diff --git a/.gitignore b/.gitignore index 6e7d108a868..b711fdcaea2 100644 --- a/.gitignore +++ b/.gitignore @@ -99,7 +99,7 @@ publish/ # NuGet Packages Directory ## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ +packages/ # Windows Azure Build Output csx diff --git a/src/Libraries/Nop.Core/Domain/Catalog/Product.cs b/src/Libraries/Nop.Core/Domain/Catalog/Product.cs index 28f40b8c6f3..ed4950a259c 100644 --- a/src/Libraries/Nop.Core/Domain/Catalog/Product.cs +++ b/src/Libraries/Nop.Core/Domain/Catalog/Product.cs @@ -1,710 +1,723 @@ -using System; -using System.Collections.Generic; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Security; -using Nop.Core.Domain.Seo; -using Nop.Core.Domain.Stores; - -namespace Nop.Core.Domain.Catalog -{ - /// - /// Represents a product - /// - public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported - { - private ICollection _productCategories; - private ICollection _productManufacturers; - private ICollection _productPictures; - private ICollection _productReviews; - private ICollection _productSpecificationAttributes; - private ICollection _productTags; - private ICollection _productAttributeMappings; - private ICollection _productAttributeCombinations; - private ICollection _tierPrices; - private ICollection _appliedDiscounts; - private ICollection _productWarehouseInventory; - - - /// - /// Gets or sets the product type identifier - /// - public int ProductTypeId { get; set; } - /// - /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products) - /// - public int ParentGroupedProductId { get; set; } - /// - /// Gets or sets the values indicating whether this product is visible in catalog or search results. - /// It's used when this product is associated to some "grouped" one - /// This way associated products could be accessed/added/etc only from a grouped product details page - /// - public bool VisibleIndividually { get; set; } - - /// - /// Gets or sets the name - /// - public string Name { get; set; } - /// - /// Gets or sets the short description - /// - public string ShortDescription { get; set; } - /// - /// Gets or sets the full description - /// - public string FullDescription { get; set; } - - /// - /// Gets or sets the admin comment - /// - public string AdminComment { get; set; } - - /// - /// Gets or sets a value of used product template identifier - /// - public int ProductTemplateId { get; set; } - - /// - /// Gets or sets a vendor identifier - /// - public int VendorId { get; set; } - - /// - /// Gets or sets a value indicating whether to show the product on home page - /// - public bool ShowOnHomePage { get; set; } - - /// - /// Gets or sets the meta keywords - /// - public string MetaKeywords { get; set; } - /// - /// Gets or sets the meta description - /// - public string MetaDescription { get; set; } - /// - /// Gets or sets the meta title - /// - public string MetaTitle { get; set; } - - /// - /// Gets or sets a value indicating whether the product allows customer reviews - /// - public bool AllowCustomerReviews { get; set; } - /// - /// Gets or sets the rating sum (approved reviews) - /// - public int ApprovedRatingSum { get; set; } - /// - /// Gets or sets the rating sum (not approved reviews) - /// - public int NotApprovedRatingSum { get; set; } - /// - /// Gets or sets the total rating votes (approved reviews) - /// - public int ApprovedTotalReviews { get; set; } - /// - /// Gets or sets the total rating votes (not approved reviews) - /// - public int NotApprovedTotalReviews { get; set; } - - /// - /// Gets or sets a value indicating whether the entity is subject to ACL - /// - public bool SubjectToAcl { get; set; } - /// - /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores - /// - public bool LimitedToStores { get; set; } - - /// - /// Gets or sets the SKU - /// - public string Sku { get; set; } - /// - /// Gets or sets the manufacturer part number - /// - public string ManufacturerPartNumber { get; set; } - /// - /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books). - /// - public string Gtin { get; set; } - - /// - /// Gets or sets a value indicating whether the product is gift card - /// - public bool IsGiftCard { get; set; } - /// - /// Gets or sets the gift card type identifier - /// - public int GiftCardTypeId { get; set; } - /// - /// Gets or sets gift card amount that can be used after purchase. If not specified, then product price will be used. - /// - public decimal? OverriddenGiftCardAmount { get; set; } - - /// - /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X requires Product Y) - /// - public bool RequireOtherProducts { get; set; } - /// - /// Gets or sets a required product identifiers (comma separated) - /// - public string RequiredProductIds { get; set; } - /// - /// Gets or sets a value indicating whether required products are automatically added to the cart - /// - public bool AutomaticallyAddRequiredProducts { get; set; } - - /// - /// Gets or sets a value indicating whether the product is download - /// - public bool IsDownload { get; set; } - /// - /// Gets or sets the download identifier - /// - public int DownloadId { get; set; } - /// - /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times - /// - public bool UnlimitedDownloads { get; set; } - /// - /// Gets or sets the maximum number of downloads - /// - public int MaxNumberOfDownloads { get; set; } - /// - /// Gets or sets the number of days during customers keeps access to the file. - /// - public int? DownloadExpirationDays { get; set; } - /// - /// Gets or sets the download activation type - /// - public int DownloadActivationTypeId { get; set; } - /// - /// Gets or sets a value indicating whether the product has a sample download file - /// - public bool HasSampleDownload { get; set; } - /// - /// Gets or sets the sample download identifier - /// - public int SampleDownloadId { get; set; } - /// - /// Gets or sets a value indicating whether the product has user agreement - /// - public bool HasUserAgreement { get; set; } - /// - /// Gets or sets the text of license agreement - /// - public string UserAgreementText { get; set; } - - /// - /// Gets or sets a value indicating whether the product is recurring - /// - public bool IsRecurring { get; set; } - /// - /// Gets or sets the cycle length - /// - public int RecurringCycleLength { get; set; } - /// - /// Gets or sets the cycle period - /// - public int RecurringCyclePeriodId { get; set; } - /// - /// Gets or sets the total cycles - /// - public int RecurringTotalCycles { get; set; } - - /// - /// Gets or sets a value indicating whether the product is rental - /// - public bool IsRental { get; set; } - /// - /// Gets or sets the rental length for some period (price for this period) - /// - public int RentalPriceLength { get; set; } - /// - /// Gets or sets the rental period (price for this period) - /// - public int RentalPricePeriodId { get; set; } - - /// - /// Gets or sets a value indicating whether the entity is ship enabled - /// - public bool IsShipEnabled { get; set; } - /// - /// Gets or sets a value indicating whether the entity is free shipping - /// - public bool IsFreeShipping { get; set; } - /// - /// Gets or sets a value this product should be shipped separately (each item) - /// - public bool ShipSeparately { get; set; } - /// - /// Gets or sets the additional shipping charge - /// - public decimal AdditionalShippingCharge { get; set; } - /// - /// Gets or sets a delivery date identifier - /// - public int DeliveryDateId { get; set; } - - /// - /// Gets or sets a value indicating whether the product is marked as tax exempt - /// - public bool IsTaxExempt { get; set; } - /// - /// Gets or sets the tax category identifier - /// - public int TaxCategoryId { get; set; } - /// - /// Gets or sets a value indicating whether the product is telecommunications or broadcasting or electronic services - /// - public bool IsTelecommunicationsOrBroadcastingOrElectronicServices { get; set; } - - /// - /// Gets or sets a value indicating how to manage inventory - /// - public int ManageInventoryMethodId { get; set; } - /// - /// Gets or sets a product availability range identifier - /// - public int ProductAvailabilityRangeId { get; set; } - /// - /// Gets or sets a value indicating whether multiple warehouses are used for this product - /// - public bool UseMultipleWarehouses { get; set; } - /// - /// Gets or sets a warehouse identifier - /// - public int WarehouseId { get; set; } - /// - /// Gets or sets the stock quantity - /// - public int StockQuantity { get; set; } - /// - /// Gets or sets a value indicating whether to display stock availability - /// - public bool DisplayStockAvailability { get; set; } - /// - /// Gets or sets a value indicating whether to display stock quantity - /// - public bool DisplayStockQuantity { get; set; } - /// - /// Gets or sets the minimum stock quantity - /// - public int MinStockQuantity { get; set; } - /// - /// Gets or sets the low stock activity identifier - /// - public int LowStockActivityId { get; set; } - /// - /// Gets or sets the quantity when admin should be notified - /// - public int NotifyAdminForQuantityBelow { get; set; } - /// - /// Gets or sets a value backorder mode identifier - /// - public int BackorderModeId { get; set; } - /// - /// Gets or sets a value indicating whether to back in stock subscriptions are allowed - /// - public bool AllowBackInStockSubscriptions { get; set; } - /// - /// Gets or sets the order minimum quantity - /// - public int OrderMinimumQuantity { get; set; } - /// - /// Gets or sets the order maximum quantity - /// - public int OrderMaximumQuantity { get; set; } - /// - /// Gets or sets the comma seperated list of allowed quantities. null or empty if any quantity is allowed - /// - public string AllowedQuantities { get; set; } - /// - /// Gets or sets a value indicating whether we allow adding to the cart/wishlist only attribute combinations that exist and have stock greater than zero. - /// This option is used only when we have "manage inventory" set to "track inventory by product attributes" - /// - public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } - /// - /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit return request with this product) - /// - public bool NotReturnable { get; set; } - - /// - /// Gets or sets a value indicating whether to disable buy (Add to cart) button - /// - public bool DisableBuyButton { get; set; } - /// - /// Gets or sets a value indicating whether to disable "Add to wishlist" button - /// - public bool DisableWishlistButton { get; set; } - /// - /// Gets or sets a value indicating whether this item is available for Pre-Order - /// - public bool AvailableForPreOrder { get; set; } - /// - /// Gets or sets the start date and time of the product availability (for pre-order products) - /// - public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } - /// - /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price - /// - public bool CallForPrice { get; set; } - /// - /// Gets or sets the price - /// - public decimal Price { get; set; } - /// - /// Gets or sets the old price - /// - public decimal OldPrice { get; set; } - /// - /// Gets or sets the product cost - /// - public decimal ProductCost { get; set; } - /// - /// Gets or sets a value indicating whether a customer enters price - /// - public bool CustomerEntersPrice { get; set; } - /// - /// Gets or sets the minimum price entered by a customer - /// - public decimal MinimumCustomerEnteredPrice { get; set; } - /// - /// Gets or sets the maximum price entered by a customer - /// - public decimal MaximumCustomerEnteredPrice { get; set; } - - /// - /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users. - /// - public bool BasepriceEnabled { get; set; } - /// - /// Gets or sets an amount in product for PAngV - /// - public decimal BasepriceAmount { get; set; } - /// - /// Gets or sets a unit of product for PAngV (MeasureWeight entity) - /// - public int BasepriceUnitId { get; set; } - /// - /// Gets or sets a reference amount for PAngV - /// - public decimal BasepriceBaseAmount { get; set; } - /// - /// Gets or sets a reference unit for PAngV (MeasureWeight entity) - /// - public int BasepriceBaseUnitId { get; set; } - - - /// - /// Gets or sets a value indicating whether this product is marked as new - /// - public bool MarkAsNew { get; set; } - /// - /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore this property - /// - public DateTime? MarkAsNewStartDateTimeUtc { get; set; } - /// - /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this property - /// - public DateTime? MarkAsNewEndDateTimeUtc { get; set; } - - /// - /// Gets or sets a value indicating whether this product has tier prices configured - /// The same as if we run this.TierPrices.Count > 0 - /// We use this property for performance optimization: - /// if this property is set to false, then we do not need to load tier prices navigation property - /// - /// - public bool HasTierPrices { get; set; } - /// - /// Gets or sets a value indicating whether this product has discounts applied - /// The same as if we run this.AppliedDiscounts.Count > 0 - /// We use this property for performance optimization: - /// if this property is set to false, then we do not need to load Applied Discounts navigation property - /// - /// - public bool HasDiscountsApplied { get; set; } - - /// - /// Gets or sets the weight - /// - public decimal Weight { get; set; } - /// - /// Gets or sets the length - /// - public decimal Length { get; set; } - /// - /// Gets or sets the width - /// - public decimal Width { get; set; } - /// - /// Gets or sets the height - /// - public decimal Height { get; set; } - - /// - /// Gets or sets the available start date and time - /// - public DateTime? AvailableStartDateTimeUtc { get; set; } - /// - /// Gets or sets the available end date and time - /// - public DateTime? AvailableEndDateTimeUtc { get; set; } - - /// - /// Gets or sets a display order. - /// This value is used when sorting associated products (used with "grouped" products) - /// This value is used when sorting home page products - /// - public int DisplayOrder { get; set; } - /// - /// Gets or sets a value indicating whether the entity is published - /// - public bool Published { get; set; } - /// - /// Gets or sets a value indicating whether the entity has been deleted - /// - public bool Deleted { get; set; } - - /// - /// Gets or sets the date and time of product creation - /// - public DateTime CreatedOnUtc { get; set; } - /// - /// Gets or sets the date and time of product update - /// - public DateTime UpdatedOnUtc { get; set; } - - - - - - - /// - /// Gets or sets the product type - /// - public ProductType ProductType - { - get - { - return (ProductType)this.ProductTypeId; - } - set - { - this.ProductTypeId = (int)value; - } - } - - /// - /// Gets or sets the backorder mode - /// - public BackorderMode BackorderMode - { - get - { - return (BackorderMode)this.BackorderModeId; - } - set - { - this.BackorderModeId = (int)value; - } - } - - /// - /// Gets or sets the download activation type - /// - public DownloadActivationType DownloadActivationType - { - get - { - return (DownloadActivationType)this.DownloadActivationTypeId; - } - set - { - this.DownloadActivationTypeId = (int)value; - } - } - - /// - /// Gets or sets the gift card type - /// - public GiftCardType GiftCardType - { - get - { - return (GiftCardType)this.GiftCardTypeId; - } - set - { - this.GiftCardTypeId = (int)value; - } - } - - /// - /// Gets or sets the low stock activity - /// - public LowStockActivity LowStockActivity - { - get - { - return (LowStockActivity)this.LowStockActivityId; - } - set - { - this.LowStockActivityId = (int)value; - } - } - - /// - /// Gets or sets the value indicating how to manage inventory - /// - public ManageInventoryMethod ManageInventoryMethod - { - get - { - return (ManageInventoryMethod)this.ManageInventoryMethodId; - } - set - { - this.ManageInventoryMethodId = (int)value; - } - } - - /// - /// Gets or sets the cycle period for recurring products - /// - public RecurringProductCyclePeriod RecurringCyclePeriod - { - get - { - return (RecurringProductCyclePeriod)this.RecurringCyclePeriodId; - } - set - { - this.RecurringCyclePeriodId = (int)value; - } - } - - /// - /// Gets or sets the period for rental products - /// - public RentalPricePeriod RentalPricePeriod - { - get - { - return (RentalPricePeriod)this.RentalPricePeriodId; - } - set - { - this.RentalPricePeriodId = (int)value; - } - } - - - - - - - /// - /// Gets or sets the collection of ProductCategory - /// - public virtual ICollection ProductCategories - { - get { return _productCategories ?? (_productCategories = new List()); } - protected set { _productCategories = value; } - } - - /// - /// Gets or sets the collection of ProductManufacturer - /// - public virtual ICollection ProductManufacturers - { - get { return _productManufacturers ?? (_productManufacturers = new List()); } - protected set { _productManufacturers = value; } - } - - /// - /// Gets or sets the collection of ProductPicture - /// - public virtual ICollection ProductPictures - { - get { return _productPictures ?? (_productPictures = new List()); } - protected set { _productPictures = value; } - } - - /// - /// Gets or sets the collection of product reviews - /// - public virtual ICollection ProductReviews - { - get { return _productReviews ?? (_productReviews = new List()); } - protected set { _productReviews = value; } - } - - /// - /// Gets or sets the product specification attribute - /// - public virtual ICollection ProductSpecificationAttributes - { - get { return _productSpecificationAttributes ?? (_productSpecificationAttributes = new List()); } - protected set { _productSpecificationAttributes = value; } - } - - /// - /// Gets or sets the product tags - /// - public virtual ICollection ProductTags - { - get { return _productTags ?? (_productTags = new List()); } - protected set { _productTags = value; } - } - - /// - /// Gets or sets the product attribute mappings - /// - public virtual ICollection ProductAttributeMappings - { - get { return _productAttributeMappings ?? (_productAttributeMappings = new List()); } - protected set { _productAttributeMappings = value; } - } - - /// - /// Gets or sets the product attribute combinations - /// - public virtual ICollection ProductAttributeCombinations - { - get { return _productAttributeCombinations ?? (_productAttributeCombinations = new List()); } - protected set { _productAttributeCombinations = value; } - } - - /// - /// Gets or sets the tier prices - /// - public virtual ICollection TierPrices - { - get { return _tierPrices ?? (_tierPrices = new List()); } - protected set { _tierPrices = value; } - } - - /// - /// Gets or sets the collection of applied discounts - /// - public virtual ICollection AppliedDiscounts - { - get { return _appliedDiscounts ?? (_appliedDiscounts = new List()); } - protected set { _appliedDiscounts = value; } - } - - /// - /// Gets or sets the collection of "ProductWarehouseInventory" records. We use it only when "UseMultipleWarehouses" is set to "true" and ManageInventoryMethod" to "ManageStock" - /// - public virtual ICollection ProductWarehouseInventory - { - get { return _productWarehouseInventory ?? (_productWarehouseInventory = new List()); } - protected set { _productWarehouseInventory = value; } - } - } +using System; +using System.Collections.Generic; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Security; +using Nop.Core.Domain.Seo; +using Nop.Core.Domain.Stores; + +namespace Nop.Core.Domain.Catalog +{ + /// + /// Represents a product + /// + public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported + { + private ICollection _productCategories; + private ICollection _productManufacturers; + private ICollection _productPictures; + private ICollection _productReviews; + private ICollection _productSpecificationAttributes; + private ICollection _productTags; + private ICollection _productAttributeMappings; + private ICollection _productAttributeCombinations; + private ICollection _tierPrices; + private ICollection _appliedDiscounts; + private ICollection _productWarehouseInventory; + + + /// + /// Gets or sets the product type identifier + /// + public int ProductTypeId { get; set; } + /// + /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products) + /// + public int ParentGroupedProductId { get; set; } + /// + /// Gets or sets the values indicating whether this product is visible in catalog or search results. + /// It's used when this product is associated to some "grouped" one + /// This way associated products could be accessed/added/etc only from a grouped product details page + /// + public bool VisibleIndividually { get; set; } + + /// + /// Gets or sets the name + /// + public string Name { get; set; } + /// + /// Gets or sets the short description + /// + public string ShortDescription { get; set; } + /// + /// Gets or sets the full description + /// + public string FullDescription { get; set; } + + /// + /// Gets or sets the admin comment + /// + public string AdminComment { get; set; } + + /// + /// Gets or sets a value of used product template identifier + /// + public int ProductTemplateId { get; set; } + + /// + /// Gets or sets a vendor identifier + /// + public int VendorId { get; set; } + + /// + /// Gets or sets a value indicating whether to show the product on home page + /// + public bool ShowOnHomePage { get; set; } + + /// + /// Gets or sets the meta keywords + /// + public string MetaKeywords { get; set; } + /// + /// Gets or sets the meta description + /// + public string MetaDescription { get; set; } + /// + /// Gets or sets the meta title + /// + public string MetaTitle { get; set; } + + /// + /// Gets or sets a value indicating whether the product allows customer reviews + /// + public bool AllowCustomerReviews { get; set; } + /// + /// Gets or sets the rating sum (approved reviews) + /// + public int ApprovedRatingSum { get; set; } + /// + /// Gets or sets the rating sum (not approved reviews) + /// + public int NotApprovedRatingSum { get; set; } + /// + /// Gets or sets the total rating votes (approved reviews) + /// + public int ApprovedTotalReviews { get; set; } + /// + /// Gets or sets the total rating votes (not approved reviews) + /// + public int NotApprovedTotalReviews { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is subject to ACL + /// + public bool SubjectToAcl { get; set; } + /// + /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores + /// + public bool LimitedToStores { get; set; } + + /// + /// Gets or sets the SKU + /// + public string Sku { get; set; } + /// + /// Gets or sets the manufacturer part number + /// + public string ManufacturerPartNumber { get; set; } + /// + /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books). + /// + public string Gtin { get; set; } + + /// + /// Gets or sets a value indicating whether the product is gift card + /// + public bool IsGiftCard { get; set; } + /// + /// Gets or sets the gift card type identifier + /// + public int GiftCardTypeId { get; set; } + /// + /// Gets or sets gift card amount that can be used after purchase. If not specified, then product price will be used. + /// + public decimal? OverriddenGiftCardAmount { get; set; } + + /// + /// Gets or sets a value indicating whether the product are reward points + /// + public bool IsRewardPoints { get; set; } + /// + /// Gets or sets a value of Reward Points exchange rate when purchased + /// + public decimal? OverriddenRPExchangeRate { get; set; } + + /// + /// Gets or sets a value indicating whether the product is excluded from reward points calculation + /// + public bool ExcludeFromRewardPoints { get; set; } + /// + /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X requires Product Y) + /// + public bool RequireOtherProducts { get; set; } + /// + /// Gets or sets a required product identifiers (comma separated) + /// + public string RequiredProductIds { get; set; } + /// + /// Gets or sets a value indicating whether required products are automatically added to the cart + /// + public bool AutomaticallyAddRequiredProducts { get; set; } + + /// + /// Gets or sets a value indicating whether the product is download + /// + public bool IsDownload { get; set; } + /// + /// Gets or sets the download identifier + /// + public int DownloadId { get; set; } + /// + /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times + /// + public bool UnlimitedDownloads { get; set; } + /// + /// Gets or sets the maximum number of downloads + /// + public int MaxNumberOfDownloads { get; set; } + /// + /// Gets or sets the number of days during customers keeps access to the file. + /// + public int? DownloadExpirationDays { get; set; } + /// + /// Gets or sets the download activation type + /// + public int DownloadActivationTypeId { get; set; } + /// + /// Gets or sets a value indicating whether the product has a sample download file + /// + public bool HasSampleDownload { get; set; } + /// + /// Gets or sets the sample download identifier + /// + public int SampleDownloadId { get; set; } + /// + /// Gets or sets a value indicating whether the product has user agreement + /// + public bool HasUserAgreement { get; set; } + /// + /// Gets or sets the text of license agreement + /// + public string UserAgreementText { get; set; } + + /// + /// Gets or sets a value indicating whether the product is recurring + /// + public bool IsRecurring { get; set; } + /// + /// Gets or sets the cycle length + /// + public int RecurringCycleLength { get; set; } + /// + /// Gets or sets the cycle period + /// + public int RecurringCyclePeriodId { get; set; } + /// + /// Gets or sets the total cycles + /// + public int RecurringTotalCycles { get; set; } + + /// + /// Gets or sets a value indicating whether the product is rental + /// + public bool IsRental { get; set; } + /// + /// Gets or sets the rental length for some period (price for this period) + /// + public int RentalPriceLength { get; set; } + /// + /// Gets or sets the rental period (price for this period) + /// + public int RentalPricePeriodId { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is ship enabled + /// + public bool IsShipEnabled { get; set; } + /// + /// Gets or sets a value indicating whether the entity is free shipping + /// + public bool IsFreeShipping { get; set; } + /// + /// Gets or sets a value this product should be shipped separately (each item) + /// + public bool ShipSeparately { get; set; } + /// + /// Gets or sets the additional shipping charge + /// + public decimal AdditionalShippingCharge { get; set; } + /// + /// Gets or sets a delivery date identifier + /// + public int DeliveryDateId { get; set; } + + /// + /// Gets or sets a value indicating whether the product is marked as tax exempt + /// + public bool IsTaxExempt { get; set; } + /// + /// Gets or sets the tax category identifier + /// + public int TaxCategoryId { get; set; } + /// + /// Gets or sets a value indicating whether the product is telecommunications or broadcasting or electronic services + /// + public bool IsTelecommunicationsOrBroadcastingOrElectronicServices { get; set; } + + /// + /// Gets or sets a value indicating how to manage inventory + /// + public int ManageInventoryMethodId { get; set; } + /// + /// Gets or sets a product availability range identifier + /// + public int ProductAvailabilityRangeId { get; set; } + /// + /// Gets or sets a value indicating whether multiple warehouses are used for this product + /// + public bool UseMultipleWarehouses { get; set; } + /// + /// Gets or sets a warehouse identifier + /// + public int WarehouseId { get; set; } + /// + /// Gets or sets the stock quantity + /// + public int StockQuantity { get; set; } + /// + /// Gets or sets a value indicating whether to display stock availability + /// + public bool DisplayStockAvailability { get; set; } + /// + /// Gets or sets a value indicating whether to display stock quantity + /// + public bool DisplayStockQuantity { get; set; } + /// + /// Gets or sets the minimum stock quantity + /// + public int MinStockQuantity { get; set; } + /// + /// Gets or sets the low stock activity identifier + /// + public int LowStockActivityId { get; set; } + /// + /// Gets or sets the quantity when admin should be notified + /// + public int NotifyAdminForQuantityBelow { get; set; } + /// + /// Gets or sets a value backorder mode identifier + /// + public int BackorderModeId { get; set; } + /// + /// Gets or sets a value indicating whether to back in stock subscriptions are allowed + /// + public bool AllowBackInStockSubscriptions { get; set; } + /// + /// Gets or sets the order minimum quantity + /// + public int OrderMinimumQuantity { get; set; } + /// + /// Gets or sets the order maximum quantity + /// + public int OrderMaximumQuantity { get; set; } + /// + /// Gets or sets the comma seperated list of allowed quantities. null or empty if any quantity is allowed + /// + public string AllowedQuantities { get; set; } + /// + /// Gets or sets a value indicating whether we allow adding to the cart/wishlist only attribute combinations that exist and have stock greater than zero. + /// This option is used only when we have "manage inventory" set to "track inventory by product attributes" + /// + public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } + /// + /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit return request with this product) + /// + public bool NotReturnable { get; set; } + + /// + /// Gets or sets a value indicating whether to disable buy (Add to cart) button + /// + public bool DisableBuyButton { get; set; } + /// + /// Gets or sets a value indicating whether to disable "Add to wishlist" button + /// + public bool DisableWishlistButton { get; set; } + /// + /// Gets or sets a value indicating whether this item is available for Pre-Order + /// + public bool AvailableForPreOrder { get; set; } + /// + /// Gets or sets the start date and time of the product availability (for pre-order products) + /// + public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } + /// + /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price + /// + public bool CallForPrice { get; set; } + /// + /// Gets or sets the price + /// + public decimal Price { get; set; } + /// + /// Gets or sets the old price + /// + public decimal OldPrice { get; set; } + /// + /// Gets or sets the product cost + /// + public decimal ProductCost { get; set; } + /// + /// Gets or sets a value indicating whether a customer enters price + /// + public bool CustomerEntersPrice { get; set; } + /// + /// Gets or sets the minimum price entered by a customer + /// + public decimal MinimumCustomerEnteredPrice { get; set; } + /// + /// Gets or sets the maximum price entered by a customer + /// + public decimal MaximumCustomerEnteredPrice { get; set; } + + /// + /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users. + /// + public bool BasepriceEnabled { get; set; } + /// + /// Gets or sets an amount in product for PAngV + /// + public decimal BasepriceAmount { get; set; } + /// + /// Gets or sets a unit of product for PAngV (MeasureWeight entity) + /// + public int BasepriceUnitId { get; set; } + /// + /// Gets or sets a reference amount for PAngV + /// + public decimal BasepriceBaseAmount { get; set; } + /// + /// Gets or sets a reference unit for PAngV (MeasureWeight entity) + /// + public int BasepriceBaseUnitId { get; set; } + + + /// + /// Gets or sets a value indicating whether this product is marked as new + /// + public bool MarkAsNew { get; set; } + /// + /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore this property + /// + public DateTime? MarkAsNewStartDateTimeUtc { get; set; } + /// + /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this property + /// + public DateTime? MarkAsNewEndDateTimeUtc { get; set; } + + /// + /// Gets or sets a value indicating whether this product has tier prices configured + /// The same as if we run this.TierPrices.Count > 0 + /// We use this property for performance optimization: + /// if this property is set to false, then we do not need to load tier prices navigation property + /// + /// + public bool HasTierPrices { get; set; } + /// + /// Gets or sets a value indicating whether this product has discounts applied + /// The same as if we run this.AppliedDiscounts.Count > 0 + /// We use this property for performance optimization: + /// if this property is set to false, then we do not need to load Applied Discounts navigation property + /// + /// + public bool HasDiscountsApplied { get; set; } + + /// + /// Gets or sets the weight + /// + public decimal Weight { get; set; } + /// + /// Gets or sets the length + /// + public decimal Length { get; set; } + /// + /// Gets or sets the width + /// + public decimal Width { get; set; } + /// + /// Gets or sets the height + /// + public decimal Height { get; set; } + + /// + /// Gets or sets the available start date and time + /// + public DateTime? AvailableStartDateTimeUtc { get; set; } + /// + /// Gets or sets the available end date and time + /// + public DateTime? AvailableEndDateTimeUtc { get; set; } + + /// + /// Gets or sets a display order. + /// This value is used when sorting associated products (used with "grouped" products) + /// This value is used when sorting home page products + /// + public int DisplayOrder { get; set; } + /// + /// Gets or sets a value indicating whether the entity is published + /// + public bool Published { get; set; } + /// + /// Gets or sets a value indicating whether the entity has been deleted + /// + public bool Deleted { get; set; } + + /// + /// Gets or sets the date and time of product creation + /// + public DateTime CreatedOnUtc { get; set; } + /// + /// Gets or sets the date and time of product update + /// + public DateTime UpdatedOnUtc { get; set; } + + + + + + + /// + /// Gets or sets the product type + /// + public ProductType ProductType + { + get + { + return (ProductType)this.ProductTypeId; + } + set + { + this.ProductTypeId = (int)value; + } + } + + /// + /// Gets or sets the backorder mode + /// + public BackorderMode BackorderMode + { + get + { + return (BackorderMode)this.BackorderModeId; + } + set + { + this.BackorderModeId = (int)value; + } + } + + /// + /// Gets or sets the download activation type + /// + public DownloadActivationType DownloadActivationType + { + get + { + return (DownloadActivationType)this.DownloadActivationTypeId; + } + set + { + this.DownloadActivationTypeId = (int)value; + } + } + + /// + /// Gets or sets the gift card type + /// + public GiftCardType GiftCardType + { + get + { + return (GiftCardType)this.GiftCardTypeId; + } + set + { + this.GiftCardTypeId = (int)value; + } + } + + /// + /// Gets or sets the low stock activity + /// + public LowStockActivity LowStockActivity + { + get + { + return (LowStockActivity)this.LowStockActivityId; + } + set + { + this.LowStockActivityId = (int)value; + } + } + + /// + /// Gets or sets the value indicating how to manage inventory + /// + public ManageInventoryMethod ManageInventoryMethod + { + get + { + return (ManageInventoryMethod)this.ManageInventoryMethodId; + } + set + { + this.ManageInventoryMethodId = (int)value; + } + } + + /// + /// Gets or sets the cycle period for recurring products + /// + public RecurringProductCyclePeriod RecurringCyclePeriod + { + get + { + return (RecurringProductCyclePeriod)this.RecurringCyclePeriodId; + } + set + { + this.RecurringCyclePeriodId = (int)value; + } + } + + /// + /// Gets or sets the period for rental products + /// + public RentalPricePeriod RentalPricePeriod + { + get + { + return (RentalPricePeriod)this.RentalPricePeriodId; + } + set + { + this.RentalPricePeriodId = (int)value; + } + } + + + + + + + /// + /// Gets or sets the collection of ProductCategory + /// + public virtual ICollection ProductCategories + { + get { return _productCategories ?? (_productCategories = new List()); } + protected set { _productCategories = value; } + } + + /// + /// Gets or sets the collection of ProductManufacturer + /// + public virtual ICollection ProductManufacturers + { + get { return _productManufacturers ?? (_productManufacturers = new List()); } + protected set { _productManufacturers = value; } + } + + /// + /// Gets or sets the collection of ProductPicture + /// + public virtual ICollection ProductPictures + { + get { return _productPictures ?? (_productPictures = new List()); } + protected set { _productPictures = value; } + } + + /// + /// Gets or sets the collection of product reviews + /// + public virtual ICollection ProductReviews + { + get { return _productReviews ?? (_productReviews = new List()); } + protected set { _productReviews = value; } + } + + /// + /// Gets or sets the product specification attribute + /// + public virtual ICollection ProductSpecificationAttributes + { + get { return _productSpecificationAttributes ?? (_productSpecificationAttributes = new List()); } + protected set { _productSpecificationAttributes = value; } + } + + /// + /// Gets or sets the product tags + /// + public virtual ICollection ProductTags + { + get { return _productTags ?? (_productTags = new List()); } + protected set { _productTags = value; } + } + + /// + /// Gets or sets the product attribute mappings + /// + public virtual ICollection ProductAttributeMappings + { + get { return _productAttributeMappings ?? (_productAttributeMappings = new List()); } + protected set { _productAttributeMappings = value; } + } + + /// + /// Gets or sets the product attribute combinations + /// + public virtual ICollection ProductAttributeCombinations + { + get { return _productAttributeCombinations ?? (_productAttributeCombinations = new List()); } + protected set { _productAttributeCombinations = value; } + } + + /// + /// Gets or sets the tier prices + /// + public virtual ICollection TierPrices + { + get { return _tierPrices ?? (_tierPrices = new List()); } + protected set { _tierPrices = value; } + } + + /// + /// Gets or sets the collection of applied discounts + /// + public virtual ICollection AppliedDiscounts + { + get { return _appliedDiscounts ?? (_appliedDiscounts = new List()); } + protected set { _appliedDiscounts = value; } + } + + /// + /// Gets or sets the collection of "ProductWarehouseInventory" records. We use it only when "UseMultipleWarehouses" is set to "true" and ManageInventoryMethod" to "ManageStock" + /// + public virtual ICollection ProductWarehouseInventory + { + get { return _productWarehouseInventory ?? (_productWarehouseInventory = new List()); } + protected set { _productWarehouseInventory = value; } + } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Core/Domain/Catalog/ProductEditorSettings.cs b/src/Libraries/Nop.Core/Domain/Catalog/ProductEditorSettings.cs index 4a947873850..3967630f131 100644 --- a/src/Libraries/Nop.Core/Domain/Catalog/ProductEditorSettings.cs +++ b/src/Libraries/Nop.Core/Domain/Catalog/ProductEditorSettings.cs @@ -135,9 +135,14 @@ public class ProductEditorSettings : ISettings /// public bool IsGiftCard { get; set; } + /// + /// Gets or sets a value indicating whether 'reward points' section is shown + /// + public bool IsRewardPoints { get; set; } /// /// Gets or sets a value indicating whether 'Downloadable product' field is shown /// + public bool DownloadableProduct { get; set; } /// diff --git a/src/Libraries/Nop.Core/Domain/Customers/RewardPointsHistory.cs b/src/Libraries/Nop.Core/Domain/Customers/RewardPointsHistory.cs index d8ffd332d95..a9c815b1791 100644 --- a/src/Libraries/Nop.Core/Domain/Customers/RewardPointsHistory.cs +++ b/src/Libraries/Nop.Core/Domain/Customers/RewardPointsHistory.cs @@ -1,56 +1,73 @@ -using System; -using Nop.Core.Domain.Orders; - -namespace Nop.Core.Domain.Customers -{ - /// - /// Represents a reward point history entry - /// - public partial class RewardPointsHistory : BaseEntity - { - /// - /// Gets or sets the customer identifier - /// - public int CustomerId { get; set; } - - /// - /// Gets or sets the store identifier in which these reward points were awarded or redeemed - /// - public int StoreId { get; set; } - - /// - /// Gets or sets the points redeemed/added - /// - public int Points { get; set; } - - /// - /// Gets or sets the points balance - /// - public int? PointsBalance { get; set; } - - /// - /// Gets or sets the used amount - /// - public decimal UsedAmount { get; set; } - - /// - /// Gets or sets the message - /// - public string Message { get; set; } - - /// - /// Gets or sets the date and time of instance creation - /// - public DateTime CreatedOnUtc { get; set; } - - /// - /// Gets or sets the order for which points were redeemed as a payment (spent by a customer when placing this order) - /// - public virtual Order UsedWithOrder { get; set; } - - /// - /// Gets or sets the customer - /// - public virtual Customer Customer { get; set; } - } -} +using System; +using Nop.Core.Domain.Orders; + +namespace Nop.Core.Domain.Customers +{ + /// + /// Represents a reward point history entry + /// + public partial class RewardPointsHistory : BaseEntity + { + /// + /// Gets or sets the customer identifier + /// + public int CustomerId { get; set; } + + /// + /// Gets or sets the store identifier in which these reward points were awarded or redeemed + /// + public int StoreId { get; set; } + + /// + /// Gets or sets the points redeemed/added + /// + public int Points { get; set; } + /// + /// Gets or sets the purchased points redeemed/added + /// + public int PointsPurchased { get; set; } + /// + /// Gets or sets the points balance + /// + public int? PointsBalance { get; set; } + /// + /// Gets or sets the purchased points balance + /// + public int? PointsBalancePurchased { get; set; } + /// + /// Gets or sets the used amount. Opposite sign as respective points! + /// + public decimal UsedAmount { get; set; } + /// + /// Gets or sets the used purchased amount. Opposite sign as respective points! + /// + public decimal UsedAmountPurchased { get; set; } + /// + /// Gets or sets the message + /// + public string Message { get; set; } + + /// + /// Gets or sets the date and time of instance creation + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the order for which points were redeemed as a payment (spent by a customer when placing this order) + /// + public virtual Order UsedWithOrder { get; set; } + + /// + /// Gets or sets the customer + /// + public virtual Customer Customer { get; set; } + /// + /// Gets or sets the associated order item identifier + /// + public int? PurchasedWithOrderItemId { get; set; } + /// + /// Gets or sets the associated order item + /// + public virtual OrderItem PurchasedWithOrderItem { get; set; } + } +} diff --git a/src/Libraries/Nop.Core/Domain/Customers/RewardPointsSettings.cs b/src/Libraries/Nop.Core/Domain/Customers/RewardPointsSettings.cs index e84e087ba8f..f2cdc1ccfc9 100644 --- a/src/Libraries/Nop.Core/Domain/Customers/RewardPointsSettings.cs +++ b/src/Libraries/Nop.Core/Domain/Customers/RewardPointsSettings.cs @@ -1,62 +1,88 @@ -using Nop.Core.Configuration; - -namespace Nop.Core.Domain.Customers -{ - public class RewardPointsSettings : ISettings - { - /// - /// Gets or sets a value indicating whether Reward Points Program is enabled - /// - public bool Enabled { get; set; } - - /// - /// Gets or sets a value of Reward Points exchange rate - /// - public decimal ExchangeRate { get; set; } - - /// - /// Gets or sets the minimum reward points to use - /// - public int MinimumRewardPointsToUse { get; set; } - - /// - /// Gets or sets a number of points awarded for registration - /// - public int PointsForRegistration { get; set; } - - /// - /// Gets or sets a number of points awarded for purchases (amount in primary store currency) - /// - public decimal PointsForPurchases_Amount { get; set; } - - /// - /// Gets or sets a number of points awarded for purchases - /// - public int PointsForPurchases_Points { get; set; } - - /// - /// Gets or sets a delay before activation points - /// - public int ActivationDelay { get; set; } - - /// - /// Gets or sets the period of activation delay - /// - public int ActivationDelayPeriodId { get; set; } - - /// - /// Gets or sets a value indicating whether "You will earn" message should be displayed - /// - public bool DisplayHowMuchWillBeEarned { get; set; } - - /// - /// Gets or sets a value indicating whether all reward points are accumulated in one balance for all stores and they can be used in any store. Otherwise, each store has its own rewards points and they can only be used in that store. - /// - public bool PointsAccumulatedForAllStores { get; set; } - - /// - /// Gets or sets the page size is for history of reward points on my account page - /// - public int PageSize { get; set; } - } +using Nop.Core.Configuration; + +namespace Nop.Core.Domain.Customers +{ + public class RewardPointsSettings : ISettings + { + /// + /// Gets or sets a value indicating whether Reward Points Program is enabled + /// + public bool Enabled { get; set; } + + /// + /// Gets or sets a value of Reward Points exchange rate + /// + public decimal ExchangeRate { get; set; } + + /// + /// Gets or sets the minimum reward points to use + /// + public int MinimumRewardPointsToUse { get; set; } + + /// + /// Gets or sets a number of points awarded for registration + /// + public int PointsForRegistration { get; set; } + + /// + /// Gets or sets a number of points awarded for purchases (amount in primary store currency) + /// + public decimal PointsForPurchases_Amount { get; set; } + + /// + /// Gets or sets a number of points awarded for purchases + /// + public int PointsForPurchases_Points { get; set; } + + /// + /// Gets or sets a delay before activation points + /// + public int ActivationDelay { get; set; } + + /// + /// Gets or sets the period of activation delay + /// + public int ActivationDelayPeriodId { get; set; } + + /// + /// Gets or sets a value indicating whether "You will earn" message should be displayed + /// + public bool DisplayHowMuchWillBeEarned { get; set; } + + /// + /// Gets or sets a value indicating whether all reward points are accumulated in one balance for all stores and they can be used in any store. Otherwise, each store has its own rewards points and they can only be used in that store. + /// + public bool PointsAccumulatedForAllStores { get; set; } + + /// + /// Gets or sets the page size is for history of reward points on my account page + /// + public int PageSize { get; set; } + + /// + /// Gets or sets a value indicating whether earned reward points are taxable + /// + public bool EarnedRewardPointsAreTaxable { get; set; } + /// + /// Gets or sets a value indicating whether reward points can be earned on shipping + /// + public bool AwardPointsIncludeShipping { get; set; } + /// + /// Gets or sets a value indicating whether reward points can be earned on payment fee + /// + public bool AwardPointsIncludePaymentMethodAdditionalFee { get; set; } + /// + /// Gets or sets a value indicating whether giftcards applied to payment amount should be excluded for reward points calculation + /// + public bool AwardPointsExcludeGiftCard { get; set; } + /// + /// Gets or sets a value indicating whether purchased reward points applied to payment amount should be excluded for reward points calculation + /// + public bool AwardPointsExcludePurchasedRewardPoints { get; set; } + /// + /// Gets or sets a value indicating whether reward points can only be earned when using purchased reward points for payment + /// + public bool EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints { get; set; } + + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Core/Domain/Orders/Order.cs b/src/Libraries/Nop.Core/Domain/Orders/Order.cs index 5566caf5a09..793b025e86a 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/Order.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/Order.cs @@ -1,494 +1,582 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; - -namespace Nop.Core.Domain.Orders -{ - /// - /// Represents an order - /// - public partial class Order : BaseEntity - { - - private ICollection _discountUsageHistory; - private ICollection _giftCardUsageHistory; - private ICollection _orderNotes; - private ICollection _orderItems; - private ICollection _shipments; - - #region Utilities - - protected virtual SortedDictionary ParseTaxRates(string taxRatesStr) - { - var taxRatesDictionary = new SortedDictionary(); - if (String.IsNullOrEmpty(taxRatesStr)) - return taxRatesDictionary; - - string[] lines = taxRatesStr.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries); - foreach (string line in lines) - { - if (String.IsNullOrEmpty(line.Trim())) - continue; - - string[] taxes = line.Split(new [] { ':' }); - if (taxes.Length == 2) - { - try - { - decimal taxRate = decimal.Parse(taxes[0].Trim(), CultureInfo.InvariantCulture); - decimal taxValue = decimal.Parse(taxes[1].Trim(), CultureInfo.InvariantCulture); - taxRatesDictionary.Add(taxRate, taxValue); - } - catch (Exception exc) - { - Debug.WriteLine(exc.ToString()); - } - } - } - - //add at least one tax rate (0%) - if (!taxRatesDictionary.Any()) - taxRatesDictionary.Add(decimal.Zero, decimal.Zero); - - return taxRatesDictionary; - } - - #endregion - - #region Properties - - /// - /// Gets or sets the order identifier - /// - public Guid OrderGuid { get; set; } - - /// - /// Gets or sets the store identifier - /// - public int StoreId { get; set; } - - /// - /// Gets or sets the customer identifier - /// - public int CustomerId { get; set; } - - /// - /// Gets or sets the billing address identifier - /// - public int BillingAddressId { get; set; } - - /// - /// Gets or sets the shipping address identifier - /// - public int? ShippingAddressId { get; set; } - - /// - /// Gets or sets the pickup address identifier - /// - public int? PickupAddressId { get; set; } - - /// - /// Gets or sets a value indicating whether a customer chose "pick up in store" shipping option - /// - public bool PickUpInStore { get; set; } - - /// - /// Gets or sets an order status identifier - /// - public int OrderStatusId { get; set; } - - /// - /// Gets or sets the shipping status identifier - /// - public int ShippingStatusId { get; set; } - - /// - /// Gets or sets the payment status identifier - /// - public int PaymentStatusId { get; set; } - - /// - /// Gets or sets the payment method system name - /// - public string PaymentMethodSystemName { get; set; } - - /// - /// Gets or sets the customer currency code (at the moment of order placing) - /// - public string CustomerCurrencyCode { get; set; } - - /// - /// Gets or sets the currency rate - /// - public decimal CurrencyRate { get; set; } - - /// - /// Gets or sets the customer tax display type identifier - /// - public int CustomerTaxDisplayTypeId { get; set; } - - /// - /// Gets or sets the VAT number (the European Union Value Added Tax) - /// - public string VatNumber { get; set; } - - /// - /// Gets or sets the order subtotal (incl tax) - /// - public decimal OrderSubtotalInclTax { get; set; } - - /// - /// Gets or sets the order subtotal (excl tax) - /// - public decimal OrderSubtotalExclTax { get; set; } - - /// - /// Gets or sets the order subtotal discount (incl tax) - /// - public decimal OrderSubTotalDiscountInclTax { get; set; } - - /// - /// Gets or sets the order subtotal discount (excl tax) - /// - public decimal OrderSubTotalDiscountExclTax { get; set; } - - /// - /// Gets or sets the order shipping (incl tax) - /// - public decimal OrderShippingInclTax { get; set; } - - /// - /// Gets or sets the order shipping (excl tax) - /// - public decimal OrderShippingExclTax { get; set; } - - /// - /// Gets or sets the payment method additional fee (incl tax) - /// - public decimal PaymentMethodAdditionalFeeInclTax { get; set; } - - /// - /// Gets or sets the payment method additional fee (excl tax) - /// - public decimal PaymentMethodAdditionalFeeExclTax { get; set; } - - /// - /// Gets or sets the tax rates - /// - public string TaxRates { get; set; } - - /// - /// Gets or sets the order tax - /// - public decimal OrderTax { get; set; } - - /// - /// Gets or sets the order discount (applied to order total) - /// - public decimal OrderDiscount { get; set; } - - /// - /// Gets or sets the order total - /// - public decimal OrderTotal { get; set; } - - /// - /// Gets or sets the refunded amount - /// - public decimal RefundedAmount { get; set; } - - /// - /// Gets or sets the reward points history entry identifier when reward points were earned (gained) for placing this order - /// - public int? RewardPointsHistoryEntryId { get; set; } - - /// - /// Gets or sets the checkout attribute description - /// - public string CheckoutAttributeDescription { get; set; } - - /// - /// Gets or sets the checkout attributes in XML format - /// - public string CheckoutAttributesXml { get; set; } - - /// - /// Gets or sets the customer language identifier - /// - public int CustomerLanguageId { get; set; } - - /// - /// Gets or sets the affiliate identifier - /// - public int AffiliateId { get; set; } - - /// - /// Gets or sets the customer IP address - /// - public string CustomerIp { get; set; } - - /// - /// Gets or sets a value indicating whether storing of credit card number is allowed - /// - public bool AllowStoringCreditCardNumber { get; set; } - - /// - /// Gets or sets the card type - /// - public string CardType { get; set; } - - /// - /// Gets or sets the card name - /// - public string CardName { get; set; } - - /// - /// Gets or sets the card number - /// - public string CardNumber { get; set; } - - /// - /// Gets or sets the masked credit card number - /// - public string MaskedCreditCardNumber { get; set; } - - /// - /// Gets or sets the card CVV2 - /// - public string CardCvv2 { get; set; } - - /// - /// Gets or sets the card expiration month - /// - public string CardExpirationMonth { get; set; } - - /// - /// Gets or sets the card expiration year - /// - public string CardExpirationYear { get; set; } - - /// - /// Gets or sets the authorization transaction identifier - /// - public string AuthorizationTransactionId { get; set; } - - /// - /// Gets or sets the authorization transaction code - /// - public string AuthorizationTransactionCode { get; set; } - - /// - /// Gets or sets the authorization transaction result - /// - public string AuthorizationTransactionResult { get; set; } - - /// - /// Gets or sets the capture transaction identifier - /// - public string CaptureTransactionId { get; set; } - - /// - /// Gets or sets the capture transaction result - /// - public string CaptureTransactionResult { get; set; } - - /// - /// Gets or sets the subscription transaction identifier - /// - public string SubscriptionTransactionId { get; set; } - - /// - /// Gets or sets the paid date and time - /// - public DateTime? PaidDateUtc { get; set; } - - /// - /// Gets or sets the shipping method - /// - public string ShippingMethod { get; set; } - - /// - /// Gets or sets the shipping rate computation method identifier or the pickup point provider identifier (if PickUpInStore is true) - /// - public string ShippingRateComputationMethodSystemName { get; set; } - - /// - /// Gets or sets the serialized CustomValues (values from ProcessPaymentRequest) - /// - public string CustomValuesXml { get; set; } - - /// - /// Gets or sets a value indicating whether the entity has been deleted - /// - public bool Deleted { get; set; } - - /// - /// Gets or sets the date and time of order creation - /// - public DateTime CreatedOnUtc { get; set; } - - /// - /// Gets or sets the custom order number without prefix - /// - public string CustomOrderNumber { get; set; } - - #endregion - - #region Navigation properties - - /// - /// Gets or sets the customer - /// - public virtual Customer Customer { get; set; } - - /// - /// Gets or sets the billing address - /// - public virtual Address BillingAddress { get; set; } - - /// - /// Gets or sets the shipping address - /// - public virtual Address ShippingAddress { get; set; } - - /// - /// Gets or sets the pickup address - /// - public virtual Address PickupAddress { get; set; } - - /// - /// Gets or sets the reward points history record (spent by a customer when placing this order) - /// - public virtual RewardPointsHistory RedeemedRewardPointsEntry { get; set; } - - /// - /// Gets or sets discount usage history - /// - public virtual ICollection DiscountUsageHistory - { - get { return _discountUsageHistory ?? (_discountUsageHistory = new List()); } - protected set { _discountUsageHistory = value; } - } - - /// - /// Gets or sets gift card usage history (gift card that were used with this order) - /// - public virtual ICollection GiftCardUsageHistory - { - get { return _giftCardUsageHistory ?? (_giftCardUsageHistory = new List()); } - protected set { _giftCardUsageHistory = value; } - } - - /// - /// Gets or sets order notes - /// - public virtual ICollection OrderNotes - { - get { return _orderNotes ?? (_orderNotes = new List()); } - protected set { _orderNotes = value; } - } - - /// - /// Gets or sets order items - /// - public virtual ICollection OrderItems - { - get { return _orderItems ?? (_orderItems = new List()); } - protected set { _orderItems = value; } - } - - /// - /// Gets or sets shipments - /// - public virtual ICollection Shipments - { - get { return _shipments ?? (_shipments = new List()); } - protected set { _shipments = value; } - } - - #endregion - - #region Custom properties - - /// - /// Gets or sets the order status - /// - public OrderStatus OrderStatus - { - get - { - return (OrderStatus)this.OrderStatusId; - } - set - { - this.OrderStatusId = (int)value; - } - } - - /// - /// Gets or sets the payment status - /// - public PaymentStatus PaymentStatus - { - get - { - return (PaymentStatus)this.PaymentStatusId; - } - set - { - this.PaymentStatusId = (int)value; - } - } - - /// - /// Gets or sets the shipping status - /// - public ShippingStatus ShippingStatus - { - get - { - return (ShippingStatus)this.ShippingStatusId; - } - set - { - this.ShippingStatusId = (int)value; - } - } - - /// - /// Gets or sets the customer tax display type - /// - public TaxDisplayType CustomerTaxDisplayType - { - get - { - return (TaxDisplayType)this.CustomerTaxDisplayTypeId; - } - set - { - this.CustomerTaxDisplayTypeId = (int)value; - } - } - - /// - /// Gets the applied tax rates - /// - public SortedDictionary TaxRatesDictionary - { - get - { - return ParseTaxRates(this.TaxRates); - } - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Linq; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; + +namespace Nop.Core.Domain.Orders +{ + /// + /// Represents an order + /// + public partial class Order : BaseEntity + { + + private ICollection _discountUsageHistory; + private ICollection _giftCardUsageHistory; + private ICollection _orderNotes; + private ICollection _orderItems; + private ICollection _shipments; + + #region Utilities + + /// + /// Parses order.TaxRates string + /// + /// + /// Returns the sorted dictionary of taxrateEntries + protected virtual SortedDictionary ParseTaxRates(string taxRatesStr) + { + var taxRatesDictionary = new SortedDictionary(); + if (String.IsNullOrEmpty(taxRatesStr)) + return taxRatesDictionary; + + string[] lines = taxRatesStr.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + foreach (string line in lines) + { + if (String.IsNullOrEmpty(line.Trim())) + continue; + + string[] taxes = line.Split(new[] { ':' }); + if (taxes.Length == 6) + { + try + { + decimal rate = decimal.Parse(taxes[0].Trim(), CultureInfo.InvariantCulture); + taxRatesDictionary.Add(rate, new TaxRateRec() + { + TaxRate = rate, + Amount = decimal.Parse(taxes[1].Trim(), CultureInfo.InvariantCulture), + DiscountAmount = decimal.Parse(taxes[2].Trim(), CultureInfo.InvariantCulture), + BaseAmount = decimal.Parse(taxes[3].Trim(), CultureInfo.InvariantCulture), + TaxAmount = decimal.Parse(taxes[4].Trim(), CultureInfo.InvariantCulture), + AmountIncludingTax = decimal.Parse(taxes[5].Trim(), CultureInfo.InvariantCulture) + }); + } + catch (Exception exc) + { + Debug.WriteLine(exc.ToString()); + } + } + } + + //add at least one tax rate (0%) + if (!taxRatesDictionary.Any()) + taxRatesDictionary.Add(decimal.Zero, new TaxRateRec() + { + TaxRate = decimal.Zero, + Amount = decimal.Zero, + DiscountAmount = decimal.Zero, + BaseAmount = decimal.Zero, + TaxAmount = decimal.Zero, + AmountIncludingTax = decimal.Zero + }); + + return taxRatesDictionary; + } + + #endregion + + #region Properties + + /// + /// Gets or sets the order identifier + /// + public Guid OrderGuid { get; set; } + + /// + /// Gets or sets the store identifier + /// + public int StoreId { get; set; } + + /// + /// Gets or sets the customer identifier + /// + public int CustomerId { get; set; } + + /// + /// Gets or sets the billing address identifier + /// + public int BillingAddressId { get; set; } + + /// + /// Gets or sets the shipping address identifier + /// + public int? ShippingAddressId { get; set; } + + /// + /// Gets or sets the pickup address identifier + /// + public int? PickupAddressId { get; set; } + + /// + /// Gets or sets a value indicating whether a customer chose "pick up in store" shipping option + /// + public bool PickUpInStore { get; set; } + + /// + /// Gets or sets an order status identifier + /// + public int OrderStatusId { get; set; } + + /// + /// Gets or sets the shipping status identifier + /// + public int ShippingStatusId { get; set; } + + /// + /// Gets or sets the payment status identifier + /// + public int PaymentStatusId { get; set; } + + /// + /// Gets or sets the payment method system name + /// + public string PaymentMethodSystemName { get; set; } + + /// + /// Gets or sets the customer currency code (at the moment of order placing) + /// + public string CustomerCurrencyCode { get; set; } + + /// + /// Gets or sets the currency rate + /// + public decimal CurrencyRate { get; set; } + + /// + /// Gets or sets the customer tax display type identifier + /// + public int CustomerTaxDisplayTypeId { get; set; } + + /// + /// Gets or sets the VAT number (the European Union Value Added Tax) + /// + public string VatNumber { get; set; } + + /// + /// Gets or sets the order subtotal (incl tax) + /// + public decimal OrderSubtotalInclTax { get; set; } + + /// + /// Gets or sets the order subtotal (excl tax) + /// + public decimal OrderSubtotalExclTax { get; set; } + + /// + /// Gets or sets the order subtotal discount (incl tax) + /// + public decimal OrderSubTotalDiscountInclTax { get; set; } + + /// + /// Gets or sets the order subtotal discount (excl tax) + /// + public decimal OrderSubTotalDiscountExclTax { get; set; } + + /// + /// Gets or sets the order shipping (incl tax) + /// + /// + public decimal OrderShippingInclTax { get; set; } + /// + /// Gets or sets the order shipping (excl tax) + /// + /// + public decimal OrderShippingExclTax { get; set; } + + /// Gets or sets the order shipping (non taxable) + /// + public decimal OrderShippingNonTaxable { get; set; } + + /// + /// Gets or sets the payment method additional fee (incl tax) + /// + public decimal PaymentMethodAdditionalFeeInclTax { get; set; } + + /// + /// Gets or sets the payment method additional fee (excl tax) + /// + public decimal PaymentMethodAdditionalFeeExclTax { get; set; } + + /// + /// Gets or sets the payment method additional fee (non taxable) + /// + public decimal PaymentMethodAdditionalFeeNonTaxable { get; set; } + /// + /// Gets or sets the tax rates + /// + public string TaxRates { get; set; } + + /// + /// Gets or sets the order tax + /// + public decimal OrderTax { get; set; } + + /// + /// Gets or sets the order discount (applied to order total) + /// + public decimal OrderDiscount { get; set; } + + /// + /// Gets or sets the order total to pay + /// + public decimal OrderTotal { get; set; } + + /// + /// Gets or sets the refunded amount + /// + public decimal RefundedAmount { get; set; } + + /// + /// Gets or sets the reward points history entry identifier when reward points were earned (gained) for placing this order + /// + public int? RewardPointsHistoryEntryId { get; set; } + + /// + /// Gets or sets the checkout attribute description + /// + public string CheckoutAttributeDescription { get; set; } + + /// + /// Gets or sets the checkout attributes in XML format + /// + public string CheckoutAttributesXml { get; set; } + + /// + /// Gets or sets the customer language identifier + /// + public int CustomerLanguageId { get; set; } + + /// + /// Gets or sets the affiliate identifier + /// + public int AffiliateId { get; set; } + + /// + /// Gets or sets the customer IP address + /// + public string CustomerIp { get; set; } + + /// + /// Gets or sets a value indicating whether storing of credit card number is allowed + /// + public bool AllowStoringCreditCardNumber { get; set; } + + /// + /// Gets or sets the card type + /// + public string CardType { get; set; } + + /// + /// Gets or sets the card name + /// + public string CardName { get; set; } + + /// + /// Gets or sets the card number + /// + public string CardNumber { get; set; } + + /// + /// Gets or sets the masked credit card number + /// + public string MaskedCreditCardNumber { get; set; } + + /// + /// Gets or sets the card CVV2 + /// + public string CardCvv2 { get; set; } + + /// + /// Gets or sets the card expiration month + /// + public string CardExpirationMonth { get; set; } + + /// + /// Gets or sets the card expiration year + /// + public string CardExpirationYear { get; set; } + + /// + /// Gets or sets the authorization transaction identifier + /// + public string AuthorizationTransactionId { get; set; } + + /// + /// Gets or sets the authorization transaction code + /// + public string AuthorizationTransactionCode { get; set; } + + /// + /// Gets or sets the authorization transaction result + /// + public string AuthorizationTransactionResult { get; set; } + + /// + /// Gets or sets the capture transaction identifier + /// + public string CaptureTransactionId { get; set; } + + /// + /// Gets or sets the capture transaction result + /// + public string CaptureTransactionResult { get; set; } + + /// + /// Gets or sets the subscription transaction identifier + /// + public string SubscriptionTransactionId { get; set; } + + /// + /// Gets or sets the paid date and time + /// + public DateTime? PaidDateUtc { get; set; } + + /// + /// Gets or sets the shipping method + /// + public string ShippingMethod { get; set; } + + /// + /// Gets or sets the shipping rate computation method identifier or the pickup point provider identifier (if PickUpInStore is true) + /// + public string ShippingRateComputationMethodSystemName { get; set; } + + /// + /// Gets or sets the serialized CustomValues (values from ProcessPaymentRequest) + /// + public string CustomValuesXml { get; set; } + + /// + /// Gets or sets a value indicating whether the entity has been deleted + /// + public bool Deleted { get; set; } + + /// + /// Gets or sets the date and time of order creation + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the invoice ID + /// + public string InvoiceId { get; set; } + /// + /// Gets or sets the invoice date UTC + /// + public DateTime? InvoiceDateUtc { get; set; } + + /// + /// Gets or sets the order total base amount excl. tax + /// + public decimal OrderAmount { get; set; } //MF 09.12.16 + + /// + /// Gets or sets the order total amount incl. tax + /// + public decimal OrderAmountIncl { get; set; } //MF 09.12.16 + /// + /// Gets or sets the order total discount amount incl. tax + /// + public decimal OrderDiscountIncl { get; set; } + /// + /// Gets or sets the order total earned reward points base amount incl. tax + /// + public decimal EarnedRewardPointsBaseAmountIncl { get; set; } + /// + /// Gets or sets the order total earned reward points base amount excl. tax + /// + public decimal EarnedRewardPointsBaseAmountExcl { get; set; } + /// + /// Gets or sets a value indicating if redeemed reward points are taxable + /// + public bool RewardPointsTaxable { get; set; } + /// + /// Gets or sets the custom order number without prefix + /// + public string CustomOrderNumber { get; set; } + /// + + + #endregion + + #region Navigation properties + + /// + /// Gets or sets the customer + /// + public virtual Customer Customer { get; set; } + + /// + /// Gets or sets the billing address + /// + public virtual Address BillingAddress { get; set; } + + /// + /// Gets or sets the shipping address + /// + public virtual Address ShippingAddress { get; set; } + + /// + /// Gets or sets the pickup address + /// + public virtual Address PickupAddress { get; set; } + + /// + /// Gets or sets the reward points history record (spent by a customer when placing this order) + /// + public virtual RewardPointsHistory RedeemedRewardPointsEntry { get; set; } + + /// + /// Gets or sets discount usage history + /// + public virtual ICollection DiscountUsageHistory + { + get { return _discountUsageHistory ?? (_discountUsageHistory = new List()); } + protected set { _discountUsageHistory = value; } + } + + /// + /// Gets or sets gift card usage history (gift card that were used with this order) + /// + public virtual ICollection GiftCardUsageHistory + { + get { return _giftCardUsageHistory ?? (_giftCardUsageHistory = new List()); } + protected set { _giftCardUsageHistory = value; } + } + + /// + /// Gets or sets order notes + /// + public virtual ICollection OrderNotes + { + get { return _orderNotes ?? (_orderNotes = new List()); } + protected set { _orderNotes = value; } + } + + /// + /// Gets or sets order items + /// + public virtual ICollection OrderItems + { + get { return _orderItems ?? (_orderItems = new List()); } + protected set { _orderItems = value; } + } + + /// + /// Gets or sets shipments + /// + public virtual ICollection Shipments + { + get { return _shipments ?? (_shipments = new List()); } + protected set { _shipments = value; } + } + + #endregion + + #region Custom properties + + /// + /// Gets or sets the order status + /// + public OrderStatus OrderStatus + { + get + { + return (OrderStatus)this.OrderStatusId; + } + set + { + this.OrderStatusId = (int)value; + } + } + + /// + /// Gets or sets the payment status + /// + public PaymentStatus PaymentStatus + { + get + { + return (PaymentStatus)this.PaymentStatusId; + } + set + { + this.PaymentStatusId = (int)value; + } + } + + /// + /// Gets or sets the shipping status + /// + public ShippingStatus ShippingStatus + { + get + { + return (ShippingStatus)this.ShippingStatusId; + } + set + { + this.ShippingStatusId = (int)value; + } + } + + /// + /// Gets or sets the customer tax display type + /// + public TaxDisplayType CustomerTaxDisplayType + { + get + { + return (TaxDisplayType)this.CustomerTaxDisplayTypeId; + } + set + { + this.CustomerTaxDisplayTypeId = (int)value; + } + } + + /// + /// Gets the applied tax rates + /// + public SortedDictionary TaxRatesDictionary + { + get + { + return ParseTaxRates(this.TaxRates); + } + } + + /// + /// Gets the order total amount incl. tax + /// + public decimal OrderTotalAmountIncl + { + get + { + return OrderAmountIncl + PaymentMethodAdditionalFeeNonTaxable + OrderShippingNonTaxable + - (RewardPointsTaxable ? decimal.Zero : (RedeemedRewardPointsEntry != null ? RedeemedRewardPointsEntry.UsedAmount : decimal.Zero)); + } + } + #endregion + } + + #region Nested classes + public partial class TaxRateRec + { + public decimal TaxRate { get; set; } + public decimal Amount { get; set; } + public decimal DiscountAmount { get; set; } + public decimal BaseAmount { get; set; } + public decimal TaxAmount { get; set; } + public decimal AmountIncludingTax { get; set; } + } + #endregion +} diff --git a/src/Libraries/Nop.Core/Domain/Orders/OrderAverageReportLine.cs b/src/Libraries/Nop.Core/Domain/Orders/OrderAverageReportLine.cs index a56507a3fb8..2647afe82fb 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/OrderAverageReportLine.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/OrderAverageReportLine.cs @@ -1,28 +1,32 @@ -namespace Nop.Core.Domain.Orders -{ - /// - /// Represents an order average report line - /// - public partial class OrderAverageReportLine - { - /// - /// Gets or sets the count - /// - public int CountOrders { get; set; } - - /// - /// Gets or sets the shipping summary (excluding tax) - /// - public decimal SumShippingExclTax { get; set; } - - /// - /// Gets or sets the tax summary - /// - public decimal SumTax { get; set; } - - /// - /// Gets or sets the order total summary - /// - public decimal SumOrders { get; set; } - } -} +namespace Nop.Core.Domain.Orders +{ + /// + /// Represents an order average report line + /// + public partial class OrderAverageReportLine + { + /// + /// Gets or sets the count + /// + public int CountOrders { get; set; } + + /// + /// Gets or sets the shipping summary (excluding tax) + /// + public decimal SumShippingExclTax { get; set; } + + /// + /// Gets or sets the tax summary + /// + public decimal SumTax { get; set; } + + /// + /// Gets or sets the order total summary + /// + public decimal SumOrders { get; set; } + /// + /// Gets or sets the order total amount summary + /// + public decimal SumOrdersTotalAmountIncl { get; set; } + } +} diff --git a/src/Libraries/Nop.Core/Domain/Orders/OrderItem.cs b/src/Libraries/Nop.Core/Domain/Orders/OrderItem.cs index 00782772ec7..89255e33205 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/OrderItem.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/OrderItem.cs @@ -1,129 +1,143 @@ -using System; -using System.Collections.Generic; -using Nop.Core.Domain.Catalog; - -namespace Nop.Core.Domain.Orders -{ - /// - /// Represents an order item - /// - public partial class OrderItem : BaseEntity - { - private ICollection _associatedGiftCards; - - /// - /// Gets or sets the order item identifier - /// - public Guid OrderItemGuid { get; set; } - - /// - /// Gets or sets the order identifier - /// - public int OrderId { get; set; } - - /// - /// Gets or sets the product identifier - /// - public int ProductId { get; set; } - - /// - /// Gets or sets the quantity - /// - public int Quantity { get; set; } - - /// - /// Gets or sets the unit price in primary store currency (incl tax) - /// - public decimal UnitPriceInclTax { get; set; } - - /// - /// Gets or sets the unit price in primary store currency (excl tax) - /// - public decimal UnitPriceExclTax { get; set; } - - /// - /// Gets or sets the price in primary store currency (incl tax) - /// - public decimal PriceInclTax { get; set; } - - /// - /// Gets or sets the price in primary store currency (excl tax) - /// - public decimal PriceExclTax { get; set; } - - /// - /// Gets or sets the discount amount (incl tax) - /// - public decimal DiscountAmountInclTax { get; set; } - - /// - /// Gets or sets the discount amount (excl tax) - /// - public decimal DiscountAmountExclTax { get; set; } - - /// - /// Gets or sets the original cost of this order item (when an order was placed), qty 1 - /// - public decimal OriginalProductCost { get; set; } - - /// - /// Gets or sets the attribute description - /// - public string AttributeDescription { get; set; } - - /// - /// Gets or sets the product attributes in XML format - /// - public string AttributesXml { get; set; } - - /// - /// Gets or sets the download count - /// - public int DownloadCount { get; set; } - - /// - /// Gets or sets a value indicating whether download is activated - /// - public bool IsDownloadActivated { get; set; } - - /// - /// Gets or sets a license download identifier (in case this is a downloadable product) - /// - public int? LicenseDownloadId { get; set; } - - /// - /// Gets or sets the total weight of one item - /// It's nullable for compatibility with the previous version of nopCommerce where was no such property - /// - public decimal? ItemWeight { get; set; } - - /// - /// Gets or sets the rental product start date (null if it's not a rental product) - /// - public DateTime? RentalStartDateUtc { get; set; } - - /// - /// Gets or sets the rental product end date (null if it's not a rental product) - /// - public DateTime? RentalEndDateUtc { get; set; } - - /// - /// Gets the order - /// - public virtual Order Order { get; set; } - - /// - /// Gets the product - /// - public virtual Product Product { get; set; } - - /// - /// Gets or sets the associated gift card - /// - public virtual ICollection AssociatedGiftCards - { - get { return _associatedGiftCards ?? (_associatedGiftCards = new List()); } - protected set { _associatedGiftCards = value; } - } - } -} +using System; +using System.Collections.Generic; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; + +namespace Nop.Core.Domain.Orders +{ + /// + /// Represents an order item + /// + public partial class OrderItem : BaseEntity + { + private ICollection _associatedGiftCards; + private ICollection _associatedRewardPoints; + /// + /// Gets or sets the order item identifier + /// + public Guid OrderItemGuid { get; set; } + + /// + /// Gets or sets the order identifier + /// + public int OrderId { get; set; } + + /// + /// Gets or sets the product identifier + /// + public int ProductId { get; set; } + + /// + /// Gets or sets the quantity + /// + public int Quantity { get; set; } + + /// + /// Gets or sets the unit price in primary store currency (incl tax) + /// + public decimal UnitPriceInclTax { get; set; } + + /// + /// Gets or sets the unit price in primary store currency (excl tax) + /// + public decimal UnitPriceExclTax { get; set; } + + /// + /// Gets or sets the price in primary store currency (incl tax) + /// + public decimal PriceInclTax { get; set; } + + /// + /// Gets or sets the price in primary store currency (excl tax) + /// + public decimal PriceExclTax { get; set; } + + /// + /// Gets or sets the discount amount (incl tax) + /// + public decimal DiscountAmountInclTax { get; set; } + + /// + /// Gets or sets the discount amount (excl tax) + /// + public decimal DiscountAmountExclTax { get; set; } + + /// + /// Gets or sets the original cost of this order item (when an order was placed), qty 1 + /// + public decimal OriginalProductCost { get; set; } + + /// + /// Gets or sets the attribute description + /// + public string AttributeDescription { get; set; } + + /// + /// Gets or sets the product attributes in XML format + /// + public string AttributesXml { get; set; } + + /// + /// Gets or sets the download count + /// + public int DownloadCount { get; set; } + + /// + /// Gets or sets a value indicating whether download is activated + /// + public bool IsDownloadActivated { get; set; } + + /// + /// Gets or sets a license download identifier (in case this is a downloadable product) + /// + public int? LicenseDownloadId { get; set; } + + /// + /// Gets or sets the total weight of one item + /// It's nullable for compatibility with the previous version of nopCommerce where was no such property + /// + public decimal? ItemWeight { get; set; } + + /// + /// Gets or sets the rental product start date (null if it's not a rental product) + /// + public DateTime? RentalStartDateUtc { get; set; } + + /// + /// Gets or sets the rental product end date (null if it's not a rental product) + /// + public DateTime? RentalEndDateUtc { get; set; } + + /// + /// Gets the order + /// + public virtual Order Order { get; set; } + + /// + /// Gets the product + /// + public virtual Product Product { get; set; } + + /// + /// Gets or sets the associated gift card + /// + public virtual ICollection AssociatedGiftCards + { + get { return _associatedGiftCards ?? (_associatedGiftCards = new List()); } + protected set { _associatedGiftCards = value; } + } + + /// + /// tax% of product + /// + public decimal TaxRate { get; set; } //MF 25.11.16 + /// + /// Gets or sets the associated reward points + /// + public virtual ICollection AssociatedRewardPoints + { + get { return _associatedRewardPoints ?? (_associatedRewardPoints = new List()); } + protected set { _associatedRewardPoints = value; } + } + } +} diff --git a/src/Libraries/Nop.Core/Domain/Orders/OrderSettings.cs b/src/Libraries/Nop.Core/Domain/Orders/OrderSettings.cs index adc1cf5fb00..e2a3692631e 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/OrderSettings.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/OrderSettings.cs @@ -1,134 +1,146 @@ -using Nop.Core.Configuration; - -namespace Nop.Core.Domain.Orders -{ - public class OrderSettings : ISettings - { - /// - /// Gets or sets a value indicating whether customer can make re-order - /// - public bool IsReOrderAllowed { get; set; } - - /// - /// Gets or sets a minimum order subtotal amount - /// - public decimal MinOrderSubtotalAmount { get; set; } - /// - /// Gets or sets a value indicating whether 'Minimum order subtotal amount' option - /// should be evaluated over 'X' value including tax or not - /// - public bool MinOrderSubtotalAmountIncludingTax { get; set; } - /// - /// Gets or sets a minimum order total amount - /// - public decimal MinOrderTotalAmount { get; set; } - - /// - /// Gets or sets a value indicating whether automatically update order totals on editing an order in admin area - /// - public bool AutoUpdateOrderTotalsOnEditingOrder { get; set; } - - /// - /// Gets or sets a value indicating whether anonymous checkout allowed - /// - public bool AnonymousCheckoutAllowed { get; set; } - - /// - /// Gets or sets a value indicating whether 'Terms of service' enabled on the shopping cart page - /// - public bool TermsOfServiceOnShoppingCartPage { get; set; } - /// - /// Gets or sets a value indicating whether 'Terms of service' enabled on the order confirmation page - /// - public bool TermsOfServiceOnOrderConfirmPage { get; set; } - - /// - /// Gets or sets a value indicating whether 'One-page checkout' is enabled - /// - public bool OnePageCheckoutEnabled { get; set; } - - /// - /// Gets or sets a value indicating whether order totals should be displayed on 'Payment info' tab of 'One-page checkout' page - /// - public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab { get; set; } - /// - /// Gets or sets a value indicating whether "Billing address" step should be skipped - /// - public bool DisableBillingAddressCheckoutStep { get; set; } - /// - /// Gets or sets a value indicating whether "Order completed" page should be skipped - /// - public bool DisableOrderCompletedPage { get; set; } - - /// - /// Gets or sets a value indicating we should attach PDF invoice to "Order placed" email - /// - public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; } - /// - /// Gets or sets a value indicating we should attach PDF invoice to "Order paid" email - /// - public bool AttachPdfInvoiceToOrderPaidEmail { get; set; } - /// - /// Gets or sets a value indicating we should attach PDF invoice to "Order completed" email - /// - public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; } - /// - /// Gets or sets a value indicating we PDF invoices should be generated in customer language. Otherwise, use the current one - /// - public bool GeneratePdfInvoiceInCustomerLanguage { get; set; } - - /// - /// Gets or sets a value indicating whether "Return requests" are allowed - /// - public bool ReturnRequestsEnabled { get; set; } - /// - /// Gets or sets a value indicating whether customers are allowed to upload files - /// - public bool ReturnRequestsAllowFiles { get; set; } - /// - /// Gets or sets maximum file size for upload file (return request). Set 0 to allow any file size - /// - public int ReturnRequestsFileMaximumSize { get; set; } - /// - /// Gets or sets a value "Return requests" number mask - /// - public string ReturnRequestNumberMask { get; set; } - /// - /// Gets or sets a number of days that the Return Request Link will be available for customers after order placing. - /// - public int NumberOfDaysReturnRequestAvailable { get; set; } - - /// - /// Gets or sets a value indicating whether to activate related gift cards after completing the order - /// - public bool ActivateGiftCardsAfterCompletingOrder { get; set; } - /// - /// Gets or sets a value indicating whether to deactivate related gift cards after cancelling the order - /// - public bool DeactivateGiftCardsAfterCancellingOrder { get; set; } - /// - /// Gets or sets a value indicating whether to deactivate related gift cards after deleting the order - /// - public bool DeactivateGiftCardsAfterDeletingOrder { get; set; } - - /// - /// Gets or sets an order placement interval in seconds (prevent 2 orders being placed within an X seconds time frame). - /// - public int MinimumOrderPlacementInterval { get; set; } - - /// - /// Gets or sets a value indicating whether an order status should be set to "Complete" only when its shipping status is "Delivered". Otherwise, "Shipped" status will be enough. - /// - public bool CompleteOrderWhenDelivered { get; set; } - - /// - /// Gets or sets a custom order number mask - /// - public string CustomOrderNumberMask { get; set; } - - /// - /// Gets or sets a value indicating whether the orders need to be exported with their products - /// - public bool ExportWithProducts { get; set; } - } +using Nop.Core.Configuration; + +namespace Nop.Core.Domain.Orders +{ + public class OrderSettings : ISettings + { + /// + /// Gets or sets a value indicating whether customer can make re-order + /// + public bool IsReOrderAllowed { get; set; } + + /// + /// Gets or sets a minimum order subtotal amount + /// + public decimal MinOrderSubtotalAmount { get; set; } + /// + /// Gets or sets a value indicating whether 'Minimum order subtotal amount' option + /// should be evaluated over 'X' value including tax or not + /// + public bool MinOrderSubtotalAmountIncludingTax { get; set; } + /// + /// Gets or sets a minimum order total amount + /// + public decimal MinOrderTotalAmount { get; set; } + + /// + /// Gets or sets a value indicating whether automatically update order totals on editing an order in admin area + /// + public bool AutoUpdateOrderTotalsOnEditingOrder { get; set; } + + /// + /// Gets or sets a value indicating whether anonymous checkout allowed + /// + public bool AnonymousCheckoutAllowed { get; set; } + + /// + /// Gets or sets a value indicating whether 'Terms of service' enabled on the shopping cart page + /// + public bool TermsOfServiceOnShoppingCartPage { get; set; } + /// + /// Gets or sets a value indicating whether 'Terms of service' enabled on the order confirmation page + /// + public bool TermsOfServiceOnOrderConfirmPage { get; set; } + + /// + /// Gets or sets a value indicating whether 'One-page checkout' is enabled + /// + public bool OnePageCheckoutEnabled { get; set; } + + /// + /// Gets or sets a value indicating whether order totals should be displayed on 'Payment info' tab of 'One-page checkout' page + /// + public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab { get; set; } + /// + /// Gets or sets a value indicating whether "Billing address" step should be skipped + /// + public bool DisableBillingAddressCheckoutStep { get; set; } + /// + /// Gets or sets a value indicating whether "Order completed" page should be skipped + /// + public bool DisableOrderCompletedPage { get; set; } + + /// + /// Gets or sets a value indicating we should attach PDF invoice to "Order placed" email + /// + public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; } + /// + /// Gets or sets a value indicating we should attach PDF invoice to "Order paid" email + /// + public bool AttachPdfInvoiceToOrderPaidEmail { get; set; } + /// + /// Gets or sets a value indicating we should attach PDF invoice to "Order completed" email + /// + public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; } + /// + /// Gets or sets a value indicating we PDF invoices should be generated in customer language. Otherwise, use the current one + /// + public bool GeneratePdfInvoiceInCustomerLanguage { get; set; } + + /// + /// Gets or sets a value indicating whether "Return requests" are allowed + /// + public bool ReturnRequestsEnabled { get; set; } + /// + /// Gets or sets a value indicating whether customers are allowed to upload files + /// + public bool ReturnRequestsAllowFiles { get; set; } + /// + /// Gets or sets maximum file size for upload file (return request). Set 0 to allow any file size + /// + public int ReturnRequestsFileMaximumSize { get; set; } + /// + /// Gets or sets a value "Return requests" number mask + /// + public string ReturnRequestNumberMask { get; set; } + /// + /// Gets or sets a number of days that the Return Request Link will be available for customers after order placing. + /// + public int NumberOfDaysReturnRequestAvailable { get; set; } + + /// + /// Gets or sets a value indicating whether to activate related gift cards after completing the order + /// + public bool ActivateGiftCardsAfterCompletingOrder { get; set; } + /// + /// Gets or sets a value indicating whether to deactivate related gift cards after cancelling the order + /// + public bool DeactivateGiftCardsAfterCancellingOrder { get; set; } + /// + /// Gets or sets a value indicating whether to deactivate related gift cards after deleting the order + /// + public bool DeactivateGiftCardsAfterDeletingOrder { get; set; } + + /// + /// Gets or sets an order placement interval in seconds (prevent 2 orders being placed within an X seconds time frame). + /// + public int MinimumOrderPlacementInterval { get; set; } + + /// + /// Gets or sets a value indicating whether an order status should be set to "Complete" only when its shipping status is "Delivered". Otherwise, "Shipped" status will be enough. + /// + public bool CompleteOrderWhenDelivered { get; set; } + /// + /// Last issued Invoice Id + /// + public int InvoiceIdent { get; set; } + /// + /// Last issued Invoice Year + /// + public int InvoiceYear { get; set; } + + /// + /// Gets or sets a custom order number mask + /// + public string CustomOrderNumberMask { get; set; } + + /// + /// Gets or sets a value indicating whether the orders need to be exported with their products + /// + public bool ExportWithProducts { get; set; } + /// + /// Gets or sets a value indicating whether invoice ident should be set from background task + /// + public bool AssignInvoiceIdentFromTask { get; set; } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartItem.cs b/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartItem.cs index 94d18561078..5ffe1b9abb7 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartItem.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartItem.cs @@ -1,149 +1,162 @@ -using System; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; - -namespace Nop.Core.Domain.Orders -{ - /// - /// Represents a shopping cart item - /// - public partial class ShoppingCartItem : BaseEntity - { - /// - /// Gets or sets the store identifier - /// - public int StoreId { get; set; } - - /// - /// Gets or sets the shopping cart type identifier - /// - public int ShoppingCartTypeId { get; set; } - - /// - /// Gets or sets the customer identifier - /// - public int CustomerId { get; set; } - - /// - /// Gets or sets the product identifier - /// - public int ProductId { get; set; } - - /// - /// Gets or sets the product attributes in XML format - /// - public string AttributesXml { get; set; } - - /// - /// Gets or sets the price enter by a customer - /// - public decimal CustomerEnteredPrice { get; set; } - - /// - /// Gets or sets the quantity - /// - public int Quantity { get; set; } - - /// - /// Gets or sets the rental product start date (null if it's not a rental product) - /// - public DateTime? RentalStartDateUtc { get; set; } - - /// - /// Gets or sets the rental product end date (null if it's not a rental product) - /// - public DateTime? RentalEndDateUtc { get; set; } - - /// - /// Gets or sets the date and time of instance creation - /// - public DateTime CreatedOnUtc { get; set; } - - /// - /// Gets or sets the date and time of instance update - /// - public DateTime UpdatedOnUtc { get; set; } - - /// - /// Gets the log type - /// - public ShoppingCartType ShoppingCartType - { - get - { - return (ShoppingCartType)this.ShoppingCartTypeId; - } - set - { - this.ShoppingCartTypeId = (int)value; - } - } - - /// - /// Gets or sets the product - /// - public virtual Product Product { get; set; } - - /// - /// Gets or sets the customer - /// - public virtual Customer Customer { get; set; } - - /// - /// Gets a value indicating whether the shopping cart item is free shipping - /// - public bool IsFreeShipping - { - get - { - var product = this.Product; - if (product != null) - return product.IsFreeShipping; - return true; - } - } - - /// - /// Gets a value indicating whether the shopping cart item is ship enabled - /// - public bool IsShipEnabled - { - get - { - var product = this.Product; - if (product != null) - return product.IsShipEnabled; - return false; - } - } - - /// - /// Gets the additional shipping charge - /// - public decimal AdditionalShippingCharge - { - get - { - decimal additionalShippingCharge = decimal.Zero; - var product = this.Product; - if (product != null) - additionalShippingCharge = product.AdditionalShippingCharge * Quantity; - return additionalShippingCharge; - } - } - - /// - /// Gets a value indicating whether the shopping cart item is tax exempt - /// - public bool IsTaxExempt - { - get - { - var product = this.Product; - if (product != null) - return product.IsTaxExempt; - return false; - } - } - } -} +using System; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; + +namespace Nop.Core.Domain.Orders +{ + /// + /// Represents a shopping cart item + /// + public partial class ShoppingCartItem : BaseEntity + { + /// + /// Gets or sets the store identifier + /// + public int StoreId { get; set; } + + /// + /// Gets or sets the shopping cart type identifier + /// + public int ShoppingCartTypeId { get; set; } + + /// + /// Gets or sets the customer identifier + /// + public int CustomerId { get; set; } + + /// + /// Gets or sets the product identifier + /// + public int ProductId { get; set; } + + /// + /// Gets or sets the product attributes in XML format + /// + public string AttributesXml { get; set; } + + /// + /// Gets or sets the price enter by a customer + /// + public decimal CustomerEnteredPrice { get; set; } + + /// + /// Gets or sets the quantity + /// + public int Quantity { get; set; } + /// + /// Gets or sets the rental product start date (null if it's not a rental product) + /// + public DateTime? RentalStartDateUtc { get; set; } + + /// + /// Gets or sets the rental product end date (null if it's not a rental product) + /// + public DateTime? RentalEndDateUtc { get; set; } + + /// + /// Gets or sets the date and time of instance creation + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the date and time of instance update + /// + public DateTime UpdatedOnUtc { get; set; } + + /// + /// Gets the log type + /// + public ShoppingCartType ShoppingCartType + { + get + { + return (ShoppingCartType)this.ShoppingCartTypeId; + } + set + { + this.ShoppingCartTypeId = (int)value; + } + } + + /// + /// Gets or sets the product + /// + public virtual Product Product { get; set; } + + /// + /// Gets or sets the customer + /// + public virtual Customer Customer { get; set; } + + /// + /// Gets a value indicating whether the shopping cart item is free shipping + /// + public bool IsFreeShipping + { + get + { + var product = this.Product; + if (product != null) + return product.IsFreeShipping; + return true; + } + } + + /// + /// Gets a value indicating whether the shopping cart item is ship enabled + /// + public bool IsShipEnabled + { + get + { + var product = this.Product; + if (product != null) + return product.IsShipEnabled; + return false; + } + } + + /// + /// Gets the additional shipping charge + /// + public decimal AdditionalShippingCharge + { + get + { + decimal additionalShippingCharge = decimal.Zero; + var product = this.Product; + if (product != null) + additionalShippingCharge = product.AdditionalShippingCharge * Quantity; + return additionalShippingCharge; + } + } + + /// + /// Gets a value indicating whether the shopping cart item is tax exempt + /// + public bool IsTaxExempt + { + get + { + var product = this.Product; + if (product != null) + return product.IsTaxExempt; + return false; + } + } + //fields for restored cart + /// + /// TaxRate for restored cart. Only used by UpdateOrderTotal and can be null + /// + public decimal? TaxRate { get; set; } + /// + /// Subtotal of item with tax + /// + public decimal? SubTotalInclTax { get; set; } + + /// + /// Subtotal of item without tax + /// + public decimal? SubTotalExclTax { get; set; } + } +} diff --git a/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartSettings.cs b/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartSettings.cs index 65493a6169c..11655ef6266 100644 --- a/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartSettings.cs +++ b/src/Libraries/Nop.Core/Domain/Orders/ShoppingCartSettings.cs @@ -1,115 +1,119 @@ - -using Nop.Core.Configuration; - -namespace Nop.Core.Domain.Orders -{ - public class ShoppingCartSettings : ISettings - { - /// - /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist - /// - public bool DisplayCartAfterAddingProduct { get; set; } - - /// - /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist - /// - public bool DisplayWishlistAfterAddingProduct { get; set; } - - /// - /// Gets or sets a value indicating maximum number of items in the shopping cart - /// - public int MaximumShoppingCartItems { get; set; } - - /// - /// Gets or sets a value indicating maximum number of items in the wishlist - /// - public int MaximumWishlistItems { get; set; } - - /// - /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block - /// - public bool AllowOutOfStockItemsToBeAddedToWishlist { get; set; } - - /// - /// Gets or sets a value indicating whether to move items from wishlist to cart when clicking "Add to cart" button. Otherwise, they are copied. - /// - public bool MoveItemsFromWishlistToCart { get; set; } - - /// - /// Gets or sets a value indicating whether shopping carts (and wishlist) are shared between stores (in multi-store environment) - /// - public bool CartsSharedBetweenStores { get; set; } - - /// - /// Gets or sets a value indicating whether to show product image on shopping cart page - /// - public bool ShowProductImagesOnShoppingCart { get; set; } - - /// - /// Gets or sets a value indicating whether to show product image on wishlist page - /// - public bool ShowProductImagesOnWishList { get; set; } - - /// - /// Gets or sets a value indicating whether to show discount box on shopping cart page - /// - public bool ShowDiscountBox { get; set; } - - /// - /// Gets or sets a value indicating whether to show gift card box on shopping cart page - /// - public bool ShowGiftCardBox { get; set; } - - /// - /// Gets or sets a number of "Cross-sells" on shopping cart page - /// - public int CrossSellsNumber { get; set; } - - /// - /// Gets or sets a value indicating whether "email a wishlist" feature is enabled - /// - public bool EmailWishlistEnabled { get; set; } - - /// - /// Gets or sets a value indicating whether to enabled "email a wishlist" for anonymous users. - /// - public bool AllowAnonymousUsersToEmailWishlist { get; set; } - - /// Gets or sets a value indicating whether mini-shopping cart is enabled - /// - public bool MiniShoppingCartEnabled { get; set; } - - /// - /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block - /// - public bool ShowProductImagesInMiniShoppingCart { get; set; } - - /// Gets or sets a maximum number of products which can be displayed in the mini-shopping cart block - /// - public int MiniShoppingCartProductNumber { get; set; } - - //Round is already an issue. - //When enabled it can cause one issue: http://www.nopcommerce.com/boards/t/7679/vattax-rounding-error-important-fix.aspx - //When disable it causes another one: http://www.nopcommerce.com/boards/t/11419/nop-20-order-of-steps-in-checkout.aspx?p=3#46924 - /// - /// Gets or sets a value indicating whether to round calculated prices and total during calculation - /// - public bool RoundPricesDuringCalculation { get; set; } - - /// - /// Gets or sets a value indicating whether we should group shopping cart items for the same products - /// For example, a customer could have two shopping cart items for the same products (different product attributes) - /// - public bool GroupTierPricesForDistinctShoppingCartItems { get; set; } - - /// - /// Gets or sets a value indicating whether a customer will beable to edit products in the cart - /// - public bool AllowCartItemEditing { get; set; } - - /// - /// Gets or sets a value indicating whether a customer will see quantity of attribute values associated to products (when qty > 1) - /// - public bool RenderAssociatedAttributeValueQuantity { get; set; } - } + +using Nop.Core.Configuration; + +namespace Nop.Core.Domain.Orders +{ + public class ShoppingCartSettings : ISettings + { + /// + /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist + /// + public bool DisplayCartAfterAddingProduct { get; set; } + + /// + /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist + /// + public bool DisplayWishlistAfterAddingProduct { get; set; } + + /// + /// Gets or sets a value indicating maximum number of items in the shopping cart + /// + public int MaximumShoppingCartItems { get; set; } + + /// + /// Gets or sets a value indicating maximum number of items in the wishlist + /// + public int MaximumWishlistItems { get; set; } + + /// + /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block + /// + public bool AllowOutOfStockItemsToBeAddedToWishlist { get; set; } + + /// + /// Gets or sets a value indicating whether to move items from wishlist to cart when clicking "Add to cart" button. Otherwise, they are copied. + /// + public bool MoveItemsFromWishlistToCart { get; set; } + + /// + /// Gets or sets a value indicating whether shopping carts (and wishlist) are shared between stores (in multi-store environment) + /// + public bool CartsSharedBetweenStores { get; set; } + + /// + /// Gets or sets a value indicating whether to show product image on shopping cart page + /// + public bool ShowProductImagesOnShoppingCart { get; set; } + + /// + /// Gets or sets a value indicating whether to show product image on wishlist page + /// + public bool ShowProductImagesOnWishList { get; set; } + + /// + /// Gets or sets a value indicating whether to show discount box on shopping cart page + /// + public bool ShowDiscountBox { get; set; } + + /// + /// Gets or sets a value indicating whether to show gift card box on shopping cart page + /// + public bool ShowGiftCardBox { get; set; } + + /// + /// Gets or sets a number of "Cross-sells" on shopping cart page + /// + public int CrossSellsNumber { get; set; } + + /// + /// Gets or sets a value indicating whether "email a wishlist" feature is enabled + /// + public bool EmailWishlistEnabled { get; set; } + + /// + /// Gets or sets a value indicating whether to enabled "email a wishlist" for anonymous users. + /// + public bool AllowAnonymousUsersToEmailWishlist { get; set; } + + /// Gets or sets a value indicating whether mini-shopping cart is enabled + /// + public bool MiniShoppingCartEnabled { get; set; } + + /// + /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block + /// + public bool ShowProductImagesInMiniShoppingCart { get; set; } + + /// Gets or sets a maximum number of products which can be displayed in the mini-shopping cart block + /// + public int MiniShoppingCartProductNumber { get; set; } + + //Round is already an issue. + //When enabled it can cause one issue: http://www.nopcommerce.com/boards/t/7679/vattax-rounding-error-important-fix.aspx + //When disable it causes another one: http://www.nopcommerce.com/boards/t/11419/nop-20-order-of-steps-in-checkout.aspx?p=3#46924 + /// + /// Gets or sets a value indicating whether to round calculated prices and total during calculation + /// + public bool RoundPricesDuringCalculation { get; set; } + + /// + /// Gets or sets a value indicating whether we should group shopping cart items for the same products + /// For example, a customer could have two shopping cart items for the same products (different product attributes) + /// + public bool GroupTierPricesForDistinctShoppingCartItems { get; set; } + + /// + /// Gets or sets a value indicating whether a customer will beable to edit products in the cart + /// + public bool AllowCartItemEditing { get; set; } + + /// + /// Gets or sets a value indicating whether a customer will see quantity of attribute values associated to products (when qty > 1) + /// + public bool RenderAssociatedAttributeValueQuantity { get; set; } + /// + /// Gets or sets a value indicating whether a customer will see the price of attribute values associated to products + /// + public bool RenderProductAttributePrices { get; set; } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Core/Html/HtmlHelper.cs b/src/Libraries/Nop.Core/Html/HtmlHelper.cs index af886767b2a..5defb54fe6c 100644 --- a/src/Libraries/Nop.Core/Html/HtmlHelper.cs +++ b/src/Libraries/Nop.Core/Html/HtmlHelper.cs @@ -1,227 +1,232 @@ -using System; -using System.Text; -using System.Text.RegularExpressions; -using System.Web; - -namespace Nop.Core.Html -{ - /// - /// Represents a HTML helper - /// - public partial class HtmlHelper - { - #region Fields - private readonly static Regex paragraphStartRegex = new Regex("

", RegexOptions.IgnoreCase); - private readonly static Regex paragraphEndRegex = new Regex("

", RegexOptions.IgnoreCase); - //private static Regex ampRegex = new Regex("&(?!(?:#[0-9]{2,4};|[a-z0-9]+;))", RegexOptions.Compiled | RegexOptions.IgnoreCase); - - #endregion - - #region Utilities - - private static string EnsureOnlyAllowedHtml(string text) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - const string allowedTags = "br,hr,b,i,u,a,div,ol,ul,li,blockquote,img,span,p,em,strong,font,pre,h1,h2,h3,h4,h5,h6,address,cite"; - - var m = Regex.Matches(text, "<.*?>", RegexOptions.IgnoreCase); - for (int i = m.Count - 1; i >= 0; i--) - { - string tag = text.Substring(m[i].Index + 1, m[i].Length - 1).Trim().ToLower(); - - if (!IsValidTag(tag, allowedTags)) - { - text = text.Remove(m[i].Index, m[i].Length); - } - } - - return text; - } - - private static bool IsValidTag(string tag, string tags) - { - string[] allowedTags = tags.Split(','); - if (tag.IndexOf("javascript") >= 0) return false; - if (tag.IndexOf("vbscript") >= 0) return false; - if (tag.IndexOf("onclick") >= 0) return false; - - var endchars = new [] { ' ', '>', '/', '\t' }; - - int pos = tag.IndexOfAny(endchars, 1); - if (pos > 0) tag = tag.Substring(0, pos); - if (tag[0] == '/') tag = tag.Substring(1); - - foreach (string aTag in allowedTags) - { - if (tag == aTag) return true; - } - - return false; - } - #endregion - - #region Methods - /// - /// Formats the text - /// - /// Text - /// A value indicating whether to strip tags - /// A value indicating whether HTML is allowed - /// A value indicating whether HTML is allowed - /// A value indicating whether BBCode is allowed - /// A value indicating whether to resolve links - /// A value indicating whether to add "noFollow" tag - /// Formatted text - public static string FormatText(string text, bool stripTags, - bool convertPlainTextToHtml, bool allowHtml, - bool allowBBCode, bool resolveLinks, bool addNoFollowTag) - { - - if (String.IsNullOrEmpty(text)) - return string.Empty; - - try - { - if (stripTags) - { - text = StripTags(text); - } - - text = allowHtml ? EnsureOnlyAllowedHtml(text) : HttpUtility.HtmlEncode(text); - - if (convertPlainTextToHtml) - { - text = ConvertPlainTextToHtml(text); - } - - if (allowBBCode) - { - text = BBCodeHelper.FormatText(text, true, true, true, true, true, true, true); - } - - if (resolveLinks) - { - text = ResolveLinksHelper.FormatText(text); - } - - if (addNoFollowTag) - { - //add noFollow tag. not implemented - } - } - catch (Exception exc) - { - text = string.Format("Text cannot be formatted. Error: {0}", exc.Message); - } - return text; - } - - /// - /// Strips tags - /// - /// Text - /// Formatted text - public static string StripTags(string text) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - text = Regex.Replace(text, @"(>)(\r|\n)*(<)", "><"); - text = Regex.Replace(text, "(<[^>]*>)([^<]*)", "$2"); - text = Regex.Replace(text, "(&#x?[0-9]{2,4};|"|&| |<|>|€|©|®|‰|‡|†|‹|›|„|”|“|‚|’|‘|—|–|‏|‎|‍|‌| | | |˜|ˆ|Ÿ|š|Š)", "@"); - - return text; - } - - /// - /// replace anchor text (remove a tag from the following url Name and output only the string "Name") - /// - /// Text - /// Text - public static string ReplaceAnchorTags(string text) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - text = Regex.Replace(text, @"]+>([^<]*(?:(?!", "$1", RegexOptions.IgnoreCase); - return text; - } - - /// - /// Converts plain text to HTML - /// - /// Text - /// Formatted text - public static string ConvertPlainTextToHtml(string text) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - text = text.Replace("\r\n", "
"); - text = text.Replace("\r", "
"); - text = text.Replace("\n", "
"); - text = text.Replace("\t", "  "); - text = text.Replace(" ", "  "); - - return text; - } - - /// - /// Converts HTML to plain text - /// - /// Text - /// A value indicating whether to decode text - /// A value indicating whether to replace anchor text (remove a tag from the following url Name and output only the string "Name") - /// Formatted text - public static string ConvertHtmlToPlainText(string text, - bool decode = false, bool replaceAnchorTags = false) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - if (decode) - text = HttpUtility.HtmlDecode(text); - - text = text.Replace("
", "\n"); - text = text.Replace("
", "\n"); - text = text.Replace("
", "\n"); - text = text.Replace("  ", "\t"); - text = text.Replace("  ", " "); - - if (replaceAnchorTags) - text = ReplaceAnchorTags(text); - - return text; - } - - /// - /// Converts text to paragraph - /// - /// Text - /// Formatted text - public static string ConvertPlainTextToParagraph(string text) - { - if (String.IsNullOrEmpty(text)) - return string.Empty; - - text = paragraphStartRegex.Replace(text, string.Empty); - text = paragraphEndRegex.Replace(text, "\n"); - text = text.Replace("\r\n", "\n").Replace("\r", "\n"); - text = text + "\n\n"; - text = text.Replace("\n\n", "\n"); - var strArray = text.Split(new [] { '\n' }); - var builder = new StringBuilder(); - foreach (string str in strArray) - { - if ((str != null) && (str.Trim().Length > 0)) - { - builder.AppendFormat("

{0}

\n", str); - } - } - return builder.ToString(); - } - #endregion - } -} +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Web; + +namespace Nop.Core.Html +{ + /// + /// Represents a HTML helper + /// + public partial class HtmlHelper + { + #region Fields + private readonly static Regex paragraphStartRegex = new Regex("

", RegexOptions.IgnoreCase); + private readonly static Regex paragraphEndRegex = new Regex("

", RegexOptions.IgnoreCase); + //private static Regex ampRegex = new Regex("&(?!(?:#[0-9]{2,4};|[a-z0-9]+;))", RegexOptions.Compiled | RegexOptions.IgnoreCase); + + #endregion + + #region Utilities + + private static string EnsureOnlyAllowedHtml(string text) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + const string allowedTags = "br,hr,b,i,u,a,div,ol,ul,li,blockquote,img,span,p,em,strong,font,pre,h1,h2,h3,h4,h5,h6,address,cite"; + + var m = Regex.Matches(text, "<.*?>", RegexOptions.IgnoreCase); + for (int i = m.Count - 1; i >= 0; i--) + { + string tag = text.Substring(m[i].Index + 1, m[i].Length - 1).Trim().ToLower(); + + if (!IsValidTag(tag, allowedTags)) + { + text = text.Remove(m[i].Index, m[i].Length); + } + } + + return text; + } + + private static bool IsValidTag(string tag, string tags) + { + string[] allowedTags = tags.Split(','); + if (tag.IndexOf("javascript") >= 0) return false; + if (tag.IndexOf("vbscript") >= 0) return false; + if (tag.IndexOf("onclick") >= 0) return false; + + var endchars = new [] { ' ', '>', '/', '\t' }; + + int pos = tag.IndexOfAny(endchars, 1); + if (pos > 0) tag = tag.Substring(0, pos); + if (tag[0] == '/') tag = tag.Substring(1); + + foreach (string aTag in allowedTags) + { + if (tag == aTag) return true; + } + + return false; + } + #endregion + + #region Methods + /// + /// Formats the text + /// + /// Text + /// A value indicating whether to strip tags + /// A value indicating whether HTML is allowed + /// A value indicating whether HTML is allowed + /// A value indicating whether BBCode is allowed + /// A value indicating whether to resolve links + /// A value indicating whether to add "noFollow" tag + /// Formatted text + public static string FormatText(string text, bool stripTags, + bool convertPlainTextToHtml, bool allowHtml, + bool allowBBCode, bool resolveLinks, bool addNoFollowTag) + { + + if (String.IsNullOrEmpty(text)) + return string.Empty; + + try + { + if (stripTags) + { + text = StripTags(text); + } + + text = allowHtml ? EnsureOnlyAllowedHtml(text) : HttpUtility.HtmlEncode(text); + + if (convertPlainTextToHtml) + { + text = ConvertPlainTextToHtml(text); + } + + if (allowBBCode) + { + text = BBCodeHelper.FormatText(text, true, true, true, true, true, true, true); + } + + if (resolveLinks) + { + text = ResolveLinksHelper.FormatText(text); + } + + if (addNoFollowTag) + { + //add noFollow tag. not implemented + } + } + catch (Exception exc) + { + text = string.Format("Text cannot be formatted. Error: {0}", exc.Message); + } + return text; + } + + /// + /// Strips tags + /// + /// Text + /// Formatted text + public static string StripTags(string text) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + text = Regex.Replace(text, @"(>)(\r|\n)*(<)", "><"); + text = Regex.Replace(text, "(<[^>]*>)([^<]*)", "$2"); + text = Regex.Replace(text, "(&#x?[0-9]{2,4};|"|&| |<|>|€|©|®|‰|‡|†|‹|›|„|”|“|‚|’|‘|—|–|‏|‎|‍|‌| | | |˜|ˆ|Ÿ|š|Š)", "@"); + + return text; + } + + /// + /// replace anchor text (remove a tag from the following url Name and output only the string "Name") + /// + /// Text + /// Text + public static string ReplaceAnchorTags(string text) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + text = Regex.Replace(text, @"]+>([^<]*(?:(?!", "$1", RegexOptions.IgnoreCase); + return text; + } + + /// + /// Converts plain text to HTML + /// + /// Text + /// Formatted text + public static string ConvertPlainTextToHtml(string text) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + text = text.Replace("\r\n", "
"); + text = text.Replace("\r", "
"); + text = text.Replace("\n", "
"); + text = text.Replace("\t", "  "); + text = text.Replace(" ", "  "); + + return text; + } + + /// + /// Converts HTML to plain text + /// + /// Text + /// A value indicating whether to decode text + /// A value indicating whether to replace anchor text (remove a tag from the following url Name and output only the string "Name") + /// Formatted text + public static string ConvertHtmlToPlainText(string text, + bool decode = false, bool replaceAnchorTags = false) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + if (decode) + text = HttpUtility.HtmlDecode(text); + + text = text.Replace("
", "\n"); + text = text.Replace("
", "\n"); + text = text.Replace("
", "\n"); + text = text.Replace("  ", "\t"); + text = text.Replace("  ", " "); + //attribute Vat tags to remove + text = text.Replace("", ""); + text = text.Replace("", "\t"); + text = text.Replace("", ""); + + + if (replaceAnchorTags) + text = ReplaceAnchorTags(text); + + return text; + } + + /// + /// Converts text to paragraph + /// + /// Text + /// Formatted text + public static string ConvertPlainTextToParagraph(string text) + { + if (String.IsNullOrEmpty(text)) + return string.Empty; + + text = paragraphStartRegex.Replace(text, string.Empty); + text = paragraphEndRegex.Replace(text, "\n"); + text = text.Replace("\r\n", "\n").Replace("\r", "\n"); + text = text + "\n\n"; + text = text.Replace("\n\n", "\n"); + var strArray = text.Split(new [] { '\n' }); + var builder = new StringBuilder(); + foreach (string str in strArray) + { + if ((str != null) && (str.Trim().Length > 0)) + { + builder.AppendFormat("

{0}

\n", str); + } + } + return builder.ToString(); + } + #endregion + } +} diff --git a/src/Libraries/Nop.Data/Mapping/Customers/RewardPointsHistoryMap.cs b/src/Libraries/Nop.Data/Mapping/Customers/RewardPointsHistoryMap.cs index 73d3f16ac9a..0444c3fc9cc 100644 --- a/src/Libraries/Nop.Data/Mapping/Customers/RewardPointsHistoryMap.cs +++ b/src/Libraries/Nop.Data/Mapping/Customers/RewardPointsHistoryMap.cs @@ -1,23 +1,28 @@ -using Nop.Core.Domain.Customers; - -namespace Nop.Data.Mapping.Customers -{ - public partial class RewardPointsHistoryMap : NopEntityTypeConfiguration - { - public RewardPointsHistoryMap() - { - this.ToTable("RewardPointsHistory"); - this.HasKey(rph => rph.Id); - - this.Property(rph => rph.UsedAmount).HasPrecision(18, 4); - - this.HasRequired(rph => rph.Customer) - .WithMany() - .HasForeignKey(rph => rph.CustomerId); - - this.HasOptional(rph => rph.UsedWithOrder) - .WithOptionalDependent(o => o.RedeemedRewardPointsEntry) - .WillCascadeOnDelete(false); - } - } +using Nop.Core.Domain.Customers; + +namespace Nop.Data.Mapping.Customers +{ + public partial class RewardPointsHistoryMap : NopEntityTypeConfiguration + { + public RewardPointsHistoryMap() + { + this.ToTable("RewardPointsHistory"); + this.HasKey(rph => rph.Id); + + this.Property(rph => rph.UsedAmount).HasPrecision(18, 4); + this.Property(rph => rph.UsedAmountPurchased).HasPrecision(18, 4); + + this.HasRequired(rph => rph.Customer) + .WithMany() + .HasForeignKey(rph => rph.CustomerId); + + this.HasOptional(rph => rph.UsedWithOrder) + .WithOptionalDependent(o => o.RedeemedRewardPointsEntry) + .WillCascadeOnDelete(false); + + this.HasOptional(rph => rph.PurchasedWithOrderItem) + .WithMany(orderItem => orderItem.AssociatedRewardPoints) + .HasForeignKey(rph => rph.PurchasedWithOrderItemId); + } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Data/Mapping/Orders/OrderItemMap.cs b/src/Libraries/Nop.Data/Mapping/Orders/OrderItemMap.cs index bc9b4de313a..7e8d477815c 100644 --- a/src/Libraries/Nop.Data/Mapping/Orders/OrderItemMap.cs +++ b/src/Libraries/Nop.Data/Mapping/Orders/OrderItemMap.cs @@ -1,31 +1,32 @@ -using Nop.Core.Domain.Orders; - -namespace Nop.Data.Mapping.Orders -{ - public partial class OrderItemMap : NopEntityTypeConfiguration - { - public OrderItemMap() - { - this.ToTable("OrderItem"); - this.HasKey(orderItem => orderItem.Id); - - this.Property(orderItem => orderItem.UnitPriceInclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.UnitPriceExclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.PriceInclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.PriceExclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.DiscountAmountInclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.DiscountAmountExclTax).HasPrecision(18, 4); - this.Property(orderItem => orderItem.OriginalProductCost).HasPrecision(18, 4); - this.Property(orderItem => orderItem.ItemWeight).HasPrecision(18, 4); - - - this.HasRequired(orderItem => orderItem.Order) - .WithMany(o => o.OrderItems) - .HasForeignKey(orderItem => orderItem.OrderId); - - this.HasRequired(orderItem => orderItem.Product) - .WithMany() - .HasForeignKey(orderItem => orderItem.ProductId); - } - } +using Nop.Core.Domain.Orders; + +namespace Nop.Data.Mapping.Orders +{ + public partial class OrderItemMap : NopEntityTypeConfiguration + { + public OrderItemMap() + { + this.ToTable("OrderItem"); + this.HasKey(orderItem => orderItem.Id); + + this.Property(orderItem => orderItem.UnitPriceInclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.UnitPriceExclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.PriceInclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.PriceExclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.DiscountAmountInclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.DiscountAmountExclTax).HasPrecision(18, 4); + this.Property(orderItem => orderItem.OriginalProductCost).HasPrecision(18, 4); + this.Property(orderItem => orderItem.ItemWeight).HasPrecision(18, 4); + this.Property(orderItem => orderItem.TaxRate).HasPrecision(18, 4); //MF 25.11.16 + + + this.HasRequired(orderItem => orderItem.Order) + .WithMany(o => o.OrderItems) + .HasForeignKey(orderItem => orderItem.OrderId); + + this.HasRequired(orderItem => orderItem.Product) + .WithMany() + .HasForeignKey(orderItem => orderItem.ProductId); + } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Data/Mapping/Orders/OrderMap.cs b/src/Libraries/Nop.Data/Mapping/Orders/OrderMap.cs index 74eb3da187a..d9221fd4b13 100644 --- a/src/Libraries/Nop.Data/Mapping/Orders/OrderMap.cs +++ b/src/Libraries/Nop.Data/Mapping/Orders/OrderMap.cs @@ -1,53 +1,61 @@ -using Nop.Core.Domain.Orders; - -namespace Nop.Data.Mapping.Orders -{ - public partial class OrderMap : NopEntityTypeConfiguration - { - public OrderMap() - { - this.ToTable("Order"); - this.HasKey(o => o.Id); - this.Property(o => o.CurrencyRate).HasPrecision(18, 8); - this.Property(o => o.OrderSubtotalInclTax).HasPrecision(18, 4); - this.Property(o => o.OrderSubtotalExclTax).HasPrecision(18, 4); - this.Property(o => o.OrderSubTotalDiscountInclTax).HasPrecision(18, 4); - this.Property(o => o.OrderSubTotalDiscountExclTax).HasPrecision(18, 4); - this.Property(o => o.OrderShippingInclTax).HasPrecision(18, 4); - this.Property(o => o.OrderShippingExclTax).HasPrecision(18, 4); - this.Property(o => o.PaymentMethodAdditionalFeeInclTax).HasPrecision(18, 4); - this.Property(o => o.PaymentMethodAdditionalFeeExclTax).HasPrecision(18, 4); - this.Property(o => o.OrderTax).HasPrecision(18, 4); - this.Property(o => o.OrderDiscount).HasPrecision(18, 4); - this.Property(o => o.OrderTotal).HasPrecision(18, 4); - this.Property(o => o.RefundedAmount).HasPrecision(18, 4); - this.Property(o => o.CustomOrderNumber).IsRequired(); - - this.Ignore(o => o.OrderStatus); - this.Ignore(o => o.PaymentStatus); - this.Ignore(o => o.ShippingStatus); - this.Ignore(o => o.CustomerTaxDisplayType); - this.Ignore(o => o.TaxRatesDictionary); - - this.HasRequired(o => o.Customer) - .WithMany() - .HasForeignKey(o => o.CustomerId); - - //code below is commented because it causes some issues on big databases - http://www.nopcommerce.com/boards/t/11126/bug-version-20-command-confirm-takes-several-minutes-using-big-databases.aspx - //this.HasRequired(o => o.BillingAddress).WithOptional().Map(x => x.MapKey("BillingAddressId")).WillCascadeOnDelete(false); - //this.HasOptional(o => o.ShippingAddress).WithOptionalDependent().Map(x => x.MapKey("ShippingAddressId")).WillCascadeOnDelete(false); - this.HasRequired(o => o.BillingAddress) - .WithMany() - .HasForeignKey(o => o.BillingAddressId) - .WillCascadeOnDelete(false); - this.HasOptional(o => o.ShippingAddress) - .WithMany() - .HasForeignKey(o => o.ShippingAddressId) - .WillCascadeOnDelete(false); - this.HasOptional(o => o.PickupAddress) - .WithMany() - .HasForeignKey(o => o.PickupAddressId) - .WillCascadeOnDelete(false); - } - } +using Nop.Core.Domain.Orders; + +namespace Nop.Data.Mapping.Orders +{ + public partial class OrderMap : NopEntityTypeConfiguration + { + public OrderMap() + { + this.ToTable("Order"); + this.HasKey(o => o.Id); + this.Property(o => o.CurrencyRate).HasPrecision(18, 8); + this.Property(o => o.OrderSubtotalInclTax).HasPrecision(18, 4); + this.Property(o => o.OrderSubtotalExclTax).HasPrecision(18, 4); + this.Property(o => o.OrderSubTotalDiscountInclTax).HasPrecision(18, 4); + this.Property(o => o.OrderSubTotalDiscountExclTax).HasPrecision(18, 4); + this.Property(o => o.OrderShippingInclTax).HasPrecision(18, 4); + this.Property(o => o.OrderShippingExclTax).HasPrecision(18, 4); + this.Property(o => o.OrderShippingNonTaxable).HasPrecision(18, 4); + this.Property(o => o.PaymentMethodAdditionalFeeInclTax).HasPrecision(18, 4); + this.Property(o => o.PaymentMethodAdditionalFeeExclTax).HasPrecision(18, 4); + this.Property(o => o.PaymentMethodAdditionalFeeNonTaxable).HasPrecision(18, 4); + this.Property(o => o.OrderTax).HasPrecision(18, 4); + this.Property(o => o.OrderDiscount).HasPrecision(18, 4); + this.Property(o => o.OrderAmount).HasPrecision(18, 4); //MF 09.12.16 + this.Property(o => o.OrderAmountIncl).HasPrecision(18, 4); //MF 09.12.16 + this.Property(o => o.OrderDiscountIncl).HasPrecision(18, 4); + this.Property(o => o.EarnedRewardPointsBaseAmountIncl).HasPrecision(18, 4); + this.Property(o => o.EarnedRewardPointsBaseAmountExcl).HasPrecision(18, 4); + this.Property(o => o.OrderTotal).HasPrecision(18, 4); + this.Property(o => o.RefundedAmount).HasPrecision(18, 4); + this.Property(o => o.CustomOrderNumber).IsRequired(); + + this.Ignore(o => o.OrderStatus); + this.Ignore(o => o.PaymentStatus); + this.Ignore(o => o.ShippingStatus); + this.Ignore(o => o.CustomerTaxDisplayType); + this.Ignore(o => o.TaxRatesDictionary); + this.Ignore(o => o.OrderTotalAmountIncl); + + this.HasRequired(o => o.Customer) + .WithMany() + .HasForeignKey(o => o.CustomerId); + + //code below is commented because it causes some issues on big databases - http://www.nopcommerce.com/boards/t/11126/bug-version-20-command-confirm-takes-several-minutes-using-big-databases.aspx + //this.HasRequired(o => o.BillingAddress).WithOptional().Map(x => x.MapKey("BillingAddressId")).WillCascadeOnDelete(false); + //this.HasOptional(o => o.ShippingAddress).WithOptionalDependent().Map(x => x.MapKey("ShippingAddressId")).WillCascadeOnDelete(false); + this.HasRequired(o => o.BillingAddress) + .WithMany() + .HasForeignKey(o => o.BillingAddressId) + .WillCascadeOnDelete(false); + this.HasOptional(o => o.ShippingAddress) + .WithMany() + .HasForeignKey(o => o.ShippingAddressId) + .WillCascadeOnDelete(false); + this.HasOptional(o => o.PickupAddress) + .WithMany() + .HasForeignKey(o => o.PickupAddressId) + .WillCascadeOnDelete(false); + } + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Data/Mapping/Orders/ShoppingCartItemMap.cs b/src/Libraries/Nop.Data/Mapping/Orders/ShoppingCartItemMap.cs index 4f14308ba1b..55a6cba7e16 100644 --- a/src/Libraries/Nop.Data/Mapping/Orders/ShoppingCartItemMap.cs +++ b/src/Libraries/Nop.Data/Mapping/Orders/ShoppingCartItemMap.cs @@ -1,29 +1,32 @@ -using Nop.Core.Domain.Orders; - -namespace Nop.Data.Mapping.Orders -{ - public partial class ShoppingCartItemMap : NopEntityTypeConfiguration - { - public ShoppingCartItemMap() - { - this.ToTable("ShoppingCartItem"); - this.HasKey(sci => sci.Id); - - this.Property(sci => sci.CustomerEnteredPrice).HasPrecision(18, 4); - - this.Ignore(sci => sci.ShoppingCartType); - this.Ignore(sci => sci.IsFreeShipping); - this.Ignore(sci => sci.IsShipEnabled); - this.Ignore(sci => sci.AdditionalShippingCharge); - this.Ignore(sci => sci.IsTaxExempt); - - this.HasRequired(sci => sci.Customer) - .WithMany(c => c.ShoppingCartItems) - .HasForeignKey(sci => sci.CustomerId); - - this.HasRequired(sci => sci.Product) - .WithMany() - .HasForeignKey(sci => sci.ProductId); - } - } -} +using Nop.Core.Domain.Orders; + +namespace Nop.Data.Mapping.Orders +{ + public partial class ShoppingCartItemMap : NopEntityTypeConfiguration + { + public ShoppingCartItemMap() + { + this.ToTable("ShoppingCartItem"); + this.HasKey(sci => sci.Id); + + this.Property(sci => sci.CustomerEnteredPrice).HasPrecision(18, 4); + + this.Ignore(sci => sci.ShoppingCartType); + this.Ignore(sci => sci.IsFreeShipping); + this.Ignore(sci => sci.IsShipEnabled); + this.Ignore(sci => sci.AdditionalShippingCharge); + this.Ignore(sci => sci.IsTaxExempt); + this.Ignore(sci => sci.TaxRate); + this.Ignore(sci => sci.SubTotalExclTax); + this.Ignore(sci => sci.SubTotalInclTax); + + this.HasRequired(sci => sci.Customer) + .WithMany(c => c.ShoppingCartItems) + .HasForeignKey(sci => sci.CustomerId); + + this.HasRequired(sci => sci.Product) + .WithMany() + .HasForeignKey(sci => sci.ProductId); + } + } +} diff --git a/src/Libraries/Nop.Services/Catalog/CopyProductService.cs b/src/Libraries/Nop.Services/Catalog/CopyProductService.cs index 2d9aefa3470..0a2bb4d12a4 100644 --- a/src/Libraries/Nop.Services/Catalog/CopyProductService.cs +++ b/src/Libraries/Nop.Services/Catalog/CopyProductService.cs @@ -1,635 +1,638 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Media; -using Nop.Services.Localization; -using Nop.Services.Media; -using Nop.Services.Seo; -using Nop.Services.Stores; - -namespace Nop.Services.Catalog -{ - /// - /// Copy Product service - /// - public partial class CopyProductService : ICopyProductService - { - #region Fields - - private readonly IProductService _productService; - private readonly IProductAttributeService _productAttributeService; - private readonly ILanguageService _languageService; - private readonly ILocalizedEntityService _localizedEntityService; - private readonly ILocalizationService _localizationService; - private readonly IPictureService _pictureService; - private readonly ICategoryService _categoryService; - private readonly IManufacturerService _manufacturerService; - private readonly ISpecificationAttributeService _specificationAttributeService; - private readonly IDownloadService _downloadService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IUrlRecordService _urlRecordService; - private readonly IStoreMappingService _storeMappingService; - - #endregion - - #region Ctor - - public CopyProductService(IProductService productService, - IProductAttributeService productAttributeService, - ILanguageService languageService, - ILocalizedEntityService localizedEntityService, - ILocalizationService localizationService, - IPictureService pictureService, - ICategoryService categoryService, - IManufacturerService manufacturerService, - ISpecificationAttributeService specificationAttributeService, - IDownloadService downloadService, - IProductAttributeParser productAttributeParser, - IUrlRecordService urlRecordService, - IStoreMappingService storeMappingService) - { - this._productService = productService; - this._productAttributeService = productAttributeService; - this._languageService = languageService; - this._localizedEntityService = localizedEntityService; - this._localizationService = localizationService; - this._pictureService = pictureService; - this._categoryService = categoryService; - this._manufacturerService = manufacturerService; - this._specificationAttributeService = specificationAttributeService; - this._downloadService = downloadService; - this._productAttributeParser = productAttributeParser; - this._urlRecordService = urlRecordService; - this._storeMappingService = storeMappingService; - } - - #endregion - - #region Methods - - /// - /// Create a copy of product with all depended data - /// - /// The product to copy - /// The name of product duplicate - /// A value indicating whether the product duplicate should be published - /// A value indicating whether the product images should be copied - /// A value indicating whether the copy associated products - /// Product copy - public virtual Product CopyProduct(Product product, string newName, - bool isPublished = true, bool copyImages = true, bool copyAssociatedProducts = true) - { - if (product == null) - throw new ArgumentNullException("product"); - - if (String.IsNullOrEmpty(newName)) - throw new ArgumentException("Product name is required"); - - //product download & sample download - int downloadId = product.DownloadId; - int sampleDownloadId = product.SampleDownloadId; - if (product.IsDownload) - { - var download = _downloadService.GetDownloadById(product.DownloadId); - if (download != null) - { - var downloadCopy = new Download - { - DownloadGuid = Guid.NewGuid(), - UseDownloadUrl = download.UseDownloadUrl, - DownloadUrl = download.DownloadUrl, - DownloadBinary = download.DownloadBinary, - ContentType = download.ContentType, - Filename = download.Filename, - Extension = download.Extension, - IsNew = download.IsNew, - }; - _downloadService.InsertDownload(downloadCopy); - downloadId = downloadCopy.Id; - } - - if (product.HasSampleDownload) - { - var sampleDownload = _downloadService.GetDownloadById(product.SampleDownloadId); - if (sampleDownload != null) - { - var sampleDownloadCopy = new Download - { - DownloadGuid = Guid.NewGuid(), - UseDownloadUrl = sampleDownload.UseDownloadUrl, - DownloadUrl = sampleDownload.DownloadUrl, - DownloadBinary = sampleDownload.DownloadBinary, - ContentType = sampleDownload.ContentType, - Filename = sampleDownload.Filename, - Extension = sampleDownload.Extension, - IsNew = sampleDownload.IsNew - }; - _downloadService.InsertDownload(sampleDownloadCopy); - sampleDownloadId = sampleDownloadCopy.Id; - } - } - } - - var newSku = !String.IsNullOrWhiteSpace(product.Sku) - ? string.Format(_localizationService.GetResource("Admin.Catalog.Products.Copy.SKU.New"), product.Sku) : - product.Sku; - // product - var productCopy = new Product - { - ProductTypeId = product.ProductTypeId, - ParentGroupedProductId = product.ParentGroupedProductId, - VisibleIndividually = product.VisibleIndividually, - Name = newName, - ShortDescription = product.ShortDescription, - FullDescription = product.FullDescription, - VendorId = product.VendorId, - ProductTemplateId = product.ProductTemplateId, - AdminComment = product.AdminComment, - ShowOnHomePage = product.ShowOnHomePage, - MetaKeywords = product.MetaKeywords, - MetaDescription = product.MetaDescription, - MetaTitle = product.MetaTitle, - AllowCustomerReviews = product.AllowCustomerReviews, - LimitedToStores = product.LimitedToStores, - Sku = newSku, - ManufacturerPartNumber = product.ManufacturerPartNumber, - Gtin = product.Gtin, - IsGiftCard = product.IsGiftCard, - GiftCardType = product.GiftCardType, - OverriddenGiftCardAmount = product.OverriddenGiftCardAmount, - RequireOtherProducts = product.RequireOtherProducts, - RequiredProductIds = product.RequiredProductIds, - AutomaticallyAddRequiredProducts = product.AutomaticallyAddRequiredProducts, - IsDownload = product.IsDownload, - DownloadId = downloadId, - UnlimitedDownloads = product.UnlimitedDownloads, - MaxNumberOfDownloads = product.MaxNumberOfDownloads, - DownloadExpirationDays = product.DownloadExpirationDays, - DownloadActivationType = product.DownloadActivationType, - HasSampleDownload = product.HasSampleDownload, - SampleDownloadId = sampleDownloadId, - HasUserAgreement = product.HasUserAgreement, - UserAgreementText = product.UserAgreementText, - IsRecurring = product.IsRecurring, - RecurringCycleLength = product.RecurringCycleLength, - RecurringCyclePeriod = product.RecurringCyclePeriod, - RecurringTotalCycles = product.RecurringTotalCycles, - IsRental = product.IsRental, - RentalPriceLength = product.RentalPriceLength, - RentalPricePeriod = product.RentalPricePeriod, - IsShipEnabled = product.IsShipEnabled, - IsFreeShipping = product.IsFreeShipping, - ShipSeparately = product.ShipSeparately, - AdditionalShippingCharge = product.AdditionalShippingCharge, - DeliveryDateId = product.DeliveryDateId, - IsTaxExempt = product.IsTaxExempt, - TaxCategoryId = product.TaxCategoryId, - IsTelecommunicationsOrBroadcastingOrElectronicServices = product.IsTelecommunicationsOrBroadcastingOrElectronicServices, - ManageInventoryMethod = product.ManageInventoryMethod, - ProductAvailabilityRangeId = product.ProductAvailabilityRangeId, - UseMultipleWarehouses = product.UseMultipleWarehouses, - WarehouseId = product.WarehouseId, - StockQuantity = product.StockQuantity, - DisplayStockAvailability = product.DisplayStockAvailability, - DisplayStockQuantity = product.DisplayStockQuantity, - MinStockQuantity = product.MinStockQuantity, - LowStockActivityId = product.LowStockActivityId, - NotifyAdminForQuantityBelow = product.NotifyAdminForQuantityBelow, - BackorderMode = product.BackorderMode, - AllowBackInStockSubscriptions = product.AllowBackInStockSubscriptions, - OrderMinimumQuantity = product.OrderMinimumQuantity, - OrderMaximumQuantity = product.OrderMaximumQuantity, - AllowedQuantities = product.AllowedQuantities, - AllowAddingOnlyExistingAttributeCombinations = product.AllowAddingOnlyExistingAttributeCombinations, - NotReturnable = product.NotReturnable, - DisableBuyButton = product.DisableBuyButton, - DisableWishlistButton = product.DisableWishlistButton, - AvailableForPreOrder = product.AvailableForPreOrder, - PreOrderAvailabilityStartDateTimeUtc = product.PreOrderAvailabilityStartDateTimeUtc, - CallForPrice = product.CallForPrice, - Price = product.Price, - OldPrice = product.OldPrice, - ProductCost = product.ProductCost, - CustomerEntersPrice = product.CustomerEntersPrice, - MinimumCustomerEnteredPrice = product.MinimumCustomerEnteredPrice, - MaximumCustomerEnteredPrice = product.MaximumCustomerEnteredPrice, - BasepriceEnabled = product.BasepriceEnabled, - BasepriceAmount = product.BasepriceAmount, - BasepriceUnitId = product.BasepriceUnitId, - BasepriceBaseAmount = product.BasepriceBaseAmount, - BasepriceBaseUnitId = product.BasepriceBaseUnitId, - MarkAsNew = product.MarkAsNew, - MarkAsNewStartDateTimeUtc = product.MarkAsNewStartDateTimeUtc, - MarkAsNewEndDateTimeUtc = product.MarkAsNewEndDateTimeUtc, - Weight = product.Weight, - Length = product.Length, - Width = product.Width, - Height = product.Height, - AvailableStartDateTimeUtc = product.AvailableStartDateTimeUtc, - AvailableEndDateTimeUtc = product.AvailableEndDateTimeUtc, - DisplayOrder = product.DisplayOrder, - Published = isPublished, - Deleted = product.Deleted, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - - //validate search engine name - _productService.InsertProduct(productCopy); - - //search engine name - _urlRecordService.SaveSlug(productCopy, productCopy.ValidateSeName("", productCopy.Name, true), 0); - - var languages = _languageService.GetAllLanguages(true); - - //localization - foreach (var lang in languages) - { - var name = product.GetLocalized(x => x.Name, lang.Id, false, false); - if (!String.IsNullOrEmpty(name)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.Name, name, lang.Id); - - var shortDescription = product.GetLocalized(x => x.ShortDescription, lang.Id, false, false); - if (!String.IsNullOrEmpty(shortDescription)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.ShortDescription, shortDescription, lang.Id); - - var fullDescription = product.GetLocalized(x => x.FullDescription, lang.Id, false, false); - if (!String.IsNullOrEmpty(fullDescription)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.FullDescription, fullDescription, lang.Id); - - var metaKeywords = product.GetLocalized(x => x.MetaKeywords, lang.Id, false, false); - if (!String.IsNullOrEmpty(metaKeywords)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaKeywords, metaKeywords, lang.Id); - - var metaDescription = product.GetLocalized(x => x.MetaDescription, lang.Id, false, false); - if (!String.IsNullOrEmpty(metaDescription)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaDescription, metaDescription, lang.Id); - - var metaTitle = product.GetLocalized(x => x.MetaTitle, lang.Id, false, false); - if (!String.IsNullOrEmpty(metaTitle)) - _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaTitle, metaTitle, lang.Id); - - //search engine name - _urlRecordService.SaveSlug(productCopy, productCopy.ValidateSeName("", name, false), lang.Id); - } - - //product tags - foreach (var productTag in product.ProductTags) - { - productCopy.ProductTags.Add(productTag); - } - _productService.UpdateProduct(productCopy); - - //product pictures - //variable to store original and new picture identifiers - var originalNewPictureIdentifiers = new Dictionary(); - if (copyImages) - { - foreach (var productPicture in product.ProductPictures) - { - var picture = productPicture.Picture; - var pictureCopy = _pictureService.InsertPicture( - _pictureService.LoadPictureBinary(picture), - picture.MimeType, - _pictureService.GetPictureSeName(newName), - picture.AltAttribute, - picture.TitleAttribute); - _productService.InsertProductPicture(new ProductPicture - { - ProductId = productCopy.Id, - PictureId = pictureCopy.Id, - DisplayOrder = productPicture.DisplayOrder - }); - originalNewPictureIdentifiers.Add(picture.Id, pictureCopy.Id); - } - } - - //quantity change history - _productService.AddStockQuantityHistoryEntry(productCopy, product.StockQuantity, product.StockQuantity, product.WarehouseId, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id)); - - // product <-> warehouses mappings - foreach (var pwi in product.ProductWarehouseInventory) - { - var pwiCopy = new ProductWarehouseInventory - { - ProductId = productCopy.Id, - WarehouseId = pwi.WarehouseId, - StockQuantity = pwi.StockQuantity, - ReservedQuantity = 0, - }; - - productCopy.ProductWarehouseInventory.Add(pwiCopy); - - //quantity change history - var message = string.Format("{0} {1}", _localizationService.GetResource("Admin.StockQuantityHistory.Messages.MultipleWarehouses"), - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id)); - _productService.AddStockQuantityHistoryEntry(productCopy, pwi.StockQuantity, pwi.StockQuantity, pwi.WarehouseId, message); - } - _productService.UpdateProduct(productCopy); - - // product <-> categories mappings - foreach (var productCategory in product.ProductCategories) - { - var productCategoryCopy = new ProductCategory - { - ProductId = productCopy.Id, - CategoryId = productCategory.CategoryId, - IsFeaturedProduct = productCategory.IsFeaturedProduct, - DisplayOrder = productCategory.DisplayOrder - }; - - _categoryService.InsertProductCategory(productCategoryCopy); - } - - // product <-> manufacturers mappings - foreach (var productManufacturers in product.ProductManufacturers) - { - var productManufacturerCopy = new ProductManufacturer - { - ProductId = productCopy.Id, - ManufacturerId = productManufacturers.ManufacturerId, - IsFeaturedProduct = productManufacturers.IsFeaturedProduct, - DisplayOrder = productManufacturers.DisplayOrder - }; - - _manufacturerService.InsertProductManufacturer(productManufacturerCopy); - } - - // product <-> releated products mappings - foreach (var relatedProduct in _productService.GetRelatedProductsByProductId1(product.Id, true)) - { - _productService.InsertRelatedProduct( - new RelatedProduct - { - ProductId1 = productCopy.Id, - ProductId2 = relatedProduct.ProductId2, - DisplayOrder = relatedProduct.DisplayOrder - }); - } - - // product <-> cross sells mappings - foreach (var csProduct in _productService.GetCrossSellProductsByProductId1(product.Id, true)) - { - _productService.InsertCrossSellProduct( - new CrossSellProduct - { - ProductId1 = productCopy.Id, - ProductId2 = csProduct.ProductId2, - }); - } - - // product specifications - foreach (var productSpecificationAttribute in product.ProductSpecificationAttributes) - { - var psaCopy = new ProductSpecificationAttribute - { - ProductId = productCopy.Id, - AttributeTypeId = productSpecificationAttribute.AttributeTypeId, - SpecificationAttributeOptionId = productSpecificationAttribute.SpecificationAttributeOptionId, - CustomValue = productSpecificationAttribute.CustomValue, - AllowFiltering = productSpecificationAttribute.AllowFiltering, - ShowOnProductPage = productSpecificationAttribute.ShowOnProductPage, - DisplayOrder = productSpecificationAttribute.DisplayOrder - }; - _specificationAttributeService.InsertProductSpecificationAttribute(psaCopy); - } - - //store mapping - var selectedStoreIds = _storeMappingService.GetStoresIdsWithAccess(product); - foreach (var id in selectedStoreIds) - { - _storeMappingService.InsertStoreMapping(productCopy, id); - } - - //product <-> attributes mappings - var associatedAttributes = new Dictionary(); - var associatedAttributeValues = new Dictionary(); - - //attribute mapping with condition attributes - var oldCopyWithConditionAttributes = new List(); - - //all product attribute mapping copies - var productAttributeMappingCopies = new Dictionary(); - - foreach (var productAttributeMapping in _productAttributeService.GetProductAttributeMappingsByProductId(product.Id)) - { - var productAttributeMappingCopy = new ProductAttributeMapping - { - ProductId = productCopy.Id, - ProductAttributeId = productAttributeMapping.ProductAttributeId, - TextPrompt = productAttributeMapping.TextPrompt, - IsRequired = productAttributeMapping.IsRequired, - AttributeControlTypeId = productAttributeMapping.AttributeControlTypeId, - DisplayOrder = productAttributeMapping.DisplayOrder, - ValidationMinLength = productAttributeMapping.ValidationMinLength, - ValidationMaxLength = productAttributeMapping.ValidationMaxLength, - ValidationFileAllowedExtensions = productAttributeMapping.ValidationFileAllowedExtensions, - ValidationFileMaximumSize = productAttributeMapping.ValidationFileMaximumSize, - DefaultValue = productAttributeMapping.DefaultValue - }; - _productAttributeService.InsertProductAttributeMapping(productAttributeMappingCopy); - - productAttributeMappingCopies.Add(productAttributeMappingCopy.Id, productAttributeMappingCopy); - - if (!string.IsNullOrEmpty(productAttributeMapping.ConditionAttributeXml)) - { - oldCopyWithConditionAttributes.Add(productAttributeMapping); - } - - //save associated value (used for combinations copying) - associatedAttributes.Add(productAttributeMapping.Id, productAttributeMappingCopy.Id); - - // product attribute values - var productAttributeValues = _productAttributeService.GetProductAttributeValues(productAttributeMapping.Id); - foreach (var productAttributeValue in productAttributeValues) - { - int attributeValuePictureId = 0; - if (originalNewPictureIdentifiers.ContainsKey(productAttributeValue.PictureId)) - { - attributeValuePictureId = originalNewPictureIdentifiers[productAttributeValue.PictureId]; - } - var attributeValueCopy = new ProductAttributeValue - { - ProductAttributeMappingId = productAttributeMappingCopy.Id, - AttributeValueTypeId = productAttributeValue.AttributeValueTypeId, - AssociatedProductId = productAttributeValue.AssociatedProductId, - Name = productAttributeValue.Name, - ColorSquaresRgb = productAttributeValue.ColorSquaresRgb, - PriceAdjustment = productAttributeValue.PriceAdjustment, - WeightAdjustment = productAttributeValue.WeightAdjustment, - Cost = productAttributeValue.Cost, - CustomerEntersQty = productAttributeValue.CustomerEntersQty, - Quantity = productAttributeValue.Quantity, - IsPreSelected = productAttributeValue.IsPreSelected, - DisplayOrder = productAttributeValue.DisplayOrder, - PictureId = attributeValuePictureId, - }; - //picture associated to "iamge square" attribute type (if exists) - if (productAttributeValue.ImageSquaresPictureId > 0) - { - var origImageSquaresPicture = _pictureService.GetPictureById(productAttributeValue.ImageSquaresPictureId); - if (origImageSquaresPicture != null) - { - //copy the picture - var imageSquaresPictureCopy = _pictureService.InsertPicture( - _pictureService.LoadPictureBinary(origImageSquaresPicture), - origImageSquaresPicture.MimeType, - origImageSquaresPicture.SeoFilename, - origImageSquaresPicture.AltAttribute, - origImageSquaresPicture.TitleAttribute); - attributeValueCopy.ImageSquaresPictureId = imageSquaresPictureCopy.Id; - } - } - - _productAttributeService.InsertProductAttributeValue(attributeValueCopy); - - //save associated value (used for combinations copying) - associatedAttributeValues.Add(productAttributeValue.Id, attributeValueCopy.Id); - - //localization - foreach (var lang in languages) - { - var name = productAttributeValue.GetLocalized(x => x.Name, lang.Id, false, false); - if (!String.IsNullOrEmpty(name)) - _localizedEntityService.SaveLocalizedValue(attributeValueCopy, x => x.Name, name, lang.Id); - } - } - } - - //copy attribute conditions - foreach (var productAttributeMapping in oldCopyWithConditionAttributes) - { - var oldConditionAttributeMapping = _productAttributeParser.ParseProductAttributeMappings(productAttributeMapping.ConditionAttributeXml).FirstOrDefault(); - - if (oldConditionAttributeMapping == null) - continue; - - var oldConditionValues = _productAttributeParser.ParseProductAttributeValues(productAttributeMapping.ConditionAttributeXml, oldConditionAttributeMapping.Id); - - if (!oldConditionValues.Any()) - continue; - - var newAttributeMappingId = associatedAttributes[oldConditionAttributeMapping.Id]; - var newConditionAttributeMapping = productAttributeMappingCopies[newAttributeMappingId]; - - var newConditionAttributeXml = string.Empty; - - foreach (var oldConditionValue in oldConditionValues) - { - newConditionAttributeXml = _productAttributeParser.AddProductAttribute(newConditionAttributeXml, newConditionAttributeMapping, associatedAttributeValues[oldConditionValue.Id].ToString()); - } - - var attributeMappingId = associatedAttributes[productAttributeMapping.Id]; - var conditionAttribute = productAttributeMappingCopies[attributeMappingId]; - conditionAttribute.ConditionAttributeXml = newConditionAttributeXml; - - _productAttributeService.UpdateProductAttributeMapping(conditionAttribute); - } - - //attribute combinations - foreach (var combination in _productAttributeService.GetAllProductAttributeCombinations(product.Id)) - { - //generate new AttributesXml according to new value IDs - string newAttributesXml = ""; - var parsedProductAttributes = _productAttributeParser.ParseProductAttributeMappings(combination.AttributesXml); - foreach (var oldAttribute in parsedProductAttributes) - { - if (associatedAttributes.ContainsKey(oldAttribute.Id)) - { - var newAttribute = _productAttributeService.GetProductAttributeMappingById(associatedAttributes[oldAttribute.Id]); - if (newAttribute != null) - { - var oldAttributeValuesStr = _productAttributeParser.ParseValues(combination.AttributesXml, oldAttribute.Id); - foreach (var oldAttributeValueStr in oldAttributeValuesStr) - { - if (newAttribute.ShouldHaveValues()) - { - //attribute values - int oldAttributeValue = int.Parse(oldAttributeValueStr); - if (associatedAttributeValues.ContainsKey(oldAttributeValue)) - { - var newAttributeValue = _productAttributeService.GetProductAttributeValueById(associatedAttributeValues[oldAttributeValue]); - if (newAttributeValue != null) - { - newAttributesXml = _productAttributeParser.AddProductAttribute(newAttributesXml, - newAttribute, newAttributeValue.Id.ToString()); - } - } - } - else - { - //just a text - newAttributesXml = _productAttributeParser.AddProductAttribute(newAttributesXml, - newAttribute, oldAttributeValueStr); - } - } - } - } - } - var combinationCopy = new ProductAttributeCombination - { - ProductId = productCopy.Id, - AttributesXml = newAttributesXml, - StockQuantity = combination.StockQuantity, - AllowOutOfStockOrders = combination.AllowOutOfStockOrders, - Sku = combination.Sku, - ManufacturerPartNumber = combination.ManufacturerPartNumber, - Gtin = combination.Gtin, - OverriddenPrice = combination.OverriddenPrice, - NotifyAdminForQuantityBelow = combination.NotifyAdminForQuantityBelow - }; - _productAttributeService.InsertProductAttributeCombination(combinationCopy); - - //quantity change history - _productService.AddStockQuantityHistoryEntry(productCopy, combination.StockQuantity, combination.StockQuantity, - message: string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id), combinationId: combination.Id); - } - - //tier prices - foreach (var tierPrice in product.TierPrices) - { - _productService.InsertTierPrice( - new TierPrice - { - ProductId = productCopy.Id, - StoreId = tierPrice.StoreId, - CustomerRoleId = tierPrice.CustomerRoleId, - Quantity = tierPrice.Quantity, - Price = tierPrice.Price, - StartDateTimeUtc = tierPrice.StartDateTimeUtc, - EndDateTimeUtc = tierPrice.EndDateTimeUtc - }); - } - - // product <-> discounts mapping - foreach (var discount in product.AppliedDiscounts) - { - productCopy.AppliedDiscounts.Add(discount); - _productService.UpdateProduct(productCopy); - } - - //update "HasTierPrices" and "HasDiscountsApplied" properties - _productService.UpdateHasTierPricesProperty(productCopy); - _productService.UpdateHasDiscountsApplied(productCopy); - - //associated products - if (copyAssociatedProducts) - { - var associatedProducts = _productService.GetAssociatedProducts(product.Id, showHidden: true); - foreach (var associatedProduct in associatedProducts) - { - var associatedProductCopy = CopyProduct(associatedProduct, string.Format("Copy of {0}", associatedProduct.Name), - isPublished, copyImages, false); - associatedProductCopy.ParentGroupedProductId = productCopy.Id; - _productService.UpdateProduct(productCopy); - } - } - - return productCopy; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Media; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Seo; +using Nop.Services.Stores; + +namespace Nop.Services.Catalog +{ + /// + /// Copy Product service + /// + public partial class CopyProductService : ICopyProductService + { + #region Fields + + private readonly IProductService _productService; + private readonly IProductAttributeService _productAttributeService; + private readonly ILanguageService _languageService; + private readonly ILocalizedEntityService _localizedEntityService; + private readonly ILocalizationService _localizationService; + private readonly IPictureService _pictureService; + private readonly ICategoryService _categoryService; + private readonly IManufacturerService _manufacturerService; + private readonly ISpecificationAttributeService _specificationAttributeService; + private readonly IDownloadService _downloadService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IUrlRecordService _urlRecordService; + private readonly IStoreMappingService _storeMappingService; + + #endregion + + #region Ctor + + public CopyProductService(IProductService productService, + IProductAttributeService productAttributeService, + ILanguageService languageService, + ILocalizedEntityService localizedEntityService, + ILocalizationService localizationService, + IPictureService pictureService, + ICategoryService categoryService, + IManufacturerService manufacturerService, + ISpecificationAttributeService specificationAttributeService, + IDownloadService downloadService, + IProductAttributeParser productAttributeParser, + IUrlRecordService urlRecordService, + IStoreMappingService storeMappingService) + { + this._productService = productService; + this._productAttributeService = productAttributeService; + this._languageService = languageService; + this._localizedEntityService = localizedEntityService; + this._localizationService = localizationService; + this._pictureService = pictureService; + this._categoryService = categoryService; + this._manufacturerService = manufacturerService; + this._specificationAttributeService = specificationAttributeService; + this._downloadService = downloadService; + this._productAttributeParser = productAttributeParser; + this._urlRecordService = urlRecordService; + this._storeMappingService = storeMappingService; + } + + #endregion + + #region Methods + + /// + /// Create a copy of product with all depended data + /// + /// The product to copy + /// The name of product duplicate + /// A value indicating whether the product duplicate should be published + /// A value indicating whether the product images should be copied + /// A value indicating whether the copy associated products + /// Product copy + public virtual Product CopyProduct(Product product, string newName, + bool isPublished = true, bool copyImages = true, bool copyAssociatedProducts = true) + { + if (product == null) + throw new ArgumentNullException("product"); + + if (String.IsNullOrEmpty(newName)) + throw new ArgumentException("Product name is required"); + + //product download & sample download + int downloadId = product.DownloadId; + int sampleDownloadId = product.SampleDownloadId; + if (product.IsDownload) + { + var download = _downloadService.GetDownloadById(product.DownloadId); + if (download != null) + { + var downloadCopy = new Download + { + DownloadGuid = Guid.NewGuid(), + UseDownloadUrl = download.UseDownloadUrl, + DownloadUrl = download.DownloadUrl, + DownloadBinary = download.DownloadBinary, + ContentType = download.ContentType, + Filename = download.Filename, + Extension = download.Extension, + IsNew = download.IsNew, + }; + _downloadService.InsertDownload(downloadCopy); + downloadId = downloadCopy.Id; + } + + if (product.HasSampleDownload) + { + var sampleDownload = _downloadService.GetDownloadById(product.SampleDownloadId); + if (sampleDownload != null) + { + var sampleDownloadCopy = new Download + { + DownloadGuid = Guid.NewGuid(), + UseDownloadUrl = sampleDownload.UseDownloadUrl, + DownloadUrl = sampleDownload.DownloadUrl, + DownloadBinary = sampleDownload.DownloadBinary, + ContentType = sampleDownload.ContentType, + Filename = sampleDownload.Filename, + Extension = sampleDownload.Extension, + IsNew = sampleDownload.IsNew + }; + _downloadService.InsertDownload(sampleDownloadCopy); + sampleDownloadId = sampleDownloadCopy.Id; + } + } + } + + var newSku = !String.IsNullOrWhiteSpace(product.Sku) + ? string.Format(_localizationService.GetResource("Admin.Catalog.Products.Copy.SKU.New"), product.Sku) : + product.Sku; + // product + var productCopy = new Product + { + ProductTypeId = product.ProductTypeId, + ParentGroupedProductId = product.ParentGroupedProductId, + VisibleIndividually = product.VisibleIndividually, + Name = newName, + ShortDescription = product.ShortDescription, + FullDescription = product.FullDescription, + VendorId = product.VendorId, + ProductTemplateId = product.ProductTemplateId, + AdminComment = product.AdminComment, + ShowOnHomePage = product.ShowOnHomePage, + MetaKeywords = product.MetaKeywords, + MetaDescription = product.MetaDescription, + MetaTitle = product.MetaTitle, + AllowCustomerReviews = product.AllowCustomerReviews, + LimitedToStores = product.LimitedToStores, + Sku = newSku, + ManufacturerPartNumber = product.ManufacturerPartNumber, + Gtin = product.Gtin, + IsGiftCard = product.IsGiftCard, + GiftCardType = product.GiftCardType, + OverriddenGiftCardAmount = product.OverriddenGiftCardAmount, + IsRewardPoints = product.IsRewardPoints, + OverriddenRPExchangeRate = product.OverriddenRPExchangeRate, + ExcludeFromRewardPoints = product.ExcludeFromRewardPoints, + RequireOtherProducts = product.RequireOtherProducts, + RequiredProductIds = product.RequiredProductIds, + AutomaticallyAddRequiredProducts = product.AutomaticallyAddRequiredProducts, + IsDownload = product.IsDownload, + DownloadId = downloadId, + UnlimitedDownloads = product.UnlimitedDownloads, + MaxNumberOfDownloads = product.MaxNumberOfDownloads, + DownloadExpirationDays = product.DownloadExpirationDays, + DownloadActivationType = product.DownloadActivationType, + HasSampleDownload = product.HasSampleDownload, + SampleDownloadId = sampleDownloadId, + HasUserAgreement = product.HasUserAgreement, + UserAgreementText = product.UserAgreementText, + IsRecurring = product.IsRecurring, + RecurringCycleLength = product.RecurringCycleLength, + RecurringCyclePeriod = product.RecurringCyclePeriod, + RecurringTotalCycles = product.RecurringTotalCycles, + IsRental = product.IsRental, + RentalPriceLength = product.RentalPriceLength, + RentalPricePeriod = product.RentalPricePeriod, + IsShipEnabled = product.IsShipEnabled, + IsFreeShipping = product.IsFreeShipping, + ShipSeparately = product.ShipSeparately, + AdditionalShippingCharge = product.AdditionalShippingCharge, + DeliveryDateId = product.DeliveryDateId, + IsTaxExempt = product.IsTaxExempt, + TaxCategoryId = product.TaxCategoryId, + IsTelecommunicationsOrBroadcastingOrElectronicServices = product.IsTelecommunicationsOrBroadcastingOrElectronicServices, + ManageInventoryMethod = product.ManageInventoryMethod, + ProductAvailabilityRangeId = product.ProductAvailabilityRangeId, + UseMultipleWarehouses = product.UseMultipleWarehouses, + WarehouseId = product.WarehouseId, + StockQuantity = product.StockQuantity, + DisplayStockAvailability = product.DisplayStockAvailability, + DisplayStockQuantity = product.DisplayStockQuantity, + MinStockQuantity = product.MinStockQuantity, + LowStockActivityId = product.LowStockActivityId, + NotifyAdminForQuantityBelow = product.NotifyAdminForQuantityBelow, + BackorderMode = product.BackorderMode, + AllowBackInStockSubscriptions = product.AllowBackInStockSubscriptions, + OrderMinimumQuantity = product.OrderMinimumQuantity, + OrderMaximumQuantity = product.OrderMaximumQuantity, + AllowedQuantities = product.AllowedQuantities, + AllowAddingOnlyExistingAttributeCombinations = product.AllowAddingOnlyExistingAttributeCombinations, + NotReturnable = product.NotReturnable, + DisableBuyButton = product.DisableBuyButton, + DisableWishlistButton = product.DisableWishlistButton, + AvailableForPreOrder = product.AvailableForPreOrder, + PreOrderAvailabilityStartDateTimeUtc = product.PreOrderAvailabilityStartDateTimeUtc, + CallForPrice = product.CallForPrice, + Price = product.Price, + OldPrice = product.OldPrice, + ProductCost = product.ProductCost, + CustomerEntersPrice = product.CustomerEntersPrice, + MinimumCustomerEnteredPrice = product.MinimumCustomerEnteredPrice, + MaximumCustomerEnteredPrice = product.MaximumCustomerEnteredPrice, + BasepriceEnabled = product.BasepriceEnabled, + BasepriceAmount = product.BasepriceAmount, + BasepriceUnitId = product.BasepriceUnitId, + BasepriceBaseAmount = product.BasepriceBaseAmount, + BasepriceBaseUnitId = product.BasepriceBaseUnitId, + MarkAsNew = product.MarkAsNew, + MarkAsNewStartDateTimeUtc = product.MarkAsNewStartDateTimeUtc, + MarkAsNewEndDateTimeUtc = product.MarkAsNewEndDateTimeUtc, + Weight = product.Weight, + Length = product.Length, + Width = product.Width, + Height = product.Height, + AvailableStartDateTimeUtc = product.AvailableStartDateTimeUtc, + AvailableEndDateTimeUtc = product.AvailableEndDateTimeUtc, + DisplayOrder = product.DisplayOrder, + Published = isPublished, + Deleted = product.Deleted, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + + //validate search engine name + _productService.InsertProduct(productCopy); + + //search engine name + _urlRecordService.SaveSlug(productCopy, productCopy.ValidateSeName("", productCopy.Name, true), 0); + + var languages = _languageService.GetAllLanguages(true); + + //localization + foreach (var lang in languages) + { + var name = product.GetLocalized(x => x.Name, lang.Id, false, false); + if (!String.IsNullOrEmpty(name)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.Name, name, lang.Id); + + var shortDescription = product.GetLocalized(x => x.ShortDescription, lang.Id, false, false); + if (!String.IsNullOrEmpty(shortDescription)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.ShortDescription, shortDescription, lang.Id); + + var fullDescription = product.GetLocalized(x => x.FullDescription, lang.Id, false, false); + if (!String.IsNullOrEmpty(fullDescription)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.FullDescription, fullDescription, lang.Id); + + var metaKeywords = product.GetLocalized(x => x.MetaKeywords, lang.Id, false, false); + if (!String.IsNullOrEmpty(metaKeywords)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaKeywords, metaKeywords, lang.Id); + + var metaDescription = product.GetLocalized(x => x.MetaDescription, lang.Id, false, false); + if (!String.IsNullOrEmpty(metaDescription)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaDescription, metaDescription, lang.Id); + + var metaTitle = product.GetLocalized(x => x.MetaTitle, lang.Id, false, false); + if (!String.IsNullOrEmpty(metaTitle)) + _localizedEntityService.SaveLocalizedValue(productCopy, x => x.MetaTitle, metaTitle, lang.Id); + + //search engine name + _urlRecordService.SaveSlug(productCopy, productCopy.ValidateSeName("", name, false), lang.Id); + } + + //product tags + foreach (var productTag in product.ProductTags) + { + productCopy.ProductTags.Add(productTag); + } + _productService.UpdateProduct(productCopy); + + //product pictures + //variable to store original and new picture identifiers + var originalNewPictureIdentifiers = new Dictionary(); + if (copyImages) + { + foreach (var productPicture in product.ProductPictures) + { + var picture = productPicture.Picture; + var pictureCopy = _pictureService.InsertPicture( + _pictureService.LoadPictureBinary(picture), + picture.MimeType, + _pictureService.GetPictureSeName(newName), + picture.AltAttribute, + picture.TitleAttribute); + _productService.InsertProductPicture(new ProductPicture + { + ProductId = productCopy.Id, + PictureId = pictureCopy.Id, + DisplayOrder = productPicture.DisplayOrder + }); + originalNewPictureIdentifiers.Add(picture.Id, pictureCopy.Id); + } + } + + //quantity change history + _productService.AddStockQuantityHistoryEntry(productCopy, product.StockQuantity, product.StockQuantity, product.WarehouseId, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id)); + + // product <-> warehouses mappings + foreach (var pwi in product.ProductWarehouseInventory) + { + var pwiCopy = new ProductWarehouseInventory + { + ProductId = productCopy.Id, + WarehouseId = pwi.WarehouseId, + StockQuantity = pwi.StockQuantity, + ReservedQuantity = 0, + }; + + productCopy.ProductWarehouseInventory.Add(pwiCopy); + + //quantity change history + var message = string.Format("{0} {1}", _localizationService.GetResource("Admin.StockQuantityHistory.Messages.MultipleWarehouses"), + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id)); + _productService.AddStockQuantityHistoryEntry(productCopy, pwi.StockQuantity, pwi.StockQuantity, pwi.WarehouseId, message); + } + _productService.UpdateProduct(productCopy); + + // product <-> categories mappings + foreach (var productCategory in product.ProductCategories) + { + var productCategoryCopy = new ProductCategory + { + ProductId = productCopy.Id, + CategoryId = productCategory.CategoryId, + IsFeaturedProduct = productCategory.IsFeaturedProduct, + DisplayOrder = productCategory.DisplayOrder + }; + + _categoryService.InsertProductCategory(productCategoryCopy); + } + + // product <-> manufacturers mappings + foreach (var productManufacturers in product.ProductManufacturers) + { + var productManufacturerCopy = new ProductManufacturer + { + ProductId = productCopy.Id, + ManufacturerId = productManufacturers.ManufacturerId, + IsFeaturedProduct = productManufacturers.IsFeaturedProduct, + DisplayOrder = productManufacturers.DisplayOrder + }; + + _manufacturerService.InsertProductManufacturer(productManufacturerCopy); + } + + // product <-> releated products mappings + foreach (var relatedProduct in _productService.GetRelatedProductsByProductId1(product.Id, true)) + { + _productService.InsertRelatedProduct( + new RelatedProduct + { + ProductId1 = productCopy.Id, + ProductId2 = relatedProduct.ProductId2, + DisplayOrder = relatedProduct.DisplayOrder + }); + } + + // product <-> cross sells mappings + foreach (var csProduct in _productService.GetCrossSellProductsByProductId1(product.Id, true)) + { + _productService.InsertCrossSellProduct( + new CrossSellProduct + { + ProductId1 = productCopy.Id, + ProductId2 = csProduct.ProductId2, + }); + } + + // product specifications + foreach (var productSpecificationAttribute in product.ProductSpecificationAttributes) + { + var psaCopy = new ProductSpecificationAttribute + { + ProductId = productCopy.Id, + AttributeTypeId = productSpecificationAttribute.AttributeTypeId, + SpecificationAttributeOptionId = productSpecificationAttribute.SpecificationAttributeOptionId, + CustomValue = productSpecificationAttribute.CustomValue, + AllowFiltering = productSpecificationAttribute.AllowFiltering, + ShowOnProductPage = productSpecificationAttribute.ShowOnProductPage, + DisplayOrder = productSpecificationAttribute.DisplayOrder + }; + _specificationAttributeService.InsertProductSpecificationAttribute(psaCopy); + } + + //store mapping + var selectedStoreIds = _storeMappingService.GetStoresIdsWithAccess(product); + foreach (var id in selectedStoreIds) + { + _storeMappingService.InsertStoreMapping(productCopy, id); + } + + //product <-> attributes mappings + var associatedAttributes = new Dictionary(); + var associatedAttributeValues = new Dictionary(); + + //attribute mapping with condition attributes + var oldCopyWithConditionAttributes = new List(); + + //all product attribute mapping copies + var productAttributeMappingCopies = new Dictionary(); + + foreach (var productAttributeMapping in _productAttributeService.GetProductAttributeMappingsByProductId(product.Id)) + { + var productAttributeMappingCopy = new ProductAttributeMapping + { + ProductId = productCopy.Id, + ProductAttributeId = productAttributeMapping.ProductAttributeId, + TextPrompt = productAttributeMapping.TextPrompt, + IsRequired = productAttributeMapping.IsRequired, + AttributeControlTypeId = productAttributeMapping.AttributeControlTypeId, + DisplayOrder = productAttributeMapping.DisplayOrder, + ValidationMinLength = productAttributeMapping.ValidationMinLength, + ValidationMaxLength = productAttributeMapping.ValidationMaxLength, + ValidationFileAllowedExtensions = productAttributeMapping.ValidationFileAllowedExtensions, + ValidationFileMaximumSize = productAttributeMapping.ValidationFileMaximumSize, + DefaultValue = productAttributeMapping.DefaultValue + }; + _productAttributeService.InsertProductAttributeMapping(productAttributeMappingCopy); + + productAttributeMappingCopies.Add(productAttributeMappingCopy.Id, productAttributeMappingCopy); + + if (!string.IsNullOrEmpty(productAttributeMapping.ConditionAttributeXml)) + { + oldCopyWithConditionAttributes.Add(productAttributeMapping); + } + + //save associated value (used for combinations copying) + associatedAttributes.Add(productAttributeMapping.Id, productAttributeMappingCopy.Id); + + // product attribute values + var productAttributeValues = _productAttributeService.GetProductAttributeValues(productAttributeMapping.Id); + foreach (var productAttributeValue in productAttributeValues) + { + int attributeValuePictureId = 0; + if (originalNewPictureIdentifiers.ContainsKey(productAttributeValue.PictureId)) + { + attributeValuePictureId = originalNewPictureIdentifiers[productAttributeValue.PictureId]; + } + var attributeValueCopy = new ProductAttributeValue + { + ProductAttributeMappingId = productAttributeMappingCopy.Id, + AttributeValueTypeId = productAttributeValue.AttributeValueTypeId, + AssociatedProductId = productAttributeValue.AssociatedProductId, + Name = productAttributeValue.Name, + ColorSquaresRgb = productAttributeValue.ColorSquaresRgb, + PriceAdjustment = productAttributeValue.PriceAdjustment, + WeightAdjustment = productAttributeValue.WeightAdjustment, + Cost = productAttributeValue.Cost, + CustomerEntersQty = productAttributeValue.CustomerEntersQty, + Quantity = productAttributeValue.Quantity, + IsPreSelected = productAttributeValue.IsPreSelected, + DisplayOrder = productAttributeValue.DisplayOrder, + PictureId = attributeValuePictureId, + }; + //picture associated to "iamge square" attribute type (if exists) + if (productAttributeValue.ImageSquaresPictureId > 0) + { + var origImageSquaresPicture = _pictureService.GetPictureById(productAttributeValue.ImageSquaresPictureId); + if (origImageSquaresPicture != null) + { + //copy the picture + var imageSquaresPictureCopy = _pictureService.InsertPicture( + _pictureService.LoadPictureBinary(origImageSquaresPicture), + origImageSquaresPicture.MimeType, + origImageSquaresPicture.SeoFilename, + origImageSquaresPicture.AltAttribute, + origImageSquaresPicture.TitleAttribute); + attributeValueCopy.ImageSquaresPictureId = imageSquaresPictureCopy.Id; + } + } + + _productAttributeService.InsertProductAttributeValue(attributeValueCopy); + + //save associated value (used for combinations copying) + associatedAttributeValues.Add(productAttributeValue.Id, attributeValueCopy.Id); + + //localization + foreach (var lang in languages) + { + var name = productAttributeValue.GetLocalized(x => x.Name, lang.Id, false, false); + if (!String.IsNullOrEmpty(name)) + _localizedEntityService.SaveLocalizedValue(attributeValueCopy, x => x.Name, name, lang.Id); + } + } + } + + //copy attribute conditions + foreach (var productAttributeMapping in oldCopyWithConditionAttributes) + { + var oldConditionAttributeMapping = _productAttributeParser.ParseProductAttributeMappings(productAttributeMapping.ConditionAttributeXml).FirstOrDefault(); + + if (oldConditionAttributeMapping == null) + continue; + + var oldConditionValues = _productAttributeParser.ParseProductAttributeValues(productAttributeMapping.ConditionAttributeXml, oldConditionAttributeMapping.Id); + + if (!oldConditionValues.Any()) + continue; + + var newAttributeMappingId = associatedAttributes[oldConditionAttributeMapping.Id]; + var newConditionAttributeMapping = productAttributeMappingCopies[newAttributeMappingId]; + + var newConditionAttributeXml = string.Empty; + + foreach (var oldConditionValue in oldConditionValues) + { + newConditionAttributeXml = _productAttributeParser.AddProductAttribute(newConditionAttributeXml, newConditionAttributeMapping, associatedAttributeValues[oldConditionValue.Id].ToString()); + } + + var attributeMappingId = associatedAttributes[productAttributeMapping.Id]; + var conditionAttribute = productAttributeMappingCopies[attributeMappingId]; + conditionAttribute.ConditionAttributeXml = newConditionAttributeXml; + + _productAttributeService.UpdateProductAttributeMapping(conditionAttribute); + } + + //attribute combinations + foreach (var combination in _productAttributeService.GetAllProductAttributeCombinations(product.Id)) + { + //generate new AttributesXml according to new value IDs + string newAttributesXml = ""; + var parsedProductAttributes = _productAttributeParser.ParseProductAttributeMappings(combination.AttributesXml); + foreach (var oldAttribute in parsedProductAttributes) + { + if (associatedAttributes.ContainsKey(oldAttribute.Id)) + { + var newAttribute = _productAttributeService.GetProductAttributeMappingById(associatedAttributes[oldAttribute.Id]); + if (newAttribute != null) + { + var oldAttributeValuesStr = _productAttributeParser.ParseValues(combination.AttributesXml, oldAttribute.Id); + foreach (var oldAttributeValueStr in oldAttributeValuesStr) + { + if (newAttribute.ShouldHaveValues()) + { + //attribute values + int oldAttributeValue = int.Parse(oldAttributeValueStr); + if (associatedAttributeValues.ContainsKey(oldAttributeValue)) + { + var newAttributeValue = _productAttributeService.GetProductAttributeValueById(associatedAttributeValues[oldAttributeValue]); + if (newAttributeValue != null) + { + newAttributesXml = _productAttributeParser.AddProductAttribute(newAttributesXml, + newAttribute, newAttributeValue.Id.ToString()); + } + } + } + else + { + //just a text + newAttributesXml = _productAttributeParser.AddProductAttribute(newAttributesXml, + newAttribute, oldAttributeValueStr); + } + } + } + } + } + var combinationCopy = new ProductAttributeCombination + { + ProductId = productCopy.Id, + AttributesXml = newAttributesXml, + StockQuantity = combination.StockQuantity, + AllowOutOfStockOrders = combination.AllowOutOfStockOrders, + Sku = combination.Sku, + ManufacturerPartNumber = combination.ManufacturerPartNumber, + Gtin = combination.Gtin, + OverriddenPrice = combination.OverriddenPrice, + NotifyAdminForQuantityBelow = combination.NotifyAdminForQuantityBelow + }; + _productAttributeService.InsertProductAttributeCombination(combinationCopy); + + //quantity change history + _productService.AddStockQuantityHistoryEntry(productCopy, combination.StockQuantity, combination.StockQuantity, + message: string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CopyProduct"), product.Id), combinationId: combination.Id); + } + + //tier prices + foreach (var tierPrice in product.TierPrices) + { + _productService.InsertTierPrice( + new TierPrice + { + ProductId = productCopy.Id, + StoreId = tierPrice.StoreId, + CustomerRoleId = tierPrice.CustomerRoleId, + Quantity = tierPrice.Quantity, + Price = tierPrice.Price, + StartDateTimeUtc = tierPrice.StartDateTimeUtc, + EndDateTimeUtc = tierPrice.EndDateTimeUtc + }); + } + + // product <-> discounts mapping + foreach (var discount in product.AppliedDiscounts) + { + productCopy.AppliedDiscounts.Add(discount); + _productService.UpdateProduct(productCopy); + } + + //update "HasTierPrices" and "HasDiscountsApplied" properties + _productService.UpdateHasTierPricesProperty(productCopy); + _productService.UpdateHasDiscountsApplied(productCopy); + + //associated products + if (copyAssociatedProducts) + { + var associatedProducts = _productService.GetAssociatedProducts(product.Id, showHidden: true); + foreach (var associatedProduct in associatedProducts) + { + var associatedProductCopy = CopyProduct(associatedProduct, string.Format("Copy of {0}", associatedProduct.Name), + isPublished, copyImages, false); + associatedProductCopy.ParentGroupedProductId = productCopy.Id; + _productService.UpdateProduct(productCopy); + } + } + + return productCopy; + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Catalog/IPriceCalculationService.cs b/src/Libraries/Nop.Services/Catalog/IPriceCalculationService.cs index 9012932b96e..0a83e1b11ce 100644 --- a/src/Libraries/Nop.Services/Catalog/IPriceCalculationService.cs +++ b/src/Libraries/Nop.Services/Catalog/IPriceCalculationService.cs @@ -1,158 +1,181 @@ -using System; -using System.Collections.Generic; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Services.Discounts; - -namespace Nop.Services.Catalog -{ - /// - /// Price calculation service - /// - public partial interface IPriceCalculationService - { - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Final price - decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge = decimal.Zero, - bool includeDiscounts = true, - int quantity = 1); - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Applied discount amount - /// Applied discounts - /// Final price - decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge, - bool includeDiscounts, - int quantity, - out decimal discountAmount, - out List appliedDiscounts); - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Rental period start date (for rental products) - /// Rental period end date (for rental products) - /// Applied discount amount - /// Applied discounts - /// Final price - decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge, - bool includeDiscounts, - int quantity, - DateTime? rentalStartDate, - DateTime? rentalEndDate, - out decimal discountAmount, - out List appliedDiscounts); - - - - /// - /// Gets the shopping cart unit price (one item) - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Shopping cart unit price (one item) - decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, - bool includeDiscounts = true); - /// - /// Gets the shopping cart unit price (one item) - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Shopping cart unit price (one item) - decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts); - /// - /// Gets the shopping cart unit price (one item) - /// - /// Product - /// Customer - /// Shopping cart type - /// Quantity - /// Product atrributes (XML format) - /// Customer entered price (if specified) - /// Rental start date (null for not rental products) - /// Rental end date (null for not rental products) - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Shopping cart unit price (one item) - decimal GetUnitPrice(Product product, - Customer customer, - ShoppingCartType shoppingCartType, - int quantity, - string attributesXml, - decimal customerEnteredPrice, - DateTime? rentalStartDate, DateTime? rentalEndDate, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts); - /// - /// Gets the shopping cart item sub total - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Shopping cart item sub total - decimal GetSubTotal(ShoppingCartItem shoppingCartItem, - bool includeDiscounts = true); - /// - /// Gets the shopping cart item sub total - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Maximum discounted qty. Return not nullable value if discount cannot be applied to ALL items - /// Shopping cart item sub total - decimal GetSubTotal(ShoppingCartItem shoppingCartItem, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts, - out int? maximumDiscountQty); - - /// - /// Gets the product cost (one item) - /// - /// Product - /// Shopping cart item attributes in XML - /// Product cost (one item) - decimal GetProductCost(Product product, string attributesXml); - - - - - /// - /// Get a price adjustment of a product attribute value - /// - /// Product attribute value - /// Price adjustment - decimal GetProductAttributeValuePriceAdjustment(ProductAttributeValue value); - } -} +using System; +using System.Collections.Generic; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Services.Discounts; + +namespace Nop.Services.Catalog +{ + /// + /// Price calculation service + /// + public partial interface IPriceCalculationService + { + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Final price + decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge = decimal.Zero, + bool includeDiscounts = true, + int quantity = 1); + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Applied discount amount + /// Applied discounts + /// Final price + decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + out decimal discountAmount, + out List appliedDiscounts); + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Rental period start date (for rental products) + /// Rental period end date (for rental products) + /// Applied discount amount + /// Applied discounts + /// Final price + decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + DateTime? rentalStartDate, + DateTime? rentalEndDate, + out decimal discountAmount, + out List appliedDiscounts); + + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Rental period start date (for rental products) + /// Rental period end date (for rental products) + /// Applied discount amount + /// Applied discounts + /// Overridden product price. If specified, then it'll be used instead of a product price. For example, used with product attribute combinations + /// Final price + decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + DateTime? rentalStartDate, + DateTime? rentalEndDate, + out decimal discountAmount, + out List appliedDiscounts, + decimal? overriddenProductPrice); + + /// + /// Gets the shopping cart unit price (one item) + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Shopping cart unit price (one item) + decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, + bool includeDiscounts = true); + /// + /// Gets the shopping cart unit price (one item) + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Shopping cart unit price (one item) + decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts); + /// + /// Gets the shopping cart unit price (one item) + /// + /// Product + /// Customer + /// Shopping cart type + /// Quantity + /// Product atrributes (XML format) + /// Customer entered price (if specified) + /// Rental start date (null for not rental products) + /// Rental end date (null for not rental products) + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Shopping cart unit price (one item) + decimal GetUnitPrice(Product product, + Customer customer, + ShoppingCartType shoppingCartType, + int quantity, + ref string attributesXml, + decimal customerEnteredPrice, + DateTime? rentalStartDate, DateTime? rentalEndDate, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts); + /// + /// Gets the shopping cart item sub total + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Shopping cart item sub total + decimal GetSubTotal(ShoppingCartItem shoppingCartItem, + bool includeDiscounts = true); + /// + /// Gets the shopping cart item sub total + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Maximum discounted qty. Return not nullable value if discount cannot be applied to ALL items + /// Shopping cart item sub total + decimal GetSubTotal(ShoppingCartItem shoppingCartItem, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts, + out int? maximumDiscountQty); + + /// + /// Gets the product cost (one item) + /// + /// Product + /// Shopping cart item attributes in XML + /// Product cost (one item) + decimal GetProductCost(Product product, string attributesXml); + + + + + /// + /// Get a price adjustment of a product attribute value + /// + /// Product attribute value + /// Price adjustment + decimal GetProductAttributeValuePriceAdjustment(ProductAttributeValue value); + } +} diff --git a/src/Libraries/Nop.Services/Catalog/IPriceFormatter.cs b/src/Libraries/Nop.Services/Catalog/IPriceFormatter.cs index 1ff03d84f61..1ce377eb4d5 100644 --- a/src/Libraries/Nop.Services/Catalog/IPriceFormatter.cs +++ b/src/Libraries/Nop.Services/Catalog/IPriceFormatter.cs @@ -43,7 +43,7 @@ public partial interface IPriceFormatter /// A value indicating whether to show tax suffix /// Language /// Price - string FormatPrice(decimal price, bool showCurrency, + string FormatPrice(decimal price, bool showCurrency, string currencyCode, bool showTax, Language language); /// @@ -67,7 +67,7 @@ string FormatPrice(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - string FormatPrice(decimal price, bool showCurrency, + string FormatPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax); /// @@ -80,7 +80,7 @@ string FormatPrice(decimal price, bool showCurrency, /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - string FormatPrice(decimal price, bool showCurrency, + string FormatPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax); /// @@ -110,7 +110,7 @@ string FormatPrice(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - string FormatShippingPrice(decimal price, bool showCurrency, + string FormatShippingPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax); /// /// Formats the shipping price @@ -122,9 +122,9 @@ string FormatShippingPrice(decimal price, bool showCurrency, /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - string FormatShippingPrice(decimal price, bool showCurrency, + string FormatShippingPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax); - + /// /// Formats the shipping price /// @@ -134,7 +134,7 @@ string FormatShippingPrice(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - string FormatShippingPrice(decimal price, bool showCurrency, + string FormatShippingPrice(decimal price, bool showCurrency, string currencyCode, Language language, bool priceIncludesTax); @@ -169,7 +169,7 @@ string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, + string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax); /// @@ -181,7 +181,7 @@ string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, + string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, string currencyCode, Language language, bool priceIncludesTax); @@ -192,5 +192,24 @@ string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, /// Tax rate /// Formatted tax rate string FormatTaxRate(decimal taxRate); + + /// + /// Adds tax suffix to text + /// + /// Text to format + /// Language + /// A value indicating whether price includes tax + /// + string FormatTaxString(string text, Language language, bool priceIncludesTax); + + /// + /// Adds tax suffix to text + /// + /// Text to format + /// Language + /// A value indicating whether price includes tax + /// Optional. A value indicating whether to show tax suffix. + /// + string FormatTaxString(string text, Language language, bool priceIncludesTax, bool showTax); } } diff --git a/src/Libraries/Nop.Services/Catalog/IProductAttributeFormatter.cs b/src/Libraries/Nop.Services/Catalog/IProductAttributeFormatter.cs index 25996258a40..86839fbf5aa 100644 --- a/src/Libraries/Nop.Services/Catalog/IProductAttributeFormatter.cs +++ b/src/Libraries/Nop.Services/Catalog/IProductAttributeFormatter.cs @@ -1,37 +1,39 @@ -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; - -namespace Nop.Services.Catalog -{ - /// - /// Product attribute formatter interface - /// - public partial interface IProductAttributeFormatter - { - /// - /// Formats attributes - /// - /// Product - /// Attributes in XML format - /// Attributes - string FormatAttributes(Product product, string attributesXml); - - /// - /// Formats attributes - /// - /// Product - /// Attributes in XML format - /// Customer - /// Serapator - /// A value indicating whether to encode (HTML) values - /// A value indicating whether to render prices - /// A value indicating whether to render product attributes - /// A value indicating whether to render gift card attributes - /// A value indicating whether to HTML hyperink tags could be rendered (if required) - /// Attributes - string FormatAttributes(Product product, string attributesXml, - Customer customer, string serapator = "
", bool htmlEncode = true, bool renderPrices = true, - bool renderProductAttributes = true, bool renderGiftCardAttributes = true, - bool allowHyperlinks = true); - } -} +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; + +namespace Nop.Services.Catalog +{ + /// + /// Product attribute formatter interface + /// + public partial interface IProductAttributeFormatter + { + /// + /// Formats attributes + /// + /// Product + /// Attributes in XML format + /// Attributes + string FormatAttributes(Product product, string attributesXml); + + /// + /// Formats attributes + /// + /// Product + /// Attributes in XML format + /// Customer + /// Serapator + /// A value indicating whether to encode (HTML) values + /// A value indicating whether to render prices + /// A value indicating whether to render product attributes + /// A value indicating whether to render gift card attributes + /// A value indicating whether to HTML hyperink tags could be rendered (if required) + /// A value indicating if attribute VAT should be rendered with price. Null is default, i.e. don't render + /// Attributes + string FormatAttributes(Product product, string attributesXml, + Customer customer, string serapator = "
", bool htmlEncode = true, bool renderPrices = true, + bool renderProductAttributes = true, bool renderGiftCardAttributes = true, + bool allowHyperlinks = true, + decimal? subTotal = null); + } +} diff --git a/src/Libraries/Nop.Services/Catalog/IProductAttributeParser.cs b/src/Libraries/Nop.Services/Catalog/IProductAttributeParser.cs index e68aa2553de..037409e56c8 100644 --- a/src/Libraries/Nop.Services/Catalog/IProductAttributeParser.cs +++ b/src/Libraries/Nop.Services/Catalog/IProductAttributeParser.cs @@ -1,122 +1,147 @@ -using System.Collections.Generic; -using Nop.Core.Domain.Catalog; - -namespace Nop.Services.Catalog -{ - /// - /// Product attribute parser interface - /// - public partial interface IProductAttributeParser - { - #region Product attributes - - /// - /// Gets selected product attribute mappings - /// - /// Attributes in XML format - /// Selected product attribute mappings - IList ParseProductAttributeMappings(string attributesXml); - - /// - /// Get product attribute values - /// - /// Attributes in XML format - /// Product attribute mapping identifier; pass 0 to load all values - /// Product attribute values - IList ParseProductAttributeValues(string attributesXml, int productAttributeMappingId = 0); - - /// - /// Gets selected product attribute values - /// - /// Attributes in XML format - /// Product attribute mapping identifier - /// Product attribute values - IList ParseValues(string attributesXml, int productAttributeMappingId); - - /// - /// Adds an attribute - /// - /// Attributes in XML format - /// Product attribute mapping - /// Value - /// Quantity (used with AttributeValueType.AssociatedToProduct to specify the quantity entered by the customer) - /// Updated result (XML format) - string AddProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping, string value, int? quantity = null); - - /// - /// Remove an attribute - /// - /// Attributes in XML format - /// Product attribute mapping - /// Updated result (XML format) - string RemoveProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping); - - /// - /// Are attributes equal - /// - /// The attributes of the first product - /// The attributes of the second product - /// A value indicating whether we should ignore non-combinable attributes - /// A value indicating whether we should ignore the quantity of attribute value entered by the customer - /// Result - bool AreProductAttributesEqual(string attributesXml1, string attributesXml2, bool ignoreNonCombinableAttributes, bool ignoreQuantity = true); - - /// - /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified - /// - /// Product attribute - /// Selected attributes (XML format) - /// Result - bool? IsConditionMet(ProductAttributeMapping pam, string selectedAttributesXml); - - /// - /// Finds a product attribute combination by attributes stored in XML - /// - /// Product - /// Attributes in XML format - /// A value indicating whether we should ignore non-combinable attributes - /// Found product attribute combination - ProductAttributeCombination FindProductAttributeCombination(Product product, - string attributesXml, bool ignoreNonCombinableAttributes = true); - - /// - /// Generate all combinations - /// - /// Product - /// A value indicating whether we should ignore non-combinable attributes - /// Attribute combinations in XML format - IList GenerateAllCombinations(Product product, bool ignoreNonCombinableAttributes = false); - - #endregion - - #region Gift card attributes - - /// - /// Add gift card attrbibutes - /// - /// Attributes in XML format - /// Recipient name - /// Recipient email - /// Sender name - /// Sender email - /// Message - /// Attributes - string AddGiftCardAttribute(string attributesXml, string recipientName, - string recipientEmail, string senderName, string senderEmail, string giftCardMessage); - - /// - /// Get gift card attrbibutes - /// - /// Attributes in XML format - /// Recipient name - /// Recipient email - /// Sender name - /// Sender email - /// Message - void GetGiftCardAttribute(string attributesXml, out string recipientName, - out string recipientEmail, out string senderName, - out string senderEmail, out string giftCardMessage); - - #endregion - } -} +using System.Collections.Generic; +using Nop.Core.Domain.Catalog; +using Nop.Services.Tax; + +namespace Nop.Services.Catalog +{ + /// + /// Product attribute parser interface + /// + public partial interface IProductAttributeParser + { + #region Product attributes + + /// + /// Gets selected product attribute mappings + /// + /// Attributes in XML format + /// Selected product attribute mappings + IList ParseProductAttributeMappings(string attributesXml); + + /// + /// Get product attribute values + /// + /// Attributes in XML format + /// Product attribute mapping identifier; pass 0 to load all values + /// Product attribute values + IList ParseProductAttributeValues(string attributesXml, int productAttributeMappingId = 0); + + /// + /// Gets selected product attribute values + /// + /// Attributes in XML format + /// Product attribute mapping identifier + /// Product attribute values + IList ParseValues(string attributesXml, int productAttributeMappingId); + + /// + /// Adds an attribute + /// + /// Attributes in XML format + /// Product attribute mapping + /// Value + /// Quantity (used with AttributeValueType.AssociatedToProduct to specify the quantity entered by the customer) + /// Updated result (XML format) + string AddProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping, string value, int? quantity = null); + + /// + /// Remove an attribute + /// + /// Attributes in XML format + /// Product attribute mapping + /// Updated result (XML format) + string RemoveProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping); + + /// + /// Are attributes equal + /// + /// The attributes of the first product + /// The attributes of the second product + /// A value indicating whether we should ignore non-combinable attributes + /// A value indicating whether we should ignore the quantity of attribute value entered by the customer + /// Result + bool AreProductAttributesEqual(string attributesXml1, string attributesXml2, bool ignoreNonCombinableAttributes, bool ignoreQuantity = true); + + /// + /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified + /// + /// Product attribute + /// Selected attributes (XML format) + /// Result + bool? IsConditionMet(ProductAttributeMapping pam, string selectedAttributesXml); + + /// + /// Finds a product attribute combination by attributes stored in XML + /// + /// Product + /// Attributes in XML format + /// A value indicating whether we should ignore non-combinable attributes + /// Found product attribute combination + ProductAttributeCombination FindProductAttributeCombination(Product product, + string attributesXml, bool ignoreNonCombinableAttributes = true); + + /// + /// Generate all combinations + /// + /// Product + /// A value indicating whether we should ignore non-combinable attributes + /// Attribute combinations in XML format + IList GenerateAllCombinations(Product product, bool ignoreNonCombinableAttributes = false); + + #endregion + + #region taxAttribute + /// + /// Adds tax subdivision to existing attributesXml + /// + /// Attributes in XML format + /// Set Product tax subdivision + /// Updated result (XML format) + string AddTaxAttribute(string attributesXml, TaxSummary taxSummary); + + /// + /// Parse ProductAttributesTax + /// + /// Attributes in XML format + /// SortedDictionary with taxRate and taxRateWeight + SortedDictionary ParseTaxAttribute(string attributesXml); + + /// + /// Check if attributesXml contains tax attribute information + /// + /// Attributes in XML format + /// A boolean value indicating if tax attribute info is present + bool hasTaxInfoInAttributeXML (string attributesXml); + #endregion + + #region Gift card attributes + + /// + /// Add gift card attrbibutes + /// + /// Attributes in XML format + /// Recipient name + /// Recipient email + /// Sender name + /// Sender email + /// Message + /// Attributes + string AddGiftCardAttribute(string attributesXml, string recipientName, + string recipientEmail, string senderName, string senderEmail, string giftCardMessage); + + /// + /// Get gift card attrbibutes + /// + /// Attributes in XML format + /// Recipient name + /// Recipient email + /// Sender name + /// Sender email + /// Message + void GetGiftCardAttribute(string attributesXml, out string recipientName, + out string recipientEmail, out string senderName, + out string senderEmail, out string giftCardMessage); + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Catalog/PriceCalculationService.cs b/src/Libraries/Nop.Services/Catalog/PriceCalculationService.cs index 4169a8fe86d..d2aa285daa9 100644 --- a/src/Libraries/Nop.Services/Catalog/PriceCalculationService.cs +++ b/src/Libraries/Nop.Services/Catalog/PriceCalculationService.cs @@ -1,749 +1,804 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Orders; -using Nop.Services.Catalog.Cache; -using Nop.Services.Customers; -using Nop.Services.Discounts; - -namespace Nop.Services.Catalog -{ - /// - /// Price calculation service - /// - public partial class PriceCalculationService : IPriceCalculationService - { - #region Fields - - private readonly IWorkContext _workContext; - private readonly IStoreContext _storeContext; - private readonly IDiscountService _discountService; - private readonly ICategoryService _categoryService; - private readonly IManufacturerService _manufacturerService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IProductService _productService; - private readonly ICacheManager _cacheManager; - private readonly ShoppingCartSettings _shoppingCartSettings; - private readonly CatalogSettings _catalogSettings; - - #endregion - - #region Ctor - - public PriceCalculationService(IWorkContext workContext, - IStoreContext storeContext, - IDiscountService discountService, - ICategoryService categoryService, - IManufacturerService manufacturerService, - IProductAttributeParser productAttributeParser, - IProductService productService, - ICacheManager cacheManager, - ShoppingCartSettings shoppingCartSettings, - CatalogSettings catalogSettings) - { - this._workContext = workContext; - this._storeContext = storeContext; - this._discountService = discountService; - this._categoryService = categoryService; - this._manufacturerService = manufacturerService; - this._productAttributeParser = productAttributeParser; - this._productService = productService; - this._cacheManager = cacheManager; - this._shoppingCartSettings = shoppingCartSettings; - this._catalogSettings = catalogSettings; - } - - #endregion - - #region Nested classes - - [Serializable] - protected class ProductPriceForCaching - { - public ProductPriceForCaching() - { - this.AppliedDiscounts = new List(); - } - - public decimal Price { get; set; } - public decimal AppliedDiscountAmount { get; set; } - public List AppliedDiscounts { get; set; } - } - #endregion - - #region Utilities - - /// - /// Gets allowed discounts applied to product - /// - /// Product - /// Customer - /// Discounts - protected virtual IList GetAllowedDiscountsAppliedToProduct(Product product, Customer customer) - { - var allowedDiscounts = new List(); - if (_catalogSettings.IgnoreDiscounts) - return allowedDiscounts; - - if (product.HasDiscountsApplied) - { - //we use this property ("HasDiscountsApplied") for performance optimization to avoid unnecessary database calls - foreach (var discount in product.AppliedDiscounts) - { - if (_discountService.ValidateDiscount(discount, customer).IsValid && - discount.DiscountType == DiscountType.AssignedToSkus) - allowedDiscounts.Add(discount.MapDiscount()); - } - } - - return allowedDiscounts; - } - - /// - /// Gets allowed discounts applied to categories - /// - /// Product - /// Customer - /// Discounts - protected virtual IList GetAllowedDiscountsAppliedToCategories(Product product, Customer customer) - { - var allowedDiscounts = new List(); - if (_catalogSettings.IgnoreDiscounts) - return allowedDiscounts; - - //load cached discount models (performance optimization) - foreach (var discount in _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)) - { - //load identifier of categories with this discount applied to - var discountCategoryIds = _discountService.GetAppliedCategoryIds(discount, customer); - - //compare with categories of this product - var productCategoryIds = new List(); - if (discountCategoryIds.Any()) - { - //load identifier of categories of this product - var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_CATEGORY_IDS_MODEL_KEY, - product.Id, - string.Join(",", customer.GetCustomerRoleIds()), - _storeContext.CurrentStore.Id); - productCategoryIds = _cacheManager.Get(cacheKey, () => - _categoryService - .GetProductCategoriesByProductId(product.Id) - .Select(x => x.CategoryId) - .ToList()); - } - - foreach (var categoryId in productCategoryIds) - { - if (discountCategoryIds.Contains(categoryId)) - { - if (_discountService.ValidateDiscount(discount, customer).IsValid && - !allowedDiscounts.ContainsDiscount(discount)) - allowedDiscounts.Add(discount); - } - } - } - - return allowedDiscounts; - } - - /// - /// Gets allowed discounts applied to manufacturers - /// - /// Product - /// Customer - /// Discounts - protected virtual IList GetAllowedDiscountsAppliedToManufacturers(Product product, Customer customer) - { - var allowedDiscounts = new List(); - if (_catalogSettings.IgnoreDiscounts) - return allowedDiscounts; - - foreach (var discount in _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)) - { - //load identifier of manufacturers with this discount applied to - var discountManufacturerIds = _discountService.GetAppliedManufacturerIds(discount, customer); - - //compare with manufacturers of this product - var productManufacturerIds = new List(); - if (discountManufacturerIds.Any()) - { - //load identifier of manufacturers of this product - var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_MANUFACTURER_IDS_MODEL_KEY, - product.Id, - string.Join(",", customer.GetCustomerRoleIds()), - _storeContext.CurrentStore.Id); - productManufacturerIds = _cacheManager.Get(cacheKey, () => - _manufacturerService - .GetProductManufacturersByProductId(product.Id) - .Select(x => x.ManufacturerId) - .ToList()); - } - - foreach (var manufacturerId in productManufacturerIds) - { - if (discountManufacturerIds.Contains(manufacturerId)) - { - if (_discountService.ValidateDiscount(discount, customer).IsValid && - !allowedDiscounts.ContainsDiscount(discount)) - allowedDiscounts.Add(discount); - } - } - } - - return allowedDiscounts; - } - - /// - /// Gets allowed discounts - /// - /// Product - /// Customer - /// Discounts - protected virtual IList GetAllowedDiscounts(Product product, Customer customer) - { - var allowedDiscounts = new List(); - if (_catalogSettings.IgnoreDiscounts) - return allowedDiscounts; - - //discounts applied to products - foreach (var discount in GetAllowedDiscountsAppliedToProduct(product, customer)) - if (!allowedDiscounts.ContainsDiscount(discount)) - allowedDiscounts.Add(discount); - - //discounts applied to categories - foreach (var discount in GetAllowedDiscountsAppliedToCategories(product, customer)) - if (!allowedDiscounts.ContainsDiscount(discount)) - allowedDiscounts.Add(discount); - - //discounts applied to manufacturers - foreach (var discount in GetAllowedDiscountsAppliedToManufacturers(product, customer)) - if (!allowedDiscounts.ContainsDiscount(discount)) - allowedDiscounts.Add(discount); - - return allowedDiscounts; - } - - /// - /// Gets discount amount - /// - /// Product - /// The customer - /// Already calculated product price without discount - /// Applied discounts - /// Discount amount - protected virtual decimal GetDiscountAmount(Product product, - Customer customer, - decimal productPriceWithoutDiscount, - out List appliedDiscounts) - { - if (product == null) - throw new ArgumentNullException("product"); - - appliedDiscounts = null; - decimal appliedDiscountAmount = decimal.Zero; - - //we don't apply discounts to products with price entered by a customer - if (product.CustomerEntersPrice) - return appliedDiscountAmount; - - //discounts are disabled - if (_catalogSettings.IgnoreDiscounts) - return appliedDiscountAmount; - - var allowedDiscounts = GetAllowedDiscounts(product, customer); - - //no discounts - if (!allowedDiscounts.Any()) - return appliedDiscountAmount; - - appliedDiscounts = allowedDiscounts.GetPreferredDiscount(productPriceWithoutDiscount, out appliedDiscountAmount); - return appliedDiscountAmount; - } - - #endregion - - #region Methods - - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Final price - public virtual decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge = decimal.Zero, - bool includeDiscounts = true, - int quantity = 1) - { - decimal discountAmount; - List appliedDiscounts; - return GetFinalPrice(product, customer, additionalCharge, includeDiscounts, - quantity, out discountAmount, out appliedDiscounts); - } - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Applied discount amount - /// Applied discounts - /// Final price - public virtual decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge, - bool includeDiscounts, - int quantity, - out decimal discountAmount, - out List appliedDiscounts) - { - return GetFinalPrice(product, customer, - additionalCharge, includeDiscounts, quantity, - null, null, - out discountAmount, out appliedDiscounts); - } - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Rental period start date (for rental products) - /// Rental period end date (for rental products) - /// Applied discount amount - /// Applied discounts - /// Final price - public virtual decimal GetFinalPrice(Product product, - Customer customer, - decimal additionalCharge, - bool includeDiscounts, - int quantity, - DateTime? rentalStartDate, - DateTime? rentalEndDate, - out decimal discountAmount, - out List appliedDiscounts) - { - return GetFinalPrice(product, customer, null, additionalCharge, includeDiscounts, quantity, - rentalStartDate, rentalEndDate, out discountAmount, out appliedDiscounts); - } - /// - /// Gets the final price - /// - /// Product - /// The customer - /// Overridden product price. If specified, then it'll be used instead of a product price. For example, used with product attribute combinations - /// Additional charge - /// A value indicating whether include discounts or not for final price computation - /// Shopping cart item quantity - /// Rental period start date (for rental products) - /// Rental period end date (for rental products) - /// Applied discount amount - /// Applied discounts - /// Final price - public virtual decimal GetFinalPrice(Product product, - Customer customer, - decimal? overriddenProductPrice, - decimal additionalCharge, - bool includeDiscounts, - int quantity, - DateTime? rentalStartDate, - DateTime? rentalEndDate, - out decimal discountAmount, - out List appliedDiscounts) - { - if (product == null) - throw new ArgumentNullException("product"); - - discountAmount = decimal.Zero; - appliedDiscounts = new List(); - - var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_PRICE_MODEL_KEY, - product.Id, - overriddenProductPrice.HasValue ? overriddenProductPrice.Value.ToString(CultureInfo.InvariantCulture) : null, - additionalCharge.ToString(CultureInfo.InvariantCulture), - includeDiscounts, - quantity, - string.Join(",", customer.GetCustomerRoleIds()), - _storeContext.CurrentStore.Id); - var cacheTime = _catalogSettings.CacheProductPrices ? 60 : 0; - //we do not cache price for rental products - //otherwise, it can cause memory leaks (to store all possible date period combinations) - if (product.IsRental) - cacheTime = 0; - var cachedPrice = _cacheManager.Get(cacheKey, cacheTime, () => - { - var result = new ProductPriceForCaching(); - - //initial price - decimal price = overriddenProductPrice.HasValue ? overriddenProductPrice.Value : product.Price; - - //tier prices - var tierPrice = product.GetPreferredTierPrice(customer, _storeContext.CurrentStore.Id, quantity); - if (tierPrice != null) - price = tierPrice.Price; - - //additional charge - price = price + additionalCharge; - - //rental products - if (product.IsRental) - if (rentalStartDate.HasValue && rentalEndDate.HasValue) - price = price * product.GetRentalPeriods(rentalStartDate.Value, rentalEndDate.Value); - - if (includeDiscounts) - { - //discount - List tmpAppliedDiscounts; - decimal tmpDiscountAmount = GetDiscountAmount(product, customer, price, out tmpAppliedDiscounts); - price = price - tmpDiscountAmount; - - if (tmpAppliedDiscounts != null) - { - result.AppliedDiscounts = tmpAppliedDiscounts; - result.AppliedDiscountAmount = tmpDiscountAmount; - } - } - - if (price < decimal.Zero) - price = decimal.Zero; - - result.Price = price; - return result; - }); - - if (includeDiscounts) - { - if (cachedPrice.AppliedDiscounts.Any()) - { - appliedDiscounts.AddRange(cachedPrice.AppliedDiscounts); - discountAmount = cachedPrice.AppliedDiscountAmount; - } - } - - return cachedPrice.Price; - } - - - - /// - /// Gets the shopping cart unit price (one item) - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Shopping cart unit price (one item) - public virtual decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, - bool includeDiscounts = true) - { - decimal discountAmount; - List appliedDiscounts; - return GetUnitPrice(shoppingCartItem, includeDiscounts, - out discountAmount, out appliedDiscounts); - } - /// - /// Gets the shopping cart unit price (one item) - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Shopping cart unit price (one item) - public virtual decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts) - { - if (shoppingCartItem == null) - throw new ArgumentNullException("shoppingCartItem"); - - return GetUnitPrice(shoppingCartItem.Product, - shoppingCartItem.Customer, - shoppingCartItem.ShoppingCartType, - shoppingCartItem.Quantity, - shoppingCartItem.AttributesXml, - shoppingCartItem.CustomerEnteredPrice, - shoppingCartItem.RentalStartDateUtc, - shoppingCartItem.RentalEndDateUtc, - includeDiscounts, - out discountAmount, - out appliedDiscounts); - } - /// - /// Gets the shopping cart unit price (one item) - /// - /// Product - /// Customer - /// Shopping cart type - /// Quantity - /// Product atrributes (XML format) - /// Customer entered price (if specified) - /// Rental start date (null for not rental products) - /// Rental end date (null for not rental products) - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Shopping cart unit price (one item) - public virtual decimal GetUnitPrice(Product product, - Customer customer, - ShoppingCartType shoppingCartType, - int quantity, - string attributesXml, - decimal customerEnteredPrice, - DateTime? rentalStartDate, DateTime? rentalEndDate, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts) - { - if (product == null) - throw new ArgumentNullException("product"); - - if (customer == null) - throw new ArgumentNullException("customer"); - - discountAmount = decimal.Zero; - appliedDiscounts = new List(); - - decimal finalPrice; - - var combination = _productAttributeParser.FindProductAttributeCombination(product, attributesXml); - if (combination != null && combination.OverriddenPrice.HasValue) - { - finalPrice = GetFinalPrice(product, - customer, - combination.OverriddenPrice.Value, - decimal.Zero, - includeDiscounts, - quantity, - product.IsRental ? rentalStartDate : null, - product.IsRental ? rentalEndDate : null, - out discountAmount, out appliedDiscounts); - } - else - { - //summarize price of all attributes - decimal attributesTotalPrice = decimal.Zero; - var attributeValues = _productAttributeParser.ParseProductAttributeValues(attributesXml); - if (attributeValues != null) - { - foreach (var attributeValue in attributeValues) - { - attributesTotalPrice += GetProductAttributeValuePriceAdjustment(attributeValue); - } - } - - //get price of a product (with previously calculated price of all attributes) - if (product.CustomerEntersPrice) - { - finalPrice = customerEnteredPrice; - } - else - { - int qty; - if (_shoppingCartSettings.GroupTierPricesForDistinctShoppingCartItems) - { - //the same products with distinct product attributes could be stored as distinct "ShoppingCartItem" records - //so let's find how many of the current products are in the cart - qty = customer.ShoppingCartItems - .Where(x => x.ProductId == product.Id) - .Where(x => x.ShoppingCartType == shoppingCartType) - .Sum(x => x.Quantity); - if (qty == 0) - { - qty = quantity; - } - } - else - { - qty = quantity; - } - finalPrice = GetFinalPrice(product, - customer, - attributesTotalPrice, - includeDiscounts, - qty, - product.IsRental ? rentalStartDate : null, - product.IsRental ? rentalEndDate : null, - out discountAmount, out appliedDiscounts); - } - } - - //rounding - if (_shoppingCartSettings.RoundPricesDuringCalculation) - finalPrice = RoundingHelper.RoundPrice(finalPrice); - - return finalPrice; - } - /// - /// Gets the shopping cart item sub total - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Shopping cart item sub total - public virtual decimal GetSubTotal(ShoppingCartItem shoppingCartItem, - bool includeDiscounts = true) - { - decimal discountAmount; - List appliedDiscounts; - int? maximumDiscountQty; - return GetSubTotal(shoppingCartItem, includeDiscounts, out discountAmount, out appliedDiscounts, out maximumDiscountQty); - } - /// - /// Gets the shopping cart item sub total - /// - /// The shopping cart item - /// A value indicating whether include discounts or not for price computation - /// Applied discount amount - /// Applied discounts - /// Maximum discounted qty. Return not nullable value if discount cannot be applied to ALL items - /// Shopping cart item sub total - public virtual decimal GetSubTotal(ShoppingCartItem shoppingCartItem, - bool includeDiscounts, - out decimal discountAmount, - out List appliedDiscounts, - out int? maximumDiscountQty) - { - if (shoppingCartItem == null) - throw new ArgumentNullException("shoppingCartItem"); - - decimal subTotal; - maximumDiscountQty = null; - - //unit price - var unitPrice = GetUnitPrice(shoppingCartItem, includeDiscounts, - out discountAmount, out appliedDiscounts); - - //discount - if (appliedDiscounts.Any()) - { - //we can properly use "MaximumDiscountedQuantity" property only for one discount (not cumulative ones) - DiscountForCaching oneAndOnlyDiscount = null; - if (appliedDiscounts.Count == 1) - oneAndOnlyDiscount = appliedDiscounts.First(); - - if (oneAndOnlyDiscount != null && - oneAndOnlyDiscount.MaximumDiscountedQuantity.HasValue && - shoppingCartItem.Quantity > oneAndOnlyDiscount.MaximumDiscountedQuantity.Value) - { - maximumDiscountQty = oneAndOnlyDiscount.MaximumDiscountedQuantity.Value; - //we cannot apply discount for all shopping cart items - var discountedQuantity = oneAndOnlyDiscount.MaximumDiscountedQuantity.Value; - var discountedSubTotal = unitPrice * discountedQuantity; - discountAmount = discountAmount * discountedQuantity; - - var notDiscountedQuantity = shoppingCartItem.Quantity - discountedQuantity; - var notDiscountedUnitPrice = GetUnitPrice(shoppingCartItem, false); - var notDiscountedSubTotal = notDiscountedUnitPrice*notDiscountedQuantity; - - subTotal = discountedSubTotal + notDiscountedSubTotal; - } - else - { - //discount is applied to all items (quantity) - //calculate discount amount for all items - discountAmount = discountAmount * shoppingCartItem.Quantity; - - subTotal = unitPrice * shoppingCartItem.Quantity; - } - } - else - { - subTotal = unitPrice * shoppingCartItem.Quantity; - } - return subTotal; - } - - - /// - /// Gets the product cost (one item) - /// - /// Product - /// Shopping cart item attributes in XML - /// Product cost (one item) - public virtual decimal GetProductCost(Product product, string attributesXml) - { - if (product == null) - throw new ArgumentNullException("product"); - - decimal cost = product.ProductCost; - var attributeValues = _productAttributeParser.ParseProductAttributeValues(attributesXml); - foreach (var attributeValue in attributeValues) - { - switch (attributeValue.AttributeValueType) - { - case AttributeValueType.Simple: - { - //simple attribute - cost += attributeValue.Cost; - } - break; - case AttributeValueType.AssociatedToProduct: - { - //bundled product - var associatedProduct = _productService.GetProductById(attributeValue.AssociatedProductId); - if (associatedProduct != null) - cost += associatedProduct.ProductCost * attributeValue.Quantity; - } - break; - default: - break; - } - } - - return cost; - } - - - - /// - /// Get a price adjustment of a product attribute value - /// - /// Product attribute value - /// Price adjustment - public virtual decimal GetProductAttributeValuePriceAdjustment(ProductAttributeValue value) - { - if (value == null) - throw new ArgumentNullException("value"); - - var adjustment = decimal.Zero; - switch (value.AttributeValueType) - { - case AttributeValueType.Simple: - { - //simple attribute - adjustment = value.PriceAdjustment; - } - break; - case AttributeValueType.AssociatedToProduct: - { - //bundled product - var associatedProduct = _productService.GetProductById(value.AssociatedProductId); - if (associatedProduct != null) - { - adjustment = GetFinalPrice(associatedProduct, _workContext.CurrentCustomer, includeDiscounts: true) * value.Quantity; - } - } - break; - default: - break; - } - - return adjustment; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Orders; +using Nop.Services.Catalog.Cache; +using Nop.Services.Customers; +using Nop.Services.Discounts; +using Nop.Services.Tax; +using Nop.Core.Domain.Tax; + +namespace Nop.Services.Catalog +{ + /// + /// Price calculation service + /// + public partial class PriceCalculationService : IPriceCalculationService + { + #region Fields + + private readonly IWorkContext _workContext; + private readonly IStoreContext _storeContext; + private readonly IDiscountService _discountService; + private readonly ICategoryService _categoryService; + private readonly IManufacturerService _manufacturerService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IProductService _productService; + private readonly ICacheManager _cacheManager; + private readonly ShoppingCartSettings _shoppingCartSettings; + private readonly CatalogSettings _catalogSettings; + private readonly ITaxService _taxService; + + #endregion + + #region Ctor + + public PriceCalculationService(IWorkContext workContext, + IStoreContext storeContext, + IDiscountService discountService, + ICategoryService categoryService, + IManufacturerService manufacturerService, + IProductAttributeParser productAttributeParser, + IProductService productService, + ICacheManager cacheManager, + ShoppingCartSettings shoppingCartSettings, + CatalogSettings catalogSettings, + ITaxService taxService) + { + this._workContext = workContext; + this._storeContext = storeContext; + this._discountService = discountService; + this._categoryService = categoryService; + this._manufacturerService = manufacturerService; + this._productAttributeParser = productAttributeParser; + this._productService = productService; + this._cacheManager = cacheManager; + this._shoppingCartSettings = shoppingCartSettings; + this._catalogSettings = catalogSettings; + this._taxService = taxService; + } + + #endregion + + #region Nested classes + + [Serializable] + protected class ProductPriceForCaching + { + public ProductPriceForCaching() + { + this.AppliedDiscounts = new List(); + } + + public decimal Price { get; set; } + public decimal AppliedDiscountAmount { get; set; } + public List AppliedDiscounts { get; set; } + } + #endregion + + #region Utilities + + /// + /// Gets allowed discounts applied to product + /// + /// Product + /// Customer + /// Discounts + protected virtual IList GetAllowedDiscountsAppliedToProduct(Product product, Customer customer) + { + var allowedDiscounts = new List(); + if (_catalogSettings.IgnoreDiscounts) + return allowedDiscounts; + + if (product.HasDiscountsApplied) + { + //we use this property ("HasDiscountsApplied") for performance optimization to avoid unnecessary database calls + foreach (var discount in product.AppliedDiscounts) + { + if (_discountService.ValidateDiscount(discount, customer).IsValid && + discount.DiscountType == DiscountType.AssignedToSkus) + allowedDiscounts.Add(discount.MapDiscount()); + } + } + + return allowedDiscounts; + } + + /// + /// Gets allowed discounts applied to categories + /// + /// Product + /// Customer + /// Discounts + protected virtual IList GetAllowedDiscountsAppliedToCategories(Product product, Customer customer) + { + var allowedDiscounts = new List(); + if (_catalogSettings.IgnoreDiscounts) + return allowedDiscounts; + + //load cached discount models (performance optimization) + foreach (var discount in _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)) + { + //load identifier of categories with this discount applied to + var discountCategoryIds = _discountService.GetAppliedCategoryIds(discount, customer); + + //compare with categories of this product + var productCategoryIds = new List(); + if (discountCategoryIds.Any()) + { + //load identifier of categories of this product + var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_CATEGORY_IDS_MODEL_KEY, + product.Id, + string.Join(",", customer.GetCustomerRoleIds()), + _storeContext.CurrentStore.Id); + productCategoryIds = _cacheManager.Get(cacheKey, () => + _categoryService + .GetProductCategoriesByProductId(product.Id) + .Select(x => x.CategoryId) + .ToList()); + } + + foreach (var categoryId in productCategoryIds) + { + if (discountCategoryIds.Contains(categoryId)) + { + if (_discountService.ValidateDiscount(discount, customer).IsValid && + !allowedDiscounts.ContainsDiscount(discount)) + allowedDiscounts.Add(discount); + } + } + } + + return allowedDiscounts; + } + + /// + /// Gets allowed discounts applied to manufacturers + /// + /// Product + /// Customer + /// Discounts + protected virtual IList GetAllowedDiscountsAppliedToManufacturers(Product product, Customer customer) + { + var allowedDiscounts = new List(); + if (_catalogSettings.IgnoreDiscounts) + return allowedDiscounts; + + foreach (var discount in _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)) + { + //load identifier of manufacturers with this discount applied to + var discountManufacturerIds = _discountService.GetAppliedManufacturerIds(discount, customer); + + //compare with manufacturers of this product + var productManufacturerIds = new List(); + if (discountManufacturerIds.Any()) + { + //load identifier of manufacturers of this product + var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_MANUFACTURER_IDS_MODEL_KEY, + product.Id, + string.Join(",", customer.GetCustomerRoleIds()), + _storeContext.CurrentStore.Id); + productManufacturerIds = _cacheManager.Get(cacheKey, () => + _manufacturerService + .GetProductManufacturersByProductId(product.Id) + .Select(x => x.ManufacturerId) + .ToList()); + } + + foreach (var manufacturerId in productManufacturerIds) + { + if (discountManufacturerIds.Contains(manufacturerId)) + { + if (_discountService.ValidateDiscount(discount, customer).IsValid && + !allowedDiscounts.ContainsDiscount(discount)) + allowedDiscounts.Add(discount); + } + } + } + + return allowedDiscounts; + } + + /// + /// Gets allowed discounts + /// + /// Product + /// Customer + /// Discounts + protected virtual IList GetAllowedDiscounts(Product product, Customer customer) + { + var allowedDiscounts = new List(); + if (_catalogSettings.IgnoreDiscounts) + return allowedDiscounts; + + //discounts applied to products + foreach (var discount in GetAllowedDiscountsAppliedToProduct(product, customer)) + if (!allowedDiscounts.ContainsDiscount(discount)) + allowedDiscounts.Add(discount); + + //discounts applied to categories + foreach (var discount in GetAllowedDiscountsAppliedToCategories(product, customer)) + if (!allowedDiscounts.ContainsDiscount(discount)) + allowedDiscounts.Add(discount); + + //discounts applied to manufacturers + foreach (var discount in GetAllowedDiscountsAppliedToManufacturers(product, customer)) + if (!allowedDiscounts.ContainsDiscount(discount)) + allowedDiscounts.Add(discount); + + return allowedDiscounts; + } + + /// + /// Gets discount amount + /// + /// Product + /// The customer + /// Already calculated product price without discount + /// Applied discounts + /// Discount amount + protected virtual decimal GetDiscountAmount(Product product, + Customer customer, + decimal productPriceWithoutDiscount, + out List appliedDiscounts) + { + if (product == null) + throw new ArgumentNullException("product"); + + appliedDiscounts = null; + decimal appliedDiscountAmount = decimal.Zero; + + //we don't apply discounts to products with price entered by a customer + if (product.CustomerEntersPrice) + return appliedDiscountAmount; + + //discounts are disabled + if (_catalogSettings.IgnoreDiscounts) + return appliedDiscountAmount; + + var allowedDiscounts = GetAllowedDiscounts(product, customer); + + //no discounts + if (!allowedDiscounts.Any()) + return appliedDiscountAmount; + + appliedDiscounts = allowedDiscounts.GetPreferredDiscount(productPriceWithoutDiscount, out appliedDiscountAmount); + return appliedDiscountAmount; + } + + #endregion + + #region Methods + + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Final price + public virtual decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge = decimal.Zero, + bool includeDiscounts = true, + int quantity = 1) + { + decimal discountAmount; + List appliedDiscounts; + return GetFinalPrice(product, customer, additionalCharge, includeDiscounts, + quantity, out discountAmount, out appliedDiscounts); + } + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Applied discount amount + /// Applied discounts + /// Final price + public virtual decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + out decimal discountAmount, + out List appliedDiscounts) + { + return GetFinalPrice(product, customer, + additionalCharge, includeDiscounts, quantity, + null, null, + out discountAmount, out appliedDiscounts); + } + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Rental period start date (for rental products) + /// Rental period end date (for rental products) + /// Applied discount amount + /// Applied discounts + /// Final price + public virtual decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + DateTime? rentalStartDate, + DateTime? rentalEndDate, + out decimal discountAmount, + out List appliedDiscounts) + { + return GetFinalPrice(product, customer, additionalCharge, includeDiscounts, quantity, + rentalStartDate, rentalEndDate, out discountAmount, out appliedDiscounts, null); + } + /// + /// Gets the final price + /// + /// Product + /// The customer + /// Additional charge + /// A value indicating whether include discounts or not for final price computation + /// Shopping cart item quantity + /// Rental period start date (for rental products) + /// Rental period end date (for rental products) + /// Applied discount amount + /// Applied discounts + /// Overridden product price. If specified, then it'll be used instead of a product price. For example, used with product attribute combinations + /// Final price + public virtual decimal GetFinalPrice(Product product, + Customer customer, + decimal additionalCharge, + bool includeDiscounts, + int quantity, + DateTime? rentalStartDate, + DateTime? rentalEndDate, + out decimal discountAmount, + out List appliedDiscounts, + decimal? overriddenProductPrice) + { + if (product == null) + throw new ArgumentNullException("product"); + + discountAmount = decimal.Zero; + appliedDiscounts = new List(); + + var cacheKey = string.Format(PriceCacheEventConsumer.PRODUCT_PRICE_MODEL_KEY, + product.Id, + overriddenProductPrice.HasValue ? overriddenProductPrice.Value.ToString(CultureInfo.InvariantCulture) : null, + additionalCharge.ToString(CultureInfo.InvariantCulture), + includeDiscounts, + quantity, + string.Join(",", customer.GetCustomerRoleIds()), + _storeContext.CurrentStore.Id); + var cacheTime = _catalogSettings.CacheProductPrices ? 60 : 0; + //we do not cache price for rental products + //otherwise, it can cause memory leaks (to store all possible date period combinations) + if (product.IsRental) + cacheTime = 0; + var cachedPrice = _cacheManager.Get(cacheKey, cacheTime, () => + { + var result = new ProductPriceForCaching(); + + //initial price + decimal price = overriddenProductPrice.HasValue ? overriddenProductPrice.Value : product.Price; + + //tier prices + var tierPrice = product.GetPreferredTierPrice(customer, _storeContext.CurrentStore.Id, quantity); + if (tierPrice != null) + price = tierPrice.Price; + + //additional charge + price = price + additionalCharge; + + //rental products + if (product.IsRental) + if (rentalStartDate.HasValue && rentalEndDate.HasValue) + price = price * product.GetRentalPeriods(rentalStartDate.Value, rentalEndDate.Value); + + if (includeDiscounts) + { + //discount + List tmpAppliedDiscounts; + decimal tmpDiscountAmount = GetDiscountAmount(product, customer, price, out tmpAppliedDiscounts); + price = price - tmpDiscountAmount; + + if (tmpAppliedDiscounts != null) + { + result.AppliedDiscounts = tmpAppliedDiscounts; + result.AppliedDiscountAmount = tmpDiscountAmount; + } + } + + if (price < decimal.Zero) + price = decimal.Zero; + + result.Price = price; + return result; + }); + + if (includeDiscounts) + { + if (cachedPrice.AppliedDiscounts.Any()) + { + appliedDiscounts.AddRange(cachedPrice.AppliedDiscounts); + discountAmount = cachedPrice.AppliedDiscountAmount; + } + } + + return cachedPrice.Price; + } + + + + /// + /// Gets the shopping cart unit price (one item) + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Shopping cart unit price (one item) + public virtual decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, + bool includeDiscounts = true) + { + decimal discountAmount; + List appliedDiscounts; + return GetUnitPrice(shoppingCartItem, includeDiscounts, + out discountAmount, out appliedDiscounts); + } + /// + /// Gets the shopping cart unit price (one item) + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Shopping cart unit price (one item) + public virtual decimal GetUnitPrice(ShoppingCartItem shoppingCartItem, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts) + { + if (shoppingCartItem == null) + throw new ArgumentNullException("shoppingCartItem"); + var attributesXml = shoppingCartItem.AttributesXml; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + var unitPrice = GetUnitPrice(shoppingCartItem.Product, + shoppingCartItem.Customer, + shoppingCartItem.ShoppingCartType, + shoppingCartItem.Quantity, + ref attributesXml, + shoppingCartItem.CustomerEnteredPrice, + shoppingCartItem.RentalStartDateUtc, + shoppingCartItem.RentalEndDateUtc, + includeDiscounts, + out discountAmount, + out appliedDiscounts); + //update modified attributesXml with attributes taxinfo + shoppingCartItem.AttributesXml = attributesXml; + return unitPrice; + } + /// + /// Gets the shopping cart unit price (one item) + /// + /// Product + /// Customer + /// Shopping cart type + /// Quantity + /// Product atrributes (XML format) + /// Customer entered price (if specified) + /// Rental start date (null for not rental products) + /// Rental end date (null for not rental products) + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Shopping cart unit price (one item) + public virtual decimal GetUnitPrice(Product product, + Customer customer, + ShoppingCartType shoppingCartType, + int quantity, + ref string attributesXml, + decimal customerEnteredPrice, + DateTime? rentalStartDate, DateTime? rentalEndDate, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts) + { + if (product == null) + throw new ArgumentNullException("product"); + + if (customer == null) + throw new ArgumentNullException("customer"); + + discountAmount = decimal.Zero; + appliedDiscounts = new List(); + + //taxWeights will use price tax settings + var taxWeightSummary = new TaxSummary(_taxService.PricesIncludeTax()); + + decimal finalPrice = decimal.Zero; + + var combination = _productAttributeParser.FindProductAttributeCombination(product, attributesXml); + + //get taxrate and summarize price of all attributes to build up taxWeightSummary + //needed for VAT calculation of product bundles + //taxrate comes from associated product and not from product + decimal attributesTotalPrice = decimal.Zero; + var attributeValues = _productAttributeParser.ParseProductAttributeValues(attributesXml); + if (attributeValues != null) + { + decimal taxRate; + foreach (var attributeValue in attributeValues) + { + var attributePrice = GetProductAttributeValuePriceAdjustment(attributeValue); + attributesTotalPrice += attributePrice; + + if (attributeValue.AttributeValueType == AttributeValueType.AssociatedToProduct) + { + //bundled product + var associatedProduct = _productService.GetProductById(attributeValue.AssociatedProductId); + if (associatedProduct != null) + { + //get only the taxrate of associate product, price is not needed + var attributePriceTax = _taxService.GetProductPrice(associatedProduct, 0, customer, out taxRate); + //build taxSummary for tax subdivision + taxWeightSummary.AddRate(taxRate, attributePrice); + } + } + } + } + + + if (combination != null && combination.OverriddenPrice.HasValue) + { + finalPrice = GetFinalPrice(product, + customer, + decimal.Zero, + includeDiscounts, + quantity, + product.IsRental ? rentalStartDate : null, + product.IsRental ? rentalEndDate : null, + out discountAmount, out appliedDiscounts, + combination.OverriddenPrice.Value); + } + else + { + //get price of a product (with previously calculated price of all attributes) + if (product.CustomerEntersPrice) + { + finalPrice = customerEnteredPrice; + } + else + { + int qty; + if (_shoppingCartSettings.GroupTierPricesForDistinctShoppingCartItems) + { + //the same products with distinct product attributes could be stored as distinct "ShoppingCartItem" records + //so let's find how many of the current products are in the cart + qty = customer.ShoppingCartItems + .Where(x => x.ProductId == product.Id) + .Where(x => x.ShoppingCartType == shoppingCartType) + .Sum(x => x.Quantity); + if (qty == 0) + { + qty = quantity; + } + } + else + { + qty = quantity; + } + finalPrice = GetFinalPrice(product, + customer, + attributesTotalPrice, + includeDiscounts, + qty, + product.IsRental ? rentalStartDate : null, + product.IsRental ? rentalEndDate : null, + out discountAmount, out appliedDiscounts); + } + } + + //rounding + if (_shoppingCartSettings.RoundPricesDuringCalculation) + finalPrice = RoundingHelper.RoundPrice(finalPrice); + + //add tax attributes if needed + if (taxWeightSummary != null && taxWeightSummary.TaxRates.Any()) + { + decimal prodcutTaxRate; + //get taxrate and product price + var productPrice = _taxService.GetProductPrice(product, product.Price, customer, out prodcutTaxRate); + + //price is overridden or it is product price + attributes price + if (combination == null || combination != null && !combination.OverriddenPrice.HasValue) + { + var baseProductPrice = productPrice; // finalPrice - attributesTotalPrice; + //add product price if exists + if (baseProductPrice > decimal.Zero) + taxWeightSummary.AddRate(prodcutTaxRate, baseProductPrice); + } + if (taxWeightSummary.TaxRates.Count() > 1 || + (taxWeightSummary.TaxRates.FirstOrDefault().Key != prodcutTaxRate) //use associated product taxRate when different + ) + { + taxWeightSummary.CalculateWeights(); + attributesXml = _productAttributeParser.AddTaxAttribute(attributesXml, taxWeightSummary); + } + } + + return finalPrice; + } + /// + /// Gets the shopping cart item sub total + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Shopping cart item sub total + public virtual decimal GetSubTotal(ShoppingCartItem shoppingCartItem, + bool includeDiscounts = true) + { + decimal discountAmount; + List appliedDiscounts; + int? maximumDiscountQty; + return GetSubTotal(shoppingCartItem, includeDiscounts, out discountAmount, out appliedDiscounts, out maximumDiscountQty); + } + /// + /// Gets the shopping cart item sub total + /// + /// The shopping cart item + /// A value indicating whether include discounts or not for price computation + /// Applied discount amount + /// Applied discounts + /// Maximum discounted qty. Return not nullable value if discount cannot be applied to ALL items + /// Shopping cart item sub total + public virtual decimal GetSubTotal(ShoppingCartItem shoppingCartItem, + bool includeDiscounts, + out decimal discountAmount, + out List appliedDiscounts, + out int? maximumDiscountQty) + { + if (shoppingCartItem == null) + throw new ArgumentNullException("shoppingCartItem"); + + decimal subTotal; + maximumDiscountQty = null; + + //unit price + var unitPrice = GetUnitPrice(shoppingCartItem, includeDiscounts, + out discountAmount, out appliedDiscounts); + + //discount + if (appliedDiscounts.Any()) + { + //we can properly use "MaximumDiscountedQuantity" property only for one discount (not cumulative ones) + DiscountForCaching oneAndOnlyDiscount = null; + if (appliedDiscounts.Count == 1) + oneAndOnlyDiscount = appliedDiscounts.First(); + + if (oneAndOnlyDiscount != null && + oneAndOnlyDiscount.MaximumDiscountedQuantity.HasValue && + shoppingCartItem.Quantity > oneAndOnlyDiscount.MaximumDiscountedQuantity.Value) + { + maximumDiscountQty = oneAndOnlyDiscount.MaximumDiscountedQuantity.Value; + //we cannot apply discount for all shopping cart items + var discountedQuantity = oneAndOnlyDiscount.MaximumDiscountedQuantity.Value; + var discountedSubTotal = unitPrice * discountedQuantity; + discountAmount = discountAmount * discountedQuantity; + + var notDiscountedQuantity = shoppingCartItem.Quantity - discountedQuantity; + var notDiscountedUnitPrice = GetUnitPrice(shoppingCartItem, false); + var notDiscountedSubTotal = notDiscountedUnitPrice*notDiscountedQuantity; + + subTotal = discountedSubTotal + notDiscountedSubTotal; + } + else + { + //discount is applied to all items (quantity) + //calculate discount amount for all items + discountAmount = discountAmount * shoppingCartItem.Quantity; + + subTotal = unitPrice * shoppingCartItem.Quantity; + } + } + else + { + subTotal = unitPrice * shoppingCartItem.Quantity; + } + return subTotal; + } + + + /// + /// Gets the product cost (one item) + /// + /// Product + /// Shopping cart item attributes in XML + /// Product cost (one item) + public virtual decimal GetProductCost(Product product, string attributesXml) + { + if (product == null) + throw new ArgumentNullException("product"); + + decimal cost = product.ProductCost; + var attributeValues = _productAttributeParser.ParseProductAttributeValues(attributesXml); + foreach (var attributeValue in attributeValues) + { + switch (attributeValue.AttributeValueType) + { + case AttributeValueType.Simple: + { + //simple attribute + cost += attributeValue.Cost; + } + break; + case AttributeValueType.AssociatedToProduct: + { + //bundled product + var associatedProduct = _productService.GetProductById(attributeValue.AssociatedProductId); + if (associatedProduct != null) + cost += associatedProduct.ProductCost * attributeValue.Quantity; + } + break; + default: + break; + } + } + + return cost; + } + + + + /// + /// Get a price adjustment of a product attribute value + /// + /// Product attribute value + /// Price adjustment + public virtual decimal GetProductAttributeValuePriceAdjustment(ProductAttributeValue value) + { + if (value == null) + throw new ArgumentNullException("value"); + + var adjustment = decimal.Zero; + switch (value.AttributeValueType) + { + case AttributeValueType.Simple: + { + //simple attribute + adjustment = value.PriceAdjustment; + } + break; + case AttributeValueType.AssociatedToProduct: + { + //bundled product + var associatedProduct = _productService.GetProductById(value.AssociatedProductId); + if (associatedProduct != null) + { + adjustment = GetFinalPrice(associatedProduct, _workContext.CurrentCustomer, includeDiscounts: true) * value.Quantity; + } + } + break; + default: + break; + } + + return adjustment; + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Catalog/PriceFormatter.cs b/src/Libraries/Nop.Services/Catalog/PriceFormatter.cs index 0f026f4b19a..e0b37650166 100644 --- a/src/Libraries/Nop.Services/Catalog/PriceFormatter.cs +++ b/src/Libraries/Nop.Services/Catalog/PriceFormatter.cs @@ -169,7 +169,7 @@ public virtual string FormatPrice(decimal price, bool showCurrency, public virtual string FormatPrice(decimal price, bool showCurrency, string currencyCode, Language language, bool priceIncludesTax) { - var currency = _currencyService.GetCurrencyByCode(currencyCode) + var currency = _currencyService.GetCurrencyByCode(currencyCode) ?? new Currency { CurrencyCode = currencyCode @@ -186,10 +186,10 @@ public virtual string FormatPrice(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - public virtual string FormatPrice(decimal price, bool showCurrency, + public virtual string FormatPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax) { - return FormatPrice(price, showCurrency, targetCurrency, language, + return FormatPrice(price, showCurrency, targetCurrency, language, priceIncludesTax, _taxSettings.DisplayTaxSuffix); } @@ -203,12 +203,12 @@ public virtual string FormatPrice(decimal price, bool showCurrency, /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - public virtual string FormatPrice(decimal price, bool showCurrency, + public virtual string FormatPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax) { //we should round it no matter of "ShoppingCartSettings.RoundPricesDuringCalculation" setting price = RoundingHelper.RoundPrice(price); - + string currencyString = GetCurrencyString(price, showCurrency, targetCurrency); if (showTax) { @@ -228,7 +228,7 @@ public virtual string FormatPrice(decimal price, bool showCurrency, } return string.Format(formatStr, currencyString); } - + return currencyString; } @@ -293,7 +293,7 @@ public virtual string FormatShippingPrice(decimal price, bool showCurrency) /// Language /// A value indicating whether price includes tax /// Price - public virtual string FormatShippingPrice(decimal price, bool showCurrency, + public virtual string FormatShippingPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax) { bool showTax = _taxSettings.ShippingIsTaxable && _taxSettings.DisplayTaxSuffix; @@ -310,12 +310,12 @@ public virtual string FormatShippingPrice(decimal price, bool showCurrency, /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - public virtual string FormatShippingPrice(decimal price, bool showCurrency, + public virtual string FormatShippingPrice(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax) { return FormatPrice(price, showCurrency, targetCurrency, language, priceIncludesTax, showTax); } - + /// /// Formats the shipping price /// @@ -325,10 +325,10 @@ public virtual string FormatShippingPrice(decimal price, bool showCurrency, /// Language /// A value indicating whether price includes tax /// Price - public virtual string FormatShippingPrice(decimal price, bool showCurrency, + public virtual string FormatShippingPrice(decimal price, bool showCurrency, string currencyCode, Language language, bool priceIncludesTax) { - var currency = _currencyService.GetCurrencyByCode(currencyCode) + var currency = _currencyService.GetCurrencyByCode(currencyCode) ?? new Currency { CurrencyCode = currencyCode @@ -347,7 +347,7 @@ public virtual string FormatShippingPrice(decimal price, bool showCurrency, public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency) { bool priceIncludesTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return FormatPaymentMethodAdditionalFee(price, showCurrency, _workContext.WorkingCurrency, + return FormatPaymentMethodAdditionalFee(price, showCurrency, _workContext.WorkingCurrency, _workContext.WorkingLanguage, priceIncludesTax); } @@ -377,10 +377,10 @@ public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showC /// A value indicating whether price includes tax /// A value indicating whether to show tax suffix /// Price - public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, + public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax) { - return FormatPrice(price, showCurrency, targetCurrency, language, + return FormatPrice(price, showCurrency, targetCurrency, language, priceIncludesTax, showTax); } @@ -393,7 +393,7 @@ public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showC /// Language /// A value indicating whether price includes tax /// Price - public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, + public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showCurrency, string currencyCode, Language language, bool priceIncludesTax) { var currency = _currencyService.GetCurrencyByCode(currencyCode) @@ -401,7 +401,7 @@ public virtual string FormatPaymentMethodAdditionalFee(decimal price, bool showC { CurrencyCode = currencyCode }; - return FormatPaymentMethodAdditionalFee(price, showCurrency, currency, + return FormatPaymentMethodAdditionalFee(price, showCurrency, currency, language, priceIncludesTax); } @@ -417,6 +417,50 @@ public virtual string FormatTaxRate(decimal taxRate) return taxRate.ToString("G29"); } + /// + /// Adds tax suffix to text + /// + /// Text to format + /// Language + /// A value indicating whether price includes tax + /// + public virtual string FormatTaxString(string text, Language language, bool priceIncludesTax) + { + bool showTax = _taxSettings.DisplayTaxSuffix; + return FormatTaxString(text, language, priceIncludesTax, showTax); + } + /// + /// Adds tax suffix to text + /// + /// Text to format + /// Language + /// A value indicating whether price includes tax + /// Optional. A value indicating whether to show tax suffix. + /// + public virtual string FormatTaxString(string text, Language language, bool priceIncludesTax, bool showTax) + { + + if (showTax) + { + //show tax suffix + string formatStr; + if (priceIncludesTax) + { + formatStr = _localizationService.GetResource("Products.InclTaxSuffix", language.Id, false); + if (String.IsNullOrEmpty(formatStr)) + formatStr = "{0} incl tax"; + } + else + { + formatStr = _localizationService.GetResource("Products.ExclTaxSuffix", language.Id, false); + if (String.IsNullOrEmpty(formatStr)) + formatStr = "{0} excl tax"; + } + return string.Format(formatStr, text); + } + + return text; + } #endregion } } diff --git a/src/Libraries/Nop.Services/Catalog/ProductAttributeFormatter.cs b/src/Libraries/Nop.Services/Catalog/ProductAttributeFormatter.cs index 1b06a5c15db..9f3e6101b09 100644 --- a/src/Libraries/Nop.Services/Catalog/ProductAttributeFormatter.cs +++ b/src/Libraries/Nop.Services/Catalog/ProductAttributeFormatter.cs @@ -1,243 +1,276 @@ -using System; -using System.Text; -using System.Web; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Core.Html; -using Nop.Services.Directory; -using Nop.Services.Localization; -using Nop.Services.Media; -using Nop.Services.Tax; - -namespace Nop.Services.Catalog -{ - /// - /// Product attribute formatter - /// - public partial class ProductAttributeFormatter : IProductAttributeFormatter - { - private readonly IWorkContext _workContext; - private readonly IProductAttributeService _productAttributeService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly ICurrencyService _currencyService; - private readonly ILocalizationService _localizationService; - private readonly ITaxService _taxService; - private readonly IPriceFormatter _priceFormatter; - private readonly IDownloadService _downloadService; - private readonly IWebHelper _webHelper; - private readonly IPriceCalculationService _priceCalculationService; - private readonly ShoppingCartSettings _shoppingCartSettings; - - public ProductAttributeFormatter(IWorkContext workContext, - IProductAttributeService productAttributeService, - IProductAttributeParser productAttributeParser, - ICurrencyService currencyService, - ILocalizationService localizationService, - ITaxService taxService, - IPriceFormatter priceFormatter, - IDownloadService downloadService, - IWebHelper webHelper, - IPriceCalculationService priceCalculationService, - ShoppingCartSettings shoppingCartSettings) - { - this._workContext = workContext; - this._productAttributeService = productAttributeService; - this._productAttributeParser = productAttributeParser; - this._currencyService = currencyService; - this._localizationService = localizationService; - this._taxService = taxService; - this._priceFormatter = priceFormatter; - this._downloadService = downloadService; - this._webHelper = webHelper; - this._priceCalculationService = priceCalculationService; - this._shoppingCartSettings = shoppingCartSettings; - } - - /// - /// Formats attributes - /// - /// Product - /// Attributes in XML format - /// Attributes - public virtual string FormatAttributes(Product product, string attributesXml) - { - var customer = _workContext.CurrentCustomer; - return FormatAttributes(product, attributesXml, customer); - } - - /// - /// Formats attributes - /// - /// Product - /// Attributes in XML format - /// Customer - /// Serapator - /// A value indicating whether to encode (HTML) values - /// A value indicating whether to render prices - /// A value indicating whether to render product attributes - /// A value indicating whether to render gift card attributes - /// A value indicating whether to HTML hyperink tags could be rendered (if required) - /// Attributes - public virtual string FormatAttributes(Product product, string attributesXml, - Customer customer, string serapator = "
", bool htmlEncode = true, bool renderPrices = true, - bool renderProductAttributes = true, bool renderGiftCardAttributes = true, - bool allowHyperlinks = true) - { - var result = new StringBuilder(); - - //attributes - if (renderProductAttributes) - { - foreach (var attribute in _productAttributeParser.ParseProductAttributeMappings(attributesXml)) - { - //attributes without values - if (!attribute.ShouldHaveValues()) - { - foreach (var value in _productAttributeParser.ParseValues(attributesXml, attribute.Id)) - { - var formattedAttribute = string.Empty; - if (attribute.AttributeControlType == AttributeControlType.MultilineTextbox) - { - //multiline textbox - var attributeName = attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id); - - //encode (if required) - if (htmlEncode) - attributeName = HttpUtility.HtmlEncode(attributeName); - - //we never encode multiline textbox input - formattedAttribute = string.Format("{0}: {1}", attributeName, HtmlHelper.FormatText(value, false, true, false, false, false, false)); - } - else if (attribute.AttributeControlType == AttributeControlType.FileUpload) - { - //file upload - Guid downloadGuid; - Guid.TryParse(value, out downloadGuid); - var download = _downloadService.GetDownloadByGuid(downloadGuid); - if (download != null) - { - var fileName = string.Format("{0}{1}", download.Filename ?? download.DownloadGuid.ToString(), download.Extension); - - //encode (if required) - if (htmlEncode) - fileName = HttpUtility.HtmlEncode(fileName); - - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - var attributeText = allowHyperlinks ? string.Format("{2}", - _webHelper.GetStoreLocation(false), download.DownloadGuid, fileName) : fileName; - - var attributeName = attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id); - - //encode (if required) - if (htmlEncode) - attributeName = HttpUtility.HtmlEncode(attributeName); - - formattedAttribute = string.Format("{0}: {1}", attributeName, attributeText); - } - } - else - { - //other attributes (textbox, datepicker) - formattedAttribute = string.Format("{0}: {1}", attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id), value); - - //encode (if required) - if (htmlEncode) - formattedAttribute = HttpUtility.HtmlEncode(formattedAttribute); - } - - if (!string.IsNullOrEmpty(formattedAttribute)) - { - if (result.Length > 0) - result.Append(serapator); - result.Append(formattedAttribute); - } - } - } - //product attribute values - else - { - foreach (var attributeValue in _productAttributeParser.ParseProductAttributeValues(attributesXml, attribute.Id)) - { - var formattedAttribute = string.Format("{0}: {1}", - attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id), - attributeValue.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id)); - - if (renderPrices) - { - decimal taxRate; - var attributeValuePriceAdjustment = _priceCalculationService.GetProductAttributeValuePriceAdjustment(attributeValue); - var priceAdjustmentBase = _taxService.GetProductPrice(product, attributeValuePriceAdjustment, customer, out taxRate); - var priceAdjustment = _currencyService.ConvertFromPrimaryStoreCurrency(priceAdjustmentBase, _workContext.WorkingCurrency); - if (priceAdjustmentBase > 0) - formattedAttribute += string.Format(" [+{0}]", _priceFormatter.FormatPrice(priceAdjustment, false, false)); - else if (priceAdjustmentBase < decimal.Zero) - formattedAttribute += string.Format(" [-{0}]", _priceFormatter.FormatPrice(-priceAdjustment, false, false)); - } - - //display quantity - if (_shoppingCartSettings.RenderAssociatedAttributeValueQuantity && attributeValue.AttributeValueType == AttributeValueType.AssociatedToProduct) - { - //render only when more than 1 - if (attributeValue.Quantity > 1) - formattedAttribute += string.Format(_localizationService.GetResource("ProductAttributes.Quantity"), attributeValue.Quantity); - } - - //encode (if required) - if (htmlEncode) - formattedAttribute = HttpUtility.HtmlEncode(formattedAttribute); - - if (!string.IsNullOrEmpty(formattedAttribute)) - { - if (result.Length > 0) - result.Append(serapator); - result.Append(formattedAttribute); - } - } - } - } - } - - //gift cards - if (renderGiftCardAttributes) - { - if (product.IsGiftCard) - { - string giftCardRecipientName; - string giftCardRecipientEmail; - string giftCardSenderName; - string giftCardSenderEmail; - string giftCardMessage; - _productAttributeParser.GetGiftCardAttribute(attributesXml, out giftCardRecipientName, out giftCardRecipientEmail, - out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); - - //sender - var giftCardFrom = product.GiftCardType == GiftCardType.Virtual ? - string.Format(_localizationService.GetResource("GiftCardAttribute.From.Virtual"), giftCardSenderName, giftCardSenderEmail) : - string.Format(_localizationService.GetResource("GiftCardAttribute.From.Physical"), giftCardSenderName); - //recipient - var giftCardFor = product.GiftCardType == GiftCardType.Virtual ? - string.Format(_localizationService.GetResource("GiftCardAttribute.For.Virtual"), giftCardRecipientName, giftCardRecipientEmail) : - string.Format(_localizationService.GetResource("GiftCardAttribute.For.Physical"), giftCardRecipientName); - - //encode (if required) - if (htmlEncode) - { - giftCardFrom = HttpUtility.HtmlEncode(giftCardFrom); - giftCardFor = HttpUtility.HtmlEncode(giftCardFor); - } - - if (!String.IsNullOrEmpty(result.ToString())) - { - result.Append(serapator); - } - result.Append(giftCardFrom); - result.Append(serapator); - result.Append(giftCardFor); - } - } - return result.ToString(); - } - } -} +using System; +using System.Text; +using System.Web; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Core.Html; +using Nop.Services.Directory; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Tax; +using System.Collections.Generic; +using Nop.Core.Domain.Tax; + +namespace Nop.Services.Catalog +{ + /// + /// Product attribute formatter + /// + public partial class ProductAttributeFormatter : IProductAttributeFormatter + { + private readonly IWorkContext _workContext; + private readonly IProductAttributeService _productAttributeService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly ICurrencyService _currencyService; + private readonly ILocalizationService _localizationService; + private readonly ITaxService _taxService; + private readonly IPriceFormatter _priceFormatter; + private readonly IDownloadService _downloadService; + private readonly IWebHelper _webHelper; + private readonly IPriceCalculationService _priceCalculationService; + private readonly ShoppingCartSettings _shoppingCartSettings; + + public ProductAttributeFormatter(IWorkContext workContext, + IProductAttributeService productAttributeService, + IProductAttributeParser productAttributeParser, + ICurrencyService currencyService, + ILocalizationService localizationService, + ITaxService taxService, + IPriceFormatter priceFormatter, + IDownloadService downloadService, + IWebHelper webHelper, + IPriceCalculationService priceCalculationService, + ShoppingCartSettings shoppingCartSettings) + { + this._workContext = workContext; + this._productAttributeService = productAttributeService; + this._productAttributeParser = productAttributeParser; + this._currencyService = currencyService; + this._localizationService = localizationService; + this._taxService = taxService; + this._priceFormatter = priceFormatter; + this._downloadService = downloadService; + this._webHelper = webHelper; + this._priceCalculationService = priceCalculationService; + this._shoppingCartSettings = shoppingCartSettings; + } + + /// + /// Formats attributes + /// + /// Product + /// Attributes in XML format + /// Attributes + public virtual string FormatAttributes(Product product, string attributesXml) + { + var customer = _workContext.CurrentCustomer; + return FormatAttributes(product, attributesXml, customer); + } + + /// + /// Formats attributes + /// + /// Product + /// Attributes in XML format + /// Customer + /// Serapator + /// A value indicating whether to encode (HTML) values + /// A value indicating whether to render prices + /// A value indicating whether to render product attributes + /// A value indicating whether to render gift card attributes + /// A value indicating whether to HTML hyperink tags could be rendered (if required) + /// /// A value indicating if attribute VAT should be rendered with price. Null is default, i.e. don't render + /// Attributes + public virtual string FormatAttributes(Product product, string attributesXml, + Customer customer, string serapator = "
", bool htmlEncode = true, bool renderPrices = true, + bool renderProductAttributes = true, bool renderGiftCardAttributes = true, + bool allowHyperlinks = true, + decimal? subTotal = null) + { + var result = new StringBuilder(); + + //attributes + if (renderProductAttributes) + { + foreach (var attribute in _productAttributeParser.ParseProductAttributeMappings(attributesXml)) + { + //attributes without values + if (!attribute.ShouldHaveValues()) + { + foreach (var value in _productAttributeParser.ParseValues(attributesXml, attribute.Id)) + { + var formattedAttribute = string.Empty; + if (attribute.AttributeControlType == AttributeControlType.MultilineTextbox) + { + //multiline textbox + var attributeName = attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id); + + //encode (if required) + if (htmlEncode) + attributeName = HttpUtility.HtmlEncode(attributeName); + + //we never encode multiline textbox input + formattedAttribute = string.Format("{0}: {1}", attributeName, HtmlHelper.FormatText(value, false, true, false, false, false, false)); + } + else if (attribute.AttributeControlType == AttributeControlType.FileUpload) + { + //file upload + Guid downloadGuid; + Guid.TryParse(value, out downloadGuid); + var download = _downloadService.GetDownloadByGuid(downloadGuid); + if (download != null) + { + var fileName = string.Format("{0}{1}", download.Filename ?? download.DownloadGuid.ToString(), download.Extension); + + //encode (if required) + if (htmlEncode) + fileName = HttpUtility.HtmlEncode(fileName); + + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + var attributeText = allowHyperlinks ? string.Format("{2}", + _webHelper.GetStoreLocation(false), download.DownloadGuid, fileName) : fileName; + + var attributeName = attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id); + + //encode (if required) + if (htmlEncode) + attributeName = HttpUtility.HtmlEncode(attributeName); + + formattedAttribute = string.Format("{0}: {1}", attributeName, attributeText); + } + } + else + { + //other attributes (textbox, datepicker) + formattedAttribute = string.Format("{0}: {1}", attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id), value); + + //encode (if required) + if (htmlEncode) + formattedAttribute = HttpUtility.HtmlEncode(formattedAttribute); + } + + if (!string.IsNullOrEmpty(formattedAttribute)) + { + if (result.Length > 0) + result.Append(serapator); + result.Append(formattedAttribute); + } + } + } + //product attribute values + else + { + foreach (var attributeValue in _productAttributeParser.ParseProductAttributeValues(attributesXml, attribute.Id)) + { + var formattedAttribute = string.Format("{0}: {1}", + attribute.ProductAttribute.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id), + attributeValue.GetLocalized(a => a.Name, _workContext.WorkingLanguage.Id)); + + if (renderPrices && _shoppingCartSettings.RenderProductAttributePrices && attribute.AttributeControlType != AttributeControlType.ReadonlyCheckboxes) //prices are off for readonly attributes + { + decimal taxRate; + var attributeValuePriceAdjustment = _priceCalculationService.GetProductAttributeValuePriceAdjustment(attributeValue); + var priceAdjustmentBase = _taxService.GetProductPrice(product, attributeValuePriceAdjustment, customer, out taxRate); + var priceAdjustment = _currencyService.ConvertFromPrimaryStoreCurrency(priceAdjustmentBase, _workContext.WorkingCurrency); + if (priceAdjustmentBase > 0) + formattedAttribute += string.Format(" [+{0}]", _priceFormatter.FormatPrice(priceAdjustment, false, false)); + else if (priceAdjustmentBase < decimal.Zero) + formattedAttribute += string.Format(" [-{0}]", _priceFormatter.FormatPrice(-priceAdjustment, false, false)); + } + + //display quantity + if (_shoppingCartSettings.RenderAssociatedAttributeValueQuantity && attributeValue.AttributeValueType == AttributeValueType.AssociatedToProduct) + { + //render only when more than 1 + if (attributeValue.Quantity > 1) + formattedAttribute += string.Format(_localizationService.GetResource("ProductAttributes.Quantity"), attributeValue.Quantity); + } + + //encode (if required) + if (htmlEncode) + formattedAttribute = HttpUtility.HtmlEncode(formattedAttribute); + + if (!string.IsNullOrEmpty(formattedAttribute)) + { + if (result.Length > 0) + result.Append(serapator); + result.Append(formattedAttribute); + } + } + } + } + } + + //gift cards + if (renderGiftCardAttributes) + { + if (product.IsGiftCard) + { + string giftCardRecipientName; + string giftCardRecipientEmail; + string giftCardSenderName; + string giftCardSenderEmail; + string giftCardMessage; + _productAttributeParser.GetGiftCardAttribute(attributesXml, out giftCardRecipientName, out giftCardRecipientEmail, + out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); + + //sender + var giftCardFrom = product.GiftCardType == GiftCardType.Virtual ? + string.Format(_localizationService.GetResource("GiftCardAttribute.From.Virtual"), giftCardSenderName, giftCardSenderEmail) : + string.Format(_localizationService.GetResource("GiftCardAttribute.From.Physical"), giftCardSenderName); + //recipient + var giftCardFor = product.GiftCardType == GiftCardType.Virtual ? + string.Format(_localizationService.GetResource("GiftCardAttribute.For.Virtual"), giftCardRecipientName, giftCardRecipientEmail) : + string.Format(_localizationService.GetResource("GiftCardAttribute.For.Physical"), giftCardRecipientName); + + //encode (if required) + if (htmlEncode) + { + giftCardFrom = HttpUtility.HtmlEncode(giftCardFrom); + giftCardFor = HttpUtility.HtmlEncode(giftCardFor); + } + + if (!String.IsNullOrEmpty(result.ToString())) + { + result.Append(serapator); + } + result.Append(giftCardFrom); + result.Append(serapator); + result.Append(giftCardFor); + } + } + + //attribute tax + if (subTotal != null & subTotal != decimal.Zero) + { + var taxAttributes = _productAttributeParser.ParseTaxAttribute(attributesXml); + if (taxAttributes.Count != 0) + { + var attribTaxSummary = new TaxSummary(_workContext.TaxDisplayType == TaxDisplayType.IncludingTax); + var attribTax = attribTaxSummary.ApplyAttributeRate(subTotal ?? decimal.Zero, taxAttributes); + string formattedAttribute = ""; + if (result.Length > 0) + result.Append(serapator); + result.Append(String.Format("{0} {1}
", + _localizationService.GetResource("ShoppingCart.TaxRate"), + _localizationService.GetResource("Shoppingcart.Totals.OrderAmount"))); + + foreach (KeyValuePair kvp in attribTax) + { + decimal vatpercentage = kvp.Key; + decimal rateAmount = kvp.Value; + var priceBase = _currencyService.ConvertFromPrimaryStoreCurrency(rateAmount, _workContext.WorkingCurrency); + var price = _priceFormatter.FormatPrice(priceBase, false, false); + price = htmlEncode ? HttpUtility.HtmlEncode(price) : price; + formattedAttribute = String.Format("{0} {1}
", kvp.Key.ToString(), price); + result.Append(formattedAttribute); + } + } + + } + return result.ToString(); + } + } +} diff --git a/src/Libraries/Nop.Services/Catalog/ProductAttributeParser.cs b/src/Libraries/Nop.Services/Catalog/ProductAttributeParser.cs index df203866037..42ab1c3dbdd 100644 --- a/src/Libraries/Nop.Services/Catalog/ProductAttributeParser.cs +++ b/src/Libraries/Nop.Services/Catalog/ProductAttributeParser.cs @@ -1,783 +1,889 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Xml; -using Nop.Core.Domain.Catalog; -using Nop.Data; - -namespace Nop.Services.Catalog -{ - /// - /// Product attribute parser - /// - public partial class ProductAttributeParser : IProductAttributeParser - { - #region Fields - - private readonly IDbContext _context; - private readonly IProductAttributeService _productAttributeService; - - #endregion - - #region Ctor - - public ProductAttributeParser(IDbContext context, - IProductAttributeService productAttributeService) - { - this._context = context; - this._productAttributeService = productAttributeService; - } - - #endregion - - #region Product attributes - - /// - /// Gets selected product attribute mapping identifiers - /// - /// Attributes in XML format - /// Selected product attribute mapping identifiers - protected virtual IList ParseProductAttributeMappingIds(string attributesXml) - { - var ids = new List(); - if (String.IsNullOrEmpty(attributesXml)) - return ids; - - try - { - var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(attributesXml); - - var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); - foreach (XmlNode node1 in nodeList1) - { - if (node1.Attributes != null && node1.Attributes["ID"] != null) - { - string str1 = node1.Attributes["ID"].InnerText.Trim(); - int id; - if (int.TryParse(str1, out id)) - { - ids.Add(id); - } - } - } - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - return ids; - } - - /// - /// Gets selected product attribute values with the quantity entered by the customer - /// - /// Attributes in XML format - /// Product attribute mapping identifier - /// Collections of pairs of product attribute values and their quantity - protected IList> ParseValuesWithQuantity(string attributesXml, int productAttributeMappingId) - { - var selectedValues = new List>(); - if (string.IsNullOrEmpty(attributesXml)) - return selectedValues; - - try - { - var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(attributesXml); - - foreach (XmlNode attributeNode in xmlDoc.SelectNodes(@"//Attributes/ProductAttribute")) - { - if (attributeNode.Attributes != null && attributeNode.Attributes["ID"] != null) - { - int attributeId; - if (int.TryParse(attributeNode.Attributes["ID"].InnerText.Trim(), out attributeId) && attributeId == productAttributeMappingId) - { - foreach (XmlNode attributeValue in attributeNode.SelectNodes("ProductAttributeValue")) - { - var value = attributeValue.SelectSingleNode("Value").InnerText.Trim(); - var quantityNode = attributeValue.SelectSingleNode("Quantity"); - selectedValues.Add(new Tuple(value, quantityNode != null ? quantityNode.InnerText.Trim() : string.Empty)); - } - } - } - } - } - catch { } - - return selectedValues; - } - - /// - /// Gets selected product attribute mappings - /// - /// Attributes in XML format - /// Selected product attribute mappings - public virtual IList ParseProductAttributeMappings(string attributesXml) - { - var result = new List(); - if (String.IsNullOrEmpty(attributesXml)) - return result; - - var ids = ParseProductAttributeMappingIds(attributesXml); - foreach (int id in ids) - { - var attribute = _productAttributeService.GetProductAttributeMappingById(id); - if (attribute != null) - { - result.Add(attribute); - } - } - return result; - } - - /// - /// Get product attribute values - /// - /// Attributes in XML format - /// Product attribute mapping identifier; pass 0 to load all values - /// Product attribute values - public virtual IList ParseProductAttributeValues(string attributesXml, int productAttributeMappingId = 0) - { - var values = new List(); - if (string.IsNullOrEmpty(attributesXml)) - return values; - - var attributes = ParseProductAttributeMappings(attributesXml); - - //to load values only for the passed product attribute mapping - if (productAttributeMappingId > 0) - attributes = attributes.Where(attribute => attribute.Id == productAttributeMappingId).ToList(); - - foreach (var attribute in attributes) - { - if (!attribute.ShouldHaveValues()) - continue; - - foreach (var attributeValue in ParseValuesWithQuantity(attributesXml, attribute.Id)) - { - int attributeValueId; - if (!string.IsNullOrEmpty(attributeValue.Item1) && int.TryParse(attributeValue.Item1, out attributeValueId)) - { - var value = _productAttributeService.GetProductAttributeValueById(attributeValueId); - if (value != null) - { - int quantity; - if (!string.IsNullOrEmpty(attributeValue.Item2) && int.TryParse(attributeValue.Item2, out quantity) && quantity != value.Quantity) - { - //if customer enters quantity, use new entity with new quantity - var oldValue = _context.LoadOriginalCopy(value); - oldValue.ProductAttributeMapping = attribute; - oldValue.Quantity = quantity; - values.Add(oldValue); - } - else - values.Add(value); - } - } - } - } - return values; - } - - /// - /// Gets selected product attribute values - /// - /// Attributes in XML format - /// Product attribute mapping identifier - /// Product attribute values - public virtual IList ParseValues(string attributesXml, int productAttributeMappingId) - { - var selectedValues = new List(); - if (String.IsNullOrEmpty(attributesXml)) - return selectedValues; - - try - { - var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(attributesXml); - - var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); - foreach (XmlNode node1 in nodeList1) - { - if (node1.Attributes != null && node1.Attributes["ID"] != null) - { - string str1 =node1.Attributes["ID"].InnerText.Trim(); - int id; - if (int.TryParse(str1, out id)) - { - if (id == productAttributeMappingId) - { - var nodeList2 = node1.SelectNodes(@"ProductAttributeValue/Value"); - foreach (XmlNode node2 in nodeList2) - { - string value = node2.InnerText.Trim(); - selectedValues.Add(value); - } - } - } - } - } - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - return selectedValues; - } - - /// - /// Adds an attribute - /// - /// Attributes in XML format - /// Product attribute mapping - /// Value - /// Quantity (used with AttributeValueType.AssociatedToProduct to specify the quantity entered by the customer) - /// Updated result (XML format) - public virtual string AddProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping, string value, int? quantity = null) - { - string result = string.Empty; - try - { - var xmlDoc = new XmlDocument(); - if (String.IsNullOrEmpty(attributesXml)) - { - var element1 = xmlDoc.CreateElement("Attributes"); - xmlDoc.AppendChild(element1); - } - else - { - xmlDoc.LoadXml(attributesXml); - } - var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); - - XmlElement attributeElement = null; - //find existing - var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); - foreach (XmlNode node1 in nodeList1) - { - if (node1.Attributes != null && node1.Attributes["ID"] != null) - { - string str1 =node1.Attributes["ID"].InnerText.Trim(); - int id; - if (int.TryParse(str1, out id)) - { - if (id == productAttributeMapping.Id) - { - attributeElement = (XmlElement)node1; - break; - } - } - } - } - - //create new one if not found - if (attributeElement == null) - { - attributeElement = xmlDoc.CreateElement("ProductAttribute"); - attributeElement.SetAttribute("ID", productAttributeMapping.Id.ToString()); - rootElement.AppendChild(attributeElement); - } - var attributeValueElement = xmlDoc.CreateElement("ProductAttributeValue"); - attributeElement.AppendChild(attributeValueElement); - - var attributeValueValueElement = xmlDoc.CreateElement("Value"); - attributeValueValueElement.InnerText = value; - attributeValueElement.AppendChild(attributeValueValueElement); - - //the quantity entered by the customer - if (quantity.HasValue) - { - var attributeValueQuantity = xmlDoc.CreateElement("Quantity"); - attributeValueQuantity.InnerText = quantity.ToString(); - attributeValueElement.AppendChild(attributeValueQuantity); - } - - result = xmlDoc.OuterXml; - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - return result; - } - - /// - /// Remove an attribute - /// - /// Attributes in XML format - /// Product attribute mapping - /// Updated result (XML format) - public virtual string RemoveProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping) - { - string result = string.Empty; - try - { - var xmlDoc = new XmlDocument(); - if (String.IsNullOrEmpty(attributesXml)) - { - var element1 = xmlDoc.CreateElement("Attributes"); - xmlDoc.AppendChild(element1); - } - else - { - xmlDoc.LoadXml(attributesXml); - } - var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); - - XmlElement attributeElement = null; - //find existing - var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); - foreach (XmlNode node1 in nodeList1) - { - if (node1.Attributes != null && node1.Attributes["ID"] != null) - { - string str1 = node1.Attributes["ID"].InnerText.Trim(); - int id; - if (int.TryParse(str1, out id)) - { - if (id == productAttributeMapping.Id) - { - attributeElement = (XmlElement)node1; - break; - } - } - } - } - - //found - if (attributeElement != null) - { - rootElement.RemoveChild(attributeElement); - } - - result = xmlDoc.OuterXml; - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - return result; - } - - /// - /// Are attributes equal - /// - /// The attributes of the first product - /// The attributes of the second product - /// A value indicating whether we should ignore non-combinable attributes - /// A value indicating whether we should ignore the quantity of attribute value entered by the customer - /// Result - public virtual bool AreProductAttributesEqual(string attributesXml1, string attributesXml2, bool ignoreNonCombinableAttributes, bool ignoreQuantity = true) - { - var attributes1 = ParseProductAttributeMappings(attributesXml1); - if (ignoreNonCombinableAttributes) - { - attributes1 = attributes1.Where(x => !x.IsNonCombinable()).ToList(); - } - var attributes2 = ParseProductAttributeMappings(attributesXml2); - if (ignoreNonCombinableAttributes) - { - attributes2 = attributes2.Where(x => !x.IsNonCombinable()).ToList(); - } - if (attributes1.Count != attributes2.Count) - return false; - - bool attributesEqual = true; - foreach (var a1 in attributes1) - { - bool hasAttribute = false; - foreach (var a2 in attributes2) - { - if (a1.Id == a2.Id) - { - hasAttribute = true; - var values1Str = ParseValuesWithQuantity(attributesXml1, a1.Id); - var values2Str = ParseValuesWithQuantity(attributesXml2, a2.Id); - if (values1Str.Count == values2Str.Count) - { - foreach (var str1 in values1Str) - { - bool hasValue = false; - foreach (var str2 in values2Str) - { - //case insensitive? - //if (str1.Trim().ToLower() == str2.Trim().ToLower()) - if (str1.Item1.Trim() == str2.Item1.Trim()) - { - hasValue = ignoreQuantity ? true : str1.Item2.Trim() == str2.Item2.Trim(); - break; - } - } - - if (!hasValue) - { - attributesEqual = false; - break; - } - } - } - else - { - attributesEqual = false; - break; - } - } - } - - if (hasAttribute == false) - { - attributesEqual = false; - break; - } - } - - return attributesEqual; - } - - /// - /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified - /// - /// Product attribute - /// Selected attributes (XML format) - /// Result - public virtual bool? IsConditionMet(ProductAttributeMapping pam, string selectedAttributesXml) - { - if (pam == null) - throw new ArgumentNullException("pam"); - - var conditionAttributeXml = pam.ConditionAttributeXml; - if (String.IsNullOrEmpty(conditionAttributeXml)) - //no condition - return null; - - //load an attribute this one depends on - var dependOnAttribute = ParseProductAttributeMappings(conditionAttributeXml).FirstOrDefault(); - if (dependOnAttribute == null) - return true; - - var valuesThatShouldBeSelected = ParseValues(conditionAttributeXml, dependOnAttribute.Id) - //a workaround here: - //ConditionAttributeXml can contain "empty" values (nothing is selected) - //but in other cases (like below) we do not store empty values - //that's why we remove empty values here - .Where(x => !String.IsNullOrEmpty(x)) - .ToList(); - var selectedValues = ParseValues(selectedAttributesXml, dependOnAttribute.Id); - if (valuesThatShouldBeSelected.Count != selectedValues.Count) - return false; - - //compare values - var allFound = true; - foreach (var t1 in valuesThatShouldBeSelected) - { - bool found = false; - foreach (var t2 in selectedValues) - if (t1 == t2) - found = true; - if (!found) - allFound = false; - } - - return allFound; - } - - /// - /// Finds a product attribute combination by attributes stored in XML - /// - /// Product - /// Attributes in XML format - /// A value indicating whether we should ignore non-combinable attributes - /// Found product attribute combination - public virtual ProductAttributeCombination FindProductAttributeCombination(Product product, - string attributesXml, bool ignoreNonCombinableAttributes = true) - { - if (product == null) - throw new ArgumentNullException("product"); - - var combinations = _productAttributeService.GetAllProductAttributeCombinations(product.Id); - return combinations.FirstOrDefault(x => - AreProductAttributesEqual(x.AttributesXml, attributesXml, ignoreNonCombinableAttributes)); - } - - /// - /// Generate all combinations - /// - /// Product - /// A value indicating whether we should ignore non-combinable attributes - /// Attribute combinations in XML format - public virtual IList GenerateAllCombinations(Product product, bool ignoreNonCombinableAttributes = false) - { - if (product == null) - throw new ArgumentNullException("product"); - - var allProductAttributMappings = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); - if (ignoreNonCombinableAttributes) - { - allProductAttributMappings = allProductAttributMappings.Where(x => !x.IsNonCombinable()).ToList(); - } - var allPossibleAttributeCombinations = new List>(); - for (int counter = 0; counter < (1 << allProductAttributMappings.Count); ++counter) - { - var combination = new List(); - for (int i = 0; i < allProductAttributMappings.Count; ++i) - { - if ((counter & (1 << i)) == 0) - { - combination.Add(allProductAttributMappings[i]); - } - } - - allPossibleAttributeCombinations.Add(combination); - } - - var allAttributesXml = new List(); - foreach (var combination in allPossibleAttributeCombinations) - { - var attributesXml = new List(); - foreach (var pam in combination) - { - if (!pam.ShouldHaveValues()) - continue; - - var attributeValues = _productAttributeService.GetProductAttributeValues(pam.Id); - if (!attributeValues.Any()) - continue; - - //checkboxes could have several values ticked - var allPossibleCheckboxCombinations = new List>(); - if (pam.AttributeControlType == AttributeControlType.Checkboxes || - pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) - { - for (int counter = 0; counter < (1 << attributeValues.Count); ++counter) - { - var checkboxCombination = new List(); - for (int i = 0; i < attributeValues.Count; ++i) - { - if ((counter & (1 << i)) == 0) - { - checkboxCombination.Add(attributeValues[i]); - } - } - - allPossibleCheckboxCombinations.Add(checkboxCombination); - } - } - - if (!attributesXml.Any()) - { - //first set of values - if (pam.AttributeControlType == AttributeControlType.Checkboxes || - pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) - { - //checkboxes could have several values ticked - foreach (var checkboxCombination in allPossibleCheckboxCombinations) - { - var tmp1 = ""; - foreach (var checkboxValue in checkboxCombination) - { - tmp1 = AddProductAttribute(tmp1, pam, checkboxValue.Id.ToString()); - } - if (!String.IsNullOrEmpty(tmp1)) - { - attributesXml.Add(tmp1); - } - } - } - else - { - //other attribute types (dropdownlist, radiobutton, color squares) - foreach (var attributeValue in attributeValues) - { - var tmp1 = AddProductAttribute("", pam, attributeValue.Id.ToString()); - attributesXml.Add(tmp1); - } - } - } - else - { - //next values. let's "append" them to already generated attribute combinations in XML format - var attributesXmlTmp = new List(); - if (pam.AttributeControlType == AttributeControlType.Checkboxes || - pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) - { - //checkboxes could have several values ticked - foreach (var str1 in attributesXml) - { - foreach (var checkboxCombination in allPossibleCheckboxCombinations) - { - var tmp1 = str1; - foreach (var checkboxValue in checkboxCombination) - { - tmp1 = AddProductAttribute(tmp1, pam, checkboxValue.Id.ToString()); - } - if (!String.IsNullOrEmpty(tmp1)) - { - attributesXmlTmp.Add(tmp1); - } - } - } - } - else - { - //other attribute types (dropdownlist, radiobutton, color squares) - foreach (var attributeValue in attributeValues) - { - foreach (var str1 in attributesXml) - { - var tmp1 = AddProductAttribute(str1, pam, attributeValue.Id.ToString()); - attributesXmlTmp.Add(tmp1); - } - } - } - attributesXml.Clear(); - attributesXml.AddRange(attributesXmlTmp); - } - } - allAttributesXml.AddRange(attributesXml); - } - - //validate conditional attributes (if specified) - //minor workaround: - //once it's done (validation), then we could have some duplicated combinations in result - //we don't remove them here (for performance optimization) because anyway it'll be done in the "GenerateAllAttributeCombinations" method of ProductController - for (int i = 0; i < allAttributesXml.Count; i++) - { - var attributesXml = allAttributesXml[i]; - foreach (var attribute in allProductAttributMappings) - { - var conditionMet = IsConditionMet(attribute, attributesXml); - if (conditionMet.HasValue && !conditionMet.Value) - { - allAttributesXml[i] = RemoveProductAttribute(attributesXml, attribute); - } - } - } - return allAttributesXml; - } - - #endregion - - #region Gift card attributes - - /// - /// Add gift card attrbibutes - /// - /// Attributes in XML format - /// Recipient name - /// Recipient email - /// Sender name - /// Sender email - /// Message - /// Attributes - public string AddGiftCardAttribute(string attributesXml, string recipientName, - string recipientEmail, string senderName, string senderEmail, string giftCardMessage) - { - string result = string.Empty; - try - { - recipientName = recipientName.Trim(); - recipientEmail = recipientEmail.Trim(); - senderName = senderName.Trim(); - senderEmail = senderEmail.Trim(); - - var xmlDoc = new XmlDocument(); - if (String.IsNullOrEmpty(attributesXml)) - { - var element1 = xmlDoc.CreateElement("Attributes"); - xmlDoc.AppendChild(element1); - } - else - { - xmlDoc.LoadXml(attributesXml); - } - - var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); - - var giftCardElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo"); - if (giftCardElement == null) - { - giftCardElement = xmlDoc.CreateElement("GiftCardInfo"); - rootElement.AppendChild(giftCardElement); - } - - var recipientNameElement = xmlDoc.CreateElement("RecipientName"); - recipientNameElement.InnerText = recipientName; - giftCardElement.AppendChild(recipientNameElement); - - var recipientEmailElement = xmlDoc.CreateElement("RecipientEmail"); - recipientEmailElement.InnerText = recipientEmail; - giftCardElement.AppendChild(recipientEmailElement); - - var senderNameElement = xmlDoc.CreateElement("SenderName"); - senderNameElement.InnerText = senderName; - giftCardElement.AppendChild(senderNameElement); - - var senderEmailElement = xmlDoc.CreateElement("SenderEmail"); - senderEmailElement.InnerText = senderEmail; - giftCardElement.AppendChild(senderEmailElement); - - var messageElement = xmlDoc.CreateElement("Message"); - messageElement.InnerText = giftCardMessage; - giftCardElement.AppendChild(messageElement); - - result = xmlDoc.OuterXml; - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - return result; - } - - /// - /// Get gift card attrbibutes - /// - /// Attributes - /// Recipient name - /// Recipient email - /// Sender name - /// Sender email - /// Message - public void GetGiftCardAttribute(string attributesXml, out string recipientName, - out string recipientEmail, out string senderName, - out string senderEmail, out string giftCardMessage) - { - recipientName = string.Empty; - recipientEmail = string.Empty; - senderName = string.Empty; - senderEmail = string.Empty; - giftCardMessage = string.Empty; - - try - { - var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(attributesXml); - - var recipientNameElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/RecipientName"); - var recipientEmailElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/RecipientEmail"); - var senderNameElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/SenderName"); - var senderEmailElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/SenderEmail"); - var messageElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/Message"); - - if (recipientNameElement != null) - recipientName = recipientNameElement.InnerText; - if (recipientEmailElement != null) - recipientEmail = recipientEmailElement.InnerText; - if (senderNameElement != null) - senderName = senderNameElement.InnerText; - if (senderEmailElement != null) - senderEmail = senderEmailElement.InnerText; - if (messageElement != null) - giftCardMessage = messageElement.InnerText; - } - catch (Exception exc) - { - Debug.Write(exc.ToString()); - } - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Xml; +using Nop.Core.Domain.Catalog; +using Nop.Data; +using Nop.Services.Tax; +using System.Globalization; + +namespace Nop.Services.Catalog +{ + /// + /// Product attribute parser + /// + public partial class ProductAttributeParser : IProductAttributeParser + { + #region Fields + + private readonly IDbContext _context; + private readonly IProductAttributeService _productAttributeService; + + #endregion + + #region Ctor + + public ProductAttributeParser(IDbContext context, + IProductAttributeService productAttributeService) + { + this._context = context; + this._productAttributeService = productAttributeService; + } + + #endregion + + #region Product attributes + + /// + /// Gets selected product attribute mapping identifiers + /// + /// Attributes in XML format + /// Selected product attribute mapping identifiers + protected virtual IList ParseProductAttributeMappingIds(string attributesXml) + { + var ids = new List(); + if (String.IsNullOrEmpty(attributesXml)) + return ids; + + try + { + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(attributesXml); + + var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); + foreach (XmlNode node1 in nodeList1) + { + if (node1.Attributes != null && node1.Attributes["ID"] != null) + { + string str1 = node1.Attributes["ID"].InnerText.Trim(); + int id; + if (int.TryParse(str1, out id)) + { + ids.Add(id); + } + } + } + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return ids; + } + + /// + /// Gets selected product attribute values with the quantity entered by the customer + /// + /// Attributes in XML format + /// Product attribute mapping identifier + /// Collections of pairs of product attribute values and their quantity + protected IList> ParseValuesWithQuantity(string attributesXml, int productAttributeMappingId) + { + var selectedValues = new List>(); + if (string.IsNullOrEmpty(attributesXml)) + return selectedValues; + + try + { + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(attributesXml); + + foreach (XmlNode attributeNode in xmlDoc.SelectNodes(@"//Attributes/ProductAttribute")) + { + if (attributeNode.Attributes != null && attributeNode.Attributes["ID"] != null) + { + int attributeId; + if (int.TryParse(attributeNode.Attributes["ID"].InnerText.Trim(), out attributeId) && attributeId == productAttributeMappingId) + { + foreach (XmlNode attributeValue in attributeNode.SelectNodes("ProductAttributeValue")) + { + var value = attributeValue.SelectSingleNode("Value").InnerText.Trim(); + var quantityNode = attributeValue.SelectSingleNode("Quantity"); + selectedValues.Add(new Tuple(value, quantityNode != null ? quantityNode.InnerText.Trim() : string.Empty)); + } + } + } + } + } + catch { } + + return selectedValues; + } + + /// + /// Gets selected product attribute mappings + /// + /// Attributes in XML format + /// Selected product attribute mappings + public virtual IList ParseProductAttributeMappings(string attributesXml) + { + var result = new List(); + if (String.IsNullOrEmpty(attributesXml)) + return result; + + var ids = ParseProductAttributeMappingIds(attributesXml); + foreach (int id in ids) + { + var attribute = _productAttributeService.GetProductAttributeMappingById(id); + if (attribute != null) + { + result.Add(attribute); + } + } + return result; + } + + /// + /// Get product attribute values + /// + /// Attributes in XML format + /// Product attribute mapping identifier; pass 0 to load all values + /// Product attribute values + public virtual IList ParseProductAttributeValues(string attributesXml, int productAttributeMappingId = 0) + { + var values = new List(); + if (string.IsNullOrEmpty(attributesXml)) + return values; + + var attributes = ParseProductAttributeMappings(attributesXml); + + //to load values only for the passed product attribute mapping + if (productAttributeMappingId > 0) + attributes = attributes.Where(attribute => attribute.Id == productAttributeMappingId).ToList(); + + foreach (var attribute in attributes) + { + if (!attribute.ShouldHaveValues()) + continue; + + foreach (var attributeValue in ParseValuesWithQuantity(attributesXml, attribute.Id)) + { + int attributeValueId; + if (!string.IsNullOrEmpty(attributeValue.Item1) && int.TryParse(attributeValue.Item1, out attributeValueId)) + { + var value = _productAttributeService.GetProductAttributeValueById(attributeValueId); + if (value != null) + { + int quantity; + if (!string.IsNullOrEmpty(attributeValue.Item2) && int.TryParse(attributeValue.Item2, out quantity) && quantity != value.Quantity) + { + //if customer enters quantity, use new entity with new quantity + var oldValue = _context.LoadOriginalCopy(value); + oldValue.ProductAttributeMapping = attribute; + oldValue.Quantity = quantity; + values.Add(oldValue); + } + else + values.Add(value); + } + } + } + } + return values; + } + + /// + /// Gets selected product attribute values + /// + /// Attributes in XML format + /// Product attribute mapping identifier + /// Product attribute values + public virtual IList ParseValues(string attributesXml, int productAttributeMappingId) + { + var selectedValues = new List(); + if (String.IsNullOrEmpty(attributesXml)) + return selectedValues; + + try + { + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(attributesXml); + + var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); + foreach (XmlNode node1 in nodeList1) + { + if (node1.Attributes != null && node1.Attributes["ID"] != null) + { + string str1 =node1.Attributes["ID"].InnerText.Trim(); + int id; + if (int.TryParse(str1, out id)) + { + if (id == productAttributeMappingId) + { + var nodeList2 = node1.SelectNodes(@"ProductAttributeValue/Value"); + foreach (XmlNode node2 in nodeList2) + { + string value = node2.InnerText.Trim(); + selectedValues.Add(value); + } + } + } + } + } + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return selectedValues; + } + + /// + /// Adds an attribute + /// + /// Attributes in XML format + /// Product attribute mapping + /// Value + /// Quantity (used with AttributeValueType.AssociatedToProduct to specify the quantity entered by the customer) + /// Updated result (XML format) + public virtual string AddProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping, string value, int? quantity = null) + { + string result = string.Empty; + try + { + var xmlDoc = new XmlDocument(); + if (String.IsNullOrEmpty(attributesXml)) + { + var element1 = xmlDoc.CreateElement("Attributes"); + xmlDoc.AppendChild(element1); + } + else + { + xmlDoc.LoadXml(attributesXml); + } + var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); + + XmlElement attributeElement = null; + //find existing + var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); + foreach (XmlNode node1 in nodeList1) + { + if (node1.Attributes != null && node1.Attributes["ID"] != null) + { + string str1 =node1.Attributes["ID"].InnerText.Trim(); + int id; + if (int.TryParse(str1, out id)) + { + if (id == productAttributeMapping.Id) + { + attributeElement = (XmlElement)node1; + break; + } + } + } + } + + //create new one if not found + if (attributeElement == null) + { + attributeElement = xmlDoc.CreateElement("ProductAttribute"); + attributeElement.SetAttribute("ID", productAttributeMapping.Id.ToString()); + rootElement.AppendChild(attributeElement); + } + var attributeValueElement = xmlDoc.CreateElement("ProductAttributeValue"); + attributeElement.AppendChild(attributeValueElement); + + var attributeValueValueElement = xmlDoc.CreateElement("Value"); + attributeValueValueElement.InnerText = value; + attributeValueElement.AppendChild(attributeValueValueElement); + + //the quantity entered by the customer + if (quantity.HasValue) + { + var attributeValueQuantity = xmlDoc.CreateElement("Quantity"); + attributeValueQuantity.InnerText = quantity.ToString(); + attributeValueElement.AppendChild(attributeValueQuantity); + } + + result = xmlDoc.OuterXml; + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return result; + } + + /// + /// Remove an attribute + /// + /// Attributes in XML format + /// Product attribute mapping + /// Updated result (XML format) + public virtual string RemoveProductAttribute(string attributesXml, ProductAttributeMapping productAttributeMapping) + { + string result = string.Empty; + try + { + var xmlDoc = new XmlDocument(); + if (String.IsNullOrEmpty(attributesXml)) + { + var element1 = xmlDoc.CreateElement("Attributes"); + xmlDoc.AppendChild(element1); + } + else + { + xmlDoc.LoadXml(attributesXml); + } + var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); + + XmlElement attributeElement = null; + //find existing + var nodeList1 = xmlDoc.SelectNodes(@"//Attributes/ProductAttribute"); + foreach (XmlNode node1 in nodeList1) + { + if (node1.Attributes != null && node1.Attributes["ID"] != null) + { + string str1 = node1.Attributes["ID"].InnerText.Trim(); + int id; + if (int.TryParse(str1, out id)) + { + if (id == productAttributeMapping.Id) + { + attributeElement = (XmlElement)node1; + break; + } + } + } + } + + //found + if (attributeElement != null) + { + rootElement.RemoveChild(attributeElement); + } + + result = xmlDoc.OuterXml; + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return result; + } + + /// + /// Are attributes equal + /// + /// The attributes of the first product + /// The attributes of the second product + /// A value indicating whether we should ignore non-combinable attributes + /// A value indicating whether we should ignore the quantity of attribute value entered by the customer + /// Result + public virtual bool AreProductAttributesEqual(string attributesXml1, string attributesXml2, bool ignoreNonCombinableAttributes, bool ignoreQuantity = true) + { + var attributes1 = ParseProductAttributeMappings(attributesXml1); + if (ignoreNonCombinableAttributes) + { + attributes1 = attributes1.Where(x => !x.IsNonCombinable()).ToList(); + } + var attributes2 = ParseProductAttributeMappings(attributesXml2); + if (ignoreNonCombinableAttributes) + { + attributes2 = attributes2.Where(x => !x.IsNonCombinable()).ToList(); + } + if (attributes1.Count != attributes2.Count) + return false; + + bool attributesEqual = true; + foreach (var a1 in attributes1) + { + bool hasAttribute = false; + foreach (var a2 in attributes2) + { + if (a1.Id == a2.Id) + { + hasAttribute = true; + var values1Str = ParseValuesWithQuantity(attributesXml1, a1.Id); + var values2Str = ParseValuesWithQuantity(attributesXml2, a2.Id); + if (values1Str.Count == values2Str.Count) + { + foreach (var str1 in values1Str) + { + bool hasValue = false; + foreach (var str2 in values2Str) + { + //case insensitive? + //if (str1.Trim().ToLower() == str2.Trim().ToLower()) + if (str1.Item1.Trim() == str2.Item1.Trim()) + { + hasValue = ignoreQuantity ? true : str1.Item2.Trim() == str2.Item2.Trim(); + break; + } + } + + if (!hasValue) + { + attributesEqual = false; + break; + } + } + } + else + { + attributesEqual = false; + break; + } + } + } + + if (hasAttribute == false) + { + attributesEqual = false; + break; + } + } + + return attributesEqual; + } + + /// + /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified + /// + /// Product attribute + /// Selected attributes (XML format) + /// Result + public virtual bool? IsConditionMet(ProductAttributeMapping pam, string selectedAttributesXml) + { + if (pam == null) + throw new ArgumentNullException("pam"); + + var conditionAttributeXml = pam.ConditionAttributeXml; + if (String.IsNullOrEmpty(conditionAttributeXml)) + //no condition + return null; + + //load an attribute this one depends on + var dependOnAttribute = ParseProductAttributeMappings(conditionAttributeXml).FirstOrDefault(); + if (dependOnAttribute == null) + return true; + + var valuesThatShouldBeSelected = ParseValues(conditionAttributeXml, dependOnAttribute.Id) + //a workaround here: + //ConditionAttributeXml can contain "empty" values (nothing is selected) + //but in other cases (like below) we do not store empty values + //that's why we remove empty values here + .Where(x => !String.IsNullOrEmpty(x)) + .ToList(); + var selectedValues = ParseValues(selectedAttributesXml, dependOnAttribute.Id); + if (valuesThatShouldBeSelected.Count != selectedValues.Count) + return false; + + //compare values + var allFound = true; + foreach (var t1 in valuesThatShouldBeSelected) + { + bool found = false; + foreach (var t2 in selectedValues) + if (t1 == t2) + found = true; + if (!found) + allFound = false; + } + + return allFound; + } + + /// + /// Finds a product attribute combination by attributes stored in XML + /// + /// Product + /// Attributes in XML format + /// A value indicating whether we should ignore non-combinable attributes + /// Found product attribute combination + public virtual ProductAttributeCombination FindProductAttributeCombination(Product product, + string attributesXml, bool ignoreNonCombinableAttributes = true) + { + if (product == null) + throw new ArgumentNullException("product"); + + var combinations = _productAttributeService.GetAllProductAttributeCombinations(product.Id); + return combinations.FirstOrDefault(x => + AreProductAttributesEqual(x.AttributesXml, attributesXml, ignoreNonCombinableAttributes)); + } + + /// + /// Generate all combinations + /// + /// Product + /// A value indicating whether we should ignore non-combinable attributes + /// Attribute combinations in XML format + public virtual IList GenerateAllCombinations(Product product, bool ignoreNonCombinableAttributes = false) + { + if (product == null) + throw new ArgumentNullException("product"); + + var allProductAttributMappings = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); + if (ignoreNonCombinableAttributes) + { + allProductAttributMappings = allProductAttributMappings.Where(x => !x.IsNonCombinable()).ToList(); + } + var allPossibleAttributeCombinations = new List>(); + for (int counter = 0; counter < (1 << allProductAttributMappings.Count); ++counter) + { + var combination = new List(); + for (int i = 0; i < allProductAttributMappings.Count; ++i) + { + if ((counter & (1 << i)) == 0) + { + combination.Add(allProductAttributMappings[i]); + } + } + + allPossibleAttributeCombinations.Add(combination); + } + + var allAttributesXml = new List(); + foreach (var combination in allPossibleAttributeCombinations) + { + var attributesXml = new List(); + foreach (var pam in combination) + { + if (!pam.ShouldHaveValues()) + continue; + + var attributeValues = _productAttributeService.GetProductAttributeValues(pam.Id); + if (!attributeValues.Any()) + continue; + + //checkboxes could have several values ticked + var allPossibleCheckboxCombinations = new List>(); + if (pam.AttributeControlType == AttributeControlType.Checkboxes || + pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) + { + for (int counter = 0; counter < (1 << attributeValues.Count); ++counter) + { + var checkboxCombination = new List(); + for (int i = 0; i < attributeValues.Count; ++i) + { + if ((counter & (1 << i)) == 0) + { + checkboxCombination.Add(attributeValues[i]); + } + } + + allPossibleCheckboxCombinations.Add(checkboxCombination); + } + } + + if (!attributesXml.Any()) + { + //first set of values + if (pam.AttributeControlType == AttributeControlType.Checkboxes || + pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) + { + //checkboxes could have several values ticked + foreach (var checkboxCombination in allPossibleCheckboxCombinations) + { + var tmp1 = ""; + foreach (var checkboxValue in checkboxCombination) + { + tmp1 = AddProductAttribute(tmp1, pam, checkboxValue.Id.ToString()); + } + if (!String.IsNullOrEmpty(tmp1)) + { + attributesXml.Add(tmp1); + } + } + } + else + { + //other attribute types (dropdownlist, radiobutton, color squares) + foreach (var attributeValue in attributeValues) + { + var tmp1 = AddProductAttribute("", pam, attributeValue.Id.ToString()); + attributesXml.Add(tmp1); + } + } + } + else + { + //next values. let's "append" them to already generated attribute combinations in XML format + var attributesXmlTmp = new List(); + if (pam.AttributeControlType == AttributeControlType.Checkboxes || + pam.AttributeControlType == AttributeControlType.ReadonlyCheckboxes) + { + //checkboxes could have several values ticked + foreach (var str1 in attributesXml) + { + foreach (var checkboxCombination in allPossibleCheckboxCombinations) + { + var tmp1 = str1; + foreach (var checkboxValue in checkboxCombination) + { + tmp1 = AddProductAttribute(tmp1, pam, checkboxValue.Id.ToString()); + } + if (!String.IsNullOrEmpty(tmp1)) + { + attributesXmlTmp.Add(tmp1); + } + } + } + } + else + { + //other attribute types (dropdownlist, radiobutton, color squares) + foreach (var attributeValue in attributeValues) + { + foreach (var str1 in attributesXml) + { + var tmp1 = AddProductAttribute(str1, pam, attributeValue.Id.ToString()); + attributesXmlTmp.Add(tmp1); + } + } + } + attributesXml.Clear(); + attributesXml.AddRange(attributesXmlTmp); + } + } + allAttributesXml.AddRange(attributesXml); + } + + //validate conditional attributes (if specified) + //minor workaround: + //once it's done (validation), then we could have some duplicated combinations in result + //we don't remove them here (for performance optimization) because anyway it'll be done in the "GenerateAllAttributeCombinations" method of ProductController + for (int i = 0; i < allAttributesXml.Count; i++) + { + var attributesXml = allAttributesXml[i]; + foreach (var attribute in allProductAttributMappings) + { + var conditionMet = IsConditionMet(attribute, attributesXml); + if (conditionMet.HasValue && !conditionMet.Value) + { + allAttributesXml[i] = RemoveProductAttribute(attributesXml, attribute); + } + } + } + return allAttributesXml; + } + + #endregion + + #region taxAttribute + /// + /// Adds tax subdivision to existing attributesXml + /// + /// Attributes in XML format + /// Set Product tax subdivision + /// Updated result (XML format) + public virtual string AddTaxAttribute(string attributesXml, TaxSummary taxSummary) + { + string result = string.Empty; + try + { + var xmlDoc = new XmlDocument(); + if (String.IsNullOrEmpty(attributesXml)) + { + var element1 = xmlDoc.CreateElement("Attributes"); + xmlDoc.AppendChild(element1); + } + else + { + xmlDoc.LoadXml(attributesXml); + } + var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); + var attributeTaxElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/ProductAttributesTax"); + + if (taxSummary.TaxRates.Any()) + { + //create new ProductAttributesTax element if not found + if (attributeTaxElement == null) + { + attributeTaxElement = xmlDoc.CreateElement("ProductAttributesTax"); + rootElement.AppendChild(attributeTaxElement); + } + + foreach (KeyValuePair kvp in taxSummary.TaxRates) + { + decimal vatpercentage = kvp.Key; + TaxRateEntry taxrate = kvp.Value; + + //find existing + var strVatPer = vatpercentage.ToString(CultureInfo.InvariantCulture); + var strNode = String.Format("//Attributes/ProductAttributesTax/TaxRate[@Rate='{0}']", strVatPer); + var attributeTaxRateElement = (XmlElement)xmlDoc.SelectSingleNode(@strNode); + + //create new one if not found + if (attributeTaxRateElement == null) + { + attributeTaxRateElement = xmlDoc.CreateElement("TaxRate"); + attributeTaxRateElement.SetAttribute("Rate", strVatPer); + attributeTaxElement.AppendChild(attributeTaxRateElement); + } + attributeTaxRateElement.SetAttribute("RateWeight", taxrate.TaxRateWeight.ToString(CultureInfo.InvariantCulture)); + } + } + else + { + //remove attributeTaxElement when no taxRates + if (attributeTaxElement != null) + { + rootElement.RemoveChild(attributeTaxElement); + } + } + result = xmlDoc.OuterXml; + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return result; + } + /// + /// Parse ProductAttributesTax + /// + /// Attributes in XML format + /// SortedDictionary with taxRate and taxRateWeight + public SortedDictionary ParseTaxAttribute(string attributesXml) + { + var taxDict = new SortedDictionary(); + var xmlDoc = new XmlDocument(); + if (!String.IsNullOrEmpty(attributesXml)) + { + xmlDoc.LoadXml(attributesXml); + foreach (XmlElement e in xmlDoc.SelectNodes("//Attributes/ProductAttributesTax/TaxRate")) + { + var style = NumberStyles.AllowDecimalPoint; + decimal rate = decimal.Zero; decimal rateWeight = decimal.Zero; + if (decimal.TryParse(e.GetAttribute("Rate"), style, CultureInfo.InvariantCulture, out rate) && decimal.TryParse(e.GetAttribute("RateWeight"), style, CultureInfo.InvariantCulture, out rateWeight)) + taxDict.Add(rate, rateWeight); + } + + } + return taxDict; + } + + /// + /// Check if attributesXml contains tax attribute info + /// + /// Attributes in XML format + /// A boolean value indicating if tax attribute info is present + public bool hasTaxInfoInAttributeXML(string attributesXml) + { + return attributesXml.Contains("Attributes in XML format + /// Recipient name + /// Recipient email + /// Sender name + /// Sender email + /// Message + /// Attributes + public string AddGiftCardAttribute(string attributesXml, string recipientName, + string recipientEmail, string senderName, string senderEmail, string giftCardMessage) + { + string result = string.Empty; + try + { + recipientName = recipientName.Trim(); + recipientEmail = recipientEmail.Trim(); + senderName = senderName.Trim(); + senderEmail = senderEmail.Trim(); + + var xmlDoc = new XmlDocument(); + if (String.IsNullOrEmpty(attributesXml)) + { + var element1 = xmlDoc.CreateElement("Attributes"); + xmlDoc.AppendChild(element1); + } + else + { + xmlDoc.LoadXml(attributesXml); + } + + var rootElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes"); + + var giftCardElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo"); + if (giftCardElement == null) + { + giftCardElement = xmlDoc.CreateElement("GiftCardInfo"); + rootElement.AppendChild(giftCardElement); + } + + var recipientNameElement = xmlDoc.CreateElement("RecipientName"); + recipientNameElement.InnerText = recipientName; + giftCardElement.AppendChild(recipientNameElement); + + var recipientEmailElement = xmlDoc.CreateElement("RecipientEmail"); + recipientEmailElement.InnerText = recipientEmail; + giftCardElement.AppendChild(recipientEmailElement); + + var senderNameElement = xmlDoc.CreateElement("SenderName"); + senderNameElement.InnerText = senderName; + giftCardElement.AppendChild(senderNameElement); + + var senderEmailElement = xmlDoc.CreateElement("SenderEmail"); + senderEmailElement.InnerText = senderEmail; + giftCardElement.AppendChild(senderEmailElement); + + var messageElement = xmlDoc.CreateElement("Message"); + messageElement.InnerText = giftCardMessage; + giftCardElement.AppendChild(messageElement); + + result = xmlDoc.OuterXml; + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + return result; + } + + /// + /// Get gift card attrbibutes + /// + /// Attributes + /// Recipient name + /// Recipient email + /// Sender name + /// Sender email + /// Message + public void GetGiftCardAttribute(string attributesXml, out string recipientName, + out string recipientEmail, out string senderName, + out string senderEmail, out string giftCardMessage) + { + recipientName = string.Empty; + recipientEmail = string.Empty; + senderName = string.Empty; + senderEmail = string.Empty; + giftCardMessage = string.Empty; + + try + { + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(attributesXml); + + var recipientNameElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/RecipientName"); + var recipientEmailElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/RecipientEmail"); + var senderNameElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/SenderName"); + var senderEmailElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/SenderEmail"); + var messageElement = (XmlElement)xmlDoc.SelectSingleNode(@"//Attributes/GiftCardInfo/Message"); + + if (recipientNameElement != null) + recipientName = recipientNameElement.InnerText; + if (recipientEmailElement != null) + recipientEmail = recipientEmailElement.InnerText; + if (senderNameElement != null) + senderName = senderNameElement.InnerText; + if (senderEmailElement != null) + senderEmail = senderEmailElement.InnerText; + if (messageElement != null) + giftCardMessage = messageElement.InnerText; + } + catch (Exception exc) + { + Debug.Write(exc.ToString()); + } + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Catalog/RoundingHelper.cs b/src/Libraries/Nop.Services/Catalog/RoundingHelper.cs index beceb364206..7a8df355381 100644 --- a/src/Libraries/Nop.Services/Catalog/RoundingHelper.cs +++ b/src/Libraries/Nop.Services/Catalog/RoundingHelper.cs @@ -102,5 +102,18 @@ public static decimal Round(this decimal value, RoundingType roundingType) return rez; } + + public static decimal RoundTax(decimal value) + { + //we use this method because some currencies (e.g. Gungarian Forint or Swiss Franc) use non-standard rules for rounding + //you can implement any rounding logic here + //use EngineContext.Current.Resolve() to get current currency + + //using Swiss Franc (CHF)? just uncomment the line below + //return Math.Round(value * 20, 0) / 20; + + //default round + return Math.Round(value, 2, MidpointRounding.AwayFromZero); + } } } diff --git a/src/Libraries/Nop.Services/Common/PdfService.cs b/src/Libraries/Nop.Services/Common/PdfService.cs index 8ae14490aa7..fa99196b7a4 100644 --- a/src/Libraries/Nop.Services/Common/PdfService.cs +++ b/src/Libraries/Nop.Services/Common/PdfService.cs @@ -1,1347 +1,1382 @@ -// RTL Support provided by Credo inc (www.credo.co.il || info@credo.co.il) - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using iTextSharp.text; -using iTextSharp.text.pdf; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Core.Html; -using Nop.Services.Catalog; -using Nop.Services.Configuration; -using Nop.Services.Directory; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Media; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Stores; - -namespace Nop.Services.Common -{ - /// - /// PDF service - /// - public partial class PdfService : IPdfService - { - #region Fields - - private readonly ILocalizationService _localizationService; - private readonly ILanguageService _languageService; - private readonly IWorkContext _workContext; - private readonly IOrderService _orderService; - private readonly IPaymentService _paymentService; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly IPriceFormatter _priceFormatter; - private readonly ICurrencyService _currencyService; - private readonly IMeasureService _measureService; - private readonly IPictureService _pictureService; - private readonly IProductService _productService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IStoreService _storeService; - private readonly IStoreContext _storeContext; - private readonly ISettingService _settingContext; - private readonly IAddressAttributeFormatter _addressAttributeFormatter; - - private readonly CatalogSettings _catalogSettings; - private readonly CurrencySettings _currencySettings; - private readonly MeasureSettings _measureSettings; - private readonly PdfSettings _pdfSettings; - private readonly TaxSettings _taxSettings; - private readonly AddressSettings _addressSettings; - - #endregion - - #region Ctor - - public PdfService(ILocalizationService localizationService, - ILanguageService languageService, - IWorkContext workContext, - IOrderService orderService, - IPaymentService paymentService, - IDateTimeHelper dateTimeHelper, - IPriceFormatter priceFormatter, - ICurrencyService currencyService, - IMeasureService measureService, - IPictureService pictureService, - IProductService productService, - IProductAttributeParser productAttributeParser, - IStoreService storeService, - IStoreContext storeContext, - ISettingService settingContext, - IAddressAttributeFormatter addressAttributeFormatter, - CatalogSettings catalogSettings, - CurrencySettings currencySettings, - MeasureSettings measureSettings, - PdfSettings pdfSettings, - TaxSettings taxSettings, - AddressSettings addressSettings) - { - this._localizationService = localizationService; - this._languageService = languageService; - this._workContext = workContext; - this._orderService = orderService; - this._paymentService = paymentService; - this._dateTimeHelper = dateTimeHelper; - this._priceFormatter = priceFormatter; - this._currencyService = currencyService; - this._measureService = measureService; - this._pictureService = pictureService; - this._productService = productService; - this._productAttributeParser = productAttributeParser; - this._storeService = storeService; - this._storeContext = storeContext; - this._settingContext = settingContext; - this._addressAttributeFormatter = addressAttributeFormatter; - this._currencySettings = currencySettings; - this._catalogSettings = catalogSettings; - this._measureSettings = measureSettings; - this._pdfSettings = pdfSettings; - this._taxSettings = taxSettings; - this._addressSettings = addressSettings; - } - - #endregion - - #region Utilities - - /// - /// Get font - /// - /// Font - protected virtual Font GetFont() - { - //nopCommerce supports unicode characters - //nopCommerce uses Free Serif font by default (~/App_Data/Pdf/FreeSerif.ttf file) - //It was downloaded from http://savannah.gnu.org/projects/freefont - return GetFont(_pdfSettings.FontFileName); - } - /// - /// Get font - /// - /// Font file name - /// Font - protected virtual Font GetFont(string fontFileName) - { - if (fontFileName == null) - throw new ArgumentNullException("fontFileName"); - - string fontPath = Path.Combine(CommonHelper.MapPath("~/App_Data/Pdf/"), fontFileName); - var baseFont = BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); - var font = new Font(baseFont, 10, Font.NORMAL); - return font; - } - - /// - /// Get font direction - /// - /// Language - /// Font direction - protected virtual int GetDirection(Language lang) - { - return lang.Rtl ? PdfWriter.RUN_DIRECTION_RTL : PdfWriter.RUN_DIRECTION_LTR; - } - - /// - /// Get element alignment - /// - /// Language - /// Is opposite? - /// Element alignment - protected virtual int GetAlignment(Language lang, bool isOpposite = false) - { - //if we need the element to be opposite, like logo etc`. - if (!isOpposite) - return lang.Rtl ? Element.ALIGN_RIGHT : Element.ALIGN_LEFT; - - return lang.Rtl ? Element.ALIGN_LEFT : Element.ALIGN_RIGHT; - } - - #endregion - - #region Methods - - /// - /// Print an order to PDF - /// - /// Order - /// Language identifier; 0 to use a language used when placing an order - /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed - /// A path of generated file - public virtual string PrintOrderToPdf(Order order, int languageId = 0, int vendorId = 0) - { - if (order == null) - throw new ArgumentNullException("order"); - - string fileName = string.Format("order_{0}_{1}.pdf", order.OrderGuid, CommonHelper.GenerateRandomDigitCode(4)); - string filePath = Path.Combine(CommonHelper.MapPath("~/content/files/ExportImport"), fileName); - using (var fileStream = new FileStream(filePath, FileMode.Create)) - { - var orders = new List(); - orders.Add(order); - PrintOrdersToPdf(fileStream, orders, languageId, vendorId); - } - return filePath; - } - - /// - /// Print orders to PDF - /// - /// Stream - /// Orders - /// Language identifier; 0 to use a language used when placing an order - /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed - public virtual void PrintOrdersToPdf(Stream stream, IList orders, int languageId = 0, int vendorId = 0) - { - if (stream == null) - throw new ArgumentNullException("stream"); - - if (orders == null) - throw new ArgumentNullException("orders"); - - var pageSize = PageSize.A4; - - if (_pdfSettings.LetterPageSizeEnabled) - { - pageSize = PageSize.LETTER; - } - - - var doc = new Document(pageSize); - var pdfWriter = PdfWriter.GetInstance(doc, stream); - doc.Open(); - - //fonts - var titleFont = GetFont(); - titleFont.SetStyle(Font.BOLD); - titleFont.Color = BaseColor.BLACK; - var font = GetFont(); - var attributesFont = GetFont(); - attributesFont.SetStyle(Font.ITALIC); - - int ordCount = orders.Count; - int ordNum = 0; - - foreach (var order in orders) - { - //by default _pdfSettings contains settings for the current active store - //and we need PdfSettings for the store which was used to place an order - //so let's load it based on a store of the current order - var pdfSettingsByStore = _settingContext.LoadSetting(order.StoreId); - - - var lang = _languageService.GetLanguageById(languageId == 0 ? order.CustomerLanguageId : languageId); - if (lang == null || !lang.Published) - lang = _workContext.WorkingLanguage; - - #region Header - - //logo - var logoPicture = _pictureService.GetPictureById(pdfSettingsByStore.LogoPictureId); - var logoExists = logoPicture != null; - - //header - var headerTable = new PdfPTable(logoExists ? 2 : 1); - headerTable.RunDirection = GetDirection(lang); - headerTable.DefaultCell.Border = Rectangle.NO_BORDER; - - //store info - var store = _storeService.GetStoreById(order.StoreId) ?? _storeContext.CurrentStore; - var anchor = new Anchor(store.Url.Trim(new [] { '/' }), font); - anchor.Reference = store.Url; - - var cellHeader = new PdfPCell(new Phrase(String.Format(_localizationService.GetResource("PDFInvoice.Order#", lang.Id), order.CustomOrderNumber), titleFont)); - cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); - cellHeader.Phrase.Add(new Phrase(anchor)); - cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); - cellHeader.Phrase.Add(new Phrase(String.Format(_localizationService.GetResource("PDFInvoice.OrderDate", lang.Id), _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc).ToString("D", new CultureInfo(lang.LanguageCulture))), font)); - cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); - cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); - cellHeader.HorizontalAlignment = Element.ALIGN_LEFT; - cellHeader.Border = Rectangle.NO_BORDER; - - headerTable.AddCell(cellHeader); - - if (logoExists) - if (lang.Rtl) - headerTable.SetWidths(new[] { 0.2f, 0.8f }); - else - headerTable.SetWidths(new[] { 0.8f, 0.2f }); - headerTable.WidthPercentage = 100f; - - //logo - if (logoExists) - { - var logoFilePath = _pictureService.GetThumbLocalPath(logoPicture, 0, false); - var logo = Image.GetInstance(logoFilePath); - logo.Alignment = GetAlignment(lang, true); - logo.ScaleToFit(65f, 65f); - - var cellLogo = new PdfPCell(); - cellLogo.Border = Rectangle.NO_BORDER; - cellLogo.AddElement(logo); - headerTable.AddCell(cellLogo); - } - doc.Add(headerTable); - - #endregion - - #region Addresses - - var addressTable = new PdfPTable(2); - addressTable.RunDirection = GetDirection(lang); - addressTable.DefaultCell.Border = Rectangle.NO_BORDER; - addressTable.WidthPercentage = 100f; - addressTable.SetWidths(new[] { 50, 50 }); - - //billing info - var billingAddress = new PdfPTable(1); - billingAddress.DefaultCell.Border = Rectangle.NO_BORDER; - billingAddress.RunDirection = GetDirection(lang); - - billingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.BillingInformation", lang.Id), titleFont)); - - if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.BillingAddress.Company)) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Company", lang.Id), order.BillingAddress.Company), font)); - - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Name", lang.Id), order.BillingAddress.FirstName + " " + order.BillingAddress.LastName), font)); - if (_addressSettings.PhoneEnabled) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.BillingAddress.PhoneNumber), font)); - if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.BillingAddress.FaxNumber)) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Fax", lang.Id), order.BillingAddress.FaxNumber), font)); - if (_addressSettings.StreetAddressEnabled) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.BillingAddress.Address1), font)); - if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.BillingAddress.Address2)) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address2", lang.Id), order.BillingAddress.Address2), font)); - if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) - billingAddress.AddCell(new Paragraph(" " + String.Format("{0}, {1} {2}", order.BillingAddress.City, order.BillingAddress.StateProvince != null ? order.BillingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.BillingAddress.ZipPostalCode), font)); - if (_addressSettings.CountryEnabled && order.BillingAddress.Country != null) - billingAddress.AddCell(new Paragraph(" " + order.BillingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); - - //VAT number - if (!String.IsNullOrEmpty(order.VatNumber)) - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.VATNumber", lang.Id), order.VatNumber), font)); - - //custom attributes - var customBillingAddressAttributes = _addressAttributeFormatter.FormatAttributes( order.BillingAddress.CustomAttributes); - if (!String.IsNullOrEmpty(customBillingAddressAttributes)) - { - //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) - billingAddress.AddCell(new Paragraph(" " + HtmlHelper.ConvertHtmlToPlainText(customBillingAddressAttributes, true, true), font)); - } - - - - //vendors payment details - if (vendorId == 0) - { - //payment method - var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); - string paymentMethodStr = paymentMethod != null ? paymentMethod.GetLocalizedFriendlyName(_localizationService, lang.Id) : order.PaymentMethodSystemName; - if (!String.IsNullOrEmpty(paymentMethodStr)) - { - billingAddress.AddCell(new Paragraph(" ")); - billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.PaymentMethod", lang.Id), paymentMethodStr), font)); - billingAddress.AddCell(new Paragraph()); - } - - //custom values - var customValues = order.DeserializeCustomValues(); - if (customValues != null) - { - foreach (var item in customValues) - { - billingAddress.AddCell(new Paragraph(" ")); - billingAddress.AddCell(new Paragraph(" " + item.Key + ": " + item.Value, font)); - billingAddress.AddCell(new Paragraph()); - } - } - } - addressTable.AddCell(billingAddress); - - //shipping info - var shippingAddress = new PdfPTable(1); - shippingAddress.DefaultCell.Border = Rectangle.NO_BORDER; - shippingAddress.RunDirection = GetDirection(lang); - - if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) - { - //cell = new PdfPCell(); - //cell.Border = Rectangle.NO_BORDER; - - if (!order.PickUpInStore) - { - if (order.ShippingAddress == null) - throw new NopException(string.Format("Shipping is required, but address is not available. Order ID = {0}", order.Id)); - - shippingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.ShippingInformation", lang.Id), titleFont)); - if (!String.IsNullOrEmpty(order.ShippingAddress.Company)) - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Company", lang.Id), order.ShippingAddress.Company), font)); - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Name", lang.Id), order.ShippingAddress.FirstName + " " + order.ShippingAddress.LastName), font)); - if (_addressSettings.PhoneEnabled) - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.ShippingAddress.PhoneNumber), font)); - if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.ShippingAddress.FaxNumber)) - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Fax", lang.Id), order.ShippingAddress.FaxNumber), font)); - if (_addressSettings.StreetAddressEnabled) - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.ShippingAddress.Address1), font)); - if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.ShippingAddress.Address2)) - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address2", lang.Id), order.ShippingAddress.Address2), font)); - if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) - shippingAddress.AddCell(new Paragraph(" " + String.Format("{0}, {1} {2}", order.ShippingAddress.City, order.ShippingAddress.StateProvince != null ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.ShippingAddress.ZipPostalCode), font)); - if (_addressSettings.CountryEnabled && order.ShippingAddress.Country != null) - shippingAddress.AddCell(new Paragraph(" " + order.ShippingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); - //custom attributes - var customShippingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); - if (!String.IsNullOrEmpty(customShippingAddressAttributes)) - { - //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) - shippingAddress.AddCell(new Paragraph(" " + HtmlHelper.ConvertHtmlToPlainText(customShippingAddressAttributes, true, true), font)); - } - shippingAddress.AddCell(new Paragraph(" ")); - } - else - if (order.PickupAddress != null) - { - shippingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.Pickup", lang.Id), titleFont)); - if (!string.IsNullOrEmpty(order.PickupAddress.Address1)) - shippingAddress.AddCell(new Paragraph(string.Format(" {0}", string.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.PickupAddress.Address1)), font)); - if (!string.IsNullOrEmpty(order.PickupAddress.City)) - shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.City), font)); - if (order.PickupAddress.Country != null) - shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.Country.GetLocalized(x => x.Name, lang.Id)), font)); - if (!string.IsNullOrEmpty(order.PickupAddress.ZipPostalCode)) - shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.ZipPostalCode), font)); - shippingAddress.AddCell(new Paragraph(" ")); - } - shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.ShippingMethod", lang.Id), order.ShippingMethod), font)); - shippingAddress.AddCell(new Paragraph()); - - addressTable.AddCell(shippingAddress); - } - else - { - shippingAddress.AddCell(new Paragraph()); - addressTable.AddCell(shippingAddress); - } - - doc.Add(addressTable); - doc.Add(new Paragraph(" ")); - - #endregion - - #region Products - - //products - var productsHeader = new PdfPTable(1); - productsHeader.RunDirection = GetDirection(lang); - productsHeader.WidthPercentage = 100f; - var cellProducts = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.Product(s)", lang.Id), titleFont)); - cellProducts.Border = Rectangle.NO_BORDER; - productsHeader.AddCell(cellProducts); - doc.Add(productsHeader); - doc.Add(new Paragraph(" ")); - - - var orderItems = order.OrderItems; - - var productsTable = new PdfPTable(_catalogSettings.ShowSkuOnProductDetailsPage ? 5 : 4); - productsTable.RunDirection = GetDirection(lang); - productsTable.WidthPercentage = 100f; - if (lang.Rtl) - { - productsTable.SetWidths(_catalogSettings.ShowSkuOnProductDetailsPage - ? new[] {15, 10, 15, 15, 45} - : new[] {20, 10, 20, 50}); - } - else - { - productsTable.SetWidths(_catalogSettings.ShowSkuOnProductDetailsPage - ? new[] {45, 15, 15, 10, 15} - : new[] {50, 20, 10, 20}); - } - - //product name - var cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductName", lang.Id), font)); - cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - - //SKU - if (_catalogSettings.ShowSkuOnProductDetailsPage) - { - cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.SKU", lang.Id), font)); - cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - } - - //price - cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductPrice", lang.Id), font)); - cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - - //qty - cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductQuantity", lang.Id), font)); - cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - - //total - cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductTotal", lang.Id), font)); - cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - - foreach (var orderItem in orderItems) - { - var p = orderItem.Product; - - //a vendor should have access only to his products - if (vendorId > 0 && p.VendorId != vendorId) - continue; - - var pAttribTable = new PdfPTable(1); - pAttribTable.RunDirection = GetDirection(lang); - pAttribTable.DefaultCell.Border = Rectangle.NO_BORDER; - - //product name - string name = p.GetLocalized(x => x.Name, lang.Id); - pAttribTable.AddCell(new Paragraph(name, font)); - cellProductItem.AddElement(new Paragraph(name, font)); - //attributes - if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) - { - var attributesParagraph = new Paragraph(HtmlHelper.ConvertHtmlToPlainText(orderItem.AttributeDescription, true, true), attributesFont); - pAttribTable.AddCell(attributesParagraph); - } - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; - var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - - var rentalInfoParagraph = new Paragraph(rentalInfo, attributesFont); - pAttribTable.AddCell(rentalInfoParagraph); - } - productsTable.AddCell(pAttribTable); - - //SKU - if (_catalogSettings.ShowSkuOnProductDetailsPage) - { - var sku = p.FormatSku(orderItem.AttributesXml, _productAttributeParser); - cellProductItem = new PdfPCell(new Phrase(sku ?? String.Empty, font)); - cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cellProductItem); - } - - //price - string unitPrice; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate); - unitPrice = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - } - else - { - //excluding tax - var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate); - unitPrice = _priceFormatter.FormatPrice(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - } - cellProductItem = new PdfPCell(new Phrase(unitPrice, font)); - cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; - productsTable.AddCell(cellProductItem); - - //qty - cellProductItem = new PdfPCell(new Phrase(orderItem.Quantity.ToString(), font)); - cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; - productsTable.AddCell(cellProductItem); - - //total - string subTotal; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); - subTotal = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - } - else - { - //excluding tax - var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate); - subTotal = _priceFormatter.FormatPrice(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - } - cellProductItem = new PdfPCell(new Phrase(subTotal, font)); - cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; - productsTable.AddCell(cellProductItem); - } - doc.Add(productsTable); - - #endregion - - #region Checkout attributes - - //vendors cannot see checkout attributes - if (vendorId == 0 && !String.IsNullOrEmpty(order.CheckoutAttributeDescription)) - { - doc.Add(new Paragraph(" ")); - var attribTable = new PdfPTable(1); - attribTable.RunDirection = GetDirection(lang); - attribTable.WidthPercentage = 100f; - - string attributes = HtmlHelper.ConvertHtmlToPlainText(order.CheckoutAttributeDescription, true, true); - var cCheckoutAttributes = new PdfPCell(new Phrase(attributes, font)); - cCheckoutAttributes.Border = Rectangle.NO_BORDER; - cCheckoutAttributes.HorizontalAlignment = Element.ALIGN_RIGHT; - attribTable.AddCell(cCheckoutAttributes); - doc.Add(attribTable); - } - - #endregion - - #region Totals - - //vendors cannot see totals - if (vendorId == 0) - { - //subtotal - var totalsTable = new PdfPTable(1); - totalsTable.RunDirection = GetDirection(lang); - totalsTable.DefaultCell.Border = Rectangle.NO_BORDER; - totalsTable.WidthPercentage = 100f; - - //order subtotal - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) - { - //including tax - - var orderSubtotalInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalInclTax, order.CurrencyRate); - string orderSubtotalInclTaxStr = _priceFormatter.FormatPrice(orderSubtotalInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Sub-Total", lang.Id), orderSubtotalInclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - else - { - //excluding tax - - var orderSubtotalExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalExclTax, order.CurrencyRate); - string orderSubtotalExclTaxStr = _priceFormatter.FormatPrice(orderSubtotalExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Sub-Total", lang.Id), orderSubtotalExclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - - //discount (applied to order subtotal) - if (order.OrderSubTotalDiscountExclTax > decimal.Zero) - { - //order subtotal - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) - { - //including tax - - var orderSubTotalDiscountInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountInclTax, order.CurrencyRate); - string orderSubTotalDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderSubTotalDiscountInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderSubTotalDiscountInCustomerCurrencyStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - else - { - //excluding tax - - var orderSubTotalDiscountExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountExclTax, order.CurrencyRate); - string orderSubTotalDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderSubTotalDiscountExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderSubTotalDiscountInCustomerCurrencyStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - } - - //shipping - if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) - { - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var orderShippingInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingInclTax, order.CurrencyRate); - string orderShippingInclTaxStr = _priceFormatter.FormatShippingPrice(orderShippingInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Shipping", lang.Id), orderShippingInclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - else - { - //excluding tax - var orderShippingExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingExclTax, order.CurrencyRate); - string orderShippingExclTaxStr = _priceFormatter.FormatShippingPrice(orderShippingExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Shipping", lang.Id), orderShippingExclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - } - - //payment fee - if (order.PaymentMethodAdditionalFeeExclTax > decimal.Zero) - { - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var paymentMethodAdditionalFeeInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeInclTax, order.CurrencyRate); - string paymentMethodAdditionalFeeInclTaxStr = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.PaymentMethodAdditionalFee", lang.Id), paymentMethodAdditionalFeeInclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - else - { - //excluding tax - var paymentMethodAdditionalFeeExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeExclTax, order.CurrencyRate); - string paymentMethodAdditionalFeeExclTaxStr = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.PaymentMethodAdditionalFee", lang.Id), paymentMethodAdditionalFeeExclTaxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - } - - //tax - string taxStr = string.Empty; - var taxRates = new SortedDictionary(); - bool displayTax = true; - bool displayTaxRates = true; - if (_taxSettings.HideTaxInOrderSummary && order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - displayTax = false; - } - else - { - if (order.OrderTax == 0 && _taxSettings.HideZeroTax) - { - displayTax = false; - displayTaxRates = false; - } - else - { - taxRates = order.TaxRatesDictionary; - - displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); - displayTax = !displayTaxRates; - - var orderTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTax, order.CurrencyRate); - taxStr = _priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); - } - } - if (displayTax) - { - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Tax", lang.Id), taxStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - if (displayTaxRates) - { - foreach (var item in taxRates) - { - string taxRate = String.Format(_localizationService.GetResource("PDFInvoice.TaxRate", lang.Id), _priceFormatter.FormatTaxRate(item.Key)); - string taxValue = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value, order.CurrencyRate), true, order.CustomerCurrencyCode, false, lang); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", taxRate, taxValue), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - } - - //discount (applied to order total) - if (order.OrderDiscount > decimal.Zero) - { - var orderDiscountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderDiscount, order.CurrencyRate); - string orderDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderDiscountInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderDiscountInCustomerCurrencyStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - - //gift cards - foreach (var gcuh in order.GiftCardUsageHistory) - { - string gcTitle = string.Format(_localizationService.GetResource("PDFInvoice.GiftCardInfo", lang.Id), gcuh.GiftCard.GiftCardCouponCode); - string gcAmountStr = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(gcuh.UsedValue, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, lang); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", gcTitle, gcAmountStr), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - - //reward points - if (order.RedeemedRewardPointsEntry != null) - { - string rpTitle = string.Format(_localizationService.GetResource("PDFInvoice.RewardPoints", lang.Id), -order.RedeemedRewardPointsEntry.Points); - string rpAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(order.RedeemedRewardPointsEntry.UsedAmount, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, lang); - - var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", rpTitle, rpAmount), font)); - p.HorizontalAlignment = Element.ALIGN_RIGHT; - p.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(p); - } - - //order total - var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); - string orderTotalStr = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); - - - var pTotal = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.OrderTotal", lang.Id), orderTotalStr), titleFont)); - pTotal.HorizontalAlignment = Element.ALIGN_RIGHT; - pTotal.Border = Rectangle.NO_BORDER; - totalsTable.AddCell(pTotal); - - doc.Add(totalsTable); - } - - #endregion - - #region Order notes - - if (pdfSettingsByStore.RenderOrderNotes) - { - var orderNotes = order.OrderNotes - .Where(on => on.DisplayToCustomer) - .OrderByDescending(on => on.CreatedOnUtc) - .ToList(); - if (orderNotes.Any()) - { - var notesHeader = new PdfPTable(1); - notesHeader.RunDirection = GetDirection(lang); - notesHeader.WidthPercentage = 100f; - var cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes", lang.Id), titleFont)); - cellOrderNote.Border = Rectangle.NO_BORDER; - notesHeader.AddCell(cellOrderNote); - doc.Add(notesHeader); - doc.Add(new Paragraph(" ")); - - var notesTable = new PdfPTable(2); - notesTable.RunDirection = GetDirection(lang); - if (lang.Rtl) - { - notesTable.SetWidths(new[] {70, 30}); - } - else - { - notesTable.SetWidths(new[] {30, 70}); - } - notesTable.WidthPercentage = 100f; - - //created on - cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes.CreatedOn", lang.Id), font)); - cellOrderNote.BackgroundColor = BaseColor.LIGHT_GRAY; - cellOrderNote.HorizontalAlignment = Element.ALIGN_CENTER; - notesTable.AddCell(cellOrderNote); - - //note - cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes.Note", lang.Id), font)); - cellOrderNote.BackgroundColor = BaseColor.LIGHT_GRAY; - cellOrderNote.HorizontalAlignment = Element.ALIGN_CENTER; - notesTable.AddCell(cellOrderNote); - - foreach (var orderNote in orderNotes) - { - cellOrderNote = new PdfPCell(new Phrase(_dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc).ToString(), font)); - cellOrderNote.HorizontalAlignment = Element.ALIGN_LEFT; - notesTable.AddCell(cellOrderNote); - - cellOrderNote = new PdfPCell(new Phrase(HtmlHelper.ConvertHtmlToPlainText(orderNote.FormatOrderNoteText(), true, true), font)); - cellOrderNote.HorizontalAlignment = Element.ALIGN_LEFT; - notesTable.AddCell(cellOrderNote); - - //should we display a link to downloadable files here? - //I think, no. Onyway, PDFs are printable documents and links (files) are useful here - } - doc.Add(notesTable); - } - } - - #endregion - - #region Footer - - if (!String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn1) || !String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn2)) - { - var column1Lines = String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn1) ? - new List() : - pdfSettingsByStore.InvoiceFooterTextColumn1 - .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .ToList(); - var column2Lines = String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn2) ? - new List() : - pdfSettingsByStore.InvoiceFooterTextColumn2 - .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .ToList(); - if (column1Lines.Any() || column2Lines.Any()) - { - var totalLines = Math.Max(column1Lines.Count, column2Lines.Count); - const float margin = 43; - - //if you have really a lot of lines in the footer, then replace 9 with 10 or 11 - int footerHeight = totalLines * 9; - var directContent = pdfWriter.DirectContent; - directContent.MoveTo(pageSize.GetLeft(margin), pageSize.GetBottom(margin) + footerHeight); - directContent.LineTo(pageSize.GetRight(margin), pageSize.GetBottom(margin) + footerHeight); - directContent.Stroke(); - - - var footerTable = new PdfPTable(2); - footerTable.WidthPercentage = 100f; - footerTable.SetTotalWidth(new float[] { 250, 250 }); - footerTable.RunDirection = GetDirection(lang); - - //column 1 - if (column1Lines.Any()) - { - var column1 = new PdfPCell(new Phrase()); - column1.Border = Rectangle.NO_BORDER; - column1.HorizontalAlignment = Element.ALIGN_LEFT; - foreach (var footerLine in column1Lines) - { - column1.Phrase.Add(new Phrase(footerLine, font)); - column1.Phrase.Add(new Phrase(Environment.NewLine)); - } - footerTable.AddCell(column1); - } - else - { - var column = new PdfPCell(new Phrase(" ")); - column.Border = Rectangle.NO_BORDER; - footerTable.AddCell(column); - } - - //column 2 - if (column2Lines.Any()) - { - var column2 = new PdfPCell(new Phrase()); - column2.Border = Rectangle.NO_BORDER; - column2.HorizontalAlignment = Element.ALIGN_LEFT; - foreach (var footerLine in column2Lines) - { - column2.Phrase.Add(new Phrase(footerLine, font)); - column2.Phrase.Add(new Phrase(Environment.NewLine)); - } - footerTable.AddCell(column2); - } - else - { - var column = new PdfPCell(new Phrase(" ")); - column.Border = Rectangle.NO_BORDER; - footerTable.AddCell(column); - } - - footerTable.WriteSelectedRows(0, totalLines, pageSize.GetLeft(margin), pageSize.GetBottom(margin) + footerHeight, directContent); - } - } - - #endregion - - ordNum++; - if (ordNum < ordCount) - { - doc.NewPage(); - } - } - doc.Close(); - } - - /// - /// Print packaging slips to PDF - /// - /// Stream - /// Shipments - /// Language identifier; 0 to use a language used when placing an order - public virtual void PrintPackagingSlipsToPdf(Stream stream, IList shipments, int languageId = 0) - { - if (stream == null) - throw new ArgumentNullException("stream"); - - if (shipments == null) - throw new ArgumentNullException("shipments"); - - var pageSize = PageSize.A4; - - if (_pdfSettings.LetterPageSizeEnabled) - { - pageSize = PageSize.LETTER; - } - - var doc = new Document(pageSize); - PdfWriter.GetInstance(doc, stream); - doc.Open(); - - //fonts - var titleFont = GetFont(); - titleFont.SetStyle(Font.BOLD); - titleFont.Color = BaseColor.BLACK; - var font = GetFont(); - var attributesFont = GetFont(); - attributesFont.SetStyle(Font.ITALIC); - - int shipmentCount = shipments.Count; - int shipmentNum = 0; - - foreach (var shipment in shipments) - { - var order = shipment.Order; - - var lang = _languageService.GetLanguageById(languageId == 0 ? order.CustomerLanguageId : languageId); - if (lang == null || !lang.Published) - lang = _workContext.WorkingLanguage; - - var addressTable = new PdfPTable(1); - if (lang.Rtl) - addressTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; - addressTable.DefaultCell.Border = Rectangle.NO_BORDER; - addressTable.WidthPercentage = 100f; - - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Shipment", lang.Id), shipment.Id), titleFont)); - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Order", lang.Id), order.CustomOrderNumber), titleFont)); - - if (!order.PickUpInStore) - { - if (order.ShippingAddress == null) - throw new NopException(string.Format("Shipping is required, but address is not available. Order ID = {0}", order.Id)); - - if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.ShippingAddress.Company)) - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Company", lang.Id), - order.ShippingAddress.Company), font)); - - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Name", lang.Id), - order.ShippingAddress.FirstName + " " + order.ShippingAddress.LastName), font)); - if (_addressSettings.PhoneEnabled) - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Phone", lang.Id), - order.ShippingAddress.PhoneNumber), font)); - if (_addressSettings.StreetAddressEnabled) - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Address", lang.Id), - order.ShippingAddress.Address1), font)); - - if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.ShippingAddress.Address2)) - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Address2", lang.Id), - order.ShippingAddress.Address2), font)); - - if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) - addressTable.AddCell(new Paragraph(String.Format("{0}, {1} {2}", order.ShippingAddress.City, order.ShippingAddress.StateProvince != null - ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) - : "", order.ShippingAddress.ZipPostalCode), font)); - - if (_addressSettings.CountryEnabled && order.ShippingAddress.Country != null) - addressTable.AddCell(new Paragraph(order.ShippingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); - - //custom attributes - var customShippingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); - if (!String.IsNullOrEmpty(customShippingAddressAttributes)) - { - addressTable.AddCell(new Paragraph(HtmlHelper.ConvertHtmlToPlainText(customShippingAddressAttributes, true, true), font)); - } - } - else - if (order.PickupAddress != null) - { - addressTable.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.Pickup", lang.Id), titleFont)); - if (!string.IsNullOrEmpty(order.PickupAddress.Address1)) - addressTable.AddCell(new Paragraph(string.Format(" {0}", string.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.PickupAddress.Address1)), font)); - if (!string.IsNullOrEmpty(order.PickupAddress.City)) - addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.City), font)); - if (order.PickupAddress.Country != null) - addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.Country.GetLocalized(x => x.Name, lang.Id)), font)); - if (!string.IsNullOrEmpty(order.PickupAddress.ZipPostalCode)) - addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.ZipPostalCode), font)); - addressTable.AddCell(new Paragraph(" ")); - } - - addressTable.AddCell(new Paragraph(" ")); - - addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.ShippingMethod", lang.Id), order.ShippingMethod), font)); - addressTable.AddCell(new Paragraph(" ")); - doc.Add(addressTable); - - var productsTable = new PdfPTable(3); - productsTable.WidthPercentage = 100f; - if (lang.Rtl) - { - productsTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; - productsTable.SetWidths(new[] {20, 20, 60}); - } - else - { - productsTable.SetWidths(new[] {60, 20, 20}); - } - - //product name - var cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.ProductName", lang.Id),font)); - cell.BackgroundColor = BaseColor.LIGHT_GRAY; - cell.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cell); - - //SKU - cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.SKU", lang.Id), font)); - cell.BackgroundColor = BaseColor.LIGHT_GRAY; - cell.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cell); - - //qty - cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.QTY", lang.Id), font)); - cell.BackgroundColor = BaseColor.LIGHT_GRAY; - cell.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cell); - - foreach (var si in shipment.ShipmentItems) - { - var productAttribTable = new PdfPTable(1); - if (lang.Rtl) - productAttribTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; - productAttribTable.DefaultCell.Border = Rectangle.NO_BORDER; - - //product name - var orderItem = _orderService.GetOrderItemById(si.OrderItemId); - if (orderItem == null) - continue; - - var p = orderItem.Product; - string name = p.GetLocalized(x => x.Name, lang.Id); - productAttribTable.AddCell(new Paragraph(name, font)); - //attributes - if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) - { - var attributesParagraph = new Paragraph(HtmlHelper.ConvertHtmlToPlainText(orderItem.AttributeDescription, true, true), attributesFont); - productAttribTable.AddCell(attributesParagraph); - } - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; - var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - - var rentalInfoParagraph = new Paragraph(rentalInfo, attributesFont); - productAttribTable.AddCell(rentalInfoParagraph); - } - productsTable.AddCell(productAttribTable); - - //SKU - var sku = p.FormatSku(orderItem.AttributesXml, _productAttributeParser); - cell = new PdfPCell(new Phrase(sku ?? String.Empty, font)); - cell.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cell); - - //qty - cell = new PdfPCell(new Phrase(si.Quantity.ToString(), font)); - cell.HorizontalAlignment = Element.ALIGN_CENTER; - productsTable.AddCell(cell); - } - doc.Add(productsTable); - - shipmentNum++; - if (shipmentNum < shipmentCount) - { - doc.NewPage(); - } - } - - - doc.Close(); - } - - /// - /// Print products to PDF - /// - /// Stream - /// Products - public virtual void PrintProductsToPdf(Stream stream, IList products) - { - if (stream == null) - throw new ArgumentNullException("stream"); - - if (products == null) - throw new ArgumentNullException("products"); - - var lang = _workContext.WorkingLanguage; - - var pageSize = PageSize.A4; - - if (_pdfSettings.LetterPageSizeEnabled) - { - pageSize = PageSize.LETTER; - } - - var doc = new Document(pageSize); - PdfWriter.GetInstance(doc, stream); - doc.Open(); - - //fonts - var titleFont = GetFont(); - titleFont.SetStyle(Font.BOLD); - titleFont.Color = BaseColor.BLACK; - var font = GetFont(); - - int productNumber = 1; - int prodCount = products.Count; - - foreach (var product in products) - { - string productName = product.GetLocalized(x => x.Name, lang.Id); - string productDescription = product.GetLocalized(x => x.FullDescription, lang.Id); - - var productTable = new PdfPTable(1); - productTable.WidthPercentage = 100f; - productTable.DefaultCell.Border = Rectangle.NO_BORDER; - if (lang.Rtl) - { - productTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; - } - - productTable.AddCell(new Paragraph(String.Format("{0}. {1}", productNumber, productName), titleFont)); - productTable.AddCell(new Paragraph(" ")); - productTable.AddCell(new Paragraph(HtmlHelper.StripTags(HtmlHelper.ConvertHtmlToPlainText(productDescription, decode: true)), font)); - productTable.AddCell(new Paragraph(" ")); - - if (product.ProductType == ProductType.SimpleProduct) - { - //simple product - //render its properties such as price, weight, etc - var priceStr = string.Format("{0} {1}", product.Price.ToString("0.00"), _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode); - if (product.IsRental) - priceStr = _priceFormatter.FormatRentalProductPeriod(product, priceStr); - productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.Price", lang.Id), priceStr), font)); - productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.SKU", lang.Id), product.Sku), font)); - - if (product.IsShipEnabled && product.Weight > Decimal.Zero) - productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Weight", lang.Id), product.Weight.ToString("0.00"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).Name), font)); - - if (product.ManageInventoryMethod == ManageInventoryMethod.ManageStock) - productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.StockQuantity", lang.Id), product.GetTotalStockQuantity()), font)); - - productTable.AddCell(new Paragraph(" ")); - } - var pictures = _pictureService.GetPicturesByProductId(product.Id); - if (pictures.Any()) - { - var table = new PdfPTable(2); - table.WidthPercentage = 100f; - if (lang.Rtl) - { - table.RunDirection = PdfWriter.RUN_DIRECTION_RTL; - } - - foreach (var pic in pictures) - { - var picBinary = _pictureService.LoadPictureBinary(pic); - if (picBinary != null && picBinary.Length > 0) - { - var pictureLocalPath = _pictureService.GetThumbLocalPath(pic, 200, false); - var cell = new PdfPCell(Image.GetInstance(pictureLocalPath)); - cell.HorizontalAlignment = Element.ALIGN_LEFT; - cell.Border = Rectangle.NO_BORDER; - table.AddCell(cell); - } - } - - if (pictures.Count % 2 > 0) - { - var cell = new PdfPCell(new Phrase(" ")); - cell.Border = Rectangle.NO_BORDER; - table.AddCell(cell); - } - - productTable.AddCell(table); - productTable.AddCell(new Paragraph(" ")); - } - - - if (product.ProductType == ProductType.GroupedProduct) - { - //grouped product. render its associated products - int pvNum = 1; - foreach (var associatedProduct in _productService.GetAssociatedProducts(product.Id, showHidden: true)) - { - productTable.AddCell(new Paragraph(String.Format("{0}-{1}. {2}", productNumber, pvNum, associatedProduct.GetLocalized(x => x.Name, lang.Id)), font)); - productTable.AddCell(new Paragraph(" ")); - - //uncomment to render associated product description - //string apDescription = associatedProduct.GetLocalized(x => x.ShortDescription, lang.Id); - //if (!String.IsNullOrEmpty(apDescription)) - //{ - // productTable.AddCell(new Paragraph(HtmlHelper.StripTags(HtmlHelper.ConvertHtmlToPlainText(apDescription)), font)); - // productTable.AddCell(new Paragraph(" ")); - //} - - //uncomment to render associated product picture - //var apPicture = _pictureService.GetPicturesByProductId(associatedProduct.Id).FirstOrDefault(); - //if (apPicture != null) - //{ - // var picBinary = _pictureService.LoadPictureBinary(apPicture); - // if (picBinary != null && picBinary.Length > 0) - // { - // var pictureLocalPath = _pictureService.GetThumbLocalPath(apPicture, 200, false); - // productTable.AddCell(Image.GetInstance(pictureLocalPath)); - // } - //} - - productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Price", lang.Id), associatedProduct.Price.ToString("0.00"), _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode), font)); - productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.SKU", lang.Id), associatedProduct.Sku), font)); - - if (associatedProduct.IsShipEnabled && associatedProduct.Weight > Decimal.Zero) - productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Weight", lang.Id), associatedProduct.Weight.ToString("0.00"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).Name), font)); - - if (associatedProduct.ManageInventoryMethod == ManageInventoryMethod.ManageStock) - productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.StockQuantity", lang.Id), associatedProduct.GetTotalStockQuantity()), font)); - - productTable.AddCell(new Paragraph(" ")); - - pvNum++; - } - } - - doc.Add(productTable); - - productNumber++; - - if (productNumber <= prodCount) - { - doc.NewPage(); - } - } - - doc.Close(); - } - - #endregion - } +// RTL Support provided by Credo inc (www.credo.co.il || info@credo.co.il) + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using iTextSharp.text; +using iTextSharp.text.pdf; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Html; +using Nop.Services.Catalog; +using Nop.Services.Configuration; +using Nop.Services.Directory; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Stores; + +namespace Nop.Services.Common +{ + /// + /// PDF service + /// + public partial class PdfService : IPdfService + { + #region Fields + + private readonly ILocalizationService _localizationService; + private readonly ILanguageService _languageService; + private readonly IWorkContext _workContext; + private readonly IOrderService _orderService; + private readonly IPaymentService _paymentService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IPriceFormatter _priceFormatter; + private readonly ICurrencyService _currencyService; + private readonly IMeasureService _measureService; + private readonly IPictureService _pictureService; + private readonly IProductService _productService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IStoreService _storeService; + private readonly IStoreContext _storeContext; + private readonly ISettingService _settingContext; + private readonly IAddressAttributeFormatter _addressAttributeFormatter; + + private readonly CatalogSettings _catalogSettings; + private readonly CurrencySettings _currencySettings; + private readonly MeasureSettings _measureSettings; + private readonly PdfSettings _pdfSettings; + private readonly TaxSettings _taxSettings; + private readonly AddressSettings _addressSettings; + + #endregion + + #region Ctor + + public PdfService(ILocalizationService localizationService, + ILanguageService languageService, + IWorkContext workContext, + IOrderService orderService, + IPaymentService paymentService, + IDateTimeHelper dateTimeHelper, + IPriceFormatter priceFormatter, + ICurrencyService currencyService, + IMeasureService measureService, + IPictureService pictureService, + IProductService productService, + IProductAttributeParser productAttributeParser, + IStoreService storeService, + IStoreContext storeContext, + ISettingService settingContext, + IAddressAttributeFormatter addressAttributeFormatter, + CatalogSettings catalogSettings, + CurrencySettings currencySettings, + MeasureSettings measureSettings, + PdfSettings pdfSettings, + TaxSettings taxSettings, + AddressSettings addressSettings) + { + this._localizationService = localizationService; + this._languageService = languageService; + this._workContext = workContext; + this._orderService = orderService; + this._paymentService = paymentService; + this._dateTimeHelper = dateTimeHelper; + this._priceFormatter = priceFormatter; + this._currencyService = currencyService; + this._measureService = measureService; + this._pictureService = pictureService; + this._productService = productService; + this._productAttributeParser = productAttributeParser; + this._storeService = storeService; + this._storeContext = storeContext; + this._settingContext = settingContext; + this._addressAttributeFormatter = addressAttributeFormatter; + this._currencySettings = currencySettings; + this._catalogSettings = catalogSettings; + this._measureSettings = measureSettings; + this._pdfSettings = pdfSettings; + this._taxSettings = taxSettings; + this._addressSettings = addressSettings; + } + + #endregion + + #region Utilities + + /// + /// Get font + /// + /// Font + protected virtual Font GetFont() + { + //nopCommerce supports unicode characters + //nopCommerce uses Free Serif font by default (~/App_Data/Pdf/FreeSerif.ttf file) + //It was downloaded from http://savannah.gnu.org/projects/freefont + return GetFont(_pdfSettings.FontFileName); + } + /// + /// Get font + /// + /// Font file name + /// Font + protected virtual Font GetFont(string fontFileName) + { + if (fontFileName == null) + throw new ArgumentNullException("fontFileName"); + + string fontPath = Path.Combine(CommonHelper.MapPath("~/App_Data/Pdf/"), fontFileName); + var baseFont = BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); + var font = new Font(baseFont, 10, Font.NORMAL); + return font; + } + + /// + /// Get font direction + /// + /// Language + /// Font direction + protected virtual int GetDirection(Language lang) + { + return lang.Rtl ? PdfWriter.RUN_DIRECTION_RTL : PdfWriter.RUN_DIRECTION_LTR; + } + + /// + /// Get element alignment + /// + /// Language + /// Is opposite? + /// Element alignment + protected virtual int GetAlignment(Language lang, bool isOpposite = false) + { + //if we need the element to be opposite, like logo etc`. + if (!isOpposite) + return lang.Rtl ? Element.ALIGN_RIGHT : Element.ALIGN_LEFT; + + return lang.Rtl ? Element.ALIGN_LEFT : Element.ALIGN_RIGHT; + } + + #endregion + + #region Methods + + /// + /// Print an order to PDF + /// + /// Order + /// Language identifier; 0 to use a language used when placing an order + /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed + /// A path of generated file + public virtual string PrintOrderToPdf(Order order, int languageId = 0, int vendorId = 0) + { + if (order == null) + throw new ArgumentNullException("order"); + + string fileName = string.Format("order_{0}_{1}.pdf", order.OrderGuid, CommonHelper.GenerateRandomDigitCode(4)); + string filePath = Path.Combine(CommonHelper.MapPath("~/content/files/ExportImport"), fileName); + using (var fileStream = new FileStream(filePath, FileMode.Create)) + { + var orders = new List(); + orders.Add(order); + PrintOrdersToPdf(fileStream, orders, languageId, vendorId); + } + return filePath; + } + + /// + /// Print orders to PDF + /// + /// Stream + /// Orders + /// Language identifier; 0 to use a language used when placing an order + /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed + public virtual void PrintOrdersToPdf(Stream stream, IList orders, int languageId = 0, int vendorId = 0) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + if (orders == null) + throw new ArgumentNullException("orders"); + + var pageSize = PageSize.A4; + + if (_pdfSettings.LetterPageSizeEnabled) + { + pageSize = PageSize.LETTER; + } + + + var doc = new Document(pageSize); + var pdfWriter = PdfWriter.GetInstance(doc, stream); + doc.Open(); + + //fonts + var titleFont = GetFont(); + titleFont.SetStyle(Font.BOLD); + titleFont.Color = BaseColor.BLACK; + var font = GetFont(); + var attributesFont = GetFont(); + attributesFont.SetStyle(Font.ITALIC); + + int ordCount = orders.Count; + int ordNum = 0; + + foreach (var order in orders) + { + //by default _pdfSettings contains settings for the current active store + //and we need PdfSettings for the store which was used to place an order + //so let's load it based on a store of the current order + var pdfSettingsByStore = _settingContext.LoadSetting(order.StoreId); + + + var lang = _languageService.GetLanguageById(languageId == 0 ? order.CustomerLanguageId : languageId); + if (lang == null || !lang.Published) + lang = _workContext.WorkingLanguage; + + #region Header + + //logo + var logoPicture = _pictureService.GetPictureById(pdfSettingsByStore.LogoPictureId); + var logoExists = logoPicture != null; + + //header + var headerTable = new PdfPTable(logoExists ? 2 : 1); + headerTable.RunDirection = GetDirection(lang); + headerTable.DefaultCell.Border = Rectangle.NO_BORDER; + + //store info + var store = _storeService.GetStoreById(order.StoreId) ?? _storeContext.CurrentStore; + var anchor = new Anchor(store.Url.Trim(new [] { '/' }), font); + anchor.Reference = store.Url; + + var cellHeader = new PdfPCell(new Phrase(String.Format(_localizationService.GetResource("PDFInvoice.Order#", lang.Id), order.CustomOrderNumber), titleFont)); + cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); + cellHeader.Phrase.Add(new Phrase(anchor)); + cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); + cellHeader.Phrase.Add(new Phrase(String.Format(_localizationService.GetResource("PDFInvoice.OrderDate", lang.Id), _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc).ToString("D", new CultureInfo(lang.LanguageCulture))), font)); + cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); + cellHeader.Phrase.Add(new Phrase(Environment.NewLine)); + cellHeader.HorizontalAlignment = Element.ALIGN_LEFT; + cellHeader.Border = Rectangle.NO_BORDER; + + headerTable.AddCell(cellHeader); + + if (logoExists) + if (lang.Rtl) + headerTable.SetWidths(new[] { 0.2f, 0.8f }); + else + headerTable.SetWidths(new[] { 0.8f, 0.2f }); + headerTable.WidthPercentage = 100f; + + //logo + if (logoExists) + { + var logoFilePath = _pictureService.GetThumbLocalPath(logoPicture, 0, false); + var logo = Image.GetInstance(logoFilePath); + logo.Alignment = GetAlignment(lang, true); + logo.ScaleToFit(65f, 65f); + + var cellLogo = new PdfPCell(); + cellLogo.Border = Rectangle.NO_BORDER; + cellLogo.AddElement(logo); + headerTable.AddCell(cellLogo); + } + doc.Add(headerTable); + + #endregion + + #region Addresses + + var addressTable = new PdfPTable(2); + addressTable.RunDirection = GetDirection(lang); + addressTable.DefaultCell.Border = Rectangle.NO_BORDER; + addressTable.WidthPercentage = 100f; + addressTable.SetWidths(new[] { 50, 50 }); + + //billing info + var billingAddress = new PdfPTable(1); + billingAddress.DefaultCell.Border = Rectangle.NO_BORDER; + billingAddress.RunDirection = GetDirection(lang); + + billingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.BillingInformation", lang.Id), titleFont)); + + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.BillingAddress.Company)) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Company", lang.Id), order.BillingAddress.Company), font)); + + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Name", lang.Id), order.BillingAddress.FirstName + " " + order.BillingAddress.LastName), font)); + if (_addressSettings.PhoneEnabled) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.BillingAddress.PhoneNumber), font)); + if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.BillingAddress.FaxNumber)) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Fax", lang.Id), order.BillingAddress.FaxNumber), font)); + if (_addressSettings.StreetAddressEnabled) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.BillingAddress.Address1), font)); + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.BillingAddress.Address2)) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address2", lang.Id), order.BillingAddress.Address2), font)); + if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) + billingAddress.AddCell(new Paragraph(" " + String.Format("{0}, {1} {2}", order.BillingAddress.City, order.BillingAddress.StateProvince != null ? order.BillingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.BillingAddress.ZipPostalCode), font)); + if (_addressSettings.CountryEnabled && order.BillingAddress.Country != null) + billingAddress.AddCell(new Paragraph(" " + order.BillingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); + + //VAT number + if (!String.IsNullOrEmpty(order.VatNumber)) + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.VATNumber", lang.Id), order.VatNumber), font)); + + //custom attributes + var customBillingAddressAttributes = _addressAttributeFormatter.FormatAttributes( order.BillingAddress.CustomAttributes); + if (!String.IsNullOrEmpty(customBillingAddressAttributes)) + { + //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) + billingAddress.AddCell(new Paragraph(" " + HtmlHelper.ConvertHtmlToPlainText(customBillingAddressAttributes, true, true), font)); + } + + + + //vendors payment details + if (vendorId == 0) + { + //payment method + var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); + string paymentMethodStr = paymentMethod != null ? paymentMethod.GetLocalizedFriendlyName(_localizationService, lang.Id) : order.PaymentMethodSystemName; + if (!String.IsNullOrEmpty(paymentMethodStr)) + { + billingAddress.AddCell(new Paragraph(" ")); + billingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.PaymentMethod", lang.Id), paymentMethodStr), font)); + billingAddress.AddCell(new Paragraph()); + } + + //custom values + var customValues = order.DeserializeCustomValues(); + if (customValues != null) + { + foreach (var item in customValues) + { + billingAddress.AddCell(new Paragraph(" ")); + billingAddress.AddCell(new Paragraph(" " + item.Key + ": " + item.Value, font)); + billingAddress.AddCell(new Paragraph()); + } + } + } + addressTable.AddCell(billingAddress); + + //shipping info + var shippingAddress = new PdfPTable(1); + shippingAddress.DefaultCell.Border = Rectangle.NO_BORDER; + shippingAddress.RunDirection = GetDirection(lang); + + if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) + { + //cell = new PdfPCell(); + //cell.Border = Rectangle.NO_BORDER; + + if (!order.PickUpInStore) + { + if (order.ShippingAddress == null) + throw new NopException(string.Format("Shipping is required, but address is not available. Order ID = {0}", order.Id)); + + shippingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.ShippingInformation", lang.Id), titleFont)); + if (!String.IsNullOrEmpty(order.ShippingAddress.Company)) + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Company", lang.Id), order.ShippingAddress.Company), font)); + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Name", lang.Id), order.ShippingAddress.FirstName + " " + order.ShippingAddress.LastName), font)); + if (_addressSettings.PhoneEnabled) + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.ShippingAddress.PhoneNumber), font)); + if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.ShippingAddress.FaxNumber)) + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Fax", lang.Id), order.ShippingAddress.FaxNumber), font)); + if (_addressSettings.StreetAddressEnabled) + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.ShippingAddress.Address1), font)); + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.ShippingAddress.Address2)) + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.Address2", lang.Id), order.ShippingAddress.Address2), font)); + if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) + shippingAddress.AddCell(new Paragraph(" " + String.Format("{0}, {1} {2}", order.ShippingAddress.City, order.ShippingAddress.StateProvince != null ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.ShippingAddress.ZipPostalCode), font)); + if (_addressSettings.CountryEnabled && order.ShippingAddress.Country != null) + shippingAddress.AddCell(new Paragraph(" " + order.ShippingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); + //custom attributes + var customShippingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); + if (!String.IsNullOrEmpty(customShippingAddressAttributes)) + { + //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) + shippingAddress.AddCell(new Paragraph(" " + HtmlHelper.ConvertHtmlToPlainText(customShippingAddressAttributes, true, true), font)); + } + shippingAddress.AddCell(new Paragraph(" ")); + } + else + if (order.PickupAddress != null) + { + shippingAddress.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.Pickup", lang.Id), titleFont)); + if (!string.IsNullOrEmpty(order.PickupAddress.Address1)) + shippingAddress.AddCell(new Paragraph(string.Format(" {0}", string.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.PickupAddress.Address1)), font)); + if (!string.IsNullOrEmpty(order.PickupAddress.City)) + shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.City), font)); + if (order.PickupAddress.Country != null) + shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.Country.GetLocalized(x => x.Name, lang.Id)), font)); + if (!string.IsNullOrEmpty(order.PickupAddress.ZipPostalCode)) + shippingAddress.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.ZipPostalCode), font)); + shippingAddress.AddCell(new Paragraph(" ")); + } + shippingAddress.AddCell(new Paragraph(" " + String.Format(_localizationService.GetResource("PDFInvoice.ShippingMethod", lang.Id), order.ShippingMethod), font)); + shippingAddress.AddCell(new Paragraph()); + + addressTable.AddCell(shippingAddress); + } + else + { + shippingAddress.AddCell(new Paragraph()); + addressTable.AddCell(shippingAddress); + } + + doc.Add(addressTable); + doc.Add(new Paragraph(" ")); + + #endregion + + #region Products + + //products + var productsHeader = new PdfPTable(1); + productsHeader.RunDirection = GetDirection(lang); + productsHeader.WidthPercentage = 100f; + var cellProducts = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.Product(s)", lang.Id), titleFont)); + cellProducts.Border = Rectangle.NO_BORDER; + productsHeader.AddCell(cellProducts); + doc.Add(productsHeader); + doc.Add(new Paragraph(" ")); + + + var orderItems = order.OrderItems; + + var productsTable = new PdfPTable(_catalogSettings.ShowSkuOnProductDetailsPage ? 5 : 4); + productsTable.RunDirection = GetDirection(lang); + productsTable.WidthPercentage = 100f; + if (lang.Rtl) + { + productsTable.SetWidths(_catalogSettings.ShowSkuOnProductDetailsPage + ? new[] {15, 10, 15, 15, 45} + : new[] {20, 10, 20, 50}); + } + else + { + productsTable.SetWidths(_catalogSettings.ShowSkuOnProductDetailsPage + ? new[] {45, 15, 15, 10, 15} + : new[] {50, 20, 10, 20}); + } + + //product name + var cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductName", lang.Id), font)); + cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + + //SKU + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.SKU", lang.Id), font)); + cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + } + + //price + cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductPrice", lang.Id), font)); + cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + + //qty + cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductQuantity", lang.Id), font)); + cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + + //total + cellProductItem = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.ProductTotal", lang.Id), font)); + cellProductItem.BackgroundColor = BaseColor.LIGHT_GRAY; + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + + foreach (var orderItem in orderItems) + { + var p = orderItem.Product; + + //a vendor should have access only to his products + if (vendorId > 0 && p.VendorId != vendorId) + continue; + + var pAttribTable = new PdfPTable(1); + pAttribTable.RunDirection = GetDirection(lang); + pAttribTable.DefaultCell.Border = Rectangle.NO_BORDER; + + //product name + string name = p.GetLocalized(x => x.Name, lang.Id); + pAttribTable.AddCell(new Paragraph(name, font)); + cellProductItem.AddElement(new Paragraph(name, font)); + //attributes + if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) + { + var attributesParagraph = new Paragraph(HtmlHelper.ConvertHtmlToPlainText(orderItem.AttributeDescription, true, true), attributesFont); + pAttribTable.AddCell(attributesParagraph); + } + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + + var rentalInfoParagraph = new Paragraph(rentalInfo, attributesFont); + pAttribTable.AddCell(rentalInfoParagraph); + } + productsTable.AddCell(pAttribTable); + + //SKU + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + var sku = p.FormatSku(orderItem.AttributesXml, _productAttributeParser); + cellProductItem = new PdfPCell(new Phrase(sku ?? String.Empty, font)); + cellProductItem.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cellProductItem); + } + + //price + string unitPrice; + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) + { + //including tax + var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate); + unitPrice = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + } + else + { + //excluding tax + var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate); + unitPrice = _priceFormatter.FormatPrice(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + } + cellProductItem = new PdfPCell(new Phrase(unitPrice, font)); + cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; + productsTable.AddCell(cellProductItem); + + //qty + cellProductItem = new PdfPCell(new Phrase(orderItem.Quantity.ToString(), font)); + cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; + productsTable.AddCell(cellProductItem); + + //total + string subTotal; + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) + { + //including tax + var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); + subTotal = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + } + else + { + //excluding tax + var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate); + subTotal = _priceFormatter.FormatPrice(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + } + cellProductItem = new PdfPCell(new Phrase(subTotal, font)); + cellProductItem.HorizontalAlignment = Element.ALIGN_LEFT; + productsTable.AddCell(cellProductItem); + } + doc.Add(productsTable); + + #endregion + + #region Checkout attributes + + //vendors cannot see checkout attributes + if (vendorId == 0 && !String.IsNullOrEmpty(order.CheckoutAttributeDescription)) + { + doc.Add(new Paragraph(" ")); + var attribTable = new PdfPTable(1); + attribTable.RunDirection = GetDirection(lang); + attribTable.WidthPercentage = 100f; + + string attributes = HtmlHelper.ConvertHtmlToPlainText(order.CheckoutAttributeDescription, true, true); + var cCheckoutAttributes = new PdfPCell(new Phrase(attributes, font)); + cCheckoutAttributes.Border = Rectangle.NO_BORDER; + cCheckoutAttributes.HorizontalAlignment = Element.ALIGN_RIGHT; + attribTable.AddCell(cCheckoutAttributes); + doc.Add(attribTable); + } + + #endregion + + #region Totals + + //vendors cannot see totals + if (vendorId == 0) + { + //subtotal + var totalsTable = new PdfPTable(1); + totalsTable.RunDirection = GetDirection(lang); + totalsTable.DefaultCell.Border = Rectangle.NO_BORDER; + totalsTable.WidthPercentage = 100f; + + //order subtotal + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) + { + //including tax + + var orderSubtotalInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalInclTax, order.CurrencyRate); + string orderSubtotalInclTaxStr = _priceFormatter.FormatPrice(orderSubtotalInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Sub-Total", lang.Id), orderSubtotalInclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + else + { + //excluding tax + + var orderSubtotalExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalExclTax, order.CurrencyRate); + string orderSubtotalExclTaxStr = _priceFormatter.FormatPrice(orderSubtotalExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Sub-Total", lang.Id), orderSubtotalExclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //discount (applied to order subtotal) + if (order.OrderSubTotalDiscountExclTax > decimal.Zero) + { + //order subtotal + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) + { + //including tax + + var orderSubTotalDiscountInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountInclTax, order.CurrencyRate); + string orderSubTotalDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderSubTotalDiscountInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderSubTotalDiscountInCustomerCurrencyStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + else + { + //excluding tax + + var orderSubTotalDiscountExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountExclTax, order.CurrencyRate); + string orderSubTotalDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderSubTotalDiscountExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderSubTotalDiscountInCustomerCurrencyStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + } + + //shipping + if (order.ShippingStatus != ShippingStatus.ShippingNotRequired && order.OrderShippingInclTax != decimal.Zero) + { + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) + { + //including tax + var orderShippingInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingInclTax, order.CurrencyRate); + string orderShippingInclTaxStr = _priceFormatter.FormatShippingPrice(orderShippingInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Shipping", lang.Id), orderShippingInclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + else + { + //excluding tax + var orderShippingExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingExclTax, order.CurrencyRate); + string orderShippingExclTaxStr = _priceFormatter.FormatShippingPrice(orderShippingExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Shipping", lang.Id), orderShippingExclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + } + + //reward points applied to order amount + if (order.RedeemedRewardPointsEntry != null && order.RedeemedRewardPointsEntry.UsedAmount != decimal.Zero) + { + string rpTitle = string.Format(_localizationService.GetResource("PDFInvoice.RewardPoints", lang.Id), -order.RedeemedRewardPointsEntry.Points); + string rpAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(order.RedeemedRewardPointsEntry.UsedAmount, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, lang); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", rpTitle, rpAmount), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + //payment fee + if (order.PaymentMethodAdditionalFeeExclTax != decimal.Zero) //alow negative + { + if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) + { + //including tax + var paymentMethodAdditionalFeeInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeInclTax, order.CurrencyRate); + string paymentMethodAdditionalFeeInclTaxStr = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.PaymentMethodAdditionalFee", lang.Id), paymentMethodAdditionalFeeInclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + else + { + //excluding tax + var paymentMethodAdditionalFeeExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeExclTax, order.CurrencyRate); + string paymentMethodAdditionalFeeExclTaxStr = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, lang, false); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.PaymentMethodAdditionalFee", lang.Id), paymentMethodAdditionalFeeExclTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + } + + //discount (applied to order total) + if (order.OrderDiscount > decimal.Zero) + { + var orderDiscountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderDiscount, order.CurrencyRate); + string orderDiscountInCustomerCurrencyStr = _priceFormatter.FormatPrice(-orderDiscountInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Discount", lang.Id), orderDiscountInCustomerCurrencyStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //tax + string taxStr = string.Empty; + var taxRates = new SortedDictionary(); + bool displayTax = true; + bool displayTaxRates = true; + if (_taxSettings.HideTaxInOrderSummary && order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) + { + displayTax = false; + } + else + { + if (order.OrderTax == 0 && _taxSettings.HideZeroTax) + { + displayTax = false; + displayTaxRates = false; + } + else + { + taxRates = order.TaxRatesDictionary; + + displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); + displayTax = !displayTaxRates; + + var orderTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTax, order.CurrencyRate); + taxStr = _priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); + } + } + if (displayTax) + { + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Tax", lang.Id), taxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + if (displayTaxRates) + { + foreach (var item in taxRates) + { + string taxRate = String.Format(_localizationService.GetResource("PDFInvoice.TaxRate", lang.Id), _priceFormatter.FormatTaxRate(item.Key)); + string taxValue = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.TaxAmount, order.CurrencyRate), true, order.CustomerCurrencyCode, false, lang); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", taxRate, taxValue), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + } + + //shipping non taxable + if (order.ShippingStatus != ShippingStatus.ShippingNotRequired && order.OrderShippingNonTaxable != decimal.Zero) + { + var orderShippingNonTaxableInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingNonTaxable, order.CurrencyRate); + string orderShippingNonTaxableTaxStr = _priceFormatter.FormatShippingPrice(orderShippingNonTaxableInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.Shipping", lang.Id), orderShippingNonTaxableTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //payment fee non taxable + if (order.PaymentMethodAdditionalFeeNonTaxable != decimal.Zero) //alow negative + { + var paymentMethodAdditionalFeeNonTaxableInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeNonTaxable, order.CurrencyRate); + string paymentMethodAdditionalFeeNonTaxStr = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeNonTaxableInCustomerCurrency, true, order.CustomerCurrencyCode, lang, true); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.PaymentMethodAdditionalFee", lang.Id), paymentMethodAdditionalFeeNonTaxStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //gift cards + foreach (var gcuh in order.GiftCardUsageHistory) + { + string gcTitle = string.Format(_localizationService.GetResource("PDFInvoice.GiftCardInfo", lang.Id), gcuh.GiftCard.GiftCardCouponCode); + string gcAmountStr = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(gcuh.UsedValue, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, lang); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", gcTitle, gcAmountStr), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //reward points + if (order.RedeemedRewardPointsEntry != null && order.RedeemedRewardPointsEntry.UsedAmountPurchased != decimal.Zero) + { + string rpTitle = string.Format(_localizationService.GetResource("PDFInvoice.RewardPointsPurchased", lang.Id), -order.RedeemedRewardPointsEntry.PointsPurchased); + string rpAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(order.RedeemedRewardPointsEntry.UsedAmountPurchased, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, lang); + + var p = new PdfPCell(new Paragraph(String.Format("{0} {1}", rpTitle, rpAmount), font)); + p.HorizontalAlignment = Element.ALIGN_RIGHT; + p.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(p); + } + + //order total + var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); + string orderTotalStr = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, lang); + + + var pTotal = new PdfPCell(new Paragraph(String.Format("{0} {1}", _localizationService.GetResource("PDFInvoice.OrderTotal", lang.Id), orderTotalStr), titleFont)); + pTotal.HorizontalAlignment = Element.ALIGN_RIGHT; + pTotal.Border = Rectangle.NO_BORDER; + totalsTable.AddCell(pTotal); + + doc.Add(totalsTable); + } + + #endregion + + #region Order notes + + if (pdfSettingsByStore.RenderOrderNotes) + { + var orderNotes = order.OrderNotes + .Where(on => on.DisplayToCustomer) + .OrderByDescending(on => on.CreatedOnUtc) + .ToList(); + if (orderNotes.Any()) + { + var notesHeader = new PdfPTable(1); + notesHeader.RunDirection = GetDirection(lang); + notesHeader.WidthPercentage = 100f; + var cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes", lang.Id), titleFont)); + cellOrderNote.Border = Rectangle.NO_BORDER; + notesHeader.AddCell(cellOrderNote); + doc.Add(notesHeader); + doc.Add(new Paragraph(" ")); + + var notesTable = new PdfPTable(2); + notesTable.RunDirection = GetDirection(lang); + if (lang.Rtl) + { + notesTable.SetWidths(new[] {70, 30}); + } + else + { + notesTable.SetWidths(new[] {30, 70}); + } + notesTable.WidthPercentage = 100f; + + //created on + cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes.CreatedOn", lang.Id), font)); + cellOrderNote.BackgroundColor = BaseColor.LIGHT_GRAY; + cellOrderNote.HorizontalAlignment = Element.ALIGN_CENTER; + notesTable.AddCell(cellOrderNote); + + //note + cellOrderNote = new PdfPCell(new Phrase(_localizationService.GetResource("PDFInvoice.OrderNotes.Note", lang.Id), font)); + cellOrderNote.BackgroundColor = BaseColor.LIGHT_GRAY; + cellOrderNote.HorizontalAlignment = Element.ALIGN_CENTER; + notesTable.AddCell(cellOrderNote); + + foreach (var orderNote in orderNotes) + { + cellOrderNote = new PdfPCell(new Phrase(_dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc).ToString(), font)); + cellOrderNote.HorizontalAlignment = Element.ALIGN_LEFT; + notesTable.AddCell(cellOrderNote); + + cellOrderNote = new PdfPCell(new Phrase(HtmlHelper.ConvertHtmlToPlainText(orderNote.FormatOrderNoteText(), true, true), font)); + cellOrderNote.HorizontalAlignment = Element.ALIGN_LEFT; + notesTable.AddCell(cellOrderNote); + + //should we display a link to downloadable files here? + //I think, no. Onyway, PDFs are printable documents and links (files) are useful here + } + doc.Add(notesTable); + } + } + + #endregion + + #region Footer + + if (!String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn1) || !String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn2)) + { + var column1Lines = String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn1) ? + new List() : + pdfSettingsByStore.InvoiceFooterTextColumn1 + .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) + .ToList(); + var column2Lines = String.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn2) ? + new List() : + pdfSettingsByStore.InvoiceFooterTextColumn2 + .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) + .ToList(); + if (column1Lines.Any() || column2Lines.Any()) + { + var totalLines = Math.Max(column1Lines.Count, column2Lines.Count); + const float margin = 43; + + //if you have really a lot of lines in the footer, then replace 9 with 10 or 11 + int footerHeight = totalLines * 9; + var directContent = pdfWriter.DirectContent; + directContent.MoveTo(pageSize.GetLeft(margin), pageSize.GetBottom(margin) + footerHeight); + directContent.LineTo(pageSize.GetRight(margin), pageSize.GetBottom(margin) + footerHeight); + directContent.Stroke(); + + + var footerTable = new PdfPTable(2); + footerTable.WidthPercentage = 100f; + footerTable.SetTotalWidth(new float[] { 250, 250 }); + footerTable.RunDirection = GetDirection(lang); + + //column 1 + if (column1Lines.Any()) + { + var column1 = new PdfPCell(new Phrase()); + column1.Border = Rectangle.NO_BORDER; + column1.HorizontalAlignment = Element.ALIGN_LEFT; + foreach (var footerLine in column1Lines) + { + column1.Phrase.Add(new Phrase(footerLine, font)); + column1.Phrase.Add(new Phrase(Environment.NewLine)); + } + footerTable.AddCell(column1); + } + else + { + var column = new PdfPCell(new Phrase(" ")); + column.Border = Rectangle.NO_BORDER; + footerTable.AddCell(column); + } + + //column 2 + if (column2Lines.Any()) + { + var column2 = new PdfPCell(new Phrase()); + column2.Border = Rectangle.NO_BORDER; + column2.HorizontalAlignment = Element.ALIGN_LEFT; + foreach (var footerLine in column2Lines) + { + column2.Phrase.Add(new Phrase(footerLine, font)); + column2.Phrase.Add(new Phrase(Environment.NewLine)); + } + footerTable.AddCell(column2); + } + else + { + var column = new PdfPCell(new Phrase(" ")); + column.Border = Rectangle.NO_BORDER; + footerTable.AddCell(column); + } + + footerTable.WriteSelectedRows(0, totalLines, pageSize.GetLeft(margin), pageSize.GetBottom(margin) + footerHeight, directContent); + } + } + + #endregion + + ordNum++; + if (ordNum < ordCount) + { + doc.NewPage(); + } + } + doc.Close(); + } + + /// + /// Print packaging slips to PDF + /// + /// Stream + /// Shipments + /// Language identifier; 0 to use a language used when placing an order + public virtual void PrintPackagingSlipsToPdf(Stream stream, IList shipments, int languageId = 0) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + if (shipments == null) + throw new ArgumentNullException("shipments"); + + var pageSize = PageSize.A4; + + if (_pdfSettings.LetterPageSizeEnabled) + { + pageSize = PageSize.LETTER; + } + + var doc = new Document(pageSize); + PdfWriter.GetInstance(doc, stream); + doc.Open(); + + //fonts + var titleFont = GetFont(); + titleFont.SetStyle(Font.BOLD); + titleFont.Color = BaseColor.BLACK; + var font = GetFont(); + var attributesFont = GetFont(); + attributesFont.SetStyle(Font.ITALIC); + + int shipmentCount = shipments.Count; + int shipmentNum = 0; + + foreach (var shipment in shipments) + { + var order = shipment.Order; + + var lang = _languageService.GetLanguageById(languageId == 0 ? order.CustomerLanguageId : languageId); + if (lang == null || !lang.Published) + lang = _workContext.WorkingLanguage; + + var addressTable = new PdfPTable(1); + if (lang.Rtl) + addressTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; + addressTable.DefaultCell.Border = Rectangle.NO_BORDER; + addressTable.WidthPercentage = 100f; + + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Shipment", lang.Id), shipment.Id), titleFont)); + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Order", lang.Id), order.CustomOrderNumber), titleFont)); + + if (!order.PickUpInStore) + { + if (order.ShippingAddress == null) + throw new NopException(string.Format("Shipping is required, but address is not available. Order ID = {0}", order.Id)); + + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.ShippingAddress.Company)) + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Company", lang.Id), + order.ShippingAddress.Company), font)); + + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Name", lang.Id), + order.ShippingAddress.FirstName + " " + order.ShippingAddress.LastName), font)); + if (_addressSettings.PhoneEnabled) + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Phone", lang.Id), + order.ShippingAddress.PhoneNumber), font)); + if (_addressSettings.StreetAddressEnabled) + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Address", lang.Id), + order.ShippingAddress.Address1), font)); + + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.ShippingAddress.Address2)) + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.Address2", lang.Id), + order.ShippingAddress.Address2), font)); + + if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) + addressTable.AddCell(new Paragraph(String.Format("{0}, {1} {2}", order.ShippingAddress.City, order.ShippingAddress.StateProvince != null + ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) + : "", order.ShippingAddress.ZipPostalCode), font)); + + if (_addressSettings.CountryEnabled && order.ShippingAddress.Country != null) + addressTable.AddCell(new Paragraph(order.ShippingAddress.Country.GetLocalized(x => x.Name, lang.Id), font)); + + //custom attributes + var customShippingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); + if (!String.IsNullOrEmpty(customShippingAddressAttributes)) + { + addressTable.AddCell(new Paragraph(HtmlHelper.ConvertHtmlToPlainText(customShippingAddressAttributes, true, true), font)); + } + } + else + if (order.PickupAddress != null) + { + addressTable.AddCell(new Paragraph(_localizationService.GetResource("PDFInvoice.Pickup", lang.Id), titleFont)); + if (!string.IsNullOrEmpty(order.PickupAddress.Address1)) + addressTable.AddCell(new Paragraph(string.Format(" {0}", string.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.PickupAddress.Address1)), font)); + if (!string.IsNullOrEmpty(order.PickupAddress.City)) + addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.City), font)); + if (order.PickupAddress.Country != null) + addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.Country.GetLocalized(x => x.Name, lang.Id)), font)); + if (!string.IsNullOrEmpty(order.PickupAddress.ZipPostalCode)) + addressTable.AddCell(new Paragraph(string.Format(" {0}", order.PickupAddress.ZipPostalCode), font)); + addressTable.AddCell(new Paragraph(" ")); + } + + addressTable.AddCell(new Paragraph(" ")); + + addressTable.AddCell(new Paragraph(String.Format(_localizationService.GetResource("PDFPackagingSlip.ShippingMethod", lang.Id), order.ShippingMethod), font)); + addressTable.AddCell(new Paragraph(" ")); + doc.Add(addressTable); + + var productsTable = new PdfPTable(3); + productsTable.WidthPercentage = 100f; + if (lang.Rtl) + { + productsTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; + productsTable.SetWidths(new[] {20, 20, 60}); + } + else + { + productsTable.SetWidths(new[] {60, 20, 20}); + } + + //product name + var cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.ProductName", lang.Id),font)); + cell.BackgroundColor = BaseColor.LIGHT_GRAY; + cell.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cell); + + //SKU + cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.SKU", lang.Id), font)); + cell.BackgroundColor = BaseColor.LIGHT_GRAY; + cell.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cell); + + //qty + cell = new PdfPCell(new Phrase(_localizationService.GetResource("PDFPackagingSlip.QTY", lang.Id), font)); + cell.BackgroundColor = BaseColor.LIGHT_GRAY; + cell.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cell); + + foreach (var si in shipment.ShipmentItems) + { + var productAttribTable = new PdfPTable(1); + if (lang.Rtl) + productAttribTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; + productAttribTable.DefaultCell.Border = Rectangle.NO_BORDER; + + //product name + var orderItem = _orderService.GetOrderItemById(si.OrderItemId); + if (orderItem == null) + continue; + + var p = orderItem.Product; + string name = p.GetLocalized(x => x.Name, lang.Id); + productAttribTable.AddCell(new Paragraph(name, font)); + //attributes + if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) + { + var attributesParagraph = new Paragraph(HtmlHelper.ConvertHtmlToPlainText(orderItem.AttributeDescription, true, true), attributesFont); + productAttribTable.AddCell(attributesParagraph); + } + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + + var rentalInfoParagraph = new Paragraph(rentalInfo, attributesFont); + productAttribTable.AddCell(rentalInfoParagraph); + } + productsTable.AddCell(productAttribTable); + + //SKU + var sku = p.FormatSku(orderItem.AttributesXml, _productAttributeParser); + cell = new PdfPCell(new Phrase(sku ?? String.Empty, font)); + cell.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cell); + + //qty + cell = new PdfPCell(new Phrase(si.Quantity.ToString(), font)); + cell.HorizontalAlignment = Element.ALIGN_CENTER; + productsTable.AddCell(cell); + } + doc.Add(productsTable); + + shipmentNum++; + if (shipmentNum < shipmentCount) + { + doc.NewPage(); + } + } + + + doc.Close(); + } + + /// + /// Print products to PDF + /// + /// Stream + /// Products + public virtual void PrintProductsToPdf(Stream stream, IList products) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + if (products == null) + throw new ArgumentNullException("products"); + + var lang = _workContext.WorkingLanguage; + + var pageSize = PageSize.A4; + + if (_pdfSettings.LetterPageSizeEnabled) + { + pageSize = PageSize.LETTER; + } + + var doc = new Document(pageSize); + PdfWriter.GetInstance(doc, stream); + doc.Open(); + + //fonts + var titleFont = GetFont(); + titleFont.SetStyle(Font.BOLD); + titleFont.Color = BaseColor.BLACK; + var font = GetFont(); + + int productNumber = 1; + int prodCount = products.Count; + + foreach (var product in products) + { + string productName = product.GetLocalized(x => x.Name, lang.Id); + string productDescription = product.GetLocalized(x => x.FullDescription, lang.Id); + + var productTable = new PdfPTable(1); + productTable.WidthPercentage = 100f; + productTable.DefaultCell.Border = Rectangle.NO_BORDER; + if (lang.Rtl) + { + productTable.RunDirection = PdfWriter.RUN_DIRECTION_RTL; + } + + productTable.AddCell(new Paragraph(String.Format("{0}. {1}", productNumber, productName), titleFont)); + productTable.AddCell(new Paragraph(" ")); + productTable.AddCell(new Paragraph(HtmlHelper.StripTags(HtmlHelper.ConvertHtmlToPlainText(productDescription, decode: true)), font)); + productTable.AddCell(new Paragraph(" ")); + + if (product.ProductType == ProductType.SimpleProduct) + { + //simple product + //render its properties such as price, weight, etc + var priceStr = string.Format("{0} {1}", product.Price.ToString("0.00"), _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode); + if (product.IsRental) + priceStr = _priceFormatter.FormatRentalProductPeriod(product, priceStr); + productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.Price", lang.Id), priceStr), font)); + productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.SKU", lang.Id), product.Sku), font)); + + if (product.IsShipEnabled && product.Weight > Decimal.Zero) + productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Weight", lang.Id), product.Weight.ToString("0.00"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).Name), font)); + + if (product.ManageInventoryMethod == ManageInventoryMethod.ManageStock) + productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.StockQuantity", lang.Id), product.GetTotalStockQuantity()), font)); + + productTable.AddCell(new Paragraph(" ")); + } + var pictures = _pictureService.GetPicturesByProductId(product.Id); + if (pictures.Any()) + { + var table = new PdfPTable(2); + table.WidthPercentage = 100f; + if (lang.Rtl) + { + table.RunDirection = PdfWriter.RUN_DIRECTION_RTL; + } + + foreach (var pic in pictures) + { + var picBinary = _pictureService.LoadPictureBinary(pic); + if (picBinary != null && picBinary.Length > 0) + { + var pictureLocalPath = _pictureService.GetThumbLocalPath(pic, 200, false); + var cell = new PdfPCell(Image.GetInstance(pictureLocalPath)); + cell.HorizontalAlignment = Element.ALIGN_LEFT; + cell.Border = Rectangle.NO_BORDER; + table.AddCell(cell); + } + } + + if (pictures.Count % 2 > 0) + { + var cell = new PdfPCell(new Phrase(" ")); + cell.Border = Rectangle.NO_BORDER; + table.AddCell(cell); + } + + productTable.AddCell(table); + productTable.AddCell(new Paragraph(" ")); + } + + + if (product.ProductType == ProductType.GroupedProduct) + { + //grouped product. render its associated products + int pvNum = 1; + foreach (var associatedProduct in _productService.GetAssociatedProducts(product.Id, showHidden: true)) + { + productTable.AddCell(new Paragraph(String.Format("{0}-{1}. {2}", productNumber, pvNum, associatedProduct.GetLocalized(x => x.Name, lang.Id)), font)); + productTable.AddCell(new Paragraph(" ")); + + //uncomment to render associated product description + //string apDescription = associatedProduct.GetLocalized(x => x.ShortDescription, lang.Id); + //if (!String.IsNullOrEmpty(apDescription)) + //{ + // productTable.AddCell(new Paragraph(HtmlHelper.StripTags(HtmlHelper.ConvertHtmlToPlainText(apDescription)), font)); + // productTable.AddCell(new Paragraph(" ")); + //} + + //uncomment to render associated product picture + //var apPicture = _pictureService.GetPicturesByProductId(associatedProduct.Id).FirstOrDefault(); + //if (apPicture != null) + //{ + // var picBinary = _pictureService.LoadPictureBinary(apPicture); + // if (picBinary != null && picBinary.Length > 0) + // { + // var pictureLocalPath = _pictureService.GetThumbLocalPath(apPicture, 200, false); + // productTable.AddCell(Image.GetInstance(pictureLocalPath)); + // } + //} + + productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Price", lang.Id), associatedProduct.Price.ToString("0.00"), _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode), font)); + productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.SKU", lang.Id), associatedProduct.Sku), font)); + + if (associatedProduct.IsShipEnabled && associatedProduct.Weight > Decimal.Zero) + productTable.AddCell(new Paragraph(String.Format("{0}: {1} {2}", _localizationService.GetResource("PDFProductCatalog.Weight", lang.Id), associatedProduct.Weight.ToString("0.00"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).Name), font)); + + if (associatedProduct.ManageInventoryMethod == ManageInventoryMethod.ManageStock) + productTable.AddCell(new Paragraph(String.Format("{0}: {1}", _localizationService.GetResource("PDFProductCatalog.StockQuantity", lang.Id), associatedProduct.GetTotalStockQuantity()), font)); + + productTable.AddCell(new Paragraph(" ")); + + pvNum++; + } + } + + doc.Add(productTable); + + productNumber++; + + if (productNumber <= prodCount) + { + doc.NewPage(); + } + } + + doc.Close(); + } + + #endregion + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Common/PdfService7.cs b/src/Libraries/Nop.Services/Common/PdfService7.cs new file mode 100644 index 00000000000..8a0f5b5e482 --- /dev/null +++ b/src/Libraries/Nop.Services/Common/PdfService7.cs @@ -0,0 +1,1089 @@ +// RTL Support provided by Credo inc (www.credo.co.il || info@credo.co.il) + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Html; +using Nop.Services.Catalog; +using Nop.Services.Configuration; +using Nop.Services.Directory; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Stores; +using iText.Kernel.Font; +using iText.IO.Font; +using iText.Kernel.Geom; +using iText.Kernel.Pdf; +using iText.Kernel.Pdf.Canvas; +using iText.Layout; +using iText.Layout.Element; +using iText.Layout.Borders; +using iText.Layout.Properties; +using iText.Kernel.Colors; +using iText.Kernel.Pdf.Action; +using iText.IO.Image; +using iText.Kernel.Pdf.Xobject; +using iText.Kernel.Events; +using Nop.Services.Tax; +using System.Text.RegularExpressions; + +namespace Nop.Services.Common +{ + /// + /// PDF service + /// + public partial class PdfService7 : IPdfService + { + #region Fields + + private readonly ILocalizationService _localizationService; + private readonly ILanguageService _languageService; + private readonly IWorkContext _workContext; + private readonly IOrderService _orderService; + private readonly IPaymentService _paymentService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IPriceFormatter _priceFormatter; + private readonly ICurrencyService _currencyService; + private readonly IMeasureService _measureService; + private readonly IPictureService _pictureService; + private readonly IProductService _productService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IStoreService _storeService; + private readonly IStoreContext _storeContext; + private readonly ISettingService _settingContext; + private readonly IAddressAttributeFormatter _addressAttributeFormatter; + + private readonly CatalogSettings _catalogSettings; + private readonly CurrencySettings _currencySettings; + private readonly MeasureSettings _measureSettings; + private readonly PdfSettings _pdfSettings; + private readonly TaxSettings _taxSettings; + private readonly AddressSettings _addressSettings; + private readonly ICheckoutAttributeParser _checkoutAttributeParser; + private readonly ITaxService _taxService; + + #endregion + + #region Ctor + + public PdfService7(ILocalizationService localizationService, + ILanguageService languageService, + IWorkContext workContext, + IOrderService orderService, + IPaymentService paymentService, + IDateTimeHelper dateTimeHelper, + IPriceFormatter priceFormatter, + ICurrencyService currencyService, + IMeasureService measureService, + IPictureService pictureService, + IProductService productService, + IProductAttributeParser productAttributeParser, + IStoreService storeService, + IStoreContext storeContext, + ISettingService settingContext, + IAddressAttributeFormatter addressAttributeFormatter, + CatalogSettings catalogSettings, + CurrencySettings currencySettings, + MeasureSettings measureSettings, + PdfSettings pdfSettings, + TaxSettings taxSettings, + AddressSettings addressSettings, + ICheckoutAttributeParser checkoutAttributeParser, + ITaxService taxService) + { + this._localizationService = localizationService; + this._languageService = languageService; + this._workContext = workContext; + this._orderService = orderService; + this._paymentService = paymentService; + this._dateTimeHelper = dateTimeHelper; + this._priceFormatter = priceFormatter; + this._currencyService = currencyService; + this._measureService = measureService; + this._pictureService = pictureService; + this._productService = productService; + this._productAttributeParser = productAttributeParser; + this._storeService = storeService; + this._storeContext = storeContext; + this._settingContext = settingContext; + this._addressAttributeFormatter = addressAttributeFormatter; + this._currencySettings = currencySettings; + this._catalogSettings = catalogSettings; + this._measureSettings = measureSettings; + this._pdfSettings = pdfSettings; + this._taxSettings = taxSettings; + this._addressSettings = addressSettings; + this._checkoutAttributeParser = checkoutAttributeParser; + this._taxService = taxService; + } + + #endregion + + #region Utilities + + #region fonts + /// + /// Get font + /// + /// Font + protected virtual PdfFont GetFont() + { + //nopCommerce supports unicode characters + //nopCommerce uses Free Serif font by default (~/App_Data/Pdf/FreeSerif.ttf file) + //It was downloaded from http://savannah.gnu.org/projects/freefont + return GetFont(_pdfSettings.FontFileName); + } + /// + /// Get font + /// + /// Font file name + /// Font + protected virtual PdfFont GetFont(string fontFileName) + { + //if (fontFileName == null) + // throw new ArgumentNullException("fontFileName"); + + //string fontPath = Path.Combine(CommonHelper.MapPath("~/App_Data/Pdf/"), fontFileName); + //var baseFont = BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); + var font = PdfFontFactory.CreateFont(FontConstants.HELVETICA, PdfEncodings.CP1252, true); + return font; + } + /// + /// Get font bold + /// + /// Font + protected virtual PdfFont GetFontBold() + { + var font = PdfFontFactory.CreateFont(FontConstants.HELVETICA_BOLD, PdfEncodings.CP1252, true); + return font; + } + /// + /// Get font italic + /// + /// Font + protected virtual PdfFont GetFontItalic() + { + var font = PdfFontFactory.CreateFont(FontConstants.HELVETICA_OBLIQUE, PdfEncodings.CP1252, true); + return font; + } + /// + /// Get font bold italic + /// + /// Font + protected virtual PdfFont GetFontBoldItalic() + { + var font = PdfFontFactory.CreateFont(FontConstants.HELVETICA_BOLDOBLIQUE, PdfEncodings.CP1252, true); + return font; + } + #endregion + + #region generic + protected virtual float millimetersToPoints(float value) + { + return (value / 25.4f) * 72f; + } + + protected virtual string TakeCountLines(string text, int count) + { + string lines = ""; + int i = 0; + Match match = Regex.Match(text, "^.*$", RegexOptions.Multiline); + + while (match.Success && i < count) + { + lines += match + "\n"; + match = match.NextMatch(); + i++; + } + + return lines; + } + #endregion + #region pagehandler + private class PageNumSetter : IEventHandler + { + PdfFormXObject placeholder; + float side = 20; + float space = 3.5f; + float descent = 3; + float x; float y; + string txtPage = "Page {0}"; + int pageOffset = 0; + + //public string txtPage { get; set; } = "Page {0}"; + //public int pageOffset { get; set; } = 0; + + public PageNumSetter(float posX, float posY, string TxtPage, int PageOffset) + { + placeholder = new PdfFormXObject(new Rectangle(0, 0, side, side)); + x = posX; + y = posY; + txtPage = TxtPage; + pageOffset = PageOffset; + + } + + public void HandleEvent(Event e) + { + PdfDocumentEvent docEvent = (PdfDocumentEvent)e; + PdfDocument pdf = docEvent.GetDocument(); + PdfPage page = docEvent.GetPage(); + int pageNumber = pdf.GetPageNumber(page) - pageOffset; + Rectangle pageSize = page.GetPageSize(); + PdfCanvas pdfCanvas = new PdfCanvas(page.NewContentStreamBefore(), page.GetResources(), pdf); + Canvas canvas = new Canvas(pdfCanvas, pdf, pageSize); + Paragraph p = new Paragraph() + .Add(string.Format(txtPage, pageNumber)).Add(" / ").SetFontSize(8); + canvas.ShowTextAligned(p, x, y, TextAlignment.RIGHT); + pdfCanvas.AddXObject(placeholder, x + space, y - descent); + pdfCanvas.Release(); + + + } + public void writeTotPageNum(PdfDocument pdf) + { + Canvas canvas = new Canvas(placeholder, pdf); + Paragraph p = new Paragraph() + .Add((pdf.GetNumberOfPages() - pageOffset).ToString()).SetFontSize(8); + canvas.ShowTextAligned(p, 0, descent, TextAlignment.LEFT); + } + + + } + #endregion + #endregion + + #region Methods + + /// + /// Print an order to PDF + /// + /// Order + /// Language identifier; 0 to use a language used when placing an order + /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed + /// A path of generated file + public virtual string PrintOrderToPdf(Order order, int languageId = 0, int vendorId = 0) + { + if (order == null) + throw new ArgumentNullException("order"); + + string fileName = string.Format("order_{0}_{1}.pdf", order.OrderGuid, CommonHelper.GenerateRandomDigitCode(4)); + string filePath = System.IO.Path.Combine(CommonHelper.MapPath("~/content/files/ExportImport"), fileName); + using (var fileStream = new FileStream(filePath, FileMode.Create)) + { + var orders = new List(); + orders.Add(order); + PrintOrdersToPdf(fileStream, orders, languageId, vendorId); + } + return filePath; + } + + /// + /// Print orders to PDF + /// + /// Stream + /// Orders + /// Language identifier; 0 to use a language used when placing an order + /// Vendor identifier to limit products; 0 to to print all products. If specified, then totals won't be printed + public virtual void PrintOrdersToPdf(Stream stream, IList orders, int languageId = 0, int vendorId = 0) + { + #region doc settings + if (stream == null) + throw new ArgumentNullException("stream"); + + if (orders == null) + throw new ArgumentNullException("orders"); + + var pageSize = PageSize.A4; //595 x 842 + + if (_pdfSettings.LetterPageSizeEnabled) + { + pageSize = PageSize.LETTER; + } + + var pdfWriter = new PdfWriter(stream); + var pdfDoc = new PdfDocument(pdfWriter); + var doc = new Document(pdfDoc, pageSize);//, false); + + //store footer properties + var footerY = doc.GetLeftMargin(); + var footerX = doc.GetBottomMargin(); + var footerWidht = pageSize.GetWidth() - doc.GetLeftMargin() - doc.GetRightMargin(); + + //set margin for footer + var bottomMatgin = 100f; + doc.SetBottomMargin(bottomMatgin); + + //generic vars + var cellPdf = new Cell(); + var cellPdf2 = new Cell(); + var paraPdf = new Paragraph(); + + pdfDoc.GetCatalog().SetPageLayout(PdfName.SinglePage); + //info + PdfDocumentInfo info = pdfDoc.GetDocumentInfo(); + info.SetTitle("Rechnung"); + info.SetAuthor("Förderverein The FoodCoop"); + info.SetSubject("Invoice"); + //info.SetCreator("The FoodCoop"); + + //styles + Style styleTitle = new Style().SetFont(GetFontBold()).SetFontSize(12).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style styleNormal = new Style().SetFont(GetFont()).SetFontSize(8).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style styleAttrib = new Style().SetFont(GetFontItalic()).SetFontSize(8).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style5 = new Style().SetFont(GetFont()).SetFontSize(5).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style5b = new Style().SetFont(GetFontBold()).SetFontSize(5).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style6 = new Style().SetFont(GetFont()).SetFontSize(6).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style6b = new Style().SetFont(GetFontBold()).SetFontSize(6).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style8 = new Style().SetFont(GetFont()).SetFontSize(8).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style8b = new Style().SetFont(GetFontBold()).SetFontSize(8).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style style9b = new Style().SetFont(GetFontBold()).SetFontSize(9).SetFontColor(Color.BLACK).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + Style styleCell = new Style().SetBorder(Border.NO_BORDER).SetHorizontalAlignment(HorizontalAlignment.LEFT).SetTextAlignment(TextAlignment.LEFT); + + #endregion + + + int ordCount = orders.Count; + int ordNum = 0; + int pagesSofar = 0; + + foreach (var order in orders) + { + bool includingTax = order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax; + + //by default _pdfSettings contains settings for the current active store + //and we need PdfSettings for the store which was used to place an order + //so let's load it based on a store of the current order + var pdfSettingsByStore = _settingContext.LoadSetting(order.StoreId); + + + var lang = _languageService.GetLanguageById(languageId == 0 ? order.CustomerLanguageId : languageId); + if (lang == null || !lang.Published) + lang = _workContext.WorkingLanguage; + + var currency = _currencyService.GetCurrencyByCode(order.CustomerCurrencyCode) + ?? new Currency + { + CurrencyCode = order.CustomerCurrencyCode + }; + bool showCurrency = false; + + var pageEvent = new PageNumSetter(pageSize.GetWidth() / 2, footerX - 20, _localizationService.GetResource("PDFInvoice.Page", lang.Id) + " {0}", pagesSofar); + pdfDoc.AddEventHandler(PdfDocumentEvent.INSERT_PAGE, pageEvent); + + //there is no need for a new page as last element is a footer + //if (ordNum > 0) + // doc.Add(new AreaBreak(AreaBreakType.NEXT_PAGE)); + + //main layout is based on a single table + int col = 7; + int headerCol = 4; int logoCol = col - headerCol; + int shippAddrCol = 4; int ivAddrCol = col - shippAddrCol; + //main layout table. Will have only 1 column. + var tabPage = new Table(col).SetBorder(Border.NO_BORDER).SetWidthPercent(100f); + tabPage.SetProperty(Property.BORDER, null); + tabPage.SetProperty(Property.TEXT_ALIGNMENT, TextAlignment.LEFT); + + #region Header&Logo + + var logoPicture = _pictureService.GetPictureById(pdfSettingsByStore.LogoPictureId); + var logoExists = logoPicture != null; + + //store info + var store = _storeService.GetStoreById(order.StoreId) ?? _storeContext.CurrentStore; + var anchor = new Text(store.Url.Trim(new[] { '/' })).SetAction(PdfAction.CreateURI(store.Url)); + + paraPdf = new Paragraph(new Text(store.CompanyName).AddStyle(styleTitle)).AddStyle(styleNormal).SetMultipliedLeading(1.2f).Add("\n"); + + + //We use seetings for address and bank + if (!string.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn1)) + { + paraPdf.Add(new Text(pdfSettingsByStore.InvoiceFooterTextColumn1).AddStyle(style5)); + paraPdf.Add(new Text("\n").AddStyle(style6)); + } + if (!string.IsNullOrEmpty(pdfSettingsByStore.InvoiceFooterTextColumn2)) + { + paraPdf.Add(new Text(pdfSettingsByStore.InvoiceFooterTextColumn2).AddStyle(style5)); + paraPdf.Add(new Text("\n").AddStyle(style6)); + } + + paraPdf.Add(anchor.AddStyle(style5)).Add("\n"); + tabPage.AddHeaderCell(new Cell(1, logoExists ? headerCol : col).Add(paraPdf).AddStyle(styleCell)); + + //logo + if (logoExists) + { + var logoFilePath = _pictureService.GetThumbLocalPath(logoPicture, 0, false); + var logo = new Image(ImageDataFactory.Create(logoFilePath)).SetAutoScale(true); + tabPage.AddHeaderCell(new Cell(1, logoCol).Add(logo).AddStyle(styleCell)); + } + + //empty Line + tabPage.AddHeaderCell(new Cell(1, col).Add("\n").AddStyle(styleCell)); + + #endregion + + #region Addresses + + #region shippingaddr + + //shipping info + if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) + { + if (!order.PickUpInStore) + { + if (order.ShippingAddress == null) + throw new NopException(string.Format("Shipping is required, but address is not available. Order ID = {0}", order.Id)); + + paraPdf = new Paragraph(new Text(_localizationService.GetResource("PDFInvoice.ShippingInformation", lang.Id)).AddStyle(style8b)).AddStyle(styleNormal).SetMultipliedLeading(1.2f).SetFirstLineIndent(-5f).SetMarginLeft(5f); + paraPdf.Add("\n"); + if (!String.IsNullOrEmpty(order.ShippingAddress.Company)) + paraPdf.Add(new Text(order.ShippingAddress.Company)).Add("\n"); + if (!String.IsNullOrEmpty(order.ShippingAddress.FirstName)) + paraPdf.Add(new Text(order.ShippingAddress.FirstName)).Add(" "); + if (!String.IsNullOrEmpty(order.ShippingAddress.LastName)) + paraPdf.Add(new Text(order.ShippingAddress.LastName)).Add("\n"); + if (_addressSettings.PhoneEnabled && !String.IsNullOrEmpty(order.ShippingAddress.PhoneNumber)) + paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.ShippingAddress.PhoneNumber))).Add("\n"); + if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.ShippingAddress.FaxNumber)) + paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.FaxNumber", lang.Id), order.ShippingAddress.FaxNumber))).Add("\n"); + if (_addressSettings.StreetAddressEnabled && !String.IsNullOrEmpty(order.ShippingAddress.Address1)) + paraPdf.Add(new Text(order.ShippingAddress.Address1)).Add("\n"); + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.ShippingAddress.Address2)) + paraPdf.Add(new Text(order.ShippingAddress.Address2)).Add("\n"); + + if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) + paraPdf.Add(new Text(String.Format("{2} {0}, {1}", order.ShippingAddress.City, order.ShippingAddress.StateProvince != null ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.ShippingAddress.ZipPostalCode))).Add("\n"); + if (_addressSettings.CountryEnabled && order.ShippingAddress.Country != null) + paraPdf.Add(new Text(String.Format("{0}", order.ShippingAddress.Country != null ? order.ShippingAddress.Country.GetLocalized(x => x.Name, lang.Id) : ""))).Add("\n"); + + //custom attributes + var customShippingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); + if (!String.IsNullOrEmpty(customShippingAddressAttributes)) + { + //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) + paraPdf.Add(new Text(HtmlHelper.ConvertHtmlToPlainText(customShippingAddressAttributes, true, true))).Add("\n"); + } + } + else + if (order.PickupAddress != null) + { + paraPdf = new Paragraph(new Text(_localizationService.GetResource("PDFInvoice.Pickup", lang.Id)).AddStyle(style9b)).AddStyle(styleNormal).SetMultipliedLeading(1f).SetFirstLineIndent(5f); + paraPdf.Add("\n"); + if (!string.IsNullOrEmpty(order.PickupAddress.Address1)) + paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.Address", lang.Id), order.PickupAddress.Address1))).Add("\n"); + if (!string.IsNullOrEmpty(order.PickupAddress.City)) + paraPdf.Add(order.PickupAddress.City).Add("\n"); + if (order.PickupAddress.Country != null) + paraPdf.Add(order.PickupAddress.Country.GetLocalized(x => x.Name, lang.Id)).Add("\n"); + if (!string.IsNullOrEmpty(order.PickupAddress.ZipPostalCode)) + paraPdf.Add(order.PickupAddress.ZipPostalCode).Add("\n"); + + } + + tabPage.AddHeaderCell(new Cell(1, shippAddrCol).Add(paraPdf).AddStyle(styleCell)); + } + else + { + paraPdf.Add("\n"); + tabPage.AddHeaderCell(new Cell(1, shippAddrCol).Add(paraPdf).AddStyle(styleCell)); + } + + #endregion + + #region billing + //billing info + paraPdf = new Paragraph(new Text(_localizationService.GetResource("PDFInvoice.BillingInformation", lang.Id)).AddStyle(style8b)).AddStyle(styleNormal).SetMultipliedLeading(1.2f).SetFirstLineIndent(-5f).SetMarginLeft(5f); + paraPdf.Add("\n"); + //paraPdf = new Paragraph().AddStyle(styleNormal).SetMultipliedLeading(1.2f); + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.BillingAddress.Company)) + paraPdf.Add(new Text(order.BillingAddress.Company)).Add("\n"); + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.BillingAddress.FirstName)) + paraPdf.Add(new Text(order.BillingAddress.FirstName)).Add(" "); + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(order.BillingAddress.LastName)) + paraPdf.Add(new Text(order.BillingAddress.LastName)).Add("\n"); + if (_addressSettings.PhoneEnabled && !String.IsNullOrEmpty(order.BillingAddress.PhoneNumber)) + paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.Phone", lang.Id), order.BillingAddress.PhoneNumber))).Add("\n"); + if (_addressSettings.FaxEnabled && !String.IsNullOrEmpty(order.BillingAddress.FaxNumber)) + paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.FaxNumber", lang.Id), order.BillingAddress.FaxNumber))).Add("\n"); + if (_addressSettings.StreetAddressEnabled && !String.IsNullOrEmpty(order.BillingAddress.Address1)) + paraPdf.Add(new Text(order.BillingAddress.Address1)).Add("\n"); + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(order.BillingAddress.Address2)) + paraPdf.Add(new Text(order.BillingAddress.Address2)).Add("\n"); + + if (_addressSettings.CityEnabled || _addressSettings.StateProvinceEnabled || _addressSettings.ZipPostalCodeEnabled) + paraPdf.Add(new Text(String.Format("{2} {0}, {1}", order.BillingAddress.City, order.BillingAddress.StateProvince != null ? order.BillingAddress.StateProvince.GetLocalized(x => x.Name, lang.Id) : "", order.BillingAddress.ZipPostalCode))).Add("\n"); + if (_addressSettings.CountryEnabled && order.BillingAddress.Country != null) + paraPdf.Add(new Text(String.Format("{0}", order.BillingAddress.Country != null ? order.BillingAddress.Country.GetLocalized(x => x.Name, lang.Id) : ""))).Add("\n"); + + //VAT number + //if (!String.IsNullOrEmpty(order.VatNumber)) + // paraPdf.Add(new Text(String.Format(_localizationService.GetResource("PDFInvoice.VATNumber", lang.Id), order.VatNumber))).Add("\n"); + + //custom attributes + var customBillingAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.BillingAddress.CustomAttributes); + if (!String.IsNullOrEmpty(customBillingAddressAttributes)) + { + //TODO: we should add padding to each line (in case if we have sevaral custom address attributes) + paraPdf.Add(new Text(HtmlHelper.ConvertHtmlToPlainText(customBillingAddressAttributes, true, true))).Add("\n"); + } + + //vendors payment details from payment provider + if (vendorId == 0) + { + //custom values + var customValues = order.DeserializeCustomValues(); + if (customValues != null) + { + foreach (var item in customValues) + { + if (!String.IsNullOrEmpty(item.Value.ToString())) + paraPdf.Add(new Text(item.Key + ": " + item.Value)).Add("\n"); + } + } + } + + //add + tabPage.AddHeaderCell(new Cell(1, ivAddrCol).Add(paraPdf).AddStyle(styleCell)); + #endregion + + #endregion + + #region invoice header + //empty Line + tabPage.AddHeaderCell(new Cell(1, col).Add("\n").AddStyle(styleCell)); + //Invoice + var invoiceID = (order.InvoiceId != null && order.InvoiceId != "ToBeAssigned") ? order.InvoiceId : null; + paraPdf = new Paragraph(new Text(_localizationService.GetResource(invoiceID != null? "PDFInvoice.Invoice" :"PDFInvoice.Order", lang.Id)).AddStyle(styleTitle)); + if (invoiceID != null) + paraPdf.Add(new Text(" " + invoiceID).AddStyle(styleTitle)); + tabPage.AddHeaderCell(new Cell(1, col - 3).Add(paraPdf).AddStyle(styleCell)); + paraPdf = new Paragraph(); + if (order.InvoiceDateUtc.HasValue) + { + paraPdf.Add(new Text(_localizationService.GetResource("PDFInvoice.InvoiceDate", lang.Id)).AddStyle(style9b)).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddHeaderCell(new Cell(1, 2).Add(paraPdf).AddStyle(styleCell)); + paraPdf = new Paragraph(new Text(_dateTimeHelper.ConvertToUserTime((System.DateTime)(order.InvoiceDateUtc), DateTimeKind.Utc).ToString("d", new CultureInfo(lang.LanguageCulture)) ?? "").AddStyle(style9b)).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddHeaderCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell)); + } + else + tabPage.AddHeaderCell(new Cell(1, 3).Add(paraPdf).AddStyle(styleCell)); + + #region invoice titles + //compose titles + + //payment method + var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); + string paymentMethodStr = paymentMethod != null ? paymentMethod.GetLocalizedFriendlyName(_localizationService, lang.Id) : order.PaymentMethodSystemName; + + //titles + string[,] tit = { { "PDFInvoice.Order#", order.Id.ToString() ?? ""} + , { "PDFInvoice.OrderDate", _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc).ToString("d", new CultureInfo(lang.LanguageCulture)) ?? ""} + , { "Order.ShippingMethod", order.ShippingMethod ?? ""} + , { "Order.PaymentMethod", paymentMethodStr ?? ""} + , { "Order.Payment.Status", order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext) ?? ""} + , { "Order.VatNumber", order.VatNumber ?? ""} + , { "PDFInvoice.Currency", order.CustomerCurrencyCode} + }; + + for (var i = 0; i <= tit.GetUpperBound(0); i++) + { + cellPdf = new Cell(); + paraPdf = new Paragraph(new Text(String.Format(_localizationService.GetResource(tit[i, 0], lang.Id))).AddStyle(style8)); + cellPdf.Add(paraPdf); + tabPage.AddHeaderCell(cellPdf.SetBorder(null) + .SetVerticalAlignment(VerticalAlignment.TOP) + .SetBackgroundColor(Color.LIGHT_GRAY) + .SetPadding(0) + .SetTextAlignment(TextAlignment.LEFT) + .SetBorderTop(new SolidBorder(1)) + ); + } + + for (var i = 0; i <= tit.GetUpperBound(0); i++) + { + cellPdf = new Cell(); + paraPdf = new Paragraph(new Text(tit[i, 1]).AddStyle(style9b)); + cellPdf.Add(paraPdf); + tabPage.AddHeaderCell(cellPdf.SetBorder(null) + .SetVerticalAlignment(VerticalAlignment.BOTTOM) + .SetTextAlignment(TextAlignment.LEFT) + .SetBorderBottom(new SolidBorder(0.5f)) + ); + } + + #endregion + + #endregion + + #region Products + + //products + var orderItems = order.OrderItems; + + var hasSku = _catalogSettings.ShowSkuOnProductDetailsPage; + + tabPage.AddHeaderCell(new Cell(1, hasSku ? 2 : 3).Add(_localizationService.GetResource("PDFInvoice.ProductName", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY)); + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + tabPage.AddHeaderCell(new Cell(1, 1).Add(_localizationService.GetResource("PDFInvoice.SKU", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY)); + } + tabPage.AddHeaderCell(new Cell(1, 1).Add(_localizationService.GetResource("PDFInvoice.TaxRate", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + tabPage.AddHeaderCell(new Cell(1, 1).Add(_priceFormatter.FormatTaxString(_localizationService.GetResource("PDFInvoice.ProductPrice", lang.Id), lang, includingTax)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.RIGHT)); + tabPage.AddHeaderCell(new Cell(1, 1).Add(_localizationService.GetResource("PDFInvoice.ProductQuantity", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.RIGHT)); + tabPage.AddHeaderCell(new Cell(1, 1).Add(_priceFormatter.FormatTaxString(_localizationService.GetResource("PDFInvoice.ProductTotal", lang.Id), lang, includingTax)).AddStyle(styleCell).AddStyle(style9b).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.RIGHT)); + int ic = 1; //init product numerator + + foreach (var orderItem in orderItems) + { + var p = orderItem.Product; + + //a vendor should have access only to his products + if (vendorId > 0 && p.VendorId != vendorId) + continue; + + //product name + string name; + name = ic.ToString() + ") " + p.GetLocalized(x => x.Name, lang.Id); + paraPdf = new Paragraph(new Text(name).AddStyle(style9b)).AddStyle(styleNormal).SetMultipliedLeading(1.5f).Add("\n"); + + //attributes + if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) + { + paraPdf.Add(HtmlHelper.ConvertHtmlToPlainText(orderItem.AttributeDescription, true, true)).AddStyle(styleNormal).Add("\n"); + } + //rental info + if (orderItem.Product != null && orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + + paraPdf.Add(rentalInfo).AddStyle(styleNormal).Add("\n"); + } + + tabPage.AddCell(new Cell(1, hasSku ? 2 : 3).Add(paraPdf).AddStyle(styleCell).SetKeepTogether(true)); + + //SKU + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + var sku = p.FormatSku(orderItem.AttributesXml, _productAttributeParser); + paraPdf = new Paragraph(sku ?? String.Empty).AddStyle(styleNormal); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + } + //taxrate + bool hasAttribVat = !String.IsNullOrEmpty(orderItem.AttributesXml) && orderItem.AttributesXml.Contains(" 0) + continue; + + //product name + paraPdf = new Paragraph(HtmlHelper.ConvertHtmlToPlainText(attributeValue.Name, true, true)).AddStyle(styleNormal).Add("\n"); + tabPage.AddCell(new Cell(1, hasSku ? 2 : 3).Add(paraPdf).AddStyle(styleCell)); + + //SKU + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + paraPdf = new Paragraph("").AddStyle(styleNormal); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + } + //taxrate + paraPdf = new Paragraph(_priceFormatter.FormatTaxRate(taxRate)).AddStyle(styleNormal).SetTextAlignment(TextAlignment.CENTER); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + + //price + string unitPrice; + var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(itemAmount, order.CurrencyRate); + unitPrice = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, showCurrency, currency, lang, true, false); + + paraPdf = new Paragraph(unitPrice).AddStyle(styleNormal).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + + //qty + paraPdf = new Paragraph("1").AddStyle(styleNormal).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + + //total + string subTotal = unitPrice; + paraPdf = new Paragraph(subTotal).AddStyle(styleNormal).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddCell(new Cell().Add(paraPdf).AddStyle(styleCell)); + + } + } + #endregion + + //footer products, checkout table + paraPdf = new Paragraph(_localizationService.GetResource("PDFInvoice.Continue", lang.Id)).AddStyle(styleNormal).SetTextAlignment(TextAlignment.RIGHT); + tabPage.AddFooterCell(new Cell(1, col).Add(paraPdf).AddStyle(styleCell)).SetSkipLastFooter(true); + + tabPage.AddCell(new Cell(1, col).Add(" ").AddStyle(styleCell).SetBorderTop(new SolidBorder(0.1f))); + + #region Order notes in cell not used atm. They are printed on last page + //var notesCell = 4; + //int totNotes = 0; + //if (pdfSettingsByStore.RenderOrderNotes) + //{ + // var orderNotes = order.OrderNotes + // .Where(on => on.DisplayToCustomer) + // .OrderByDescending(on => on.CreatedOnUtc) + // .ToList(); + + // if (orderNotes.Any()) + // { + // totNotes = orderNotes.Count(); + // int notesCol = 4; + // var tabNotes = new Table(notesCol).SetBorder(Border.NO_BORDER).SetWidthPercent(100f); + // paraPdf = new Paragraph(new Text(_localizationService.GetResource("PDFInvoice.OrderNotes", lang.Id)).AddStyle(styleTitle)).AddStyle(styleNormal).SetMultipliedLeading(1.5f); + // tabNotes.AddHeaderCell(new Cell(1, notesCol).Add(paraPdf).AddStyle(styleCell)); + + // //created on + // tabNotes.AddHeaderCell(new Cell(1, 1).Add(_localizationService.GetResource("PDFInvoice.OrderNotes.CreatedOn", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetTextAlignment(TextAlignment.LEFT)); + + // //note + // tabNotes.AddHeaderCell(new Cell(1, notesCol - 1).Add(_localizationService.GetResource("PDFInvoice.OrderNotes.Note", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetTextAlignment(TextAlignment.LEFT)); + // var orderNote = orderNotes.FirstOrDefault(); + + // paraPdf = new Paragraph(_dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc).ToString("g", new CultureInfo(lang.LanguageCulture))).AddStyle(styleNormal).SetTextAlignment(TextAlignment.LEFT); + // tabNotes.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell).SetKeepTogether(true)); + // var strNotes = TakeCountLines(HtmlHelper.ConvertHtmlToPlainText(orderNote.FormatOrderNoteText(), true, true), 20); + + // paraPdf = new Paragraph(strNotes).AddStyle(styleNormal).SetTextAlignment(TextAlignment.LEFT); + // tabNotes.AddCell(new Cell(1, notesCol - 1).Add(paraPdf).AddStyle(styleCell).SetKeepTogether(true)); + + // //should we display a link to downloadable files here? + // //I think, no. Onyway, PDFs are printable documents and links (files) are useful here + + // tabPage.AddCell(new Cell(1, notesCell).Add(tabNotes).AddStyle(styleCell).SetPadding(0)); + // } + //} + + #endregion. see + + #region Order totals + var taxRates = order.TaxRatesDictionary; + + var sumCell = col; // - notesCell; + int subcol = col; // totNotes > 0 ? sumCell : col; + var tabTot = new Table(subcol).SetBorder(Border.NO_BORDER).SetWidthPercent(100f); + + //vendors cannot see totals + if (vendorId == 0) + { + int redeemedPoints = 0; + decimal redeemedAmount = decimal.Zero; + if (order.RedeemedRewardPointsEntry != null) + { + redeemedPoints = -order.RedeemedRewardPointsEntry.Points; + redeemedAmount = -order.RedeemedRewardPointsEntry.UsedAmount; + } + var lstSummary = new List> //desc, amount, show when zero, doLocalize, borderTop, borderBottom + { + Tuple.Create("PDFInvoice.Sub-Total", includingTax ? order.OrderSubtotalInclTax : order.OrderSubtotalExclTax, true, true, false, false) //order subtotal + ,Tuple.Create("PDFInvoice.Discount", includingTax ? -order.OrderSubTotalDiscountInclTax : -order.OrderSubTotalDiscountExclTax, false, true, false, false) //discount (applied to order subtotal) + ,Tuple.Create("PDFInvoice.Shipping", includingTax ? order.OrderShippingInclTax : order.OrderShippingExclTax, false, order.OrderShippingInclTax == decimal.Zero && order.OrderShippingNonTaxable == decimal.Zero, order.ShippingStatus != ShippingStatus.ShippingNotRequired, false) //shipping + ,Tuple.Create(string.Format(_localizationService.GetResource("PDFInvoice.RewardPoints", lang.Id), redeemedPoints), redeemedAmount, false, true, false, false) //earned reward points + ,Tuple.Create("PDFInvoice.PaymentMethodAdditionalFee", includingTax ? order.PaymentMethodAdditionalFeeInclTax : order.PaymentMethodAdditionalFeeExclTax, false, true, false, false) //payment fee + ,Tuple.Create("PDFInvoice.InvoiceDiscount", -order.OrderDiscount, false, true, false, false) //discount (applied to order total) + }; + + if (!includingTax) + { + lstSummary.Add(new Tuple("PDFInvoice.OrderAmount", order.OrderAmount, true, true, false, false)); //tax base + lstSummary.Add(new Tuple("PDFInvoice.Tax", order.OrderTax, true, true, false, false)); //tax amount + } + //order total incl. + lstSummary.Add(new Tuple("PDFInvoice.OrderAmountIncl", order.OrderAmountIncl, true, true, false, false)); + + //shipping non taxable + var shippTuple = Tuple.Create("PDFInvoice.Shipping", order.OrderShippingNonTaxable, false, false, order.ShippingStatus != ShippingStatus.ShippingNotRequired, false); + lstSummary.Add(shippTuple); + + //payment fee non taxable + lstSummary.Add(new Tuple("PDFInvoice.PaymentMethodAdditionalFee", order.PaymentMethodAdditionalFeeNonTaxable, false, true, false, false)); + + //gift cards + foreach (var gcuh in order.GiftCardUsageHistory) + { + lstSummary.Add(new Tuple( + string.Format(_localizationService.GetResource("PDFInvoice.GiftCardInfo", lang.Id), gcuh.GiftCard.GiftCardCouponCode), -gcuh.UsedValue, false, false, false, false + ) + ); + } + + //purchased reward points + if (order.RedeemedRewardPointsEntry != null) + { + lstSummary.Add(new Tuple( + string.Format(_localizationService.GetResource("PDFInvoice.RewardPointsPurchased", lang.Id), -order.RedeemedRewardPointsEntry.PointsPurchased), -order.RedeemedRewardPointsEntry.UsedAmountPurchased, false, false, false, false + ) + ); + } + + //order total to pay + lstSummary.Add(new Tuple("PDFInvoice.AmountToPay", order.OrderTotal, true, true, true, false)); + + foreach (var tupSummary in lstSummary) + { + var desc = tupSummary.Item1; + var amount = tupSummary.Item2; + var showZero = tupSummary.Item3; + var doLocalize = tupSummary.Item4; + var borderTop = tupSummary.Item5; + var borderBottom = tupSummary.Item6; + + var amountInCustomerCurrency = _currencyService.ConvertCurrency(amount, order.CurrencyRate); + var amountInCustomerCurrencyStr = _priceFormatter.FormatPrice(amountInCustomerCurrency, showCurrency, currency, lang, includingTax, false); + + if (amountInCustomerCurrency != decimal.Zero || showZero) + { + paraPdf = new Paragraph(doLocalize ? _localizationService.GetResource(desc, lang.Id) : desc).AddStyle(style9b).SetTextAlignment(TextAlignment.RIGHT); + cellPdf = new Cell(1, subcol - 1).Add(paraPdf).AddStyle(styleCell); + paraPdf = new Paragraph(amountInCustomerCurrencyStr).AddStyle(style9b).SetTextAlignment(TextAlignment.RIGHT); + cellPdf2 = new Cell(1, 1).Add(paraPdf).AddStyle(styleCell); + if (borderTop) + { + cellPdf.SetBorderTop(new SolidBorder(0.5f)); cellPdf2.SetBorderTop(new SolidBorder(0.5f)); + } + if (borderBottom) + { + cellPdf.SetBorderBottom(new SolidBorder(0.5f)); cellPdf2.SetBorderBottom(new SolidBorder(0.5f)); + } + tabTot.AddCell(cellPdf); + tabTot.AddCell(cellPdf2); + } + } + + + } + else + tabTot.AddCell(""); + + tabPage.AddCell(new Cell(1, col) //totNotes > 0 ? sumCell : col) + .Add(tabTot).AddStyle(styleCell).SetPadding(0).SetKeepTogether(true)); + #endregion + + #region Order notes + + if (pdfSettingsByStore.RenderOrderNotes ) //&& totNotes > 1) + { + var orderNotes = order.OrderNotes + .Where(on => on.DisplayToCustomer) + .OrderByDescending(on => on.CreatedOnUtc) + .ToList(); + + + if (orderNotes.Any()) + { + paraPdf = new Paragraph(new Text(_localizationService.GetResource("PDFInvoice.OrderNotes", lang.Id)).AddStyle(styleTitle)).AddStyle(styleNormal).SetMultipliedLeading(1.5f); + tabPage.AddCell(new Cell(1, col).Add(paraPdf).AddStyle(styleCell)); + + //created on + tabPage.AddCell(new Cell(1, 1).Add(_localizationService.GetResource("PDFInvoice.OrderNotes.CreatedOn", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetTextAlignment(TextAlignment.LEFT)); + + //note + tabPage.AddCell(new Cell(1, col - 1).Add(_localizationService.GetResource("PDFInvoice.OrderNotes.Note", lang.Id)).AddStyle(styleCell).AddStyle(style9b).SetTextAlignment(TextAlignment.LEFT)); + + foreach (var orderNote in orderNotes)//.Skip(1)) + { + paraPdf = new Paragraph(_dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc).ToString("g", new CultureInfo(lang.LanguageCulture))).AddStyle(styleNormal).SetTextAlignment(TextAlignment.LEFT); + tabPage.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell)); + var strNotes = TakeCountLines(HtmlHelper.ConvertHtmlToPlainText(orderNote.FormatOrderNoteText(), true, true), 20); + + paraPdf = new Paragraph(strNotes).AddStyle(styleNormal).SetTextAlignment(TextAlignment.LEFT); + tabPage.AddCell(new Cell(1, col - 1).Add(paraPdf).AddStyle(styleCell)); + } + + } + } + + #endregion + + #region tax summary + var footerTable = new Table(col).SetBorder(Border.NO_BORDER).SetWidthPercent(100f); + var displayTaxRates = _taxSettings.DisplayTaxRates; + if (displayTaxRates) + { + var taxTable = new Table(new float[] { 20, 20, 20, 20, 20 }).SetBorder(Border.NO_BORDER).SetWidthPercent(100f).AddStyle(styleNormal).SetHorizontalAlignment(HorizontalAlignment.LEFT); + + //header + taxTable.AddCell(new Cell().Add(_localizationService.GetResource("PDFInvoice.TaxRate", lang.Id)).AddStyle(styleCell).AddStyle(style8).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + taxTable.AddCell(new Cell().Add(_localizationService.GetResource(includingTax ? "PDFInvoice.OrderAmountIncl" : "PDFInvoice.OrderAmount", lang.Id)).AddStyle(styleCell).AddStyle(style8).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + taxTable.AddCell(new Cell().Add(_localizationService.GetResource(includingTax ? "PDFInvoice.DiscountAmountIncl" : "PDFInvoice.DiscountAmount", lang.Id)).AddStyle(styleCell).AddStyle(style8).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + taxTable.AddCell(new Cell().Add(_localizationService.GetResource("PDFInvoice.BaseAmount", lang.Id)).AddStyle(styleCell).AddStyle(style8).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + taxTable.AddCell(new Cell().Add(_localizationService.GetResource("PDFInvoice.TaxAmount", lang.Id)).AddStyle(styleCell).AddStyle(style8).SetBackgroundColor(Color.LIGHT_GRAY).SetTextAlignment(TextAlignment.CENTER)); + + + foreach (var item in taxRates) + { + string taxRate = String.Format(_priceFormatter.FormatTaxRate(item.Key)); + string Amount = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.Amount, order.CurrencyRate), showCurrency, order.CustomerCurrencyCode, false, lang); + string DiscountAmount = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.DiscountAmount, order.CurrencyRate), showCurrency, order.CustomerCurrencyCode, false, lang); + string BaseAmount = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.BaseAmount, order.CurrencyRate), showCurrency, order.CustomerCurrencyCode, false, lang); + string TaxAmount = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.TaxAmount, order.CurrencyRate), showCurrency, order.CustomerCurrencyCode, false, lang); + //string AmountIncludingVAT = _priceFormatter.FormatPrice(_currencyService.ConvertCurrency(item.Value.AmountIncludingVAT, order.CurrencyRate), true, order.CustomerCurrencyCode, false, lang); + + taxTable.AddCell(new Cell().Add(taxRate).AddStyle(styleCell).AddStyle(style8b).SetTextAlignment(TextAlignment.CENTER).SetBackgroundColor(Color.WHITE)); + taxTable.AddCell(new Cell().Add(Amount).AddStyle(styleCell).AddStyle(style8b).SetTextAlignment(TextAlignment.CENTER).SetBackgroundColor(Color.WHITE)); + taxTable.AddCell(new Cell().Add(DiscountAmount).AddStyle(styleCell).AddStyle(style8b).SetTextAlignment(TextAlignment.CENTER).SetBackgroundColor(Color.WHITE)); + taxTable.AddCell(new Cell().Add(BaseAmount).AddStyle(styleCell).AddStyle(style8b).SetTextAlignment(TextAlignment.CENTER).SetBackgroundColor(Color.WHITE)); + taxTable.AddCell(new Cell().Add(TaxAmount).AddStyle(styleCell).AddStyle(style8b).SetTextAlignment(TextAlignment.CENTER).SetBackgroundColor(Color.WHITE)); + } + + footerTable.AddCell(new Cell(1, 5).Add(taxTable).AddStyle(styleCell).SetPadding(0).SetBorderTop(new SolidBorder(0.1f)).SetBorderBottom(new SolidBorder(0.1f))); + + var taxAmountTable = new Table(2).SetBorder(Border.NO_BORDER).SetWidthPercent(100f).AddStyle(styleNormal).SetHorizontalAlignment(HorizontalAlignment.LEFT); + + //base amount head + paraPdf = new Paragraph(_localizationService.GetResource("PDFInvoice.BaseAmountTotal", lang.Id)).AddStyle(style8).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell).SetBackgroundColor(Color.LIGHT_GRAY)); + + //total pay header + paraPdf = new Paragraph(_localizationService.GetResource("PDFInvoice.AmountToPay", lang.Id)).AddStyle(style8).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(2, 1).Add(paraPdf).AddStyle(styleCell).SetBackgroundColor(Color.LIGHT_GRAY).SetVerticalAlignment(VerticalAlignment.TOP)); + + //base amount + var amountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderAmount, order.CurrencyRate); + string amountInCustomerCurrencyStr = _priceFormatter.FormatPrice(amountInCustomerCurrency, showCurrency, currency, lang, false, false); + paraPdf = new Paragraph(amountInCustomerCurrencyStr).AddStyle(style9b).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell).SetBackgroundColor(Color.WHITE)); + + //vat amount head + paraPdf = new Paragraph(_localizationService.GetResource("PDFInvoice.TaxAmount", lang.Id)).AddStyle(style8).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell).SetBackgroundColor(Color.LIGHT_GRAY)); + + //total pay amount + amountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); + amountInCustomerCurrencyStr = _priceFormatter.FormatPrice(amountInCustomerCurrency, showCurrency, currency, lang, false, false); + paraPdf = new Paragraph(amountInCustomerCurrencyStr).AddStyle(style9b).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(2, 1).Add(paraPdf).AddStyle(styleCell).SetVerticalAlignment(VerticalAlignment.MIDDLE).SetBackgroundColor(Color.WHITE)); + + //vat amount + amountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTax, order.CurrencyRate); + amountInCustomerCurrencyStr = _priceFormatter.FormatPrice(amountInCustomerCurrency, showCurrency, currency, lang, false, false); + paraPdf = new Paragraph(amountInCustomerCurrencyStr).AddStyle(style9b).SetTextAlignment(TextAlignment.CENTER); + taxAmountTable.AddCell(new Cell(1, 1).Add(paraPdf).AddStyle(styleCell).SetBackgroundColor(Color.WHITE)); + + footerTable.AddCell(new Cell(1, 2).Add(taxAmountTable).AddStyle(styleCell).SetPadding(0).SetBorderTop(new SolidBorder(0.1f)).SetBorderBottom(new SolidBorder(0.1f)).SetKeepTogether(true)); + + //place footer in tabPage cell and position it using setfixedpos + tabPage.AddCell(new Cell(1, col).Add(footerTable).AddStyle(styleCell).SetPadding(0).SetKeepTogether(true).SetFixedPosition(footerX, footerY, footerWidht)); + + } + #endregion + + + doc.Add(tabPage); + + //tmp margin marker + //var pdfcan = new PdfCanvas(pdfDoc.GetLastPage()); + //pdfcan.MoveTo(0, bottomMatgin).LineTo(100, bottomMatgin).Stroke(); + + + //doc.Relayout(); + + //finalize page + pdfDoc.RemoveEventHandler(PdfDocumentEvent.INSERT_PAGE, pageEvent); + pageEvent.writeTotPageNum(pdfDoc); + pageEvent = null; + pagesSofar = pdfDoc.GetNumberOfPages(); + + + ordNum++; + + } + doc.Close(); + } + + + + + + /// + /// Print packaging slips to PDF + /// + /// Stream + /// Shipments + /// Language identifier; 0 to use a language used when placing an order + public virtual void PrintPackagingSlipsToPdf(Stream stream, IList shipments, int languageId = 0) + { + var _pdfService = new PdfService(_localizationService, _languageService, _workContext, _orderService, _paymentService, _dateTimeHelper, _priceFormatter, _currencyService, _measureService, _pictureService, _productService, _productAttributeParser, _storeService, _storeContext, _settingContext, _addressAttributeFormatter, _catalogSettings, _currencySettings, _measureSettings, _pdfSettings, _taxSettings, _addressSettings); + _pdfService.PrintPackagingSlipsToPdf(stream, shipments, languageId); + + } + + /// + /// Print products to PDF + /// + /// Stream + /// Products + public virtual void PrintProductsToPdf(Stream stream, IList products) + { + var _pdfService = new PdfService(_localizationService, _languageService, _workContext, _orderService, _paymentService, _dateTimeHelper, _priceFormatter, _currencyService, _measureService, _pictureService, _productService, _productAttributeParser, _storeService, _storeContext, _settingContext, _addressAttributeFormatter, _catalogSettings, _currencySettings, _measureSettings, _pdfSettings, _taxSettings, _addressSettings); + _pdfService.PrintProductsToPdf(stream, products); + + } + #endregion + } + + +} \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Customers/CustomerRegistrationService.cs b/src/Libraries/Nop.Services/Customers/CustomerRegistrationService.cs index 3d4cdec7c34..62c13f88f25 100644 --- a/src/Libraries/Nop.Services/Customers/CustomerRegistrationService.cs +++ b/src/Libraries/Nop.Services/Customers/CustomerRegistrationService.cs @@ -1,465 +1,465 @@ -using System; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Customers; -using Nop.Services.Common; -using Nop.Services.Events; -using Nop.Services.Localization; -using Nop.Services.Messages; -using Nop.Services.Orders; -using Nop.Services.Security; -using Nop.Services.Stores; - -namespace Nop.Services.Customers -{ - /// - /// Customer registration service - /// - public partial class CustomerRegistrationService : ICustomerRegistrationService - { - #region Fields - - private readonly ICustomerService _customerService; - private readonly IEncryptionService _encryptionService; - private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService; - private readonly ILocalizationService _localizationService; - private readonly IStoreService _storeService; - private readonly IRewardPointService _rewardPointService; - private readonly IGenericAttributeService _genericAttributeService; - private readonly IWorkContext _workContext; - private readonly IWorkflowMessageService _workflowMessageService; - private readonly IEventPublisher _eventPublisher; - private readonly RewardPointsSettings _rewardPointsSettings; - private readonly CustomerSettings _customerSettings; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Customer service - /// Encryption service - /// Newsletter subscription service - /// Localization service - /// Store service - /// Reward points service - /// Generic attribute service - /// Work context - /// Workflow message service - /// Event publisher - /// Reward points settings - /// Customer settings - public CustomerRegistrationService(ICustomerService customerService, - IEncryptionService encryptionService, - INewsLetterSubscriptionService newsLetterSubscriptionService, - ILocalizationService localizationService, - IStoreService storeService, - IRewardPointService rewardPointService, - IWorkContext workContext, - IGenericAttributeService genericAttributeService, - IWorkflowMessageService workflowMessageService, - IEventPublisher eventPublisher, - RewardPointsSettings rewardPointsSettings, - CustomerSettings customerSettings) - { - this._customerService = customerService; - this._encryptionService = encryptionService; - this._newsLetterSubscriptionService = newsLetterSubscriptionService; - this._localizationService = localizationService; - this._storeService = storeService; - this._rewardPointService = rewardPointService; - this._genericAttributeService = genericAttributeService; - this._workContext = workContext; - this._workflowMessageService = workflowMessageService; - this._eventPublisher = eventPublisher; - this._rewardPointsSettings = rewardPointsSettings; - this._customerSettings = customerSettings; - } - - #endregion - - #region Utilities - - /// - /// Check whether the entered password matches with saved one - /// - /// Customer password - /// The entered password - /// True if passwords match; otherwise false - protected bool PasswordsMatch(CustomerPassword customerPassword, string enteredPassword) - { - if (customerPassword == null || string.IsNullOrEmpty(enteredPassword)) - return false; - - var savedPassword = string.Empty; - switch (customerPassword.PasswordFormat) - { - case PasswordFormat.Clear: - savedPassword = enteredPassword; - break; - case PasswordFormat.Encrypted: - savedPassword = _encryptionService.EncryptText(enteredPassword); - break; - case PasswordFormat.Hashed: - savedPassword = _encryptionService.CreatePasswordHash(enteredPassword, customerPassword.PasswordSalt, _customerSettings.HashedPasswordFormat); - break; - } - - return customerPassword.Password.Equals(savedPassword); - } - - #endregion - - #region Methods - - /// - /// Validate customer - /// - /// Username or email - /// Password - /// Result - public virtual CustomerLoginResults ValidateCustomer(string usernameOrEmail, string password) - { - var customer = _customerSettings.UsernamesEnabled ? - _customerService.GetCustomerByUsername(usernameOrEmail) : - _customerService.GetCustomerByEmail(usernameOrEmail); - - if (customer == null) - return CustomerLoginResults.CustomerNotExist; - if (customer.Deleted) - return CustomerLoginResults.Deleted; - if (!customer.Active) - return CustomerLoginResults.NotActive; - //only registered can login - if (!customer.IsRegistered()) - return CustomerLoginResults.NotRegistered; - //check whether a customer is locked out - if (customer.CannotLoginUntilDateUtc.HasValue && customer.CannotLoginUntilDateUtc.Value > DateTime.UtcNow) - return CustomerLoginResults.LockedOut; - - if (!PasswordsMatch(_customerService.GetCurrentPassword(customer.Id), password)) - { - //wrong password - customer.FailedLoginAttempts++; - if (_customerSettings.FailedPasswordAllowedAttempts > 0 && - customer.FailedLoginAttempts >= _customerSettings.FailedPasswordAllowedAttempts) - { - //lock out - customer.CannotLoginUntilDateUtc = DateTime.UtcNow.AddMinutes(_customerSettings.FailedPasswordLockoutMinutes); - //reset the counter - customer.FailedLoginAttempts = 0; - } - _customerService.UpdateCustomer(customer); - - return CustomerLoginResults.WrongPassword; - } - - //update login details - customer.FailedLoginAttempts = 0; - customer.CannotLoginUntilDateUtc = null; - customer.RequireReLogin = false; - customer.LastLoginDateUtc = DateTime.UtcNow; - _customerService.UpdateCustomer(customer); - - return CustomerLoginResults.Successful; - } - - /// - /// Register customer - /// - /// Request - /// Result - public virtual CustomerRegistrationResult RegisterCustomer(CustomerRegistrationRequest request) - { - if (request == null) - throw new ArgumentNullException("request"); - - if (request.Customer == null) - throw new ArgumentException("Can't load current customer"); - - var result = new CustomerRegistrationResult(); - if (request.Customer.IsSearchEngineAccount()) - { - result.AddError("Search engine can't be registered"); - return result; - } - if (request.Customer.IsBackgroundTaskAccount()) - { - result.AddError("Background task account can't be registered"); - return result; - } - if (request.Customer.IsRegistered()) - { - result.AddError("Current customer is already registered"); - return result; - } - if (String.IsNullOrEmpty(request.Email)) - { - result.AddError(_localizationService.GetResource("Account.Register.Errors.EmailIsNotProvided")); - return result; - } - if (!CommonHelper.IsValidEmail(request.Email)) - { - result.AddError(_localizationService.GetResource("Common.WrongEmail")); - return result; - } - if (String.IsNullOrWhiteSpace(request.Password)) - { - result.AddError(_localizationService.GetResource("Account.Register.Errors.PasswordIsNotProvided")); - return result; - } - if (_customerSettings.UsernamesEnabled) - { - if (String.IsNullOrEmpty(request.Username)) - { - result.AddError(_localizationService.GetResource("Account.Register.Errors.UsernameIsNotProvided")); - return result; - } - } - - //validate unique user - if (_customerService.GetCustomerByEmail(request.Email) != null) - { - result.AddError(_localizationService.GetResource("Account.Register.Errors.EmailAlreadyExists")); - return result; - } - if (_customerSettings.UsernamesEnabled) - { - if (_customerService.GetCustomerByUsername(request.Username) != null) - { - result.AddError(_localizationService.GetResource("Account.Register.Errors.UsernameAlreadyExists")); - return result; - } - } - - //at this point request is valid - request.Customer.Username = request.Username; - request.Customer.Email = request.Email; - - var customerPassword = new CustomerPassword - { - Customer = request.Customer, - PasswordFormat = request.PasswordFormat, - CreatedOnUtc = DateTime.UtcNow - }; - switch (request.PasswordFormat) - { - case PasswordFormat.Clear: - customerPassword.Password = request.Password; - break; - case PasswordFormat.Encrypted: - customerPassword.Password = _encryptionService.EncryptText(request.Password); - break; - case PasswordFormat.Hashed: - { - var saltKey = _encryptionService.CreateSaltKey(5); - customerPassword.PasswordSalt = saltKey; - customerPassword.Password = _encryptionService.CreatePasswordHash(request.Password, saltKey, _customerSettings.HashedPasswordFormat); - } - break; - } - _customerService.InsertCustomerPassword(customerPassword); - - request.Customer.Active = request.IsApproved; - - //add to 'Registered' role - var registeredRole = _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered); - if (registeredRole == null) - throw new NopException("'Registered' role could not be loaded"); - request.Customer.CustomerRoles.Add(registeredRole); - //remove from 'Guests' role - var guestRole = request.Customer.CustomerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Guests); - if (guestRole != null) - request.Customer.CustomerRoles.Remove(guestRole); - - //Add reward points for customer registration (if enabled) - if (_rewardPointsSettings.Enabled && - _rewardPointsSettings.PointsForRegistration > 0) - { - _rewardPointService.AddRewardPointsHistoryEntry(request.Customer, - _rewardPointsSettings.PointsForRegistration, - request.StoreId, - _localizationService.GetResource("RewardPoints.Message.EarnedForRegistration")); - } - - _customerService.UpdateCustomer(request.Customer); - - //publish event - _eventPublisher.Publish(new CustomerPasswordChangedEvent(customerPassword)); - - return result; - } - - /// - /// Change password - /// - /// Request - /// Result - public virtual ChangePasswordResult ChangePassword(ChangePasswordRequest request) - { - if (request == null) - throw new ArgumentNullException("request"); - - var result = new ChangePasswordResult(); - if (String.IsNullOrWhiteSpace(request.Email)) - { - result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.EmailIsNotProvided")); - return result; - } - if (String.IsNullOrWhiteSpace(request.NewPassword)) - { - result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.PasswordIsNotProvided")); - return result; - } - - var customer = _customerService.GetCustomerByEmail(request.Email); - if (customer == null) - { - result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.EmailNotFound")); - return result; - } - - if (request.ValidateRequest) - { - //request isn't valid - if (!PasswordsMatch(_customerService.GetCurrentPassword(customer.Id), request.OldPassword)) - { - result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.OldPasswordDoesntMatch")); - return result; - } - } - - //check for duplicates - if (_customerSettings.UnduplicatedPasswordsNumber > 0) - { - //get some of previous passwords - var previousPasswords = _customerService.GetCustomerPasswords(customer.Id, passwordsToReturn: _customerSettings.UnduplicatedPasswordsNumber); - - var newPasswordMatchesWithPrevious = previousPasswords.Any(password => PasswordsMatch(password, request.NewPassword)); - if (newPasswordMatchesWithPrevious) - { - result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.PasswordMatchesWithPrevious")); - return result; - } - } - - //at this point request is valid - var customerPassword = new CustomerPassword - { - Customer = customer, - PasswordFormat = request.NewPasswordFormat, - CreatedOnUtc = DateTime.UtcNow - }; - switch (request.NewPasswordFormat) - { - case PasswordFormat.Clear: - customerPassword.Password = request.NewPassword; - break; - case PasswordFormat.Encrypted: - customerPassword.Password = _encryptionService.EncryptText(request.NewPassword); - break; - case PasswordFormat.Hashed: - { - var saltKey = _encryptionService.CreateSaltKey(5); - customerPassword.PasswordSalt = saltKey; - customerPassword.Password = _encryptionService.CreatePasswordHash(request.NewPassword, saltKey, _customerSettings.HashedPasswordFormat); - } - break; - } - _customerService.InsertCustomerPassword(customerPassword); - - //publish event - _eventPublisher.Publish(new CustomerPasswordChangedEvent(customerPassword)); - - return result; - } - - /// - /// Sets a user email - /// - /// Customer - /// New email - /// Require validation of new email address - public virtual void SetEmail(Customer customer, string newEmail, bool requireValidation) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - if (newEmail == null) - throw new NopException("Email cannot be null"); - - newEmail = newEmail.Trim(); - string oldEmail = customer.Email; - - if (!CommonHelper.IsValidEmail(newEmail)) - throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.NewEmailIsNotValid")); - - if (newEmail.Length > 100) - throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.EmailTooLong")); - - var customer2 = _customerService.GetCustomerByEmail(newEmail); - if (customer2 != null && customer.Id != customer2.Id) - throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.EmailAlreadyExists")); - - if (requireValidation) - { - //re-validate email - customer.EmailToRevalidate = newEmail; - _customerService.UpdateCustomer(customer); - - //email re-validation message - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.EmailRevalidationToken, Guid.NewGuid().ToString()); - _workflowMessageService.SendCustomerEmailRevalidationMessage(customer, _workContext.WorkingLanguage.Id); - } - else - { - customer.Email = newEmail; - _customerService.UpdateCustomer(customer); - - //update newsletter subscription (if required) - if (!String.IsNullOrEmpty(oldEmail) && !oldEmail.Equals(newEmail, StringComparison.InvariantCultureIgnoreCase)) - { - foreach (var store in _storeService.GetAllStores()) - { - var subscriptionOld = _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreId(oldEmail, store.Id); - if (subscriptionOld != null) - { - subscriptionOld.Email = newEmail; - _newsLetterSubscriptionService.UpdateNewsLetterSubscription(subscriptionOld); - } - } - } - } - } - - /// - /// Sets a customer username - /// - /// Customer - /// New Username - public virtual void SetUsername(Customer customer, string newUsername) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - if (!_customerSettings.UsernamesEnabled) - throw new NopException("Usernames are disabled"); - - newUsername = newUsername.Trim(); - - if (newUsername.Length > 100) - throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.UsernameTooLong")); - - var user2 = _customerService.GetCustomerByUsername(newUsername); - if (user2 != null && customer.Id != user2.Id) - throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.UsernameAlreadyExists")); - - customer.Username = newUsername; - _customerService.UpdateCustomer(customer); - } - - #endregion - } +using System; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Customers; +using Nop.Services.Common; +using Nop.Services.Events; +using Nop.Services.Localization; +using Nop.Services.Messages; +using Nop.Services.Orders; +using Nop.Services.Security; +using Nop.Services.Stores; + +namespace Nop.Services.Customers +{ + /// + /// Customer registration service + /// + public partial class CustomerRegistrationService : ICustomerRegistrationService + { + #region Fields + + private readonly ICustomerService _customerService; + private readonly IEncryptionService _encryptionService; + private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService; + private readonly ILocalizationService _localizationService; + private readonly IStoreService _storeService; + private readonly IRewardPointService _rewardPointService; + private readonly IGenericAttributeService _genericAttributeService; + private readonly IWorkContext _workContext; + private readonly IWorkflowMessageService _workflowMessageService; + private readonly IEventPublisher _eventPublisher; + private readonly RewardPointsSettings _rewardPointsSettings; + private readonly CustomerSettings _customerSettings; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Customer service + /// Encryption service + /// Newsletter subscription service + /// Localization service + /// Store service + /// Reward points service + /// Generic attribute service + /// Work context + /// Workflow message service + /// Event publisher + /// Reward points settings + /// Customer settings + public CustomerRegistrationService(ICustomerService customerService, + IEncryptionService encryptionService, + INewsLetterSubscriptionService newsLetterSubscriptionService, + ILocalizationService localizationService, + IStoreService storeService, + IRewardPointService rewardPointService, + IWorkContext workContext, + IGenericAttributeService genericAttributeService, + IWorkflowMessageService workflowMessageService, + IEventPublisher eventPublisher, + RewardPointsSettings rewardPointsSettings, + CustomerSettings customerSettings) + { + this._customerService = customerService; + this._encryptionService = encryptionService; + this._newsLetterSubscriptionService = newsLetterSubscriptionService; + this._localizationService = localizationService; + this._storeService = storeService; + this._rewardPointService = rewardPointService; + this._genericAttributeService = genericAttributeService; + this._workContext = workContext; + this._workflowMessageService = workflowMessageService; + this._eventPublisher = eventPublisher; + this._rewardPointsSettings = rewardPointsSettings; + this._customerSettings = customerSettings; + } + + #endregion + + #region Utilities + + /// + /// Check whether the entered password matches with saved one + /// + /// Customer password + /// The entered password + /// True if passwords match; otherwise false + protected bool PasswordsMatch(CustomerPassword customerPassword, string enteredPassword) + { + if (customerPassword == null || string.IsNullOrEmpty(enteredPassword)) + return false; + + var savedPassword = string.Empty; + switch (customerPassword.PasswordFormat) + { + case PasswordFormat.Clear: + savedPassword = enteredPassword; + break; + case PasswordFormat.Encrypted: + savedPassword = _encryptionService.EncryptText(enteredPassword); + break; + case PasswordFormat.Hashed: + savedPassword = _encryptionService.CreatePasswordHash(enteredPassword, customerPassword.PasswordSalt, _customerSettings.HashedPasswordFormat); + break; + } + + return customerPassword.Password.Equals(savedPassword); + } + + #endregion + + #region Methods + + /// + /// Validate customer + /// + /// Username or email + /// Password + /// Result + public virtual CustomerLoginResults ValidateCustomer(string usernameOrEmail, string password) + { + var customer = _customerSettings.UsernamesEnabled ? + _customerService.GetCustomerByUsername(usernameOrEmail) : + _customerService.GetCustomerByEmail(usernameOrEmail); + + if (customer == null) + return CustomerLoginResults.CustomerNotExist; + if (customer.Deleted) + return CustomerLoginResults.Deleted; + if (!customer.Active) + return CustomerLoginResults.NotActive; + //only registered can login + if (!customer.IsRegistered()) + return CustomerLoginResults.NotRegistered; + //check whether a customer is locked out + if (customer.CannotLoginUntilDateUtc.HasValue && customer.CannotLoginUntilDateUtc.Value > DateTime.UtcNow) + return CustomerLoginResults.LockedOut; + + if (!PasswordsMatch(_customerService.GetCurrentPassword(customer.Id), password)) + { + //wrong password + customer.FailedLoginAttempts++; + if (_customerSettings.FailedPasswordAllowedAttempts > 0 && + customer.FailedLoginAttempts >= _customerSettings.FailedPasswordAllowedAttempts) + { + //lock out + customer.CannotLoginUntilDateUtc = DateTime.UtcNow.AddMinutes(_customerSettings.FailedPasswordLockoutMinutes); + //reset the counter + customer.FailedLoginAttempts = 0; + } + _customerService.UpdateCustomer(customer); + + return CustomerLoginResults.WrongPassword; + } + + //update login details + customer.FailedLoginAttempts = 0; + customer.CannotLoginUntilDateUtc = null; + customer.RequireReLogin = false; + customer.LastLoginDateUtc = DateTime.UtcNow; + _customerService.UpdateCustomer(customer); + + return CustomerLoginResults.Successful; + } + + /// + /// Register customer + /// + /// Request + /// Result + public virtual CustomerRegistrationResult RegisterCustomer(CustomerRegistrationRequest request) + { + if (request == null) + throw new ArgumentNullException("request"); + + if (request.Customer == null) + throw new ArgumentException("Can't load current customer"); + + var result = new CustomerRegistrationResult(); + if (request.Customer.IsSearchEngineAccount()) + { + result.AddError("Search engine can't be registered"); + return result; + } + if (request.Customer.IsBackgroundTaskAccount()) + { + result.AddError("Background task account can't be registered"); + return result; + } + if (request.Customer.IsRegistered()) + { + result.AddError("Current customer is already registered"); + return result; + } + if (String.IsNullOrEmpty(request.Email)) + { + result.AddError(_localizationService.GetResource("Account.Register.Errors.EmailIsNotProvided")); + return result; + } + if (!CommonHelper.IsValidEmail(request.Email)) + { + result.AddError(_localizationService.GetResource("Common.WrongEmail")); + return result; + } + if (String.IsNullOrWhiteSpace(request.Password)) + { + result.AddError(_localizationService.GetResource("Account.Register.Errors.PasswordIsNotProvided")); + return result; + } + if (_customerSettings.UsernamesEnabled) + { + if (String.IsNullOrEmpty(request.Username)) + { + result.AddError(_localizationService.GetResource("Account.Register.Errors.UsernameIsNotProvided")); + return result; + } + } + + //validate unique user + if (_customerService.GetCustomerByEmail(request.Email) != null) + { + result.AddError(_localizationService.GetResource("Account.Register.Errors.EmailAlreadyExists")); + return result; + } + if (_customerSettings.UsernamesEnabled) + { + if (_customerService.GetCustomerByUsername(request.Username) != null) + { + result.AddError(_localizationService.GetResource("Account.Register.Errors.UsernameAlreadyExists")); + return result; + } + } + + //at this point request is valid + request.Customer.Username = request.Username; + request.Customer.Email = request.Email; + + var customerPassword = new CustomerPassword + { + Customer = request.Customer, + PasswordFormat = request.PasswordFormat, + CreatedOnUtc = DateTime.UtcNow + }; + switch (request.PasswordFormat) + { + case PasswordFormat.Clear: + customerPassword.Password = request.Password; + break; + case PasswordFormat.Encrypted: + customerPassword.Password = _encryptionService.EncryptText(request.Password); + break; + case PasswordFormat.Hashed: + { + var saltKey = _encryptionService.CreateSaltKey(5); + customerPassword.PasswordSalt = saltKey; + customerPassword.Password = _encryptionService.CreatePasswordHash(request.Password, saltKey, _customerSettings.HashedPasswordFormat); + } + break; + } + _customerService.InsertCustomerPassword(customerPassword); + + request.Customer.Active = request.IsApproved; + + //add to 'Registered' role + var registeredRole = _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered); + if (registeredRole == null) + throw new NopException("'Registered' role could not be loaded"); + request.Customer.CustomerRoles.Add(registeredRole); + //remove from 'Guests' role + var guestRole = request.Customer.CustomerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Guests); + if (guestRole != null) + request.Customer.CustomerRoles.Remove(guestRole); + + //Add reward points for customer registration (if enabled) + if (_rewardPointsSettings.Enabled && + _rewardPointsSettings.PointsForRegistration > 0) + { + _rewardPointService.AddRewardPointsHistoryEntry(request.Customer, + new RewardPoints(_rewardPointService) { Points = _rewardPointsSettings.PointsForRegistration }, + request.StoreId, + _localizationService.GetResource("RewardPoints.Message.EarnedForRegistration")); + } + + _customerService.UpdateCustomer(request.Customer); + + //publish event + _eventPublisher.Publish(new CustomerPasswordChangedEvent(customerPassword)); + + return result; + } + + /// + /// Change password + /// + /// Request + /// Result + public virtual ChangePasswordResult ChangePassword(ChangePasswordRequest request) + { + if (request == null) + throw new ArgumentNullException("request"); + + var result = new ChangePasswordResult(); + if (String.IsNullOrWhiteSpace(request.Email)) + { + result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.EmailIsNotProvided")); + return result; + } + if (String.IsNullOrWhiteSpace(request.NewPassword)) + { + result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.PasswordIsNotProvided")); + return result; + } + + var customer = _customerService.GetCustomerByEmail(request.Email); + if (customer == null) + { + result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.EmailNotFound")); + return result; + } + + if (request.ValidateRequest) + { + //request isn't valid + if (!PasswordsMatch(_customerService.GetCurrentPassword(customer.Id), request.OldPassword)) + { + result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.OldPasswordDoesntMatch")); + return result; + } + } + + //check for duplicates + if (_customerSettings.UnduplicatedPasswordsNumber > 0) + { + //get some of previous passwords + var previousPasswords = _customerService.GetCustomerPasswords(customer.Id, passwordsToReturn: _customerSettings.UnduplicatedPasswordsNumber); + + var newPasswordMatchesWithPrevious = previousPasswords.Any(password => PasswordsMatch(password, request.NewPassword)); + if (newPasswordMatchesWithPrevious) + { + result.AddError(_localizationService.GetResource("Account.ChangePassword.Errors.PasswordMatchesWithPrevious")); + return result; + } + } + + //at this point request is valid + var customerPassword = new CustomerPassword + { + Customer = customer, + PasswordFormat = request.NewPasswordFormat, + CreatedOnUtc = DateTime.UtcNow + }; + switch (request.NewPasswordFormat) + { + case PasswordFormat.Clear: + customerPassword.Password = request.NewPassword; + break; + case PasswordFormat.Encrypted: + customerPassword.Password = _encryptionService.EncryptText(request.NewPassword); + break; + case PasswordFormat.Hashed: + { + var saltKey = _encryptionService.CreateSaltKey(5); + customerPassword.PasswordSalt = saltKey; + customerPassword.Password = _encryptionService.CreatePasswordHash(request.NewPassword, saltKey, _customerSettings.HashedPasswordFormat); + } + break; + } + _customerService.InsertCustomerPassword(customerPassword); + + //publish event + _eventPublisher.Publish(new CustomerPasswordChangedEvent(customerPassword)); + + return result; + } + + /// + /// Sets a user email + /// + /// Customer + /// New email + /// Require validation of new email address + public virtual void SetEmail(Customer customer, string newEmail, bool requireValidation) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + if (newEmail == null) + throw new NopException("Email cannot be null"); + + newEmail = newEmail.Trim(); + string oldEmail = customer.Email; + + if (!CommonHelper.IsValidEmail(newEmail)) + throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.NewEmailIsNotValid")); + + if (newEmail.Length > 100) + throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.EmailTooLong")); + + var customer2 = _customerService.GetCustomerByEmail(newEmail); + if (customer2 != null && customer.Id != customer2.Id) + throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.EmailAlreadyExists")); + + if (requireValidation) + { + //re-validate email + customer.EmailToRevalidate = newEmail; + _customerService.UpdateCustomer(customer); + + //email re-validation message + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.EmailRevalidationToken, Guid.NewGuid().ToString()); + _workflowMessageService.SendCustomerEmailRevalidationMessage(customer, _workContext.WorkingLanguage.Id); + } + else + { + customer.Email = newEmail; + _customerService.UpdateCustomer(customer); + + //update newsletter subscription (if required) + if (!String.IsNullOrEmpty(oldEmail) && !oldEmail.Equals(newEmail, StringComparison.InvariantCultureIgnoreCase)) + { + foreach (var store in _storeService.GetAllStores()) + { + var subscriptionOld = _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreId(oldEmail, store.Id); + if (subscriptionOld != null) + { + subscriptionOld.Email = newEmail; + _newsLetterSubscriptionService.UpdateNewsLetterSubscription(subscriptionOld); + } + } + } + } + } + + /// + /// Sets a customer username + /// + /// Customer + /// New Username + public virtual void SetUsername(Customer customer, string newUsername) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + if (!_customerSettings.UsernamesEnabled) + throw new NopException("Usernames are disabled"); + + newUsername = newUsername.Trim(); + + if (newUsername.Length > 100) + throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.UsernameTooLong")); + + var user2 = _customerService.GetCustomerByUsername(newUsername); + if (user2 != null && customer.Id != user2.Id) + throw new NopException(_localizationService.GetResource("Account.EmailUsernameErrors.UsernameAlreadyExists")); + + customer.Username = newUsername; + _customerService.UpdateCustomer(customer); + } + + #endregion + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Discounts/DiscountService.cs b/src/Libraries/Nop.Services/Discounts/DiscountService.cs index 5b6bb0f809f..16d908afc83 100644 --- a/src/Libraries/Nop.Services/Discounts/DiscountService.cs +++ b/src/Libraries/Nop.Services/Discounts/DiscountService.cs @@ -1,726 +1,733 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Data; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Orders; -using Nop.Core.Plugins; -using Nop.Services.Catalog; -using Nop.Services.Customers; -using Nop.Services.Discounts.Cache; -using Nop.Services.Events; -using Nop.Services.Localization; -using Nop.Services.Orders; - -namespace Nop.Services.Discounts -{ - /// - /// Discount service - /// - public partial class DiscountService : IDiscountService - { - #region Fields - - private readonly IRepository _discountRepository; - private readonly IRepository _discountRequirementRepository; - private readonly IRepository _discountUsageHistoryRepository; - private readonly ICacheManager _cacheManager; - private readonly IStoreContext _storeContext; - private readonly ILocalizationService _localizationService; - private readonly ICategoryService _categoryService; - private readonly IPluginFinder _pluginFinder; - private readonly IEventPublisher _eventPublisher; - private readonly IWorkContext _workContext; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Cache manager - /// Discount repository - /// Discount requirement repository - /// Discount usage history repository - /// Store context - /// Localization service - /// Category service - /// Plugin finder - /// Event published - /// work context - public DiscountService(ICacheManager cacheManager, - IRepository discountRepository, - IRepository discountRequirementRepository, - IRepository discountUsageHistoryRepository, - IStoreContext storeContext, - ILocalizationService localizationService, - ICategoryService categoryService, - IPluginFinder pluginFinder, - IEventPublisher eventPublisher, - IWorkContext workContext) - { - this._cacheManager = cacheManager; - this._discountRepository = discountRepository; - this._discountRequirementRepository = discountRequirementRepository; - this._discountUsageHistoryRepository = discountUsageHistoryRepository; - this._storeContext = storeContext; - this._localizationService = localizationService; - this._categoryService = categoryService; - this._pluginFinder = pluginFinder; - this._eventPublisher = eventPublisher; - this._workContext = workContext; - } - - #endregion - - #region Nested classes - - [Serializable] - public class DiscountRequirementForCaching - { - public DiscountRequirementForCaching() - { - ChildRequirements = new List(); - } - - public int Id { get; set; } - public string SystemName { get; set; } - public bool IsGroup { get; set; } - public RequirementGroupInteractionType? InteractionType { get; set; } - public IList ChildRequirements { get; set; } - } - - #endregion - - #region Utilities - - /// - /// Get requirements for caching - /// - /// Collection of discount requirement - /// List of DiscountRequirementForCaching - protected IList GetReqirementsForCaching(IEnumerable requirements) - { - var requirementForCaching = requirements.Select(requirement => new DiscountRequirementForCaching - { - Id = requirement.Id, - IsGroup = requirement.IsGroup, - SystemName = requirement.DiscountRequirementRuleSystemName, - InteractionType = requirement.InteractionType, - ChildRequirements = GetReqirementsForCaching(requirement.ChildRequirements) - }); - - return requirementForCaching.ToList(); - } - - /// - /// Get discount validation result - /// - /// Collection of discount requirement - /// Interaction type within the group of requirements - /// Customer - /// Errors - /// True if result is valid; otherwise false - protected bool GetValidationResult(IEnumerable requirements, - RequirementGroupInteractionType groupInteractionType, Customer customer, List errors) - { - var result = false; - - foreach (var requirement in requirements) - { - if (requirement.IsGroup) - { - //get child requirements for the group - var interactionType = requirement.InteractionType.HasValue - ? requirement.InteractionType.Value : RequirementGroupInteractionType.And; - result = GetValidationResult(requirement.ChildRequirements, interactionType, customer, errors); - } - else - { - //or try to get validation result for the requirement - var requirementRulePlugin = LoadDiscountRequirementRuleBySystemName(requirement.SystemName); - if (requirementRulePlugin == null) - continue; - - if (!_pluginFinder.AuthorizedForUser(requirementRulePlugin.PluginDescriptor, customer)) - continue; - - if (!_pluginFinder.AuthenticateStore(requirementRulePlugin.PluginDescriptor, _storeContext.CurrentStore.Id)) - continue; - - var ruleResult = requirementRulePlugin.CheckRequirement(new DiscountRequirementValidationRequest - { - DiscountRequirementId = requirement.Id, - Customer = customer, - Store = _storeContext.CurrentStore - }); - - //add validation error - if (!ruleResult.IsValid) - errors.Add(ruleResult.UserError); - - result = ruleResult.IsValid; - } - - //all requirements must be met, so return false - if (!result && groupInteractionType == RequirementGroupInteractionType.And) - return result; - - //any of requirements must be met, so return true - if (result && groupInteractionType == RequirementGroupInteractionType.Or) - return result; - } - - return result; - } - - #endregion - - #region Methods - - #region Discounts - - /// - /// Delete discount - /// - /// Discount - public virtual void DeleteDiscount(Discount discount) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - _discountRepository.Delete(discount); - - //event notification - _eventPublisher.EntityDeleted(discount); - } - - /// - /// Gets a discount - /// - /// Discount identifier - /// Discount - public virtual Discount GetDiscountById(int discountId) - { - if (discountId == 0) - return null; - - return _discountRepository.GetById(discountId); - } - - /// - /// Gets all discounts - /// - /// Discount type; null to load all discount - /// Coupon code to find (exact match) - /// Discount name - /// A value indicating whether to show hidden records - /// Discounts - public virtual IList GetAllDiscounts(DiscountType? discountType = null, - string couponCode = "", string discountName = "", bool showHidden = false) - { - var query = _discountRepository.Table; - if (!showHidden) - { - //The function 'CurrentUtcDateTime' is not supported by SQL Server Compact. - //That's why we pass the date value - var nowUtc = DateTime.UtcNow; - query = query.Where(d => - (!d.StartDateUtc.HasValue || d.StartDateUtc <= nowUtc) - && (!d.EndDateUtc.HasValue || d.EndDateUtc >= nowUtc)); - } - if (!String.IsNullOrEmpty(couponCode)) - { - query = query.Where(d => d.CouponCode == couponCode); - } - if (!String.IsNullOrEmpty(discountName)) - { - query = query.Where(d => d.Name.Contains(discountName)); - } - if (discountType.HasValue) - { - int discountTypeId = (int) discountType.Value; - query = query.Where(d => d.DiscountTypeId == discountTypeId); - } - - query = query.OrderBy(d => d.Name); - - var discounts = query.ToList(); - return discounts; - } - - /// - /// Inserts a discount - /// - /// Discount - public virtual void InsertDiscount(Discount discount) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - _discountRepository.Insert(discount); - - //event notification - _eventPublisher.EntityInserted(discount); - } - - /// - /// Updates the discount - /// - /// Discount - public virtual void UpdateDiscount(Discount discount) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - _discountRepository.Update(discount); - - //event notification - _eventPublisher.EntityUpdated(discount); - } - - #endregion - - #region Discounts (caching) - - /// - /// Gets all discounts (cachable models) - /// - /// Discount type; null to load all discount - /// Coupon code to find (exact match) - /// Discount name - /// A value indicating whether to show hidden records - /// Discounts - public virtual IList GetAllDiscountsForCaching(DiscountType? discountType = null, - string couponCode = "", string discountName = "", bool showHidden = false) - { - //we cache discounts between requests. Otherwise, they will be loaded for almost each HTTP request - //we have to use the following workaround with cachable model (DiscountForCaching) because - //Entity Framework doesn't support 2-level caching - - //we load all discounts, and filter them using "discountType" parameter later (in memory) - //we do it because we know that this method is invoked several times per HTTP request with distinct "discountType" parameter - //that's why let's access the database only once - string key = string.Format(DiscountEventConsumer.DISCOUNT_ALL_KEY, showHidden, couponCode, discountName); - var result = _cacheManager.Get(key, () => - { - var discounts = GetAllDiscounts(null, couponCode, discountName, showHidden); - return discounts.Select(d => d.MapDiscount()).ToList(); - }); - //we know that this method is usually inkoved multiple times - //that's why we filter discounts by type on the application layer - if (discountType.HasValue) - { - result = result.Where(d => d.DiscountType == discountType.Value).ToList(); - } - return result; - } - - /// - /// Get category identifiers to which a discount is applied - /// - /// Discount - /// Customer - /// Category identifiers - public virtual IList GetAppliedCategoryIds(DiscountForCaching discount, Customer customer) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - var discountId = discount.Id; - var cacheKey = string.Format(DiscountEventConsumer.DISCOUNT_CATEGORY_IDS_MODEL_KEY, - discountId, - string.Join(",", customer.GetCustomerRoleIds()), - _storeContext.CurrentStore.Id); - var result = _cacheManager.Get(cacheKey, () => - { - var ids = new List(); - var rootCategoryIds = _discountRepository.Table.Where(x => x.Id == discountId) - .SelectMany(x => x.AppliedToCategories.Select(c => c.Id)) - .ToList(); - foreach (var categoryId in rootCategoryIds) - { - if (!ids.Contains(categoryId)) - ids.Add(categoryId); - if (discount.AppliedToSubCategories) - { - //include subcategories - foreach (var childCategoryId in _categoryService - .GetAllCategoriesByParentCategoryId(categoryId, false, true) - .Select(x => x.Id)) - { - if (!ids.Contains(childCategoryId)) - ids.Add(childCategoryId); - } - } - } - return ids; - }); - - return result; - } - - /// - /// Get manufacturer identifiers to which a discount is applied - /// - /// Discount - /// Customer - /// Manufacturer identifiers - public virtual IList GetAppliedManufacturerIds(DiscountForCaching discount, Customer customer) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - var discountId = discount.Id; - var cacheKey = string.Format(DiscountEventConsumer.DISCOUNT_MANUFACTURER_IDS_MODEL_KEY, - discountId, - string.Join(",", customer.GetCustomerRoleIds()), - _storeContext.CurrentStore.Id); - var result = _cacheManager.Get(cacheKey, () => - { - return _discountRepository.Table.Where(x => x.Id == discountId) - .SelectMany(x => x.AppliedToManufacturers.Select(c => c.Id)) - .ToList(); - }); - - return result; - } - - #endregion - - #region Discount requirements - - /// - /// Get all discount requirements - /// - /// Discont identifier - /// Whether to load top-level requirements only (without parent identifier) - /// Requirements - public virtual IList GetAllDiscountRequirements(int discountId = 0, bool topLevelOnly = false) - { - var query = _discountRequirementRepository.Table; - - //filter by discount - if (discountId > 0) - query = query.Where(requirement => requirement.DiscountId == discountId); - - //filter by top-level - if (topLevelOnly) - query = query.Where(requirement => !requirement.ParentId.HasValue); - - query = query.OrderBy(requirement => requirement.Id); - - return query.ToList(); - } - - /// - /// Delete discount requirement - /// - /// Discount requirement - public virtual void DeleteDiscountRequirement(DiscountRequirement discountRequirement) - { - if (discountRequirement == null) - throw new ArgumentNullException("discountRequirement"); - - _discountRequirementRepository.Delete(discountRequirement); - - //event notification - _eventPublisher.EntityDeleted(discountRequirement); - } - - /// - /// Load discount requirement rule by system name - /// - /// System name - /// Found discount requirement rule - public virtual IDiscountRequirementRule LoadDiscountRequirementRuleBySystemName(string systemName) - { - var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); - if (descriptor != null) - return descriptor.Instance(); - - return null; - } - - /// - /// Load all discount requirement rules - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Discount requirement rules - public virtual IList LoadAllDiscountRequirementRules(Customer customer = null) - { - return _pluginFinder.GetPlugins(customer: customer).ToList(); - } - - #endregion - - #region Validation - - /// - /// Validate discount - /// - /// Discount - /// Customer - /// Discount validation result - public virtual DiscountValidationResult ValidateDiscount(Discount discount, Customer customer) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - return ValidateDiscount(discount.MapDiscount(), customer); - } - - /// - /// Validate discount - /// - /// Discount - /// Customer - /// Coupon codes to validate - /// Discount validation result - public virtual DiscountValidationResult ValidateDiscount(Discount discount, Customer customer, string[] couponCodesToValidate) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - return ValidateDiscount(discount.MapDiscount(), customer, couponCodesToValidate); - } - - /// - /// Validate discount - /// - /// Discount - /// Customer - /// Discount validation result - public virtual DiscountValidationResult ValidateDiscount(DiscountForCaching discount, Customer customer) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - if (customer == null) - throw new ArgumentNullException("customer"); - - string[] couponCodesToValidate = customer.ParseAppliedDiscountCouponCodes(); - return ValidateDiscount(discount, customer, couponCodesToValidate); - } - - /// - /// Validate discount - /// - /// Discount - /// Customer - /// Coupon codes to validate - /// Discount validation result - public virtual DiscountValidationResult ValidateDiscount(DiscountForCaching discount, Customer customer, string[] couponCodesToValidate) - { - if (discount == null) - throw new ArgumentNullException("discount"); - - if (customer == null) - throw new ArgumentNullException("customer"); - - //invalid by default - var result = new DiscountValidationResult(); - - //check coupon code - if (discount.RequiresCouponCode) - { - if (String.IsNullOrEmpty(discount.CouponCode)) - return result; - - if (couponCodesToValidate == null) - return result; - - if (!couponCodesToValidate.Any(x => x.Equals(discount.CouponCode, StringComparison.InvariantCultureIgnoreCase))) - return result; - } - - //Do not allow discounts applied to order subtotal or total when a customer has gift cards in the cart. - //Otherwise, this customer can purchase gift cards with discount and get more than paid ("free money"). - if (discount.DiscountType == DiscountType.AssignedToOrderSubTotal || - discount.DiscountType == DiscountType.AssignedToOrderTotal) - { - var cart = customer.ShoppingCartItems - .Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart) - .LimitPerStore(_storeContext.CurrentStore.Id) - .ToList(); - - var hasGiftCards = cart.Any(x => x.Product.IsGiftCard); - if (hasGiftCards) - { - result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.CannotBeUsedWithGiftCards") }; - return result; - } - } - - //check date range - DateTime now = DateTime.UtcNow; - if (discount.StartDateUtc.HasValue) - { - DateTime startDate = DateTime.SpecifyKind(discount.StartDateUtc.Value, DateTimeKind.Utc); - if (startDate.CompareTo(now) > 0) - { - result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.NotStartedYet") }; - return result; - } - } - if (discount.EndDateUtc.HasValue) - { - DateTime endDate = DateTime.SpecifyKind(discount.EndDateUtc.Value, DateTimeKind.Utc); - if (endDate.CompareTo(now) < 0) - { - result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.Expired") }; - return result; - } - } - - //discount limitation - switch (discount.DiscountLimitation) - { - case DiscountLimitationType.NTimesOnly: - { - var usedTimes = GetAllDiscountUsageHistory(discount.Id, null, null, 0, 1).TotalCount; - if (usedTimes >= discount.LimitationTimes) - return result; - } - break; - case DiscountLimitationType.NTimesPerCustomer: - { - if (customer.IsRegistered()) - { - var usedTimes = GetAllDiscountUsageHistory(discount.Id, customer.Id, null, 0, 1).TotalCount; - if (usedTimes >= discount.LimitationTimes) - { - result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.CannotBeUsedAnymore") }; - return result; - } - } - } - break; - case DiscountLimitationType.Unlimited: - default: - break; - } - - //discount requirements - string key = string.Format(DiscountEventConsumer.DISCOUNT_REQUIREMENT_MODEL_KEY, discount.Id); - var requirementsForCaching = _cacheManager.Get(key, () => - { - var requirements = GetAllDiscountRequirements(discount.Id, true); - return GetReqirementsForCaching(requirements); - }); - - //get top-level group - var topLevelGroup = requirementsForCaching.FirstOrDefault(); - if (topLevelGroup == null || (topLevelGroup.IsGroup && !topLevelGroup.ChildRequirements.Any()) || !topLevelGroup.InteractionType.HasValue) - { - //there are no requirements, so discount is valid - result.IsValid = true; - return result; - } - - //requirements are exist, let's check them - var errors = new List(); - result.IsValid = GetValidationResult(requirementsForCaching, topLevelGroup.InteractionType.Value, customer, errors); - - //set errors if result is not valid - if (!result.IsValid) - result.Errors = errors; - - return result; - } - - #endregion - - #region Discount usage history - - /// - /// Gets a discount usage history record - /// - /// Discount usage history record identifier - /// Discount usage history - public virtual DiscountUsageHistory GetDiscountUsageHistoryById(int discountUsageHistoryId) - { - if (discountUsageHistoryId == 0) - return null; - - return _discountUsageHistoryRepository.GetById(discountUsageHistoryId); - } - - /// - /// Gets all discount usage history records - /// - /// Discount identifier; null to load all records - /// Customer identifier; null to load all records - /// Order identifier; null to load all records - /// Page index - /// Page size - /// Discount usage history records - public virtual IPagedList GetAllDiscountUsageHistory(int? discountId = null, - int? customerId = null, int? orderId = null, - int pageIndex = 0, int pageSize = int.MaxValue) - { - var query = _discountUsageHistoryRepository.Table; - if (discountId.HasValue && discountId.Value > 0) - query = query.Where(duh => duh.DiscountId == discountId.Value); - if (customerId.HasValue && customerId.Value > 0) - query = query.Where(duh => duh.Order != null && duh.Order.CustomerId == customerId.Value); - if (orderId.HasValue && orderId.Value > 0) - query = query.Where(duh => duh.OrderId == orderId.Value); - query = query.OrderByDescending(c => c.CreatedOnUtc); - return new PagedList(query, pageIndex, pageSize); - } - - /// - /// Insert discount usage history record - /// - /// Discount usage history record - public virtual void InsertDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) - { - if (discountUsageHistory == null) - throw new ArgumentNullException("discountUsageHistory"); - - _discountUsageHistoryRepository.Insert(discountUsageHistory); - - //event notification - _eventPublisher.EntityInserted(discountUsageHistory); - } - - /// - /// Update discount usage history record - /// - /// Discount usage history record - public virtual void UpdateDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) - { - if (discountUsageHistory == null) - throw new ArgumentNullException("discountUsageHistory"); - - _discountUsageHistoryRepository.Update(discountUsageHistory); - - //event notification - _eventPublisher.EntityUpdated(discountUsageHistory); - } - - /// - /// Delete discount usage history record - /// - /// Discount usage history record - public virtual void DeleteDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) - { - if (discountUsageHistory == null) - throw new ArgumentNullException("discountUsageHistory"); - - _discountUsageHistoryRepository.Delete(discountUsageHistory); - - //event notification - _eventPublisher.EntityDeleted(discountUsageHistory); - } - - #endregion - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Data; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Orders; +using Nop.Core.Plugins; +using Nop.Services.Catalog; +using Nop.Services.Customers; +using Nop.Services.Discounts.Cache; +using Nop.Services.Events; +using Nop.Services.Localization; +using Nop.Services.Orders; + +namespace Nop.Services.Discounts +{ + /// + /// Discount service + /// + public partial class DiscountService : IDiscountService + { + #region Fields + + private readonly IRepository _discountRepository; + private readonly IRepository _discountRequirementRepository; + private readonly IRepository _discountUsageHistoryRepository; + private readonly ICacheManager _cacheManager; + private readonly IStoreContext _storeContext; + private readonly ILocalizationService _localizationService; + private readonly ICategoryService _categoryService; + private readonly IPluginFinder _pluginFinder; + private readonly IEventPublisher _eventPublisher; + private readonly IWorkContext _workContext; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Cache manager + /// Discount repository + /// Discount requirement repository + /// Discount usage history repository + /// Store context + /// Localization service + /// Category service + /// Plugin finder + /// Event published + /// work context + public DiscountService(ICacheManager cacheManager, + IRepository discountRepository, + IRepository discountRequirementRepository, + IRepository discountUsageHistoryRepository, + IStoreContext storeContext, + ILocalizationService localizationService, + ICategoryService categoryService, + IPluginFinder pluginFinder, + IEventPublisher eventPublisher, + IWorkContext workContext) + { + this._cacheManager = cacheManager; + this._discountRepository = discountRepository; + this._discountRequirementRepository = discountRequirementRepository; + this._discountUsageHistoryRepository = discountUsageHistoryRepository; + this._storeContext = storeContext; + this._localizationService = localizationService; + this._categoryService = categoryService; + this._pluginFinder = pluginFinder; + this._eventPublisher = eventPublisher; + this._workContext = workContext; + } + + #endregion + + #region Nested classes + + [Serializable] + public class DiscountRequirementForCaching + { + public DiscountRequirementForCaching() + { + ChildRequirements = new List(); + } + + public int Id { get; set; } + public string SystemName { get; set; } + public bool IsGroup { get; set; } + public RequirementGroupInteractionType? InteractionType { get; set; } + public IList ChildRequirements { get; set; } + } + + #endregion + + #region Utilities + + /// + /// Get requirements for caching + /// + /// Collection of discount requirement + /// List of DiscountRequirementForCaching + protected IList GetReqirementsForCaching(IEnumerable requirements) + { + var requirementForCaching = requirements.Select(requirement => new DiscountRequirementForCaching + { + Id = requirement.Id, + IsGroup = requirement.IsGroup, + SystemName = requirement.DiscountRequirementRuleSystemName, + InteractionType = requirement.InteractionType, + ChildRequirements = GetReqirementsForCaching(requirement.ChildRequirements) + }); + + return requirementForCaching.ToList(); + } + + /// + /// Get discount validation result + /// + /// Collection of discount requirement + /// Interaction type within the group of requirements + /// Customer + /// Errors + /// True if result is valid; otherwise false + protected bool GetValidationResult(IEnumerable requirements, + RequirementGroupInteractionType groupInteractionType, Customer customer, List errors) + { + var result = false; + + foreach (var requirement in requirements) + { + if (requirement.IsGroup) + { + //get child requirements for the group + var interactionType = requirement.InteractionType.HasValue + ? requirement.InteractionType.Value : RequirementGroupInteractionType.And; + result = GetValidationResult(requirement.ChildRequirements, interactionType, customer, errors); + } + else + { + //or try to get validation result for the requirement + var requirementRulePlugin = LoadDiscountRequirementRuleBySystemName(requirement.SystemName); + if (requirementRulePlugin == null) + continue; + + if (!_pluginFinder.AuthorizedForUser(requirementRulePlugin.PluginDescriptor, customer)) + continue; + + if (!_pluginFinder.AuthenticateStore(requirementRulePlugin.PluginDescriptor, _storeContext.CurrentStore.Id)) + continue; + + var ruleResult = requirementRulePlugin.CheckRequirement(new DiscountRequirementValidationRequest + { + DiscountRequirementId = requirement.Id, + Customer = customer, + Store = _storeContext.CurrentStore + }); + + //add validation error + if (!ruleResult.IsValid) + errors.Add(ruleResult.UserError); + + result = ruleResult.IsValid; + } + + //all requirements must be met, so return false + if (!result && groupInteractionType == RequirementGroupInteractionType.And) + return result; + + //any of requirements must be met, so return true + if (result && groupInteractionType == RequirementGroupInteractionType.Or) + return result; + } + + return result; + } + + #endregion + + #region Methods + + #region Discounts + + /// + /// Delete discount + /// + /// Discount + public virtual void DeleteDiscount(Discount discount) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + _discountRepository.Delete(discount); + + //event notification + _eventPublisher.EntityDeleted(discount); + } + + /// + /// Gets a discount + /// + /// Discount identifier + /// Discount + public virtual Discount GetDiscountById(int discountId) + { + if (discountId == 0) + return null; + + return _discountRepository.GetById(discountId); + } + + /// + /// Gets all discounts + /// + /// Discount type; null to load all discount + /// Coupon code to find (exact match) + /// Discount name + /// A value indicating whether to show hidden records + /// Discounts + public virtual IList GetAllDiscounts(DiscountType? discountType = null, + string couponCode = "", string discountName = "", bool showHidden = false) + { + var query = _discountRepository.Table; + if (!showHidden) + { + //The function 'CurrentUtcDateTime' is not supported by SQL Server Compact. + //That's why we pass the date value + var nowUtc = DateTime.UtcNow; + query = query.Where(d => + (!d.StartDateUtc.HasValue || d.StartDateUtc <= nowUtc) + && (!d.EndDateUtc.HasValue || d.EndDateUtc >= nowUtc)); + } + if (!String.IsNullOrEmpty(couponCode)) + { + query = query.Where(d => d.CouponCode == couponCode); + } + if (!String.IsNullOrEmpty(discountName)) + { + query = query.Where(d => d.Name.Contains(discountName)); + } + if (discountType.HasValue) + { + int discountTypeId = (int) discountType.Value; + query = query.Where(d => d.DiscountTypeId == discountTypeId); + } + + query = query.OrderBy(d => d.Name); + + var discounts = query.ToList(); + return discounts; + } + + /// + /// Inserts a discount + /// + /// Discount + public virtual void InsertDiscount(Discount discount) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + _discountRepository.Insert(discount); + + //event notification + _eventPublisher.EntityInserted(discount); + } + + /// + /// Updates the discount + /// + /// Discount + public virtual void UpdateDiscount(Discount discount) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + _discountRepository.Update(discount); + + //event notification + _eventPublisher.EntityUpdated(discount); + } + + #endregion + + #region Discounts (caching) + + /// + /// Gets all discounts (cachable models) + /// + /// Discount type; null to load all discount + /// Coupon code to find (exact match) + /// Discount name + /// A value indicating whether to show hidden records + /// Discounts + public virtual IList GetAllDiscountsForCaching(DiscountType? discountType = null, + string couponCode = "", string discountName = "", bool showHidden = false) + { + //we cache discounts between requests. Otherwise, they will be loaded for almost each HTTP request + //we have to use the following workaround with cachable model (DiscountForCaching) because + //Entity Framework doesn't support 2-level caching + + //we load all discounts, and filter them using "discountType" parameter later (in memory) + //we do it because we know that this method is invoked several times per HTTP request with distinct "discountType" parameter + //that's why let's access the database only once + string key = string.Format(DiscountEventConsumer.DISCOUNT_ALL_KEY, showHidden, couponCode, discountName); + var result = _cacheManager.Get(key, () => + { + var discounts = GetAllDiscounts(null, couponCode, discountName, showHidden); + return discounts.Select(d => d.MapDiscount()).ToList(); + }); + //we know that this method is usually inkoved multiple times + //that's why we filter discounts by type on the application layer + if (discountType.HasValue) + { + result = result.Where(d => d.DiscountType == discountType.Value).ToList(); + } + return result; + } + + /// + /// Get category identifiers to which a discount is applied + /// + /// Discount + /// Customer + /// Category identifiers + public virtual IList GetAppliedCategoryIds(DiscountForCaching discount, Customer customer) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + var discountId = discount.Id; + var cacheKey = string.Format(DiscountEventConsumer.DISCOUNT_CATEGORY_IDS_MODEL_KEY, + discountId, + string.Join(",", customer.GetCustomerRoleIds()), + _storeContext.CurrentStore.Id); + var result = _cacheManager.Get(cacheKey, () => + { + var ids = new List(); + var rootCategoryIds = _discountRepository.Table.Where(x => x.Id == discountId) + .SelectMany(x => x.AppliedToCategories.Select(c => c.Id)) + .ToList(); + foreach (var categoryId in rootCategoryIds) + { + if (!ids.Contains(categoryId)) + ids.Add(categoryId); + if (discount.AppliedToSubCategories) + { + //include subcategories + foreach (var childCategoryId in _categoryService + .GetAllCategoriesByParentCategoryId(categoryId, false, true) + .Select(x => x.Id)) + { + if (!ids.Contains(childCategoryId)) + ids.Add(childCategoryId); + } + } + } + return ids; + }); + + return result; + } + + /// + /// Get manufacturer identifiers to which a discount is applied + /// + /// Discount + /// Customer + /// Manufacturer identifiers + public virtual IList GetAppliedManufacturerIds(DiscountForCaching discount, Customer customer) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + var discountId = discount.Id; + var cacheKey = string.Format(DiscountEventConsumer.DISCOUNT_MANUFACTURER_IDS_MODEL_KEY, + discountId, + string.Join(",", customer.GetCustomerRoleIds()), + _storeContext.CurrentStore.Id); + var result = _cacheManager.Get(cacheKey, () => + { + return _discountRepository.Table.Where(x => x.Id == discountId) + .SelectMany(x => x.AppliedToManufacturers.Select(c => c.Id)) + .ToList(); + }); + + return result; + } + + #endregion + + #region Discount requirements + + /// + /// Get all discount requirements + /// + /// Discont identifier + /// Whether to load top-level requirements only (without parent identifier) + /// Requirements + public virtual IList GetAllDiscountRequirements(int discountId = 0, bool topLevelOnly = false) + { + var query = _discountRequirementRepository.Table; + + //filter by discount + if (discountId > 0) + query = query.Where(requirement => requirement.DiscountId == discountId); + + //filter by top-level + if (topLevelOnly) + query = query.Where(requirement => !requirement.ParentId.HasValue); + + query = query.OrderBy(requirement => requirement.Id); + + return query.ToList(); + } + + /// + /// Delete discount requirement + /// + /// Discount requirement + public virtual void DeleteDiscountRequirement(DiscountRequirement discountRequirement) + { + if (discountRequirement == null) + throw new ArgumentNullException("discountRequirement"); + + _discountRequirementRepository.Delete(discountRequirement); + + //event notification + _eventPublisher.EntityDeleted(discountRequirement); + } + + /// + /// Load discount requirement rule by system name + /// + /// System name + /// Found discount requirement rule + public virtual IDiscountRequirementRule LoadDiscountRequirementRuleBySystemName(string systemName) + { + var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); + if (descriptor != null) + return descriptor.Instance(); + + return null; + } + + /// + /// Load all discount requirement rules + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Discount requirement rules + public virtual IList LoadAllDiscountRequirementRules(Customer customer = null) + { + return _pluginFinder.GetPlugins(customer: customer).ToList(); + } + + #endregion + + #region Validation + + /// + /// Validate discount + /// + /// Discount + /// Customer + /// Discount validation result + public virtual DiscountValidationResult ValidateDiscount(Discount discount, Customer customer) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + return ValidateDiscount(discount.MapDiscount(), customer); + } + + /// + /// Validate discount + /// + /// Discount + /// Customer + /// Coupon codes to validate + /// Discount validation result + public virtual DiscountValidationResult ValidateDiscount(Discount discount, Customer customer, string[] couponCodesToValidate) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + return ValidateDiscount(discount.MapDiscount(), customer, couponCodesToValidate); + } + + /// + /// Validate discount + /// + /// Discount + /// Customer + /// Discount validation result + public virtual DiscountValidationResult ValidateDiscount(DiscountForCaching discount, Customer customer) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + if (customer == null) + throw new ArgumentNullException("customer"); + + string[] couponCodesToValidate = customer.ParseAppliedDiscountCouponCodes(); + return ValidateDiscount(discount, customer, couponCodesToValidate); + } + + /// + /// Validate discount + /// + /// Discount + /// Customer + /// Coupon codes to validate + /// Discount validation result + public virtual DiscountValidationResult ValidateDiscount(DiscountForCaching discount, Customer customer, string[] couponCodesToValidate) + { + if (discount == null) + throw new ArgumentNullException("discount"); + + if (customer == null) + throw new ArgumentNullException("customer"); + + //invalid by default + var result = new DiscountValidationResult(); + + //check coupon code + if (discount.RequiresCouponCode) + { + if (String.IsNullOrEmpty(discount.CouponCode)) + return result; + + if (couponCodesToValidate == null) + return result; + + if (!couponCodesToValidate.Any(x => x.Equals(discount.CouponCode, StringComparison.InvariantCultureIgnoreCase))) + return result; + } + + //Do not allow discounts applied to order subtotal or total when a customer has gift cards in the cart. + //Otherwise, this customer can purchase gift cards with discount and get more than paid ("free money"). + if (discount.DiscountType == DiscountType.AssignedToOrderSubTotal || + discount.DiscountType == DiscountType.AssignedToOrderTotal) + { + var cart = customer.ShoppingCartItems + .Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart) + .LimitPerStore(_storeContext.CurrentStore.Id) + .ToList(); + + var hasGiftCards = cart.Any(x => x.Product.IsGiftCard); + if (hasGiftCards) + { + result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.CannotBeUsedWithGiftCards") }; + return result; + } + + var hasRewardPoints = cart.HasRewardPointsProduct(); // cart.Any(x => x.Product.IsRewardPoints); + if (hasRewardPoints) + { + result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.CannotBeUsedWithRewardPoints") }; + return result; + } + } + + //check date range + DateTime now = DateTime.UtcNow; + if (discount.StartDateUtc.HasValue) + { + DateTime startDate = DateTime.SpecifyKind(discount.StartDateUtc.Value, DateTimeKind.Utc); + if (startDate.CompareTo(now) > 0) + { + result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.NotStartedYet") }; + return result; + } + } + if (discount.EndDateUtc.HasValue) + { + DateTime endDate = DateTime.SpecifyKind(discount.EndDateUtc.Value, DateTimeKind.Utc); + if (endDate.CompareTo(now) < 0) + { + result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.Expired") }; + return result; + } + } + + //discount limitation + switch (discount.DiscountLimitation) + { + case DiscountLimitationType.NTimesOnly: + { + var usedTimes = GetAllDiscountUsageHistory(discount.Id, null, null, 0, 1).TotalCount; + if (usedTimes >= discount.LimitationTimes) + return result; + } + break; + case DiscountLimitationType.NTimesPerCustomer: + { + if (customer.IsRegistered()) + { + var usedTimes = GetAllDiscountUsageHistory(discount.Id, customer.Id, null, 0, 1).TotalCount; + if (usedTimes >= discount.LimitationTimes) + { + result.Errors = new List { _localizationService.GetResource("ShoppingCart.Discount.CannotBeUsedAnymore") }; + return result; + } + } + } + break; + case DiscountLimitationType.Unlimited: + default: + break; + } + + //discount requirements + string key = string.Format(DiscountEventConsumer.DISCOUNT_REQUIREMENT_MODEL_KEY, discount.Id); + var requirementsForCaching = _cacheManager.Get(key, () => + { + var requirements = GetAllDiscountRequirements(discount.Id, true); + return GetReqirementsForCaching(requirements); + }); + + //get top-level group + var topLevelGroup = requirementsForCaching.FirstOrDefault(); + if (topLevelGroup == null || (topLevelGroup.IsGroup && !topLevelGroup.ChildRequirements.Any()) || !topLevelGroup.InteractionType.HasValue) + { + //there are no requirements, so discount is valid + result.IsValid = true; + return result; + } + + //requirements are exist, let's check them + var errors = new List(); + result.IsValid = GetValidationResult(requirementsForCaching, topLevelGroup.InteractionType.Value, customer, errors); + + //set errors if result is not valid + if (!result.IsValid) + result.Errors = errors; + + return result; + } + + #endregion + + #region Discount usage history + + /// + /// Gets a discount usage history record + /// + /// Discount usage history record identifier + /// Discount usage history + public virtual DiscountUsageHistory GetDiscountUsageHistoryById(int discountUsageHistoryId) + { + if (discountUsageHistoryId == 0) + return null; + + return _discountUsageHistoryRepository.GetById(discountUsageHistoryId); + } + + /// + /// Gets all discount usage history records + /// + /// Discount identifier; null to load all records + /// Customer identifier; null to load all records + /// Order identifier; null to load all records + /// Page index + /// Page size + /// Discount usage history records + public virtual IPagedList GetAllDiscountUsageHistory(int? discountId = null, + int? customerId = null, int? orderId = null, + int pageIndex = 0, int pageSize = int.MaxValue) + { + var query = _discountUsageHistoryRepository.Table; + if (discountId.HasValue && discountId.Value > 0) + query = query.Where(duh => duh.DiscountId == discountId.Value); + if (customerId.HasValue && customerId.Value > 0) + query = query.Where(duh => duh.Order != null && duh.Order.CustomerId == customerId.Value); + if (orderId.HasValue && orderId.Value > 0) + query = query.Where(duh => duh.OrderId == orderId.Value); + query = query.OrderByDescending(c => c.CreatedOnUtc); + return new PagedList(query, pageIndex, pageSize); + } + + /// + /// Insert discount usage history record + /// + /// Discount usage history record + public virtual void InsertDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) + { + if (discountUsageHistory == null) + throw new ArgumentNullException("discountUsageHistory"); + + _discountUsageHistoryRepository.Insert(discountUsageHistory); + + //event notification + _eventPublisher.EntityInserted(discountUsageHistory); + } + + /// + /// Update discount usage history record + /// + /// Discount usage history record + public virtual void UpdateDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) + { + if (discountUsageHistory == null) + throw new ArgumentNullException("discountUsageHistory"); + + _discountUsageHistoryRepository.Update(discountUsageHistory); + + //event notification + _eventPublisher.EntityUpdated(discountUsageHistory); + } + + /// + /// Delete discount usage history record + /// + /// Discount usage history record + public virtual void DeleteDiscountUsageHistory(DiscountUsageHistory discountUsageHistory) + { + if (discountUsageHistory == null) + throw new ArgumentNullException("discountUsageHistory"); + + _discountUsageHistoryRepository.Delete(discountUsageHistory); + + //event notification + _eventPublisher.EntityDeleted(discountUsageHistory); + } + + #endregion + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/ExportImport/ExportManager.cs b/src/Libraries/Nop.Services/ExportImport/ExportManager.cs index 1e0400059f8..b740deb63b1 100644 --- a/src/Libraries/Nop.Services/ExportImport/ExportManager.cs +++ b/src/Libraries/Nop.Services/ExportImport/ExportManager.cs @@ -291,7 +291,7 @@ protected virtual byte[] ExportToXlsx(PropertyByName[] properties, IEnumer using (var xlPackage = new ExcelPackage(stream)) { // uncomment this line if you want the XML written out to the outputDir - //xlPackage.DebugMode = true; + //xlPackage.DebugMode = true; // get handles to the worksheets var worksheet = xlPackage.Workbook.Worksheets.Add(typeof(T).Name); @@ -355,7 +355,7 @@ private byte[] ExportProductsToXlsxWithAttributes(PropertyByName[] prop using (var xlPackage = new ExcelPackage(stream)) { // uncomment this line if you want the XML written out to the outputDir - //xlPackage.DebugMode = true; + //xlPackage.DebugMode = true; // get handles to the worksheets var worksheet = xlPackage.Workbook.Worksheets.Add(typeof(Product).Name); @@ -436,15 +436,17 @@ private byte[] ExportOrderToXlsxWithProducts(PropertyByName[] properties, { var orderItemProperties = new[] { - new PropertyByName("Name", oi => oi.Product.Name), new PropertyByName("Sku", oi => oi.Product.Sku), + new PropertyByName("Name", oi => oi.Product.Name), + new PropertyByName("AttributeDescription", oi => oi.AttributeDescription), new PropertyByName("PriceExclTax", oi => oi.UnitPriceExclTax), new PropertyByName("PriceInclTax", oi => oi.UnitPriceInclTax), new PropertyByName("Quantity", oi => oi.Quantity), new PropertyByName("DiscountExclTax", oi => oi.DiscountAmountExclTax), new PropertyByName("DiscountInclTax", oi => oi.DiscountAmountInclTax), new PropertyByName("TotalExclTax", oi => oi.PriceExclTax), - new PropertyByName("TotalInclTax", oi => oi.PriceInclTax) + new PropertyByName("TotalInclTax", oi => oi.PriceInclTax), + new PropertyByName("TaxRate", oi => oi.TaxRate) }; var orderItemsManager = new PropertyManager(orderItemProperties); @@ -473,23 +475,23 @@ private byte[] ExportOrderToXlsxWithProducts(PropertyByName[] properties, manager.WriteToXlsx(worksheet, row++, _catalogSettings.ExportImportUseDropdownlistsForAssociatedEntities); //products - var orederItems = order.OrderItems.ToList(); + var orderItems = order.OrderItems.ToList(); //a vendor should have access only to his products if (_workContext.CurrentVendor != null) - orederItems = orederItems.Where(p => p.Product.VendorId == _workContext.CurrentVendor.Id).ToList(); + orderItems = orderItems.Where(p => p.Product.VendorId == _workContext.CurrentVendor.Id).ToList(); - if (!orederItems.Any()) + if (!orderItems.Any()) continue; orderItemsManager.WriteCaption(worksheet, SetCaptionStyle, row, 2); worksheet.Row(row).OutlineLevel = 1; worksheet.Row(row).Collapsed = true; - foreach (var orederItem in orederItems) + foreach (var orderItem in orderItems) { row++; - orderItemsManager.CurrentObject = orederItem; + orderItemsManager.CurrentObject = orderItem; orderItemsManager.WriteToXlsx(worksheet, row, _catalogSettings.ExportImportUseDropdownlistsForAssociatedEntities, 2, fpWorksheet); worksheet.Row(row).OutlineLevel = 1; worksheet.Row(row).Collapsed = true; @@ -701,6 +703,9 @@ public virtual string ExportProductsToXml(IList products) xmlWriter.WriteString("IsGiftCard", product.IsGiftCard, IgnoreExportPoductProperty(p => p.IsGiftCard)); xmlWriter.WriteString("GiftCardType", product.GiftCardType, IgnoreExportPoductProperty(p => p.IsGiftCard)); xmlWriter.WriteString("OverriddenGiftCardAmount", product.OverriddenGiftCardAmount, IgnoreExportPoductProperty(p => p.IsGiftCard)); + xmlWriter.WriteString("IsRewardPoints", product.IsRewardPoints, IgnoreExportPoductProperty(p => p.IsRewardPoints)); + xmlWriter.WriteString("OverriddenRPExchangeRate", product.OverriddenRPExchangeRate, IgnoreExportPoductProperty(p => p.IsRewardPoints)); + xmlWriter.WriteString("ExcludeFromRewardPoints", product.ExcludeFromRewardPoints, IgnoreExportPoductProperty(p => p.IsRewardPoints)); xmlWriter.WriteString("RequireOtherProducts", product.RequireOtherProducts, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)); xmlWriter.WriteString("RequiredProductIds", product.RequiredProductIds, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)); xmlWriter.WriteString("AutomaticallyAddRequiredProducts", product.AutomaticallyAddRequiredProducts, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)); @@ -1009,6 +1014,9 @@ public virtual byte[] ExportProductsToXlsx(IEnumerable products) DropDownElements = GiftCardType.Virtual.ToSelectList(useLocalization: false) }, new PropertyByName("OverriddenGiftCardAmount", p => p.OverriddenGiftCardAmount, IgnoreExportPoductProperty(p => p.IsGiftCard)), + new PropertyByName("IsRewardPoints", p => p.IsRewardPoints, IgnoreExportPoductProperty(p => p.IsRewardPoints)), + new PropertyByName("OverriddenRPExchangeRate", p => p.OverriddenRPExchangeRate, IgnoreExportPoductProperty(p => p.IsRewardPoints)), + new PropertyByName("ExcludeFromRewardPoints", p => p.ExcludeFromRewardPoints, IgnoreExportPoductProperty(p => p.IsRewardPoints)), new PropertyByName("RequireOtherProducts", p => p.RequireOtherProducts, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)), new PropertyByName("RequiredProductIds", p => p.RequiredProductIds, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)), new PropertyByName("AutomaticallyAddRequiredProducts", p => p.AutomaticallyAddRequiredProducts, IgnoreExportPoductProperty(p => p.RequireOtherProductsAddedToTheCart)), @@ -1173,13 +1181,22 @@ public virtual string ExportOrdersToXml(IList orders) xmlWriter.WriteString("OrderSubTotalDiscountExclTax", order.OrderSubTotalDiscountExclTax, ignore); xmlWriter.WriteString("OrderShippingInclTax", order.OrderShippingInclTax, ignore); xmlWriter.WriteString("OrderShippingExclTax", order.OrderShippingExclTax, ignore); + xmlWriter.WriteString("OrderShippingNonTaxable", order.OrderShippingNonTaxable, ignore); xmlWriter.WriteString("PaymentMethodAdditionalFeeInclTax", order.PaymentMethodAdditionalFeeInclTax, ignore); xmlWriter.WriteString("PaymentMethodAdditionalFeeExclTax", order.PaymentMethodAdditionalFeeExclTax, ignore); + xmlWriter.WriteString("PaymentMethodAdditionalFeeNonTaxable", order.PaymentMethodAdditionalFeeNonTaxable, ignore); xmlWriter.WriteString("TaxRates", order.TaxRates, ignore); xmlWriter.WriteString("OrderTax", order.OrderTax, ignore); xmlWriter.WriteString("OrderTotal", order.OrderTotal, ignore); + xmlWriter.WriteString("OrderAmount", order.OrderAmount, ignore); + xmlWriter.WriteString("OrderAmountIncl", order.OrderAmount, ignore); + xmlWriter.WriteString("OrderDiscountIncl", order.OrderAmount, ignore); + xmlWriter.WriteString("EarnedRewardPointsBaseAmountIncl", order.OrderAmount, ignore); + xmlWriter.WriteString("EarnedRewardPointsBaseAmountExcl", order.OrderAmount, ignore); xmlWriter.WriteString("RefundedAmount", order.RefundedAmount, ignore); xmlWriter.WriteString("OrderDiscount", order.OrderDiscount, ignore); + xmlWriter.WriteString("OrderShippingNonTaxable", order.OrderAmount, ignore); + xmlWriter.WriteString("PaymentMethodAdditionalFeeNonTaxable", order.OrderAmount, ignore); xmlWriter.WriteString("CurrencyRate", order.CurrencyRate); xmlWriter.WriteString("CustomerCurrencyCode", order.CustomerCurrencyCode); xmlWriter.WriteString("AffiliateId", order.AffiliateId, ignore); @@ -1232,6 +1249,7 @@ public virtual string ExportOrdersToXml(IList orders) xmlWriter.WriteString("DiscountInclTax", orderItem.DiscountAmountInclTax); xmlWriter.WriteString("TotalExclTax", orderItem.PriceExclTax); xmlWriter.WriteString("TotalInclTax", orderItem.PriceInclTax); + xmlWriter.WriteString("TaxRate", orderItem.TaxRate.ToString()); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); @@ -1250,9 +1268,9 @@ public virtual string ExportOrdersToXml(IList orders) xmlWriter.WriteElementString("TrackingNumber", null, shipment.TrackingNumber); xmlWriter.WriteElementString("TotalWeight", null, shipment.TotalWeight.HasValue ? shipment.TotalWeight.Value.ToString() : String.Empty); - xmlWriter.WriteElementString("ShippedDateUtc", null, shipment.ShippedDateUtc.HasValue ? + xmlWriter.WriteElementString("ShippedDateUtc", null, shipment.ShippedDateUtc.HasValue ? shipment.ShippedDateUtc.ToString() : String.Empty); - xmlWriter.WriteElementString("DeliveryDateUtc", null, shipment.DeliveryDateUtc.HasValue ? + xmlWriter.WriteElementString("DeliveryDateUtc", null, shipment.DeliveryDateUtc.HasValue ? shipment.DeliveryDateUtc.Value.ToString() : String.Empty); xmlWriter.WriteElementString("CreatedOnUtc", null, shipment.CreatedOnUtc.ToString()); xmlWriter.WriteEndElement(); @@ -1293,13 +1311,22 @@ public virtual byte[] ExportOrdersToXlsx(IList orders) new PropertyByName("OrderSubTotalDiscountExclTax", p => p.OrderSubTotalDiscountExclTax, ignore), new PropertyByName("OrderShippingInclTax", p => p.OrderShippingInclTax, ignore), new PropertyByName("OrderShippingExclTax", p => p.OrderShippingExclTax, ignore), + new PropertyByName("OrderShippingNonTaxable", p => p.OrderShippingNonTaxable, ignore), new PropertyByName("PaymentMethodAdditionalFeeInclTax", p => p.PaymentMethodAdditionalFeeInclTax, ignore), new PropertyByName("PaymentMethodAdditionalFeeExclTax", p => p.PaymentMethodAdditionalFeeExclTax, ignore), + new PropertyByName("PaymentMethodAdditionalFeeNonTaxable", p => p.PaymentMethodAdditionalFeeNonTaxable, ignore), new PropertyByName("TaxRates", p => p.TaxRates, ignore), new PropertyByName("OrderTax", p => p.OrderTax, ignore), new PropertyByName("OrderTotal", p => p.OrderTotal, ignore), + new PropertyByName("OrderAmount", p => p.OrderAmount, ignore), + new PropertyByName("OrderAmountIncl", p => p.OrderAmountIncl, ignore), + new PropertyByName("OrderDiscountIncl", p => p.OrderAmountIncl, ignore), + new PropertyByName("EarnedRewardPointsBaseAmountIncl", p => p.OrderAmountIncl, ignore), + new PropertyByName("EarnedRewardPointsBaseAmountExcl", p => p.OrderAmountIncl, ignore), new PropertyByName("RefundedAmount", p => p.RefundedAmount, ignore), new PropertyByName("OrderDiscount", p => p.OrderDiscount, ignore), + new PropertyByName("OrderShippingNonTaxable", p => p.OrderShippingNonTaxable, ignore), + new PropertyByName("PaymentMethodAdditionalFeeNonTaxable", p => p.PaymentMethodAdditionalFeeNonTaxable, ignore), new PropertyByName("CurrencyRate", p => p.CurrencyRate), new PropertyByName("CustomerCurrencyCode", p => p.CustomerCurrencyCode), new PropertyByName("AffiliateId", p => p.AffiliateId, ignore), diff --git a/src/Libraries/Nop.Services/ExportImport/ImportManager.cs b/src/Libraries/Nop.Services/ExportImport/ImportManager.cs index e195a1c9997..021ae74a1bb 100644 --- a/src/Libraries/Nop.Services/ExportImport/ImportManager.cs +++ b/src/Libraries/Nop.Services/ExportImport/ImportManager.cs @@ -330,7 +330,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) //the columns var properties = GetPropertiesByExcelCells(worksheet); - + var manager = new PropertyManager(properties); var attributProperties = new[] @@ -343,7 +343,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) { DropDownElements = AttributeControlType.TextBox.ToSelectList(useLocalization: false) }, - new PropertyByName("AttributeDisplayOrder"), + new PropertyByName("AttributeDisplayOrder"), new PropertyByName("ProductAttributeValueId"), new PropertyByName("ValueName"), new PropertyByName("AttributeValueType") @@ -371,7 +371,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) var tempProperty = manager.GetProperty("Categories"); var categoryCellNum = tempProperty.Return(p => p.PropertyOrderPosition, -1); - + tempProperty = manager.GetProperty("SKU"); var skuCellNum = tempProperty.Return(p => p.PropertyOrderPosition, -1); @@ -444,7 +444,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) } if (categoryCellNum > 0) - { + { var categoryIds = worksheet.Cells[endRow, categoryCellNum].Value.Return(p => p.ToString(), string.Empty); if (!categoryIds.IsEmpty()) @@ -460,7 +460,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) } if (manufacturerCellNum > 0) - { + { var manufacturerIds = worksheet.Cells[endRow, manufacturerCellNum].Value.Return(p => p.ToString(), string.Empty); if (!manufacturerIds.IsEmpty()) allManufacturersNames.AddRange(manufacturerIds.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim())); @@ -536,7 +536,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) var productAttributeId = managerProductAttribute.GetProperty("AttributeId").IntValue; var attributeControlTypeId = managerProductAttribute.GetProperty("AttributeControlType").IntValue; - + var productAttributeValueId = managerProductAttribute.GetProperty("ProductAttributeValueId").IntValue; var associatedProductId = managerProductAttribute.GetProperty("AssociatedProductId").IntValue; var valueName = managerProductAttribute.GetProperty("ValueName").StringValue; @@ -556,7 +556,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) var attributeDisplayOrder = managerProductAttribute.GetProperty("AttributeDisplayOrder").IntValue; var productAttributeMapping = lastLoadedProduct.ProductAttributeMappings.FirstOrDefault(pam => pam.ProductAttributeId == productAttributeId); - + if (productAttributeMapping == null) { //insert mapping @@ -720,6 +720,15 @@ public virtual void ImportProductsFromXlsx(Stream stream) case "OverriddenGiftCardAmount": product.OverriddenGiftCardAmount = property.DecimalValue; break; + case "IsRewardPoints": + product.IsRewardPoints = property.BooleanValue; + break; + case "OverriddenRPExchangeRate": + product.OverriddenRPExchangeRate = property.DecimalValue; + break; + case "ExcludeFromRewardPoints": + product.ExcludeFromRewardPoints = property.BooleanValue; + break; case "RequireOtherProducts": product.RequireOtherProducts = property.BooleanValue; break; @@ -935,7 +944,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) //sets the current vendor for the new product if (isNew && _workContext.CurrentVendor != null) product.VendorId = _workContext.CurrentVendor.Id; - + product.UpdatedOnUtc = DateTime.UtcNow; if (isNew) @@ -953,7 +962,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) _productService.AddStockQuantityHistoryEntry(product, product.StockQuantity - previousStockQuantity, product.StockQuantity, product.WarehouseId, _localizationService.GetResource("Admin.StockQuantityHistory.Messages.ImportProduct.Edit")); } - //warehouse is changed + //warehouse is changed else { //compose a message @@ -989,7 +998,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) tempProperty = manager.GetProperty("Categories"); if (tempProperty != null) - { + { var categoryNames = tempProperty.StringValue; //category mappings @@ -999,7 +1008,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) { if (categories.Any(c => c == categoryId)) continue; - + var productCategory = new ProductCategory { ProductId = product.Id, @@ -1079,7 +1088,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) //_productService.UpdateHasTierPricesProperty(product); //_productService.UpdateHasDiscountsApplied(product); } - + if (_mediaSettings.ImportProductImagesUsingHash && _pictureService.StoreInDb && _dataProvider.SupportedLengthOfBinaryHash() > 0) ImportProductImagesUsingHash(productPictureMetadata, allProductsBySku); else @@ -1089,7 +1098,7 @@ public virtual void ImportProductsFromXlsx(Stream stream) _customerActivityService.InsertActivity("ImportProducts", _localizationService.GetResource("ActivityLog.ImportProducts"), countProductsInFile); } } - + /// /// Import newsletter subscribers from TXT file /// diff --git a/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs b/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs index 72d17029e86..fa2043b140a 100644 --- a/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs +++ b/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs @@ -1,12270 +1,12351 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Nop.Core; -using Nop.Core.Data; -using Nop.Core.Domain; -using Nop.Core.Domain.Affiliates; -using Nop.Core.Domain.Blogs; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Cms; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Forums; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Logging; -using Nop.Core.Domain.Media; -using Nop.Core.Domain.Messages; -using Nop.Core.Domain.News; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Polls; -using Nop.Core.Domain.Security; -using Nop.Core.Domain.Seo; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Stores; -using Nop.Core.Domain.Tasks; -using Nop.Core.Domain.Tax; -using Nop.Core.Domain.Topics; -using Nop.Core.Domain.Vendors; -using Nop.Core.Infrastructure; -using Nop.Services.Common; -using Nop.Services.Configuration; -using Nop.Services.Customers; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Media; -using Nop.Services.Seo; - -namespace Nop.Services.Installation -{ - public partial class CodeFirstInstallationService : IInstallationService - { - #region Fields - - private readonly IRepository _storeRepository; - private readonly IRepository _measureDimensionRepository; - private readonly IRepository _measureWeightRepository; - private readonly IRepository _taxCategoryRepository; - private readonly IRepository _languageRepository; - private readonly IRepository _currencyRepository; - private readonly IRepository _customerRepository; - private readonly IRepository _customerPasswordRepository; - private readonly IRepository _customerRoleRepository; - private readonly IRepository _specificationAttributeRepository; - private readonly IRepository _checkoutAttributeRepository; - private readonly IRepository _productAttributeRepository; - private readonly IRepository _categoryRepository; - private readonly IRepository _manufacturerRepository; - private readonly IRepository _productRepository; - private readonly IRepository _urlRecordRepository; - private readonly IRepository _relatedProductRepository; - private readonly IRepository _emailAccountRepository; - private readonly IRepository _messageTemplateRepository; - private readonly IRepository _forumGroupRepository; - private readonly IRepository _forumRepository; - private readonly IRepository _countryRepository; - private readonly IRepository _stateProvinceRepository; - private readonly IRepository _discountRepository; - private readonly IRepository _blogPostRepository; - private readonly IRepository _topicRepository; - private readonly IRepository _newsItemRepository; - private readonly IRepository _pollRepository; - private readonly IRepository _shippingMethodRepository; - private readonly IRepository _deliveryDateRepository; - private readonly IRepository _productAvailabilityRangeRepository; - private readonly IRepository _activityLogTypeRepository; - private readonly IRepository _activityLogRepository; - private readonly IRepository _productTagRepository; - private readonly IRepository _productTemplateRepository; - private readonly IRepository _categoryTemplateRepository; - private readonly IRepository _manufacturerTemplateRepository; - private readonly IRepository _topicTemplateRepository; - private readonly IRepository _scheduleTaskRepository; - private readonly IRepository _returnRequestReasonRepository; - private readonly IRepository _returnRequestActionRepository; - private readonly IRepository
_addressRepository; - private readonly IRepository _warehouseRepository; - private readonly IRepository _vendorRepository; - private readonly IRepository _affiliateRepository; - private readonly IRepository _orderRepository; - private readonly IRepository _orderItemRepository; - private readonly IRepository _orderNoteRepository; - private readonly IRepository _giftCardRepository; - private readonly IRepository _shipmentRepository; - private readonly IRepository _searchTermRepository; - private readonly IRepository _shipmentItemRepository; - private readonly IRepository _stockQuantityHistoryRepository; - private readonly IGenericAttributeService _genericAttributeService; - private readonly IWebHelper _webHelper; - - #endregion - - #region Ctor - - public CodeFirstInstallationService(IRepository storeRepository, - IRepository measureDimensionRepository, - IRepository measureWeightRepository, - IRepository taxCategoryRepository, - IRepository languageRepository, - IRepository currencyRepository, - IRepository customerRepository, - IRepository customerPasswordRepository, - IRepository customerRoleRepository, - IRepository specificationAttributeRepository, - IRepository checkoutAttributeRepository, - IRepository productAttributeRepository, - IRepository categoryRepository, - IRepository manufacturerRepository, - IRepository productRepository, - IRepository urlRecordRepository, - IRepository relatedProductRepository, - IRepository emailAccountRepository, - IRepository messageTemplateRepository, - IRepository forumGroupRepository, - IRepository forumRepository, - IRepository countryRepository, - IRepository stateProvinceRepository, - IRepository discountRepository, - IRepository blogPostRepository, - IRepository topicRepository, - IRepository newsItemRepository, - IRepository pollRepository, - IRepository shippingMethodRepository, - IRepository deliveryDateRepository, - IRepository productAvailabilityRangeRepository, - IRepository activityLogTypeRepository, - IRepository activityLogRepository, - IRepository productTagRepository, - IRepository productTemplateRepository, - IRepository categoryTemplateRepository, - IRepository manufacturerTemplateRepository, - IRepository topicTemplateRepository, - IRepository scheduleTaskRepository, - IRepository returnRequestReasonRepository, - IRepository returnRequestActionRepository, - IRepository
addressRepository, - IRepository warehouseRepository, - IRepository vendorRepository, - IRepository affiliateRepository, - IRepository orderRepository, - IRepository orderItemRepository, - IRepository orderNoteRepository, - IRepository giftCardRepository, - IRepository shipmentRepository, - IRepository shipmentItemRepository, - IRepository searchTermRepository, - IRepository stockQuantityHistoryRepository, - IGenericAttributeService genericAttributeService, - IWebHelper webHelper) - { - this._storeRepository = storeRepository; - this._measureDimensionRepository = measureDimensionRepository; - this._measureWeightRepository = measureWeightRepository; - this._taxCategoryRepository = taxCategoryRepository; - this._languageRepository = languageRepository; - this._currencyRepository = currencyRepository; - this._customerRepository = customerRepository; - this._customerPasswordRepository = customerPasswordRepository; - this._customerRoleRepository = customerRoleRepository; - this._specificationAttributeRepository = specificationAttributeRepository; - this._checkoutAttributeRepository = checkoutAttributeRepository; - this._productAttributeRepository = productAttributeRepository; - this._categoryRepository = categoryRepository; - this._manufacturerRepository = manufacturerRepository; - this._productRepository = productRepository; - this._urlRecordRepository = urlRecordRepository; - this._relatedProductRepository = relatedProductRepository; - this._emailAccountRepository = emailAccountRepository; - this._messageTemplateRepository = messageTemplateRepository; - this._forumGroupRepository = forumGroupRepository; - this._forumRepository = forumRepository; - this._countryRepository = countryRepository; - this._stateProvinceRepository = stateProvinceRepository; - this._discountRepository = discountRepository; - this._blogPostRepository = blogPostRepository; - this._topicRepository = topicRepository; - this._newsItemRepository = newsItemRepository; - this._pollRepository = pollRepository; - this._shippingMethodRepository = shippingMethodRepository; - this._deliveryDateRepository = deliveryDateRepository; - this._productAvailabilityRangeRepository = productAvailabilityRangeRepository; - this._activityLogTypeRepository = activityLogTypeRepository; - this._activityLogRepository = activityLogRepository; - this._productTagRepository = productTagRepository; - this._productTemplateRepository = productTemplateRepository; - this._categoryTemplateRepository = categoryTemplateRepository; - this._manufacturerTemplateRepository = manufacturerTemplateRepository; - this._topicTemplateRepository = topicTemplateRepository; - this._scheduleTaskRepository = scheduleTaskRepository; - this._returnRequestReasonRepository = returnRequestReasonRepository; - this._returnRequestActionRepository = returnRequestActionRepository; - this._addressRepository = addressRepository; - this._warehouseRepository = warehouseRepository; - this._vendorRepository = vendorRepository; - this._affiliateRepository = affiliateRepository; - this._orderRepository = orderRepository; - this._orderItemRepository = orderItemRepository; - this._orderNoteRepository = orderNoteRepository; - this._giftCardRepository = giftCardRepository; - this._shipmentRepository = shipmentRepository; - this._shipmentItemRepository = shipmentItemRepository; - this._searchTermRepository = searchTermRepository; - this._stockQuantityHistoryRepository = stockQuantityHistoryRepository; - this._genericAttributeService = genericAttributeService; - this._webHelper = webHelper; - } - - #endregion - - #region Utilities - - protected virtual void InstallStores() - { - //var storeUrl = "http://www.yourStore.com/"; - var storeUrl = _webHelper.GetStoreLocation(false); - var stores = new List - { - new Store - { - Name = "Your store name", - Url = storeUrl, - SslEnabled = false, - Hosts = "yourstore.com,www.yourstore.com", - DisplayOrder = 1, - //should we set some default company info? - CompanyName = "Your company name", - CompanyAddress = "your company country, state, zip, street, etc", - CompanyPhoneNumber = "(123) 456-78901", - CompanyVat = null, - }, - }; - - _storeRepository.Insert(stores); - } - - protected virtual void InstallMeasures() - { - var measureDimensions = new List - { - new MeasureDimension - { - Name = "inch(es)", - SystemKeyword = "inches", - Ratio = 1M, - DisplayOrder = 1, - }, - new MeasureDimension - { - Name = "feet", - SystemKeyword = "feet", - Ratio = 0.08333333M, - DisplayOrder = 2, - }, - new MeasureDimension - { - Name = "meter(s)", - SystemKeyword = "meters", - Ratio = 0.0254M, - DisplayOrder = 3, - }, - new MeasureDimension - { - Name = "millimetre(s)", - SystemKeyword = "millimetres", - Ratio = 25.4M, - DisplayOrder = 4, - } - }; - - _measureDimensionRepository.Insert(measureDimensions); - - var measureWeights = new List - { - new MeasureWeight - { - Name = "ounce(s)", - SystemKeyword = "ounce", - Ratio = 16M, - DisplayOrder = 1, - }, - new MeasureWeight - { - Name = "lb(s)", - SystemKeyword = "lb", - Ratio = 1M, - DisplayOrder = 2, - }, - new MeasureWeight - { - Name = "kg(s)", - SystemKeyword = "kg", - Ratio = 0.45359237M, - DisplayOrder = 3, - }, - new MeasureWeight - { - Name = "gram(s)", - SystemKeyword = "grams", - Ratio = 453.59237M, - DisplayOrder = 4, - } - }; - - _measureWeightRepository.Insert(measureWeights); - } - - protected virtual void InstallTaxCategories() - { - var taxCategories = new List - { - new TaxCategory - { - Name = "Books", - DisplayOrder = 1, - }, - new TaxCategory - { - Name = "Electronics & Software", - DisplayOrder = 5, - }, - new TaxCategory - { - Name = "Downloadable Products", - DisplayOrder = 10, - }, - new TaxCategory - { - Name = "Jewelry", - DisplayOrder = 15, - }, - new TaxCategory - { - Name = "Apparel", - DisplayOrder = 20, - }, - }; - _taxCategoryRepository.Insert(taxCategories); - - } - - protected virtual void InstallLanguages() - { - var language = new Language - { - Name = "English", - LanguageCulture = "en-US", - UniqueSeoCode = "en", - FlagImageFileName = "us.png", - Published = true, - DisplayOrder = 1 - }; - _languageRepository.Insert(language); - } - - protected virtual void InstallLocaleResources() - { - //'English' language - var language = _languageRepository.Table.Single(l => l.Name == "English"); - - //save resources - foreach (var filePath in System.IO.Directory.EnumerateFiles(CommonHelper.MapPath("~/App_Data/Localization/"), "*.nopres.xml", SearchOption.TopDirectoryOnly)) - { - var localesXml = File.ReadAllText(filePath); - var localizationService = EngineContext.Current.Resolve(); - localizationService.ImportResourcesFromXml(language, localesXml); - } - - } - - protected virtual void InstallCurrencies() - { - var currencies = new List - { - new Currency - { - Name = "US Dollar", - CurrencyCode = "USD", - Rate = 1, - DisplayLocale = "en-US", - CustomFormatting = "", - Published = true, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Australian Dollar", - CurrencyCode = "AUD", - Rate = 1.36M, - DisplayLocale = "en-AU", - CustomFormatting = "", - Published = false, - DisplayOrder = 2, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "British Pound", - CurrencyCode = "GBP", - Rate = 0.82M, - DisplayLocale = "en-GB", - CustomFormatting = "", - Published = false, - DisplayOrder = 3, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Canadian Dollar", - CurrencyCode = "CAD", - Rate = 1.32M, - DisplayLocale = "en-CA", - CustomFormatting = "", - Published = false, - DisplayOrder = 4, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Chinese Yuan Renminbi", - CurrencyCode = "CNY", - Rate = 6.93M, - DisplayLocale = "zh-CN", - CustomFormatting = "", - Published = false, - DisplayOrder = 5, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Euro", - CurrencyCode = "EUR", - Rate = 0.95M, - DisplayLocale = "", - //CustomFormatting = "0.00", - CustomFormatting = string.Format("{0}0.00", "\u20ac"), - Published = true, - DisplayOrder = 6, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Hong Kong Dollar", - CurrencyCode = "HKD", - Rate = 7.75M, - DisplayLocale = "zh-HK", - CustomFormatting = "", - Published = false, - DisplayOrder = 7, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Japanese Yen", - CurrencyCode = "JPY", - Rate = 116.64M, - DisplayLocale = "ja-JP", - CustomFormatting = "", - Published = false, - DisplayOrder = 8, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Russian Rouble", - CurrencyCode = "RUB", - Rate = 59.75M, - DisplayLocale = "ru-RU", - CustomFormatting = "", - Published = false, - DisplayOrder = 9, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Swedish Krona", - CurrencyCode = "SEK", - Rate = 9.08M, - DisplayLocale = "sv-SE", - CustomFormatting = "", - Published = false, - DisplayOrder = 10, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding1 - }, - new Currency - { - Name = "Romanian Leu", - CurrencyCode = "RON", - Rate = 4.28M, - DisplayLocale = "ro-RO", - CustomFormatting = "", - Published = false, - DisplayOrder = 11, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - new Currency - { - Name = "Indian Rupee", - CurrencyCode = "INR", - Rate = 68.17M, - DisplayLocale = "en-IN", - CustomFormatting = "", - Published = false, - DisplayOrder = 12, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - RoundingType = RoundingType.Rounding001 - }, - }; - _currencyRepository.Insert(currencies); - } - - protected virtual void InstallCountriesAndStates() - { - var cUsa = new Country - { - Name = "United States", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "US", - ThreeLetterIsoCode = "USA", - NumericIsoCode = 840, - SubjectToVat = false, - DisplayOrder = 1, - Published = true, - }; - cUsa.StateProvinces.Add(new StateProvince - { - Name = "AA (Armed Forces Americas)", - Abbreviation = "AA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "AE (Armed Forces Europe)", - Abbreviation = "AE", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Alabama", - Abbreviation = "AL", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Alaska", - Abbreviation = "AK", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "American Samoa", - Abbreviation = "AS", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "AP (Armed Forces Pacific)", - Abbreviation = "AP", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Arizona", - Abbreviation = "AZ", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Arkansas", - Abbreviation = "AR", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "California", - Abbreviation = "CA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Colorado", - Abbreviation = "CO", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Connecticut", - Abbreviation = "CT", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Delaware", - Abbreviation = "DE", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "District of Columbia", - Abbreviation = "DC", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Federated States of Micronesia", - Abbreviation = "FM", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Florida", - Abbreviation = "FL", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Georgia", - Abbreviation = "GA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Guam", - Abbreviation = "GU", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Hawaii", - Abbreviation = "HI", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Idaho", - Abbreviation = "ID", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Illinois", - Abbreviation = "IL", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Indiana", - Abbreviation = "IN", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Iowa", - Abbreviation = "IA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Kansas", - Abbreviation = "KS", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Kentucky", - Abbreviation = "KY", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Louisiana", - Abbreviation = "LA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Maine", - Abbreviation = "ME", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Marshall Islands", - Abbreviation = "MH", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Maryland", - Abbreviation = "MD", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Massachusetts", - Abbreviation = "MA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Michigan", - Abbreviation = "MI", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Minnesota", - Abbreviation = "MN", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Mississippi", - Abbreviation = "MS", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Missouri", - Abbreviation = "MO", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Montana", - Abbreviation = "MT", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Nebraska", - Abbreviation = "NE", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Nevada", - Abbreviation = "NV", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "New Hampshire", - Abbreviation = "NH", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "New Jersey", - Abbreviation = "NJ", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "New Mexico", - Abbreviation = "NM", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "New York", - Abbreviation = "NY", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "North Carolina", - Abbreviation = "NC", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "North Dakota", - Abbreviation = "ND", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Northern Mariana Islands", - Abbreviation = "MP", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Ohio", - Abbreviation = "OH", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Oklahoma", - Abbreviation = "OK", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Oregon", - Abbreviation = "OR", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Palau", - Abbreviation = "PW", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Pennsylvania", - Abbreviation = "PA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Puerto Rico", - Abbreviation = "PR", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Rhode Island", - Abbreviation = "RI", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "South Carolina", - Abbreviation = "SC", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "South Dakota", - Abbreviation = "SD", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Tennessee", - Abbreviation = "TN", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Texas", - Abbreviation = "TX", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Utah", - Abbreviation = "UT", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Vermont", - Abbreviation = "VT", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Virgin Islands", - Abbreviation = "VI", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Virginia", - Abbreviation = "VA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Washington", - Abbreviation = "WA", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "West Virginia", - Abbreviation = "WV", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Wisconsin", - Abbreviation = "WI", - Published = true, - DisplayOrder = 1, - }); - cUsa.StateProvinces.Add(new StateProvince - { - Name = "Wyoming", - Abbreviation = "WY", - Published = true, - DisplayOrder = 1, - }); - var cCanada = new Country - { - Name = "Canada", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CA", - ThreeLetterIsoCode = "CAN", - NumericIsoCode = 124, - SubjectToVat = false, - DisplayOrder = 100, - Published = true, - }; - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Alberta", - Abbreviation = "AB", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "British Columbia", - Abbreviation = "BC", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Manitoba", - Abbreviation = "MB", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "New Brunswick", - Abbreviation = "NB", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Newfoundland and Labrador", - Abbreviation = "NL", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Northwest Territories", - Abbreviation = "NT", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Nova Scotia", - Abbreviation = "NS", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Nunavut", - Abbreviation = "NU", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Ontario", - Abbreviation = "ON", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Prince Edward Island", - Abbreviation = "PE", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Quebec", - Abbreviation = "QC", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Saskatchewan", - Abbreviation = "SK", - Published = true, - DisplayOrder = 1, - }); - cCanada.StateProvinces.Add(new StateProvince - { - Name = "Yukon Territory", - Abbreviation = "YT", - Published = true, - DisplayOrder = 1, - }); - var countries = new List - { - cUsa, - cCanada, - //other countries - new Country - { - Name = "Argentina", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AR", - ThreeLetterIsoCode = "ARG", - NumericIsoCode = 32, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Armenia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AM", - ThreeLetterIsoCode = "ARM", - NumericIsoCode = 51, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Aruba", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AW", - ThreeLetterIsoCode = "ABW", - NumericIsoCode = 533, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Australia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AU", - ThreeLetterIsoCode = "AUS", - NumericIsoCode = 36, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Austria", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AT", - ThreeLetterIsoCode = "AUT", - NumericIsoCode = 40, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Azerbaijan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AZ", - ThreeLetterIsoCode = "AZE", - NumericIsoCode = 31, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bahamas", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BS", - ThreeLetterIsoCode = "BHS", - NumericIsoCode = 44, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bangladesh", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BD", - ThreeLetterIsoCode = "BGD", - NumericIsoCode = 50, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Belarus", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BY", - ThreeLetterIsoCode = "BLR", - NumericIsoCode = 112, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Belgium", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BE", - ThreeLetterIsoCode = "BEL", - NumericIsoCode = 56, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Belize", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BZ", - ThreeLetterIsoCode = "BLZ", - NumericIsoCode = 84, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bermuda", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BM", - ThreeLetterIsoCode = "BMU", - NumericIsoCode = 60, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bolivia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BO", - ThreeLetterIsoCode = "BOL", - NumericIsoCode = 68, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bosnia and Herzegowina", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BA", - ThreeLetterIsoCode = "BIH", - NumericIsoCode = 70, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Brazil", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BR", - ThreeLetterIsoCode = "BRA", - NumericIsoCode = 76, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bulgaria", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BG", - ThreeLetterIsoCode = "BGR", - NumericIsoCode = 100, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cayman Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KY", - ThreeLetterIsoCode = "CYM", - NumericIsoCode = 136, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Chile", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CL", - ThreeLetterIsoCode = "CHL", - NumericIsoCode = 152, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "China", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CN", - ThreeLetterIsoCode = "CHN", - NumericIsoCode = 156, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Colombia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CO", - ThreeLetterIsoCode = "COL", - NumericIsoCode = 170, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Costa Rica", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CR", - ThreeLetterIsoCode = "CRI", - NumericIsoCode = 188, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Croatia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HR", - ThreeLetterIsoCode = "HRV", - NumericIsoCode = 191, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cuba", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CU", - ThreeLetterIsoCode = "CUB", - NumericIsoCode = 192, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cyprus", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CY", - ThreeLetterIsoCode = "CYP", - NumericIsoCode = 196, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Czech Republic", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CZ", - ThreeLetterIsoCode = "CZE", - NumericIsoCode = 203, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Denmark", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DK", - ThreeLetterIsoCode = "DNK", - NumericIsoCode = 208, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Dominican Republic", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DO", - ThreeLetterIsoCode = "DOM", - NumericIsoCode = 214, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "East Timor", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TL", - ThreeLetterIsoCode = "TLS", - NumericIsoCode = 626, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Ecuador", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "EC", - ThreeLetterIsoCode = "ECU", - NumericIsoCode = 218, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Egypt", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "EG", - ThreeLetterIsoCode = "EGY", - NumericIsoCode = 818, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Finland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FI", - ThreeLetterIsoCode = "FIN", - NumericIsoCode = 246, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "France", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FR", - ThreeLetterIsoCode = "FRA", - NumericIsoCode = 250, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Georgia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GE", - ThreeLetterIsoCode = "GEO", - NumericIsoCode = 268, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Germany", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DE", - ThreeLetterIsoCode = "DEU", - NumericIsoCode = 276, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Gibraltar", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GI", - ThreeLetterIsoCode = "GIB", - NumericIsoCode = 292, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Greece", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GR", - ThreeLetterIsoCode = "GRC", - NumericIsoCode = 300, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guatemala", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GT", - ThreeLetterIsoCode = "GTM", - NumericIsoCode = 320, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Hong Kong", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HK", - ThreeLetterIsoCode = "HKG", - NumericIsoCode = 344, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Hungary", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HU", - ThreeLetterIsoCode = "HUN", - NumericIsoCode = 348, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "India", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IN", - ThreeLetterIsoCode = "IND", - NumericIsoCode = 356, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Indonesia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ID", - ThreeLetterIsoCode = "IDN", - NumericIsoCode = 360, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Ireland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IE", - ThreeLetterIsoCode = "IRL", - NumericIsoCode = 372, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Israel", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IL", - ThreeLetterIsoCode = "ISR", - NumericIsoCode = 376, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Italy", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IT", - ThreeLetterIsoCode = "ITA", - NumericIsoCode = 380, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Jamaica", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "JM", - ThreeLetterIsoCode = "JAM", - NumericIsoCode = 388, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Japan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "JP", - ThreeLetterIsoCode = "JPN", - NumericIsoCode = 392, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Jordan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "JO", - ThreeLetterIsoCode = "JOR", - NumericIsoCode = 400, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Kazakhstan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KZ", - ThreeLetterIsoCode = "KAZ", - NumericIsoCode = 398, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Korea, Democratic People's Republic of", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KP", - ThreeLetterIsoCode = "PRK", - NumericIsoCode = 408, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Kuwait", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KW", - ThreeLetterIsoCode = "KWT", - NumericIsoCode = 414, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Malaysia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MY", - ThreeLetterIsoCode = "MYS", - NumericIsoCode = 458, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mexico", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MX", - ThreeLetterIsoCode = "MEX", - NumericIsoCode = 484, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Netherlands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NL", - ThreeLetterIsoCode = "NLD", - NumericIsoCode = 528, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "New Zealand", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NZ", - ThreeLetterIsoCode = "NZL", - NumericIsoCode = 554, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Norway", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NO", - ThreeLetterIsoCode = "NOR", - NumericIsoCode = 578, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Pakistan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PK", - ThreeLetterIsoCode = "PAK", - NumericIsoCode = 586, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Palestine", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PS", - ThreeLetterIsoCode = "PSE", - NumericIsoCode = 275, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Paraguay", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PY", - ThreeLetterIsoCode = "PRY", - NumericIsoCode = 600, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Peru", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PE", - ThreeLetterIsoCode = "PER", - NumericIsoCode = 604, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Philippines", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PH", - ThreeLetterIsoCode = "PHL", - NumericIsoCode = 608, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Poland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PL", - ThreeLetterIsoCode = "POL", - NumericIsoCode = 616, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Portugal", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PT", - ThreeLetterIsoCode = "PRT", - NumericIsoCode = 620, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Puerto Rico", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PR", - ThreeLetterIsoCode = "PRI", - NumericIsoCode = 630, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Qatar", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "QA", - ThreeLetterIsoCode = "QAT", - NumericIsoCode = 634, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Romania", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "RO", - ThreeLetterIsoCode = "ROM", - NumericIsoCode = 642, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Russian Federation", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "RU", - ThreeLetterIsoCode = "RUS", - NumericIsoCode = 643, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Saudi Arabia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SA", - ThreeLetterIsoCode = "SAU", - NumericIsoCode = 682, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Singapore", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SG", - ThreeLetterIsoCode = "SGP", - NumericIsoCode = 702, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Slovakia (Slovak Republic)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SK", - ThreeLetterIsoCode = "SVK", - NumericIsoCode = 703, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Slovenia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SI", - ThreeLetterIsoCode = "SVN", - NumericIsoCode = 705, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "South Africa", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ZA", - ThreeLetterIsoCode = "ZAF", - NumericIsoCode = 710, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Spain", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ES", - ThreeLetterIsoCode = "ESP", - NumericIsoCode = 724, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Sweden", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SE", - ThreeLetterIsoCode = "SWE", - NumericIsoCode = 752, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Switzerland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CH", - ThreeLetterIsoCode = "CHE", - NumericIsoCode = 756, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Taiwan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TW", - ThreeLetterIsoCode = "TWN", - NumericIsoCode = 158, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Thailand", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TH", - ThreeLetterIsoCode = "THA", - NumericIsoCode = 764, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Turkey", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TR", - ThreeLetterIsoCode = "TUR", - NumericIsoCode = 792, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Ukraine", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "UA", - ThreeLetterIsoCode = "UKR", - NumericIsoCode = 804, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "United Arab Emirates", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AE", - ThreeLetterIsoCode = "ARE", - NumericIsoCode = 784, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "United Kingdom", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GB", - ThreeLetterIsoCode = "GBR", - NumericIsoCode = 826, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "United States minor outlying islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "UM", - ThreeLetterIsoCode = "UMI", - NumericIsoCode = 581, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Uruguay", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "UY", - ThreeLetterIsoCode = "URY", - NumericIsoCode = 858, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Uzbekistan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "UZ", - ThreeLetterIsoCode = "UZB", - NumericIsoCode = 860, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Venezuela", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VE", - ThreeLetterIsoCode = "VEN", - NumericIsoCode = 862, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Serbia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "RS", - ThreeLetterIsoCode = "SRB", - NumericIsoCode = 688, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Afghanistan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AF", - ThreeLetterIsoCode = "AFG", - NumericIsoCode = 4, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Albania", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AL", - ThreeLetterIsoCode = "ALB", - NumericIsoCode = 8, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Algeria", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DZ", - ThreeLetterIsoCode = "DZA", - NumericIsoCode = 12, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "American Samoa", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AS", - ThreeLetterIsoCode = "ASM", - NumericIsoCode = 16, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Andorra", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AD", - ThreeLetterIsoCode = "AND", - NumericIsoCode = 20, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Angola", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AO", - ThreeLetterIsoCode = "AGO", - NumericIsoCode = 24, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Anguilla", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AI", - ThreeLetterIsoCode = "AIA", - NumericIsoCode = 660, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Antarctica", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AQ", - ThreeLetterIsoCode = "ATA", - NumericIsoCode = 10, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Antigua and Barbuda", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AG", - ThreeLetterIsoCode = "ATG", - NumericIsoCode = 28, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bahrain", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BH", - ThreeLetterIsoCode = "BHR", - NumericIsoCode = 48, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Barbados", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BB", - ThreeLetterIsoCode = "BRB", - NumericIsoCode = 52, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Benin", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BJ", - ThreeLetterIsoCode = "BEN", - NumericIsoCode = 204, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bhutan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BT", - ThreeLetterIsoCode = "BTN", - NumericIsoCode = 64, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Botswana", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BW", - ThreeLetterIsoCode = "BWA", - NumericIsoCode = 72, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Bouvet Island", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BV", - ThreeLetterIsoCode = "BVT", - NumericIsoCode = 74, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "British Indian Ocean Territory", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IO", - ThreeLetterIsoCode = "IOT", - NumericIsoCode = 86, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Brunei Darussalam", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BN", - ThreeLetterIsoCode = "BRN", - NumericIsoCode = 96, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Burkina Faso", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BF", - ThreeLetterIsoCode = "BFA", - NumericIsoCode = 854, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Burundi", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "BI", - ThreeLetterIsoCode = "BDI", - NumericIsoCode = 108, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cambodia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KH", - ThreeLetterIsoCode = "KHM", - NumericIsoCode = 116, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cameroon", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CM", - ThreeLetterIsoCode = "CMR", - NumericIsoCode = 120, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cape Verde", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CV", - ThreeLetterIsoCode = "CPV", - NumericIsoCode = 132, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Central African Republic", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CF", - ThreeLetterIsoCode = "CAF", - NumericIsoCode = 140, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Chad", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TD", - ThreeLetterIsoCode = "TCD", - NumericIsoCode = 148, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Christmas Island", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CX", - ThreeLetterIsoCode = "CXR", - NumericIsoCode = 162, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cocos (Keeling) Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CC", - ThreeLetterIsoCode = "CCK", - NumericIsoCode = 166, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Comoros", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KM", - ThreeLetterIsoCode = "COM", - NumericIsoCode = 174, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Congo", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CG", - ThreeLetterIsoCode = "COG", - NumericIsoCode = 178, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Congo (Democratic Republic of the)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CD", - ThreeLetterIsoCode = "COD", - NumericIsoCode = 180, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cook Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CK", - ThreeLetterIsoCode = "COK", - NumericIsoCode = 184, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Cote D'Ivoire", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "CI", - ThreeLetterIsoCode = "CIV", - NumericIsoCode = 384, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Djibouti", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DJ", - ThreeLetterIsoCode = "DJI", - NumericIsoCode = 262, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Dominica", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "DM", - ThreeLetterIsoCode = "DMA", - NumericIsoCode = 212, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "El Salvador", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SV", - ThreeLetterIsoCode = "SLV", - NumericIsoCode = 222, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Equatorial Guinea", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GQ", - ThreeLetterIsoCode = "GNQ", - NumericIsoCode = 226, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Eritrea", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ER", - ThreeLetterIsoCode = "ERI", - NumericIsoCode = 232, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Estonia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "EE", - ThreeLetterIsoCode = "EST", - NumericIsoCode = 233, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Ethiopia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ET", - ThreeLetterIsoCode = "ETH", - NumericIsoCode = 231, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Falkland Islands (Malvinas)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FK", - ThreeLetterIsoCode = "FLK", - NumericIsoCode = 238, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Faroe Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FO", - ThreeLetterIsoCode = "FRO", - NumericIsoCode = 234, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Fiji", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FJ", - ThreeLetterIsoCode = "FJI", - NumericIsoCode = 242, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "French Guiana", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GF", - ThreeLetterIsoCode = "GUF", - NumericIsoCode = 254, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "French Polynesia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PF", - ThreeLetterIsoCode = "PYF", - NumericIsoCode = 258, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "French Southern Territories", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TF", - ThreeLetterIsoCode = "ATF", - NumericIsoCode = 260, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Gabon", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GA", - ThreeLetterIsoCode = "GAB", - NumericIsoCode = 266, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Gambia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GM", - ThreeLetterIsoCode = "GMB", - NumericIsoCode = 270, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Ghana", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GH", - ThreeLetterIsoCode = "GHA", - NumericIsoCode = 288, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Greenland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GL", - ThreeLetterIsoCode = "GRL", - NumericIsoCode = 304, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Grenada", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GD", - ThreeLetterIsoCode = "GRD", - NumericIsoCode = 308, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guadeloupe", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GP", - ThreeLetterIsoCode = "GLP", - NumericIsoCode = 312, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guam", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GU", - ThreeLetterIsoCode = "GUM", - NumericIsoCode = 316, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guinea", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GN", - ThreeLetterIsoCode = "GIN", - NumericIsoCode = 324, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guinea-bissau", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GW", - ThreeLetterIsoCode = "GNB", - NumericIsoCode = 624, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Guyana", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GY", - ThreeLetterIsoCode = "GUY", - NumericIsoCode = 328, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Haiti", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HT", - ThreeLetterIsoCode = "HTI", - NumericIsoCode = 332, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Heard and Mc Donald Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HM", - ThreeLetterIsoCode = "HMD", - NumericIsoCode = 334, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Honduras", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "HN", - ThreeLetterIsoCode = "HND", - NumericIsoCode = 340, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Iceland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IS", - ThreeLetterIsoCode = "ISL", - NumericIsoCode = 352, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Iran (Islamic Republic of)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IR", - ThreeLetterIsoCode = "IRN", - NumericIsoCode = 364, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Iraq", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "IQ", - ThreeLetterIsoCode = "IRQ", - NumericIsoCode = 368, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Kenya", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KE", - ThreeLetterIsoCode = "KEN", - NumericIsoCode = 404, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Kiribati", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KI", - ThreeLetterIsoCode = "KIR", - NumericIsoCode = 296, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Korea", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KR", - ThreeLetterIsoCode = "KOR", - NumericIsoCode = 410, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Kyrgyzstan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KG", - ThreeLetterIsoCode = "KGZ", - NumericIsoCode = 417, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Lao People's Democratic Republic", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LA", - ThreeLetterIsoCode = "LAO", - NumericIsoCode = 418, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Latvia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LV", - ThreeLetterIsoCode = "LVA", - NumericIsoCode = 428, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Lebanon", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LB", - ThreeLetterIsoCode = "LBN", - NumericIsoCode = 422, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Lesotho", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LS", - ThreeLetterIsoCode = "LSO", - NumericIsoCode = 426, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Liberia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LR", - ThreeLetterIsoCode = "LBR", - NumericIsoCode = 430, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Libyan Arab Jamahiriya", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LY", - ThreeLetterIsoCode = "LBY", - NumericIsoCode = 434, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Liechtenstein", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LI", - ThreeLetterIsoCode = "LIE", - NumericIsoCode = 438, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Lithuania", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LT", - ThreeLetterIsoCode = "LTU", - NumericIsoCode = 440, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Luxembourg", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LU", - ThreeLetterIsoCode = "LUX", - NumericIsoCode = 442, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Macau", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MO", - ThreeLetterIsoCode = "MAC", - NumericIsoCode = 446, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Macedonia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MK", - ThreeLetterIsoCode = "MKD", - NumericIsoCode = 807, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Madagascar", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MG", - ThreeLetterIsoCode = "MDG", - NumericIsoCode = 450, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Malawi", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MW", - ThreeLetterIsoCode = "MWI", - NumericIsoCode = 454, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Maldives", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MV", - ThreeLetterIsoCode = "MDV", - NumericIsoCode = 462, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mali", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ML", - ThreeLetterIsoCode = "MLI", - NumericIsoCode = 466, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Malta", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MT", - ThreeLetterIsoCode = "MLT", - NumericIsoCode = 470, - SubjectToVat = true, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Marshall Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MH", - ThreeLetterIsoCode = "MHL", - NumericIsoCode = 584, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Martinique", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MQ", - ThreeLetterIsoCode = "MTQ", - NumericIsoCode = 474, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mauritania", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MR", - ThreeLetterIsoCode = "MRT", - NumericIsoCode = 478, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mauritius", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MU", - ThreeLetterIsoCode = "MUS", - NumericIsoCode = 480, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mayotte", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "YT", - ThreeLetterIsoCode = "MYT", - NumericIsoCode = 175, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Micronesia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "FM", - ThreeLetterIsoCode = "FSM", - NumericIsoCode = 583, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Moldova", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MD", - ThreeLetterIsoCode = "MDA", - NumericIsoCode = 498, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Monaco", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MC", - ThreeLetterIsoCode = "MCO", - NumericIsoCode = 492, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mongolia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MN", - ThreeLetterIsoCode = "MNG", - NumericIsoCode = 496, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Montenegro", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ME", - ThreeLetterIsoCode = "MNE", - NumericIsoCode = 499, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Montserrat", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MS", - ThreeLetterIsoCode = "MSR", - NumericIsoCode = 500, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Morocco", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MA", - ThreeLetterIsoCode = "MAR", - NumericIsoCode = 504, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Mozambique", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MZ", - ThreeLetterIsoCode = "MOZ", - NumericIsoCode = 508, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Myanmar", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MM", - ThreeLetterIsoCode = "MMR", - NumericIsoCode = 104, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Namibia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NA", - ThreeLetterIsoCode = "NAM", - NumericIsoCode = 516, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Nauru", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NR", - ThreeLetterIsoCode = "NRU", - NumericIsoCode = 520, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Nepal", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NP", - ThreeLetterIsoCode = "NPL", - NumericIsoCode = 524, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Netherlands Antilles", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "AN", - ThreeLetterIsoCode = "ANT", - NumericIsoCode = 530, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "New Caledonia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NC", - ThreeLetterIsoCode = "NCL", - NumericIsoCode = 540, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Nicaragua", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NI", - ThreeLetterIsoCode = "NIC", - NumericIsoCode = 558, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Niger", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NE", - ThreeLetterIsoCode = "NER", - NumericIsoCode = 562, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Nigeria", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NG", - ThreeLetterIsoCode = "NGA", - NumericIsoCode = 566, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Niue", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NU", - ThreeLetterIsoCode = "NIU", - NumericIsoCode = 570, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Norfolk Island", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "NF", - ThreeLetterIsoCode = "NFK", - NumericIsoCode = 574, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Northern Mariana Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "MP", - ThreeLetterIsoCode = "MNP", - NumericIsoCode = 580, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Oman", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "OM", - ThreeLetterIsoCode = "OMN", - NumericIsoCode = 512, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Palau", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PW", - ThreeLetterIsoCode = "PLW", - NumericIsoCode = 585, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Panama", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PA", - ThreeLetterIsoCode = "PAN", - NumericIsoCode = 591, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Papua New Guinea", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PG", - ThreeLetterIsoCode = "PNG", - NumericIsoCode = 598, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Pitcairn", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PN", - ThreeLetterIsoCode = "PCN", - NumericIsoCode = 612, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Reunion", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "RE", - ThreeLetterIsoCode = "REU", - NumericIsoCode = 638, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Rwanda", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "RW", - ThreeLetterIsoCode = "RWA", - NumericIsoCode = 646, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Saint Kitts and Nevis", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "KN", - ThreeLetterIsoCode = "KNA", - NumericIsoCode = 659, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Saint Lucia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LC", - ThreeLetterIsoCode = "LCA", - NumericIsoCode = 662, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Saint Vincent and the Grenadines", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VC", - ThreeLetterIsoCode = "VCT", - NumericIsoCode = 670, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Samoa", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "WS", - ThreeLetterIsoCode = "WSM", - NumericIsoCode = 882, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "San Marino", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SM", - ThreeLetterIsoCode = "SMR", - NumericIsoCode = 674, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Sao Tome and Principe", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ST", - ThreeLetterIsoCode = "STP", - NumericIsoCode = 678, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Senegal", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SN", - ThreeLetterIsoCode = "SEN", - NumericIsoCode = 686, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Seychelles", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SC", - ThreeLetterIsoCode = "SYC", - NumericIsoCode = 690, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Sierra Leone", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SL", - ThreeLetterIsoCode = "SLE", - NumericIsoCode = 694, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Solomon Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SB", - ThreeLetterIsoCode = "SLB", - NumericIsoCode = 90, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Somalia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SO", - ThreeLetterIsoCode = "SOM", - NumericIsoCode = 706, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "South Georgia & South Sandwich Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "GS", - ThreeLetterIsoCode = "SGS", - NumericIsoCode = 239, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "South Sudan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SS", - ThreeLetterIsoCode = "SSD", - NumericIsoCode = 728, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Sri Lanka", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "LK", - ThreeLetterIsoCode = "LKA", - NumericIsoCode = 144, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "St. Helena", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SH", - ThreeLetterIsoCode = "SHN", - NumericIsoCode = 654, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "St. Pierre and Miquelon", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "PM", - ThreeLetterIsoCode = "SPM", - NumericIsoCode = 666, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Sudan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SD", - ThreeLetterIsoCode = "SDN", - NumericIsoCode = 736, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Suriname", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SR", - ThreeLetterIsoCode = "SUR", - NumericIsoCode = 740, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Svalbard and Jan Mayen Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SJ", - ThreeLetterIsoCode = "SJM", - NumericIsoCode = 744, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Swaziland", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SZ", - ThreeLetterIsoCode = "SWZ", - NumericIsoCode = 748, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Syrian Arab Republic", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "SY", - ThreeLetterIsoCode = "SYR", - NumericIsoCode = 760, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tajikistan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TJ", - ThreeLetterIsoCode = "TJK", - NumericIsoCode = 762, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tanzania", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TZ", - ThreeLetterIsoCode = "TZA", - NumericIsoCode = 834, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Togo", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TG", - ThreeLetterIsoCode = "TGO", - NumericIsoCode = 768, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tokelau", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TK", - ThreeLetterIsoCode = "TKL", - NumericIsoCode = 772, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tonga", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TO", - ThreeLetterIsoCode = "TON", - NumericIsoCode = 776, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Trinidad and Tobago", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TT", - ThreeLetterIsoCode = "TTO", - NumericIsoCode = 780, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tunisia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TN", - ThreeLetterIsoCode = "TUN", - NumericIsoCode = 788, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Turkmenistan", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TM", - ThreeLetterIsoCode = "TKM", - NumericIsoCode = 795, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Turks and Caicos Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TC", - ThreeLetterIsoCode = "TCA", - NumericIsoCode = 796, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Tuvalu", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "TV", - ThreeLetterIsoCode = "TUV", - NumericIsoCode = 798, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Uganda", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "UG", - ThreeLetterIsoCode = "UGA", - NumericIsoCode = 800, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Vanuatu", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VU", - ThreeLetterIsoCode = "VUT", - NumericIsoCode = 548, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Vatican City State (Holy See)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VA", - ThreeLetterIsoCode = "VAT", - NumericIsoCode = 336, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Viet Nam", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VN", - ThreeLetterIsoCode = "VNM", - NumericIsoCode = 704, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Virgin Islands (British)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VG", - ThreeLetterIsoCode = "VGB", - NumericIsoCode = 92, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Virgin Islands (U.S.)", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "VI", - ThreeLetterIsoCode = "VIR", - NumericIsoCode = 850, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Wallis and Futuna Islands", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "WF", - ThreeLetterIsoCode = "WLF", - NumericIsoCode = 876, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Western Sahara", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "EH", - ThreeLetterIsoCode = "ESH", - NumericIsoCode = 732, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Yemen", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "YE", - ThreeLetterIsoCode = "YEM", - NumericIsoCode = 887, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Zambia", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ZM", - ThreeLetterIsoCode = "ZMB", - NumericIsoCode = 894, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - new Country - { - Name = "Zimbabwe", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "ZW", - ThreeLetterIsoCode = "ZWE", - NumericIsoCode = 716, - SubjectToVat = false, - DisplayOrder = 100, - Published = true - }, - }; - _countryRepository.Insert(countries); - } - - protected virtual void InstallShippingMethods() - { - var shippingMethods = new List - { - new ShippingMethod - { - Name = "Ground", - Description ="Compared to other shipping methods, ground shipping is carried out closer to the earth", - DisplayOrder = 1 - }, - new ShippingMethod - { - Name = "Next Day Air", - Description ="The one day air shipping", - DisplayOrder = 3 - }, - new ShippingMethod - { - Name = "2nd Day Air", - Description ="The two day air shipping", - DisplayOrder = 3 - } - }; - _shippingMethodRepository.Insert(shippingMethods); - } - - protected virtual void InstallDeliveryDates() - { - var deliveryDates = new List - { - new DeliveryDate - { - Name = "1-2 days", - DisplayOrder = 1 - }, - new DeliveryDate - { - Name = "3-5 days", - DisplayOrder = 5 - }, - new DeliveryDate - { - Name = "1 week", - DisplayOrder = 10 - }, - }; - _deliveryDateRepository.Insert(deliveryDates); - } - - protected virtual void InstallProductAvailabilityRanges() - { - var productAvailabilityRanges = new List - { - new ProductAvailabilityRange - { - Name = "2-4 days", - DisplayOrder = 1 - }, - new ProductAvailabilityRange - { - Name = "7-10 days", - DisplayOrder = 2 - }, - new ProductAvailabilityRange - { - Name = "2 week", - DisplayOrder = 3 - }, - }; - _productAvailabilityRangeRepository.Insert(productAvailabilityRanges); - } - - protected virtual void InstallCustomersAndUsers(string defaultUserEmail, string defaultUserPassword) - { - var crAdministrators = new CustomerRole - { - Name = "Administrators", - Active = true, - IsSystemRole = true, - SystemName = SystemCustomerRoleNames.Administrators, - }; - var crForumModerators = new CustomerRole - { - Name = "Forum Moderators", - Active = true, - IsSystemRole = true, - SystemName = SystemCustomerRoleNames.ForumModerators, - }; - var crRegistered = new CustomerRole - { - Name = "Registered", - Active = true, - IsSystemRole = true, - SystemName = SystemCustomerRoleNames.Registered, - }; - var crGuests = new CustomerRole - { - Name = "Guests", - Active = true, - IsSystemRole = true, - SystemName = SystemCustomerRoleNames.Guests, - }; - var crVendors = new CustomerRole - { - Name = "Vendors", - Active = true, - IsSystemRole = true, - SystemName = SystemCustomerRoleNames.Vendors, - }; - var customerRoles = new List - { - crAdministrators, - crForumModerators, - crRegistered, - crGuests, - crVendors - }; - _customerRoleRepository.Insert(customerRoles); - - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - var storeId = defaultStore.Id; - - //admin user - var adminUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = defaultUserEmail, - Username = defaultUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - - var defaultAdminUserAddress = new Address - { - FirstName = "John", - LastName = "Smith", - PhoneNumber = "12345678", - Email = defaultUserEmail, - FaxNumber = "", - Company = "Nop Solutions Ltd", - Address1 = "21 West 52nd Street", - Address2 = "", - City = "New York", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - ZipPostalCode = "10021", - CreatedOnUtc = DateTime.UtcNow, - }; - adminUser.Addresses.Add(defaultAdminUserAddress); - adminUser.BillingAddress = defaultAdminUserAddress; - adminUser.ShippingAddress = defaultAdminUserAddress; - - adminUser.CustomerRoles.Add(crAdministrators); - adminUser.CustomerRoles.Add(crForumModerators); - adminUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(adminUser); - //set default customer name - _genericAttributeService.SaveAttribute(adminUser, SystemCustomerAttributeNames.FirstName, "John"); - _genericAttributeService.SaveAttribute(adminUser, SystemCustomerAttributeNames.LastName, "Smith"); - - //set hashed admin password - var customerRegistrationService = EngineContext.Current.Resolve(); - customerRegistrationService.ChangePassword(new ChangePasswordRequest(defaultUserEmail, false, - PasswordFormat.Hashed, defaultUserPassword)); - - //second user - var secondUserEmail = "steve_gates@nopCommerce.com"; - var secondUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = secondUserEmail, - Username = secondUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - var defaultSecondUserAddress = new Address - { - FirstName = "Steve", - LastName = "Gates", - PhoneNumber = "87654321", - Email = secondUserEmail, - FaxNumber = "", - Company = "Steve Company", - Address1 = "750 Bel Air Rd.", - Address2 = "", - City = "Los Angeles", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "California"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - ZipPostalCode = "90077", - CreatedOnUtc = DateTime.UtcNow, - }; - secondUser.Addresses.Add(defaultSecondUserAddress); - secondUser.BillingAddress = defaultSecondUserAddress; - secondUser.ShippingAddress = defaultSecondUserAddress; - - secondUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(secondUser); - //set default customer name - _genericAttributeService.SaveAttribute(secondUser, SystemCustomerAttributeNames.FirstName, defaultSecondUserAddress.FirstName); - _genericAttributeService.SaveAttribute(secondUser, SystemCustomerAttributeNames.LastName, defaultSecondUserAddress.LastName); - - //set customer password - _customerPasswordRepository.Insert(new CustomerPassword - { - Customer = secondUser, - Password = "123456", - PasswordFormat = PasswordFormat.Clear, - PasswordSalt = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }); - - //third user - var thirdUserEmail = "arthur_holmes@nopCommerce.com"; - var thirdUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = thirdUserEmail, - Username = thirdUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - var defaultThirdUserAddress = new Address - { - FirstName = "Arthur", - LastName = "Holmes", - PhoneNumber = "111222333", - Email = thirdUserEmail, - FaxNumber = "", - Company = "Holmes Company", - Address1 = "221B Baker Street", - Address2 = "", - City = "London", - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "GBR"), - ZipPostalCode = "NW1 6XE", - CreatedOnUtc = DateTime.UtcNow, - }; - thirdUser.Addresses.Add(defaultThirdUserAddress); - thirdUser.BillingAddress = defaultThirdUserAddress; - thirdUser.ShippingAddress = defaultThirdUserAddress; - - thirdUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(thirdUser); - //set default customer name - _genericAttributeService.SaveAttribute(thirdUser, SystemCustomerAttributeNames.FirstName, defaultThirdUserAddress.FirstName); - _genericAttributeService.SaveAttribute(thirdUser, SystemCustomerAttributeNames.LastName, defaultThirdUserAddress.LastName); - - //set customer password - _customerPasswordRepository.Insert(new CustomerPassword - { - Customer = thirdUser, - Password = "123456", - PasswordFormat = PasswordFormat.Clear, - PasswordSalt = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }); - - //fourth user - var fourthUserEmail = "james_pan@nopCommerce.com"; - var fourthUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = fourthUserEmail, - Username = fourthUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - var defaultFourthUserAddress = new Address - { - FirstName = "James", - LastName = "Pan", - PhoneNumber = "369258147", - Email = fourthUserEmail, - FaxNumber = "", - Company = "Pan Company", - Address1 = "St Katharines West 16", - Address2 = "", - City = "St Andrews", - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "GBR"), - ZipPostalCode = "KY16 9AX", - CreatedOnUtc = DateTime.UtcNow, - }; - fourthUser.Addresses.Add(defaultFourthUserAddress); - fourthUser.BillingAddress = defaultFourthUserAddress; - fourthUser.ShippingAddress = defaultFourthUserAddress; - - fourthUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(fourthUser); - //set default customer name - _genericAttributeService.SaveAttribute(fourthUser, SystemCustomerAttributeNames.FirstName, defaultFourthUserAddress.FirstName); - _genericAttributeService.SaveAttribute(fourthUser, SystemCustomerAttributeNames.LastName, defaultFourthUserAddress.LastName); - - //set customer password - _customerPasswordRepository.Insert(new CustomerPassword - { - Customer = fourthUser, - Password = "123456", - PasswordFormat = PasswordFormat.Clear, - PasswordSalt = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }); - - //fifth user - var fifthUserEmail = "brenda_lindgren@nopCommerce.com"; - var fifthUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = fifthUserEmail, - Username = fifthUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - var defaultFifthUserAddress = new Address - { - FirstName = "Brenda", - LastName = "Lindgren", - PhoneNumber = "14785236", - Email = fifthUserEmail, - FaxNumber = "", - Company = "Brenda Company", - Address1 = "1249 Tongass Avenue, Suite B", - Address2 = "", - City = "Ketchikan", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "Alaska"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - ZipPostalCode = "99901", - CreatedOnUtc = DateTime.UtcNow, - }; - fifthUser.Addresses.Add(defaultFifthUserAddress); - fifthUser.BillingAddress = defaultFifthUserAddress; - fifthUser.ShippingAddress = defaultFifthUserAddress; - - fifthUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(fifthUser); - //set default customer name - _genericAttributeService.SaveAttribute(fifthUser, SystemCustomerAttributeNames.FirstName, defaultFifthUserAddress.FirstName); - _genericAttributeService.SaveAttribute(fifthUser, SystemCustomerAttributeNames.LastName, defaultFifthUserAddress.LastName); - - //set customer password - _customerPasswordRepository.Insert(new CustomerPassword - { - Customer = fifthUser, - Password = "123456", - PasswordFormat = PasswordFormat.Clear, - PasswordSalt = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }); - - //sixth user - var sixthUserEmail = "victoria_victoria@nopCommerce.com"; - var sixthUser = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = sixthUserEmail, - Username = sixthUserEmail, - Active = true, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - var defaultSixthUserAddress = new Address - { - FirstName = "Victoria", - LastName = "Terces", - PhoneNumber = "45612378", - Email = sixthUserEmail, - FaxNumber = "", - Company = "Terces Company", - Address1 = "201 1st Avenue South", - Address2 = "", - City = "Saskatoon", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "Saskatchewan"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "CAN"), - ZipPostalCode = "S7K 1J9", - CreatedOnUtc = DateTime.UtcNow, - }; - sixthUser.Addresses.Add(defaultSixthUserAddress); - sixthUser.BillingAddress = defaultSixthUserAddress; - sixthUser.ShippingAddress = defaultSixthUserAddress; - - sixthUser.CustomerRoles.Add(crRegistered); - - _customerRepository.Insert(sixthUser); - //set default customer name - _genericAttributeService.SaveAttribute(sixthUser, SystemCustomerAttributeNames.FirstName, defaultSixthUserAddress.FirstName); - _genericAttributeService.SaveAttribute(sixthUser, SystemCustomerAttributeNames.LastName, defaultSixthUserAddress.LastName); - - //set customer password - _customerPasswordRepository.Insert(new CustomerPassword - { - Customer = sixthUser, - Password = "123456", - PasswordFormat = PasswordFormat.Clear, - PasswordSalt = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }); - - //search engine (crawler) built-in user - var searchEngineUser = new Customer - { - Email = "builtin@search_engine_record.com", - CustomerGuid = Guid.NewGuid(), - AdminComment = "Built-in system guest record used for requests from search engines.", - Active = true, - IsSystemAccount = true, - SystemName = SystemCustomerNames.SearchEngine, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - searchEngineUser.CustomerRoles.Add(crGuests); - _customerRepository.Insert(searchEngineUser); - - - //built-in user for background tasks - var backgroundTaskUser = new Customer - { - Email = "builtin@background-task-record.com", - CustomerGuid = Guid.NewGuid(), - AdminComment = "Built-in system record used for background tasks.", - Active = true, - IsSystemAccount = true, - SystemName = SystemCustomerNames.BackgroundTask, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = storeId - }; - backgroundTaskUser.CustomerRoles.Add(crGuests); - _customerRepository.Insert(backgroundTaskUser); - } - - protected virtual void InstallOrders() - { - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - //first order - var firstCustomer = _customerRepository.Table.First(c => c.Email.Equals("steve_gates@nopCommerce.com")); - var firstOrder = new Order() - { - StoreId = defaultStore.Id, - OrderGuid = Guid.NewGuid(), - Customer = firstCustomer, - CustomerLanguageId = _languageRepository.Table.First().Id, - CustomerIp = "127.0.0.1", - OrderSubtotalInclTax = 1855M, - OrderSubtotalExclTax = 1855M, - OrderSubTotalDiscountInclTax = decimal.Zero, - OrderSubTotalDiscountExclTax = decimal.Zero, - OrderShippingInclTax = decimal.Zero, - OrderShippingExclTax = decimal.Zero, - PaymentMethodAdditionalFeeInclTax = decimal.Zero, - PaymentMethodAdditionalFeeExclTax = decimal.Zero, - TaxRates = "0:0;", - OrderTax = decimal.Zero, - OrderTotal = 1855M, - RefundedAmount = decimal.Zero, - OrderDiscount = decimal.Zero, - CheckoutAttributeDescription = string.Empty, - CheckoutAttributesXml = string.Empty, - CustomerCurrencyCode = "USD", - CurrencyRate = 1M, - AffiliateId = 0, - OrderStatus = OrderStatus.Processing, - AllowStoringCreditCardNumber = false, - CardType = string.Empty, - CardName = string.Empty, - CardNumber = string.Empty, - MaskedCreditCardNumber = string.Empty, - CardCvv2 = string.Empty, - CardExpirationMonth = string.Empty, - CardExpirationYear = string.Empty, - PaymentMethodSystemName = "Payments.CheckMoneyOrder", - AuthorizationTransactionId = string.Empty, - AuthorizationTransactionCode = string.Empty, - AuthorizationTransactionResult = string.Empty, - CaptureTransactionId = string.Empty, - CaptureTransactionResult = string.Empty, - SubscriptionTransactionId = string.Empty, - PaymentStatus = PaymentStatus.Paid, - PaidDateUtc = DateTime.UtcNow, - BillingAddress = (Address)firstCustomer.BillingAddress.Clone(), - ShippingAddress = (Address)firstCustomer.ShippingAddress.Clone(), - ShippingStatus = ShippingStatus.NotYetShipped, - ShippingMethod = "Ground", - PickUpInStore = false, - ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", - CustomValuesXml = string.Empty, - VatNumber = string.Empty, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - _orderRepository.Insert(firstOrder); - firstOrder.CustomOrderNumber = firstOrder.Id.ToString(); - _orderRepository.Update(firstOrder); - - //item Apple iCam - var firstOrderItem1 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = firstOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Apple iCam")).Id, - UnitPriceInclTax = 1300M, - UnitPriceExclTax = 1300M, - PriceInclTax = 1300M, - PriceExclTax = 1300M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(firstOrderItem1); - - //item Leica T Mirrorless Digital Camera - var fierstOrderItem2 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = firstOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Leica T Mirrorless Digital Camera")).Id, - UnitPriceInclTax = 530M, - UnitPriceExclTax = 530M, - PriceInclTax = 530M, - PriceExclTax = 530M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(fierstOrderItem2); - - //item $25 Virtual Gift Card - var firstOrderItem3 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = firstOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("$25 Virtual Gift Card")).Id, - UnitPriceInclTax = 25M, - UnitPriceExclTax = 25M, - PriceInclTax = 25M, - PriceExclTax = 25M, - OriginalProductCost = decimal.Zero, - AttributeDescription = "From: Steve Gates <steve_gates@nopCommerce.com>
For: Brenda Lindgren <brenda_lindgren@nopCommerce.com>", - AttributesXml = "Brenda Lindgrenbrenda_lindgren@nopCommerce.comSteve Gatessteve_gates@gmail.com", - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(firstOrderItem3); - - var firstOrderGiftcard = new GiftCard - { - GiftCardType = GiftCardType.Virtual, - PurchasedWithOrderItem = firstOrderItem3, - Amount = 25M, - IsGiftCardActivated = false, - GiftCardCouponCode = string.Empty, - RecipientName = "Brenda Lindgren", - RecipientEmail = "brenda_lindgren@nopCommerce.com", - SenderName = "Steve Gates", - SenderEmail = "steve_gates@nopCommerce.com", - Message = string.Empty, - IsRecipientNotified = false, - CreatedOnUtc = DateTime.UtcNow - }; - _giftCardRepository.Insert(firstOrderGiftcard); - - //order notes - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order placed", - Order = firstOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order paid", - Order = firstOrder - }); - - - //second order - var secondCustomer = _customerRepository.Table.First(c => c.Email.Equals("arthur_holmes@nopCommerce.com")); - var secondOrder = new Order() - { - StoreId = defaultStore.Id, - OrderGuid = Guid.NewGuid(), - Customer = secondCustomer, - CustomerLanguageId = _languageRepository.Table.First().Id, - CustomerIp = "127.0.0.1", - OrderSubtotalInclTax = 2460M, - OrderSubtotalExclTax = 2460M, - OrderSubTotalDiscountInclTax = decimal.Zero, - OrderSubTotalDiscountExclTax = decimal.Zero, - OrderShippingInclTax = decimal.Zero, - OrderShippingExclTax = decimal.Zero, - PaymentMethodAdditionalFeeInclTax = decimal.Zero, - PaymentMethodAdditionalFeeExclTax = decimal.Zero, - TaxRates = "0:0;", - OrderTax = decimal.Zero, - OrderTotal = 2460M, - RefundedAmount = decimal.Zero, - OrderDiscount = decimal.Zero, - CheckoutAttributeDescription = string.Empty, - CheckoutAttributesXml = string.Empty, - CustomerCurrencyCode = "USD", - CurrencyRate = 1M, - AffiliateId = 0, - OrderStatus = OrderStatus.Pending, - AllowStoringCreditCardNumber = false, - CardType = string.Empty, - CardName = string.Empty, - CardNumber = string.Empty, - MaskedCreditCardNumber = string.Empty, - CardCvv2 = string.Empty, - CardExpirationMonth = string.Empty, - CardExpirationYear = string.Empty, - PaymentMethodSystemName = "Payments.CheckMoneyOrder", - AuthorizationTransactionId = string.Empty, - AuthorizationTransactionCode = string.Empty, - AuthorizationTransactionResult = string.Empty, - CaptureTransactionId = string.Empty, - CaptureTransactionResult = string.Empty, - SubscriptionTransactionId = string.Empty, - PaymentStatus = PaymentStatus.Pending, - PaidDateUtc = null, - BillingAddress = (Address)secondCustomer.BillingAddress.Clone(), - ShippingAddress = (Address)secondCustomer.ShippingAddress.Clone(), - ShippingStatus = ShippingStatus.NotYetShipped, - ShippingMethod = "Next Day Air", - PickUpInStore = false, - ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", - CustomValuesXml = string.Empty, - VatNumber = string.Empty, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - _orderRepository.Insert(secondOrder); - secondOrder.CustomOrderNumber = secondOrder.Id.ToString(); - _orderRepository.Update(secondOrder); - - //order notes - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order placed", - Order = secondOrder - }); - - //item Vintage Style Engagement Ring - var secondOrderItem1 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = secondOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Vintage Style Engagement Ring")).Id, - UnitPriceInclTax = 2100M, - UnitPriceExclTax = 2100M, - PriceInclTax = 2100M, - PriceExclTax = 2100M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(secondOrderItem1); - - //item Flower Girl Bracelet - var secondOrderItem2 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = secondOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Flower Girl Bracelet")).Id, - UnitPriceInclTax = 360M, - UnitPriceExclTax = 360M, - PriceInclTax = 360M, - PriceExclTax = 360M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(secondOrderItem2); - - - //third order - var thirdCustomer = _customerRepository.Table.First(c => c.Email.Equals("james_pan@nopCommerce.com")); - var thirdOrder = new Order() - { - StoreId = defaultStore.Id, - OrderGuid = Guid.NewGuid(), - Customer = thirdCustomer, - CustomerLanguageId = _languageRepository.Table.First().Id, - CustomerIp = "127.0.0.1", - OrderSubtotalInclTax = 8.80M, - OrderSubtotalExclTax = 8.80M, - OrderSubTotalDiscountInclTax = decimal.Zero, - OrderSubTotalDiscountExclTax = decimal.Zero, - OrderShippingInclTax = decimal.Zero, - OrderShippingExclTax = decimal.Zero, - PaymentMethodAdditionalFeeInclTax = decimal.Zero, - PaymentMethodAdditionalFeeExclTax = decimal.Zero, - TaxRates = "0:0;", - OrderTax = decimal.Zero, - OrderTotal = 8.80M, - RefundedAmount = decimal.Zero, - OrderDiscount = decimal.Zero, - CheckoutAttributeDescription = string.Empty, - CheckoutAttributesXml = string.Empty, - CustomerCurrencyCode = "USD", - CurrencyRate = 1M, - AffiliateId = 0, - OrderStatus = OrderStatus.Pending, - AllowStoringCreditCardNumber = false, - CardType = string.Empty, - CardName = string.Empty, - CardNumber = string.Empty, - MaskedCreditCardNumber = string.Empty, - CardCvv2 = string.Empty, - CardExpirationMonth = string.Empty, - CardExpirationYear = string.Empty, - PaymentMethodSystemName = "Payments.CheckMoneyOrder", - AuthorizationTransactionId = string.Empty, - AuthorizationTransactionCode = string.Empty, - AuthorizationTransactionResult = string.Empty, - CaptureTransactionId = string.Empty, - CaptureTransactionResult = string.Empty, - SubscriptionTransactionId = string.Empty, - PaymentStatus = PaymentStatus.Pending, - PaidDateUtc = null, - BillingAddress = (Address)thirdCustomer.BillingAddress.Clone(), - ShippingAddress = null, - ShippingStatus = ShippingStatus.ShippingNotRequired, - ShippingMethod = string.Empty, - PickUpInStore = false, - ShippingRateComputationMethodSystemName = string.Empty, - CustomValuesXml = string.Empty, - VatNumber = string.Empty, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - _orderRepository.Insert(thirdOrder); - thirdOrder.CustomOrderNumber = thirdOrder.Id.ToString(); - _orderRepository.Update(thirdOrder); - - //order notes - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order placed", - Order = thirdOrder - }); - - //item If You Wait - var thirdOrderItem1 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = thirdOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("If You Wait (donation)")).Id, - UnitPriceInclTax = 3M, - UnitPriceExclTax = 3M, - PriceInclTax = 3M, - PriceExclTax = 3M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(thirdOrderItem1); - - //item Night Visions - var thirdOrderItem2 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = thirdOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Night Visions")).Id, - UnitPriceInclTax = 2.8M, - UnitPriceExclTax = 2.8M, - PriceInclTax = 2.8M, - PriceExclTax = 2.8M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(thirdOrderItem2); - - //item Science & Faith - var thirdOrderItem3 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = thirdOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Science & Faith")).Id, - UnitPriceInclTax = 3M, - UnitPriceExclTax = 3M, - PriceInclTax = 3M, - PriceExclTax = 3M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(thirdOrderItem3); - - - //fourth order - var fourthCustomer = _customerRepository.Table.First(c => c.Email.Equals("brenda_lindgren@nopCommerce.com")); - var fourthOrder = new Order() - { - StoreId = defaultStore.Id, - OrderGuid = Guid.NewGuid(), - Customer = fourthCustomer, - CustomerLanguageId = _languageRepository.Table.First().Id, - CustomerIp = "127.0.0.1", - OrderSubtotalInclTax = 102M, - OrderSubtotalExclTax = 102M, - OrderSubTotalDiscountInclTax = decimal.Zero, - OrderSubTotalDiscountExclTax = decimal.Zero, - OrderShippingInclTax = decimal.Zero, - OrderShippingExclTax = decimal.Zero, - PaymentMethodAdditionalFeeInclTax = decimal.Zero, - PaymentMethodAdditionalFeeExclTax = decimal.Zero, - TaxRates = "0:0;", - OrderTax = decimal.Zero, - OrderTotal = 102M, - RefundedAmount = decimal.Zero, - OrderDiscount = decimal.Zero, - CheckoutAttributeDescription = string.Empty, - CheckoutAttributesXml = string.Empty, - CustomerCurrencyCode = "USD", - CurrencyRate = 1M, - AffiliateId = 0, - OrderStatus = OrderStatus.Processing, - AllowStoringCreditCardNumber = false, - CardType = string.Empty, - CardName = string.Empty, - CardNumber = string.Empty, - MaskedCreditCardNumber = string.Empty, - CardCvv2 = string.Empty, - CardExpirationMonth = string.Empty, - CardExpirationYear = string.Empty, - PaymentMethodSystemName = "Payments.CheckMoneyOrder", - AuthorizationTransactionId = string.Empty, - AuthorizationTransactionCode = string.Empty, - AuthorizationTransactionResult = string.Empty, - CaptureTransactionId = string.Empty, - CaptureTransactionResult = string.Empty, - SubscriptionTransactionId = string.Empty, - PaymentStatus = PaymentStatus.Paid, - PaidDateUtc = DateTime.UtcNow, - BillingAddress = (Address)fourthCustomer.BillingAddress.Clone(), - ShippingAddress = (Address)fourthCustomer.ShippingAddress.Clone(), - ShippingStatus = ShippingStatus.Shipped, - ShippingMethod = "Pickup in store", - PickUpInStore = true, - PickupAddress = (Address)fourthCustomer.ShippingAddress.Clone(), - ShippingRateComputationMethodSystemName = "Pickup.PickupInStore", - CustomValuesXml = string.Empty, - VatNumber = string.Empty, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - _orderRepository.Insert(fourthOrder); - fourthOrder.CustomOrderNumber = fourthOrder.Id.ToString(); - _orderRepository.Update(fourthOrder); - - //order notes - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order placed", - Order = fourthOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order paid", - Order = fourthOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order shipped", - Order = fourthOrder - }); - - //item Pride and Prejudice - var fourthOrderItem1 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = fourthOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Pride and Prejudice")).Id, - UnitPriceInclTax = 24M, - UnitPriceExclTax = 24M, - PriceInclTax = 24M, - PriceExclTax = 24M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(fourthOrderItem1); - - //item First Prize Pies - var fourthOrderItem2 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = fourthOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("First Prize Pies")).Id, - UnitPriceInclTax = 51M, - UnitPriceExclTax = 51M, - PriceInclTax = 51M, - PriceExclTax = 51M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(fourthOrderItem2); - - //item Fahrenheit 451 by Ray Bradbury - var fourthOrderItem3 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = fourthOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Fahrenheit 451 by Ray Bradbury")).Id, - UnitPriceInclTax = 27M, - UnitPriceExclTax = 27M, - PriceInclTax = 27M, - PriceExclTax = 27M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(fourthOrderItem3); - - //shipments - //shipment 1 - var fourthOrderShipment1 = new Shipment - { - Order = fourthOrder, - TrackingNumber = string.Empty, - TotalWeight = 4M, - ShippedDateUtc = DateTime.UtcNow, - DeliveryDateUtc = DateTime.UtcNow, - AdminComment = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }; - _shipmentRepository.Insert(fourthOrderShipment1); - - var fourthOrderShipment1Item1 = new ShipmentItem() - { - OrderItemId = fourthOrderItem1.Id, - Quantity = 1, - WarehouseId = 0, - Shipment = fourthOrderShipment1 - }; - _shipmentItemRepository.Insert(fourthOrderShipment1Item1); - - var fourthOrderShipment1Item2 = new ShipmentItem() - { - OrderItemId = fourthOrderItem2.Id, - Quantity = 1, - WarehouseId = 0, - Shipment = fourthOrderShipment1 - }; - _shipmentItemRepository.Insert(fourthOrderShipment1Item2); - - //shipment 2 - var fourthOrderShipment2 = new Shipment - { - Order = fourthOrder, - TrackingNumber = string.Empty, - TotalWeight = 2M, - ShippedDateUtc = DateTime.UtcNow, - DeliveryDateUtc = DateTime.UtcNow, - AdminComment = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }; - _shipmentRepository.Insert(fourthOrderShipment2); - - var fourthOrderShipment2Item1 = new ShipmentItem() - { - OrderItemId = fourthOrderItem3.Id, - Quantity = 1, - WarehouseId = 0, - Shipment = fourthOrderShipment2 - }; - _shipmentItemRepository.Insert(fourthOrderShipment2Item1); - - - - - //fifth order - var fifthCustomer = _customerRepository.Table.First(c => c.Email.Equals("victoria_victoria@nopCommerce.com")); - var fifthOrder = new Order() - { - StoreId = defaultStore.Id, - OrderGuid = Guid.NewGuid(), - Customer = fifthCustomer, - CustomerLanguageId = _languageRepository.Table.First().Id, - CustomerIp = "127.0.0.1", - OrderSubtotalInclTax = 43.50M, - OrderSubtotalExclTax = 43.50M, - OrderSubTotalDiscountInclTax = decimal.Zero, - OrderSubTotalDiscountExclTax = decimal.Zero, - OrderShippingInclTax = decimal.Zero, - OrderShippingExclTax = decimal.Zero, - PaymentMethodAdditionalFeeInclTax = decimal.Zero, - PaymentMethodAdditionalFeeExclTax = decimal.Zero, - TaxRates = "0:0;", - OrderTax = decimal.Zero, - OrderTotal = 43.50M, - RefundedAmount = decimal.Zero, - OrderDiscount = decimal.Zero, - CheckoutAttributeDescription = string.Empty, - CheckoutAttributesXml = string.Empty, - CustomerCurrencyCode = "USD", - CurrencyRate = 1M, - AffiliateId = 0, - OrderStatus = OrderStatus.Complete, - AllowStoringCreditCardNumber = false, - CardType = string.Empty, - CardName = string.Empty, - CardNumber = string.Empty, - MaskedCreditCardNumber = string.Empty, - CardCvv2 = string.Empty, - CardExpirationMonth = string.Empty, - CardExpirationYear = string.Empty, - PaymentMethodSystemName = "Payments.CheckMoneyOrder", - AuthorizationTransactionId = string.Empty, - AuthorizationTransactionCode = string.Empty, - AuthorizationTransactionResult = string.Empty, - CaptureTransactionId = string.Empty, - CaptureTransactionResult = string.Empty, - SubscriptionTransactionId = string.Empty, - PaymentStatus = PaymentStatus.Paid, - PaidDateUtc = DateTime.UtcNow, - BillingAddress = (Address)fifthCustomer.BillingAddress.Clone(), - ShippingAddress = (Address)fifthCustomer.ShippingAddress.Clone(), - ShippingStatus = ShippingStatus.Delivered, - ShippingMethod = "Ground", - PickUpInStore = false, - ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", - CustomValuesXml = string.Empty, - VatNumber = string.Empty, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - _orderRepository.Insert(fifthOrder); - fifthOrder.CustomOrderNumber = fifthOrder.Id.ToString(); - _orderRepository.Update(fifthOrder); - - //order notes - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order placed", - Order = fifthOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order paid", - Order = fifthOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order shipped", - Order = fifthOrder - }); - _orderNoteRepository.Insert(new OrderNote() - { - CreatedOnUtc = DateTime.UtcNow, - Note = "Order delivered", - Order = fifthOrder - }); - - //item Levi's 511 Jeans - var fifthOrderItem1 = new OrderItem() - { - OrderItemGuid = Guid.NewGuid(), - Order = fifthOrder, - ProductId = _productRepository.Table.First(p => p.Name.Equals("Levi's 511 Jeans")).Id, - UnitPriceInclTax = 43.50M, - UnitPriceExclTax = 43.50M, - PriceInclTax = 43.50M, - PriceExclTax = 43.50M, - OriginalProductCost = decimal.Zero, - AttributeDescription = string.Empty, - AttributesXml = string.Empty, - Quantity = 1, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = null, - RentalStartDateUtc = null, - RentalEndDateUtc = null - }; - _orderItemRepository.Insert(fifthOrderItem1); - - //shipment 1 - var fifthOrderShipment1 = new Shipment - { - Order = fifthOrder, - TrackingNumber = string.Empty, - TotalWeight = 2M, - ShippedDateUtc = DateTime.UtcNow, - DeliveryDateUtc = DateTime.UtcNow, - AdminComment = string.Empty, - CreatedOnUtc = DateTime.UtcNow - }; - _shipmentRepository.Insert(fifthOrderShipment1); - - var fifthOrderShipment1Item1 = new ShipmentItem() - { - OrderItemId = fifthOrderItem1.Id, - Quantity = 1, - WarehouseId = 0, - Shipment = fifthOrderShipment1 - }; - _shipmentItemRepository.Insert(fifthOrderShipment1Item1); - } - - protected virtual void InstallActivityLog(string defaultUserEmail) - { - //default customer/user - var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); - if (defaultCustomer == null) - throw new Exception("Cannot load default customer"); - - _activityLogRepository.Insert(new ActivityLog() - { - ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditCategory")), - Comment = "Edited a category ('Computers')", - CreatedOnUtc = DateTime.UtcNow, - Customer = defaultCustomer, - IpAddress = "127.0.0.1" - }); - _activityLogRepository.Insert(new ActivityLog() - { - ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditDiscount")), - Comment = "Edited a discount ('Sample discount with coupon code')", - CreatedOnUtc = DateTime.UtcNow, - Customer = defaultCustomer, - IpAddress = "127.0.0.1" - }); - _activityLogRepository.Insert(new ActivityLog() - { - ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditSpecAttribute")), - Comment = "Edited a specification attribute ('CPU Type')", - CreatedOnUtc = DateTime.UtcNow, - Customer = defaultCustomer, - IpAddress = "127.0.0.1" - }); - _activityLogRepository.Insert(new ActivityLog() - { - ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("AddNewProductAttribute")), - Comment = "Added a new product attribute ('Some attribute')", - CreatedOnUtc = DateTime.UtcNow, - Customer = defaultCustomer, - IpAddress = "127.0.0.1" - }); - _activityLogRepository.Insert(new ActivityLog() - { - ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("DeleteGiftCard")), - Comment = "Deleted a gift card ('bdbbc0ef-be57')", - CreatedOnUtc = DateTime.UtcNow, - Customer = defaultCustomer, - IpAddress = "127.0.0.1" - }); - } - - protected virtual void InstallSearchTerms() - { - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - _searchTermRepository.Insert(new SearchTerm() - { - Count = 34, - Keyword = "computer", - StoreId = defaultStore.Id - }); - _searchTermRepository.Insert(new SearchTerm() - { - Count = 30, - Keyword = "camera", - StoreId = defaultStore.Id - }); - _searchTermRepository.Insert(new SearchTerm() - { - Count = 27, - Keyword = "jewelry", - StoreId = defaultStore.Id - }); - _searchTermRepository.Insert(new SearchTerm() - { - Count = 26, - Keyword = "shoes", - StoreId = defaultStore.Id - }); - _searchTermRepository.Insert(new SearchTerm() - { - Count = 19, - Keyword = "jeans", - StoreId = defaultStore.Id - }); - _searchTermRepository.Insert(new SearchTerm() - { - Count = 10, - Keyword = "gift", - StoreId = defaultStore.Id - }); - } - - protected virtual void InstallEmailAccounts() - { - var emailAccounts = new List - { - new EmailAccount - { - Email = "test@mail.com", - DisplayName = "Store name", - Host = "smtp.mail.com", - Port = 25, - Username = "123", - Password = "123", - EnableSsl = false, - UseDefaultCredentials = false - }, - }; - _emailAccountRepository.Insert(emailAccounts); - } - - protected virtual void InstallMessageTemplates() - { - var eaGeneral = _emailAccountRepository.Table.FirstOrDefault(); - if (eaGeneral == null) - throw new Exception("Default email account cannot be loaded"); - - var messageTemplates = new List - { - new MessageTemplate - { - Name = MessageTemplateSystemNames.BlogCommentNotification, - Subject = "%Store.Name%. New blog comment.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new blog comment has been created for blog post \"%BlogComment.BlogPostTitle%\".{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.BackInStockNotification, - Subject = "%Store.Name%. Back in stock notification", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}Product %BackInStockSubscription.ProductName% is in stock.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.CustomerEmailValidationMessage, - Subject = "%Store.Name%. Email validation", - Body = string.Format("%Store.Name%{0}
{0}
{0}To activate your account click here.{0}
{0}
{0}%Store.Name%{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.CustomerEmailRevalidationMessage, - Subject = "%Store.Name%. Email validation", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%!{0}
{0}To validate your new email address click here.{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.PrivateMessageNotification, - Subject = "%Store.Name%. You have received a new private message", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}You have received a new private message.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.CustomerPasswordRecoveryMessage, - Subject = "%Store.Name%. Password recovery", - Body = string.Format("%Store.Name%{0}
{0}
{0}To change your password click here.{0}
{0}
{0}%Store.Name%{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.CustomerWelcomeMessage, - Subject = "Welcome to %Store.Name%", - Body = string.Format("We welcome you to %Store.Name%.{0}
{0}
{0}You can now take part in the various services we have to offer you. Some of these services include:{0}
{0}
{0}Permanent Cart - Any products added to your online cart remain there until you remove them, or check them out.{0}
{0}Address Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.{0}
{0}Order History - View your history of purchases that you have made with us.{0}
{0}Products Reviews - Share your opinions on products with our other customers.{0}
{0}
{0}For help with any of our online services, please email the store-owner: %Store.Email%.{0}
{0}
{0}Note: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to %Store.Email%.{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewForumPostMessage, - Subject = "%Store.Name%. New Post Notification.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new post has been created in the topic \"%Forums.TopicName%\" at \"%Forums.ForumName%\" forum.{0}
{0}
{0}Click here for more info.{0}
{0}
{0}Post author: %Forums.PostAuthor%{0}
{0}Post body: %Forums.PostBody%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewForumTopicMessage, - Subject = "%Store.Name%. New Topic Notification.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new topic \"%Forums.TopicName%\" has been created at \"%Forums.ForumName%\" forum.{0}
{0}
{0}Click here for more info.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.GiftCardNotification, - Subject = "%GiftCard.SenderName% has sent you a gift card for %Store.Name%", - Body = string.Format("

{0}You have received a gift card for %Store.Name%{0}

{0}

{0}Dear %GiftCard.RecipientName%,{0}
{0}
{0}%GiftCard.SenderName% (%GiftCard.SenderEmail%) has sent you a %GiftCard.Amount% gift cart for %Store.Name%{0}

{0}

{0}You gift card code is %GiftCard.CouponCode%{0}

{0}

{0}%GiftCard.Message%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.CustomerRegisteredNotification, - Subject = "%Store.Name%. New customer registration", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new customer registered with your store. Below are the customer's details:{0}
{0}Full name: %Customer.FullName%{0}
{0}Email: %Customer.Email%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewReturnRequestStoreOwnerNotification, - Subject = "%Store.Name%. New return request.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% has just submitted a new return request. Details are below:{0}
{0}Request ID: %ReturnRequest.CustomNumber%{0}
{0}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{0}
{0}Reason for return: %ReturnRequest.Reason%{0}
{0}Requested action: %ReturnRequest.RequestedAction%{0}
{0}Customer comments:{0}
{0}%ReturnRequest.CustomerComment%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewReturnRequestCustomerNotification, - Subject = "%Store.Name%. New return request.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%!{0}
{0}You have just submitted a new return request. Details are below:{0}
{0}Request ID: %ReturnRequest.CustomNumber%{0}
{0}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{0}
{0}Reason for return: %ReturnRequest.Reason%{0}
{0}Requested action: %ReturnRequest.RequestedAction%{0}
{0}Customer comments:{0}
{0}%ReturnRequest.CustomerComment%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewsCommentNotification, - Subject = "%Store.Name%. New news comment.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new news comment has been created for news \"%NewsComment.NewsTitle%\".{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewsletterSubscriptionActivationMessage, - Subject = "%Store.Name%. Subscription activation message.", - Body = string.Format("

{0}Click here to confirm your subscription to our list.{0}

{0}

{0}If you received this email by mistake, simply delete it.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewsletterSubscriptionDeactivationMessage, - Subject = "%Store.Name%. Subscription deactivation message.", - Body = string.Format("

{0}Click here to unsubscribe from our newsletter.{0}

{0}

{0}If you received this email by mistake, simply delete it.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewVatSubmittedStoreOwnerNotification, - Subject = "%Store.Name%. New VAT number is submitted.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just submitted a new VAT number. Details are below:{0}
{0}VAT number: %Customer.VatNumber%{0}
{0}VAT number status: %Customer.VatNumberStatus%{0}
{0}Received name: %VatValidationResult.Name%{0}
{0}Received address: %VatValidationResult.Address%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderCancelledCustomerNotification, - Subject = "%Store.Name%. Your order cancelled", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Your order has been cancelled. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderCompletedCustomerNotification, - Subject = "%Store.Name%. Your order completed", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Your order has been completed. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ShipmentDeliveredCustomerNotification, - Subject = "Your order from %Store.Name% has been delivered.", - Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Good news! You order has been delivered.{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% Delivered Products:{0}
{0}
{0}%Shipment.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPlacedCustomerNotification, - Subject = "Order receipt from %Store.Name%.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPlacedStoreOwnerNotification, - Subject = "%Store.Name%. Purchase Receipt for Order #%Order.OrderNumber%", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Order.CustomerFullName% (%Order.CustomerEmail%) has just placed an order from your store. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ShipmentSentCustomerNotification, - Subject = "Your order from %Store.Name% has been shipped.", - Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%!,{0}
{0}Good news! You order has been shipped.{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% Shipped Products:{0}
{0}
{0}%Shipment.Product(s)%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ProductReviewNotification, - Subject = "%Store.Name%. New product review.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new product review has been written for product \"%ProductReview.ProductName%\".{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.QuantityBelowStoreOwnerNotification, - Subject = "%Store.Name%. Quantity below notification. %Product.Name%", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Product.Name% (ID: %Product.ID%) low quantity.{0}
{0}
{0}Quantity: %Product.StockQuantity%{0}
{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.QuantityBelowAttributeCombinationStoreOwnerNotification, - Subject = "%Store.Name%. Quantity below notification. %Product.Name%", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Product.Name% (ID: %Product.ID%) low quantity.{0}
{0}%AttributeCombination.Formatted%{0}
{0}Quantity: %AttributeCombination.StockQuantity%{0}
{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ReturnRequestStatusChangedCustomerNotification, - Subject = "%Store.Name%. Return request status was changed.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}Your return request #%ReturnRequest.CustomNumber% status has been changed.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.EmailAFriendMessage, - Subject = "%Store.Name%. Referred Item", - Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}%EmailAFriend.Email% was shopping on %Store.Name% and wanted to share the following item with you.{0}
{0}
{0}%Product.Name%{0}
{0}%Product.ShortDescription%{0}
{0}
{0}For more info click here{0}
{0}
{0}
{0}%EmailAFriend.PersonalMessage%{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.WishlistToFriendMessage, - Subject = "%Store.Name%. Wishlist", - Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}%Wishlist.Email% was shopping on %Store.Name% and wanted to share a wishlist with you.{0}
{0}
{0}
{0}For more info click here{0}
{0}
{0}
{0}%Wishlist.PersonalMessage%{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewOrderNoteAddedCustomerNotification, - Subject = "%Store.Name%. New order note has been added", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}New order note has been added to your account:{0}
{0}\"%Order.NewNoteText%\".{0}
{0}%Order.OrderURLForCustomer%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.RecurringPaymentCancelledStoreOwnerNotification, - Subject = "%Store.Name%. Recurring payment cancelled", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%if (%RecurringPayment.CancelAfterFailedPayment%) The last payment for the recurring payment ID=%RecurringPayment.ID% failed, so it was cancelled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) %Customer.FullName% (%Customer.Email%) has just cancelled a recurring payment ID=%RecurringPayment.ID%. endif%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.RecurringPaymentCancelledCustomerNotification, - Subject = "%Store.Name%. Recurring payment cancelled", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}%if (%RecurringPayment.CancelAfterFailedPayment%) It appears your credit card didn't go through for this recurring payment (%Order.OrderURLForCustomer%){0}
{0}So your subscription has been canceled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) The recurring payment ID=%RecurringPayment.ID% was cancelled. endif%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.RecurringPaymentFailedCustomerNotification, - Subject = "%Store.Name%. Last recurring payment failed", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}It appears your credit card didn't go through for this recurring payment (%Order.OrderURLForCustomer%){0}
%if (%RecurringPayment.RecurringPaymentType% == \"Manual\") {0}You can recharge balance and manually retry payment or cancel it on the order history page. endif% %if (%RecurringPayment.RecurringPaymentType% == \"Automatic\") {0}You can recharge balance and wait, we will try to make the payment again, or you can cancel it on the order history page. endif%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPlacedVendorNotification, - Subject = "%Store.Name%. Order placed", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just placed an order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}%Order.Product(s)%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderRefundedCustomerNotification, - Subject = "%Store.Name%. Order #%Order.OrderNumber% refunded", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Order #%Order.OrderNumber% has been has been refunded. Please allow 7-14 days for the refund to be reflected in your account.{0}
{0}
{0}Amount refunded: %Order.AmountRefunded%{0}
{0}
{0}Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderRefundedStoreOwnerNotification, - Subject = "%Store.Name%. Order #%Order.OrderNumber% refunded", - Body = string.Format("%Store.Name%. Order #%Order.OrderNumber% refunded', N'{0}

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just refunded{0}
{0}
{0}Amount refunded: %Order.AmountRefunded%{0}
{0}
{0}Date Ordered: %Order.CreatedOn%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPaidStoreOwnerNotification, - Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just paid{0}
{0}Date Ordered: %Order.CreatedOn%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPaidCustomerNotification, - Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Order #%Order.OrderNumber% has been just paid. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.OrderPaidVendorNotification, - Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just paid.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}%Order.Product(s)%{0}

{0}", Environment.NewLine), - //this template is disabled by default - IsActive = false, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.NewVendorAccountApplyStoreOwnerNotification, - Subject = "%Store.Name%. New vendor account submitted.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just submitted for a vendor account. Details are below:{0}
{0}Vendor name: %Vendor.Name%{0}
{0}Vendor email: %Vendor.Email%{0}
{0}
{0}You can activate it in admin area.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.VendorInformationChangeNotification, - Subject = "%Store.Name%. Vendor information change.", - Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Vendor %Vendor.Name% (%Vendor.Email%) has just changed information about itself.{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ContactUsMessage, - Subject = "%Store.Name%. Contact us", - Body = string.Format("

{0}%ContactUs.Body%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - }, - new MessageTemplate - { - Name = MessageTemplateSystemNames.ContactVendorMessage, - Subject = "%Store.Name%. Contact us", - Body = string.Format("

{0}%ContactUs.Body%{0}

{0}", Environment.NewLine), - IsActive = true, - EmailAccountId = eaGeneral.Id, - } - }; - _messageTemplateRepository.Insert(messageTemplates); - } - - protected virtual void InstallTopics() - { - var defaultTopicTemplate = - _topicTemplateRepository.Table.FirstOrDefault(tt => tt.Name == "Default template"); - if (defaultTopicTemplate == null) - throw new Exception("Topic template cannot be loaded"); - - var topics = new List - { - new Topic - { - SystemName = "AboutUs", - IncludeInSitemap = false, - IsPasswordProtected = false, - IncludeInFooterColumn1 = true, - DisplayOrder = 20, - Published = true, - Title = "About us", - Body = "

Put your "About Us" information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "CheckoutAsGuestOrRegister", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "", - Body = "

Register and save time!
Register with us for future convenience:

  • Fast and easy check out
  • Easy access to your order history and status
", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "ConditionsOfUse", - IncludeInSitemap = false, - IsPasswordProtected = false, - IncludeInFooterColumn1 = true, - DisplayOrder = 15, - Published = true, - Title = "Conditions of Use", - Body = "

Put your conditions of use information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "ContactUs", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "", - Body = "

Put your contact information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "ForumWelcomeMessage", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "Forums", - Body = "

Put your welcome message here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "HomePageText", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "Welcome to our store", - Body = "

Online shopping is the process consumers go through to purchase products or services over the Internet. You can edit this in the admin site.

If you have questions, see the Documentation, or post in the Forums at nopCommerce.com

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "LoginRegistrationInfo", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "About login / registration", - Body = "

Put your login / registration information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "PrivacyInfo", - IncludeInSitemap = false, - IsPasswordProtected = false, - IncludeInFooterColumn1 = true, - DisplayOrder = 10, - Published = true, - Title = "Privacy notice", - Body = "

Put your privacy policy information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "PageNotFound", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "", - Body = "

The page you requested was not found, and we have a fine guess why.

  • If you typed the URL directly, please make sure the spelling is correct.
  • The page no longer exists. In this case, we profusely apologize for the inconvenience and for any damage this may cause.
", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "ShippingInfo", - IncludeInSitemap = false, - IsPasswordProtected = false, - IncludeInFooterColumn1 = true, - DisplayOrder = 5, - Published = true, - Title = "Shipping & returns", - Body = "

Put your shipping & returns information here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - new Topic - { - SystemName = "ApplyVendor", - IncludeInSitemap = false, - IsPasswordProtected = false, - DisplayOrder = 1, - Published = true, - Title = "", - Body = "

Put your apply vendor instructions here. You can edit this in the admin site.

", - TopicTemplateId = defaultTopicTemplate.Id - }, - }; - _topicRepository.Insert(topics); - - - //search engine names - foreach (var topic in topics) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = topic.Id, - EntityName = "Topic", - LanguageId = 0, - IsActive = true, - Slug = topic.ValidateSeName("", !String.IsNullOrEmpty(topic.Title) ? topic.Title : topic.SystemName, true) - }); - } - - } - - protected virtual void InstallSettings(bool installSampleData) - { - var settingService = EngineContext.Current.Resolve(); - settingService.SaveSetting(new PdfSettings - { - LogoPictureId = 0, - LetterPageSizeEnabled = false, - RenderOrderNotes = true, - FontFileName = "FreeSerif.ttf", - InvoiceFooterTextColumn1 = null, - InvoiceFooterTextColumn2 = null, - }); - - settingService.SaveSetting(new CommonSettings - { - UseSystemEmailForContactUsForm = true, - UseStoredProceduresIfSupported = true, - UseStoredProcedureForLoadingCategories = false, - SitemapEnabled = true, - SitemapIncludeCategories = true, - SitemapIncludeManufacturers = true, - SitemapIncludeProducts = false, - DisplayJavaScriptDisabledWarning = false, - UseFullTextSearch = false, - FullTextMode = FulltextSearchMode.ExactMatch, - Log404Errors = true, - BreadcrumbDelimiter = "/", - RenderXuaCompatible = false, - XuaCompatibleValue = "IE=edge", - BbcodeEditorOpenLinksInNewWindow = false - }); - - settingService.SaveSetting(new SeoSettings - { - PageTitleSeparator = ". ", - PageTitleSeoAdjustment = PageTitleSeoAdjustment.PagenameAfterStorename, - DefaultTitle = "Your store", - DefaultMetaKeywords = "", - DefaultMetaDescription = "", - GenerateProductMetaDescription = true, - ConvertNonWesternChars = false, - AllowUnicodeCharsInUrls = true, - CanonicalUrlsEnabled = false, - WwwRequirement = WwwRequirement.NoMatter, - //we disable bundling out of the box because it requires a lot of server resources - EnableJsBundling = false, - EnableCssBundling = false, - TwitterMetaTags = true, - OpenGraphMetaTags = true, - ReservedUrlRecordSlugs = new List - { - "admin", - "install", - "recentlyviewedproducts", - "newproducts", - "compareproducts", - "clearcomparelist", - "setproductreviewhelpfulness", - "login", - "register", - "logout", - "cart", - "wishlist", - "emailwishlist", - "checkout", - "onepagecheckout", - "contactus", - "passwordrecovery", - "subscribenewsletter", - "blog", - "boards", - "inboxupdate", - "sentupdate", - "news", - "sitemap", - "search", - "config", - "eucookielawaccept", - "page-not-found", - //system names are not allowed (anyway they will cause a runtime error), - "con", - "lpt1", - "lpt2", - "lpt3", - "lpt4", - "lpt5", - "lpt6", - "lpt7", - "lpt8", - "lpt9", - "com1", - "com2", - "com3", - "com4", - "com5", - "com6", - "com7", - "com8", - "com9", - "null", - "prn", - "aux" - }, - CustomHeadTags = "" - }); - - settingService.SaveSetting(new AdminAreaSettings - { - DefaultGridPageSize = 15, - PopupGridPageSize = 10, - GridPageSizes = "10, 15, 20, 50, 100", - RichEditorAdditionalSettings = null, - RichEditorAllowJavaScript = false, - UseRichEditorInMessageTemplates = false, - UseIsoDateTimeConverterInJson = true - }); - - - settingService.SaveSetting(new ProductEditorSettings - { - Weight = true, - Dimensions = true, - ProductAttributes = true, - SpecificationAttributes =true - }); - - settingService.SaveSetting(new CatalogSettings - { - AllowViewUnpublishedProductPage = true, - DisplayDiscontinuedMessageForUnpublishedProducts = true, - PublishBackProductWhenCancellingOrders = false, - ShowSkuOnProductDetailsPage = true, - ShowSkuOnCatalogPages = false, - ShowManufacturerPartNumber = false, - ShowGtin = false, - ShowFreeShippingNotification = true, - AllowProductSorting = true, - AllowProductViewModeChanging = true, - DefaultViewMode = "grid", - ShowProductsFromSubcategories = false, - ShowCategoryProductNumber = false, - ShowCategoryProductNumberIncludingSubcategories = false, - CategoryBreadcrumbEnabled = true, - ShowShareButton = true, - PageShareCode = "
", - ProductReviewsMustBeApproved = false, - DefaultProductRatingValue = 5, - AllowAnonymousUsersToReviewProduct = false, - ProductReviewPossibleOnlyAfterPurchasing = false, - NotifyStoreOwnerAboutNewProductReviews = false, - EmailAFriendEnabled = true, - AllowAnonymousUsersToEmailAFriend = false, - RecentlyViewedProductsNumber = 3, - RecentlyViewedProductsEnabled = true, - NewProductsNumber = 6, - NewProductsEnabled = true, - CompareProductsEnabled = true, - CompareProductsNumber = 4, - ProductSearchAutoCompleteEnabled = true, - ProductSearchAutoCompleteNumberOfProducts = 10, - ProductSearchTermMinimumLength = 3, - ShowProductImagesInSearchAutoComplete = false, - ShowBestsellersOnHomepage = false, - NumberOfBestsellersOnHomepage = 4, - SearchPageProductsPerPage = 6, - SearchPageAllowCustomersToSelectPageSize = true, - SearchPagePageSizeOptions = "6, 3, 9, 18", - ProductsAlsoPurchasedEnabled = true, - ProductsAlsoPurchasedNumber = 4, - AjaxProcessAttributeChange = true, - NumberOfProductTags = 15, - ProductsByTagPageSize = 6, - IncludeShortDescriptionInCompareProducts = false, - IncludeFullDescriptionInCompareProducts = false, - IncludeFeaturedProductsInNormalLists = false, - DisplayTierPricesWithDiscounts = true, - IgnoreDiscounts = false, - IgnoreFeaturedProducts = false, - IgnoreAcl = true, - IgnoreStoreLimitations = true, - CacheProductPrices = false, - ProductsByTagAllowCustomersToSelectPageSize = true, - ProductsByTagPageSizeOptions = "6, 3, 9, 18", - MaximumBackInStockSubscriptions = 200, - ManufacturersBlockItemsToDisplay = 2, - DisplayTaxShippingInfoFooter = false, - DisplayTaxShippingInfoProductDetailsPage = false, - DisplayTaxShippingInfoProductBoxes = false, - DisplayTaxShippingInfoShoppingCart = false, - DisplayTaxShippingInfoWishlist = false, - DisplayTaxShippingInfoOrderDetailsPage = false, - DefaultCategoryPageSizeOptions = "6, 3, 9", - DefaultCategoryPageSize = 6, - DefaultManufacturerPageSizeOptions = "6, 3, 9", - DefaultManufacturerPageSize = 6, - ShowProductReviewsTabOnAccountPage = true, - ProductReviewsPageSizeOnAccountPage = 10, - ExportImportProductAttributes = true, - ExportImportUseDropdownlistsForAssociatedEntities = true - }); - - settingService.SaveSetting(new LocalizationSettings - { - DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id, - UseImagesForLanguageSelection = false, - SeoFriendlyUrlsForLanguagesEnabled = false, - AutomaticallyDetectLanguage = false, - LoadAllLocaleRecordsOnStartup = true, - LoadAllLocalizedPropertiesOnStartup = true, - LoadAllUrlRecordsOnStartup = false, - IgnoreRtlPropertyForAdminArea = false - }); - - settingService.SaveSetting(new CustomerSettings - { - UsernamesEnabled = false, - CheckUsernameAvailabilityEnabled = false, - AllowUsersToChangeUsernames = false, - DefaultPasswordFormat = PasswordFormat.Hashed, - HashedPasswordFormat = "SHA1", - PasswordMinLength = 6, - UnduplicatedPasswordsNumber = 4, - PasswordRecoveryLinkDaysValid = 7, - PasswordLifetime = 90, - FailedPasswordAllowedAttempts = 0, - FailedPasswordLockoutMinutes = 30, - UserRegistrationType = UserRegistrationType.Standard, - AllowCustomersToUploadAvatars = false, - AvatarMaximumSizeBytes = 20000, - DefaultAvatarEnabled = true, - ShowCustomersLocation = false, - ShowCustomersJoinDate = false, - AllowViewingProfiles = false, - NotifyNewCustomerRegistration = false, - HideDownloadableProductsTab = false, - HideBackInStockSubscriptionsTab = false, - DownloadableProductsValidateUser = false, - CustomerNameFormat = CustomerNameFormat.ShowFirstName, - GenderEnabled = true, - DateOfBirthEnabled = true, - DateOfBirthRequired = false, - DateOfBirthMinimumAge = null, - CompanyEnabled = true, - StreetAddressEnabled = false, - StreetAddress2Enabled = false, - ZipPostalCodeEnabled = false, - CityEnabled = false, - CountryEnabled = false, - CountryRequired = false, - StateProvinceEnabled = false, - StateProvinceRequired = false, - PhoneEnabled = false, - FaxEnabled = false, - AcceptPrivacyPolicyEnabled = false, - NewsletterEnabled = true, - NewsletterTickedByDefault = true, - HideNewsletterBlock = false, - NewsletterBlockAllowToUnsubscribe = false, - OnlineCustomerMinutes = 20, - StoreLastVisitedPage = false, - SuffixDeletedCustomers = false, - EnteringEmailTwice = false, - RequireRegistrationForDownloadableProducts = false, - DeleteGuestTaskOlderThanMinutes = 1440 - }); - - settingService.SaveSetting(new AddressSettings - { - CompanyEnabled = true, - StreetAddressEnabled = true, - StreetAddressRequired = true, - StreetAddress2Enabled = true, - ZipPostalCodeEnabled = true, - ZipPostalCodeRequired = true, - CityEnabled = true, - CityRequired = true, - CountryEnabled = true, - StateProvinceEnabled = true, - PhoneEnabled = true, - PhoneRequired = true, - FaxEnabled = true, - }); - - settingService.SaveSetting(new MediaSettings - { - AvatarPictureSize = 120, - ProductThumbPictureSize = 415, - ProductDetailsPictureSize = 550, - ProductThumbPictureSizeOnProductDetailsPage = 100, - AssociatedProductPictureSize = 220, - CategoryThumbPictureSize = 450, - ManufacturerThumbPictureSize = 420, - VendorThumbPictureSize = 450, - CartThumbPictureSize = 80, - MiniCartThumbPictureSize = 70, - AutoCompleteSearchThumbPictureSize = 20, - ImageSquarePictureSize = 32, - MaximumImageSize = 1980, - DefaultPictureZoomEnabled = false, - DefaultImageQuality = 80, - MultipleThumbDirectories = false, - ImportProductImagesUsingHash = true, - AzureCacheControlHeader = string.Empty - }); - - settingService.SaveSetting(new StoreInformationSettings - { - StoreClosed = false, - DefaultStoreTheme = "DefaultClean", - AllowCustomerToSelectTheme = false, - DisplayMiniProfilerInPublicStore = false, - DisplayMiniProfilerForAdminOnly = false, - DisplayEuCookieLawWarning = false, - FacebookLink = "http://www.facebook.com/nopCommerce", - TwitterLink = "https://twitter.com/nopCommerce", - YoutubeLink = "http://www.youtube.com/user/nopCommerce", - GooglePlusLink = "https://plus.google.com/+nopcommerce", - HidePoweredByNopCommerce = false - }); - - settingService.SaveSetting(new ExternalAuthenticationSettings - { - AutoRegisterEnabled = true, - RequireEmailValidation = false - }); - - settingService.SaveSetting(new RewardPointsSettings - { - Enabled = true, - ExchangeRate = 1, - PointsForRegistration = 0, - PointsForPurchases_Amount = 10, - PointsForPurchases_Points = 1, - ActivationDelay = 0, - ActivationDelayPeriodId = 0, - DisplayHowMuchWillBeEarned = true, - PointsAccumulatedForAllStores = true, - PageSize = 10 - }); - - settingService.SaveSetting(new CurrencySettings - { - DisplayCurrencyLabel = false, - PrimaryStoreCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id, - PrimaryExchangeRateCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id, - ActiveExchangeRateProviderSystemName = "CurrencyExchange.MoneyConverter", - AutoUpdateEnabled = false - }); - - settingService.SaveSetting(new MeasureSettings - { - BaseDimensionId = _measureDimensionRepository.Table.Single(m => m.SystemKeyword == "inches").Id, - BaseWeightId = _measureWeightRepository.Table.Single(m => m.SystemKeyword == "lb").Id, - }); - - settingService.SaveSetting(new MessageTemplatesSettings - { - CaseInvariantReplacement = false, - Color1 = "#b9babe", - Color2 = "#ebecee", - Color3 = "#dde2e6", - }); - - settingService.SaveSetting(new ShoppingCartSettings - { - DisplayCartAfterAddingProduct = false, - DisplayWishlistAfterAddingProduct = false, - MaximumShoppingCartItems = 1000, - MaximumWishlistItems = 1000, - AllowOutOfStockItemsToBeAddedToWishlist = false, - MoveItemsFromWishlistToCart = true, - CartsSharedBetweenStores = false, - ShowProductImagesOnShoppingCart = true, - ShowProductImagesOnWishList = true, - ShowDiscountBox = true, - ShowGiftCardBox = true, - CrossSellsNumber = 4, - EmailWishlistEnabled = true, - AllowAnonymousUsersToEmailWishlist = false, - MiniShoppingCartEnabled = true, - ShowProductImagesInMiniShoppingCart = true, - MiniShoppingCartProductNumber = 5, - RoundPricesDuringCalculation = true, - GroupTierPricesForDistinctShoppingCartItems = false, - AllowCartItemEditing = true, - RenderAssociatedAttributeValueQuantity = true - }); - - settingService.SaveSetting(new OrderSettings - { - ReturnRequestNumberMask = "{ID}", - IsReOrderAllowed = true, - MinOrderSubtotalAmount = 0, - MinOrderSubtotalAmountIncludingTax = false, - MinOrderTotalAmount = 0, - AutoUpdateOrderTotalsOnEditingOrder = false, - AnonymousCheckoutAllowed = true, - TermsOfServiceOnShoppingCartPage = true, - TermsOfServiceOnOrderConfirmPage = false, - OnePageCheckoutEnabled = true, - OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab = false, - DisableBillingAddressCheckoutStep = false, - DisableOrderCompletedPage = false, - AttachPdfInvoiceToOrderPlacedEmail = false, - AttachPdfInvoiceToOrderCompletedEmail = false, - GeneratePdfInvoiceInCustomerLanguage = true, - AttachPdfInvoiceToOrderPaidEmail = false, - ReturnRequestsEnabled = true, - ReturnRequestsAllowFiles = false, - ReturnRequestsFileMaximumSize = 2048, - NumberOfDaysReturnRequestAvailable = 365, - MinimumOrderPlacementInterval = 30, - ActivateGiftCardsAfterCompletingOrder = false, - DeactivateGiftCardsAfterCancellingOrder = false, - DeactivateGiftCardsAfterDeletingOrder = false, - CompleteOrderWhenDelivered = true, - CustomOrderNumberMask = "{ID}", - ExportWithProducts = true - }); - - settingService.SaveSetting(new SecuritySettings - { - ForceSslForAllPages = false, - EncryptionKey = CommonHelper.GenerateRandomDigitCode(16), - AdminAreaAllowedIpAddresses = null, - EnableXsrfProtectionForAdminArea = true, - EnableXsrfProtectionForPublicStore = true, - HoneypotEnabled = false, - HoneypotInputName = "hpinput" - }); - - settingService.SaveSetting(new ShippingSettings - { - ActiveShippingRateComputationMethodSystemNames = new List { "Shipping.FixedOrByWeight" }, - ActivePickupPointProviderSystemNames = new List { "Pickup.PickupInStore" }, - ShipToSameAddress = true, - AllowPickUpInStore = true, - DisplayPickupPointsOnMap = false, - UseWarehouseLocation = false, - NotifyCustomerAboutShippingFromMultipleLocations = false, - FreeShippingOverXEnabled = false, - FreeShippingOverXValue = decimal.Zero, - FreeShippingOverXIncludingTax = false, - EstimateShippingEnabled = true, - DisplayShipmentEventsToCustomers = false, - DisplayShipmentEventsToStoreOwner = false, - HideShippingTotal = false, - ReturnValidOptionsIfThereAreAny = true, - BypassShippingMethodSelectionIfOnlyOne = false, - UseCubeRootMethod = true, - ConsiderAssociatedProductsDimensions = true - }); - - settingService.SaveSetting(new PaymentSettings - { - ActivePaymentMethodSystemNames = new List - { - "Payments.CheckMoneyOrder", - "Payments.Manual", - "Payments.PayInStore", - "Payments.PurchaseOrder", - }, - AllowRePostingPayments = true, - BypassPaymentMethodSelectionIfOnlyOne = true, - ShowPaymentMethodDescriptions = true, - SkipPaymentInfoStepForRedirectionPaymentMethods = false, - CancelRecurringPaymentsAfterFailedPayment = false - }); - - settingService.SaveSetting(new TaxSettings - { - TaxBasedOn = TaxBasedOn.BillingAddress, - TaxBasedOnPickupPointAddress = false, - TaxDisplayType = TaxDisplayType.ExcludingTax, - ActiveTaxProviderSystemName = "Tax.FixedOrByCountryStateZip", - DefaultTaxAddressId = 0, - DisplayTaxSuffix = false, - DisplayTaxRates = false, - PricesIncludeTax = false, - AllowCustomersToSelectTaxDisplayType = false, - ForceTaxExclusionFromOrderSubtotal = false, - DefaultTaxCategoryId = 0, - HideZeroTax = false, - HideTaxInOrderSummary = false, - ShippingIsTaxable = false, - ShippingPriceIncludesTax = false, - ShippingTaxClassId = 0, - PaymentMethodAdditionalFeeIsTaxable = false, - PaymentMethodAdditionalFeeIncludesTax = false, - PaymentMethodAdditionalFeeTaxClassId = 0, - EuVatEnabled = false, - EuVatShopCountryId = 0, - EuVatAllowVatExemption = true, - EuVatUseWebService = false, - EuVatAssumeValid = false, - EuVatEmailAdminWhenNewVatSubmitted = false, - LogErrors = false - }); - - settingService.SaveSetting(new DateTimeSettings - { - DefaultStoreTimeZoneId = "", - AllowCustomersToSetTimeZone = false - }); - - settingService.SaveSetting(new BlogSettings - { - Enabled = true, - PostsPageSize = 10, - AllowNotRegisteredUsersToLeaveComments = true, - NotifyAboutNewBlogComments = false, - NumberOfTags = 15, - ShowHeaderRssUrl = false, - BlogCommentsMustBeApproved = false, - ShowBlogCommentsPerStore = false - }); - settingService.SaveSetting(new NewsSettings - { - Enabled = true, - AllowNotRegisteredUsersToLeaveComments = true, - NotifyAboutNewNewsComments = false, - ShowNewsOnMainPage = true, - MainPageNewsCount = 3, - NewsArchivePageSize = 10, - ShowHeaderRssUrl = false, - NewsCommentsMustBeApproved = false, - ShowNewsCommentsPerStore = false - }); - - settingService.SaveSetting(new ForumSettings - { - ForumsEnabled = false, - RelativeDateTimeFormattingEnabled = true, - AllowCustomersToDeletePosts = false, - AllowCustomersToEditPosts = false, - AllowCustomersToManageSubscriptions = false, - AllowGuestsToCreatePosts = false, - AllowGuestsToCreateTopics = false, - AllowPostVoting = true, - MaxVotesPerDay = 30, - TopicSubjectMaxLength = 450, - PostMaxLength = 4000, - StrippedTopicMaxLength = 45, - TopicsPageSize = 10, - PostsPageSize = 10, - SearchResultsPageSize = 10, - ActiveDiscussionsPageSize = 50, - LatestCustomerPostsPageSize = 10, - ShowCustomersPostCount = true, - ForumEditor = EditorType.BBCodeEditor, - SignaturesEnabled = true, - AllowPrivateMessages = false, - ShowAlertForPM = false, - PrivateMessagesPageSize = 10, - ForumSubscriptionsPageSize = 10, - NotifyAboutPrivateMessages = false, - PMSubjectMaxLength = 450, - PMTextMaxLength = 4000, - HomePageActiveDiscussionsTopicCount = 5, - ActiveDiscussionsFeedEnabled = false, - ActiveDiscussionsFeedCount = 25, - ForumFeedsEnabled = false, - ForumFeedCount = 10, - ForumSearchTermMinimumLength = 3, - }); - - settingService.SaveSetting(new VendorSettings - { - DefaultVendorPageSizeOptions = "6, 3, 9", - VendorsBlockItemsToDisplay = 0, - ShowVendorOnProductDetailsPage = true, - AllowCustomersToContactVendors = true, - AllowCustomersToApplyForVendorAccount = true, - AllowVendorsToEditInfo = false, - NotifyStoreOwnerAboutVendorInformationChange = true, - MaximumProductNumber = 3000, - AllowVendorsToImportProducts = true - }); - - var eaGeneral = _emailAccountRepository.Table.FirstOrDefault(); - if (eaGeneral == null) - throw new Exception("Default email account cannot be loaded"); - settingService.SaveSetting(new EmailAccountSettings - { - DefaultEmailAccountId = eaGeneral.Id - }); - - settingService.SaveSetting(new WidgetSettings - { - ActiveWidgetSystemNames = new List { "Widgets.NivoSlider" }, - }); - - settingService.SaveSetting(new DisplayDefaultMenuItemSettings - { - DisplayHomePageMenuItem = !installSampleData, - DisplayNewProductsMenuItem = !installSampleData, - DisplayProductSearchMenuItem = !installSampleData, - DisplayCustomerInfoMenuItem = !installSampleData, - DisplayBlogMenuItem = !installSampleData, - DisplayForumsMenuItem = !installSampleData, - DisplayContactUsMenuItem = !installSampleData - }); - } - - protected virtual void InstallCheckoutAttributes() - { - var ca1 = new CheckoutAttribute - { - Name = "Gift wrapping", - IsRequired = true, - ShippableProductRequired = true, - AttributeControlType = AttributeControlType.DropdownList, - DisplayOrder = 1, - }; - ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue - { - Name = "No", - PriceAdjustment = 0, - DisplayOrder = 1, - IsPreSelected = true, - }); - ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue - { - Name = "Yes", - PriceAdjustment = 10, - DisplayOrder = 2, - }); - var checkoutAttributes = new List - { - ca1, - }; - _checkoutAttributeRepository.Insert(checkoutAttributes); - } - - protected virtual void InstallSpecificationAttributes() - { - var sa1 = new SpecificationAttribute - { - Name = "Screensize", - DisplayOrder = 1, - }; - sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "13.0''", - DisplayOrder = 2, - }); - sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "13.3''", - DisplayOrder = 3, - }); - sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "14.0''", - DisplayOrder = 4, - }); - sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "15.0''", - DisplayOrder = 4, - }); - sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "15.6''", - DisplayOrder = 5, - }); - var sa2 = new SpecificationAttribute - { - Name = "CPU Type", - DisplayOrder = 2, - }; - sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "Intel Core i5", - DisplayOrder = 1, - }); - sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "Intel Core i7", - DisplayOrder = 2, - }); - var sa3 = new SpecificationAttribute - { - Name = "Memory", - DisplayOrder = 3, - }; - sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "4 GB", - DisplayOrder = 1, - }); - sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "8 GB", - DisplayOrder = 2, - }); - sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "16 GB", - DisplayOrder = 3, - }); - var sa4 = new SpecificationAttribute - { - Name = "Hardrive", - DisplayOrder = 5, - }; - sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "128 GB", - DisplayOrder = 7, - }); - sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "500 GB", - DisplayOrder = 4, - }); - sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "1 TB", - DisplayOrder = 3, - }); - var sa5 = new SpecificationAttribute - { - Name = "Color", - DisplayOrder = 1, - }; - sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "Grey", - DisplayOrder = 2, - ColorSquaresRgb = "#8a97a8" - }); - sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "Red", - DisplayOrder = 3, - ColorSquaresRgb = "#8a374a" - }); - sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption - { - Name = "Blue", - DisplayOrder = 4, - ColorSquaresRgb = "#47476f" - }); - var specificationAttributes = new List - { - sa1, - sa2, - sa3, - sa4, - sa5 - }; - _specificationAttributeRepository.Insert(specificationAttributes); - } - - protected virtual void InstallProductAttributes() - { - var productAttributes = new List - { - new ProductAttribute - { - Name = "Color", - }, - new ProductAttribute - { - Name = "Print", - }, - new ProductAttribute - { - Name = "Custom Text", - }, - new ProductAttribute - { - Name = "HDD", - }, - new ProductAttribute - { - Name = "OS", - }, - new ProductAttribute - { - Name = "Processor", - }, - new ProductAttribute - { - Name = "RAM", - }, - new ProductAttribute - { - Name = "Size", - }, - new ProductAttribute - { - Name = "Software", - }, - }; - _productAttributeRepository.Insert(productAttributes); - } - - protected virtual void InstallCategories() - { - //pictures - var pictureService = EngineContext.Current.Resolve(); - var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); - - - - var categoryTemplateInGridAndLines = _categoryTemplateRepository - .Table.FirstOrDefault(pt => pt.Name == "Products in Grid or Lines"); - if (categoryTemplateInGridAndLines == null) - throw new Exception("Category template cannot be loaded"); - - - //categories - var allCategories = new List(); - var categoryComputers = new Category - { - Name = "Computers", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_computers.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Computers")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryComputers); - _categoryRepository.Insert(categoryComputers); - - - var categoryDesktops = new Category - { - Name = "Desktops", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryComputers.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_desktops.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Desktops")).Id, - PriceRanges = "-1000;1000-1200;1200-;", - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryDesktops); - _categoryRepository.Insert(categoryDesktops); - - - var categoryNotebooks = new Category - { - Name = "Notebooks", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryComputers.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_notebooks.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Notebooks")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 2, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryNotebooks); - _categoryRepository.Insert(categoryNotebooks); - - - var categorySoftware = new Category - { - Name = "Software", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryComputers.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_software.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Software")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 3, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categorySoftware); - _categoryRepository.Insert(categorySoftware); - - - var categoryElectronics = new Category - { - Name = "Electronics", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_electronics.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Electronics")).Id, - IncludeInTopMenu = true, - Published = true, - ShowOnHomePage = true, - DisplayOrder = 2, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryElectronics); - _categoryRepository.Insert(categoryElectronics); - - - var categoryCameraPhoto = new Category - { - Name = "Camera & photo", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryElectronics.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_camera_photo.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Camera, photo")).Id, - PriceRanges = "-500;500-;", - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryCameraPhoto); - _categoryRepository.Insert(categoryCameraPhoto); - - - var categoryCellPhones = new Category - { - Name = "Cell phones", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryElectronics.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_cell_phones.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Cell phones")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 2, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryCellPhones); - _categoryRepository.Insert(categoryCellPhones); - - - var categoryOthers = new Category - { - Name = "Others", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryElectronics.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_accessories.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Accessories")).Id, - IncludeInTopMenu = true, - PriceRanges = "-100;100-;", - Published = true, - DisplayOrder = 3, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryOthers); - _categoryRepository.Insert(categoryOthers); - - - var categoryApparel = new Category - { - Name = "Apparel", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_apparel.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Apparel")).Id, - IncludeInTopMenu = true, - Published = true, - ShowOnHomePage = true, - DisplayOrder = 3, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryApparel); - _categoryRepository.Insert(categoryApparel); - - - var categoryShoes = new Category - { - Name = "Shoes", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryApparel.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_shoes.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Shoes")).Id, - PriceRanges = "-500;500-;", - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryShoes); - _categoryRepository.Insert(categoryShoes); - - - var categoryClothing = new Category - { - Name = "Clothing", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryApparel.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_clothing.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Clothing")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 2, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryClothing); - _categoryRepository.Insert(categoryClothing); - - - var categoryAccessories = new Category - { - Name = "Accessories", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - ParentCategoryId = categoryApparel.Id, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_apparel_accessories.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Apparel Accessories")).Id, - IncludeInTopMenu = true, - PriceRanges = "-100;100-;", - Published = true, - DisplayOrder = 3, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryAccessories); - _categoryRepository.Insert(categoryAccessories); - - - var categoryDigitalDownloads = new Category - { - Name = "Digital downloads", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_digital_downloads.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Digital downloads")).Id, - IncludeInTopMenu = true, - Published = true, - ShowOnHomePage = true, - DisplayOrder = 4, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryDigitalDownloads); - _categoryRepository.Insert(categoryDigitalDownloads); - - - var categoryBooks = new Category - { - Name = "Books", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - MetaKeywords = "Books, Dictionary, Textbooks", - MetaDescription = "Books category description", - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_book.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Book")).Id, - PriceRanges = "-25;25-50;50-;", - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 5, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryBooks); - _categoryRepository.Insert(categoryBooks); - - - var categoryJewelry = new Category - { - Name = "Jewelry", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_jewelry.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Jewelry")).Id, - PriceRanges = "0-500;500-700;700-3000;", - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 6, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryJewelry); - _categoryRepository.Insert(categoryJewelry); - - var categoryGiftCards = new Category - { - Name = "Gift Cards", - CategoryTemplateId = categoryTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_gift_cards.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Gift Cards")).Id, - IncludeInTopMenu = true, - Published = true, - DisplayOrder = 7, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allCategories.Add(categoryGiftCards); - _categoryRepository.Insert(categoryGiftCards); - - - - //search engine names - foreach (var category in allCategories) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = category.Id, - EntityName = "Category", - LanguageId = 0, - IsActive = true, - Slug = category.ValidateSeName("", category.Name, true) - }); - } - } - - protected virtual void InstallManufacturers() - { - var pictureService = EngineContext.Current.Resolve(); - var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); - - var manufacturerTemplateInGridAndLines = - _manufacturerTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Products in Grid or Lines"); - if (manufacturerTemplateInGridAndLines == null) - throw new Exception("Manufacturer template cannot be loaded"); - - var allManufacturers = new List(); - var manufacturerAsus = new Manufacturer - { - Name = "Apple", - ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - Published = true, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_apple.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Apple")).Id, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - _manufacturerRepository.Insert(manufacturerAsus); - allManufacturers.Add(manufacturerAsus); - - - var manufacturerHp = new Manufacturer - { - Name = "HP", - ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - Published = true, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_hp.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Hp")).Id, - DisplayOrder = 5, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - _manufacturerRepository.Insert(manufacturerHp); - allManufacturers.Add(manufacturerHp); - - - var manufacturerNike = new Manufacturer - { - Name = "Nike", - ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9", - Published = true, - PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_nike.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Nike")).Id, - DisplayOrder = 5, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - _manufacturerRepository.Insert(manufacturerNike); - allManufacturers.Add(manufacturerNike); - - //search engine names - foreach (var manufacturer in allManufacturers) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = manufacturer.Id, - EntityName = "Manufacturer", - LanguageId = 0, - IsActive = true, - Slug = manufacturer.ValidateSeName("", manufacturer.Name, true) - }); - } - } - - protected virtual void InstallProducts(string defaultUserEmail) - { - var productTemplateSimple = _productTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Simple product"); - if (productTemplateSimple == null) - throw new Exception("Simple product template could not be loaded"); - var productTemplateGrouped = _productTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Grouped product (with variants)"); - if (productTemplateGrouped == null) - throw new Exception("Grouped product template could not be loaded"); - - //delivery date - var deliveryDate = _deliveryDateRepository.Table.FirstOrDefault(); - if (deliveryDate == null) - throw new Exception("No default deliveryDate could be loaded"); - - //product availability range - var productAvailabilityRange = _productAvailabilityRangeRepository.Table.FirstOrDefault(); - if (productAvailabilityRange == null) - throw new Exception("No default product availability range could be loaded"); - - //default customer/user - var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); - if (defaultCustomer == null) - throw new Exception("Cannot load default customer"); - - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - - //pictures - var pictureService = EngineContext.Current.Resolve(); - var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); - - //downloads - var downloadService = EngineContext.Current.Resolve(); - var sampleDownloadsPath = CommonHelper.MapPath("~/content/samples/"); - - //products - var allProducts = new List(); - - #region Desktops - - - var productBuildComputer = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Build your own computer", - Sku = "COMP_CUST", - ShortDescription = "Build it", - FullDescription = "

Fight back against cluttered workspaces with the stylish IBM zBC12 All-in-One desktop PC, featuring powerful computing resources and a stunning 20.1-inch widescreen display with stunning XBRITE-HiColor LCD technology. The black IBM zBC12 has a built-in microphone and MOTION EYE camera with face-tracking technology that allows for easy communication with friends and family. And it has a built-in DVD burner and Sony's Movie Store software so you can create a digital entertainment library for personal viewing at your convenience. Easy to setup and even easier to use, this JS-series All-in-One includes an elegantly designed keyboard and a USB mouse.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "build-your-own-computer", - AllowCustomerReviews = true, - Price = 1200M, - IsShipEnabled = true, - IsFreeShipping = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - ShowOnHomePage = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Processor"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "2.2 GHz Intel Pentium Dual-Core E2200", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "2.5 GHz Intel Pentium Dual-Core E2200", - IsPreSelected = true, - PriceAdjustment = 15, - DisplayOrder = 2, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "RAM"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "2 GB", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "4GB", - PriceAdjustment = 20, - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "8GB", - PriceAdjustment = 60, - DisplayOrder = 3, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "HDD"), - AttributeControlType = AttributeControlType.RadioList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "320 GB", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "400 GB", - PriceAdjustment = 100, - DisplayOrder = 2, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "OS"), - AttributeControlType = AttributeControlType.RadioList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Vista Home", - PriceAdjustment = 50, - IsPreSelected = true, - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Vista Premium", - PriceAdjustment = 60, - DisplayOrder = 2, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Software"), - AttributeControlType = AttributeControlType.Checkboxes, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Microsoft Office", - PriceAdjustment = 50, - IsPreSelected = true, - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Acrobat Reader", - PriceAdjustment = 10, - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Total Commander", - PriceAdjustment = 5, - DisplayOrder = 2, - } - } - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productBuildComputer); - productBuildComputer.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Desktops_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBuildComputer.Name)), - DisplayOrder = 1, - }); - productBuildComputer.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Desktops_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBuildComputer.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productBuildComputer); - - - - - - var productDigitalStorm = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Digital Storm VANQUISH 3 Custom Performance PC", - Sku = "DS_VA3_PC", - ShortDescription = "Digital Storm Vanquish 3 Desktop PC", - FullDescription = "

Blow the doors off todays most demanding games with maximum detail, speed, and power for an immersive gaming experience without breaking the bank.

Stay ahead of the competition, VANQUISH 3 is fully equipped to easily handle future upgrades, keeping your system on the cutting edge for years to come.

Each system is put through an extensive stress test, ensuring you experience zero bottlenecks and get the maximum performance from your hardware.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "compaq-presario-sr1519x-pentium-4-desktop-pc-with-cdrw", - AllowCustomerReviews = true, - Price = 1259M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productDigitalStorm); - productDigitalStorm.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_DigitalStorm.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productDigitalStorm.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productDigitalStorm); - - - - - - var productLenovoIdeaCentre = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Lenovo IdeaCentre 600 All-in-One PC", - Sku = "LE_IC_600", - ShortDescription = "", - FullDescription = "

The A600 features a 21.5in screen, DVD or optional Blu-Ray drive, support for the full beans 1920 x 1080 HD, Dolby Home Cinema certification and an optional hybrid analogue/digital TV tuner.

Connectivity is handled by 802.11a/b/g - 802.11n is optional - and an ethernet port. You also get four USB ports, a Firewire slot, a six-in-one card reader and a 1.3- or two-megapixel webcam.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "hp-iq506-touchsmart-desktop-pc", - AllowCustomerReviews = true, - Price = 500M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productLenovoIdeaCentre); - productLenovoIdeaCentre.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LenovoIdeaCentre.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLenovoIdeaCentre.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productLenovoIdeaCentre); - - - - - #endregion - - #region Notebooks - - var productAppleMacBookPro = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Apple MacBook Pro 13-inch", - Sku = "AP_MBP_13", - ShortDescription = "A groundbreaking Retina display. A new force-sensing trackpad. All-flash architecture. Powerful dual-core and quad-core Intel processors. Together, these features take the notebook to a new level of performance. And they will do the same for you in everything you create.", - FullDescription = "

With fifth-generation Intel Core processors, the latest graphics, and faster flash storage, the incredibly advanced MacBook Pro with Retina display moves even further ahead in performance and battery life.* *Compared with the previous generation.

Retina display with 2560-by-1600 resolution

Fifth-generation dual-core Intel Core i5 processor

Intel Iris Graphics

Up to 9 hours of battery life1

Faster flash storage2

802.11ac Wi-Fi

Two Thunderbolt 2 ports for connecting high-performance devices and transferring data at lightning speed

Two USB 3 ports (compatible with USB 2 devices) and HDMI

FaceTime HD camera

Pages, Numbers, Keynote, iPhoto, iMovie, GarageBand included

OS X, the world's most advanced desktop operating system

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "asus-eee-pc-1000ha-10-inch-netbook", - AllowCustomerReviews = true, - Price = 1800M, - IsShipEnabled = true, - IsFreeShipping = true, - Weight = 3, - Length = 3, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 2, - OrderMaximumQuantity = 10000, - Published = true, - ShowOnHomePage = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Apple"), - DisplayOrder = 2, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.0''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 3, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB") - } - //new ProductSpecificationAttribute - //{ - // AllowFiltering = false, - // ShowOnProductPage = true, - // DisplayOrder = 4, - // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "160 GB") - //} - } - }; - allProducts.Add(productAppleMacBookPro); - productAppleMacBookPro.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_macbook_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleMacBookPro.Name)), - DisplayOrder = 1, - }); - productAppleMacBookPro.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_macbook_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleMacBookPro.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productAppleMacBookPro); - - - - - - var productAsusN551JK = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Asus N551JK-XO076H Laptop", - Sku = "AS_551_LP", - ShortDescription = "Laptop Asus N551JK Intel Core i7-4710HQ 2.5 GHz, RAM 16GB, HDD 1TB, Video NVidia GTX 850M 4GB, BluRay, 15.6, Full HD, Win 8.1", - FullDescription = "

The ASUS N550JX combines cutting-edge audio and visual technology to deliver an unsurpassed multimedia experience. A full HD wide-view IPS panel is tailor-made for watching movies and the intuitive touchscreen makes for easy, seamless navigation. ASUS has paired the N550JXs impressive display with SonicMaster Premium, co-developed with Bang & Olufsen ICEpower audio experts, for true surround sound. A quad-speaker array and external subwoofer combine for distinct vocals and a low bass that you can feel.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "asus-eee-pc-900ha-89-inch-netbook-black", - AllowCustomerReviews = true, - Price = 1500M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 3, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "16 GB") - }, - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 4, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "1 TB") - } - } - }; - allProducts.Add(productAsusN551JK); - productAsusN551JK.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_asuspc_N551JK.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAsusN551JK.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productAsusN551JK); - - - - - - var productSamsungSeries = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Samsung Series 9 NP900X4C Premium Ultrabook", - Sku = "SM_900_PU", - ShortDescription = "Samsung Series 9 NP900X4C-A06US 15-Inch Ultrabook (1.70 GHz Intel Core i5-3317U Processor, 8GB DDR3, 128GB SSD, Windows 8) Ash Black", - FullDescription = "

Designed with mobility in mind, Samsung's durable, ultra premium, lightweight Series 9 laptop (model NP900X4C-A01US) offers mobile professionals and power users a sophisticated laptop equally suited for work and entertainment. Featuring a minimalist look that is both simple and sophisticated, its polished aluminum uni-body design offers an iconic look and feel that pushes the envelope with an edge just 0.58 inches thin. This Series 9 laptop also includes a brilliant 15-inch SuperBright Plus display with HD+ technology, 128 GB Solid State Drive (SSD), 8 GB of system memory, and up to 10 hours of battery life.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "hp-pavilion-artist-edition-dv2890nr-141-inch-laptop", - AllowCustomerReviews = true, - Price = 1590M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - //ShowOnHomePage = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.0''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 3, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB") - }, - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 4, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB") - } - } - }; - allProducts.Add(productSamsungSeries); - productSamsungSeries.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_SamsungNP900X4C.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productSamsungSeries.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productSamsungSeries); - - - - - - var productHpSpectre = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "HP Spectre XT Pro UltraBook", - Sku = "HP_SPX_UB", - ShortDescription = "HP Spectre XT Pro UltraBook / Intel Core i5-2467M / 13.3 / 4GB / 128GB / Windows 7 Professional / Laptop", - FullDescription = "

Introducing HP ENVY Spectre XT, the Ultrabook designed for those who want style without sacrificing substance. It's sleek. It's thin. And with Intel. Corer i5 processor and premium materials, it's designed to go anywhere from the bistro to the boardroom, it's unlike anything you've ever seen from HP.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "hp-pavilion-elite-m9150f-desktop-pc", - AllowCustomerReviews = true, - Price = 1350M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "HP"), - DisplayOrder = 3, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.3''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 3, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB") - }, - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 4, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB") - } - } - }; - allProducts.Add(productHpSpectre); - productHpSpectre.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HPSpectreXT_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpSpectre.Name)), - DisplayOrder = 1, - }); - productHpSpectre.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HPSpectreXT_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpSpectre.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productHpSpectre); - - - - var productHpEnvy = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "HP Envy 6-1180ca 15.6-Inch Sleekbook", - Sku = "HP_ESB_15", - ShortDescription = "HP ENVY 6-1202ea Ultrabook Beats Audio, 3rd generation Intel CoreTM i7-3517U processor, 8GB RAM, 500GB HDD, Microsoft Windows 8, AMD Radeon HD 8750M (2 GB DDR3 dedicated)", - FullDescription = "The UltrabookTM that's up for anything. Thin and light, the HP ENVY is the large screen UltrabookTM with Beats AudioTM. With a soft-touch base that makes it easy to grab and go, it's a laptop that's up for anything.

Features

- Windows 8 or other operating systems available

Top performance. Stylish design. Take notice.

- At just 19.8 mm (0.78 in) thin, the HP ENVY UltrabookTM is slim and light enough to take anywhere. It's the laptop that gets you noticed with the power to get it done.
- With an eye-catching metal design, it's a laptop that you want to carry with you. The soft-touch, slip-resistant base gives you the confidence to carry it with ease.

More entertaining. More gaming. More fun.

- Own the UltrabookTM with Beats AudioTM, dual speakers, a subwoofer, and an awesome display. Your music, movies and photo slideshows will always look and sound their best.
- Tons of video memory let you experience incredible gaming and multimedia without slowing down. Create and edit videos in a flash. And enjoy more of what you love to the fullest.
- The HP ENVY UltrabookTM is loaded with the ports you'd expect on a world-class laptop, but on a Sleekbook instead. Like HDMI, USB, RJ-45, and a headphone jack. You get all the right connections without compromising size.

Only from HP.

- Life heats up. That's why there's HP CoolSense technology, which automatically adjusts your notebook's temperature based on usage and conditions. It stays cool. You stay comfortable.
- With HP ProtectSmart, your notebook's data stays safe from accidental bumps and bruises. It senses motion and plans ahead, stopping your hard drive and protecting your entire digital life.
- Keep playing even in dimly lit rooms or on red eye flights. The optional backlit keyboard[1] is full-size so you don't compromise comfort. Backlit keyboard. Another bright idea.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "hp-pavilion-g60-230us-160-inch-laptop", - AllowCustomerReviews = true, - Price = 1460M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "HP"), - DisplayOrder = 4, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 3, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB") - }, - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 4, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "500 GB") - } - } - }; - allProducts.Add(productHpEnvy); - productHpEnvy.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HpEnvy6.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpEnvy.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productHpEnvy); - - - - - - var productLenovoThinkpad = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Lenovo Thinkpad X1 Carbon Laptop", - Sku = "LE_TX1_CL", - ShortDescription = "Lenovo Thinkpad X1 Carbon Touch Intel Core i7 14 Ultrabook", - FullDescription = "

The X1 Carbon brings a new level of quality to the ThinkPad legacy of high standards and innovation. It starts with the durable, carbon fiber-reinforced roll cage, making for the best Ultrabook construction available, and adds a host of other new features on top of the old favorites. Because for 20 years, we haven't stopped innovating. And you shouldn't stop benefiting from that.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "toshiba-satellite-a305-s6908-154-inch-laptop", - AllowCustomerReviews = true, - Price = 1360M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), - DisplayOrder = 1, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = false, - ShowOnProductPage = true, - DisplayOrder = 1, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "14.0''") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = true, - DisplayOrder = 2, - SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") - } - //new ProductSpecificationAttribute - //{ - // AllowFiltering = true, - // ShowOnProductPage = true, - // DisplayOrder = 3, - // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "1 GB") - //}, - //new ProductSpecificationAttribute - //{ - // AllowFiltering = false, - // ShowOnProductPage = true, - // DisplayOrder = 4, - // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "250 GB") - //} - } - }; - allProducts.Add(productLenovoThinkpad); - productLenovoThinkpad.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LenovoThinkpad.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLenovoThinkpad.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productLenovoThinkpad); - - #endregion - - #region Software - - - var productAdobePhotoshop = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Adobe Photoshop CS4", - Sku = "AD_CS4_PH", - ShortDescription = "Easily find and view all your photos", - FullDescription = "

Adobe Photoshop CS4 software combines power and simplicity so you can make ordinary photos extraordinary; tell engaging stories in beautiful, personalized creations for print and web; and easily find and view all your photos. New Photoshop.com membership* works with Photoshop CS4 so you can protect your photos with automatic online backup and 2 GB of storage; view your photos anywhere you are; and share your photos in fun, interactive ways with invitation-only Online Albums.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "adobe-photoshop-elements-7", - AllowCustomerReviews = true, - Price = 75M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Software"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productAdobePhotoshop); - productAdobePhotoshop.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_AdobePhotoshop.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAdobePhotoshop.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productAdobePhotoshop); - - - - - - - var productWindows8Pro = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Windows 8 Pro", - Sku = "MS_WIN_8P", - ShortDescription = "Windows 8 is a Microsoft operating system that was released in 2012 as part of the company's Windows NT OS family. ", - FullDescription = "

Windows 8 Pro is comparable to Windows 7 Professional and Ultimate and is targeted towards enthusiasts and business users; it includes all the features of Windows 8. Additional features include the ability to receive Remote Desktop connections, the ability to participate in a Windows Server domain, Encrypting File System, Hyper-V, and Virtual Hard Disk Booting, Group Policy as well as BitLocker and BitLocker To Go. Windows Media Center functionality is available only for Windows 8 Pro as a separate software package.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "corel-paint-shop-pro-photo-x2", - AllowCustomerReviews = true, - Price = 65M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Software"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productWindows8Pro); - productWindows8Pro.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Windows8.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productWindows8Pro.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productWindows8Pro); - - - - - - var productSoundForge = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Sound Forge Pro 11 (recurring)", - Sku = "SF_PRO_11", - ShortDescription = "Advanced audio waveform editor.", - FullDescription = "

Sound Forge Pro is the application of choice for a generation of creative and prolific artists, producers, and editors. Record audio quickly on a rock-solid platform, address sophisticated audio processing tasks with surgical precision, and render top-notch master files with ease. New features include one-touch recording, metering for the new critical standards, more repair and restoration tools, and exclusive round-trip interoperability with SpectraLayers Pro. Taken together, these enhancements make this edition of Sound Forge Pro the deepest and most advanced audio editing platform available.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "major-league-baseball-2k9", - IsRecurring = true, - RecurringCycleLength = 30, - RecurringCyclePeriod = RecurringProductCyclePeriod.Months, - RecurringTotalCycles = 12, - AllowCustomerReviews = true, - Price = 54.99M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Software"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productSoundForge); - productSoundForge.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_SoundForge.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productSoundForge.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productSoundForge); - - - - - #endregion - - #region Camera, Photo - - - //this one is a grouped product with two associated ones - var productNikonD5500DSLR = new Product - { - ProductType = ProductType.GroupedProduct, - VisibleIndividually = true, - Name = "Nikon D5500 DSLR", - Sku = "N5500DS_0", - ShortDescription = "Slim, lightweight Nikon D5500 packs a vari-angle touchscreen", - FullDescription = "Nikon has announced its latest DSLR, the D5500. A lightweight, compact DX-format camera with a 24.2MP sensor, its the first of its type to offer a vari-angle touchscreen. The D5500 replaces the D5300 in Nikons range, and while it offers much the same features the company says its a much slimmer and lighter prospect. Theres a deep grip for easier handling and built-in Wi-Fi that lets you transfer and share shots via your phone or tablet.", - ProductTemplateId = productTemplateGrouped.Id, - //SeName = "canon-digital-slr-camera", - AllowCustomerReviews = true, - Published = true, - Price = 670M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productNikonD5500DSLR); - productNikonD5500DSLR.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNikonD5500DSLR.Name)), - DisplayOrder = 1, - }); - productNikonD5500DSLR.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNikonD5500DSLR.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productNikonD5500DSLR); - var productNikonD5500DSLR_associated_1 = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = false, //hide this products - ParentGroupedProductId = productNikonD5500DSLR.Id, - Name = "Nikon D5500 DSLR - Black", - Sku = "N5500DS_B", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "canon-digital-slr-camera-black", - AllowCustomerReviews = true, - Published = true, - Price = 670M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allProducts.Add(productNikonD5500DSLR_associated_1); - productNikonD5500DSLR_associated_1.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_black.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Canon Digital SLR Camera - Black")), - DisplayOrder = 1, - }); - _productRepository.Insert(productNikonD5500DSLR_associated_1); - var productNikonD5500DSLR_associated_2 = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = false, //hide this products - ParentGroupedProductId = productNikonD5500DSLR.Id, - Name = "Nikon D5500 DSLR - Red", - Sku = "N5500DS_R", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "canon-digital-slr-camera-silver", - AllowCustomerReviews = true, - Published = true, - Price = 630M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow - }; - allProducts.Add(productNikonD5500DSLR_associated_2); - productNikonD5500DSLR_associated_2.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_red.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Canon Digital SLR Camera - Silver")), - DisplayOrder = 1, - }); - _productRepository.Insert(productNikonD5500DSLR_associated_2); - - - - - - var productLeica = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Leica T Mirrorless Digital Camera", - Sku = "LT_MIR_DC", - ShortDescription = "Leica T (Typ 701) Silver", - FullDescription = "

The new Leica T offers a minimalist design that's crafted from a single block of aluminum. Made in Germany and assembled by hand, this 16.3 effective mega pixel camera is easy to use. With a massive 3.7 TFT LCD intuitive touch screen control, the user is able to configure and save their own menu system. The Leica T has outstanding image quality and also has 16GB of built in memory. This is Leica's first system camera to use Wi-Fi. Add the T-App to your portable iOS device and be able to transfer and share your images (free download from the Apple App Store)

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "canon-vixia-hf100-camcorder", - AllowCustomerReviews = true, - Price = 530M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), - DisplayOrder = 3, - } - } - }; - allProducts.Add(productLeica); - productLeica.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeicaT.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLeica.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productLeica); - - - - - - - var productAppleICam = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Apple iCam", - Sku = "APPLE_CAM", - ShortDescription = "Photography becomes smart", - FullDescription = "

A few months ago we featured the amazing WVIL camera, by many considered the future of digital photography. This is another very good looking concept, iCam is the vision of Italian designer Antonio DeRosa, the idea is to have a device that attaches to the iPhone 5, which then allows the user to have a camera with interchangeable lenses. The device would also feature a front-touch screen and a projector. Would be great if apple picked up on this and made it reality.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "panasonic-hdc-sdt750k-high-definition-3d-camcorder", - AllowCustomerReviews = true, - Price = 1300M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), - DisplayOrder = 2, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Apple"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productAppleICam); - productAppleICam.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_iCam.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleICam.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productAppleICam); - - - - - #endregion - - #region Cell Phone - - var productHtcOne = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "HTC One M8 Android L 5.0 Lollipop", - Sku = "M8_HTC_5L", - ShortDescription = "HTC - One (M8) 4G LTE Cell Phone with 32GB Memory - Gunmetal (Sprint)", - FullDescription = "

HTC One (M8) Cell Phone for Sprint: With its brushed-metal design and wrap-around unibody frame, the HTC One (M8) is designed to fit beautifully in your hand. It's fun to use with amped up sound and a large Full HD touch screen, and intuitive gesture controls make it seem like your phone almost knows what you need before you do.

Sprint Easy Pay option available in store.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "blackberry-bold-9000-phone-black-att", - AllowCustomerReviews = true, - Price = 245M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - ShowOnHomePage = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productHtcOne); - productHtcOne.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_M8.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOne.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productHtcOne); - - - - - - - var productHtcOneMini = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "HTC One Mini Blue", - Sku = "OM_HTC_BL", - ShortDescription = "HTC One and HTC One Mini now available in bright blue hue", - FullDescription = "

HTC One mini smartphone with 4.30-inch 720x1280 display powered by 1.4GHz processor alongside 1GB RAM and 4-Ultrapixel rear camera.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "samsung-rugby-a837-phone-black-att", - AllowCustomerReviews = true, - Price = 100M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productHtcOneMini); - productHtcOneMini.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_Mini_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOneMini.Name)), - DisplayOrder = 1, - }); - productHtcOneMini.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_Mini_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOneMini.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productHtcOneMini); - - - - - - - var productNokiaLumia = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Nokia Lumia 1020", - Sku = "N_1020_LU", - ShortDescription = "Nokia Lumia 1020 4G Cell Phone (Unlocked)", - FullDescription = "

Capture special moments for friends and family with this Nokia Lumia 1020 32GB WHITE cell phone that features an easy-to-use 41.0MP rear-facing camera and a 1.2MP front-facing camera. The AMOLED touch screen offers 768 x 1280 resolution for crisp visuals.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "sony-dcr-sr85-1mp-60gb-hard-drive-handycam-camcorder", - AllowCustomerReviews = true, - Price = 349M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productNokiaLumia); - productNokiaLumia.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Lumia1020.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNokiaLumia.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productNokiaLumia); - - - #endregion - - #region Others - - - - var productBeatsPill = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Beats Pill 2.0 Wireless Speaker", - Sku = "BP_20_WSP", - ShortDescription = "Pill 2.0 Portable Bluetooth Speaker (1-Piece): Watch your favorite movies and listen to music with striking sound quality. This lightweight, portable speaker is easy to take with you as you travel to any destination, keeping you entertained wherever you are. ", - FullDescription = "
  • Pair and play with your Bluetooth device with 30 foot range
  • Built-in speakerphone
  • 7 hour rechargeable battery
  • Power your other devices with USB charge out
  • Tap two Beats Pills together for twice the sound with Beats Bond
", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "acer-aspire-one-89-mini-notebook-case-black", - AllowCustomerReviews = true, - Price = 79.99M, - IsShipEnabled = true, - IsFreeShipping = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - TierPrices = - { - new TierPrice - { - Quantity = 2, - Price = 19 - }, - new TierPrice - { - Quantity = 5, - Price = 17 - }, - new TierPrice - { - Quantity = 10, - Price = 15, - StartDateTimeUtc = DateTime.UtcNow.AddDays(-7), - EndDateTimeUtc = DateTime.UtcNow.AddDays(7) - } - }, - HasTierPrices = true, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Others"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productBeatsPill); - productBeatsPill.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PillBeats_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBeatsPill.Name)), - DisplayOrder = 1, - }); - productBeatsPill.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PillBeats_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBeatsPill.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productBeatsPill); - - - - - - var productUniversalTabletCover = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Universal 7-8 Inch Tablet Cover", - Sku = "TC_78I_UN", - ShortDescription = "Universal protection for 7-inch & 8-inch tablets", - FullDescription = "

Made of durable polyurethane, our Universal Cover is slim, lightweight, and strong, with protective corners that stretch to hold most 7 and 8-inch tablets securely. This tough case helps protects your tablet from bumps, scuffs, and dings.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "apc-back-ups-rs-800va-ups-800-va-ups-battery-lead-acid-br800blk", - AllowCustomerReviews = true, - Price = 39M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Others"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productUniversalTabletCover); - productUniversalTabletCover.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_TabletCover.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productUniversalTabletCover.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productUniversalTabletCover); - - - - - var productPortableSoundSpeakers = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Portable Sound Speakers", - Sku = "PT_SPK_SN", - ShortDescription = "Universall portable sound speakers", - FullDescription = "

Your phone cut the cord, now it's time for you to set your music free and buy a Bluetooth speaker. Thankfully, there's one suited for everyone out there.

Some Bluetooth speakers excel at packing in as much functionality as the unit can handle while keeping the price down. Other speakers shuck excess functionality in favor of premium build materials instead. Whatever path you choose to go down, you'll be greeted with many options to suit your personal tastes.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "microsoft-bluetooth-notebook-mouse-5000-macwindows", - AllowCustomerReviews = true, - Price = 37M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Others"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productPortableSoundSpeakers); - productPortableSoundSpeakers.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Speakers.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productPortableSoundSpeakers.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productPortableSoundSpeakers); - - - #endregion - - #region Shoes - - - var productNikeFloral = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Nike Floral Roshe Customized Running Shoes", - Sku = "NK_FRC_RS", - ShortDescription = "When you ran across these shoes, you will immediately fell in love and needed a pair of these customized beauties.", - FullDescription = "

Each Rosh Run is personalized and exclusive, handmade in our workshop Custom. Run Your Rosh creations born from the hand of an artist specialized in sneakers, more than 10 years of experience.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "adidas-womens-supernova-csh-7-running-shoe", - AllowCustomerReviews = true, - Price = 40M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "8", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "9", - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "10", - DisplayOrder = 3, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "11", - DisplayOrder = 4, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Color"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "White/Blue", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "White/Black", - DisplayOrder = 2, - }, - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Print"), - AttributeControlType = AttributeControlType.ImageSquares, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Natural", - DisplayOrder = 1, - ImageSquaresPictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "p_attribute_print_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Natural Print")).Id, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Fresh", - DisplayOrder = 2, - ImageSquaresPictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "p_attribute_print_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Fresh Print")).Id, - }, - } - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), - DisplayOrder = 2, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = false, - DisplayOrder = 1, - SpecificationAttributeOption = - _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") - .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") - } - } - }; - allProducts.Add(productNikeFloral); - productNikeFloral.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeFloralShoe_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeFloral.Name)), - DisplayOrder = 1, - }); - productNikeFloral.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeFloralShoe_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeFloral.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productNikeFloral); - - productNikeFloral.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Print").ProductAttributeValues.First(x => x.Name == "Natural").PictureId = productNikeFloral.ProductPictures.ElementAt(0).PictureId; - productNikeFloral.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Print").ProductAttributeValues.First(x => x.Name == "Fresh").PictureId = productNikeFloral.ProductPictures.ElementAt(1).PictureId; - _productRepository.Update(productNikeFloral); - - - - var productAdidas = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "adidas Consortium Campus 80s Running Shoes", - Sku = "AD_C80_RS", - ShortDescription = "adidas Consortium Campus 80s Primeknit Light Maroon/Running Shoes", - FullDescription = "

One of three colorways of the adidas Consortium Campus 80s Primeknit set to drop alongside each other. This pair comes in light maroon and running white. Featuring a maroon-based primeknit upper with white accents. A limited release, look out for these at select adidas Consortium accounts worldwide.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "etnies-mens-digit-sneaker", - AllowCustomerReviews = true, - Price = 27.56M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - //ShowOnHomePage = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "8", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "9", - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "10", - DisplayOrder = 3, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "11", - DisplayOrder = 4, - } - } - }, - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Color"), - AttributeControlType = AttributeControlType.ColorSquares, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Red", - IsPreSelected = true, - ColorSquaresRgb = "#663030", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Blue", - ColorSquaresRgb = "#363656", - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Silver", - ColorSquaresRgb = "#c5c5d5", - DisplayOrder = 3, - } - } - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), - DisplayOrder = 1, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = false, - DisplayOrder = 1, - SpecificationAttributeOption = - _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") - .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = false, - DisplayOrder = 2, - SpecificationAttributeOption = - _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") - .SpecificationAttributeOptions.Single(sao => sao.Name == "Red") - }, - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = false, - DisplayOrder = 3, - SpecificationAttributeOption = - _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") - .SpecificationAttributeOptions.Single(sao => sao.Name == "Blue") - }, - } - }; - allProducts.Add(productAdidas); - productAdidas.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), - DisplayOrder = 1, - }); - productAdidas.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), - DisplayOrder = 2, - }); - productAdidas.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_3.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), - DisplayOrder = 3, - }); - - - _productRepository.Insert(productAdidas); - - productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Red").PictureId = productAdidas.ProductPictures.ElementAt(0).PictureId; - productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Blue").PictureId = productAdidas.ProductPictures.ElementAt(1).PictureId; - productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Silver").PictureId = productAdidas.ProductPictures.ElementAt(2).PictureId; - _productRepository.Update(productAdidas); - - - - - var productNikeZoom = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Nike SB Zoom Stefan Janoski \"Medium Mint\"", - Sku = "NK_ZSJ_MM", - ShortDescription = "Nike SB Zoom Stefan Janoski Dark Grey Medium Mint Teal ...", - FullDescription = "The newly Nike SB Zoom Stefan Janoski gets hit with a \"Medium Mint\" accents that sits atop a Dark Grey suede. Expected to drop in October.", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "v-blue-juniors-cuffed-denim-short-with-rhinestones", - AllowCustomerReviews = true, - Price = 30M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), - DisplayOrder = 2, - } - }, - ProductSpecificationAttributes = - { - new ProductSpecificationAttribute - { - AllowFiltering = true, - ShowOnProductPage = false, - DisplayOrder = 1, - SpecificationAttributeOption = - _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") - .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") - } - } - }; - - allProducts.Add(productNikeZoom); - productNikeZoom.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeZoom.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeZoom.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productNikeZoom); - - - #endregion - - #region Clothing - - var productNikeTailwind = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Nike Tailwind Loose Short-Sleeve Running Shirt", - Sku = "NK_TLS_RS", - ShortDescription = "", - FullDescription = "

Boost your adrenaline with the Nike Women's Tailwind Running Shirt. The lightweight, slouchy fit is great for layering, and moisture-wicking fabrics keep you feeling at your best. This tee has a notched hem for an enhanced range of motion, while flat seams with reinforcement tape lessen discomfort and irritation over longer distances. Put your keys and card in the side zip pocket and take off in your Nike running t-shirt.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "50s-rockabilly-polka-dot-top-jr-plus-size", - AllowCustomerReviews = true, - Published = true, - Price = 15M, - IsShipEnabled = true, - Weight = 1, - Length = 2, - Width = 3, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Small", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "1X", - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "2X", - DisplayOrder = 3, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "3X", - DisplayOrder = 4, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "4X", - DisplayOrder = 5, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "5X", - DisplayOrder = 6, - } - } - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), - DisplayOrder = 1, - } - }, - ProductManufacturers = - { - new ProductManufacturer - { - Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), - DisplayOrder = 2, - } - } - }; - allProducts.Add(productNikeTailwind); - productNikeTailwind.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeShirt.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeTailwind.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productNikeTailwind); - - - - - var productOversizedWomenTShirt = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Oversized Women T-Shirt", - Sku = "WM_OVR_TS", - ShortDescription = "", - FullDescription = "

This oversized women t-Shirt needs minimum ironing. It is a great product at a great value!

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "arrow-mens-wrinkle-free-pinpoint-solid-long-sleeve", - AllowCustomerReviews = true, - Price = 24M, - IsShipEnabled = true, - Weight = 4, - Length = 3, - Width = 3, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - TierPrices = - { - new TierPrice - { - Quantity = 3, - Price = 21 - }, - new TierPrice - { - Quantity = 7, - Price = 19 - }, - new TierPrice - { - Quantity = 10, - Price = 16 - } - }, - HasTierPrices = true, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productOversizedWomenTShirt); - productOversizedWomenTShirt.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_WomenTShirt.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productOversizedWomenTShirt.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productOversizedWomenTShirt); - - - - - var productCustomTShirt = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Custom T-Shirt", - Sku = "CS_TSHIRT", - ShortDescription = "T-Shirt - Add Your Content", - FullDescription = "

Comfort comes in all shapes and forms, yet this tee out does it all. Rising above the rest, our classic cotton crew provides the simple practicality you need to make it through the day. Tag-free, relaxed fit wears well under dress shirts or stands alone in laid-back style. Reinforced collar and lightweight feel give way to long-lasting shape and breathability. One less thing to worry about, rely on this tee to provide comfort and ease with every wear.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "custom-t-shirt", - AllowCustomerReviews = true, - Price = 15M, - IsShipEnabled = true, - Weight = 4, - Length = 3, - Width = 3, - Height = 3, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Custom Text"), - TextPrompt = "Enter your text:", - AttributeControlType = AttributeControlType.TextBox, - IsRequired = true, - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productCustomTShirt); - productCustomTShirt.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_CustomTShirt.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productCustomTShirt.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productCustomTShirt); - - - - - - - var productLeviJeans = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Levi's 511 Jeans", - Sku = "LV_511_JN", - ShortDescription = "Levi's Faded Black 511 Jeans ", - FullDescription = "

Between a skinny and straight fit, our 511™ slim fit jeans are cut close without being too restricting. Slim throughout the thigh and leg opening for a long and lean look.

  • Slouch1y at top; sits below the waist
  • Slim through the leg, close at the thigh and straight to the ankle
  • Stretch for added comfort
  • Classic five-pocket styling
  • 99% Cotton, 1% Spandex, 11.2 oz. - Imported
", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "levis-skinny-511-jeans", - AllowCustomerReviews = true, - Price = 43.5M, - OldPrice = 55M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - TierPrices = - { - new TierPrice - { - Quantity = 3, - Price = 40 - }, - new TierPrice - { - Quantity = 6, - Price = 38 - }, - new TierPrice - { - Quantity = 10, - Price = 35 - } - }, - HasTierPrices = true, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productLeviJeans); - - productLeviJeans.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeviJeans_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productLeviJeans.Name)), - DisplayOrder = 1, - }); - productLeviJeans.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeviJeans_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productLeviJeans.Name)), - DisplayOrder = 2, - }); - _productRepository.Insert(productLeviJeans); - - - #endregion - - #region Accessories - - - var productObeyHat = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Obey Propaganda Hat", - Sku = "OB_HAT_PR", - ShortDescription = "", - FullDescription = "

Printed poplin 5 panel camp hat with debossed leather patch and web closure

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "indiana-jones-shapeable-wool-hat", - AllowCustomerReviews = true, - Price = 30M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductAttributeMappings = - { - new ProductAttributeMapping - { - ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), - AttributeControlType = AttributeControlType.DropdownList, - IsRequired = true, - ProductAttributeValues = - { - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Small", - DisplayOrder = 1, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Medium", - DisplayOrder = 2, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "Large", - DisplayOrder = 3, - }, - new ProductAttributeValue - { - AttributeValueType = AttributeValueType.Simple, - Name = "X-Large", - DisplayOrder = 4, - } - } - } - }, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productObeyHat); - productObeyHat.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_hat.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productObeyHat.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productObeyHat); - - - - - - - - var productBelt = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Reversible Horseferry Check Belt", - Sku = "RH_CHK_BL", - ShortDescription = "Reversible belt in Horseferry check with smooth leather trim", - FullDescription = "

Reversible belt in Horseferry check with smooth leather trim

Leather lining, polished metal buckle

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "nike-golf-casual-belt", - AllowCustomerReviews = true, - Price = 45M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - ProductAvailabilityRangeId = productAvailabilityRange.Id, - StockQuantity = 0, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productBelt); - productBelt.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Belt.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBelt.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productBelt); - - - - - - - var productSunglasses = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Ray Ban Aviator Sunglasses", - Sku = "RB_AVR_SG", - ShortDescription = "Aviator sunglasses are one of the first widely popularized styles of modern day sunwear.", - FullDescription = "

Since 1937, Ray-Ban can genuinely claim the title as the world's leading sunglasses and optical eyewear brand. Combining the best of fashion and sports performance, the Ray-Ban line of Sunglasses delivers a truly classic style that will have you looking great today and for years to come.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "ray-ban-aviator-sunglasses-rb-3025", - AllowCustomerReviews = true, - Price = 25M, - IsShipEnabled = true, - Weight = 7, - Length = 7, - Width = 7, - Height = 7, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productSunglasses); - productSunglasses.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Sunglasses.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productSunglasses.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productSunglasses); - - #endregion - - #region Digital Downloads - - - var downloadNightVision1 = new Download - { - DownloadGuid = Guid.NewGuid(), - ContentType = MimeTypes.ApplicationXZipCo, - DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_NightVision_1.zip"), - Extension = ".zip", - Filename = "Night_Vision_1", - IsNew = true, - }; - downloadService.InsertDownload(downloadNightVision1); - var downloadNightVision2 = new Download - { - DownloadGuid = Guid.NewGuid(), - ContentType = MimeTypes.TextPlain, - DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_NightVision_2.txt"), - Extension = ".txt", - Filename = "Night_Vision_1", - IsNew = true, - }; - downloadService.InsertDownload(downloadNightVision2); - var productNightVision = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Night Visions", - Sku = "NIGHT_VSN", - ShortDescription = "Night Visions is the debut studio album by American rock band Imagine Dragons.", - FullDescription = "

Original Release Date: September 4, 2012

Release Date: September 4, 2012

Genre - Alternative rock, indie rock, electronic rock

Label - Interscope/KIDinaKORNER

Copyright: (C) 2011 Interscope Records

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "poker-face", - AllowCustomerReviews = true, - Price = 2.8M, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - IsDownload = true, - DownloadId = downloadNightVision1.Id, - DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, - UnlimitedDownloads = true, - HasUserAgreement = false, - HasSampleDownload = true, - SampleDownloadId = downloadNightVision2.Id, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productNightVision); - productNightVision.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NightVisions.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNightVision.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productNightVision); - - - - - - var downloadIfYouWait1 = new Download - { - DownloadGuid = Guid.NewGuid(), - ContentType = MimeTypes.ApplicationXZipCo, - DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_IfYouWait_1.zip"), - Extension = ".zip", - Filename = "If_You_Wait_1", - IsNew = true, - }; - downloadService.InsertDownload(downloadIfYouWait1); - var downloadIfYouWait2 = new Download - { - DownloadGuid = Guid.NewGuid(), - ContentType = MimeTypes.TextPlain, - DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_IfYouWait_2.txt"), - Extension = ".txt", - Filename = "If_You_Wait_1", - IsNew = true, - }; - downloadService.InsertDownload(downloadIfYouWait2); - var productIfYouWait = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "If You Wait (donation)", - Sku = "IF_YOU_WT", - ShortDescription = "If You Wait is the debut studio album by English indie pop band London Grammar", - FullDescription = "

Original Release Date: September 6, 2013

Genre - Electronica, dream pop downtempo, pop

Label - Metal & Dust/Ministry of Sound

Producer - Tim Bran, Roy Kerr London, Grammar

Length - 43:22

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "single-ladies-put-a-ring-on-it", - CustomerEntersPrice = true, - MinimumCustomerEnteredPrice = 0.5M, - MaximumCustomerEnteredPrice = 100M, - AllowCustomerReviews = true, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - IsDownload = true, - DownloadId = downloadIfYouWait1.Id, - DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, - UnlimitedDownloads = true, - HasUserAgreement = false, - HasSampleDownload = true, - SampleDownloadId = downloadIfYouWait2.Id, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productIfYouWait); - - productIfYouWait.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_IfYouWait.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productIfYouWait.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productIfYouWait); - - - - - - var downloadScienceAndFaith = new Download - { - DownloadGuid = Guid.NewGuid(), - ContentType = MimeTypes.ApplicationXZipCo, - DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_ScienceAndFaith_1.zip"), - Extension = ".zip", - Filename = "Science_And_Faith", - IsNew = true, - }; - downloadService.InsertDownload(downloadScienceAndFaith); - var productScienceAndFaith = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Science & Faith", - Sku = "SCI_FAITH", - ShortDescription = "Science & Faith is the second studio album by Irish pop rock band The Script.", - FullDescription = "

# Original Release Date: September 10, 2010
# Label: RCA, Epic/Phonogenic(America)
# Copyright: 2010 RCA Records.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "the-battle-of-los-angeles", - AllowCustomerReviews = true, - CustomerEntersPrice = true, - MinimumCustomerEnteredPrice = 0.5M, - MaximumCustomerEnteredPrice = 1000M, - Price = decimal.Zero, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - IsDownload = true, - DownloadId = downloadScienceAndFaith.Id, - DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, - UnlimitedDownloads = true, - HasUserAgreement = false, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productScienceAndFaith); - productScienceAndFaith.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ScienceAndFaith.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productScienceAndFaith.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productScienceAndFaith); - - - - #endregion - - #region Books - - var productFahrenheit = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Fahrenheit 451 by Ray Bradbury", - Sku = "FR_451_RB", - ShortDescription = "Fahrenheit 451 is a dystopian novel by Ray Bradbury published in 1953. It is regarded as one of his best works.", - FullDescription = "

The novel presents a future American society where books are outlawed and firemen burn any that are found. The title refers to the temperature that Bradbury understood to be the autoignition point of paper.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "best-grilling-recipes", - AllowCustomerReviews = true, - Price = 27M, - OldPrice = 30M, - IsShipEnabled = true, - IsFreeShipping = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Books"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productFahrenheit); - productFahrenheit.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Fahrenheit451.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productFahrenheit.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productFahrenheit); - - - - var productFirstPrizePies = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "First Prize Pies", - Sku = "FIRST_PRP", - ShortDescription = "Allison Kave made pies as a hobby, until one day her boyfriend convinced her to enter a Brooklyn pie-making contest. She won. In fact, her pies were such a hit that she turned pro.", - FullDescription = "

First Prize Pies, a boutique, made-to-order pie business that originated on New York's Lower East Side, has become synonymous with tempting and unusual confections. For the home baker who is passionate about seasonal ingredients and loves a creative approach to recipes, First Prize Pies serves up 52 weeks of seasonal and eclectic pastries in an interesting pie-a-week format. Clear instructions, technical tips and creative encouragement guide novice bakers as well as pie mavens. With its nostalgia-evoking photos of homemade pies fresh out of the oven, First Prize Pies will be as giftable as it is practical.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "eatingwell-in-season", - AllowCustomerReviews = true, - Price = 51M, - OldPrice = 67M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Books"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productFirstPrizePies); - productFirstPrizePies.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_FirstPrizePies.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productFirstPrizePies.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productFirstPrizePies); - - - - - - - - var productPrideAndPrejudice = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Pride and Prejudice", - Sku = "PRIDE_PRJ", - ShortDescription = "Pride and Prejudice is a novel of manners by Jane Austen, first published in 1813.", - FullDescription = "

Set in England in the early 19th century, Pride and Prejudice tells the story of Mr and Mrs Bennet's five unmarried daughters after the rich and eligible Mr Bingley and his status-conscious friend, Mr Darcy, have moved into their neighbourhood. While Bingley takes an immediate liking to the eldest Bennet daughter, Jane, Darcy has difficulty adapting to local society and repeatedly clashes with the second-eldest Bennet daughter, Elizabeth.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "the-best-skillet-recipes", - AllowCustomerReviews = true, - Price = 24M, - OldPrice = 35M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Books"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productPrideAndPrejudice); - productPrideAndPrejudice.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PrideAndPrejudice.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productPrideAndPrejudice.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productPrideAndPrejudice); - - - - #endregion - - #region Jewelry - - - - var productElegantGemstoneNecklace = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Elegant Gemstone Necklace (rental)", - Sku = "EG_GEM_NL", - ShortDescription = "Classic and elegant gemstone necklace now available in our store", - FullDescription = "

For those who like jewelry, creating their ownelegant jewelry from gemstone beads provides an economical way to incorporate genuine gemstones into your jewelry wardrobe. Manufacturers create beads from all kinds of precious gemstones and semi-precious gemstones, which are available in bead shops, craft stores, and online marketplaces.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "diamond-pave-earrings", - AllowCustomerReviews = true, - IsRental = true, - RentalPriceLength = 1, - RentalPricePeriod = RentalPricePeriod.Days, - Price = 30M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productElegantGemstoneNecklace); - productElegantGemstoneNecklace.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_GemstoneNecklaces.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productElegantGemstoneNecklace.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productElegantGemstoneNecklace); - - - - - - var productFlowerGirlBracelet = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Flower Girl Bracelet", - Sku = "FL_GIRL_B", - ShortDescription = "Personalised Flower Braceled", - FullDescription = "

This is a great gift for your flower girl to wear on your wedding day. A delicate bracelet that is made with silver plated soldered cable chain, gives this bracelet a dainty look for young wrist. A Swarovski heart, shown in Rose, hangs off a silver plated flower. Hanging alongside the heart is a silver plated heart charm with Flower Girl engraved on both sides. This is a great style for the younger flower girl.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "diamond-tennis-bracelet", - AllowCustomerReviews = true, - Price = 360M, - IsShipEnabled = true, - IsFreeShipping = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productFlowerGirlBracelet); - productFlowerGirlBracelet.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_FlowerBracelet.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productFlowerGirlBracelet.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productFlowerGirlBracelet); - - - - - - - - - var productEngagementRing = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "Vintage Style Engagement Ring", - Sku = "VS_ENG_RN", - ShortDescription = "1.24 Carat (ctw) in 14K White Gold (Certified)", - FullDescription = "

Dazzle her with this gleaming 14 karat white gold vintage proposal. A ravishing collection of 11 decadent diamonds come together to invigorate a superbly ornate gold shank. Total diamond weight on this antique style engagement ring equals 1 1/4 carat (ctw). Item includes diamond certificate.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "vintage-style-three-stone-diamond-engagement-ring", - AllowCustomerReviews = true, - Price = 2100M, - IsShipEnabled = true, - Weight = 2, - Length = 2, - Width = 2, - Height = 2, - TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, - ManageInventoryMethod = ManageInventoryMethod.ManageStock, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - DisplayStockAvailability = true, - LowStockActivity = LowStockActivity.DisableBuyButton, - BackorderMode = BackorderMode.NoBackorders, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), - DisplayOrder = 1, - } - } - }; - allProducts.Add(productEngagementRing); - productEngagementRing.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_EngagementRing_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productEngagementRing.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(productEngagementRing); - - - - #endregion - - #region Gift Cards - - - var product25GiftCard = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "$25 Virtual Gift Card", - Sku = "VG_CR_025", - ShortDescription = "$25 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", - FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "25-virtual-gift-card", - AllowCustomerReviews = true, - Price = 25M, - IsGiftCard = true, - GiftCardType = GiftCardType.Virtual, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - Published = true, - ShowOnHomePage = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), - DisplayOrder = 2, - } - } - }; - allProducts.Add(product25GiftCard); - product25GiftCard.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_25giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product25GiftCard.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(product25GiftCard); - - - - - - var product50GiftCard = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "$50 Physical Gift Card", - Sku = "PG_CR_050", - ShortDescription = "$50 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", - FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "50-physical-gift-card", - AllowCustomerReviews = true, - Price = 50M, - IsGiftCard = true, - GiftCardType = GiftCardType.Physical, - IsShipEnabled = true, - IsFreeShipping = true, - DeliveryDateId = deliveryDate.Id, - Weight = 1, - Length = 1, - Width = 1, - Height = 1, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - Published = true, - MarkAsNew = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), - DisplayOrder = 3, - } - } - }; - allProducts.Add(product50GiftCard); - product50GiftCard.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_50giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product50GiftCard.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(product50GiftCard); - - - - - - var product100GiftCard = new Product - { - ProductType = ProductType.SimpleProduct, - VisibleIndividually = true, - Name = "$100 Physical Gift Card", - Sku = "PG_CR_100", - ShortDescription = "$100 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", - FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", - ProductTemplateId = productTemplateSimple.Id, - //SeName = "100-physical-gift-card", - AllowCustomerReviews = true, - Price = 100M, - IsGiftCard = true, - GiftCardType = GiftCardType.Physical, - IsShipEnabled = true, - DeliveryDateId = deliveryDate.Id, - Weight = 1, - Length = 1, - Width = 1, - Height = 1, - ManageInventoryMethod = ManageInventoryMethod.DontManageStock, - OrderMinimumQuantity = 1, - OrderMaximumQuantity = 10000, - StockQuantity = 10000, - NotifyAdminForQuantityBelow = 1, - AllowBackInStockSubscriptions = false, - Published = true, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - ProductCategories = - { - new ProductCategory - { - Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), - DisplayOrder = 4, - } - } - }; - allProducts.Add(product100GiftCard); - product100GiftCard.ProductPictures.Add(new ProductPicture - { - Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_100giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product100GiftCard.Name)), - DisplayOrder = 1, - }); - _productRepository.Insert(product100GiftCard); - - #endregion - - - - //search engine names - foreach (var product in allProducts) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = product.Id, - EntityName = "Product", - LanguageId = 0, - IsActive = true, - Slug = product.ValidateSeName("", product.Name, true) - }); - } - - - #region Related Products - - //related products - var relatedProducts = new List - { - new RelatedProduct - { - ProductId1 = productFlowerGirlBracelet.Id, - ProductId2 = productEngagementRing.Id, - }, - new RelatedProduct - { - ProductId1 = productFlowerGirlBracelet.Id, - ProductId2 = productElegantGemstoneNecklace.Id, - }, - new RelatedProduct - { - ProductId1 = productEngagementRing.Id, - ProductId2 = productFlowerGirlBracelet.Id, - }, - new RelatedProduct - { - ProductId1 = productEngagementRing.Id, - ProductId2 = productElegantGemstoneNecklace.Id, - }, - new RelatedProduct - { - ProductId1 = productElegantGemstoneNecklace.Id, - ProductId2 = productFlowerGirlBracelet.Id, - }, - new RelatedProduct - { - ProductId1 = productElegantGemstoneNecklace.Id, - ProductId2 = productEngagementRing.Id, - }, - new RelatedProduct - { - ProductId1 = productIfYouWait.Id, - ProductId2 = productNightVision.Id, - }, - new RelatedProduct - { - ProductId1 = productIfYouWait.Id, - ProductId2 = productScienceAndFaith.Id, - }, - new RelatedProduct - { - ProductId1 = productNightVision.Id, - ProductId2 = productIfYouWait.Id, - }, - new RelatedProduct - { - ProductId1 = productNightVision.Id, - ProductId2 = productScienceAndFaith.Id, - }, - new RelatedProduct - { - ProductId1 = productPrideAndPrejudice.Id, - ProductId2 = productFirstPrizePies.Id, - }, - new RelatedProduct - { - ProductId1 = productPrideAndPrejudice.Id, - ProductId2 = productFahrenheit.Id, - }, - new RelatedProduct - { - ProductId1 = productFirstPrizePies.Id, - ProductId2 = productPrideAndPrejudice.Id, - }, - new RelatedProduct - { - ProductId1 = productFirstPrizePies.Id, - ProductId2 = productFahrenheit.Id, - }, - new RelatedProduct - { - ProductId1 = productFahrenheit.Id, - ProductId2 = productFirstPrizePies.Id, - }, - new RelatedProduct - { - ProductId1 = productFahrenheit.Id, - ProductId2 = productPrideAndPrejudice.Id, - }, - new RelatedProduct - { - ProductId1 = productAsusN551JK.Id, - ProductId2 = productLenovoThinkpad.Id, - }, - new RelatedProduct - { - ProductId1 = productAsusN551JK.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - new RelatedProduct - { - ProductId1 = productAsusN551JK.Id, - ProductId2 = productSamsungSeries.Id, - }, - new RelatedProduct - { - ProductId1 = productAsusN551JK.Id, - ProductId2 = productHpSpectre.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoThinkpad.Id, - ProductId2 = productAsusN551JK.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoThinkpad.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoThinkpad.Id, - ProductId2 = productSamsungSeries.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoThinkpad.Id, - ProductId2 = productHpEnvy.Id, - }, - new RelatedProduct - { - ProductId1 = productAppleMacBookPro.Id, - ProductId2 = productLenovoThinkpad.Id, - }, - new RelatedProduct - { - ProductId1 = productAppleMacBookPro.Id, - ProductId2 = productSamsungSeries.Id, - }, - new RelatedProduct - { - ProductId1 = productAppleMacBookPro.Id, - ProductId2 = productAsusN551JK.Id, - }, - new RelatedProduct - { - ProductId1 = productAppleMacBookPro.Id, - ProductId2 = productHpSpectre.Id, - }, - new RelatedProduct - { - ProductId1 = productHpSpectre.Id, - ProductId2 = productLenovoThinkpad.Id, - }, - new RelatedProduct - { - ProductId1 = productHpSpectre.Id, - ProductId2 = productSamsungSeries.Id, - }, - new RelatedProduct - { - ProductId1 = productHpSpectre.Id, - ProductId2 = productAsusN551JK.Id, - }, - new RelatedProduct - { - ProductId1 = productHpSpectre.Id, - ProductId2 = productHpEnvy.Id, - }, - new RelatedProduct - { - ProductId1 = productHpEnvy.Id, - ProductId2 = productAsusN551JK.Id, - }, - new RelatedProduct - { - ProductId1 = productHpEnvy.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - new RelatedProduct - { - ProductId1 = productHpEnvy.Id, - ProductId2 = productHpSpectre.Id, - }, - new RelatedProduct - { - ProductId1 = productHpEnvy.Id, - ProductId2 = productSamsungSeries.Id, - }, - new RelatedProduct - { - ProductId1 = productSamsungSeries.Id, - ProductId2 = productAsusN551JK.Id, - }, - new RelatedProduct - { - ProductId1 = productSamsungSeries.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - new RelatedProduct - { - ProductId1 = productSamsungSeries.Id, - ProductId2 = productHpEnvy.Id, - }, - new RelatedProduct - { - ProductId1 = productSamsungSeries.Id, - ProductId2 = productHpSpectre.Id, - }, - new RelatedProduct - { - ProductId1 = productLeica.Id, - ProductId2 = productHtcOneMini.Id, - }, - new RelatedProduct - { - ProductId1 = productLeica.Id, - ProductId2 = productNikonD5500DSLR.Id, - }, - new RelatedProduct - { - ProductId1 = productLeica.Id, - ProductId2 = productAppleICam.Id, - }, - new RelatedProduct - { - ProductId1 = productLeica.Id, - ProductId2 = productNokiaLumia.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOne.Id, - ProductId2 = productHtcOneMini.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOne.Id, - ProductId2 = productNokiaLumia.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOne.Id, - ProductId2 = productBeatsPill.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOne.Id, - ProductId2 = productPortableSoundSpeakers.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOneMini.Id, - ProductId2 = productHtcOne.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOneMini.Id, - ProductId2 = productNokiaLumia.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOneMini.Id, - ProductId2 = productBeatsPill.Id, - }, - new RelatedProduct - { - ProductId1 = productHtcOneMini.Id, - ProductId2 = productPortableSoundSpeakers.Id, - }, - new RelatedProduct - { - ProductId1 = productNokiaLumia.Id, - ProductId2 = productHtcOne.Id, - }, - new RelatedProduct - { - ProductId1 = productNokiaLumia.Id, - ProductId2 = productHtcOneMini.Id, - }, - new RelatedProduct - { - ProductId1 = productNokiaLumia.Id, - ProductId2 = productBeatsPill.Id, - }, - new RelatedProduct - { - ProductId1 = productNokiaLumia.Id, - ProductId2 = productPortableSoundSpeakers.Id, - }, - new RelatedProduct - { - ProductId1 = productAdidas.Id, - ProductId2 = productLeviJeans.Id, - }, - new RelatedProduct - { - ProductId1 = productAdidas.Id, - ProductId2 = productNikeFloral.Id, - }, - new RelatedProduct - { - ProductId1 = productAdidas.Id, - ProductId2 = productNikeZoom.Id, - }, - new RelatedProduct - { - ProductId1 = productAdidas.Id, - ProductId2 = productNikeTailwind.Id, - }, - new RelatedProduct - { - ProductId1 = productLeviJeans.Id, - ProductId2 = productAdidas.Id, - }, - new RelatedProduct - { - ProductId1 = productLeviJeans.Id, - ProductId2 = productNikeFloral.Id, - }, - new RelatedProduct - { - ProductId1 = productLeviJeans.Id, - ProductId2 = productNikeZoom.Id, - }, - new RelatedProduct - { - ProductId1 = productLeviJeans.Id, - ProductId2 = productNikeTailwind.Id, - }, - - new RelatedProduct - { - ProductId1 = productCustomTShirt.Id, - ProductId2 = productLeviJeans.Id, - }, - new RelatedProduct - { - ProductId1 = productCustomTShirt.Id, - ProductId2 = productNikeTailwind.Id, - }, - new RelatedProduct - { - ProductId1 = productCustomTShirt.Id, - ProductId2 = productOversizedWomenTShirt.Id, - }, - new RelatedProduct - { - ProductId1 = productCustomTShirt.Id, - ProductId2 = productObeyHat.Id, - }, - new RelatedProduct - { - ProductId1 = productDigitalStorm.Id, - ProductId2 = productBuildComputer.Id, - }, - new RelatedProduct - { - ProductId1 = productDigitalStorm.Id, - ProductId2 = productLenovoIdeaCentre.Id, - }, - new RelatedProduct - { - ProductId1 = productDigitalStorm.Id, - ProductId2 = productLenovoThinkpad.Id, - }, - new RelatedProduct - { - ProductId1 = productDigitalStorm.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - - - new RelatedProduct - { - ProductId1 = productLenovoIdeaCentre.Id, - ProductId2 = productBuildComputer.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoIdeaCentre.Id, - ProductId2 = productDigitalStorm.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoIdeaCentre.Id, - ProductId2 = productLenovoThinkpad.Id, - }, - new RelatedProduct - { - ProductId1 = productLenovoIdeaCentre.Id, - ProductId2 = productAppleMacBookPro.Id, - }, - }; - _relatedProductRepository.Insert(relatedProducts); - - #endregion - - #region Product Tags - - //product tags - AddProductTag(product25GiftCard, "nice"); - AddProductTag(product25GiftCard, "gift"); - AddProductTag(productNikeTailwind, "cool"); - AddProductTag(productNikeTailwind, "apparel"); - AddProductTag(productNikeTailwind, "shirt"); - AddProductTag(productBeatsPill, "computer"); - AddProductTag(productBeatsPill, "cool"); - AddProductTag(productNikeFloral, "cool"); - AddProductTag(productNikeFloral, "shoes"); - AddProductTag(productNikeFloral, "apparel"); - AddProductTag(productAdobePhotoshop, "computer"); - AddProductTag(productAdobePhotoshop, "awesome"); - AddProductTag(productUniversalTabletCover, "computer"); - AddProductTag(productUniversalTabletCover, "cool"); - AddProductTag(productOversizedWomenTShirt, "cool"); - AddProductTag(productOversizedWomenTShirt, "apparel"); - AddProductTag(productOversizedWomenTShirt, "shirt"); - AddProductTag(productAppleMacBookPro, "compact"); - AddProductTag(productAppleMacBookPro, "awesome"); - AddProductTag(productAppleMacBookPro, "computer"); - AddProductTag(productAsusN551JK, "compact"); - AddProductTag(productAsusN551JK, "awesome"); - AddProductTag(productAsusN551JK, "computer"); - AddProductTag(productFahrenheit, "awesome"); - AddProductTag(productFahrenheit, "book"); - AddProductTag(productFahrenheit, "nice"); - AddProductTag(productHtcOne, "cell"); - AddProductTag(productHtcOne, "compact"); - AddProductTag(productHtcOne, "awesome"); - AddProductTag(productBuildComputer, "awesome"); - AddProductTag(productBuildComputer, "computer"); - AddProductTag(productNikonD5500DSLR, "cool"); - AddProductTag(productNikonD5500DSLR, "camera"); - AddProductTag(productLeica, "camera"); - AddProductTag(productLeica, "cool"); - AddProductTag(productDigitalStorm, "cool"); - AddProductTag(productDigitalStorm, "computer"); - AddProductTag(productWindows8Pro, "awesome"); - AddProductTag(productWindows8Pro, "computer"); - AddProductTag(productCustomTShirt, "cool"); - AddProductTag(productCustomTShirt, "shirt"); - AddProductTag(productCustomTShirt, "apparel"); - AddProductTag(productElegantGemstoneNecklace, "jewelry"); - AddProductTag(productElegantGemstoneNecklace, "awesome"); - AddProductTag(productFlowerGirlBracelet, "awesome"); - AddProductTag(productFlowerGirlBracelet, "jewelry"); - AddProductTag(productFirstPrizePies, "book"); - AddProductTag(productAdidas, "cool"); - AddProductTag(productAdidas, "shoes"); - AddProductTag(productAdidas, "apparel"); - AddProductTag(productLenovoIdeaCentre, "awesome"); - AddProductTag(productLenovoIdeaCentre, "computer"); - AddProductTag(productSamsungSeries, "nice"); - AddProductTag(productSamsungSeries, "computer"); - AddProductTag(productSamsungSeries, "compact"); - AddProductTag(productHpSpectre, "nice"); - AddProductTag(productHpSpectre, "computer"); - AddProductTag(productHpEnvy, "computer"); - AddProductTag(productHpEnvy, "cool"); - AddProductTag(productHpEnvy, "compact"); - AddProductTag(productObeyHat, "apparel"); - AddProductTag(productObeyHat, "cool"); - AddProductTag(productLeviJeans, "cool"); - AddProductTag(productLeviJeans, "jeans"); - AddProductTag(productLeviJeans, "apparel"); - AddProductTag(productSoundForge, "game"); - AddProductTag(productSoundForge, "computer"); - AddProductTag(productSoundForge, "cool"); - AddProductTag(productNightVision, "awesome"); - AddProductTag(productNightVision, "digital"); - AddProductTag(productSunglasses, "apparel"); - AddProductTag(productSunglasses, "cool"); - AddProductTag(productHtcOneMini, "awesome"); - AddProductTag(productHtcOneMini, "compact"); - AddProductTag(productHtcOneMini, "cell"); - AddProductTag(productIfYouWait, "digital"); - AddProductTag(productIfYouWait, "awesome"); - AddProductTag(productNokiaLumia, "awesome"); - AddProductTag(productNokiaLumia, "cool"); - AddProductTag(productNokiaLumia, "camera"); - AddProductTag(productScienceAndFaith, "digital"); - AddProductTag(productScienceAndFaith, "awesome"); - AddProductTag(productPrideAndPrejudice, "book"); - AddProductTag(productLenovoThinkpad, "awesome"); - AddProductTag(productLenovoThinkpad, "computer"); - AddProductTag(productLenovoThinkpad, "compact"); - AddProductTag(productNikeZoom, "jeans"); - AddProductTag(productNikeZoom, "cool"); - AddProductTag(productNikeZoom, "apparel"); - AddProductTag(productEngagementRing, "jewelry"); - AddProductTag(productEngagementRing, "awesome"); - - - #endregion - - #region Reviews - - //reviews - var random = new Random(); - foreach (var product in allProducts) - { - if (product.ProductType != ProductType.SimpleProduct) - continue; - - //only 3 of 4 products will have reviews - if (random.Next(4) == 3) - continue; - - //rating from 4 to 5 - var rating = random.Next(4, 6); - product.ProductReviews.Add(new ProductReview - { - CustomerId = defaultCustomer.Id, - ProductId = product.Id, - StoreId = defaultStore.Id, - IsApproved = true, - Title = "Some sample review", - ReviewText = string.Format("This sample review is for the {0}. I've been waiting for this product to be available. It is priced just right.", product.Name), - //random (4 or 5) - Rating = rating, - HelpfulYesTotal = 0, - HelpfulNoTotal = 0, - CreatedOnUtc = DateTime.UtcNow - }); - product.ApprovedRatingSum = rating; - product.ApprovedTotalReviews = product.ProductReviews.Count; - - } - _productRepository.Update(allProducts); - - #endregion - - #region Stock quantity history - - foreach (var product in allProducts) - { - if (product.StockQuantity > 0) - _stockQuantityHistoryRepository.Insert(new StockQuantityHistory - { - ProductId = product.Id, - WarehouseId = product.WarehouseId > 0 ? (int?)product.WarehouseId : null, - QuantityAdjustment = product.StockQuantity, - StockQuantity = product.StockQuantity, - Message = "The stock quantity has been edited", - CreatedOnUtc = DateTime.UtcNow - }); - } - - #endregion - } - - protected virtual void InstallForums() - { - var forumGroup = new ForumGroup - { - Name = "General", - DisplayOrder = 5, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - }; - - _forumGroupRepository.Insert(forumGroup); - - var newProductsForum = new Forum - { - ForumGroup = forumGroup, - Name = "New Products", - Description = "Discuss new products and industry trends", - NumTopics = 0, - NumPosts = 0, - LastPostCustomerId = 0, - LastPostTime = null, - DisplayOrder = 1, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - }; - _forumRepository.Insert(newProductsForum); - - var mobileDevicesForum = new Forum - { - ForumGroup = forumGroup, - Name = "Mobile Devices Forum", - Description = "Discuss the mobile phone market", - NumTopics = 0, - NumPosts = 0, - LastPostCustomerId = 0, - LastPostTime = null, - DisplayOrder = 10, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - }; - _forumRepository.Insert(mobileDevicesForum); - - var packagingShippingForum = new Forum - { - ForumGroup = forumGroup, - Name = "Packaging & Shipping", - Description = "Discuss packaging & shipping", - NumTopics = 0, - NumPosts = 0, - LastPostTime = null, - DisplayOrder = 20, - CreatedOnUtc = DateTime.UtcNow, - UpdatedOnUtc = DateTime.UtcNow, - }; - _forumRepository.Insert(packagingShippingForum); - } - - protected virtual void InstallDiscounts() - { - var discounts = new List - { - new Discount - { - Name = "Sample discount with coupon code", - DiscountType = DiscountType.AssignedToSkus, - DiscountLimitation = DiscountLimitationType.Unlimited, - UsePercentage = false, - DiscountAmount = 10, - RequiresCouponCode = true, - CouponCode = "123", - }, - new Discount - { - Name = "'20% order total' discount", - DiscountType = DiscountType.AssignedToOrderTotal, - DiscountLimitation = DiscountLimitationType.Unlimited, - UsePercentage = true, - DiscountPercentage = 20, - StartDateUtc = new DateTime(2010,1,1), - EndDateUtc = new DateTime(2020,1,1), - RequiresCouponCode = true, - CouponCode = "456", - }, - }; - _discountRepository.Insert(discounts); - } - - protected virtual void InstallBlogPosts(string defaultUserEmail) - { - var defaultLanguage = _languageRepository.Table.FirstOrDefault(); - - var blogPosts = new List - { - new BlogPost - { - AllowComments = true, - Language = defaultLanguage, - Title = "How a blog can help your growing e-Commerce business", - BodyOverview = "

When you start an online business, your main aim is to sell the products, right? As a business owner, you want to showcase your store to more audience. So, you decide to go on social media, why? Because everyone is doing it, then why shouldn’t you? It is tempting as everyone is aware of the hype that it is the best way to market your brand.

Do you know having a blog for your online store can be very helpful? Many businesses do not understand the importance of having a blog because they don’t have time to post quality content.

Today, we will talk about how a blog can play an important role for the growth of your e-Commerce business. Later, we will also discuss some tips that will be helpful to you for writing business related blog posts.

", - Body = "

When you start an online business, your main aim is to sell the products, right? As a business owner, you want to showcase your store to more audience. So, you decide to go on social media, why? Because everyone is doing it, then why shouldn’t you? It is tempting as everyone is aware of the hype that it is the best way to market your brand.

Do you know having a blog for your online store can be very helpful? Many businesses do not understand the importance of having a blog because they don’t have time to post quality content.

Today, we will talk about how a blog can play an important role for the growth of your e-Commerce business. Later, we will also discuss some tips that will be helpful to you for writing business related blog posts.

1) Blog is useful in educating your customers

Blogging is one of the best way by which you can educate your customers about your products/services that you offer. This helps you as a business owner to bring more value to your brand. When you provide useful information to the customers about your products, they are more likely to buy products from you. You can use your blog for providing tutorials in regard to the use of your products.

For example: If you have an online store that offers computer parts. You can write tutorials about how to build a computer or how to make your computer’s performance better. While talking about these things, you can mention products in the tutorials and provide link to your products within the blog post from your website. Your potential customers might get different ideas of using your product and will likely to buy products from your online store.

2) Blog helps your business in Search Engine Optimization (SEO)

Blog posts create more internal links to your website which helps a lot in SEO. Blog is a great way to have quality content on your website related to your products/services which is indexed by all major search engines like Google, Bing and Yahoo. The more original content you write in your blog post, the better ranking you will get in search engines. SEO is an on-going process and posting blog posts regularly keeps your site active all the time which is beneficial when it comes to search engine optimization.

For example: Let’s say you sell “Sony Television Model XYZ” and you regularly publish blog posts about your product. Now, whenever someone searches for “Sony Television Model XYZ”, Google will crawl on your website knowing that you have something to do with this particular product. Hence, your website will show up on the search result page whenever this item is being searched.

3) Blog helps in boosting your sales by convincing the potential customers to buy

If you own an online business, there are so many ways you can share different stories with your audience in regard your products/services that you offer. Talk about how you started your business, share stories that educate your audience about what’s new in your industry, share stories about how your product/service was beneficial to someone or share anything that you think your audience might find interesting (it does not have to be related to your product). This kind of blogging shows that you are an expert in your industry and interested in educating your audience. It sets you apart in the competitive market. This gives you an opportunity to showcase your expertise by educating the visitors and it can turn your audience into buyers.

Fun Fact: Did you know that 92% of companies who decided to blog acquired customers through their blog?

nopCommerce is great e-Commerce solution that also offers a variety of CMS features including blog. A store owner has full access for managing the blog posts and related comments.

", - Tags = "e-commerce, blog, moey", - CreatedOnUtc = DateTime.UtcNow, - }, - new BlogPost - { - AllowComments = true, - Language = defaultLanguage, - Title = "Why your online store needs a wish list", - BodyOverview = "

What comes to your mind, when you hear the term” wish list”? The application of this feature is exactly how it sounds like: a list of things that you wish to get. As an online store owner, would you like your customers to be able to save products in a wish list so that they review or buy them later? Would you like your customers to be able to share their wish list with friends and family for gift giving?

Offering your customers a feature of wish list as part of shopping cart is a great way to build loyalty to your store site. Having the feature of wish list on a store site allows online businesses to engage with their customers in a smart way as it allows the shoppers to create a list of what they desire and their preferences for future purchase.

", - Body = "

What comes to your mind, when you hear the term” wish list”? The application of this feature is exactly how it sounds like: a list of things that you wish to get. As an online store owner, would you like your customers to be able to save products in a wish list so that they review or buy them later? Would you like your customers to be able to share their wish list with friends and family for gift giving?

Offering your customers a feature of wish list as part of shopping cart is a great way to build loyalty to your store site. Having the feature of wish list on a store site allows online businesses to engage with their customers in a smart way as it allows the shoppers to create a list of what they desire and their preferences for future purchase.

Does every e-Commerce store needs a wish list? The answer to this question in most cases is yes, because of the following reasons:

Understanding the needs of your customers - A wish list is a great way to know what is in your customer’s mind. Try to think the purchase history as a small portion of the customer’s preferences. But, the wish list is like a wide open door that can give any online business a lot of valuable information about their customer and what they like or desire.

Shoppers like to share their wish list with friends and family - Providing your customers a way to email their wish list to their friends and family is a pleasant way to make online shopping enjoyable for the shoppers. It is always a good idea to make the wish list sharable by a unique link so that it can be easily shared though different channels like email or on social media sites.

Wish list can be a great marketing tool – Another way to look at wish list is a great marketing tool because it is extremely targeted and the recipients are always motivated to use it. For example: when your younger brother tells you that his wish list is on a certain e-Commerce store. What is the first thing you are going to do? You are most likely to visit the e-Commerce store, check out the wish list and end up buying something for your younger brother.

So, how a wish list is a marketing tool? The reason is quite simple, it introduce your online store to new customers just how it is explained in the above example.

Encourage customers to return to the store site – Having a feature of wish list on the store site can increase the return traffic because it encourages customers to come back and buy later. Allowing the customers to save the wish list to their online accounts gives them a reason return to the store site and login to the account at any time to view or edit the wish list items.

Wish list can be used for gifts for different occasions like weddings or birthdays. So, what kind of benefits a gift-giver gets from a wish list?

  • It gives them a surety that they didn’t buy a wrong gift
  • It guarantees that the recipient will like the gift
  • It avoids any awkward moments when the recipient unwraps the gift and as a gift-giver you got something that the recipient do not want

Wish list is a great feature to have on a store site – So, what kind of benefits a business owner gets from a wish list

  • It is a great way to advertise an online store as many people do prefer to shop where their friend or family shop online
  • It allows the current customers to return to the store site and open doors for the new customers
  • It allows store admins to track what’s in customers wish list and run promotions accordingly to target specific customer segments

nopCommerce offers the feature of wish list that allows customers to create a list of products that they desire or planning to buy in future.

", - Tags = "e-commerce, nopCommerce, sample tag, money", - CreatedOnUtc = DateTime.UtcNow.AddSeconds(1), - }, - }; - _blogPostRepository.Insert(blogPosts); - - //search engine names - foreach (var blogPost in blogPosts) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = blogPost.Id, - EntityName = "BlogPost", - LanguageId = blogPost.LanguageId, - IsActive = true, - Slug = blogPost.ValidateSeName("", blogPost.Title, true) - }); - } - - //comments - var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); - if (defaultCustomer == null) - throw new Exception("Cannot load default customer"); - - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - foreach (var blogPost in blogPosts) - { - blogPost.BlogComments.Add(new BlogComment - { - BlogPostId = blogPost.Id, - CustomerId = defaultCustomer.Id, - CommentText = "This is a sample comment for this blog post", - IsApproved = true, - StoreId = defaultStore.Id, - CreatedOnUtc = DateTime.UtcNow - }); - } - _blogPostRepository.Update(blogPosts); - } - - protected virtual void InstallNews(string defaultUserEmail) - { - var defaultLanguage = _languageRepository.Table.FirstOrDefault(); - - var news = new List - { - new NewsItem - { - AllowComments = true, - Language = defaultLanguage, - Title = "About nopCommerce", - Short = "It's stable and highly usable. From downloads to documentation, www.nopCommerce.com offers a comprehensive base of information, resources, and support to the nopCommerce community.", - Full = "

For full feature list go to nopCommerce.com

Providing outstanding custom search engine optimization, web development services and e-commerce development solutions to our clients at a fair price in a professional manner.

", - Published = true, - CreatedOnUtc = DateTime.UtcNow, - }, - new NewsItem - { - AllowComments = true, - Language = defaultLanguage, - Title = "nopCommerce new release!", - Short = "nopCommerce includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included! nopCommerce is a fully customizable shopping cart", - Full = "

nopCommerce includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included!

", - Published = true, - CreatedOnUtc = DateTime.UtcNow.AddSeconds(1), - }, - new NewsItem - { - AllowComments = true, - Language = defaultLanguage, - Title = "New online store is open!", - Short = "The new nopCommerce store is open now! We are very excited to offer our new range of products. We will be constantly adding to our range so please register on our site.", - Full = "

Our online store is officially up and running. Stock up for the holiday season! We have a great selection of items. We will be constantly adding to our range so please register on our site, this will enable you to keep up to date with any new products.

All shipping is worldwide and will leave the same day an order is placed! Happy Shopping and spread the word!!

", - Published = true, - CreatedOnUtc = DateTime.UtcNow.AddSeconds(2), - }, - - }; - _newsItemRepository.Insert(news); - - //search engine names - foreach (var newsItem in news) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = newsItem.Id, - EntityName = "NewsItem", - LanguageId = newsItem.LanguageId, - IsActive = true, - Slug = newsItem.ValidateSeName("", newsItem.Title, true) - }); - } - - //comments - var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); - if (defaultCustomer == null) - throw new Exception("Cannot load default customer"); - - //default store - var defaultStore = _storeRepository.Table.FirstOrDefault(); - if (defaultStore == null) - throw new Exception("No default store could be loaded"); - - foreach (var newsItem in news) - { - newsItem.NewsComments.Add(new NewsComment - { - NewsItemId = newsItem.Id, - CustomerId = defaultCustomer.Id, - CommentTitle = "Sample comment title", - CommentText = "This is a sample comment...", - IsApproved = true, - StoreId = defaultStore.Id, - CreatedOnUtc = DateTime.UtcNow - }); - } - _newsItemRepository.Update(news); - } - - protected virtual void InstallPolls() - { - var defaultLanguage = _languageRepository.Table.FirstOrDefault(); - var poll1 = new Poll - { - Language = defaultLanguage, - Name = "Do you like nopCommerce?", - SystemKeyword = "", - Published = true, - ShowOnHomePage = true, - DisplayOrder = 1, - }; - poll1.PollAnswers.Add(new PollAnswer - { - Name = "Excellent", - DisplayOrder = 1, - }); - poll1.PollAnswers.Add(new PollAnswer - { - Name = "Good", - DisplayOrder = 2, - }); - poll1.PollAnswers.Add(new PollAnswer - { - Name = "Poor", - DisplayOrder = 3, - }); - poll1.PollAnswers.Add(new PollAnswer - { - Name = "Very bad", - DisplayOrder = 4, - }); - _pollRepository.Insert(poll1); - } - - protected virtual void InstallActivityLogTypes() - { - var activityLogTypes = new List - { - //admin area activities - new ActivityLogType - { - SystemKeyword = "AddNewAddressAttribute", - Enabled = true, - Name = "Add a new address attribute" - }, - new ActivityLogType - { - SystemKeyword = "AddNewAddressAttributeValue", - Enabled = true, - Name = "Add a new address attribute value" - }, - new ActivityLogType - { - SystemKeyword = "AddNewAffiliate", - Enabled = true, - Name = "Add a new affiliate" - }, - new ActivityLogType - { - SystemKeyword = "AddNewBlogPost", - Enabled = true, - Name = "Add a new blog post" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCampaign", - Enabled = true, - Name = "Add a new campaign" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCategory", - Enabled = true, - Name = "Add a new category" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCheckoutAttribute", - Enabled = true, - Name = "Add a new checkout attribute" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCountry", - Enabled = true, - Name = "Add a new country" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCurrency", - Enabled = true, - Name = "Add a new currency" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCustomer", - Enabled = true, - Name = "Add a new customer" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCustomerAttribute", - Enabled = true, - Name = "Add a new customer attribute" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCustomerAttributeValue", - Enabled = true, - Name = "Add a new customer attribute value" - }, - new ActivityLogType - { - SystemKeyword = "AddNewCustomerRole", - Enabled = true, - Name = "Add a new customer role" - }, - new ActivityLogType - { - SystemKeyword = "AddNewDiscount", - Enabled = true, - Name = "Add a new discount" - }, - new ActivityLogType - { - SystemKeyword = "AddNewEmailAccount", - Enabled = true, - Name = "Add a new email account" - }, - new ActivityLogType - { - SystemKeyword = "AddNewGiftCard", - Enabled = true, - Name = "Add a new gift card" - }, - new ActivityLogType - { - SystemKeyword = "AddNewLanguage", - Enabled = true, - Name = "Add a new language" - }, - new ActivityLogType - { - SystemKeyword = "AddNewManufacturer", - Enabled = true, - Name = "Add a new manufacturer" - }, - new ActivityLogType - { - SystemKeyword = "AddNewMeasureDimension", - Enabled = true, - Name = "Add a new measure dimension" - }, - new ActivityLogType - { - SystemKeyword = "AddNewMeasureWeight", - Enabled = true, - Name = "Add a new measure weight" - }, - new ActivityLogType - { - SystemKeyword = "AddNewNews", - Enabled = true, - Name = "Add a new news" - }, - new ActivityLogType - { - SystemKeyword = "AddNewProduct", - Enabled = true, - Name = "Add a new product" - }, - new ActivityLogType - { - SystemKeyword = "AddNewProductAttribute", - Enabled = true, - Name = "Add a new product attribute" - }, - new ActivityLogType - { - SystemKeyword = "AddNewSetting", - Enabled = true, - Name = "Add a new setting" - }, - new ActivityLogType - { - SystemKeyword = "AddNewSpecAttribute", - Enabled = true, - Name = "Add a new specification attribute" - }, - new ActivityLogType - { - SystemKeyword = "AddNewStateProvince", - Enabled = true, - Name = "Add a new state or province" - }, - new ActivityLogType - { - SystemKeyword = "AddNewStore", - Enabled = true, - Name = "Add a new store" - }, - new ActivityLogType - { - SystemKeyword = "AddNewTopic", - Enabled = true, - Name = "Add a new topic" - }, - new ActivityLogType - { - SystemKeyword = "AddNewVendor", - Enabled = true, - Name = "Add a new vendor" - }, - new ActivityLogType - { - SystemKeyword = "AddNewWarehouse", - Enabled = true, - Name = "Add a new warehouse" - }, - new ActivityLogType - { - SystemKeyword = "AddNewWidget", - Enabled = true, - Name = "Add a new widget" - }, - new ActivityLogType - { - SystemKeyword = "DeleteActivityLog", - Enabled = true, - Name = "Delete activity log" - }, - new ActivityLogType - { - SystemKeyword = "DeleteAddressAttribute", - Enabled = true, - Name = "Delete an address attribute" - }, - new ActivityLogType - { - SystemKeyword = "DeleteAddressAttributeValue", - Enabled = true, - Name = "Delete an address attribute value" - }, - new ActivityLogType - { - SystemKeyword = "DeleteAffiliate", - Enabled = true, - Name = "Delete an affiliate" - }, - new ActivityLogType - { - SystemKeyword = "DeleteBlogPost", - Enabled = true, - Name = "Delete a blog post" - }, - new ActivityLogType - { - SystemKeyword = "DeleteBlogPostComment", - Enabled = true, - Name = "Delete a blog post comment" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCampaign", - Enabled = true, - Name = "Delete a campaign" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCategory", - Enabled = true, - Name = "Delete category" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCheckoutAttribute", - Enabled = true, - Name = "Delete a checkout attribute" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCountry", - Enabled = true, - Name = "Delete a country" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCurrency", - Enabled = true, - Name = "Delete a currency" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCustomer", - Enabled = true, - Name = "Delete a customer" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCustomerAttribute", - Enabled = true, - Name = "Delete a customer attribute" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCustomerAttributeValue", - Enabled = true, - Name = "Delete a customer attribute value" - }, - new ActivityLogType - { - SystemKeyword = "DeleteCustomerRole", - Enabled = true, - Name = "Delete a customer role" - }, - new ActivityLogType - { - SystemKeyword = "DeleteDiscount", - Enabled = true, - Name = "Delete a discount" - }, - new ActivityLogType - { - SystemKeyword = "DeleteEmailAccount", - Enabled = true, - Name = "Delete an email account" - }, - new ActivityLogType - { - SystemKeyword = "DeleteGiftCard", - Enabled = true, - Name = "Delete a gift card" - }, - new ActivityLogType - { - SystemKeyword = "DeleteLanguage", - Enabled = true, - Name = "Delete a language" - }, - new ActivityLogType - { - SystemKeyword = "DeleteManufacturer", - Enabled = true, - Name = "Delete a manufacturer" - }, - new ActivityLogType - { - SystemKeyword = "DeleteMeasureDimension", - Enabled = true, - Name = "Delete a measure dimension" - }, - new ActivityLogType - { - SystemKeyword = "DeleteMeasureWeight", - Enabled = true, - Name = "Delete a measure weight" - }, - new ActivityLogType - { - SystemKeyword = "DeleteMessageTemplate", - Enabled = true, - Name = "Delete a message template" - }, - new ActivityLogType - { - SystemKeyword = "DeleteNews", - Enabled = true, - Name = "Delete a news" - }, - new ActivityLogType - { - SystemKeyword = "DeleteNewsComment", - Enabled = true, - Name = "Delete a news comment" - }, - new ActivityLogType - { - SystemKeyword = "DeleteOrder", - Enabled = true, - Name = "Delete an order" - }, - new ActivityLogType - { - SystemKeyword = "DeleteProduct", - Enabled = true, - Name = "Delete a product" - }, - new ActivityLogType - { - SystemKeyword = "DeleteProductAttribute", - Enabled = true, - Name = "Delete a product attribute" - }, - new ActivityLogType - { - SystemKeyword = "DeleteProductReview", - Enabled = true, - Name = "Delete a product review" - }, - new ActivityLogType - { - SystemKeyword = "DeleteReturnRequest", - Enabled = true, - Name = "Delete a return request" - }, - new ActivityLogType - { - SystemKeyword = "DeleteSetting", - Enabled = true, - Name = "Delete a setting" - }, - new ActivityLogType - { - SystemKeyword = "DeleteSpecAttribute", - Enabled = true, - Name = "Delete a specification attribute" - }, - new ActivityLogType - { - SystemKeyword = "DeleteStateProvince", - Enabled = true, - Name = "Delete a state or province" - }, - new ActivityLogType - { - SystemKeyword = "DeleteStore", - Enabled = true, - Name = "Delete a store" - }, - new ActivityLogType - { - SystemKeyword = "DeleteTopic", - Enabled = true, - Name = "Delete a topic" - }, - new ActivityLogType - { - SystemKeyword = "DeleteVendor", - Enabled = true, - Name = "Delete a vendor" - }, - new ActivityLogType - { - SystemKeyword = "DeleteWarehouse", - Enabled = true, - Name = "Delete a warehouse" - }, - new ActivityLogType - { - SystemKeyword = "DeleteWidget", - Enabled = true, - Name = "Delete a widget" - }, - new ActivityLogType - { - SystemKeyword = "EditActivityLogTypes", - Enabled = true, - Name = "Edit activity log types" - }, - new ActivityLogType - { - SystemKeyword = "EditAddressAttribute", - Enabled = true, - Name = "Edit an address attribute" - }, - new ActivityLogType - { - SystemKeyword = "EditAddressAttributeValue", - Enabled = true, - Name = "Edit an address attribute value" - }, - new ActivityLogType - { - SystemKeyword = "EditAffiliate", - Enabled = true, - Name = "Edit an affiliate" - }, - new ActivityLogType - { - SystemKeyword = "EditBlogPost", - Enabled = true, - Name = "Edit a blog post" - }, - new ActivityLogType - { - SystemKeyword = "EditCampaign", - Enabled = true, - Name = "Edit a campaign" - }, - new ActivityLogType - { - SystemKeyword = "EditCategory", - Enabled = true, - Name = "Edit category" - }, - new ActivityLogType - { - SystemKeyword = "EditCheckoutAttribute", - Enabled = true, - Name = "Edit a checkout attribute" - }, - new ActivityLogType - { - SystemKeyword = "EditCountry", - Enabled = true, - Name = "Edit a country" - }, - new ActivityLogType - { - SystemKeyword = "EditCurrency", - Enabled = true, - Name = "Edit a currency" - }, - new ActivityLogType - { - SystemKeyword = "EditCustomer", - Enabled = true, - Name = "Edit a customer" - }, - new ActivityLogType - { - SystemKeyword = "EditCustomerAttribute", - Enabled = true, - Name = "Edit a customer attribute" - }, - new ActivityLogType - { - SystemKeyword = "EditCustomerAttributeValue", - Enabled = true, - Name = "Edit a customer attribute value" - }, - new ActivityLogType - { - SystemKeyword = "EditCustomerRole", - Enabled = true, - Name = "Edit a customer role" - }, - new ActivityLogType - { - SystemKeyword = "EditDiscount", - Enabled = true, - Name = "Edit a discount" - }, - new ActivityLogType - { - SystemKeyword = "EditEmailAccount", - Enabled = true, - Name = "Edit an email account" - }, - new ActivityLogType - { - SystemKeyword = "EditGiftCard", - Enabled = true, - Name = "Edit a gift card" - }, - new ActivityLogType - { - SystemKeyword = "EditLanguage", - Enabled = true, - Name = "Edit a language" - }, - new ActivityLogType - { - SystemKeyword = "EditManufacturer", - Enabled = true, - Name = "Edit a manufacturer" - }, - new ActivityLogType - { - SystemKeyword = "EditMeasureDimension", - Enabled = true, - Name = "Edit a measure dimension" - }, - new ActivityLogType - { - SystemKeyword = "EditMeasureWeight", - Enabled = true, - Name = "Edit a measure weight" - }, - new ActivityLogType - { - SystemKeyword = "EditMessageTemplate", - Enabled = true, - Name = "Edit a message template" - }, - new ActivityLogType - { - SystemKeyword = "EditNews", - Enabled = true, - Name = "Edit a news" - }, - new ActivityLogType - { - SystemKeyword = "EditOrder", - Enabled = true, - Name = "Edit an order" - }, - new ActivityLogType - { - SystemKeyword = "EditPlugin", - Enabled = true, - Name = "Edit a plugin" - }, - new ActivityLogType - { - SystemKeyword = "EditProduct", - Enabled = true, - Name = "Edit a product" - }, - new ActivityLogType - { - SystemKeyword = "EditProductAttribute", - Enabled = true, - Name = "Edit a product attribute" - }, - new ActivityLogType - { - SystemKeyword = "EditProductReview", - Enabled = true, - Name = "Edit a product review" - }, - new ActivityLogType - { - SystemKeyword = "EditPromotionProviders", - Enabled = true, - Name = "Edit promotion providers" - }, - new ActivityLogType - { - SystemKeyword = "EditReturnRequest", - Enabled = true, - Name = "Edit a return request" - }, - new ActivityLogType - { - SystemKeyword = "EditSettings", - Enabled = true, - Name = "Edit setting(s)" - }, - new ActivityLogType - { - SystemKeyword = "EditStateProvince", - Enabled = true, - Name = "Edit a state or province" - }, - new ActivityLogType - { - SystemKeyword = "EditStore", - Enabled = true, - Name = "Edit a store" - }, - new ActivityLogType - { - SystemKeyword = "EditTask", - Enabled = true, - Name = "Edit a task" - }, - new ActivityLogType - { - SystemKeyword = "EditSpecAttribute", - Enabled = true, - Name = "Edit a specification attribute" - }, - new ActivityLogType - { - SystemKeyword = "EditVendor", - Enabled = true, - Name = "Edit a vendor" - }, - new ActivityLogType - { - SystemKeyword = "EditWarehouse", - Enabled = true, - Name = "Edit a warehouse" - }, - new ActivityLogType - { - SystemKeyword = "EditTopic", - Enabled = true, - Name = "Edit a topic" - }, - new ActivityLogType - { - SystemKeyword = "EditWidget", - Enabled = true, - Name = "Edit a widget" - }, - new ActivityLogType - { - SystemKeyword = "Impersonation.Started", - Enabled = true, - Name = "Customer impersonation session. Started" - }, - new ActivityLogType - { - SystemKeyword = "Impersonation.Finished", - Enabled = true, - Name = "Customer impersonation session. Finished" - }, - new ActivityLogType - { - SystemKeyword = "ImportCategories", - Enabled = true, - Name = "Categories were imported" - }, - new ActivityLogType - { - SystemKeyword = "ImportManufacturers", - Enabled = true, - Name = "Manufacturers were imported" - }, - new ActivityLogType - { - SystemKeyword = "ImportProducts", - Enabled = true, - Name = "Products were imported" - }, - new ActivityLogType - { - SystemKeyword = "ImportStates", - Enabled = true, - Name = "States were imported" - }, - new ActivityLogType - { - SystemKeyword = "InstallNewPlugin", - Enabled = true, - Name = "Install a new plugin" - }, - new ActivityLogType - { - SystemKeyword = "UninstallPlugin", - Enabled = true, - Name = "Uninstall a plugin" - }, - //public store activities - new ActivityLogType - { - SystemKeyword = "PublicStore.ViewCategory", - Enabled = false, - Name = "Public store. View a category" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.ViewManufacturer", - Enabled = false, - Name = "Public store. View a manufacturer" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.ViewProduct", - Enabled = false, - Name = "Public store. View a product" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.PlaceOrder", - Enabled = false, - Name = "Public store. Place an order" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.SendPM", - Enabled = false, - Name = "Public store. Send PM" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.ContactUs", - Enabled = false, - Name = "Public store. Use contact us form" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddToCompareList", - Enabled = false, - Name = "Public store. Add to compare list" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddToShoppingCart", - Enabled = false, - Name = "Public store. Add to shopping cart" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddToWishlist", - Enabled = false, - Name = "Public store. Add to wishlist" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.Login", - Enabled = false, - Name = "Public store. Login" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.Logout", - Enabled = false, - Name = "Public store. Logout" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddProductReview", - Enabled = false, - Name = "Public store. Add product review" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddNewsComment", - Enabled = false, - Name = "Public store. Add news comment" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddBlogComment", - Enabled = false, - Name = "Public store. Add blog comment" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddForumTopic", - Enabled = false, - Name = "Public store. Add forum topic" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.EditForumTopic", - Enabled = false, - Name = "Public store. Edit forum topic" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.DeleteForumTopic", - Enabled = false, - Name = "Public store. Delete forum topic" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.AddForumPost", - Enabled = false, - Name = "Public store. Add forum post" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.EditForumPost", - Enabled = false, - Name = "Public store. Edit forum post" - }, - new ActivityLogType - { - SystemKeyword = "PublicStore.DeleteForumPost", - Enabled = false, - Name = "Public store. Delete forum post" - } - }; - _activityLogTypeRepository.Insert(activityLogTypes); - } - - protected virtual void InstallProductTemplates() - { - var productTemplates = new List - { - new ProductTemplate - { - Name = "Simple product", - ViewPath = "ProductTemplate.Simple", - DisplayOrder = 10, - IgnoredProductTypes = ((int)ProductType.GroupedProduct).ToString() - }, - new ProductTemplate - { - Name = "Grouped product (with variants)", - ViewPath = "ProductTemplate.Grouped", - DisplayOrder = 100, - IgnoredProductTypes = ((int)ProductType.SimpleProduct).ToString() - } - }; - _productTemplateRepository.Insert(productTemplates); - } - - protected virtual void InstallCategoryTemplates() - { - var categoryTemplates = new List - { - new CategoryTemplate - { - Name = "Products in Grid or Lines", - ViewPath = "CategoryTemplate.ProductsInGridOrLines", - DisplayOrder = 1 - }, - }; - _categoryTemplateRepository.Insert(categoryTemplates); - } - - protected virtual void InstallManufacturerTemplates() - { - var manufacturerTemplates = new List - { - new ManufacturerTemplate - { - Name = "Products in Grid or Lines", - ViewPath = "ManufacturerTemplate.ProductsInGridOrLines", - DisplayOrder = 1 - }, - }; - _manufacturerTemplateRepository.Insert(manufacturerTemplates); - } - - protected virtual void InstallTopicTemplates() - { - var topicTemplates = new List - { - new TopicTemplate - { - Name = "Default template", - ViewPath = "TopicDetails", - DisplayOrder = 1 - }, - }; - _topicTemplateRepository.Insert(topicTemplates); - } - - protected virtual void InstallScheduleTasks() - { - var tasks = new List - { - new ScheduleTask - { - Name = "Send emails", - Seconds = 60, - Type = "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services", - Enabled = true, - StopOnError = false, - }, - new ScheduleTask - { - Name = "Keep alive", - Seconds = 300, - Type = "Nop.Services.Common.KeepAliveTask, Nop.Services", - Enabled = true, - StopOnError = false, - }, - new ScheduleTask - { - Name = "Delete guests", - Seconds = 600, - Type = "Nop.Services.Customers.DeleteGuestsTask, Nop.Services", - Enabled = true, - StopOnError = false, - }, - new ScheduleTask - { - Name = "Clear cache", - Seconds = 600, - Type = "Nop.Services.Caching.ClearCacheTask, Nop.Services", - Enabled = false, - StopOnError = false, - }, - new ScheduleTask - { - Name = "Clear log", - //60 minutes - Seconds = 3600, - Type = "Nop.Services.Logging.ClearLogTask, Nop.Services", - Enabled = false, - StopOnError = false, - }, - new ScheduleTask - { - Name = "Update currency exchange rates", - //60 minutes - Seconds = 3600, - Type = "Nop.Services.Directory.UpdateExchangeRateTask, Nop.Services", - Enabled = true, - StopOnError = false, - }, - }; - - _scheduleTaskRepository.Insert(tasks); - } - - protected virtual void InstallReturnRequestReasons() - { - var returnRequestReasons = new List - { - new ReturnRequestReason - { - Name = "Received Wrong Product", - DisplayOrder = 1 - }, - new ReturnRequestReason - { - Name = "Wrong Product Ordered", - DisplayOrder = 2 - }, - new ReturnRequestReason - { - Name = "There Was A Problem With The Product", - DisplayOrder = 3 - } - }; - _returnRequestReasonRepository.Insert(returnRequestReasons); - } - protected virtual void InstallReturnRequestActions() - { - var returnRequestActions = new List - { - new ReturnRequestAction - { - Name = "Repair", - DisplayOrder = 1 - }, - new ReturnRequestAction - { - Name = "Replacement", - DisplayOrder = 2 - }, - new ReturnRequestAction - { - Name = "Store Credit", - DisplayOrder = 3 - } - }; - _returnRequestActionRepository.Insert(returnRequestActions); - } - - protected virtual void InstallWarehouses() - { - var warehouse1address = new Address - { - Address1 = "21 West 52nd Street", - City = "New York", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - ZipPostalCode = "10021", - CreatedOnUtc = DateTime.UtcNow, - }; - _addressRepository.Insert(warehouse1address); - var warehouse2address = new Address - { - Address1 = "300 South Spring Stree", - City = "Los Angeles", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "California"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - ZipPostalCode = "90013", - CreatedOnUtc = DateTime.UtcNow, - }; - _addressRepository.Insert(warehouse2address); - var warehouses = new List - { - new Warehouse - { - Name = "Warehouse 1 (New York)", - AddressId = warehouse1address.Id - }, - new Warehouse - { - Name = "Warehouse 2 (Los Angeles)", - AddressId = warehouse2address.Id - } - }; - - _warehouseRepository.Insert(warehouses); - } - - protected virtual void InstallVendors() - { - var vendors = new List - { - new Vendor - { - Name = "Vendor 1", - Email = "vendor1email@gmail.com", - Description = "Some description...", - AdminComment = "", - PictureId = 0, - Active = true, - DisplayOrder = 1, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9, 18", - }, - new Vendor - { - Name = "Vendor 2", - Email = "vendor2email@gmail.com", - Description = "Some description...", - AdminComment = "", - PictureId = 0, - Active = true, - DisplayOrder = 2, - PageSize = 6, - AllowCustomersToSelectPageSize = true, - PageSizeOptions = "6, 3, 9, 18", - } - }; - - _vendorRepository.Insert(vendors); - - //search engine names - foreach (var vendor in vendors) - { - _urlRecordRepository.Insert(new UrlRecord - { - EntityId = vendor.Id, - EntityName = "Vendor", - LanguageId = 0, - IsActive = true, - Slug = vendor.ValidateSeName("", vendor.Name, true) - }); - } - } - - protected virtual void InstallAffiliates() - { - var affiliateAddress = new Address - { - FirstName = "John", - LastName = "Smith", - Email = "affiliate_email@gmail.com", - Company = "Company name here...", - City = "New York", - Address1 = "21 West 52nd Street", - ZipPostalCode = "10021", - PhoneNumber = "123456789", - StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), - Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), - CreatedOnUtc = DateTime.UtcNow, - }; - _addressRepository.Insert(affiliateAddress); - var affilate = new Affiliate - { - Active = true, - Address = affiliateAddress - }; - _affiliateRepository.Insert(affilate); - } - - private void AddProductTag(Product product, string tag) - { - var productTag = _productTagRepository.Table.FirstOrDefault(pt => pt.Name == tag); - if (productTag == null) - { - productTag = new ProductTag - { - Name = tag, - }; - } - product.ProductTags.Add(productTag); - _productRepository.Update(product); - } - - #endregion - - #region Methods - - public virtual void InstallData(string defaultUserEmail, - string defaultUserPassword, bool installSampleData = true) - { - InstallStores(); - InstallMeasures(); - InstallTaxCategories(); - InstallLanguages(); - InstallCurrencies(); - InstallCountriesAndStates(); - InstallShippingMethods(); - InstallDeliveryDates(); - InstallProductAvailabilityRanges(); - InstallCustomersAndUsers(defaultUserEmail, defaultUserPassword); - InstallEmailAccounts(); - InstallMessageTemplates(); - InstallSettings(installSampleData); - InstallTopicTemplates(); - InstallTopics(); - InstallLocaleResources(); - InstallActivityLogTypes(); - InstallProductTemplates(); - InstallCategoryTemplates(); - InstallManufacturerTemplates(); - InstallScheduleTasks(); - InstallReturnRequestReasons(); - InstallReturnRequestActions(); - - if (installSampleData) - { - InstallCheckoutAttributes(); - InstallSpecificationAttributes(); - InstallProductAttributes(); - InstallCategories(); - InstallManufacturers(); - InstallProducts(defaultUserEmail); - InstallForums(); - InstallDiscounts(); - InstallBlogPosts(defaultUserEmail); - InstallNews(defaultUserEmail); - InstallPolls(); - InstallWarehouses(); - InstallVendors(); - InstallAffiliates(); - InstallOrders(); - InstallActivityLog(defaultUserEmail); - InstallSearchTerms(); - } - } - - #endregion - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Nop.Core; +using Nop.Core.Data; +using Nop.Core.Domain; +using Nop.Core.Domain.Affiliates; +using Nop.Core.Domain.Blogs; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Cms; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Forums; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Logging; +using Nop.Core.Domain.Media; +using Nop.Core.Domain.Messages; +using Nop.Core.Domain.News; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Polls; +using Nop.Core.Domain.Security; +using Nop.Core.Domain.Seo; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Stores; +using Nop.Core.Domain.Tasks; +using Nop.Core.Domain.Tax; +using Nop.Core.Domain.Topics; +using Nop.Core.Domain.Vendors; +using Nop.Core.Infrastructure; +using Nop.Services.Common; +using Nop.Services.Configuration; +using Nop.Services.Customers; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Seo; + +namespace Nop.Services.Installation +{ + public partial class CodeFirstInstallationService : IInstallationService + { + #region Fields + + private readonly IRepository _storeRepository; + private readonly IRepository _measureDimensionRepository; + private readonly IRepository _measureWeightRepository; + private readonly IRepository _taxCategoryRepository; + private readonly IRepository _languageRepository; + private readonly IRepository _currencyRepository; + private readonly IRepository _customerRepository; + private readonly IRepository _customerPasswordRepository; + private readonly IRepository _customerRoleRepository; + private readonly IRepository _specificationAttributeRepository; + private readonly IRepository _checkoutAttributeRepository; + private readonly IRepository _productAttributeRepository; + private readonly IRepository _categoryRepository; + private readonly IRepository _manufacturerRepository; + private readonly IRepository _productRepository; + private readonly IRepository _urlRecordRepository; + private readonly IRepository _relatedProductRepository; + private readonly IRepository _emailAccountRepository; + private readonly IRepository _messageTemplateRepository; + private readonly IRepository _forumGroupRepository; + private readonly IRepository _forumRepository; + private readonly IRepository _countryRepository; + private readonly IRepository _stateProvinceRepository; + private readonly IRepository _discountRepository; + private readonly IRepository _blogPostRepository; + private readonly IRepository _topicRepository; + private readonly IRepository _newsItemRepository; + private readonly IRepository _pollRepository; + private readonly IRepository _shippingMethodRepository; + private readonly IRepository _deliveryDateRepository; + private readonly IRepository _productAvailabilityRangeRepository; + private readonly IRepository _activityLogTypeRepository; + private readonly IRepository _activityLogRepository; + private readonly IRepository _productTagRepository; + private readonly IRepository _productTemplateRepository; + private readonly IRepository _categoryTemplateRepository; + private readonly IRepository _manufacturerTemplateRepository; + private readonly IRepository _topicTemplateRepository; + private readonly IRepository _scheduleTaskRepository; + private readonly IRepository _returnRequestReasonRepository; + private readonly IRepository _returnRequestActionRepository; + private readonly IRepository
_addressRepository; + private readonly IRepository _warehouseRepository; + private readonly IRepository _vendorRepository; + private readonly IRepository _affiliateRepository; + private readonly IRepository _orderRepository; + private readonly IRepository _orderItemRepository; + private readonly IRepository _orderNoteRepository; + private readonly IRepository _giftCardRepository; + private readonly IRepository _shipmentRepository; + private readonly IRepository _searchTermRepository; + private readonly IRepository _shipmentItemRepository; + private readonly IRepository _stockQuantityHistoryRepository; + private readonly IGenericAttributeService _genericAttributeService; + private readonly IWebHelper _webHelper; + + #endregion + + #region Ctor + + public CodeFirstInstallationService(IRepository storeRepository, + IRepository measureDimensionRepository, + IRepository measureWeightRepository, + IRepository taxCategoryRepository, + IRepository languageRepository, + IRepository currencyRepository, + IRepository customerRepository, + IRepository customerPasswordRepository, + IRepository customerRoleRepository, + IRepository specificationAttributeRepository, + IRepository checkoutAttributeRepository, + IRepository productAttributeRepository, + IRepository categoryRepository, + IRepository manufacturerRepository, + IRepository productRepository, + IRepository urlRecordRepository, + IRepository relatedProductRepository, + IRepository emailAccountRepository, + IRepository messageTemplateRepository, + IRepository forumGroupRepository, + IRepository forumRepository, + IRepository countryRepository, + IRepository stateProvinceRepository, + IRepository discountRepository, + IRepository blogPostRepository, + IRepository topicRepository, + IRepository newsItemRepository, + IRepository pollRepository, + IRepository shippingMethodRepository, + IRepository deliveryDateRepository, + IRepository productAvailabilityRangeRepository, + IRepository activityLogTypeRepository, + IRepository activityLogRepository, + IRepository productTagRepository, + IRepository productTemplateRepository, + IRepository categoryTemplateRepository, + IRepository manufacturerTemplateRepository, + IRepository topicTemplateRepository, + IRepository scheduleTaskRepository, + IRepository returnRequestReasonRepository, + IRepository returnRequestActionRepository, + IRepository
addressRepository, + IRepository warehouseRepository, + IRepository vendorRepository, + IRepository affiliateRepository, + IRepository orderRepository, + IRepository orderItemRepository, + IRepository orderNoteRepository, + IRepository giftCardRepository, + IRepository shipmentRepository, + IRepository shipmentItemRepository, + IRepository searchTermRepository, + IRepository stockQuantityHistoryRepository, + IGenericAttributeService genericAttributeService, + IWebHelper webHelper) + { + this._storeRepository = storeRepository; + this._measureDimensionRepository = measureDimensionRepository; + this._measureWeightRepository = measureWeightRepository; + this._taxCategoryRepository = taxCategoryRepository; + this._languageRepository = languageRepository; + this._currencyRepository = currencyRepository; + this._customerRepository = customerRepository; + this._customerPasswordRepository = customerPasswordRepository; + this._customerRoleRepository = customerRoleRepository; + this._specificationAttributeRepository = specificationAttributeRepository; + this._checkoutAttributeRepository = checkoutAttributeRepository; + this._productAttributeRepository = productAttributeRepository; + this._categoryRepository = categoryRepository; + this._manufacturerRepository = manufacturerRepository; + this._productRepository = productRepository; + this._urlRecordRepository = urlRecordRepository; + this._relatedProductRepository = relatedProductRepository; + this._emailAccountRepository = emailAccountRepository; + this._messageTemplateRepository = messageTemplateRepository; + this._forumGroupRepository = forumGroupRepository; + this._forumRepository = forumRepository; + this._countryRepository = countryRepository; + this._stateProvinceRepository = stateProvinceRepository; + this._discountRepository = discountRepository; + this._blogPostRepository = blogPostRepository; + this._topicRepository = topicRepository; + this._newsItemRepository = newsItemRepository; + this._pollRepository = pollRepository; + this._shippingMethodRepository = shippingMethodRepository; + this._deliveryDateRepository = deliveryDateRepository; + this._productAvailabilityRangeRepository = productAvailabilityRangeRepository; + this._activityLogTypeRepository = activityLogTypeRepository; + this._activityLogRepository = activityLogRepository; + this._productTagRepository = productTagRepository; + this._productTemplateRepository = productTemplateRepository; + this._categoryTemplateRepository = categoryTemplateRepository; + this._manufacturerTemplateRepository = manufacturerTemplateRepository; + this._topicTemplateRepository = topicTemplateRepository; + this._scheduleTaskRepository = scheduleTaskRepository; + this._returnRequestReasonRepository = returnRequestReasonRepository; + this._returnRequestActionRepository = returnRequestActionRepository; + this._addressRepository = addressRepository; + this._warehouseRepository = warehouseRepository; + this._vendorRepository = vendorRepository; + this._affiliateRepository = affiliateRepository; + this._orderRepository = orderRepository; + this._orderItemRepository = orderItemRepository; + this._orderNoteRepository = orderNoteRepository; + this._giftCardRepository = giftCardRepository; + this._shipmentRepository = shipmentRepository; + this._shipmentItemRepository = shipmentItemRepository; + this._searchTermRepository = searchTermRepository; + this._stockQuantityHistoryRepository = stockQuantityHistoryRepository; + this._genericAttributeService = genericAttributeService; + this._webHelper = webHelper; + } + + #endregion + + #region Utilities + + protected virtual void InstallStores() + { + //var storeUrl = "http://www.yourStore.com/"; + var storeUrl = _webHelper.GetStoreLocation(false); + var stores = new List + { + new Store + { + Name = "Your store name", + Url = storeUrl, + SslEnabled = false, + Hosts = "yourstore.com,www.yourstore.com", + DisplayOrder = 1, + //should we set some default company info? + CompanyName = "Your company name", + CompanyAddress = "your company country, state, zip, street, etc", + CompanyPhoneNumber = "(123) 456-78901", + CompanyVat = null, + }, + }; + + _storeRepository.Insert(stores); + } + + protected virtual void InstallMeasures() + { + var measureDimensions = new List + { + new MeasureDimension + { + Name = "inch(es)", + SystemKeyword = "inches", + Ratio = 1M, + DisplayOrder = 1, + }, + new MeasureDimension + { + Name = "feet", + SystemKeyword = "feet", + Ratio = 0.08333333M, + DisplayOrder = 2, + }, + new MeasureDimension + { + Name = "meter(s)", + SystemKeyword = "meters", + Ratio = 0.0254M, + DisplayOrder = 3, + }, + new MeasureDimension + { + Name = "millimetre(s)", + SystemKeyword = "millimetres", + Ratio = 25.4M, + DisplayOrder = 4, + } + }; + + _measureDimensionRepository.Insert(measureDimensions); + + var measureWeights = new List + { + new MeasureWeight + { + Name = "ounce(s)", + SystemKeyword = "ounce", + Ratio = 16M, + DisplayOrder = 1, + }, + new MeasureWeight + { + Name = "lb(s)", + SystemKeyword = "lb", + Ratio = 1M, + DisplayOrder = 2, + }, + new MeasureWeight + { + Name = "kg(s)", + SystemKeyword = "kg", + Ratio = 0.45359237M, + DisplayOrder = 3, + }, + new MeasureWeight + { + Name = "gram(s)", + SystemKeyword = "grams", + Ratio = 453.59237M, + DisplayOrder = 4, + } + }; + + _measureWeightRepository.Insert(measureWeights); + } + + protected virtual void InstallTaxCategories() + { + var taxCategories = new List + { + new TaxCategory + { + Name = "Books", + DisplayOrder = 1, + }, + new TaxCategory + { + Name = "Electronics & Software", + DisplayOrder = 5, + }, + new TaxCategory + { + Name = "Downloadable Products", + DisplayOrder = 10, + }, + new TaxCategory + { + Name = "Jewelry", + DisplayOrder = 15, + }, + new TaxCategory + { + Name = "Apparel", + DisplayOrder = 20, + }, + }; + _taxCategoryRepository.Insert(taxCategories); + + } + + protected virtual void InstallLanguages() + { + var language = new Language + { + Name = "English", + LanguageCulture = "en-US", + UniqueSeoCode = "en", + FlagImageFileName = "us.png", + Published = true, + DisplayOrder = 1 + }; + _languageRepository.Insert(language); + } + + protected virtual void InstallLocaleResources() + { + //'English' language + var language = _languageRepository.Table.Single(l => l.Name == "English"); + + //save resources + foreach (var filePath in System.IO.Directory.EnumerateFiles(CommonHelper.MapPath("~/App_Data/Localization/"), "*.nopres.xml", SearchOption.TopDirectoryOnly)) + { + var localesXml = File.ReadAllText(filePath); + var localizationService = EngineContext.Current.Resolve(); + localizationService.ImportResourcesFromXml(language, localesXml); + } + + } + + protected virtual void InstallCurrencies() + { + var currencies = new List + { + new Currency + { + Name = "US Dollar", + CurrencyCode = "USD", + Rate = 1, + DisplayLocale = "en-US", + CustomFormatting = "", + Published = true, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Australian Dollar", + CurrencyCode = "AUD", + Rate = 1.36M, + DisplayLocale = "en-AU", + CustomFormatting = "", + Published = false, + DisplayOrder = 2, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "British Pound", + CurrencyCode = "GBP", + Rate = 0.82M, + DisplayLocale = "en-GB", + CustomFormatting = "", + Published = false, + DisplayOrder = 3, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Canadian Dollar", + CurrencyCode = "CAD", + Rate = 1.32M, + DisplayLocale = "en-CA", + CustomFormatting = "", + Published = false, + DisplayOrder = 4, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Chinese Yuan Renminbi", + CurrencyCode = "CNY", + Rate = 6.93M, + DisplayLocale = "zh-CN", + CustomFormatting = "", + Published = false, + DisplayOrder = 5, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Euro", + CurrencyCode = "EUR", + Rate = 0.95M, + DisplayLocale = "", + //CustomFormatting = "0.00", + CustomFormatting = string.Format("{0}0.00", "\u20ac"), + Published = true, + DisplayOrder = 6, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Hong Kong Dollar", + CurrencyCode = "HKD", + Rate = 7.75M, + DisplayLocale = "zh-HK", + CustomFormatting = "", + Published = false, + DisplayOrder = 7, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Japanese Yen", + CurrencyCode = "JPY", + Rate = 116.64M, + DisplayLocale = "ja-JP", + CustomFormatting = "", + Published = false, + DisplayOrder = 8, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Russian Rouble", + CurrencyCode = "RUB", + Rate = 59.75M, + DisplayLocale = "ru-RU", + CustomFormatting = "", + Published = false, + DisplayOrder = 9, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Swedish Krona", + CurrencyCode = "SEK", + Rate = 9.08M, + DisplayLocale = "sv-SE", + CustomFormatting = "", + Published = false, + DisplayOrder = 10, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding1 + }, + new Currency + { + Name = "Romanian Leu", + CurrencyCode = "RON", + Rate = 4.28M, + DisplayLocale = "ro-RO", + CustomFormatting = "", + Published = false, + DisplayOrder = 11, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + new Currency + { + Name = "Indian Rupee", + CurrencyCode = "INR", + Rate = 68.17M, + DisplayLocale = "en-IN", + CustomFormatting = "", + Published = false, + DisplayOrder = 12, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + RoundingType = RoundingType.Rounding001 + }, + }; + _currencyRepository.Insert(currencies); + } + + protected virtual void InstallCountriesAndStates() + { + var cUsa = new Country + { + Name = "United States", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "US", + ThreeLetterIsoCode = "USA", + NumericIsoCode = 840, + SubjectToVat = false, + DisplayOrder = 1, + Published = true, + }; + cUsa.StateProvinces.Add(new StateProvince + { + Name = "AA (Armed Forces Americas)", + Abbreviation = "AA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "AE (Armed Forces Europe)", + Abbreviation = "AE", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Alabama", + Abbreviation = "AL", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Alaska", + Abbreviation = "AK", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "American Samoa", + Abbreviation = "AS", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "AP (Armed Forces Pacific)", + Abbreviation = "AP", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Arizona", + Abbreviation = "AZ", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Arkansas", + Abbreviation = "AR", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "California", + Abbreviation = "CA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Colorado", + Abbreviation = "CO", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Connecticut", + Abbreviation = "CT", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Delaware", + Abbreviation = "DE", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "District of Columbia", + Abbreviation = "DC", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Federated States of Micronesia", + Abbreviation = "FM", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Florida", + Abbreviation = "FL", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Georgia", + Abbreviation = "GA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Guam", + Abbreviation = "GU", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Hawaii", + Abbreviation = "HI", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Idaho", + Abbreviation = "ID", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Illinois", + Abbreviation = "IL", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Indiana", + Abbreviation = "IN", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Iowa", + Abbreviation = "IA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Kansas", + Abbreviation = "KS", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Kentucky", + Abbreviation = "KY", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Louisiana", + Abbreviation = "LA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Maine", + Abbreviation = "ME", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Marshall Islands", + Abbreviation = "MH", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Maryland", + Abbreviation = "MD", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Massachusetts", + Abbreviation = "MA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Michigan", + Abbreviation = "MI", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Minnesota", + Abbreviation = "MN", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Mississippi", + Abbreviation = "MS", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Missouri", + Abbreviation = "MO", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Montana", + Abbreviation = "MT", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Nebraska", + Abbreviation = "NE", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Nevada", + Abbreviation = "NV", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "New Hampshire", + Abbreviation = "NH", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "New Jersey", + Abbreviation = "NJ", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "New Mexico", + Abbreviation = "NM", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "New York", + Abbreviation = "NY", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "North Carolina", + Abbreviation = "NC", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "North Dakota", + Abbreviation = "ND", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Northern Mariana Islands", + Abbreviation = "MP", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Ohio", + Abbreviation = "OH", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Oklahoma", + Abbreviation = "OK", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Oregon", + Abbreviation = "OR", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Palau", + Abbreviation = "PW", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Pennsylvania", + Abbreviation = "PA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Puerto Rico", + Abbreviation = "PR", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Rhode Island", + Abbreviation = "RI", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "South Carolina", + Abbreviation = "SC", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "South Dakota", + Abbreviation = "SD", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Tennessee", + Abbreviation = "TN", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Texas", + Abbreviation = "TX", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Utah", + Abbreviation = "UT", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Vermont", + Abbreviation = "VT", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Virgin Islands", + Abbreviation = "VI", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Virginia", + Abbreviation = "VA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Washington", + Abbreviation = "WA", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "West Virginia", + Abbreviation = "WV", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Wisconsin", + Abbreviation = "WI", + Published = true, + DisplayOrder = 1, + }); + cUsa.StateProvinces.Add(new StateProvince + { + Name = "Wyoming", + Abbreviation = "WY", + Published = true, + DisplayOrder = 1, + }); + var cCanada = new Country + { + Name = "Canada", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CA", + ThreeLetterIsoCode = "CAN", + NumericIsoCode = 124, + SubjectToVat = false, + DisplayOrder = 100, + Published = true, + }; + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Alberta", + Abbreviation = "AB", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "British Columbia", + Abbreviation = "BC", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Manitoba", + Abbreviation = "MB", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "New Brunswick", + Abbreviation = "NB", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Newfoundland and Labrador", + Abbreviation = "NL", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Northwest Territories", + Abbreviation = "NT", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Nova Scotia", + Abbreviation = "NS", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Nunavut", + Abbreviation = "NU", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Ontario", + Abbreviation = "ON", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Prince Edward Island", + Abbreviation = "PE", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Quebec", + Abbreviation = "QC", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Saskatchewan", + Abbreviation = "SK", + Published = true, + DisplayOrder = 1, + }); + cCanada.StateProvinces.Add(new StateProvince + { + Name = "Yukon Territory", + Abbreviation = "YT", + Published = true, + DisplayOrder = 1, + }); + var countries = new List + { + cUsa, + cCanada, + //other countries + new Country + { + Name = "Argentina", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AR", + ThreeLetterIsoCode = "ARG", + NumericIsoCode = 32, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Armenia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AM", + ThreeLetterIsoCode = "ARM", + NumericIsoCode = 51, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Aruba", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AW", + ThreeLetterIsoCode = "ABW", + NumericIsoCode = 533, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Australia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AU", + ThreeLetterIsoCode = "AUS", + NumericIsoCode = 36, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Austria", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AT", + ThreeLetterIsoCode = "AUT", + NumericIsoCode = 40, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Azerbaijan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AZ", + ThreeLetterIsoCode = "AZE", + NumericIsoCode = 31, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bahamas", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BS", + ThreeLetterIsoCode = "BHS", + NumericIsoCode = 44, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bangladesh", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BD", + ThreeLetterIsoCode = "BGD", + NumericIsoCode = 50, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Belarus", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BY", + ThreeLetterIsoCode = "BLR", + NumericIsoCode = 112, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Belgium", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BE", + ThreeLetterIsoCode = "BEL", + NumericIsoCode = 56, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Belize", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BZ", + ThreeLetterIsoCode = "BLZ", + NumericIsoCode = 84, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bermuda", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BM", + ThreeLetterIsoCode = "BMU", + NumericIsoCode = 60, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bolivia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BO", + ThreeLetterIsoCode = "BOL", + NumericIsoCode = 68, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bosnia and Herzegowina", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BA", + ThreeLetterIsoCode = "BIH", + NumericIsoCode = 70, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Brazil", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BR", + ThreeLetterIsoCode = "BRA", + NumericIsoCode = 76, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bulgaria", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BG", + ThreeLetterIsoCode = "BGR", + NumericIsoCode = 100, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cayman Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KY", + ThreeLetterIsoCode = "CYM", + NumericIsoCode = 136, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Chile", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CL", + ThreeLetterIsoCode = "CHL", + NumericIsoCode = 152, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "China", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CN", + ThreeLetterIsoCode = "CHN", + NumericIsoCode = 156, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Colombia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CO", + ThreeLetterIsoCode = "COL", + NumericIsoCode = 170, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Costa Rica", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CR", + ThreeLetterIsoCode = "CRI", + NumericIsoCode = 188, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Croatia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HR", + ThreeLetterIsoCode = "HRV", + NumericIsoCode = 191, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cuba", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CU", + ThreeLetterIsoCode = "CUB", + NumericIsoCode = 192, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cyprus", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CY", + ThreeLetterIsoCode = "CYP", + NumericIsoCode = 196, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Czech Republic", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CZ", + ThreeLetterIsoCode = "CZE", + NumericIsoCode = 203, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Denmark", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DK", + ThreeLetterIsoCode = "DNK", + NumericIsoCode = 208, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Dominican Republic", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DO", + ThreeLetterIsoCode = "DOM", + NumericIsoCode = 214, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "East Timor", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TL", + ThreeLetterIsoCode = "TLS", + NumericIsoCode = 626, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Ecuador", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "EC", + ThreeLetterIsoCode = "ECU", + NumericIsoCode = 218, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Egypt", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "EG", + ThreeLetterIsoCode = "EGY", + NumericIsoCode = 818, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Finland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FI", + ThreeLetterIsoCode = "FIN", + NumericIsoCode = 246, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "France", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FR", + ThreeLetterIsoCode = "FRA", + NumericIsoCode = 250, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Georgia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GE", + ThreeLetterIsoCode = "GEO", + NumericIsoCode = 268, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Germany", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DE", + ThreeLetterIsoCode = "DEU", + NumericIsoCode = 276, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Gibraltar", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GI", + ThreeLetterIsoCode = "GIB", + NumericIsoCode = 292, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Greece", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GR", + ThreeLetterIsoCode = "GRC", + NumericIsoCode = 300, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guatemala", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GT", + ThreeLetterIsoCode = "GTM", + NumericIsoCode = 320, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Hong Kong", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HK", + ThreeLetterIsoCode = "HKG", + NumericIsoCode = 344, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Hungary", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HU", + ThreeLetterIsoCode = "HUN", + NumericIsoCode = 348, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "India", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IN", + ThreeLetterIsoCode = "IND", + NumericIsoCode = 356, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Indonesia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ID", + ThreeLetterIsoCode = "IDN", + NumericIsoCode = 360, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Ireland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IE", + ThreeLetterIsoCode = "IRL", + NumericIsoCode = 372, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Israel", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IL", + ThreeLetterIsoCode = "ISR", + NumericIsoCode = 376, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Italy", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IT", + ThreeLetterIsoCode = "ITA", + NumericIsoCode = 380, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Jamaica", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "JM", + ThreeLetterIsoCode = "JAM", + NumericIsoCode = 388, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Japan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "JP", + ThreeLetterIsoCode = "JPN", + NumericIsoCode = 392, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Jordan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "JO", + ThreeLetterIsoCode = "JOR", + NumericIsoCode = 400, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Kazakhstan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KZ", + ThreeLetterIsoCode = "KAZ", + NumericIsoCode = 398, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Korea, Democratic People's Republic of", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KP", + ThreeLetterIsoCode = "PRK", + NumericIsoCode = 408, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Kuwait", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KW", + ThreeLetterIsoCode = "KWT", + NumericIsoCode = 414, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Malaysia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MY", + ThreeLetterIsoCode = "MYS", + NumericIsoCode = 458, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mexico", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MX", + ThreeLetterIsoCode = "MEX", + NumericIsoCode = 484, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Netherlands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NL", + ThreeLetterIsoCode = "NLD", + NumericIsoCode = 528, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "New Zealand", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NZ", + ThreeLetterIsoCode = "NZL", + NumericIsoCode = 554, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Norway", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NO", + ThreeLetterIsoCode = "NOR", + NumericIsoCode = 578, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Pakistan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PK", + ThreeLetterIsoCode = "PAK", + NumericIsoCode = 586, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Palestine", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PS", + ThreeLetterIsoCode = "PSE", + NumericIsoCode = 275, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Paraguay", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PY", + ThreeLetterIsoCode = "PRY", + NumericIsoCode = 600, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Peru", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PE", + ThreeLetterIsoCode = "PER", + NumericIsoCode = 604, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Philippines", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PH", + ThreeLetterIsoCode = "PHL", + NumericIsoCode = 608, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Poland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PL", + ThreeLetterIsoCode = "POL", + NumericIsoCode = 616, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Portugal", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PT", + ThreeLetterIsoCode = "PRT", + NumericIsoCode = 620, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Puerto Rico", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PR", + ThreeLetterIsoCode = "PRI", + NumericIsoCode = 630, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Qatar", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "QA", + ThreeLetterIsoCode = "QAT", + NumericIsoCode = 634, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Romania", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "RO", + ThreeLetterIsoCode = "ROM", + NumericIsoCode = 642, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Russian Federation", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "RU", + ThreeLetterIsoCode = "RUS", + NumericIsoCode = 643, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Saudi Arabia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SA", + ThreeLetterIsoCode = "SAU", + NumericIsoCode = 682, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Singapore", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SG", + ThreeLetterIsoCode = "SGP", + NumericIsoCode = 702, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Slovakia (Slovak Republic)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SK", + ThreeLetterIsoCode = "SVK", + NumericIsoCode = 703, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Slovenia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SI", + ThreeLetterIsoCode = "SVN", + NumericIsoCode = 705, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "South Africa", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ZA", + ThreeLetterIsoCode = "ZAF", + NumericIsoCode = 710, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Spain", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ES", + ThreeLetterIsoCode = "ESP", + NumericIsoCode = 724, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Sweden", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SE", + ThreeLetterIsoCode = "SWE", + NumericIsoCode = 752, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Switzerland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CH", + ThreeLetterIsoCode = "CHE", + NumericIsoCode = 756, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Taiwan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TW", + ThreeLetterIsoCode = "TWN", + NumericIsoCode = 158, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Thailand", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TH", + ThreeLetterIsoCode = "THA", + NumericIsoCode = 764, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Turkey", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TR", + ThreeLetterIsoCode = "TUR", + NumericIsoCode = 792, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Ukraine", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "UA", + ThreeLetterIsoCode = "UKR", + NumericIsoCode = 804, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "United Arab Emirates", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AE", + ThreeLetterIsoCode = "ARE", + NumericIsoCode = 784, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "United Kingdom", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GB", + ThreeLetterIsoCode = "GBR", + NumericIsoCode = 826, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "United States minor outlying islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "UM", + ThreeLetterIsoCode = "UMI", + NumericIsoCode = 581, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Uruguay", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "UY", + ThreeLetterIsoCode = "URY", + NumericIsoCode = 858, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Uzbekistan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "UZ", + ThreeLetterIsoCode = "UZB", + NumericIsoCode = 860, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Venezuela", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VE", + ThreeLetterIsoCode = "VEN", + NumericIsoCode = 862, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Serbia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "RS", + ThreeLetterIsoCode = "SRB", + NumericIsoCode = 688, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Afghanistan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AF", + ThreeLetterIsoCode = "AFG", + NumericIsoCode = 4, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Albania", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AL", + ThreeLetterIsoCode = "ALB", + NumericIsoCode = 8, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Algeria", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DZ", + ThreeLetterIsoCode = "DZA", + NumericIsoCode = 12, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "American Samoa", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AS", + ThreeLetterIsoCode = "ASM", + NumericIsoCode = 16, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Andorra", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AD", + ThreeLetterIsoCode = "AND", + NumericIsoCode = 20, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Angola", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AO", + ThreeLetterIsoCode = "AGO", + NumericIsoCode = 24, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Anguilla", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AI", + ThreeLetterIsoCode = "AIA", + NumericIsoCode = 660, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Antarctica", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AQ", + ThreeLetterIsoCode = "ATA", + NumericIsoCode = 10, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Antigua and Barbuda", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AG", + ThreeLetterIsoCode = "ATG", + NumericIsoCode = 28, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bahrain", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BH", + ThreeLetterIsoCode = "BHR", + NumericIsoCode = 48, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Barbados", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BB", + ThreeLetterIsoCode = "BRB", + NumericIsoCode = 52, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Benin", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BJ", + ThreeLetterIsoCode = "BEN", + NumericIsoCode = 204, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bhutan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BT", + ThreeLetterIsoCode = "BTN", + NumericIsoCode = 64, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Botswana", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BW", + ThreeLetterIsoCode = "BWA", + NumericIsoCode = 72, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Bouvet Island", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BV", + ThreeLetterIsoCode = "BVT", + NumericIsoCode = 74, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "British Indian Ocean Territory", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IO", + ThreeLetterIsoCode = "IOT", + NumericIsoCode = 86, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Brunei Darussalam", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BN", + ThreeLetterIsoCode = "BRN", + NumericIsoCode = 96, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Burkina Faso", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BF", + ThreeLetterIsoCode = "BFA", + NumericIsoCode = 854, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Burundi", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "BI", + ThreeLetterIsoCode = "BDI", + NumericIsoCode = 108, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cambodia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KH", + ThreeLetterIsoCode = "KHM", + NumericIsoCode = 116, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cameroon", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CM", + ThreeLetterIsoCode = "CMR", + NumericIsoCode = 120, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cape Verde", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CV", + ThreeLetterIsoCode = "CPV", + NumericIsoCode = 132, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Central African Republic", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CF", + ThreeLetterIsoCode = "CAF", + NumericIsoCode = 140, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Chad", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TD", + ThreeLetterIsoCode = "TCD", + NumericIsoCode = 148, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Christmas Island", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CX", + ThreeLetterIsoCode = "CXR", + NumericIsoCode = 162, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cocos (Keeling) Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CC", + ThreeLetterIsoCode = "CCK", + NumericIsoCode = 166, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Comoros", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KM", + ThreeLetterIsoCode = "COM", + NumericIsoCode = 174, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Congo", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CG", + ThreeLetterIsoCode = "COG", + NumericIsoCode = 178, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Congo (Democratic Republic of the)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CD", + ThreeLetterIsoCode = "COD", + NumericIsoCode = 180, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cook Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CK", + ThreeLetterIsoCode = "COK", + NumericIsoCode = 184, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Cote D'Ivoire", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "CI", + ThreeLetterIsoCode = "CIV", + NumericIsoCode = 384, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Djibouti", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DJ", + ThreeLetterIsoCode = "DJI", + NumericIsoCode = 262, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Dominica", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "DM", + ThreeLetterIsoCode = "DMA", + NumericIsoCode = 212, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "El Salvador", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SV", + ThreeLetterIsoCode = "SLV", + NumericIsoCode = 222, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Equatorial Guinea", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GQ", + ThreeLetterIsoCode = "GNQ", + NumericIsoCode = 226, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Eritrea", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ER", + ThreeLetterIsoCode = "ERI", + NumericIsoCode = 232, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Estonia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "EE", + ThreeLetterIsoCode = "EST", + NumericIsoCode = 233, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Ethiopia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ET", + ThreeLetterIsoCode = "ETH", + NumericIsoCode = 231, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Falkland Islands (Malvinas)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FK", + ThreeLetterIsoCode = "FLK", + NumericIsoCode = 238, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Faroe Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FO", + ThreeLetterIsoCode = "FRO", + NumericIsoCode = 234, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Fiji", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FJ", + ThreeLetterIsoCode = "FJI", + NumericIsoCode = 242, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "French Guiana", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GF", + ThreeLetterIsoCode = "GUF", + NumericIsoCode = 254, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "French Polynesia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PF", + ThreeLetterIsoCode = "PYF", + NumericIsoCode = 258, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "French Southern Territories", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TF", + ThreeLetterIsoCode = "ATF", + NumericIsoCode = 260, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Gabon", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GA", + ThreeLetterIsoCode = "GAB", + NumericIsoCode = 266, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Gambia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GM", + ThreeLetterIsoCode = "GMB", + NumericIsoCode = 270, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Ghana", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GH", + ThreeLetterIsoCode = "GHA", + NumericIsoCode = 288, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Greenland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GL", + ThreeLetterIsoCode = "GRL", + NumericIsoCode = 304, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Grenada", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GD", + ThreeLetterIsoCode = "GRD", + NumericIsoCode = 308, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guadeloupe", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GP", + ThreeLetterIsoCode = "GLP", + NumericIsoCode = 312, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guam", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GU", + ThreeLetterIsoCode = "GUM", + NumericIsoCode = 316, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guinea", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GN", + ThreeLetterIsoCode = "GIN", + NumericIsoCode = 324, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guinea-bissau", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GW", + ThreeLetterIsoCode = "GNB", + NumericIsoCode = 624, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Guyana", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GY", + ThreeLetterIsoCode = "GUY", + NumericIsoCode = 328, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Haiti", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HT", + ThreeLetterIsoCode = "HTI", + NumericIsoCode = 332, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Heard and Mc Donald Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HM", + ThreeLetterIsoCode = "HMD", + NumericIsoCode = 334, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Honduras", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "HN", + ThreeLetterIsoCode = "HND", + NumericIsoCode = 340, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Iceland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IS", + ThreeLetterIsoCode = "ISL", + NumericIsoCode = 352, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Iran (Islamic Republic of)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IR", + ThreeLetterIsoCode = "IRN", + NumericIsoCode = 364, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Iraq", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "IQ", + ThreeLetterIsoCode = "IRQ", + NumericIsoCode = 368, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Kenya", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KE", + ThreeLetterIsoCode = "KEN", + NumericIsoCode = 404, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Kiribati", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KI", + ThreeLetterIsoCode = "KIR", + NumericIsoCode = 296, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Korea", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KR", + ThreeLetterIsoCode = "KOR", + NumericIsoCode = 410, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Kyrgyzstan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KG", + ThreeLetterIsoCode = "KGZ", + NumericIsoCode = 417, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Lao People's Democratic Republic", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LA", + ThreeLetterIsoCode = "LAO", + NumericIsoCode = 418, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Latvia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LV", + ThreeLetterIsoCode = "LVA", + NumericIsoCode = 428, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Lebanon", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LB", + ThreeLetterIsoCode = "LBN", + NumericIsoCode = 422, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Lesotho", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LS", + ThreeLetterIsoCode = "LSO", + NumericIsoCode = 426, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Liberia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LR", + ThreeLetterIsoCode = "LBR", + NumericIsoCode = 430, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Libyan Arab Jamahiriya", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LY", + ThreeLetterIsoCode = "LBY", + NumericIsoCode = 434, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Liechtenstein", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LI", + ThreeLetterIsoCode = "LIE", + NumericIsoCode = 438, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Lithuania", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LT", + ThreeLetterIsoCode = "LTU", + NumericIsoCode = 440, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Luxembourg", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LU", + ThreeLetterIsoCode = "LUX", + NumericIsoCode = 442, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Macau", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MO", + ThreeLetterIsoCode = "MAC", + NumericIsoCode = 446, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Macedonia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MK", + ThreeLetterIsoCode = "MKD", + NumericIsoCode = 807, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Madagascar", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MG", + ThreeLetterIsoCode = "MDG", + NumericIsoCode = 450, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Malawi", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MW", + ThreeLetterIsoCode = "MWI", + NumericIsoCode = 454, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Maldives", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MV", + ThreeLetterIsoCode = "MDV", + NumericIsoCode = 462, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mali", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ML", + ThreeLetterIsoCode = "MLI", + NumericIsoCode = 466, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Malta", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MT", + ThreeLetterIsoCode = "MLT", + NumericIsoCode = 470, + SubjectToVat = true, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Marshall Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MH", + ThreeLetterIsoCode = "MHL", + NumericIsoCode = 584, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Martinique", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MQ", + ThreeLetterIsoCode = "MTQ", + NumericIsoCode = 474, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mauritania", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MR", + ThreeLetterIsoCode = "MRT", + NumericIsoCode = 478, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mauritius", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MU", + ThreeLetterIsoCode = "MUS", + NumericIsoCode = 480, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mayotte", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "YT", + ThreeLetterIsoCode = "MYT", + NumericIsoCode = 175, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Micronesia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "FM", + ThreeLetterIsoCode = "FSM", + NumericIsoCode = 583, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Moldova", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MD", + ThreeLetterIsoCode = "MDA", + NumericIsoCode = 498, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Monaco", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MC", + ThreeLetterIsoCode = "MCO", + NumericIsoCode = 492, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mongolia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MN", + ThreeLetterIsoCode = "MNG", + NumericIsoCode = 496, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Montenegro", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ME", + ThreeLetterIsoCode = "MNE", + NumericIsoCode = 499, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Montserrat", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MS", + ThreeLetterIsoCode = "MSR", + NumericIsoCode = 500, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Morocco", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MA", + ThreeLetterIsoCode = "MAR", + NumericIsoCode = 504, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Mozambique", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MZ", + ThreeLetterIsoCode = "MOZ", + NumericIsoCode = 508, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Myanmar", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MM", + ThreeLetterIsoCode = "MMR", + NumericIsoCode = 104, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Namibia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NA", + ThreeLetterIsoCode = "NAM", + NumericIsoCode = 516, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Nauru", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NR", + ThreeLetterIsoCode = "NRU", + NumericIsoCode = 520, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Nepal", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NP", + ThreeLetterIsoCode = "NPL", + NumericIsoCode = 524, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Netherlands Antilles", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "AN", + ThreeLetterIsoCode = "ANT", + NumericIsoCode = 530, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "New Caledonia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NC", + ThreeLetterIsoCode = "NCL", + NumericIsoCode = 540, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Nicaragua", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NI", + ThreeLetterIsoCode = "NIC", + NumericIsoCode = 558, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Niger", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NE", + ThreeLetterIsoCode = "NER", + NumericIsoCode = 562, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Nigeria", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NG", + ThreeLetterIsoCode = "NGA", + NumericIsoCode = 566, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Niue", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NU", + ThreeLetterIsoCode = "NIU", + NumericIsoCode = 570, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Norfolk Island", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "NF", + ThreeLetterIsoCode = "NFK", + NumericIsoCode = 574, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Northern Mariana Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "MP", + ThreeLetterIsoCode = "MNP", + NumericIsoCode = 580, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Oman", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "OM", + ThreeLetterIsoCode = "OMN", + NumericIsoCode = 512, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Palau", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PW", + ThreeLetterIsoCode = "PLW", + NumericIsoCode = 585, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Panama", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PA", + ThreeLetterIsoCode = "PAN", + NumericIsoCode = 591, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Papua New Guinea", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PG", + ThreeLetterIsoCode = "PNG", + NumericIsoCode = 598, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Pitcairn", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PN", + ThreeLetterIsoCode = "PCN", + NumericIsoCode = 612, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Reunion", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "RE", + ThreeLetterIsoCode = "REU", + NumericIsoCode = 638, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Rwanda", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "RW", + ThreeLetterIsoCode = "RWA", + NumericIsoCode = 646, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Saint Kitts and Nevis", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "KN", + ThreeLetterIsoCode = "KNA", + NumericIsoCode = 659, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Saint Lucia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LC", + ThreeLetterIsoCode = "LCA", + NumericIsoCode = 662, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Saint Vincent and the Grenadines", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VC", + ThreeLetterIsoCode = "VCT", + NumericIsoCode = 670, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Samoa", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "WS", + ThreeLetterIsoCode = "WSM", + NumericIsoCode = 882, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "San Marino", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SM", + ThreeLetterIsoCode = "SMR", + NumericIsoCode = 674, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Sao Tome and Principe", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ST", + ThreeLetterIsoCode = "STP", + NumericIsoCode = 678, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Senegal", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SN", + ThreeLetterIsoCode = "SEN", + NumericIsoCode = 686, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Seychelles", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SC", + ThreeLetterIsoCode = "SYC", + NumericIsoCode = 690, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Sierra Leone", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SL", + ThreeLetterIsoCode = "SLE", + NumericIsoCode = 694, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Solomon Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SB", + ThreeLetterIsoCode = "SLB", + NumericIsoCode = 90, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Somalia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SO", + ThreeLetterIsoCode = "SOM", + NumericIsoCode = 706, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "South Georgia & South Sandwich Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "GS", + ThreeLetterIsoCode = "SGS", + NumericIsoCode = 239, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "South Sudan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SS", + ThreeLetterIsoCode = "SSD", + NumericIsoCode = 728, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Sri Lanka", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "LK", + ThreeLetterIsoCode = "LKA", + NumericIsoCode = 144, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "St. Helena", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SH", + ThreeLetterIsoCode = "SHN", + NumericIsoCode = 654, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "St. Pierre and Miquelon", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "PM", + ThreeLetterIsoCode = "SPM", + NumericIsoCode = 666, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Sudan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SD", + ThreeLetterIsoCode = "SDN", + NumericIsoCode = 736, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Suriname", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SR", + ThreeLetterIsoCode = "SUR", + NumericIsoCode = 740, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Svalbard and Jan Mayen Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SJ", + ThreeLetterIsoCode = "SJM", + NumericIsoCode = 744, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Swaziland", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SZ", + ThreeLetterIsoCode = "SWZ", + NumericIsoCode = 748, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Syrian Arab Republic", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "SY", + ThreeLetterIsoCode = "SYR", + NumericIsoCode = 760, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tajikistan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TJ", + ThreeLetterIsoCode = "TJK", + NumericIsoCode = 762, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tanzania", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TZ", + ThreeLetterIsoCode = "TZA", + NumericIsoCode = 834, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Togo", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TG", + ThreeLetterIsoCode = "TGO", + NumericIsoCode = 768, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tokelau", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TK", + ThreeLetterIsoCode = "TKL", + NumericIsoCode = 772, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tonga", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TO", + ThreeLetterIsoCode = "TON", + NumericIsoCode = 776, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Trinidad and Tobago", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TT", + ThreeLetterIsoCode = "TTO", + NumericIsoCode = 780, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tunisia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TN", + ThreeLetterIsoCode = "TUN", + NumericIsoCode = 788, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Turkmenistan", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TM", + ThreeLetterIsoCode = "TKM", + NumericIsoCode = 795, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Turks and Caicos Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TC", + ThreeLetterIsoCode = "TCA", + NumericIsoCode = 796, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Tuvalu", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "TV", + ThreeLetterIsoCode = "TUV", + NumericIsoCode = 798, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Uganda", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "UG", + ThreeLetterIsoCode = "UGA", + NumericIsoCode = 800, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Vanuatu", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VU", + ThreeLetterIsoCode = "VUT", + NumericIsoCode = 548, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Vatican City State (Holy See)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VA", + ThreeLetterIsoCode = "VAT", + NumericIsoCode = 336, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Viet Nam", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VN", + ThreeLetterIsoCode = "VNM", + NumericIsoCode = 704, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Virgin Islands (British)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VG", + ThreeLetterIsoCode = "VGB", + NumericIsoCode = 92, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Virgin Islands (U.S.)", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "VI", + ThreeLetterIsoCode = "VIR", + NumericIsoCode = 850, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Wallis and Futuna Islands", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "WF", + ThreeLetterIsoCode = "WLF", + NumericIsoCode = 876, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Western Sahara", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "EH", + ThreeLetterIsoCode = "ESH", + NumericIsoCode = 732, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Yemen", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "YE", + ThreeLetterIsoCode = "YEM", + NumericIsoCode = 887, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Zambia", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ZM", + ThreeLetterIsoCode = "ZMB", + NumericIsoCode = 894, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + new Country + { + Name = "Zimbabwe", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "ZW", + ThreeLetterIsoCode = "ZWE", + NumericIsoCode = 716, + SubjectToVat = false, + DisplayOrder = 100, + Published = true + }, + }; + _countryRepository.Insert(countries); + } + + protected virtual void InstallShippingMethods() + { + var shippingMethods = new List + { + new ShippingMethod + { + Name = "Ground", + Description ="Compared to other shipping methods, ground shipping is carried out closer to the earth", + DisplayOrder = 1 + }, + new ShippingMethod + { + Name = "Next Day Air", + Description ="The one day air shipping", + DisplayOrder = 3 + }, + new ShippingMethod + { + Name = "2nd Day Air", + Description ="The two day air shipping", + DisplayOrder = 3 + } + }; + _shippingMethodRepository.Insert(shippingMethods); + } + + protected virtual void InstallDeliveryDates() + { + var deliveryDates = new List + { + new DeliveryDate + { + Name = "1-2 days", + DisplayOrder = 1 + }, + new DeliveryDate + { + Name = "3-5 days", + DisplayOrder = 5 + }, + new DeliveryDate + { + Name = "1 week", + DisplayOrder = 10 + }, + }; + _deliveryDateRepository.Insert(deliveryDates); + } + + protected virtual void InstallProductAvailabilityRanges() + { + var productAvailabilityRanges = new List + { + new ProductAvailabilityRange + { + Name = "2-4 days", + DisplayOrder = 1 + }, + new ProductAvailabilityRange + { + Name = "7-10 days", + DisplayOrder = 2 + }, + new ProductAvailabilityRange + { + Name = "2 week", + DisplayOrder = 3 + }, + }; + _productAvailabilityRangeRepository.Insert(productAvailabilityRanges); + } + + protected virtual void InstallCustomersAndUsers(string defaultUserEmail, string defaultUserPassword) + { + var crAdministrators = new CustomerRole + { + Name = "Administrators", + Active = true, + IsSystemRole = true, + SystemName = SystemCustomerRoleNames.Administrators, + }; + var crForumModerators = new CustomerRole + { + Name = "Forum Moderators", + Active = true, + IsSystemRole = true, + SystemName = SystemCustomerRoleNames.ForumModerators, + }; + var crRegistered = new CustomerRole + { + Name = "Registered", + Active = true, + IsSystemRole = true, + SystemName = SystemCustomerRoleNames.Registered, + }; + var crGuests = new CustomerRole + { + Name = "Guests", + Active = true, + IsSystemRole = true, + SystemName = SystemCustomerRoleNames.Guests, + }; + var crVendors = new CustomerRole + { + Name = "Vendors", + Active = true, + IsSystemRole = true, + SystemName = SystemCustomerRoleNames.Vendors, + }; + var customerRoles = new List + { + crAdministrators, + crForumModerators, + crRegistered, + crGuests, + crVendors + }; + _customerRoleRepository.Insert(customerRoles); + + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + var storeId = defaultStore.Id; + + //admin user + var adminUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = defaultUserEmail, + Username = defaultUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + + var defaultAdminUserAddress = new Address + { + FirstName = "John", + LastName = "Smith", + PhoneNumber = "12345678", + Email = defaultUserEmail, + FaxNumber = "", + Company = "Nop Solutions Ltd", + Address1 = "21 West 52nd Street", + Address2 = "", + City = "New York", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + ZipPostalCode = "10021", + CreatedOnUtc = DateTime.UtcNow, + }; + adminUser.Addresses.Add(defaultAdminUserAddress); + adminUser.BillingAddress = defaultAdminUserAddress; + adminUser.ShippingAddress = defaultAdminUserAddress; + + adminUser.CustomerRoles.Add(crAdministrators); + adminUser.CustomerRoles.Add(crForumModerators); + adminUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(adminUser); + //set default customer name + _genericAttributeService.SaveAttribute(adminUser, SystemCustomerAttributeNames.FirstName, "John"); + _genericAttributeService.SaveAttribute(adminUser, SystemCustomerAttributeNames.LastName, "Smith"); + + //set hashed admin password + var customerRegistrationService = EngineContext.Current.Resolve(); + customerRegistrationService.ChangePassword(new ChangePasswordRequest(defaultUserEmail, false, + PasswordFormat.Hashed, defaultUserPassword)); + + //second user + var secondUserEmail = "steve_gates@nopCommerce.com"; + var secondUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = secondUserEmail, + Username = secondUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + var defaultSecondUserAddress = new Address + { + FirstName = "Steve", + LastName = "Gates", + PhoneNumber = "87654321", + Email = secondUserEmail, + FaxNumber = "", + Company = "Steve Company", + Address1 = "750 Bel Air Rd.", + Address2 = "", + City = "Los Angeles", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "California"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + ZipPostalCode = "90077", + CreatedOnUtc = DateTime.UtcNow, + }; + secondUser.Addresses.Add(defaultSecondUserAddress); + secondUser.BillingAddress = defaultSecondUserAddress; + secondUser.ShippingAddress = defaultSecondUserAddress; + + secondUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(secondUser); + //set default customer name + _genericAttributeService.SaveAttribute(secondUser, SystemCustomerAttributeNames.FirstName, defaultSecondUserAddress.FirstName); + _genericAttributeService.SaveAttribute(secondUser, SystemCustomerAttributeNames.LastName, defaultSecondUserAddress.LastName); + + //set customer password + _customerPasswordRepository.Insert(new CustomerPassword + { + Customer = secondUser, + Password = "123456", + PasswordFormat = PasswordFormat.Clear, + PasswordSalt = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }); + + //third user + var thirdUserEmail = "arthur_holmes@nopCommerce.com"; + var thirdUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = thirdUserEmail, + Username = thirdUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + var defaultThirdUserAddress = new Address + { + FirstName = "Arthur", + LastName = "Holmes", + PhoneNumber = "111222333", + Email = thirdUserEmail, + FaxNumber = "", + Company = "Holmes Company", + Address1 = "221B Baker Street", + Address2 = "", + City = "London", + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "GBR"), + ZipPostalCode = "NW1 6XE", + CreatedOnUtc = DateTime.UtcNow, + }; + thirdUser.Addresses.Add(defaultThirdUserAddress); + thirdUser.BillingAddress = defaultThirdUserAddress; + thirdUser.ShippingAddress = defaultThirdUserAddress; + + thirdUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(thirdUser); + //set default customer name + _genericAttributeService.SaveAttribute(thirdUser, SystemCustomerAttributeNames.FirstName, defaultThirdUserAddress.FirstName); + _genericAttributeService.SaveAttribute(thirdUser, SystemCustomerAttributeNames.LastName, defaultThirdUserAddress.LastName); + + //set customer password + _customerPasswordRepository.Insert(new CustomerPassword + { + Customer = thirdUser, + Password = "123456", + PasswordFormat = PasswordFormat.Clear, + PasswordSalt = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }); + + //fourth user + var fourthUserEmail = "james_pan@nopCommerce.com"; + var fourthUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = fourthUserEmail, + Username = fourthUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + var defaultFourthUserAddress = new Address + { + FirstName = "James", + LastName = "Pan", + PhoneNumber = "369258147", + Email = fourthUserEmail, + FaxNumber = "", + Company = "Pan Company", + Address1 = "St Katharines West 16", + Address2 = "", + City = "St Andrews", + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "GBR"), + ZipPostalCode = "KY16 9AX", + CreatedOnUtc = DateTime.UtcNow, + }; + fourthUser.Addresses.Add(defaultFourthUserAddress); + fourthUser.BillingAddress = defaultFourthUserAddress; + fourthUser.ShippingAddress = defaultFourthUserAddress; + + fourthUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(fourthUser); + //set default customer name + _genericAttributeService.SaveAttribute(fourthUser, SystemCustomerAttributeNames.FirstName, defaultFourthUserAddress.FirstName); + _genericAttributeService.SaveAttribute(fourthUser, SystemCustomerAttributeNames.LastName, defaultFourthUserAddress.LastName); + + //set customer password + _customerPasswordRepository.Insert(new CustomerPassword + { + Customer = fourthUser, + Password = "123456", + PasswordFormat = PasswordFormat.Clear, + PasswordSalt = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }); + + //fifth user + var fifthUserEmail = "brenda_lindgren@nopCommerce.com"; + var fifthUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = fifthUserEmail, + Username = fifthUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + var defaultFifthUserAddress = new Address + { + FirstName = "Brenda", + LastName = "Lindgren", + PhoneNumber = "14785236", + Email = fifthUserEmail, + FaxNumber = "", + Company = "Brenda Company", + Address1 = "1249 Tongass Avenue, Suite B", + Address2 = "", + City = "Ketchikan", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "Alaska"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + ZipPostalCode = "99901", + CreatedOnUtc = DateTime.UtcNow, + }; + fifthUser.Addresses.Add(defaultFifthUserAddress); + fifthUser.BillingAddress = defaultFifthUserAddress; + fifthUser.ShippingAddress = defaultFifthUserAddress; + + fifthUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(fifthUser); + //set default customer name + _genericAttributeService.SaveAttribute(fifthUser, SystemCustomerAttributeNames.FirstName, defaultFifthUserAddress.FirstName); + _genericAttributeService.SaveAttribute(fifthUser, SystemCustomerAttributeNames.LastName, defaultFifthUserAddress.LastName); + + //set customer password + _customerPasswordRepository.Insert(new CustomerPassword + { + Customer = fifthUser, + Password = "123456", + PasswordFormat = PasswordFormat.Clear, + PasswordSalt = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }); + + //sixth user + var sixthUserEmail = "victoria_victoria@nopCommerce.com"; + var sixthUser = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = sixthUserEmail, + Username = sixthUserEmail, + Active = true, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + var defaultSixthUserAddress = new Address + { + FirstName = "Victoria", + LastName = "Terces", + PhoneNumber = "45612378", + Email = sixthUserEmail, + FaxNumber = "", + Company = "Terces Company", + Address1 = "201 1st Avenue South", + Address2 = "", + City = "Saskatoon", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "Saskatchewan"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "CAN"), + ZipPostalCode = "S7K 1J9", + CreatedOnUtc = DateTime.UtcNow, + }; + sixthUser.Addresses.Add(defaultSixthUserAddress); + sixthUser.BillingAddress = defaultSixthUserAddress; + sixthUser.ShippingAddress = defaultSixthUserAddress; + + sixthUser.CustomerRoles.Add(crRegistered); + + _customerRepository.Insert(sixthUser); + //set default customer name + _genericAttributeService.SaveAttribute(sixthUser, SystemCustomerAttributeNames.FirstName, defaultSixthUserAddress.FirstName); + _genericAttributeService.SaveAttribute(sixthUser, SystemCustomerAttributeNames.LastName, defaultSixthUserAddress.LastName); + + //set customer password + _customerPasswordRepository.Insert(new CustomerPassword + { + Customer = sixthUser, + Password = "123456", + PasswordFormat = PasswordFormat.Clear, + PasswordSalt = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }); + + //search engine (crawler) built-in user + var searchEngineUser = new Customer + { + Email = "builtin@search_engine_record.com", + CustomerGuid = Guid.NewGuid(), + AdminComment = "Built-in system guest record used for requests from search engines.", + Active = true, + IsSystemAccount = true, + SystemName = SystemCustomerNames.SearchEngine, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + searchEngineUser.CustomerRoles.Add(crGuests); + _customerRepository.Insert(searchEngineUser); + + + //built-in user for background tasks + var backgroundTaskUser = new Customer + { + Email = "builtin@background-task-record.com", + CustomerGuid = Guid.NewGuid(), + AdminComment = "Built-in system record used for background tasks.", + Active = true, + IsSystemAccount = true, + SystemName = SystemCustomerNames.BackgroundTask, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = storeId + }; + backgroundTaskUser.CustomerRoles.Add(crGuests); + _customerRepository.Insert(backgroundTaskUser); + } + + protected virtual void InstallOrders() + { + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + //first order + var firstCustomer = _customerRepository.Table.First(c => c.Email.Equals("steve_gates@nopCommerce.com")); + var firstOrder = new Order() + { + StoreId = defaultStore.Id, + OrderGuid = Guid.NewGuid(), + Customer = firstCustomer, + CustomerLanguageId = _languageRepository.Table.First().Id, + CustomerIp = "127.0.0.1", + OrderSubtotalInclTax = 1855M, + OrderSubtotalExclTax = 1855M, + OrderSubTotalDiscountInclTax = decimal.Zero, + OrderSubTotalDiscountExclTax = decimal.Zero, + OrderShippingInclTax = decimal.Zero, + OrderShippingExclTax = decimal.Zero, + OrderShippingNonTaxable = decimal.Zero, + PaymentMethodAdditionalFeeInclTax = decimal.Zero, + PaymentMethodAdditionalFeeExclTax = decimal.Zero, + PaymentMethodAdditionalFeeNonTaxable = decimal.Zero, + TaxRates = "0:0;", + OrderTax = decimal.Zero, + OrderTotal = 1855M, + OrderAmount = 1855M, + OrderAmountIncl = 1855M, + OrderDiscountIncl = decimal.Zero, + EarnedRewardPointsBaseAmountIncl = 1855M, + EarnedRewardPointsBaseAmountExcl = 1855M, + RewardPointsTaxable = false, + RefundedAmount = decimal.Zero, + OrderDiscount = decimal.Zero, + CheckoutAttributeDescription = string.Empty, + CheckoutAttributesXml = string.Empty, + CustomerCurrencyCode = "USD", + CurrencyRate = 1M, + AffiliateId = 0, + OrderStatus = OrderStatus.Processing, + AllowStoringCreditCardNumber = false, + CardType = string.Empty, + CardName = string.Empty, + CardNumber = string.Empty, + MaskedCreditCardNumber = string.Empty, + CardCvv2 = string.Empty, + CardExpirationMonth = string.Empty, + CardExpirationYear = string.Empty, + PaymentMethodSystemName = "Payments.CheckMoneyOrder", + AuthorizationTransactionId = string.Empty, + AuthorizationTransactionCode = string.Empty, + AuthorizationTransactionResult = string.Empty, + CaptureTransactionId = string.Empty, + CaptureTransactionResult = string.Empty, + SubscriptionTransactionId = string.Empty, + PaymentStatus = PaymentStatus.Paid, + PaidDateUtc = DateTime.UtcNow, + BillingAddress = (Address)firstCustomer.BillingAddress.Clone(), + ShippingAddress = (Address)firstCustomer.ShippingAddress.Clone(), + ShippingStatus = ShippingStatus.NotYetShipped, + ShippingMethod = "Ground", + PickUpInStore = false, + ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", + CustomValuesXml = string.Empty, + VatNumber = string.Empty, + CreatedOnUtc = DateTime.UtcNow, + CustomOrderNumber = string.Empty + }; + _orderRepository.Insert(firstOrder); + firstOrder.CustomOrderNumber = firstOrder.Id.ToString(); + _orderRepository.Update(firstOrder); + + //item Apple iCam + var firstOrderItem1 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = firstOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Apple iCam")).Id, + UnitPriceInclTax = 1300M, + UnitPriceExclTax = 1300M, + PriceInclTax = 1300M, + PriceExclTax = 1300M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(firstOrderItem1); + + //item Leica T Mirrorless Digital Camera + var fierstOrderItem2 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = firstOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Leica T Mirrorless Digital Camera")).Id, + UnitPriceInclTax = 530M, + UnitPriceExclTax = 530M, + PriceInclTax = 530M, + PriceExclTax = 530M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(fierstOrderItem2); + + //item $25 Virtual Gift Card + var firstOrderItem3 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = firstOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("$25 Virtual Gift Card")).Id, + UnitPriceInclTax = 25M, + UnitPriceExclTax = 25M, + PriceInclTax = 25M, + PriceExclTax = 25M, + OriginalProductCost = decimal.Zero, + AttributeDescription = "From: Steve Gates <steve_gates@nopCommerce.com>
For: Brenda Lindgren <brenda_lindgren@nopCommerce.com>", + AttributesXml = "Brenda Lindgrenbrenda_lindgren@nopCommerce.comSteve Gatessteve_gates@gmail.com", + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(firstOrderItem3); + + var firstOrderGiftcard = new GiftCard + { + GiftCardType = GiftCardType.Virtual, + PurchasedWithOrderItem = firstOrderItem3, + Amount = 25M, + IsGiftCardActivated = false, + GiftCardCouponCode = string.Empty, + RecipientName = "Brenda Lindgren", + RecipientEmail = "brenda_lindgren@nopCommerce.com", + SenderName = "Steve Gates", + SenderEmail = "steve_gates@nopCommerce.com", + Message = string.Empty, + IsRecipientNotified = false, + CreatedOnUtc = DateTime.UtcNow + }; + _giftCardRepository.Insert(firstOrderGiftcard); + + //order notes + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order placed", + Order = firstOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order paid", + Order = firstOrder + }); + + + //second order + var secondCustomer = _customerRepository.Table.First(c => c.Email.Equals("arthur_holmes@nopCommerce.com")); + var secondOrder = new Order() + { + StoreId = defaultStore.Id, + OrderGuid = Guid.NewGuid(), + Customer = secondCustomer, + CustomerLanguageId = _languageRepository.Table.First().Id, + CustomerIp = "127.0.0.1", + OrderSubtotalInclTax = 2460M, + OrderSubtotalExclTax = 2460M, + OrderSubTotalDiscountInclTax = decimal.Zero, + OrderSubTotalDiscountExclTax = decimal.Zero, + OrderShippingInclTax = decimal.Zero, + OrderShippingExclTax = decimal.Zero, + OrderShippingNonTaxable = decimal.Zero, + PaymentMethodAdditionalFeeInclTax = decimal.Zero, + PaymentMethodAdditionalFeeExclTax = decimal.Zero, + PaymentMethodAdditionalFeeNonTaxable = decimal.Zero, + TaxRates = "0:0;", + OrderTax = decimal.Zero, + OrderTotal = 2460M, + OrderAmount = 2460M, + OrderAmountIncl = 2460M, + OrderDiscountIncl = decimal.Zero, + EarnedRewardPointsBaseAmountIncl = 2460M, + EarnedRewardPointsBaseAmountExcl = 2460M, + RewardPointsTaxable = false, + RefundedAmount = decimal.Zero, + OrderDiscount = decimal.Zero, + CheckoutAttributeDescription = string.Empty, + CheckoutAttributesXml = string.Empty, + CustomerCurrencyCode = "USD", + CurrencyRate = 1M, + AffiliateId = 0, + OrderStatus = OrderStatus.Pending, + AllowStoringCreditCardNumber = false, + CardType = string.Empty, + CardName = string.Empty, + CardNumber = string.Empty, + MaskedCreditCardNumber = string.Empty, + CardCvv2 = string.Empty, + CardExpirationMonth = string.Empty, + CardExpirationYear = string.Empty, + PaymentMethodSystemName = "Payments.CheckMoneyOrder", + AuthorizationTransactionId = string.Empty, + AuthorizationTransactionCode = string.Empty, + AuthorizationTransactionResult = string.Empty, + CaptureTransactionId = string.Empty, + CaptureTransactionResult = string.Empty, + SubscriptionTransactionId = string.Empty, + PaymentStatus = PaymentStatus.Pending, + PaidDateUtc = null, + BillingAddress = (Address)secondCustomer.BillingAddress.Clone(), + ShippingAddress = (Address)secondCustomer.ShippingAddress.Clone(), + ShippingStatus = ShippingStatus.NotYetShipped, + ShippingMethod = "Next Day Air", + PickUpInStore = false, + ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", + CustomValuesXml = string.Empty, + VatNumber = string.Empty, + CreatedOnUtc = DateTime.UtcNow, + CustomOrderNumber = string.Empty + }; + _orderRepository.Insert(secondOrder); + secondOrder.CustomOrderNumber = secondOrder.Id.ToString(); + _orderRepository.Update(secondOrder); + + //order notes + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order placed", + Order = secondOrder + }); + + //item Vintage Style Engagement Ring + var secondOrderItem1 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = secondOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Vintage Style Engagement Ring")).Id, + UnitPriceInclTax = 2100M, + UnitPriceExclTax = 2100M, + PriceInclTax = 2100M, + PriceExclTax = 2100M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(secondOrderItem1); + + //item Flower Girl Bracelet + var secondOrderItem2 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = secondOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Flower Girl Bracelet")).Id, + UnitPriceInclTax = 360M, + UnitPriceExclTax = 360M, + PriceInclTax = 360M, + PriceExclTax = 360M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(secondOrderItem2); + + + //third order + var thirdCustomer = _customerRepository.Table.First(c => c.Email.Equals("james_pan@nopCommerce.com")); + var thirdOrder = new Order() + { + StoreId = defaultStore.Id, + OrderGuid = Guid.NewGuid(), + Customer = thirdCustomer, + CustomerLanguageId = _languageRepository.Table.First().Id, + CustomerIp = "127.0.0.1", + OrderSubtotalInclTax = 8.80M, + OrderSubtotalExclTax = 8.80M, + OrderSubTotalDiscountInclTax = decimal.Zero, + OrderSubTotalDiscountExclTax = decimal.Zero, + OrderShippingInclTax = decimal.Zero, + OrderShippingExclTax = decimal.Zero, + OrderShippingNonTaxable = decimal.Zero, + PaymentMethodAdditionalFeeInclTax = decimal.Zero, + PaymentMethodAdditionalFeeExclTax = decimal.Zero, + PaymentMethodAdditionalFeeNonTaxable = decimal.Zero, + TaxRates = "0:0;", + OrderTax = decimal.Zero, + OrderTotal = 8.80M, + OrderAmount = 8.80M, + OrderAmountIncl = 8.80M, + OrderDiscountIncl = decimal.Zero, + EarnedRewardPointsBaseAmountIncl = 8.80M, + EarnedRewardPointsBaseAmountExcl = 8.80M, + RewardPointsTaxable = false, + RefundedAmount = decimal.Zero, + OrderDiscount = decimal.Zero, + CheckoutAttributeDescription = string.Empty, + CheckoutAttributesXml = string.Empty, + CustomerCurrencyCode = "USD", + CurrencyRate = 1M, + AffiliateId = 0, + OrderStatus = OrderStatus.Pending, + AllowStoringCreditCardNumber = false, + CardType = string.Empty, + CardName = string.Empty, + CardNumber = string.Empty, + MaskedCreditCardNumber = string.Empty, + CardCvv2 = string.Empty, + CardExpirationMonth = string.Empty, + CardExpirationYear = string.Empty, + PaymentMethodSystemName = "Payments.CheckMoneyOrder", + AuthorizationTransactionId = string.Empty, + AuthorizationTransactionCode = string.Empty, + AuthorizationTransactionResult = string.Empty, + CaptureTransactionId = string.Empty, + CaptureTransactionResult = string.Empty, + SubscriptionTransactionId = string.Empty, + PaymentStatus = PaymentStatus.Pending, + PaidDateUtc = null, + BillingAddress = (Address)thirdCustomer.BillingAddress.Clone(), + ShippingAddress = null, + ShippingStatus = ShippingStatus.ShippingNotRequired, + ShippingMethod = string.Empty, + PickUpInStore = false, + ShippingRateComputationMethodSystemName = string.Empty, + CustomValuesXml = string.Empty, + VatNumber = string.Empty, + CreatedOnUtc = DateTime.UtcNow, + CustomOrderNumber = string.Empty + }; + _orderRepository.Insert(thirdOrder); + thirdOrder.CustomOrderNumber = thirdOrder.Id.ToString(); + _orderRepository.Update(thirdOrder); + + //order notes + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order placed", + Order = thirdOrder + }); + + //item If You Wait + var thirdOrderItem1 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = thirdOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("If You Wait (donation)")).Id, + UnitPriceInclTax = 3M, + UnitPriceExclTax = 3M, + PriceInclTax = 3M, + PriceExclTax = 3M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(thirdOrderItem1); + + //item Night Visions + var thirdOrderItem2 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = thirdOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Night Visions")).Id, + UnitPriceInclTax = 2.8M, + UnitPriceExclTax = 2.8M, + PriceInclTax = 2.8M, + PriceExclTax = 2.8M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(thirdOrderItem2); + + //item Science & Faith + var thirdOrderItem3 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = thirdOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Science & Faith")).Id, + UnitPriceInclTax = 3M, + UnitPriceExclTax = 3M, + PriceInclTax = 3M, + PriceExclTax = 3M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(thirdOrderItem3); + + + //fourth order + var fourthCustomer = _customerRepository.Table.First(c => c.Email.Equals("brenda_lindgren@nopCommerce.com")); + var fourthOrder = new Order() + { + StoreId = defaultStore.Id, + OrderGuid = Guid.NewGuid(), + Customer = fourthCustomer, + CustomerLanguageId = _languageRepository.Table.First().Id, + CustomerIp = "127.0.0.1", + OrderSubtotalInclTax = 102M, + OrderSubtotalExclTax = 102M, + OrderSubTotalDiscountInclTax = decimal.Zero, + OrderSubTotalDiscountExclTax = decimal.Zero, + OrderShippingInclTax = decimal.Zero, + OrderShippingExclTax = decimal.Zero, + OrderShippingNonTaxable = decimal.Zero, + PaymentMethodAdditionalFeeInclTax = decimal.Zero, + PaymentMethodAdditionalFeeExclTax = decimal.Zero, + PaymentMethodAdditionalFeeNonTaxable = decimal.Zero, + TaxRates = "0:0;", + OrderTax = decimal.Zero, + OrderTotal = 102M, + OrderAmount = 102M, + OrderAmountIncl = 102M, + OrderDiscountIncl = decimal.Zero, + EarnedRewardPointsBaseAmountIncl = 102M, + EarnedRewardPointsBaseAmountExcl = 102M, + RewardPointsTaxable = false, + RefundedAmount = decimal.Zero, + OrderDiscount = decimal.Zero, + CheckoutAttributeDescription = string.Empty, + CheckoutAttributesXml = string.Empty, + CustomerCurrencyCode = "USD", + CurrencyRate = 1M, + AffiliateId = 0, + OrderStatus = OrderStatus.Processing, + AllowStoringCreditCardNumber = false, + CardType = string.Empty, + CardName = string.Empty, + CardNumber = string.Empty, + MaskedCreditCardNumber = string.Empty, + CardCvv2 = string.Empty, + CardExpirationMonth = string.Empty, + CardExpirationYear = string.Empty, + PaymentMethodSystemName = "Payments.CheckMoneyOrder", + AuthorizationTransactionId = string.Empty, + AuthorizationTransactionCode = string.Empty, + AuthorizationTransactionResult = string.Empty, + CaptureTransactionId = string.Empty, + CaptureTransactionResult = string.Empty, + SubscriptionTransactionId = string.Empty, + PaymentStatus = PaymentStatus.Paid, + PaidDateUtc = DateTime.UtcNow, + BillingAddress = (Address)fourthCustomer.BillingAddress.Clone(), + ShippingAddress = (Address)fourthCustomer.ShippingAddress.Clone(), + ShippingStatus = ShippingStatus.Shipped, + ShippingMethod = "Pickup in store", + PickUpInStore = true, + PickupAddress = (Address)fourthCustomer.ShippingAddress.Clone(), + ShippingRateComputationMethodSystemName = "Pickup.PickupInStore", + CustomValuesXml = string.Empty, + VatNumber = string.Empty, + CreatedOnUtc = DateTime.UtcNow, + CustomOrderNumber = string.Empty + }; + _orderRepository.Insert(fourthOrder); + fourthOrder.CustomOrderNumber = fourthOrder.Id.ToString(); + _orderRepository.Update(fourthOrder); + + //order notes + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order placed", + Order = fourthOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order paid", + Order = fourthOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order shipped", + Order = fourthOrder + }); + + //item Pride and Prejudice + var fourthOrderItem1 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = fourthOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Pride and Prejudice")).Id, + UnitPriceInclTax = 24M, + UnitPriceExclTax = 24M, + PriceInclTax = 24M, + PriceExclTax = 24M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(fourthOrderItem1); + + //item First Prize Pies + var fourthOrderItem2 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = fourthOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("First Prize Pies")).Id, + UnitPriceInclTax = 51M, + UnitPriceExclTax = 51M, + PriceInclTax = 51M, + PriceExclTax = 51M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(fourthOrderItem2); + + //item Fahrenheit 451 by Ray Bradbury + var fourthOrderItem3 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = fourthOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Fahrenheit 451 by Ray Bradbury")).Id, + UnitPriceInclTax = 27M, + UnitPriceExclTax = 27M, + PriceInclTax = 27M, + PriceExclTax = 27M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(fourthOrderItem3); + + //shipments + //shipment 1 + var fourthOrderShipment1 = new Shipment + { + Order = fourthOrder, + TrackingNumber = string.Empty, + TotalWeight = 4M, + ShippedDateUtc = DateTime.UtcNow, + DeliveryDateUtc = DateTime.UtcNow, + AdminComment = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }; + _shipmentRepository.Insert(fourthOrderShipment1); + + var fourthOrderShipment1Item1 = new ShipmentItem() + { + OrderItemId = fourthOrderItem1.Id, + Quantity = 1, + WarehouseId = 0, + Shipment = fourthOrderShipment1 + }; + _shipmentItemRepository.Insert(fourthOrderShipment1Item1); + + var fourthOrderShipment1Item2 = new ShipmentItem() + { + OrderItemId = fourthOrderItem2.Id, + Quantity = 1, + WarehouseId = 0, + Shipment = fourthOrderShipment1 + }; + _shipmentItemRepository.Insert(fourthOrderShipment1Item2); + + //shipment 2 + var fourthOrderShipment2 = new Shipment + { + Order = fourthOrder, + TrackingNumber = string.Empty, + TotalWeight = 2M, + ShippedDateUtc = DateTime.UtcNow, + DeliveryDateUtc = DateTime.UtcNow, + AdminComment = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }; + _shipmentRepository.Insert(fourthOrderShipment2); + + var fourthOrderShipment2Item1 = new ShipmentItem() + { + OrderItemId = fourthOrderItem3.Id, + Quantity = 1, + WarehouseId = 0, + Shipment = fourthOrderShipment2 + }; + _shipmentItemRepository.Insert(fourthOrderShipment2Item1); + + + + + //fifth order + var fifthCustomer = _customerRepository.Table.First(c => c.Email.Equals("victoria_victoria@nopCommerce.com")); + var fifthOrder = new Order() + { + StoreId = defaultStore.Id, + OrderGuid = Guid.NewGuid(), + Customer = fifthCustomer, + CustomerLanguageId = _languageRepository.Table.First().Id, + CustomerIp = "127.0.0.1", + OrderSubtotalInclTax = 43.50M, + OrderSubtotalExclTax = 43.50M, + OrderSubTotalDiscountInclTax = decimal.Zero, + OrderSubTotalDiscountExclTax = decimal.Zero, + OrderShippingInclTax = decimal.Zero, + OrderShippingExclTax = decimal.Zero, + OrderShippingNonTaxable = decimal.Zero, + PaymentMethodAdditionalFeeInclTax = decimal.Zero, + PaymentMethodAdditionalFeeExclTax = decimal.Zero, + PaymentMethodAdditionalFeeNonTaxable = decimal.Zero, + TaxRates = "0:0;", + OrderTax = decimal.Zero, + OrderTotal = 43.50M, + OrderAmount = 43.50M, + OrderAmountIncl = 43.50M, + OrderDiscountIncl = decimal.Zero, + EarnedRewardPointsBaseAmountIncl = 43.50M, + EarnedRewardPointsBaseAmountExcl = 43.50M, + RewardPointsTaxable = false, + RefundedAmount = decimal.Zero, + OrderDiscount = decimal.Zero, + CheckoutAttributeDescription = string.Empty, + CheckoutAttributesXml = string.Empty, + CustomerCurrencyCode = "USD", + CurrencyRate = 1M, + AffiliateId = 0, + OrderStatus = OrderStatus.Complete, + AllowStoringCreditCardNumber = false, + CardType = string.Empty, + CardName = string.Empty, + CardNumber = string.Empty, + MaskedCreditCardNumber = string.Empty, + CardCvv2 = string.Empty, + CardExpirationMonth = string.Empty, + CardExpirationYear = string.Empty, + PaymentMethodSystemName = "Payments.CheckMoneyOrder", + AuthorizationTransactionId = string.Empty, + AuthorizationTransactionCode = string.Empty, + AuthorizationTransactionResult = string.Empty, + CaptureTransactionId = string.Empty, + CaptureTransactionResult = string.Empty, + SubscriptionTransactionId = string.Empty, + PaymentStatus = PaymentStatus.Paid, + PaidDateUtc = DateTime.UtcNow, + BillingAddress = (Address)fifthCustomer.BillingAddress.Clone(), + ShippingAddress = (Address)fifthCustomer.ShippingAddress.Clone(), + ShippingStatus = ShippingStatus.Delivered, + ShippingMethod = "Ground", + PickUpInStore = false, + ShippingRateComputationMethodSystemName = "Shipping.FixedOrByWeight", + CustomValuesXml = string.Empty, + VatNumber = string.Empty, + CreatedOnUtc = DateTime.UtcNow, + CustomOrderNumber = string.Empty + }; + _orderRepository.Insert(fifthOrder); + fifthOrder.CustomOrderNumber = fifthOrder.Id.ToString(); + _orderRepository.Update(fifthOrder); + + //order notes + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order placed", + Order = fifthOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order paid", + Order = fifthOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order shipped", + Order = fifthOrder + }); + _orderNoteRepository.Insert(new OrderNote() + { + CreatedOnUtc = DateTime.UtcNow, + Note = "Order delivered", + Order = fifthOrder + }); + + //item Levi's 511 Jeans + var fifthOrderItem1 = new OrderItem() + { + OrderItemGuid = Guid.NewGuid(), + Order = fifthOrder, + ProductId = _productRepository.Table.First(p => p.Name.Equals("Levi's 511 Jeans")).Id, + UnitPriceInclTax = 43.50M, + UnitPriceExclTax = 43.50M, + PriceInclTax = 43.50M, + PriceExclTax = 43.50M, + OriginalProductCost = decimal.Zero, + AttributeDescription = string.Empty, + AttributesXml = string.Empty, + Quantity = 1, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = null, + RentalStartDateUtc = null, + RentalEndDateUtc = null, + TaxRate = 0 + }; + _orderItemRepository.Insert(fifthOrderItem1); + + //shipment 1 + var fifthOrderShipment1 = new Shipment + { + Order = fifthOrder, + TrackingNumber = string.Empty, + TotalWeight = 2M, + ShippedDateUtc = DateTime.UtcNow, + DeliveryDateUtc = DateTime.UtcNow, + AdminComment = string.Empty, + CreatedOnUtc = DateTime.UtcNow + }; + _shipmentRepository.Insert(fifthOrderShipment1); + + var fifthOrderShipment1Item1 = new ShipmentItem() + { + OrderItemId = fifthOrderItem1.Id, + Quantity = 1, + WarehouseId = 0, + Shipment = fifthOrderShipment1 + }; + _shipmentItemRepository.Insert(fifthOrderShipment1Item1); + } + + protected virtual void InstallActivityLog(string defaultUserEmail) + { + //default customer/user + var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); + if (defaultCustomer == null) + throw new Exception("Cannot load default customer"); + + _activityLogRepository.Insert(new ActivityLog() + { + ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditCategory")), + Comment = "Edited a category ('Computers')", + CreatedOnUtc = DateTime.UtcNow, + Customer = defaultCustomer, + IpAddress = "127.0.0.1" + }); + _activityLogRepository.Insert(new ActivityLog() + { + ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditDiscount")), + Comment = "Edited a discount ('Sample discount with coupon code')", + CreatedOnUtc = DateTime.UtcNow, + Customer = defaultCustomer, + IpAddress = "127.0.0.1" + }); + _activityLogRepository.Insert(new ActivityLog() + { + ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("EditSpecAttribute")), + Comment = "Edited a specification attribute ('CPU Type')", + CreatedOnUtc = DateTime.UtcNow, + Customer = defaultCustomer, + IpAddress = "127.0.0.1" + }); + _activityLogRepository.Insert(new ActivityLog() + { + ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("AddNewProductAttribute")), + Comment = "Added a new product attribute ('Some attribute')", + CreatedOnUtc = DateTime.UtcNow, + Customer = defaultCustomer, + IpAddress = "127.0.0.1" + }); + _activityLogRepository.Insert(new ActivityLog() + { + ActivityLogType = _activityLogTypeRepository.Table.First(alt => alt.SystemKeyword.Equals("DeleteGiftCard")), + Comment = "Deleted a gift card ('bdbbc0ef-be57')", + CreatedOnUtc = DateTime.UtcNow, + Customer = defaultCustomer, + IpAddress = "127.0.0.1" + }); + } + + protected virtual void InstallSearchTerms() + { + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + _searchTermRepository.Insert(new SearchTerm() + { + Count = 34, + Keyword = "computer", + StoreId = defaultStore.Id + }); + _searchTermRepository.Insert(new SearchTerm() + { + Count = 30, + Keyword = "camera", + StoreId = defaultStore.Id + }); + _searchTermRepository.Insert(new SearchTerm() + { + Count = 27, + Keyword = "jewelry", + StoreId = defaultStore.Id + }); + _searchTermRepository.Insert(new SearchTerm() + { + Count = 26, + Keyword = "shoes", + StoreId = defaultStore.Id + }); + _searchTermRepository.Insert(new SearchTerm() + { + Count = 19, + Keyword = "jeans", + StoreId = defaultStore.Id + }); + _searchTermRepository.Insert(new SearchTerm() + { + Count = 10, + Keyword = "gift", + StoreId = defaultStore.Id + }); + } + + protected virtual void InstallEmailAccounts() + { + var emailAccounts = new List + { + new EmailAccount + { + Email = "test@mail.com", + DisplayName = "Store name", + Host = "smtp.mail.com", + Port = 25, + Username = "123", + Password = "123", + EnableSsl = false, + UseDefaultCredentials = false + }, + }; + _emailAccountRepository.Insert(emailAccounts); + } + + protected virtual void InstallMessageTemplates() + { + var eaGeneral = _emailAccountRepository.Table.FirstOrDefault(); + if (eaGeneral == null) + throw new Exception("Default email account cannot be loaded"); + + var messageTemplates = new List + { + new MessageTemplate + { + Name = MessageTemplateSystemNames.BlogCommentNotification, + Subject = "%Store.Name%. New blog comment.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new blog comment has been created for blog post \"%BlogComment.BlogPostTitle%\".{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.BackInStockNotification, + Subject = "%Store.Name%. Back in stock notification", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}Product %BackInStockSubscription.ProductName% is in stock.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.CustomerEmailValidationMessage, + Subject = "%Store.Name%. Email validation", + Body = string.Format("%Store.Name%{0}
{0}
{0}To activate your account click here.{0}
{0}
{0}%Store.Name%{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.CustomerEmailRevalidationMessage, + Subject = "%Store.Name%. Email validation", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%!{0}
{0}To validate your new email address click here.{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.PrivateMessageNotification, + Subject = "%Store.Name%. You have received a new private message", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}You have received a new private message.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.CustomerPasswordRecoveryMessage, + Subject = "%Store.Name%. Password recovery", + Body = string.Format("%Store.Name%{0}
{0}
{0}To change your password click here.{0}
{0}
{0}%Store.Name%{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.CustomerWelcomeMessage, + Subject = "Welcome to %Store.Name%", + Body = string.Format("We welcome you to %Store.Name%.{0}
{0}
{0}You can now take part in the various services we have to offer you. Some of these services include:{0}
{0}
{0}Permanent Cart - Any products added to your online cart remain there until you remove them, or check them out.{0}
{0}Address Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.{0}
{0}Order History - View your history of purchases that you have made with us.{0}
{0}Products Reviews - Share your opinions on products with our other customers.{0}
{0}
{0}For help with any of our online services, please email the store-owner: %Store.Email%.{0}
{0}
{0}Note: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to %Store.Email%.{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewForumPostMessage, + Subject = "%Store.Name%. New Post Notification.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new post has been created in the topic \"%Forums.TopicName%\" at \"%Forums.ForumName%\" forum.{0}
{0}
{0}Click here for more info.{0}
{0}
{0}Post author: %Forums.PostAuthor%{0}
{0}Post body: %Forums.PostBody%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewForumTopicMessage, + Subject = "%Store.Name%. New Topic Notification.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new topic \"%Forums.TopicName%\" has been created at \"%Forums.ForumName%\" forum.{0}
{0}
{0}Click here for more info.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.GiftCardNotification, + Subject = "%GiftCard.SenderName% has sent you a gift card for %Store.Name%", + Body = string.Format("

{0}You have received a gift card for %Store.Name%{0}

{0}

{0}Dear %GiftCard.RecipientName%,{0}
{0}
{0}%GiftCard.SenderName% (%GiftCard.SenderEmail%) has sent you a %GiftCard.Amount% gift cart for %Store.Name%{0}

{0}

{0}You gift card code is %GiftCard.CouponCode%{0}

{0}

{0}%GiftCard.Message%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.CustomerRegisteredNotification, + Subject = "%Store.Name%. New customer registration", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new customer registered with your store. Below are the customer's details:{0}
{0}Full name: %Customer.FullName%{0}
{0}Email: %Customer.Email%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewReturnRequestStoreOwnerNotification, + Subject = "%Store.Name%. New return request.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% has just submitted a new return request. Details are below:{0}
{0}Request ID: %ReturnRequest.CustomNumber%{0}
{0}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{0}
{0}Reason for return: %ReturnRequest.Reason%{0}
{0}Requested action: %ReturnRequest.RequestedAction%{0}
{0}Customer comments:{0}
{0}%ReturnRequest.CustomerComment%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewReturnRequestCustomerNotification, + Subject = "%Store.Name%. New return request.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%!{0}
{0}You have just submitted a new return request. Details are below:{0}
{0}Request ID: %ReturnRequest.CustomNumber%{0}
{0}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{0}
{0}Reason for return: %ReturnRequest.Reason%{0}
{0}Requested action: %ReturnRequest.RequestedAction%{0}
{0}Customer comments:{0}
{0}%ReturnRequest.CustomerComment%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewsCommentNotification, + Subject = "%Store.Name%. New news comment.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new news comment has been created for news \"%NewsComment.NewsTitle%\".{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewsletterSubscriptionActivationMessage, + Subject = "%Store.Name%. Subscription activation message.", + Body = string.Format("

{0}Click here to confirm your subscription to our list.{0}

{0}

{0}If you received this email by mistake, simply delete it.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewsletterSubscriptionDeactivationMessage, + Subject = "%Store.Name%. Subscription deactivation message.", + Body = string.Format("

{0}Click here to unsubscribe from our newsletter.{0}

{0}

{0}If you received this email by mistake, simply delete it.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewVatSubmittedStoreOwnerNotification, + Subject = "%Store.Name%. New VAT number is submitted.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just submitted a new VAT number. Details are below:{0}
{0}VAT number: %Customer.VatNumber%{0}
{0}VAT number status: %Customer.VatNumberStatus%{0}
{0}Received name: %VatValidationResult.Name%{0}
{0}Received address: %VatValidationResult.Address%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderCancelledCustomerNotification, + Subject = "%Store.Name%. Your order cancelled", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Your order has been cancelled. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderCompletedCustomerNotification, + Subject = "%Store.Name%. Your order completed", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Your order has been completed. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ShipmentDeliveredCustomerNotification, + Subject = "Your order from %Store.Name% has been delivered.", + Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Good news! You order has been delivered.{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% Delivered Products:{0}
{0}
{0}%Shipment.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPlacedCustomerNotification, + Subject = "Order receipt from %Store.Name%.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPlacedStoreOwnerNotification, + Subject = "%Store.Name%. Purchase Receipt for Order #%Order.OrderNumber%", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Order.CustomerFullName% (%Order.CustomerEmail%) has just placed an order from your store. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ShipmentSentCustomerNotification, + Subject = "Your order from %Store.Name% has been shipped.", + Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%!,{0}
{0}Good news! You order has been shipped.{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% Shipped Products:{0}
{0}
{0}%Shipment.Product(s)%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ProductReviewNotification, + Subject = "%Store.Name%. New product review.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}A new product review has been written for product \"%ProductReview.ProductName%\".{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.QuantityBelowStoreOwnerNotification, + Subject = "%Store.Name%. Quantity below notification. %Product.Name%", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Product.Name% (ID: %Product.ID%) low quantity.{0}
{0}
{0}Quantity: %Product.StockQuantity%{0}
{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.QuantityBelowAttributeCombinationStoreOwnerNotification, + Subject = "%Store.Name%. Quantity below notification. %Product.Name%", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Product.Name% (ID: %Product.ID%) low quantity.{0}
{0}%AttributeCombination.Formatted%{0}
{0}Quantity: %AttributeCombination.StockQuantity%{0}
{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ReturnRequestStatusChangedCustomerNotification, + Subject = "%Store.Name%. Return request status was changed.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}Your return request #%ReturnRequest.CustomNumber% status has been changed.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.EmailAFriendMessage, + Subject = "%Store.Name%. Referred Item", + Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}%EmailAFriend.Email% was shopping on %Store.Name% and wanted to share the following item with you.{0}
{0}
{0}%Product.Name%{0}
{0}%Product.ShortDescription%{0}
{0}
{0}For more info click here{0}
{0}
{0}
{0}%EmailAFriend.PersonalMessage%{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.WishlistToFriendMessage, + Subject = "%Store.Name%. Wishlist", + Body = string.Format("

{0} %Store.Name%{0}
{0}
{0}%Wishlist.Email% was shopping on %Store.Name% and wanted to share a wishlist with you.{0}
{0}
{0}
{0}For more info click here{0}
{0}
{0}
{0}%Wishlist.PersonalMessage%{0}
{0}
{0}%Store.Name%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewOrderNoteAddedCustomerNotification, + Subject = "%Store.Name%. New order note has been added", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}New order note has been added to your account:{0}
{0}\"%Order.NewNoteText%\".{0}
{0}%Order.OrderURLForCustomer%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.RecurringPaymentCancelledStoreOwnerNotification, + Subject = "%Store.Name%. Recurring payment cancelled", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%if (%RecurringPayment.CancelAfterFailedPayment%) The last payment for the recurring payment ID=%RecurringPayment.ID% failed, so it was cancelled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) %Customer.FullName% (%Customer.Email%) has just cancelled a recurring payment ID=%RecurringPayment.ID%. endif%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.RecurringPaymentCancelledCustomerNotification, + Subject = "%Store.Name%. Recurring payment cancelled", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}%if (%RecurringPayment.CancelAfterFailedPayment%) It appears your credit card didn't go through for this recurring payment (%Order.OrderURLForCustomer%){0}
{0}So your subscription has been canceled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) The recurring payment ID=%RecurringPayment.ID% was cancelled. endif%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.RecurringPaymentFailedCustomerNotification, + Subject = "%Store.Name%. Last recurring payment failed", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Customer.FullName%,{0}
{0}It appears your credit card didn't go through for this recurring payment (%Order.OrderURLForCustomer%){0}
%if (%RecurringPayment.RecurringPaymentType% == \"Manual\") {0}You can recharge balance and manually retry payment or cancel it on the order history page. endif% %if (%RecurringPayment.RecurringPaymentType% == \"Automatic\") {0}You can recharge balance and wait, we will try to make the payment again, or you can cancel it on the order history page. endif%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPlacedVendorNotification, + Subject = "%Store.Name%. Order placed", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just placed an order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}%Order.Product(s)%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderRefundedCustomerNotification, + Subject = "%Store.Name%. Order #%Order.OrderNumber% refunded", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Order #%Order.OrderNumber% has been has been refunded. Please allow 7-14 days for the refund to be reflected in your account.{0}
{0}
{0}Amount refunded: %Order.AmountRefunded%{0}
{0}
{0}Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderRefundedStoreOwnerNotification, + Subject = "%Store.Name%. Order #%Order.OrderNumber% refunded", + Body = string.Format("%Store.Name%. Order #%Order.OrderNumber% refunded', N'{0}

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just refunded{0}
{0}
{0}Amount refunded: %Order.AmountRefunded%{0}
{0}
{0}Date Ordered: %Order.CreatedOn%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPaidStoreOwnerNotification, + Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just paid{0}
{0}Date Ordered: %Order.CreatedOn%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPaidCustomerNotification, + Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Hello %Order.CustomerFullName%,{0}
{0}Thanks for buying from %Store.Name%. Order #%Order.OrderNumber% has been just paid. Below is the summary of the order.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Order Details: %Order.OrderURLForCustomer%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}
{0}
{0}Billing Address{0}
{0}%Order.BillingFirstName% %Order.BillingLastName%{0}
{0}%Order.BillingAddress1%{0}
{0}%Order.BillingCity% %Order.BillingZipPostalCode%{0}
{0}%Order.BillingStateProvince% %Order.BillingCountry%{0}
{0}
{0}
{0}
{0}%if (%Order.Shippable%) Shipping Address{0}
{0}%Order.ShippingFirstName% %Order.ShippingLastName%{0}
{0}%Order.ShippingAddress1%{0}
{0}%Order.ShippingCity% %Order.ShippingZipPostalCode%{0}
{0}%Order.ShippingStateProvince% %Order.ShippingCountry%{0}
{0}
{0}Shipping Method: %Order.ShippingMethod%{0}
{0}
{0} endif% %Order.Product(s)%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.OrderPaidVendorNotification, + Subject = "%Store.Name%. Order #%Order.OrderNumber% paid", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Order #%Order.OrderNumber% has been just paid.{0}
{0}
{0}Order Number: %Order.OrderNumber%{0}
{0}Date Ordered: %Order.CreatedOn%{0}
{0}
{0}%Order.Product(s)%{0}

{0}", Environment.NewLine), + //this template is disabled by default + IsActive = false, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.NewVendorAccountApplyStoreOwnerNotification, + Subject = "%Store.Name%. New vendor account submitted.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}%Customer.FullName% (%Customer.Email%) has just submitted for a vendor account. Details are below:{0}
{0}Vendor name: %Vendor.Name%{0}
{0}Vendor email: %Vendor.Email%{0}
{0}
{0}You can activate it in admin area.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.VendorInformationChangeNotification, + Subject = "%Store.Name%. Vendor information change.", + Body = string.Format("

{0}%Store.Name%{0}
{0}
{0}Vendor %Vendor.Name% (%Vendor.Email%) has just changed information about itself.{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ContactUsMessage, + Subject = "%Store.Name%. Contact us", + Body = string.Format("

{0}%ContactUs.Body%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + }, + new MessageTemplate + { + Name = MessageTemplateSystemNames.ContactVendorMessage, + Subject = "%Store.Name%. Contact us", + Body = string.Format("

{0}%ContactUs.Body%{0}

{0}", Environment.NewLine), + IsActive = true, + EmailAccountId = eaGeneral.Id, + } + }; + _messageTemplateRepository.Insert(messageTemplates); + } + + protected virtual void InstallTopics() + { + var defaultTopicTemplate = + _topicTemplateRepository.Table.FirstOrDefault(tt => tt.Name == "Default template"); + if (defaultTopicTemplate == null) + throw new Exception("Topic template cannot be loaded"); + + var topics = new List + { + new Topic + { + SystemName = "AboutUs", + IncludeInSitemap = false, + IsPasswordProtected = false, + IncludeInFooterColumn1 = true, + DisplayOrder = 20, + Published = true, + Title = "About us", + Body = "

Put your "About Us" information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "CheckoutAsGuestOrRegister", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "", + Body = "

Register and save time!
Register with us for future convenience:

  • Fast and easy check out
  • Easy access to your order history and status
", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "ConditionsOfUse", + IncludeInSitemap = false, + IsPasswordProtected = false, + IncludeInFooterColumn1 = true, + DisplayOrder = 15, + Published = true, + Title = "Conditions of Use", + Body = "

Put your conditions of use information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "ContactUs", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "", + Body = "

Put your contact information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "ForumWelcomeMessage", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "Forums", + Body = "

Put your welcome message here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "HomePageText", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "Welcome to our store", + Body = "

Online shopping is the process consumers go through to purchase products or services over the Internet. You can edit this in the admin site.

If you have questions, see the Documentation, or post in the Forums at nopCommerce.com

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "LoginRegistrationInfo", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "About login / registration", + Body = "

Put your login / registration information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "PrivacyInfo", + IncludeInSitemap = false, + IsPasswordProtected = false, + IncludeInFooterColumn1 = true, + DisplayOrder = 10, + Published = true, + Title = "Privacy notice", + Body = "

Put your privacy policy information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "PageNotFound", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "", + Body = "

The page you requested was not found, and we have a fine guess why.

  • If you typed the URL directly, please make sure the spelling is correct.
  • The page no longer exists. In this case, we profusely apologize for the inconvenience and for any damage this may cause.
", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "ShippingInfo", + IncludeInSitemap = false, + IsPasswordProtected = false, + IncludeInFooterColumn1 = true, + DisplayOrder = 5, + Published = true, + Title = "Shipping & returns", + Body = "

Put your shipping & returns information here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + new Topic + { + SystemName = "ApplyVendor", + IncludeInSitemap = false, + IsPasswordProtected = false, + DisplayOrder = 1, + Published = true, + Title = "", + Body = "

Put your apply vendor instructions here. You can edit this in the admin site.

", + TopicTemplateId = defaultTopicTemplate.Id + }, + }; + _topicRepository.Insert(topics); + + + //search engine names + foreach (var topic in topics) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = topic.Id, + EntityName = "Topic", + LanguageId = 0, + IsActive = true, + Slug = topic.ValidateSeName("", !String.IsNullOrEmpty(topic.Title) ? topic.Title : topic.SystemName, true) + }); + } + + } + + protected virtual void InstallSettings(bool installSampleData) + { + var settingService = EngineContext.Current.Resolve(); + settingService.SaveSetting(new PdfSettings + { + LogoPictureId = 0, + LetterPageSizeEnabled = false, + RenderOrderNotes = true, + FontFileName = "FreeSerif.ttf", + InvoiceFooterTextColumn1 = null, + InvoiceFooterTextColumn2 = null, + }); + + settingService.SaveSetting(new CommonSettings + { + UseSystemEmailForContactUsForm = true, + UseStoredProceduresIfSupported = true, + UseStoredProcedureForLoadingCategories = false, + SitemapEnabled = true, + SitemapIncludeCategories = true, + SitemapIncludeManufacturers = true, + SitemapIncludeProducts = false, + DisplayJavaScriptDisabledWarning = false, + UseFullTextSearch = false, + FullTextMode = FulltextSearchMode.ExactMatch, + Log404Errors = true, + BreadcrumbDelimiter = "/", + RenderXuaCompatible = false, + XuaCompatibleValue = "IE=edge", + BbcodeEditorOpenLinksInNewWindow = false + }); + + settingService.SaveSetting(new SeoSettings + { + PageTitleSeparator = ". ", + PageTitleSeoAdjustment = PageTitleSeoAdjustment.PagenameAfterStorename, + DefaultTitle = "Your store", + DefaultMetaKeywords = "", + DefaultMetaDescription = "", + GenerateProductMetaDescription = true, + ConvertNonWesternChars = false, + AllowUnicodeCharsInUrls = true, + CanonicalUrlsEnabled = false, + WwwRequirement = WwwRequirement.NoMatter, + //we disable bundling out of the box because it requires a lot of server resources + EnableJsBundling = false, + EnableCssBundling = false, + TwitterMetaTags = true, + OpenGraphMetaTags = true, + ReservedUrlRecordSlugs = new List + { + "admin", + "install", + "recentlyviewedproducts", + "newproducts", + "compareproducts", + "clearcomparelist", + "setproductreviewhelpfulness", + "login", + "register", + "logout", + "cart", + "wishlist", + "emailwishlist", + "checkout", + "onepagecheckout", + "contactus", + "passwordrecovery", + "subscribenewsletter", + "blog", + "boards", + "inboxupdate", + "sentupdate", + "news", + "sitemap", + "search", + "config", + "eucookielawaccept", + "page-not-found", + //system names are not allowed (anyway they will cause a runtime error), + "con", + "lpt1", + "lpt2", + "lpt3", + "lpt4", + "lpt5", + "lpt6", + "lpt7", + "lpt8", + "lpt9", + "com1", + "com2", + "com3", + "com4", + "com5", + "com6", + "com7", + "com8", + "com9", + "null", + "prn", + "aux" + }, + CustomHeadTags = "" + }); + + settingService.SaveSetting(new AdminAreaSettings + { + DefaultGridPageSize = 15, + PopupGridPageSize = 10, + GridPageSizes = "10, 15, 20, 50, 100", + RichEditorAdditionalSettings = null, + RichEditorAllowJavaScript = false, + UseRichEditorInMessageTemplates = false, + UseIsoDateTimeConverterInJson = true + }); + + + settingService.SaveSetting(new ProductEditorSettings + { + Weight = true, + Dimensions = true, + ProductAttributes = true, + SpecificationAttributes =true + }); + + settingService.SaveSetting(new CatalogSettings + { + AllowViewUnpublishedProductPage = true, + DisplayDiscontinuedMessageForUnpublishedProducts = true, + PublishBackProductWhenCancellingOrders = false, + ShowSkuOnProductDetailsPage = true, + ShowSkuOnCatalogPages = false, + ShowManufacturerPartNumber = false, + ShowGtin = false, + ShowFreeShippingNotification = true, + AllowProductSorting = true, + AllowProductViewModeChanging = true, + DefaultViewMode = "grid", + ShowProductsFromSubcategories = false, + ShowCategoryProductNumber = false, + ShowCategoryProductNumberIncludingSubcategories = false, + CategoryBreadcrumbEnabled = true, + ShowShareButton = true, + PageShareCode = "
", + ProductReviewsMustBeApproved = false, + DefaultProductRatingValue = 5, + AllowAnonymousUsersToReviewProduct = false, + ProductReviewPossibleOnlyAfterPurchasing = false, + NotifyStoreOwnerAboutNewProductReviews = false, + EmailAFriendEnabled = true, + AllowAnonymousUsersToEmailAFriend = false, + RecentlyViewedProductsNumber = 3, + RecentlyViewedProductsEnabled = true, + NewProductsNumber = 6, + NewProductsEnabled = true, + CompareProductsEnabled = true, + CompareProductsNumber = 4, + ProductSearchAutoCompleteEnabled = true, + ProductSearchAutoCompleteNumberOfProducts = 10, + ProductSearchTermMinimumLength = 3, + ShowProductImagesInSearchAutoComplete = false, + ShowBestsellersOnHomepage = false, + NumberOfBestsellersOnHomepage = 4, + SearchPageProductsPerPage = 6, + SearchPageAllowCustomersToSelectPageSize = true, + SearchPagePageSizeOptions = "6, 3, 9, 18", + ProductsAlsoPurchasedEnabled = true, + ProductsAlsoPurchasedNumber = 4, + AjaxProcessAttributeChange = true, + NumberOfProductTags = 15, + ProductsByTagPageSize = 6, + IncludeShortDescriptionInCompareProducts = false, + IncludeFullDescriptionInCompareProducts = false, + IncludeFeaturedProductsInNormalLists = false, + DisplayTierPricesWithDiscounts = true, + IgnoreDiscounts = false, + IgnoreFeaturedProducts = false, + IgnoreAcl = true, + IgnoreStoreLimitations = true, + CacheProductPrices = false, + ProductsByTagAllowCustomersToSelectPageSize = true, + ProductsByTagPageSizeOptions = "6, 3, 9, 18", + MaximumBackInStockSubscriptions = 200, + ManufacturersBlockItemsToDisplay = 2, + DisplayTaxShippingInfoFooter = false, + DisplayTaxShippingInfoProductDetailsPage = false, + DisplayTaxShippingInfoProductBoxes = false, + DisplayTaxShippingInfoShoppingCart = false, + DisplayTaxShippingInfoWishlist = false, + DisplayTaxShippingInfoOrderDetailsPage = false, + DefaultCategoryPageSizeOptions = "6, 3, 9", + DefaultCategoryPageSize = 6, + DefaultManufacturerPageSizeOptions = "6, 3, 9", + DefaultManufacturerPageSize = 6, + ShowProductReviewsTabOnAccountPage = true, + ProductReviewsPageSizeOnAccountPage = 10, + ExportImportProductAttributes = true, + ExportImportUseDropdownlistsForAssociatedEntities = true + }); + + settingService.SaveSetting(new LocalizationSettings + { + DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id, + UseImagesForLanguageSelection = false, + SeoFriendlyUrlsForLanguagesEnabled = false, + AutomaticallyDetectLanguage = false, + LoadAllLocaleRecordsOnStartup = true, + LoadAllLocalizedPropertiesOnStartup = true, + LoadAllUrlRecordsOnStartup = false, + IgnoreRtlPropertyForAdminArea = false + }); + + settingService.SaveSetting(new CustomerSettings + { + UsernamesEnabled = false, + CheckUsernameAvailabilityEnabled = false, + AllowUsersToChangeUsernames = false, + DefaultPasswordFormat = PasswordFormat.Hashed, + HashedPasswordFormat = "SHA1", + PasswordMinLength = 6, + UnduplicatedPasswordsNumber = 4, + PasswordRecoveryLinkDaysValid = 7, + PasswordLifetime = 90, + FailedPasswordAllowedAttempts = 0, + FailedPasswordLockoutMinutes = 30, + UserRegistrationType = UserRegistrationType.Standard, + AllowCustomersToUploadAvatars = false, + AvatarMaximumSizeBytes = 20000, + DefaultAvatarEnabled = true, + ShowCustomersLocation = false, + ShowCustomersJoinDate = false, + AllowViewingProfiles = false, + NotifyNewCustomerRegistration = false, + HideDownloadableProductsTab = false, + HideBackInStockSubscriptionsTab = false, + DownloadableProductsValidateUser = false, + CustomerNameFormat = CustomerNameFormat.ShowFirstName, + GenderEnabled = true, + DateOfBirthEnabled = true, + DateOfBirthRequired = false, + DateOfBirthMinimumAge = null, + CompanyEnabled = true, + StreetAddressEnabled = false, + StreetAddress2Enabled = false, + ZipPostalCodeEnabled = false, + CityEnabled = false, + CountryEnabled = false, + CountryRequired = false, + StateProvinceEnabled = false, + StateProvinceRequired = false, + PhoneEnabled = false, + FaxEnabled = false, + AcceptPrivacyPolicyEnabled = false, + NewsletterEnabled = true, + NewsletterTickedByDefault = true, + HideNewsletterBlock = false, + NewsletterBlockAllowToUnsubscribe = false, + OnlineCustomerMinutes = 20, + StoreLastVisitedPage = false, + SuffixDeletedCustomers = false, + EnteringEmailTwice = false, + RequireRegistrationForDownloadableProducts = false, + DeleteGuestTaskOlderThanMinutes = 1440 + }); + + settingService.SaveSetting(new AddressSettings + { + CompanyEnabled = true, + StreetAddressEnabled = true, + StreetAddressRequired = true, + StreetAddress2Enabled = true, + ZipPostalCodeEnabled = true, + ZipPostalCodeRequired = true, + CityEnabled = true, + CityRequired = true, + CountryEnabled = true, + StateProvinceEnabled = true, + PhoneEnabled = true, + PhoneRequired = true, + FaxEnabled = true, + }); + + settingService.SaveSetting(new MediaSettings + { + AvatarPictureSize = 120, + ProductThumbPictureSize = 415, + ProductDetailsPictureSize = 550, + ProductThumbPictureSizeOnProductDetailsPage = 100, + AssociatedProductPictureSize = 220, + CategoryThumbPictureSize = 450, + ManufacturerThumbPictureSize = 420, + VendorThumbPictureSize = 450, + CartThumbPictureSize = 80, + MiniCartThumbPictureSize = 70, + AutoCompleteSearchThumbPictureSize = 20, + ImageSquarePictureSize = 32, + MaximumImageSize = 1980, + DefaultPictureZoomEnabled = false, + DefaultImageQuality = 80, + MultipleThumbDirectories = false, + ImportProductImagesUsingHash = true, + AzureCacheControlHeader = string.Empty + }); + + settingService.SaveSetting(new StoreInformationSettings + { + StoreClosed = false, + DefaultStoreTheme = "DefaultClean", + AllowCustomerToSelectTheme = false, + DisplayMiniProfilerInPublicStore = false, + DisplayMiniProfilerForAdminOnly = false, + DisplayEuCookieLawWarning = false, + FacebookLink = "http://www.facebook.com/nopCommerce", + TwitterLink = "https://twitter.com/nopCommerce", + YoutubeLink = "http://www.youtube.com/user/nopCommerce", + GooglePlusLink = "https://plus.google.com/+nopcommerce", + HidePoweredByNopCommerce = false + }); + + settingService.SaveSetting(new ExternalAuthenticationSettings + { + AutoRegisterEnabled = true, + RequireEmailValidation = false + }); + + settingService.SaveSetting(new RewardPointsSettings + { + Enabled = true, + ExchangeRate = 1, + PointsForRegistration = 0, + PointsForPurchases_Amount = 10, + PointsForPurchases_Points = 1, + ActivationDelay = 0, + ActivationDelayPeriodId = 0, + DisplayHowMuchWillBeEarned = true, + PointsAccumulatedForAllStores = true, + PageSize = 10, + EarnedRewardPointsAreTaxable = false, + AwardPointsIncludeShipping = true, + AwardPointsIncludePaymentMethodAdditionalFee = true, + AwardPointsExcludeGiftCard = true, + AwardPointsExcludePurchasedRewardPoints = true, + EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints = false + }); + + settingService.SaveSetting(new CurrencySettings + { + DisplayCurrencyLabel = false, + PrimaryStoreCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id, + PrimaryExchangeRateCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id, + ActiveExchangeRateProviderSystemName = "CurrencyExchange.MoneyConverter", + AutoUpdateEnabled = false + }); + + settingService.SaveSetting(new MeasureSettings + { + BaseDimensionId = _measureDimensionRepository.Table.Single(m => m.SystemKeyword == "inches").Id, + BaseWeightId = _measureWeightRepository.Table.Single(m => m.SystemKeyword == "lb").Id, + }); + + settingService.SaveSetting(new MessageTemplatesSettings + { + CaseInvariantReplacement = false, + Color1 = "#b9babe", + Color2 = "#ebecee", + Color3 = "#dde2e6", + }); + + settingService.SaveSetting(new ShoppingCartSettings + { + DisplayCartAfterAddingProduct = false, + DisplayWishlistAfterAddingProduct = false, + MaximumShoppingCartItems = 1000, + MaximumWishlistItems = 1000, + AllowOutOfStockItemsToBeAddedToWishlist = false, + MoveItemsFromWishlistToCart = true, + CartsSharedBetweenStores = false, + ShowProductImagesOnShoppingCart = true, + ShowProductImagesOnWishList = true, + ShowDiscountBox = true, + ShowGiftCardBox = true, + CrossSellsNumber = 4, + EmailWishlistEnabled = true, + AllowAnonymousUsersToEmailWishlist = false, + MiniShoppingCartEnabled = true, + ShowProductImagesInMiniShoppingCart = true, + MiniShoppingCartProductNumber = 5, + RoundPricesDuringCalculation = true, + GroupTierPricesForDistinctShoppingCartItems = false, + AllowCartItemEditing = true, + RenderAssociatedAttributeValueQuantity = true, + RenderProductAttributePrices = true + }); + + settingService.SaveSetting(new OrderSettings + { + ReturnRequestNumberMask = "{ID}", + IsReOrderAllowed = true, + MinOrderSubtotalAmount = 0, + MinOrderSubtotalAmountIncludingTax = false, + MinOrderTotalAmount = 0, + AutoUpdateOrderTotalsOnEditingOrder = false, + AnonymousCheckoutAllowed = true, + TermsOfServiceOnShoppingCartPage = true, + TermsOfServiceOnOrderConfirmPage = false, + OnePageCheckoutEnabled = true, + OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab = false, + DisableBillingAddressCheckoutStep = false, + DisableOrderCompletedPage = false, + AttachPdfInvoiceToOrderPlacedEmail = false, + AttachPdfInvoiceToOrderCompletedEmail = false, + GeneratePdfInvoiceInCustomerLanguage = true, + AttachPdfInvoiceToOrderPaidEmail = false, + ReturnRequestsEnabled = true, + ReturnRequestsAllowFiles = false, + ReturnRequestsFileMaximumSize = 2048, + NumberOfDaysReturnRequestAvailable = 365, + MinimumOrderPlacementInterval = 30, + ActivateGiftCardsAfterCompletingOrder = false, + DeactivateGiftCardsAfterCancellingOrder = false, + DeactivateGiftCardsAfterDeletingOrder = false, + CompleteOrderWhenDelivered = true, + CustomOrderNumberMask = "{ID}", + ExportWithProducts = true, + AssignInvoiceIdentFromTask = false, + }); + + settingService.SaveSetting(new SecuritySettings + { + ForceSslForAllPages = false, + EncryptionKey = CommonHelper.GenerateRandomDigitCode(16), + AdminAreaAllowedIpAddresses = null, + EnableXsrfProtectionForAdminArea = true, + EnableXsrfProtectionForPublicStore = true, + HoneypotEnabled = false, + HoneypotInputName = "hpinput" + }); + + settingService.SaveSetting(new ShippingSettings + { + ActiveShippingRateComputationMethodSystemNames = new List { "Shipping.FixedOrByWeight" }, + ActivePickupPointProviderSystemNames = new List { "Pickup.PickupInStore" }, + ShipToSameAddress = true, + AllowPickUpInStore = true, + DisplayPickupPointsOnMap = false, + UseWarehouseLocation = false, + NotifyCustomerAboutShippingFromMultipleLocations = false, + FreeShippingOverXEnabled = false, + FreeShippingOverXValue = decimal.Zero, + FreeShippingOverXIncludingTax = false, + EstimateShippingEnabled = true, + DisplayShipmentEventsToCustomers = false, + DisplayShipmentEventsToStoreOwner = false, + HideShippingTotal = false, + ReturnValidOptionsIfThereAreAny = true, + BypassShippingMethodSelectionIfOnlyOne = false, + UseCubeRootMethod = true, + ConsiderAssociatedProductsDimensions = true + }); + + settingService.SaveSetting(new PaymentSettings + { + ActivePaymentMethodSystemNames = new List + { + "Payments.CheckMoneyOrder", + "Payments.Manual", + "Payments.PayInStore", + "Payments.PurchaseOrder", + }, + AllowRePostingPayments = true, + BypassPaymentMethodSelectionIfOnlyOne = true, + ShowPaymentMethodDescriptions = true, + SkipPaymentInfoStepForRedirectionPaymentMethods = false, + CancelRecurringPaymentsAfterFailedPayment = false + }); + + settingService.SaveSetting(new TaxSettings + { + TaxBasedOn = TaxBasedOn.BillingAddress, + TaxBasedOnPickupPointAddress = false, + TaxDisplayType = TaxDisplayType.ExcludingTax, + ActiveTaxProviderSystemName = "Tax.FixedOrByCountryStateZip", + DefaultTaxAddressId = 0, + DisplayTaxSuffix = false, + DisplayTaxRates = false, + PricesIncludeTax = false, + AllowCustomersToSelectTaxDisplayType = false, + ForceTaxExclusionFromOrderSubtotal = false, + DefaultTaxCategoryId = 0, + HideZeroTax = false, + HideTaxInOrderSummary = false, + ShippingIsTaxable = false, + ShippingPriceIncludesTax = false, + ShippingTaxClassId = 0, + PaymentMethodAdditionalFeeIsTaxable = false, + PaymentMethodAdditionalFeeIncludesTax = false, + PaymentMethodAdditionalFeeTaxClassId = 0, + EuVatEnabled = false, + EuVatShopCountryId = 0, + EuVatAllowVatExemption = true, + EuVatUseWebService = false, + EuVatAssumeValid = false, + EuVatEmailAdminWhenNewVatSubmitted = false, + LogErrors = false + }); + + settingService.SaveSetting(new DateTimeSettings + { + DefaultStoreTimeZoneId = "", + AllowCustomersToSetTimeZone = false + }); + + settingService.SaveSetting(new BlogSettings + { + Enabled = true, + PostsPageSize = 10, + AllowNotRegisteredUsersToLeaveComments = true, + NotifyAboutNewBlogComments = false, + NumberOfTags = 15, + ShowHeaderRssUrl = false, + BlogCommentsMustBeApproved = false, + ShowBlogCommentsPerStore = false + }); + settingService.SaveSetting(new NewsSettings + { + Enabled = true, + AllowNotRegisteredUsersToLeaveComments = true, + NotifyAboutNewNewsComments = false, + ShowNewsOnMainPage = true, + MainPageNewsCount = 3, + NewsArchivePageSize = 10, + ShowHeaderRssUrl = false, + NewsCommentsMustBeApproved = false, + ShowNewsCommentsPerStore = false + }); + + settingService.SaveSetting(new ForumSettings + { + ForumsEnabled = false, + RelativeDateTimeFormattingEnabled = true, + AllowCustomersToDeletePosts = false, + AllowCustomersToEditPosts = false, + AllowCustomersToManageSubscriptions = false, + AllowGuestsToCreatePosts = false, + AllowGuestsToCreateTopics = false, + AllowPostVoting = true, + MaxVotesPerDay = 30, + TopicSubjectMaxLength = 450, + PostMaxLength = 4000, + StrippedTopicMaxLength = 45, + TopicsPageSize = 10, + PostsPageSize = 10, + SearchResultsPageSize = 10, + ActiveDiscussionsPageSize = 50, + LatestCustomerPostsPageSize = 10, + ShowCustomersPostCount = true, + ForumEditor = EditorType.BBCodeEditor, + SignaturesEnabled = true, + AllowPrivateMessages = false, + ShowAlertForPM = false, + PrivateMessagesPageSize = 10, + ForumSubscriptionsPageSize = 10, + NotifyAboutPrivateMessages = false, + PMSubjectMaxLength = 450, + PMTextMaxLength = 4000, + HomePageActiveDiscussionsTopicCount = 5, + ActiveDiscussionsFeedEnabled = false, + ActiveDiscussionsFeedCount = 25, + ForumFeedsEnabled = false, + ForumFeedCount = 10, + ForumSearchTermMinimumLength = 3, + }); + + settingService.SaveSetting(new VendorSettings + { + DefaultVendorPageSizeOptions = "6, 3, 9", + VendorsBlockItemsToDisplay = 0, + ShowVendorOnProductDetailsPage = true, + AllowCustomersToContactVendors = true, + AllowCustomersToApplyForVendorAccount = true, + AllowVendorsToEditInfo = false, + NotifyStoreOwnerAboutVendorInformationChange = true, + MaximumProductNumber = 3000, + AllowVendorsToImportProducts = true + }); + + var eaGeneral = _emailAccountRepository.Table.FirstOrDefault(); + if (eaGeneral == null) + throw new Exception("Default email account cannot be loaded"); + settingService.SaveSetting(new EmailAccountSettings + { + DefaultEmailAccountId = eaGeneral.Id + }); + + settingService.SaveSetting(new WidgetSettings + { + ActiveWidgetSystemNames = new List { "Widgets.NivoSlider" }, + }); + + settingService.SaveSetting(new DisplayDefaultMenuItemSettings + { + DisplayHomePageMenuItem = !installSampleData, + DisplayNewProductsMenuItem = !installSampleData, + DisplayProductSearchMenuItem = !installSampleData, + DisplayCustomerInfoMenuItem = !installSampleData, + DisplayBlogMenuItem = !installSampleData, + DisplayForumsMenuItem = !installSampleData, + DisplayContactUsMenuItem = !installSampleData + }); + } + + protected virtual void InstallCheckoutAttributes() + { + var ca1 = new CheckoutAttribute + { + Name = "Gift wrapping", + IsRequired = true, + ShippableProductRequired = true, + AttributeControlType = AttributeControlType.DropdownList, + DisplayOrder = 1, + }; + ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue + { + Name = "No", + PriceAdjustment = 0, + DisplayOrder = 1, + IsPreSelected = true, + }); + ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue + { + Name = "Yes", + PriceAdjustment = 10, + DisplayOrder = 2, + }); + var checkoutAttributes = new List + { + ca1, + }; + _checkoutAttributeRepository.Insert(checkoutAttributes); + } + + protected virtual void InstallSpecificationAttributes() + { + var sa1 = new SpecificationAttribute + { + Name = "Screensize", + DisplayOrder = 1, + }; + sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "13.0''", + DisplayOrder = 2, + }); + sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "13.3''", + DisplayOrder = 3, + }); + sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "14.0''", + DisplayOrder = 4, + }); + sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "15.0''", + DisplayOrder = 4, + }); + sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "15.6''", + DisplayOrder = 5, + }); + var sa2 = new SpecificationAttribute + { + Name = "CPU Type", + DisplayOrder = 2, + }; + sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "Intel Core i5", + DisplayOrder = 1, + }); + sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "Intel Core i7", + DisplayOrder = 2, + }); + var sa3 = new SpecificationAttribute + { + Name = "Memory", + DisplayOrder = 3, + }; + sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "4 GB", + DisplayOrder = 1, + }); + sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "8 GB", + DisplayOrder = 2, + }); + sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "16 GB", + DisplayOrder = 3, + }); + var sa4 = new SpecificationAttribute + { + Name = "Hardrive", + DisplayOrder = 5, + }; + sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "128 GB", + DisplayOrder = 7, + }); + sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "500 GB", + DisplayOrder = 4, + }); + sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "1 TB", + DisplayOrder = 3, + }); + var sa5 = new SpecificationAttribute + { + Name = "Color", + DisplayOrder = 1, + }; + sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "Grey", + DisplayOrder = 2, + ColorSquaresRgb = "#8a97a8" + }); + sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "Red", + DisplayOrder = 3, + ColorSquaresRgb = "#8a374a" + }); + sa5.SpecificationAttributeOptions.Add(new SpecificationAttributeOption + { + Name = "Blue", + DisplayOrder = 4, + ColorSquaresRgb = "#47476f" + }); + var specificationAttributes = new List + { + sa1, + sa2, + sa3, + sa4, + sa5 + }; + _specificationAttributeRepository.Insert(specificationAttributes); + } + + protected virtual void InstallProductAttributes() + { + var productAttributes = new List + { + new ProductAttribute + { + Name = "Color", + }, + new ProductAttribute + { + Name = "Print", + }, + new ProductAttribute + { + Name = "Custom Text", + }, + new ProductAttribute + { + Name = "HDD", + }, + new ProductAttribute + { + Name = "OS", + }, + new ProductAttribute + { + Name = "Processor", + }, + new ProductAttribute + { + Name = "RAM", + }, + new ProductAttribute + { + Name = "Size", + }, + new ProductAttribute + { + Name = "Software", + }, + }; + _productAttributeRepository.Insert(productAttributes); + } + + protected virtual void InstallCategories() + { + //pictures + var pictureService = EngineContext.Current.Resolve(); + var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); + + + + var categoryTemplateInGridAndLines = _categoryTemplateRepository + .Table.FirstOrDefault(pt => pt.Name == "Products in Grid or Lines"); + if (categoryTemplateInGridAndLines == null) + throw new Exception("Category template cannot be loaded"); + + + //categories + var allCategories = new List(); + var categoryComputers = new Category + { + Name = "Computers", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_computers.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Computers")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryComputers); + _categoryRepository.Insert(categoryComputers); + + + var categoryDesktops = new Category + { + Name = "Desktops", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryComputers.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_desktops.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Desktops")).Id, + PriceRanges = "-1000;1000-1200;1200-;", + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryDesktops); + _categoryRepository.Insert(categoryDesktops); + + + var categoryNotebooks = new Category + { + Name = "Notebooks", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryComputers.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_notebooks.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Notebooks")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 2, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryNotebooks); + _categoryRepository.Insert(categoryNotebooks); + + + var categorySoftware = new Category + { + Name = "Software", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryComputers.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_software.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Software")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 3, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categorySoftware); + _categoryRepository.Insert(categorySoftware); + + + var categoryElectronics = new Category + { + Name = "Electronics", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_electronics.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Electronics")).Id, + IncludeInTopMenu = true, + Published = true, + ShowOnHomePage = true, + DisplayOrder = 2, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryElectronics); + _categoryRepository.Insert(categoryElectronics); + + + var categoryCameraPhoto = new Category + { + Name = "Camera & photo", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryElectronics.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_camera_photo.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Camera, photo")).Id, + PriceRanges = "-500;500-;", + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryCameraPhoto); + _categoryRepository.Insert(categoryCameraPhoto); + + + var categoryCellPhones = new Category + { + Name = "Cell phones", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryElectronics.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_cell_phones.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Cell phones")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 2, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryCellPhones); + _categoryRepository.Insert(categoryCellPhones); + + + var categoryOthers = new Category + { + Name = "Others", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryElectronics.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_accessories.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Accessories")).Id, + IncludeInTopMenu = true, + PriceRanges = "-100;100-;", + Published = true, + DisplayOrder = 3, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryOthers); + _categoryRepository.Insert(categoryOthers); + + + var categoryApparel = new Category + { + Name = "Apparel", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_apparel.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Apparel")).Id, + IncludeInTopMenu = true, + Published = true, + ShowOnHomePage = true, + DisplayOrder = 3, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryApparel); + _categoryRepository.Insert(categoryApparel); + + + var categoryShoes = new Category + { + Name = "Shoes", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryApparel.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_shoes.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Shoes")).Id, + PriceRanges = "-500;500-;", + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryShoes); + _categoryRepository.Insert(categoryShoes); + + + var categoryClothing = new Category + { + Name = "Clothing", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryApparel.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_clothing.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Clothing")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 2, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryClothing); + _categoryRepository.Insert(categoryClothing); + + + var categoryAccessories = new Category + { + Name = "Accessories", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + ParentCategoryId = categoryApparel.Id, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_apparel_accessories.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Apparel Accessories")).Id, + IncludeInTopMenu = true, + PriceRanges = "-100;100-;", + Published = true, + DisplayOrder = 3, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryAccessories); + _categoryRepository.Insert(categoryAccessories); + + + var categoryDigitalDownloads = new Category + { + Name = "Digital downloads", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_digital_downloads.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Digital downloads")).Id, + IncludeInTopMenu = true, + Published = true, + ShowOnHomePage = true, + DisplayOrder = 4, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryDigitalDownloads); + _categoryRepository.Insert(categoryDigitalDownloads); + + + var categoryBooks = new Category + { + Name = "Books", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + MetaKeywords = "Books, Dictionary, Textbooks", + MetaDescription = "Books category description", + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_book.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Book")).Id, + PriceRanges = "-25;25-50;50-;", + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 5, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryBooks); + _categoryRepository.Insert(categoryBooks); + + + var categoryJewelry = new Category + { + Name = "Jewelry", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_jewelry.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Jewelry")).Id, + PriceRanges = "0-500;500-700;700-3000;", + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 6, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryJewelry); + _categoryRepository.Insert(categoryJewelry); + + var categoryGiftCards = new Category + { + Name = "Gift Cards", + CategoryTemplateId = categoryTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_gift_cards.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Gift Cards")).Id, + IncludeInTopMenu = true, + Published = true, + DisplayOrder = 7, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allCategories.Add(categoryGiftCards); + _categoryRepository.Insert(categoryGiftCards); + + + + //search engine names + foreach (var category in allCategories) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = category.Id, + EntityName = "Category", + LanguageId = 0, + IsActive = true, + Slug = category.ValidateSeName("", category.Name, true) + }); + } + } + + protected virtual void InstallManufacturers() + { + var pictureService = EngineContext.Current.Resolve(); + var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); + + var manufacturerTemplateInGridAndLines = + _manufacturerTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Products in Grid or Lines"); + if (manufacturerTemplateInGridAndLines == null) + throw new Exception("Manufacturer template cannot be loaded"); + + var allManufacturers = new List(); + var manufacturerAsus = new Manufacturer + { + Name = "Apple", + ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + Published = true, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_apple.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Apple")).Id, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + _manufacturerRepository.Insert(manufacturerAsus); + allManufacturers.Add(manufacturerAsus); + + + var manufacturerHp = new Manufacturer + { + Name = "HP", + ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + Published = true, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_hp.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Hp")).Id, + DisplayOrder = 5, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + _manufacturerRepository.Insert(manufacturerHp); + allManufacturers.Add(manufacturerHp); + + + var manufacturerNike = new Manufacturer + { + Name = "Nike", + ManufacturerTemplateId = manufacturerTemplateInGridAndLines.Id, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9", + Published = true, + PictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "manufacturer_nike.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Nike")).Id, + DisplayOrder = 5, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + _manufacturerRepository.Insert(manufacturerNike); + allManufacturers.Add(manufacturerNike); + + //search engine names + foreach (var manufacturer in allManufacturers) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = manufacturer.Id, + EntityName = "Manufacturer", + LanguageId = 0, + IsActive = true, + Slug = manufacturer.ValidateSeName("", manufacturer.Name, true) + }); + } + } + + protected virtual void InstallProducts(string defaultUserEmail) + { + var productTemplateSimple = _productTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Simple product"); + if (productTemplateSimple == null) + throw new Exception("Simple product template could not be loaded"); + var productTemplateGrouped = _productTemplateRepository.Table.FirstOrDefault(pt => pt.Name == "Grouped product (with variants)"); + if (productTemplateGrouped == null) + throw new Exception("Grouped product template could not be loaded"); + + //delivery date + var deliveryDate = _deliveryDateRepository.Table.FirstOrDefault(); + if (deliveryDate == null) + throw new Exception("No default deliveryDate could be loaded"); + + //product availability range + var productAvailabilityRange = _productAvailabilityRangeRepository.Table.FirstOrDefault(); + if (productAvailabilityRange == null) + throw new Exception("No default product availability range could be loaded"); + + //default customer/user + var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); + if (defaultCustomer == null) + throw new Exception("Cannot load default customer"); + + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + + //pictures + var pictureService = EngineContext.Current.Resolve(); + var sampleImagesPath = CommonHelper.MapPath("~/content/samples/"); + + //downloads + var downloadService = EngineContext.Current.Resolve(); + var sampleDownloadsPath = CommonHelper.MapPath("~/content/samples/"); + + //products + var allProducts = new List(); + + #region Desktops + + + var productBuildComputer = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Build your own computer", + Sku = "COMP_CUST", + ShortDescription = "Build it", + FullDescription = "

Fight back against cluttered workspaces with the stylish IBM zBC12 All-in-One desktop PC, featuring powerful computing resources and a stunning 20.1-inch widescreen display with stunning XBRITE-HiColor LCD technology. The black IBM zBC12 has a built-in microphone and MOTION EYE camera with face-tracking technology that allows for easy communication with friends and family. And it has a built-in DVD burner and Sony's Movie Store software so you can create a digital entertainment library for personal viewing at your convenience. Easy to setup and even easier to use, this JS-series All-in-One includes an elegantly designed keyboard and a USB mouse.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "build-your-own-computer", + AllowCustomerReviews = true, + Price = 1200M, + IsShipEnabled = true, + IsFreeShipping = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + ShowOnHomePage = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Processor"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "2.2 GHz Intel Pentium Dual-Core E2200", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "2.5 GHz Intel Pentium Dual-Core E2200", + IsPreSelected = true, + PriceAdjustment = 15, + DisplayOrder = 2, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "RAM"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "2 GB", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "4GB", + PriceAdjustment = 20, + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "8GB", + PriceAdjustment = 60, + DisplayOrder = 3, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "HDD"), + AttributeControlType = AttributeControlType.RadioList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "320 GB", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "400 GB", + PriceAdjustment = 100, + DisplayOrder = 2, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "OS"), + AttributeControlType = AttributeControlType.RadioList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Vista Home", + PriceAdjustment = 50, + IsPreSelected = true, + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Vista Premium", + PriceAdjustment = 60, + DisplayOrder = 2, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Software"), + AttributeControlType = AttributeControlType.Checkboxes, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Microsoft Office", + PriceAdjustment = 50, + IsPreSelected = true, + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Acrobat Reader", + PriceAdjustment = 10, + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Total Commander", + PriceAdjustment = 5, + DisplayOrder = 2, + } + } + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productBuildComputer); + productBuildComputer.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Desktops_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBuildComputer.Name)), + DisplayOrder = 1, + }); + productBuildComputer.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Desktops_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBuildComputer.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productBuildComputer); + + + + + + var productDigitalStorm = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Digital Storm VANQUISH 3 Custom Performance PC", + Sku = "DS_VA3_PC", + ShortDescription = "Digital Storm Vanquish 3 Desktop PC", + FullDescription = "

Blow the doors off todays most demanding games with maximum detail, speed, and power for an immersive gaming experience without breaking the bank.

Stay ahead of the competition, VANQUISH 3 is fully equipped to easily handle future upgrades, keeping your system on the cutting edge for years to come.

Each system is put through an extensive stress test, ensuring you experience zero bottlenecks and get the maximum performance from your hardware.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "compaq-presario-sr1519x-pentium-4-desktop-pc-with-cdrw", + AllowCustomerReviews = true, + Price = 1259M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productDigitalStorm); + productDigitalStorm.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_DigitalStorm.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productDigitalStorm.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productDigitalStorm); + + + + + + var productLenovoIdeaCentre = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Lenovo IdeaCentre 600 All-in-One PC", + Sku = "LE_IC_600", + ShortDescription = "", + FullDescription = "

The A600 features a 21.5in screen, DVD or optional Blu-Ray drive, support for the full beans 1920 x 1080 HD, Dolby Home Cinema certification and an optional hybrid analogue/digital TV tuner.

Connectivity is handled by 802.11a/b/g - 802.11n is optional - and an ethernet port. You also get four USB ports, a Firewire slot, a six-in-one card reader and a 1.3- or two-megapixel webcam.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "hp-iq506-touchsmart-desktop-pc", + AllowCustomerReviews = true, + Price = 500M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Desktops"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productLenovoIdeaCentre); + productLenovoIdeaCentre.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LenovoIdeaCentre.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLenovoIdeaCentre.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productLenovoIdeaCentre); + + + + + #endregion + + #region Notebooks + + var productAppleMacBookPro = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Apple MacBook Pro 13-inch", + Sku = "AP_MBP_13", + ShortDescription = "A groundbreaking Retina display. A new force-sensing trackpad. All-flash architecture. Powerful dual-core and quad-core Intel processors. Together, these features take the notebook to a new level of performance. And they will do the same for you in everything you create.", + FullDescription = "

With fifth-generation Intel Core processors, the latest graphics, and faster flash storage, the incredibly advanced MacBook Pro with Retina display moves even further ahead in performance and battery life.* *Compared with the previous generation.

Retina display with 2560-by-1600 resolution

Fifth-generation dual-core Intel Core i5 processor

Intel Iris Graphics

Up to 9 hours of battery life1

Faster flash storage2

802.11ac Wi-Fi

Two Thunderbolt 2 ports for connecting high-performance devices and transferring data at lightning speed

Two USB 3 ports (compatible with USB 2 devices) and HDMI

FaceTime HD camera

Pages, Numbers, Keynote, iPhoto, iMovie, GarageBand included

OS X, the world's most advanced desktop operating system

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "asus-eee-pc-1000ha-10-inch-netbook", + AllowCustomerReviews = true, + Price = 1800M, + IsShipEnabled = true, + IsFreeShipping = true, + Weight = 3, + Length = 3, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 2, + OrderMaximumQuantity = 10000, + Published = true, + ShowOnHomePage = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Apple"), + DisplayOrder = 2, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.0''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 3, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB") + } + //new ProductSpecificationAttribute + //{ + // AllowFiltering = false, + // ShowOnProductPage = true, + // DisplayOrder = 4, + // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "160 GB") + //} + } + }; + allProducts.Add(productAppleMacBookPro); + productAppleMacBookPro.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_macbook_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleMacBookPro.Name)), + DisplayOrder = 1, + }); + productAppleMacBookPro.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_macbook_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleMacBookPro.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productAppleMacBookPro); + + + + + + var productAsusN551JK = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Asus N551JK-XO076H Laptop", + Sku = "AS_551_LP", + ShortDescription = "Laptop Asus N551JK Intel Core i7-4710HQ 2.5 GHz, RAM 16GB, HDD 1TB, Video NVidia GTX 850M 4GB, BluRay, 15.6, Full HD, Win 8.1", + FullDescription = "

The ASUS N550JX combines cutting-edge audio and visual technology to deliver an unsurpassed multimedia experience. A full HD wide-view IPS panel is tailor-made for watching movies and the intuitive touchscreen makes for easy, seamless navigation. ASUS has paired the N550JXs impressive display with SonicMaster Premium, co-developed with Bang & Olufsen ICEpower audio experts, for true surround sound. A quad-speaker array and external subwoofer combine for distinct vocals and a low bass that you can feel.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "asus-eee-pc-900ha-89-inch-netbook-black", + AllowCustomerReviews = true, + Price = 1500M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 3, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "16 GB") + }, + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 4, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "1 TB") + } + } + }; + allProducts.Add(productAsusN551JK); + productAsusN551JK.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_asuspc_N551JK.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAsusN551JK.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productAsusN551JK); + + + + + + var productSamsungSeries = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Samsung Series 9 NP900X4C Premium Ultrabook", + Sku = "SM_900_PU", + ShortDescription = "Samsung Series 9 NP900X4C-A06US 15-Inch Ultrabook (1.70 GHz Intel Core i5-3317U Processor, 8GB DDR3, 128GB SSD, Windows 8) Ash Black", + FullDescription = "

Designed with mobility in mind, Samsung's durable, ultra premium, lightweight Series 9 laptop (model NP900X4C-A01US) offers mobile professionals and power users a sophisticated laptop equally suited for work and entertainment. Featuring a minimalist look that is both simple and sophisticated, its polished aluminum uni-body design offers an iconic look and feel that pushes the envelope with an edge just 0.58 inches thin. This Series 9 laptop also includes a brilliant 15-inch SuperBright Plus display with HD+ technology, 128 GB Solid State Drive (SSD), 8 GB of system memory, and up to 10 hours of battery life.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "hp-pavilion-artist-edition-dv2890nr-141-inch-laptop", + AllowCustomerReviews = true, + Price = 1590M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + //ShowOnHomePage = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.0''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 3, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB") + }, + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 4, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB") + } + } + }; + allProducts.Add(productSamsungSeries); + productSamsungSeries.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_SamsungNP900X4C.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productSamsungSeries.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productSamsungSeries); + + + + + + var productHpSpectre = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "HP Spectre XT Pro UltraBook", + Sku = "HP_SPX_UB", + ShortDescription = "HP Spectre XT Pro UltraBook / Intel Core i5-2467M / 13.3 / 4GB / 128GB / Windows 7 Professional / Laptop", + FullDescription = "

Introducing HP ENVY Spectre XT, the Ultrabook designed for those who want style without sacrificing substance. It's sleek. It's thin. And with Intel. Corer i5 processor and premium materials, it's designed to go anywhere from the bistro to the boardroom, it's unlike anything you've ever seen from HP.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "hp-pavilion-elite-m9150f-desktop-pc", + AllowCustomerReviews = true, + Price = 1350M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "HP"), + DisplayOrder = 3, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.3''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 3, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB") + }, + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 4, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB") + } + } + }; + allProducts.Add(productHpSpectre); + productHpSpectre.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HPSpectreXT_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpSpectre.Name)), + DisplayOrder = 1, + }); + productHpSpectre.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HPSpectreXT_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpSpectre.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productHpSpectre); + + + + var productHpEnvy = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "HP Envy 6-1180ca 15.6-Inch Sleekbook", + Sku = "HP_ESB_15", + ShortDescription = "HP ENVY 6-1202ea Ultrabook Beats Audio, 3rd generation Intel CoreTM i7-3517U processor, 8GB RAM, 500GB HDD, Microsoft Windows 8, AMD Radeon HD 8750M (2 GB DDR3 dedicated)", + FullDescription = "The UltrabookTM that's up for anything. Thin and light, the HP ENVY is the large screen UltrabookTM with Beats AudioTM. With a soft-touch base that makes it easy to grab and go, it's a laptop that's up for anything.

Features

- Windows 8 or other operating systems available

Top performance. Stylish design. Take notice.

- At just 19.8 mm (0.78 in) thin, the HP ENVY UltrabookTM is slim and light enough to take anywhere. It's the laptop that gets you noticed with the power to get it done.
- With an eye-catching metal design, it's a laptop that you want to carry with you. The soft-touch, slip-resistant base gives you the confidence to carry it with ease.

More entertaining. More gaming. More fun.

- Own the UltrabookTM with Beats AudioTM, dual speakers, a subwoofer, and an awesome display. Your music, movies and photo slideshows will always look and sound their best.
- Tons of video memory let you experience incredible gaming and multimedia without slowing down. Create and edit videos in a flash. And enjoy more of what you love to the fullest.
- The HP ENVY UltrabookTM is loaded with the ports you'd expect on a world-class laptop, but on a Sleekbook instead. Like HDMI, USB, RJ-45, and a headphone jack. You get all the right connections without compromising size.

Only from HP.

- Life heats up. That's why there's HP CoolSense technology, which automatically adjusts your notebook's temperature based on usage and conditions. It stays cool. You stay comfortable.
- With HP ProtectSmart, your notebook's data stays safe from accidental bumps and bruises. It senses motion and plans ahead, stopping your hard drive and protecting your entire digital life.
- Keep playing even in dimly lit rooms or on red eye flights. The optional backlit keyboard[1] is full-size so you don't compromise comfort. Backlit keyboard. Another bright idea.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "hp-pavilion-g60-230us-160-inch-laptop", + AllowCustomerReviews = true, + Price = 1460M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "HP"), + DisplayOrder = 4, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 3, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB") + }, + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 4, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "500 GB") + } + } + }; + allProducts.Add(productHpEnvy); + productHpEnvy.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HpEnvy6.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHpEnvy.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productHpEnvy); + + + + + + var productLenovoThinkpad = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Lenovo Thinkpad X1 Carbon Laptop", + Sku = "LE_TX1_CL", + ShortDescription = "Lenovo Thinkpad X1 Carbon Touch Intel Core i7 14 Ultrabook", + FullDescription = "

The X1 Carbon brings a new level of quality to the ThinkPad legacy of high standards and innovation. It starts with the durable, carbon fiber-reinforced roll cage, making for the best Ultrabook construction available, and adds a host of other new features on top of the old favorites. Because for 20 years, we haven't stopped innovating. And you shouldn't stop benefiting from that.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "toshiba-satellite-a305-s6908-154-inch-laptop", + AllowCustomerReviews = true, + Price = 1360M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Notebooks"), + DisplayOrder = 1, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = false, + ShowOnProductPage = true, + DisplayOrder = 1, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "14.0''") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = true, + DisplayOrder = 2, + SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7") + } + //new ProductSpecificationAttribute + //{ + // AllowFiltering = true, + // ShowOnProductPage = true, + // DisplayOrder = 3, + // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "1 GB") + //}, + //new ProductSpecificationAttribute + //{ + // AllowFiltering = false, + // ShowOnProductPage = true, + // DisplayOrder = 4, + // SpecificationAttributeOption = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "250 GB") + //} + } + }; + allProducts.Add(productLenovoThinkpad); + productLenovoThinkpad.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LenovoThinkpad.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLenovoThinkpad.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productLenovoThinkpad); + + #endregion + + #region Software + + + var productAdobePhotoshop = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Adobe Photoshop CS4", + Sku = "AD_CS4_PH", + ShortDescription = "Easily find and view all your photos", + FullDescription = "

Adobe Photoshop CS4 software combines power and simplicity so you can make ordinary photos extraordinary; tell engaging stories in beautiful, personalized creations for print and web; and easily find and view all your photos. New Photoshop.com membership* works with Photoshop CS4 so you can protect your photos with automatic online backup and 2 GB of storage; view your photos anywhere you are; and share your photos in fun, interactive ways with invitation-only Online Albums.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "adobe-photoshop-elements-7", + AllowCustomerReviews = true, + Price = 75M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Software"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productAdobePhotoshop); + productAdobePhotoshop.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_AdobePhotoshop.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAdobePhotoshop.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productAdobePhotoshop); + + + + + + + var productWindows8Pro = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Windows 8 Pro", + Sku = "MS_WIN_8P", + ShortDescription = "Windows 8 is a Microsoft operating system that was released in 2012 as part of the company's Windows NT OS family. ", + FullDescription = "

Windows 8 Pro is comparable to Windows 7 Professional and Ultimate and is targeted towards enthusiasts and business users; it includes all the features of Windows 8. Additional features include the ability to receive Remote Desktop connections, the ability to participate in a Windows Server domain, Encrypting File System, Hyper-V, and Virtual Hard Disk Booting, Group Policy as well as BitLocker and BitLocker To Go. Windows Media Center functionality is available only for Windows 8 Pro as a separate software package.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "corel-paint-shop-pro-photo-x2", + AllowCustomerReviews = true, + Price = 65M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Software"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productWindows8Pro); + productWindows8Pro.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Windows8.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productWindows8Pro.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productWindows8Pro); + + + + + + var productSoundForge = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Sound Forge Pro 11 (recurring)", + Sku = "SF_PRO_11", + ShortDescription = "Advanced audio waveform editor.", + FullDescription = "

Sound Forge Pro is the application of choice for a generation of creative and prolific artists, producers, and editors. Record audio quickly on a rock-solid platform, address sophisticated audio processing tasks with surgical precision, and render top-notch master files with ease. New features include one-touch recording, metering for the new critical standards, more repair and restoration tools, and exclusive round-trip interoperability with SpectraLayers Pro. Taken together, these enhancements make this edition of Sound Forge Pro the deepest and most advanced audio editing platform available.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "major-league-baseball-2k9", + IsRecurring = true, + RecurringCycleLength = 30, + RecurringCyclePeriod = RecurringProductCyclePeriod.Months, + RecurringTotalCycles = 12, + AllowCustomerReviews = true, + Price = 54.99M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Software"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productSoundForge); + productSoundForge.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_SoundForge.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productSoundForge.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productSoundForge); + + + + + #endregion + + #region Camera, Photo + + + //this one is a grouped product with two associated ones + var productNikonD5500DSLR = new Product + { + ProductType = ProductType.GroupedProduct, + VisibleIndividually = true, + Name = "Nikon D5500 DSLR", + Sku = "N5500DS_0", + ShortDescription = "Slim, lightweight Nikon D5500 packs a vari-angle touchscreen", + FullDescription = "Nikon has announced its latest DSLR, the D5500. A lightweight, compact DX-format camera with a 24.2MP sensor, its the first of its type to offer a vari-angle touchscreen. The D5500 replaces the D5300 in Nikons range, and while it offers much the same features the company says its a much slimmer and lighter prospect. Theres a deep grip for easier handling and built-in Wi-Fi that lets you transfer and share shots via your phone or tablet.", + ProductTemplateId = productTemplateGrouped.Id, + //SeName = "canon-digital-slr-camera", + AllowCustomerReviews = true, + Published = true, + Price = 670M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productNikonD5500DSLR); + productNikonD5500DSLR.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNikonD5500DSLR.Name)), + DisplayOrder = 1, + }); + productNikonD5500DSLR.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNikonD5500DSLR.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productNikonD5500DSLR); + var productNikonD5500DSLR_associated_1 = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = false, //hide this products + ParentGroupedProductId = productNikonD5500DSLR.Id, + Name = "Nikon D5500 DSLR - Black", + Sku = "N5500DS_B", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "canon-digital-slr-camera-black", + AllowCustomerReviews = true, + Published = true, + Price = 670M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allProducts.Add(productNikonD5500DSLR_associated_1); + productNikonD5500DSLR_associated_1.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_black.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Canon Digital SLR Camera - Black")), + DisplayOrder = 1, + }); + _productRepository.Insert(productNikonD5500DSLR_associated_1); + var productNikonD5500DSLR_associated_2 = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = false, //hide this products + ParentGroupedProductId = productNikonD5500DSLR.Id, + Name = "Nikon D5500 DSLR - Red", + Sku = "N5500DS_R", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "canon-digital-slr-camera-silver", + AllowCustomerReviews = true, + Published = true, + Price = 630M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow + }; + allProducts.Add(productNikonD5500DSLR_associated_2); + productNikonD5500DSLR_associated_2.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikonCamera_red.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName("Canon Digital SLR Camera - Silver")), + DisplayOrder = 1, + }); + _productRepository.Insert(productNikonD5500DSLR_associated_2); + + + + + + var productLeica = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Leica T Mirrorless Digital Camera", + Sku = "LT_MIR_DC", + ShortDescription = "Leica T (Typ 701) Silver", + FullDescription = "

The new Leica T offers a minimalist design that's crafted from a single block of aluminum. Made in Germany and assembled by hand, this 16.3 effective mega pixel camera is easy to use. With a massive 3.7 TFT LCD intuitive touch screen control, the user is able to configure and save their own menu system. The Leica T has outstanding image quality and also has 16GB of built in memory. This is Leica's first system camera to use Wi-Fi. Add the T-App to your portable iOS device and be able to transfer and share your images (free download from the Apple App Store)

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "canon-vixia-hf100-camcorder", + AllowCustomerReviews = true, + Price = 530M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), + DisplayOrder = 3, + } + } + }; + allProducts.Add(productLeica); + productLeica.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeicaT.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productLeica.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productLeica); + + + + + + + var productAppleICam = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Apple iCam", + Sku = "APPLE_CAM", + ShortDescription = "Photography becomes smart", + FullDescription = "

A few months ago we featured the amazing WVIL camera, by many considered the future of digital photography. This is another very good looking concept, iCam is the vision of Italian designer Antonio DeRosa, the idea is to have a device that attaches to the iPhone 5, which then allows the user to have a camera with interchangeable lenses. The device would also feature a front-touch screen and a projector. Would be great if apple picked up on this and made it reality.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "panasonic-hdc-sdt750k-high-definition-3d-camcorder", + AllowCustomerReviews = true, + Price = 1300M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Camera & photo"), + DisplayOrder = 2, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Apple"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productAppleICam); + productAppleICam.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_iCam.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productAppleICam.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productAppleICam); + + + + + #endregion + + #region Cell Phone + + var productHtcOne = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "HTC One M8 Android L 5.0 Lollipop", + Sku = "M8_HTC_5L", + ShortDescription = "HTC - One (M8) 4G LTE Cell Phone with 32GB Memory - Gunmetal (Sprint)", + FullDescription = "

HTC One (M8) Cell Phone for Sprint: With its brushed-metal design and wrap-around unibody frame, the HTC One (M8) is designed to fit beautifully in your hand. It's fun to use with amped up sound and a large Full HD touch screen, and intuitive gesture controls make it seem like your phone almost knows what you need before you do.

Sprint Easy Pay option available in store.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "blackberry-bold-9000-phone-black-att", + AllowCustomerReviews = true, + Price = 245M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + ShowOnHomePage = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productHtcOne); + productHtcOne.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_M8.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOne.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productHtcOne); + + + + + + + var productHtcOneMini = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "HTC One Mini Blue", + Sku = "OM_HTC_BL", + ShortDescription = "HTC One and HTC One Mini now available in bright blue hue", + FullDescription = "

HTC One mini smartphone with 4.30-inch 720x1280 display powered by 1.4GHz processor alongside 1GB RAM and 4-Ultrapixel rear camera.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "samsung-rugby-a837-phone-black-att", + AllowCustomerReviews = true, + Price = 100M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productHtcOneMini); + productHtcOneMini.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_Mini_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOneMini.Name)), + DisplayOrder = 1, + }); + productHtcOneMini.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_HTC_One_Mini_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productHtcOneMini.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productHtcOneMini); + + + + + + + var productNokiaLumia = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Nokia Lumia 1020", + Sku = "N_1020_LU", + ShortDescription = "Nokia Lumia 1020 4G Cell Phone (Unlocked)", + FullDescription = "

Capture special moments for friends and family with this Nokia Lumia 1020 32GB WHITE cell phone that features an easy-to-use 41.0MP rear-facing camera and a 1.2MP front-facing camera. The AMOLED touch screen offers 768 x 1280 resolution for crisp visuals.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "sony-dcr-sr85-1mp-60gb-hard-drive-handycam-camcorder", + AllowCustomerReviews = true, + Price = 349M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Cell phones"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productNokiaLumia); + productNokiaLumia.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Lumia1020.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNokiaLumia.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productNokiaLumia); + + + #endregion + + #region Others + + + + var productBeatsPill = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Beats Pill 2.0 Wireless Speaker", + Sku = "BP_20_WSP", + ShortDescription = "Pill 2.0 Portable Bluetooth Speaker (1-Piece): Watch your favorite movies and listen to music with striking sound quality. This lightweight, portable speaker is easy to take with you as you travel to any destination, keeping you entertained wherever you are. ", + FullDescription = "
  • Pair and play with your Bluetooth device with 30 foot range
  • Built-in speakerphone
  • 7 hour rechargeable battery
  • Power your other devices with USB charge out
  • Tap two Beats Pills together for twice the sound with Beats Bond
", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "acer-aspire-one-89-mini-notebook-case-black", + AllowCustomerReviews = true, + Price = 79.99M, + IsShipEnabled = true, + IsFreeShipping = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + TierPrices = + { + new TierPrice + { + Quantity = 2, + Price = 19 + }, + new TierPrice + { + Quantity = 5, + Price = 17 + }, + new TierPrice + { + Quantity = 10, + Price = 15, + StartDateTimeUtc = DateTime.UtcNow.AddDays(-7), + EndDateTimeUtc = DateTime.UtcNow.AddDays(7) + } + }, + HasTierPrices = true, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Others"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productBeatsPill); + productBeatsPill.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PillBeats_1.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBeatsPill.Name)), + DisplayOrder = 1, + }); + productBeatsPill.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PillBeats_2.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBeatsPill.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productBeatsPill); + + + + + + var productUniversalTabletCover = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Universal 7-8 Inch Tablet Cover", + Sku = "TC_78I_UN", + ShortDescription = "Universal protection for 7-inch & 8-inch tablets", + FullDescription = "

Made of durable polyurethane, our Universal Cover is slim, lightweight, and strong, with protective corners that stretch to hold most 7 and 8-inch tablets securely. This tough case helps protects your tablet from bumps, scuffs, and dings.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "apc-back-ups-rs-800va-ups-800-va-ups-battery-lead-acid-br800blk", + AllowCustomerReviews = true, + Price = 39M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Others"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productUniversalTabletCover); + productUniversalTabletCover.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_TabletCover.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productUniversalTabletCover.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productUniversalTabletCover); + + + + + var productPortableSoundSpeakers = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Portable Sound Speakers", + Sku = "PT_SPK_SN", + ShortDescription = "Universall portable sound speakers", + FullDescription = "

Your phone cut the cord, now it's time for you to set your music free and buy a Bluetooth speaker. Thankfully, there's one suited for everyone out there.

Some Bluetooth speakers excel at packing in as much functionality as the unit can handle while keeping the price down. Other speakers shuck excess functionality in favor of premium build materials instead. Whatever path you choose to go down, you'll be greeted with many options to suit your personal tastes.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "microsoft-bluetooth-notebook-mouse-5000-macwindows", + AllowCustomerReviews = true, + Price = 37M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Others"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productPortableSoundSpeakers); + productPortableSoundSpeakers.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Speakers.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productPortableSoundSpeakers.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productPortableSoundSpeakers); + + + #endregion + + #region Shoes + + + var productNikeFloral = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Nike Floral Roshe Customized Running Shoes", + Sku = "NK_FRC_RS", + ShortDescription = "When you ran across these shoes, you will immediately fell in love and needed a pair of these customized beauties.", + FullDescription = "

Each Rosh Run is personalized and exclusive, handmade in our workshop Custom. Run Your Rosh creations born from the hand of an artist specialized in sneakers, more than 10 years of experience.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "adidas-womens-supernova-csh-7-running-shoe", + AllowCustomerReviews = true, + Price = 40M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "8", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "9", + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "10", + DisplayOrder = 3, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "11", + DisplayOrder = 4, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Color"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "White/Blue", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "White/Black", + DisplayOrder = 2, + }, + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Print"), + AttributeControlType = AttributeControlType.ImageSquares, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Natural", + DisplayOrder = 1, + ImageSquaresPictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "p_attribute_print_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Natural Print")).Id, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Fresh", + DisplayOrder = 2, + ImageSquaresPictureId = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "p_attribute_print_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName("Fresh Print")).Id, + }, + } + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), + DisplayOrder = 2, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = false, + DisplayOrder = 1, + SpecificationAttributeOption = + _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") + .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") + } + } + }; + allProducts.Add(productNikeFloral); + productNikeFloral.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeFloralShoe_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeFloral.Name)), + DisplayOrder = 1, + }); + productNikeFloral.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeFloralShoe_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeFloral.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productNikeFloral); + + productNikeFloral.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Print").ProductAttributeValues.First(x => x.Name == "Natural").PictureId = productNikeFloral.ProductPictures.ElementAt(0).PictureId; + productNikeFloral.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Print").ProductAttributeValues.First(x => x.Name == "Fresh").PictureId = productNikeFloral.ProductPictures.ElementAt(1).PictureId; + _productRepository.Update(productNikeFloral); + + + + var productAdidas = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "adidas Consortium Campus 80s Running Shoes", + Sku = "AD_C80_RS", + ShortDescription = "adidas Consortium Campus 80s Primeknit Light Maroon/Running Shoes", + FullDescription = "

One of three colorways of the adidas Consortium Campus 80s Primeknit set to drop alongside each other. This pair comes in light maroon and running white. Featuring a maroon-based primeknit upper with white accents. A limited release, look out for these at select adidas Consortium accounts worldwide.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "etnies-mens-digit-sneaker", + AllowCustomerReviews = true, + Price = 27.56M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + //ShowOnHomePage = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "8", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "9", + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "10", + DisplayOrder = 3, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "11", + DisplayOrder = 4, + } + } + }, + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Color"), + AttributeControlType = AttributeControlType.ColorSquares, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Red", + IsPreSelected = true, + ColorSquaresRgb = "#663030", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Blue", + ColorSquaresRgb = "#363656", + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Silver", + ColorSquaresRgb = "#c5c5d5", + DisplayOrder = 3, + } + } + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), + DisplayOrder = 1, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = false, + DisplayOrder = 1, + SpecificationAttributeOption = + _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") + .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = false, + DisplayOrder = 2, + SpecificationAttributeOption = + _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") + .SpecificationAttributeOptions.Single(sao => sao.Name == "Red") + }, + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = false, + DisplayOrder = 3, + SpecificationAttributeOption = + _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") + .SpecificationAttributeOptions.Single(sao => sao.Name == "Blue") + }, + } + }; + allProducts.Add(productAdidas); + productAdidas.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), + DisplayOrder = 1, + }); + productAdidas.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), + DisplayOrder = 2, + }); + productAdidas.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_3.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productAdidas.Name)), + DisplayOrder = 3, + }); + + + _productRepository.Insert(productAdidas); + + productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Red").PictureId = productAdidas.ProductPictures.ElementAt(0).PictureId; + productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Blue").PictureId = productAdidas.ProductPictures.ElementAt(1).PictureId; + productAdidas.ProductAttributeMappings.First(x => x.ProductAttribute.Name == "Color").ProductAttributeValues.First(x => x.Name == "Silver").PictureId = productAdidas.ProductPictures.ElementAt(2).PictureId; + _productRepository.Update(productAdidas); + + + + + var productNikeZoom = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Nike SB Zoom Stefan Janoski \"Medium Mint\"", + Sku = "NK_ZSJ_MM", + ShortDescription = "Nike SB Zoom Stefan Janoski Dark Grey Medium Mint Teal ...", + FullDescription = "The newly Nike SB Zoom Stefan Janoski gets hit with a \"Medium Mint\" accents that sits atop a Dark Grey suede. Expected to drop in October.", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "v-blue-juniors-cuffed-denim-short-with-rhinestones", + AllowCustomerReviews = true, + Price = 30M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Shoes"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), + DisplayOrder = 2, + } + }, + ProductSpecificationAttributes = + { + new ProductSpecificationAttribute + { + AllowFiltering = true, + ShowOnProductPage = false, + DisplayOrder = 1, + SpecificationAttributeOption = + _specificationAttributeRepository.Table.Single(sa => sa.Name == "Color") + .SpecificationAttributeOptions.Single(sao => sao.Name == "Grey") + } + } + }; + + allProducts.Add(productNikeZoom); + productNikeZoom.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeZoom.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeZoom.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productNikeZoom); + + + #endregion + + #region Clothing + + var productNikeTailwind = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Nike Tailwind Loose Short-Sleeve Running Shirt", + Sku = "NK_TLS_RS", + ShortDescription = "", + FullDescription = "

Boost your adrenaline with the Nike Women's Tailwind Running Shirt. The lightweight, slouchy fit is great for layering, and moisture-wicking fabrics keep you feeling at your best. This tee has a notched hem for an enhanced range of motion, while flat seams with reinforcement tape lessen discomfort and irritation over longer distances. Put your keys and card in the side zip pocket and take off in your Nike running t-shirt.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "50s-rockabilly-polka-dot-top-jr-plus-size", + AllowCustomerReviews = true, + Published = true, + Price = 15M, + IsShipEnabled = true, + Weight = 1, + Length = 2, + Width = 3, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Small", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "1X", + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "2X", + DisplayOrder = 3, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "3X", + DisplayOrder = 4, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "4X", + DisplayOrder = 5, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "5X", + DisplayOrder = 6, + } + } + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), + DisplayOrder = 1, + } + }, + ProductManufacturers = + { + new ProductManufacturer + { + Manufacturer = _manufacturerRepository.Table.Single(c => c.Name == "Nike"), + DisplayOrder = 2, + } + } + }; + allProducts.Add(productNikeTailwind); + productNikeTailwind.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NikeShirt.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productNikeTailwind.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productNikeTailwind); + + + + + var productOversizedWomenTShirt = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Oversized Women T-Shirt", + Sku = "WM_OVR_TS", + ShortDescription = "", + FullDescription = "

This oversized women t-Shirt needs minimum ironing. It is a great product at a great value!

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "arrow-mens-wrinkle-free-pinpoint-solid-long-sleeve", + AllowCustomerReviews = true, + Price = 24M, + IsShipEnabled = true, + Weight = 4, + Length = 3, + Width = 3, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + TierPrices = + { + new TierPrice + { + Quantity = 3, + Price = 21 + }, + new TierPrice + { + Quantity = 7, + Price = 19 + }, + new TierPrice + { + Quantity = 10, + Price = 16 + } + }, + HasTierPrices = true, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productOversizedWomenTShirt); + productOversizedWomenTShirt.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_WomenTShirt.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productOversizedWomenTShirt.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productOversizedWomenTShirt); + + + + + var productCustomTShirt = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Custom T-Shirt", + Sku = "CS_TSHIRT", + ShortDescription = "T-Shirt - Add Your Content", + FullDescription = "

Comfort comes in all shapes and forms, yet this tee out does it all. Rising above the rest, our classic cotton crew provides the simple practicality you need to make it through the day. Tag-free, relaxed fit wears well under dress shirts or stands alone in laid-back style. Reinforced collar and lightweight feel give way to long-lasting shape and breathability. One less thing to worry about, rely on this tee to provide comfort and ease with every wear.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "custom-t-shirt", + AllowCustomerReviews = true, + Price = 15M, + IsShipEnabled = true, + Weight = 4, + Length = 3, + Width = 3, + Height = 3, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Custom Text"), + TextPrompt = "Enter your text:", + AttributeControlType = AttributeControlType.TextBox, + IsRequired = true, + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productCustomTShirt); + productCustomTShirt.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_CustomTShirt.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productCustomTShirt.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productCustomTShirt); + + + + + + + var productLeviJeans = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Levi's 511 Jeans", + Sku = "LV_511_JN", + ShortDescription = "Levi's Faded Black 511 Jeans ", + FullDescription = "

Between a skinny and straight fit, our 511™ slim fit jeans are cut close without being too restricting. Slim throughout the thigh and leg opening for a long and lean look.

  • Slouch1y at top; sits below the waist
  • Slim through the leg, close at the thigh and straight to the ankle
  • Stretch for added comfort
  • Classic five-pocket styling
  • 99% Cotton, 1% Spandex, 11.2 oz. - Imported
", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "levis-skinny-511-jeans", + AllowCustomerReviews = true, + Price = 43.5M, + OldPrice = 55M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + TierPrices = + { + new TierPrice + { + Quantity = 3, + Price = 40 + }, + new TierPrice + { + Quantity = 6, + Price = 38 + }, + new TierPrice + { + Quantity = 10, + Price = 35 + } + }, + HasTierPrices = true, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Clothing"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productLeviJeans); + + productLeviJeans.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeviJeans_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productLeviJeans.Name)), + DisplayOrder = 1, + }); + productLeviJeans.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LeviJeans_2.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productLeviJeans.Name)), + DisplayOrder = 2, + }); + _productRepository.Insert(productLeviJeans); + + + #endregion + + #region Accessories + + + var productObeyHat = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Obey Propaganda Hat", + Sku = "OB_HAT_PR", + ShortDescription = "", + FullDescription = "

Printed poplin 5 panel camp hat with debossed leather patch and web closure

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "indiana-jones-shapeable-wool-hat", + AllowCustomerReviews = true, + Price = 30M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductAttributeMappings = + { + new ProductAttributeMapping + { + ProductAttribute = _productAttributeRepository.Table.Single(x => x.Name == "Size"), + AttributeControlType = AttributeControlType.DropdownList, + IsRequired = true, + ProductAttributeValues = + { + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Small", + DisplayOrder = 1, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Medium", + DisplayOrder = 2, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "Large", + DisplayOrder = 3, + }, + new ProductAttributeValue + { + AttributeValueType = AttributeValueType.Simple, + Name = "X-Large", + DisplayOrder = 4, + } + } + } + }, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productObeyHat); + productObeyHat.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_hat.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productObeyHat.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productObeyHat); + + + + + + + + var productBelt = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Reversible Horseferry Check Belt", + Sku = "RH_CHK_BL", + ShortDescription = "Reversible belt in Horseferry check with smooth leather trim", + FullDescription = "

Reversible belt in Horseferry check with smooth leather trim

Leather lining, polished metal buckle

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "nike-golf-casual-belt", + AllowCustomerReviews = true, + Price = 45M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + ProductAvailabilityRangeId = productAvailabilityRange.Id, + StockQuantity = 0, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productBelt); + productBelt.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Belt.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productBelt.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productBelt); + + + + + + + var productSunglasses = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Ray Ban Aviator Sunglasses", + Sku = "RB_AVR_SG", + ShortDescription = "Aviator sunglasses are one of the first widely popularized styles of modern day sunwear.", + FullDescription = "

Since 1937, Ray-Ban can genuinely claim the title as the world's leading sunglasses and optical eyewear brand. Combining the best of fashion and sports performance, the Ray-Ban line of Sunglasses delivers a truly classic style that will have you looking great today and for years to come.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "ray-ban-aviator-sunglasses-rb-3025", + AllowCustomerReviews = true, + Price = 25M, + IsShipEnabled = true, + Weight = 7, + Length = 7, + Width = 7, + Height = 7, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Accessories"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productSunglasses); + productSunglasses.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Sunglasses.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productSunglasses.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productSunglasses); + + #endregion + + #region Digital Downloads + + + var downloadNightVision1 = new Download + { + DownloadGuid = Guid.NewGuid(), + ContentType = MimeTypes.ApplicationXZipCo, + DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_NightVision_1.zip"), + Extension = ".zip", + Filename = "Night_Vision_1", + IsNew = true, + }; + downloadService.InsertDownload(downloadNightVision1); + var downloadNightVision2 = new Download + { + DownloadGuid = Guid.NewGuid(), + ContentType = MimeTypes.TextPlain, + DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_NightVision_2.txt"), + Extension = ".txt", + Filename = "Night_Vision_1", + IsNew = true, + }; + downloadService.InsertDownload(downloadNightVision2); + var productNightVision = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Night Visions", + Sku = "NIGHT_VSN", + ShortDescription = "Night Visions is the debut studio album by American rock band Imagine Dragons.", + FullDescription = "

Original Release Date: September 4, 2012

Release Date: September 4, 2012

Genre - Alternative rock, indie rock, electronic rock

Label - Interscope/KIDinaKORNER

Copyright: (C) 2011 Interscope Records

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "poker-face", + AllowCustomerReviews = true, + Price = 2.8M, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + IsDownload = true, + DownloadId = downloadNightVision1.Id, + DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, + UnlimitedDownloads = true, + HasUserAgreement = false, + HasSampleDownload = true, + SampleDownloadId = downloadNightVision2.Id, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productNightVision); + productNightVision.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_NightVisions.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productNightVision.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productNightVision); + + + + + + var downloadIfYouWait1 = new Download + { + DownloadGuid = Guid.NewGuid(), + ContentType = MimeTypes.ApplicationXZipCo, + DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_IfYouWait_1.zip"), + Extension = ".zip", + Filename = "If_You_Wait_1", + IsNew = true, + }; + downloadService.InsertDownload(downloadIfYouWait1); + var downloadIfYouWait2 = new Download + { + DownloadGuid = Guid.NewGuid(), + ContentType = MimeTypes.TextPlain, + DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_IfYouWait_2.txt"), + Extension = ".txt", + Filename = "If_You_Wait_1", + IsNew = true, + }; + downloadService.InsertDownload(downloadIfYouWait2); + var productIfYouWait = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "If You Wait (donation)", + Sku = "IF_YOU_WT", + ShortDescription = "If You Wait is the debut studio album by English indie pop band London Grammar", + FullDescription = "

Original Release Date: September 6, 2013

Genre - Electronica, dream pop downtempo, pop

Label - Metal & Dust/Ministry of Sound

Producer - Tim Bran, Roy Kerr London, Grammar

Length - 43:22

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "single-ladies-put-a-ring-on-it", + CustomerEntersPrice = true, + MinimumCustomerEnteredPrice = 0.5M, + MaximumCustomerEnteredPrice = 100M, + AllowCustomerReviews = true, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + IsDownload = true, + DownloadId = downloadIfYouWait1.Id, + DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, + UnlimitedDownloads = true, + HasUserAgreement = false, + HasSampleDownload = true, + SampleDownloadId = downloadIfYouWait2.Id, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productIfYouWait); + + productIfYouWait.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_IfYouWait.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productIfYouWait.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productIfYouWait); + + + + + + var downloadScienceAndFaith = new Download + { + DownloadGuid = Guid.NewGuid(), + ContentType = MimeTypes.ApplicationXZipCo, + DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_ScienceAndFaith_1.zip"), + Extension = ".zip", + Filename = "Science_And_Faith", + IsNew = true, + }; + downloadService.InsertDownload(downloadScienceAndFaith); + var productScienceAndFaith = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Science & Faith", + Sku = "SCI_FAITH", + ShortDescription = "Science & Faith is the second studio album by Irish pop rock band The Script.", + FullDescription = "

# Original Release Date: September 10, 2010
# Label: RCA, Epic/Phonogenic(America)
# Copyright: 2010 RCA Records.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "the-battle-of-los-angeles", + AllowCustomerReviews = true, + CustomerEntersPrice = true, + MinimumCustomerEnteredPrice = 0.5M, + MaximumCustomerEnteredPrice = 1000M, + Price = decimal.Zero, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + IsDownload = true, + DownloadId = downloadScienceAndFaith.Id, + DownloadActivationType = DownloadActivationType.WhenOrderIsPaid, + UnlimitedDownloads = true, + HasUserAgreement = false, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Digital downloads"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productScienceAndFaith); + productScienceAndFaith.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ScienceAndFaith.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productScienceAndFaith.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productScienceAndFaith); + + + + #endregion + + #region Books + + var productFahrenheit = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Fahrenheit 451 by Ray Bradbury", + Sku = "FR_451_RB", + ShortDescription = "Fahrenheit 451 is a dystopian novel by Ray Bradbury published in 1953. It is regarded as one of his best works.", + FullDescription = "

The novel presents a future American society where books are outlawed and firemen burn any that are found. The title refers to the temperature that Bradbury understood to be the autoignition point of paper.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "best-grilling-recipes", + AllowCustomerReviews = true, + Price = 27M, + OldPrice = 30M, + IsShipEnabled = true, + IsFreeShipping = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Books"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productFahrenheit); + productFahrenheit.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Fahrenheit451.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productFahrenheit.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productFahrenheit); + + + + var productFirstPrizePies = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "First Prize Pies", + Sku = "FIRST_PRP", + ShortDescription = "Allison Kave made pies as a hobby, until one day her boyfriend convinced her to enter a Brooklyn pie-making contest. She won. In fact, her pies were such a hit that she turned pro.", + FullDescription = "

First Prize Pies, a boutique, made-to-order pie business that originated on New York's Lower East Side, has become synonymous with tempting and unusual confections. For the home baker who is passionate about seasonal ingredients and loves a creative approach to recipes, First Prize Pies serves up 52 weeks of seasonal and eclectic pastries in an interesting pie-a-week format. Clear instructions, technical tips and creative encouragement guide novice bakers as well as pie mavens. With its nostalgia-evoking photos of homemade pies fresh out of the oven, First Prize Pies will be as giftable as it is practical.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "eatingwell-in-season", + AllowCustomerReviews = true, + Price = 51M, + OldPrice = 67M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Books"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productFirstPrizePies); + productFirstPrizePies.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_FirstPrizePies.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productFirstPrizePies.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productFirstPrizePies); + + + + + + + + var productPrideAndPrejudice = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Pride and Prejudice", + Sku = "PRIDE_PRJ", + ShortDescription = "Pride and Prejudice is a novel of manners by Jane Austen, first published in 1813.", + FullDescription = "

Set in England in the early 19th century, Pride and Prejudice tells the story of Mr and Mrs Bennet's five unmarried daughters after the rich and eligible Mr Bingley and his status-conscious friend, Mr Darcy, have moved into their neighbourhood. While Bingley takes an immediate liking to the eldest Bennet daughter, Jane, Darcy has difficulty adapting to local society and repeatedly clashes with the second-eldest Bennet daughter, Elizabeth.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "the-best-skillet-recipes", + AllowCustomerReviews = true, + Price = 24M, + OldPrice = 35M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Books").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Books"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productPrideAndPrejudice); + productPrideAndPrejudice.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_PrideAndPrejudice.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(productPrideAndPrejudice.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productPrideAndPrejudice); + + + + #endregion + + #region Jewelry + + + + var productElegantGemstoneNecklace = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Elegant Gemstone Necklace (rental)", + Sku = "EG_GEM_NL", + ShortDescription = "Classic and elegant gemstone necklace now available in our store", + FullDescription = "

For those who like jewelry, creating their ownelegant jewelry from gemstone beads provides an economical way to incorporate genuine gemstones into your jewelry wardrobe. Manufacturers create beads from all kinds of precious gemstones and semi-precious gemstones, which are available in bead shops, craft stores, and online marketplaces.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "diamond-pave-earrings", + AllowCustomerReviews = true, + IsRental = true, + RentalPriceLength = 1, + RentalPricePeriod = RentalPricePeriod.Days, + Price = 30M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productElegantGemstoneNecklace); + productElegantGemstoneNecklace.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_GemstoneNecklaces.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productElegantGemstoneNecklace.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productElegantGemstoneNecklace); + + + + + + var productFlowerGirlBracelet = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Flower Girl Bracelet", + Sku = "FL_GIRL_B", + ShortDescription = "Personalised Flower Braceled", + FullDescription = "

This is a great gift for your flower girl to wear on your wedding day. A delicate bracelet that is made with silver plated soldered cable chain, gives this bracelet a dainty look for young wrist. A Swarovski heart, shown in Rose, hangs off a silver plated flower. Hanging alongside the heart is a silver plated heart charm with Flower Girl engraved on both sides. This is a great style for the younger flower girl.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "diamond-tennis-bracelet", + AllowCustomerReviews = true, + Price = 360M, + IsShipEnabled = true, + IsFreeShipping = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productFlowerGirlBracelet); + productFlowerGirlBracelet.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_FlowerBracelet.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productFlowerGirlBracelet.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productFlowerGirlBracelet); + + + + + + + + + var productEngagementRing = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "Vintage Style Engagement Ring", + Sku = "VS_ENG_RN", + ShortDescription = "1.24 Carat (ctw) in 14K White Gold (Certified)", + FullDescription = "

Dazzle her with this gleaming 14 karat white gold vintage proposal. A ravishing collection of 11 decadent diamonds come together to invigorate a superbly ornate gold shank. Total diamond weight on this antique style engagement ring equals 1 1/4 carat (ctw). Item includes diamond certificate.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "vintage-style-three-stone-diamond-engagement-ring", + AllowCustomerReviews = true, + Price = 2100M, + IsShipEnabled = true, + Weight = 2, + Length = 2, + Width = 2, + Height = 2, + TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Jewelry").Id, + ManageInventoryMethod = ManageInventoryMethod.ManageStock, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + DisplayStockAvailability = true, + LowStockActivity = LowStockActivity.DisableBuyButton, + BackorderMode = BackorderMode.NoBackorders, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Jewelry"), + DisplayOrder = 1, + } + } + }; + allProducts.Add(productEngagementRing); + productEngagementRing.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_EngagementRing_1.jpg"), MimeTypes.ImagePJpeg, pictureService.GetPictureSeName(productEngagementRing.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(productEngagementRing); + + + + #endregion + + #region Gift Cards + + + var product25GiftCard = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "$25 Virtual Gift Card", + Sku = "VG_CR_025", + ShortDescription = "$25 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", + FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "25-virtual-gift-card", + AllowCustomerReviews = true, + Price = 25M, + IsGiftCard = true, + GiftCardType = GiftCardType.Virtual, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + Published = true, + ShowOnHomePage = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), + DisplayOrder = 2, + } + } + }; + allProducts.Add(product25GiftCard); + product25GiftCard.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_25giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product25GiftCard.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(product25GiftCard); + + + + + + var product50GiftCard = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "$50 Physical Gift Card", + Sku = "PG_CR_050", + ShortDescription = "$50 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", + FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "50-physical-gift-card", + AllowCustomerReviews = true, + Price = 50M, + IsGiftCard = true, + GiftCardType = GiftCardType.Physical, + IsShipEnabled = true, + IsFreeShipping = true, + DeliveryDateId = deliveryDate.Id, + Weight = 1, + Length = 1, + Width = 1, + Height = 1, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + Published = true, + MarkAsNew = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), + DisplayOrder = 3, + } + } + }; + allProducts.Add(product50GiftCard); + product50GiftCard.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_50giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product50GiftCard.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(product50GiftCard); + + + + + + var product100GiftCard = new Product + { + ProductType = ProductType.SimpleProduct, + VisibleIndividually = true, + Name = "$100 Physical Gift Card", + Sku = "PG_CR_100", + ShortDescription = "$100 Gift Card. Gift Cards must be redeemed through our site Web site toward the purchase of eligible products.", + FullDescription = "

Gift Cards must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftCard balance. Any unused balance will be placed in the recipient's GiftCard account when redeemed. If an order exceeds the amount of the GiftCard, the balance must be paid with a credit card or other available payment method.

", + ProductTemplateId = productTemplateSimple.Id, + //SeName = "100-physical-gift-card", + AllowCustomerReviews = true, + Price = 100M, + IsGiftCard = true, + GiftCardType = GiftCardType.Physical, + IsShipEnabled = true, + DeliveryDateId = deliveryDate.Id, + Weight = 1, + Length = 1, + Width = 1, + Height = 1, + ManageInventoryMethod = ManageInventoryMethod.DontManageStock, + OrderMinimumQuantity = 1, + OrderMaximumQuantity = 10000, + StockQuantity = 10000, + NotifyAdminForQuantityBelow = 1, + AllowBackInStockSubscriptions = false, + Published = true, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + ProductCategories = + { + new ProductCategory + { + Category = _categoryRepository.Table.Single(c => c.Name == "Gift Cards"), + DisplayOrder = 4, + } + } + }; + allProducts.Add(product100GiftCard); + product100GiftCard.ProductPictures.Add(new ProductPicture + { + Picture = pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_100giftcart.jpeg"), MimeTypes.ImageJpeg, pictureService.GetPictureSeName(product100GiftCard.Name)), + DisplayOrder = 1, + }); + _productRepository.Insert(product100GiftCard); + + #endregion + + + + //search engine names + foreach (var product in allProducts) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = product.Id, + EntityName = "Product", + LanguageId = 0, + IsActive = true, + Slug = product.ValidateSeName("", product.Name, true) + }); + } + + + #region Related Products + + //related products + var relatedProducts = new List + { + new RelatedProduct + { + ProductId1 = productFlowerGirlBracelet.Id, + ProductId2 = productEngagementRing.Id, + }, + new RelatedProduct + { + ProductId1 = productFlowerGirlBracelet.Id, + ProductId2 = productElegantGemstoneNecklace.Id, + }, + new RelatedProduct + { + ProductId1 = productEngagementRing.Id, + ProductId2 = productFlowerGirlBracelet.Id, + }, + new RelatedProduct + { + ProductId1 = productEngagementRing.Id, + ProductId2 = productElegantGemstoneNecklace.Id, + }, + new RelatedProduct + { + ProductId1 = productElegantGemstoneNecklace.Id, + ProductId2 = productFlowerGirlBracelet.Id, + }, + new RelatedProduct + { + ProductId1 = productElegantGemstoneNecklace.Id, + ProductId2 = productEngagementRing.Id, + }, + new RelatedProduct + { + ProductId1 = productIfYouWait.Id, + ProductId2 = productNightVision.Id, + }, + new RelatedProduct + { + ProductId1 = productIfYouWait.Id, + ProductId2 = productScienceAndFaith.Id, + }, + new RelatedProduct + { + ProductId1 = productNightVision.Id, + ProductId2 = productIfYouWait.Id, + }, + new RelatedProduct + { + ProductId1 = productNightVision.Id, + ProductId2 = productScienceAndFaith.Id, + }, + new RelatedProduct + { + ProductId1 = productPrideAndPrejudice.Id, + ProductId2 = productFirstPrizePies.Id, + }, + new RelatedProduct + { + ProductId1 = productPrideAndPrejudice.Id, + ProductId2 = productFahrenheit.Id, + }, + new RelatedProduct + { + ProductId1 = productFirstPrizePies.Id, + ProductId2 = productPrideAndPrejudice.Id, + }, + new RelatedProduct + { + ProductId1 = productFirstPrizePies.Id, + ProductId2 = productFahrenheit.Id, + }, + new RelatedProduct + { + ProductId1 = productFahrenheit.Id, + ProductId2 = productFirstPrizePies.Id, + }, + new RelatedProduct + { + ProductId1 = productFahrenheit.Id, + ProductId2 = productPrideAndPrejudice.Id, + }, + new RelatedProduct + { + ProductId1 = productAsusN551JK.Id, + ProductId2 = productLenovoThinkpad.Id, + }, + new RelatedProduct + { + ProductId1 = productAsusN551JK.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + new RelatedProduct + { + ProductId1 = productAsusN551JK.Id, + ProductId2 = productSamsungSeries.Id, + }, + new RelatedProduct + { + ProductId1 = productAsusN551JK.Id, + ProductId2 = productHpSpectre.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoThinkpad.Id, + ProductId2 = productAsusN551JK.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoThinkpad.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoThinkpad.Id, + ProductId2 = productSamsungSeries.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoThinkpad.Id, + ProductId2 = productHpEnvy.Id, + }, + new RelatedProduct + { + ProductId1 = productAppleMacBookPro.Id, + ProductId2 = productLenovoThinkpad.Id, + }, + new RelatedProduct + { + ProductId1 = productAppleMacBookPro.Id, + ProductId2 = productSamsungSeries.Id, + }, + new RelatedProduct + { + ProductId1 = productAppleMacBookPro.Id, + ProductId2 = productAsusN551JK.Id, + }, + new RelatedProduct + { + ProductId1 = productAppleMacBookPro.Id, + ProductId2 = productHpSpectre.Id, + }, + new RelatedProduct + { + ProductId1 = productHpSpectre.Id, + ProductId2 = productLenovoThinkpad.Id, + }, + new RelatedProduct + { + ProductId1 = productHpSpectre.Id, + ProductId2 = productSamsungSeries.Id, + }, + new RelatedProduct + { + ProductId1 = productHpSpectre.Id, + ProductId2 = productAsusN551JK.Id, + }, + new RelatedProduct + { + ProductId1 = productHpSpectre.Id, + ProductId2 = productHpEnvy.Id, + }, + new RelatedProduct + { + ProductId1 = productHpEnvy.Id, + ProductId2 = productAsusN551JK.Id, + }, + new RelatedProduct + { + ProductId1 = productHpEnvy.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + new RelatedProduct + { + ProductId1 = productHpEnvy.Id, + ProductId2 = productHpSpectre.Id, + }, + new RelatedProduct + { + ProductId1 = productHpEnvy.Id, + ProductId2 = productSamsungSeries.Id, + }, + new RelatedProduct + { + ProductId1 = productSamsungSeries.Id, + ProductId2 = productAsusN551JK.Id, + }, + new RelatedProduct + { + ProductId1 = productSamsungSeries.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + new RelatedProduct + { + ProductId1 = productSamsungSeries.Id, + ProductId2 = productHpEnvy.Id, + }, + new RelatedProduct + { + ProductId1 = productSamsungSeries.Id, + ProductId2 = productHpSpectre.Id, + }, + new RelatedProduct + { + ProductId1 = productLeica.Id, + ProductId2 = productHtcOneMini.Id, + }, + new RelatedProduct + { + ProductId1 = productLeica.Id, + ProductId2 = productNikonD5500DSLR.Id, + }, + new RelatedProduct + { + ProductId1 = productLeica.Id, + ProductId2 = productAppleICam.Id, + }, + new RelatedProduct + { + ProductId1 = productLeica.Id, + ProductId2 = productNokiaLumia.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOne.Id, + ProductId2 = productHtcOneMini.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOne.Id, + ProductId2 = productNokiaLumia.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOne.Id, + ProductId2 = productBeatsPill.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOne.Id, + ProductId2 = productPortableSoundSpeakers.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOneMini.Id, + ProductId2 = productHtcOne.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOneMini.Id, + ProductId2 = productNokiaLumia.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOneMini.Id, + ProductId2 = productBeatsPill.Id, + }, + new RelatedProduct + { + ProductId1 = productHtcOneMini.Id, + ProductId2 = productPortableSoundSpeakers.Id, + }, + new RelatedProduct + { + ProductId1 = productNokiaLumia.Id, + ProductId2 = productHtcOne.Id, + }, + new RelatedProduct + { + ProductId1 = productNokiaLumia.Id, + ProductId2 = productHtcOneMini.Id, + }, + new RelatedProduct + { + ProductId1 = productNokiaLumia.Id, + ProductId2 = productBeatsPill.Id, + }, + new RelatedProduct + { + ProductId1 = productNokiaLumia.Id, + ProductId2 = productPortableSoundSpeakers.Id, + }, + new RelatedProduct + { + ProductId1 = productAdidas.Id, + ProductId2 = productLeviJeans.Id, + }, + new RelatedProduct + { + ProductId1 = productAdidas.Id, + ProductId2 = productNikeFloral.Id, + }, + new RelatedProduct + { + ProductId1 = productAdidas.Id, + ProductId2 = productNikeZoom.Id, + }, + new RelatedProduct + { + ProductId1 = productAdidas.Id, + ProductId2 = productNikeTailwind.Id, + }, + new RelatedProduct + { + ProductId1 = productLeviJeans.Id, + ProductId2 = productAdidas.Id, + }, + new RelatedProduct + { + ProductId1 = productLeviJeans.Id, + ProductId2 = productNikeFloral.Id, + }, + new RelatedProduct + { + ProductId1 = productLeviJeans.Id, + ProductId2 = productNikeZoom.Id, + }, + new RelatedProduct + { + ProductId1 = productLeviJeans.Id, + ProductId2 = productNikeTailwind.Id, + }, + + new RelatedProduct + { + ProductId1 = productCustomTShirt.Id, + ProductId2 = productLeviJeans.Id, + }, + new RelatedProduct + { + ProductId1 = productCustomTShirt.Id, + ProductId2 = productNikeTailwind.Id, + }, + new RelatedProduct + { + ProductId1 = productCustomTShirt.Id, + ProductId2 = productOversizedWomenTShirt.Id, + }, + new RelatedProduct + { + ProductId1 = productCustomTShirt.Id, + ProductId2 = productObeyHat.Id, + }, + new RelatedProduct + { + ProductId1 = productDigitalStorm.Id, + ProductId2 = productBuildComputer.Id, + }, + new RelatedProduct + { + ProductId1 = productDigitalStorm.Id, + ProductId2 = productLenovoIdeaCentre.Id, + }, + new RelatedProduct + { + ProductId1 = productDigitalStorm.Id, + ProductId2 = productLenovoThinkpad.Id, + }, + new RelatedProduct + { + ProductId1 = productDigitalStorm.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + + + new RelatedProduct + { + ProductId1 = productLenovoIdeaCentre.Id, + ProductId2 = productBuildComputer.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoIdeaCentre.Id, + ProductId2 = productDigitalStorm.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoIdeaCentre.Id, + ProductId2 = productLenovoThinkpad.Id, + }, + new RelatedProduct + { + ProductId1 = productLenovoIdeaCentre.Id, + ProductId2 = productAppleMacBookPro.Id, + }, + }; + _relatedProductRepository.Insert(relatedProducts); + + #endregion + + #region Product Tags + + //product tags + AddProductTag(product25GiftCard, "nice"); + AddProductTag(product25GiftCard, "gift"); + AddProductTag(productNikeTailwind, "cool"); + AddProductTag(productNikeTailwind, "apparel"); + AddProductTag(productNikeTailwind, "shirt"); + AddProductTag(productBeatsPill, "computer"); + AddProductTag(productBeatsPill, "cool"); + AddProductTag(productNikeFloral, "cool"); + AddProductTag(productNikeFloral, "shoes"); + AddProductTag(productNikeFloral, "apparel"); + AddProductTag(productAdobePhotoshop, "computer"); + AddProductTag(productAdobePhotoshop, "awesome"); + AddProductTag(productUniversalTabletCover, "computer"); + AddProductTag(productUniversalTabletCover, "cool"); + AddProductTag(productOversizedWomenTShirt, "cool"); + AddProductTag(productOversizedWomenTShirt, "apparel"); + AddProductTag(productOversizedWomenTShirt, "shirt"); + AddProductTag(productAppleMacBookPro, "compact"); + AddProductTag(productAppleMacBookPro, "awesome"); + AddProductTag(productAppleMacBookPro, "computer"); + AddProductTag(productAsusN551JK, "compact"); + AddProductTag(productAsusN551JK, "awesome"); + AddProductTag(productAsusN551JK, "computer"); + AddProductTag(productFahrenheit, "awesome"); + AddProductTag(productFahrenheit, "book"); + AddProductTag(productFahrenheit, "nice"); + AddProductTag(productHtcOne, "cell"); + AddProductTag(productHtcOne, "compact"); + AddProductTag(productHtcOne, "awesome"); + AddProductTag(productBuildComputer, "awesome"); + AddProductTag(productBuildComputer, "computer"); + AddProductTag(productNikonD5500DSLR, "cool"); + AddProductTag(productNikonD5500DSLR, "camera"); + AddProductTag(productLeica, "camera"); + AddProductTag(productLeica, "cool"); + AddProductTag(productDigitalStorm, "cool"); + AddProductTag(productDigitalStorm, "computer"); + AddProductTag(productWindows8Pro, "awesome"); + AddProductTag(productWindows8Pro, "computer"); + AddProductTag(productCustomTShirt, "cool"); + AddProductTag(productCustomTShirt, "shirt"); + AddProductTag(productCustomTShirt, "apparel"); + AddProductTag(productElegantGemstoneNecklace, "jewelry"); + AddProductTag(productElegantGemstoneNecklace, "awesome"); + AddProductTag(productFlowerGirlBracelet, "awesome"); + AddProductTag(productFlowerGirlBracelet, "jewelry"); + AddProductTag(productFirstPrizePies, "book"); + AddProductTag(productAdidas, "cool"); + AddProductTag(productAdidas, "shoes"); + AddProductTag(productAdidas, "apparel"); + AddProductTag(productLenovoIdeaCentre, "awesome"); + AddProductTag(productLenovoIdeaCentre, "computer"); + AddProductTag(productSamsungSeries, "nice"); + AddProductTag(productSamsungSeries, "computer"); + AddProductTag(productSamsungSeries, "compact"); + AddProductTag(productHpSpectre, "nice"); + AddProductTag(productHpSpectre, "computer"); + AddProductTag(productHpEnvy, "computer"); + AddProductTag(productHpEnvy, "cool"); + AddProductTag(productHpEnvy, "compact"); + AddProductTag(productObeyHat, "apparel"); + AddProductTag(productObeyHat, "cool"); + AddProductTag(productLeviJeans, "cool"); + AddProductTag(productLeviJeans, "jeans"); + AddProductTag(productLeviJeans, "apparel"); + AddProductTag(productSoundForge, "game"); + AddProductTag(productSoundForge, "computer"); + AddProductTag(productSoundForge, "cool"); + AddProductTag(productNightVision, "awesome"); + AddProductTag(productNightVision, "digital"); + AddProductTag(productSunglasses, "apparel"); + AddProductTag(productSunglasses, "cool"); + AddProductTag(productHtcOneMini, "awesome"); + AddProductTag(productHtcOneMini, "compact"); + AddProductTag(productHtcOneMini, "cell"); + AddProductTag(productIfYouWait, "digital"); + AddProductTag(productIfYouWait, "awesome"); + AddProductTag(productNokiaLumia, "awesome"); + AddProductTag(productNokiaLumia, "cool"); + AddProductTag(productNokiaLumia, "camera"); + AddProductTag(productScienceAndFaith, "digital"); + AddProductTag(productScienceAndFaith, "awesome"); + AddProductTag(productPrideAndPrejudice, "book"); + AddProductTag(productLenovoThinkpad, "awesome"); + AddProductTag(productLenovoThinkpad, "computer"); + AddProductTag(productLenovoThinkpad, "compact"); + AddProductTag(productNikeZoom, "jeans"); + AddProductTag(productNikeZoom, "cool"); + AddProductTag(productNikeZoom, "apparel"); + AddProductTag(productEngagementRing, "jewelry"); + AddProductTag(productEngagementRing, "awesome"); + + + #endregion + + #region Reviews + + //reviews + var random = new Random(); + foreach (var product in allProducts) + { + if (product.ProductType != ProductType.SimpleProduct) + continue; + + //only 3 of 4 products will have reviews + if (random.Next(4) == 3) + continue; + + //rating from 4 to 5 + var rating = random.Next(4, 6); + product.ProductReviews.Add(new ProductReview + { + CustomerId = defaultCustomer.Id, + ProductId = product.Id, + StoreId = defaultStore.Id, + IsApproved = true, + Title = "Some sample review", + ReviewText = string.Format("This sample review is for the {0}. I've been waiting for this product to be available. It is priced just right.", product.Name), + //random (4 or 5) + Rating = rating, + HelpfulYesTotal = 0, + HelpfulNoTotal = 0, + CreatedOnUtc = DateTime.UtcNow + }); + product.ApprovedRatingSum = rating; + product.ApprovedTotalReviews = product.ProductReviews.Count; + + } + _productRepository.Update(allProducts); + + #endregion + + #region Stock quantity history + + foreach (var product in allProducts) + { + if (product.StockQuantity > 0) + _stockQuantityHistoryRepository.Insert(new StockQuantityHistory + { + ProductId = product.Id, + WarehouseId = product.WarehouseId > 0 ? (int?)product.WarehouseId : null, + QuantityAdjustment = product.StockQuantity, + StockQuantity = product.StockQuantity, + Message = "The stock quantity has been edited", + CreatedOnUtc = DateTime.UtcNow + }); + } + + #endregion + } + + protected virtual void InstallForums() + { + var forumGroup = new ForumGroup + { + Name = "General", + DisplayOrder = 5, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + }; + + _forumGroupRepository.Insert(forumGroup); + + var newProductsForum = new Forum + { + ForumGroup = forumGroup, + Name = "New Products", + Description = "Discuss new products and industry trends", + NumTopics = 0, + NumPosts = 0, + LastPostCustomerId = 0, + LastPostTime = null, + DisplayOrder = 1, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + }; + _forumRepository.Insert(newProductsForum); + + var mobileDevicesForum = new Forum + { + ForumGroup = forumGroup, + Name = "Mobile Devices Forum", + Description = "Discuss the mobile phone market", + NumTopics = 0, + NumPosts = 0, + LastPostCustomerId = 0, + LastPostTime = null, + DisplayOrder = 10, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + }; + _forumRepository.Insert(mobileDevicesForum); + + var packagingShippingForum = new Forum + { + ForumGroup = forumGroup, + Name = "Packaging & Shipping", + Description = "Discuss packaging & shipping", + NumTopics = 0, + NumPosts = 0, + LastPostTime = null, + DisplayOrder = 20, + CreatedOnUtc = DateTime.UtcNow, + UpdatedOnUtc = DateTime.UtcNow, + }; + _forumRepository.Insert(packagingShippingForum); + } + + protected virtual void InstallDiscounts() + { + var discounts = new List + { + new Discount + { + Name = "Sample discount with coupon code", + DiscountType = DiscountType.AssignedToSkus, + DiscountLimitation = DiscountLimitationType.Unlimited, + UsePercentage = false, + DiscountAmount = 10, + RequiresCouponCode = true, + CouponCode = "123", + }, + new Discount + { + Name = "'20% order total' discount", + DiscountType = DiscountType.AssignedToOrderTotal, + DiscountLimitation = DiscountLimitationType.Unlimited, + UsePercentage = true, + DiscountPercentage = 20, + StartDateUtc = new DateTime(2010,1,1), + EndDateUtc = new DateTime(2020,1,1), + RequiresCouponCode = true, + CouponCode = "456", + }, + }; + _discountRepository.Insert(discounts); + } + + protected virtual void InstallBlogPosts(string defaultUserEmail) + { + var defaultLanguage = _languageRepository.Table.FirstOrDefault(); + + var blogPosts = new List + { + new BlogPost + { + AllowComments = true, + Language = defaultLanguage, + Title = "How a blog can help your growing e-Commerce business", + BodyOverview = "

When you start an online business, your main aim is to sell the products, right? As a business owner, you want to showcase your store to more audience. So, you decide to go on social media, why? Because everyone is doing it, then why shouldn’t you? It is tempting as everyone is aware of the hype that it is the best way to market your brand.

Do you know having a blog for your online store can be very helpful? Many businesses do not understand the importance of having a blog because they don’t have time to post quality content.

Today, we will talk about how a blog can play an important role for the growth of your e-Commerce business. Later, we will also discuss some tips that will be helpful to you for writing business related blog posts.

", + Body = "

When you start an online business, your main aim is to sell the products, right? As a business owner, you want to showcase your store to more audience. So, you decide to go on social media, why? Because everyone is doing it, then why shouldn’t you? It is tempting as everyone is aware of the hype that it is the best way to market your brand.

Do you know having a blog for your online store can be very helpful? Many businesses do not understand the importance of having a blog because they don’t have time to post quality content.

Today, we will talk about how a blog can play an important role for the growth of your e-Commerce business. Later, we will also discuss some tips that will be helpful to you for writing business related blog posts.

1) Blog is useful in educating your customers

Blogging is one of the best way by which you can educate your customers about your products/services that you offer. This helps you as a business owner to bring more value to your brand. When you provide useful information to the customers about your products, they are more likely to buy products from you. You can use your blog for providing tutorials in regard to the use of your products.

For example: If you have an online store that offers computer parts. You can write tutorials about how to build a computer or how to make your computer’s performance better. While talking about these things, you can mention products in the tutorials and provide link to your products within the blog post from your website. Your potential customers might get different ideas of using your product and will likely to buy products from your online store.

2) Blog helps your business in Search Engine Optimization (SEO)

Blog posts create more internal links to your website which helps a lot in SEO. Blog is a great way to have quality content on your website related to your products/services which is indexed by all major search engines like Google, Bing and Yahoo. The more original content you write in your blog post, the better ranking you will get in search engines. SEO is an on-going process and posting blog posts regularly keeps your site active all the time which is beneficial when it comes to search engine optimization.

For example: Let’s say you sell “Sony Television Model XYZ” and you regularly publish blog posts about your product. Now, whenever someone searches for “Sony Television Model XYZ”, Google will crawl on your website knowing that you have something to do with this particular product. Hence, your website will show up on the search result page whenever this item is being searched.

3) Blog helps in boosting your sales by convincing the potential customers to buy

If you own an online business, there are so many ways you can share different stories with your audience in regard your products/services that you offer. Talk about how you started your business, share stories that educate your audience about what’s new in your industry, share stories about how your product/service was beneficial to someone or share anything that you think your audience might find interesting (it does not have to be related to your product). This kind of blogging shows that you are an expert in your industry and interested in educating your audience. It sets you apart in the competitive market. This gives you an opportunity to showcase your expertise by educating the visitors and it can turn your audience into buyers.

Fun Fact: Did you know that 92% of companies who decided to blog acquired customers through their blog?

nopCommerce is great e-Commerce solution that also offers a variety of CMS features including blog. A store owner has full access for managing the blog posts and related comments.

", + Tags = "e-commerce, blog, moey", + CreatedOnUtc = DateTime.UtcNow, + }, + new BlogPost + { + AllowComments = true, + Language = defaultLanguage, + Title = "Why your online store needs a wish list", + BodyOverview = "

What comes to your mind, when you hear the term” wish list”? The application of this feature is exactly how it sounds like: a list of things that you wish to get. As an online store owner, would you like your customers to be able to save products in a wish list so that they review or buy them later? Would you like your customers to be able to share their wish list with friends and family for gift giving?

Offering your customers a feature of wish list as part of shopping cart is a great way to build loyalty to your store site. Having the feature of wish list on a store site allows online businesses to engage with their customers in a smart way as it allows the shoppers to create a list of what they desire and their preferences for future purchase.

", + Body = "

What comes to your mind, when you hear the term” wish list”? The application of this feature is exactly how it sounds like: a list of things that you wish to get. As an online store owner, would you like your customers to be able to save products in a wish list so that they review or buy them later? Would you like your customers to be able to share their wish list with friends and family for gift giving?

Offering your customers a feature of wish list as part of shopping cart is a great way to build loyalty to your store site. Having the feature of wish list on a store site allows online businesses to engage with their customers in a smart way as it allows the shoppers to create a list of what they desire and their preferences for future purchase.

Does every e-Commerce store needs a wish list? The answer to this question in most cases is yes, because of the following reasons:

Understanding the needs of your customers - A wish list is a great way to know what is in your customer’s mind. Try to think the purchase history as a small portion of the customer’s preferences. But, the wish list is like a wide open door that can give any online business a lot of valuable information about their customer and what they like or desire.

Shoppers like to share their wish list with friends and family - Providing your customers a way to email their wish list to their friends and family is a pleasant way to make online shopping enjoyable for the shoppers. It is always a good idea to make the wish list sharable by a unique link so that it can be easily shared though different channels like email or on social media sites.

Wish list can be a great marketing tool – Another way to look at wish list is a great marketing tool because it is extremely targeted and the recipients are always motivated to use it. For example: when your younger brother tells you that his wish list is on a certain e-Commerce store. What is the first thing you are going to do? You are most likely to visit the e-Commerce store, check out the wish list and end up buying something for your younger brother.

So, how a wish list is a marketing tool? The reason is quite simple, it introduce your online store to new customers just how it is explained in the above example.

Encourage customers to return to the store site – Having a feature of wish list on the store site can increase the return traffic because it encourages customers to come back and buy later. Allowing the customers to save the wish list to their online accounts gives them a reason return to the store site and login to the account at any time to view or edit the wish list items.

Wish list can be used for gifts for different occasions like weddings or birthdays. So, what kind of benefits a gift-giver gets from a wish list?

  • It gives them a surety that they didn’t buy a wrong gift
  • It guarantees that the recipient will like the gift
  • It avoids any awkward moments when the recipient unwraps the gift and as a gift-giver you got something that the recipient do not want

Wish list is a great feature to have on a store site – So, what kind of benefits a business owner gets from a wish list

  • It is a great way to advertise an online store as many people do prefer to shop where their friend or family shop online
  • It allows the current customers to return to the store site and open doors for the new customers
  • It allows store admins to track what’s in customers wish list and run promotions accordingly to target specific customer segments

nopCommerce offers the feature of wish list that allows customers to create a list of products that they desire or planning to buy in future.

", + Tags = "e-commerce, nopCommerce, sample tag, money", + CreatedOnUtc = DateTime.UtcNow.AddSeconds(1), + }, + }; + _blogPostRepository.Insert(blogPosts); + + //search engine names + foreach (var blogPost in blogPosts) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = blogPost.Id, + EntityName = "BlogPost", + LanguageId = blogPost.LanguageId, + IsActive = true, + Slug = blogPost.ValidateSeName("", blogPost.Title, true) + }); + } + + //comments + var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); + if (defaultCustomer == null) + throw new Exception("Cannot load default customer"); + + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + foreach (var blogPost in blogPosts) + { + blogPost.BlogComments.Add(new BlogComment + { + BlogPostId = blogPost.Id, + CustomerId = defaultCustomer.Id, + CommentText = "This is a sample comment for this blog post", + IsApproved = true, + StoreId = defaultStore.Id, + CreatedOnUtc = DateTime.UtcNow + }); + } + _blogPostRepository.Update(blogPosts); + } + + protected virtual void InstallNews(string defaultUserEmail) + { + var defaultLanguage = _languageRepository.Table.FirstOrDefault(); + + var news = new List + { + new NewsItem + { + AllowComments = true, + Language = defaultLanguage, + Title = "About nopCommerce", + Short = "It's stable and highly usable. From downloads to documentation, www.nopCommerce.com offers a comprehensive base of information, resources, and support to the nopCommerce community.", + Full = "

For full feature list go to nopCommerce.com

Providing outstanding custom search engine optimization, web development services and e-commerce development solutions to our clients at a fair price in a professional manner.

", + Published = true, + CreatedOnUtc = DateTime.UtcNow, + }, + new NewsItem + { + AllowComments = true, + Language = defaultLanguage, + Title = "nopCommerce new release!", + Short = "nopCommerce includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included! nopCommerce is a fully customizable shopping cart", + Full = "

nopCommerce includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included!

", + Published = true, + CreatedOnUtc = DateTime.UtcNow.AddSeconds(1), + }, + new NewsItem + { + AllowComments = true, + Language = defaultLanguage, + Title = "New online store is open!", + Short = "The new nopCommerce store is open now! We are very excited to offer our new range of products. We will be constantly adding to our range so please register on our site.", + Full = "

Our online store is officially up and running. Stock up for the holiday season! We have a great selection of items. We will be constantly adding to our range so please register on our site, this will enable you to keep up to date with any new products.

All shipping is worldwide and will leave the same day an order is placed! Happy Shopping and spread the word!!

", + Published = true, + CreatedOnUtc = DateTime.UtcNow.AddSeconds(2), + }, + + }; + _newsItemRepository.Insert(news); + + //search engine names + foreach (var newsItem in news) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = newsItem.Id, + EntityName = "NewsItem", + LanguageId = newsItem.LanguageId, + IsActive = true, + Slug = newsItem.ValidateSeName("", newsItem.Title, true) + }); + } + + //comments + var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail); + if (defaultCustomer == null) + throw new Exception("Cannot load default customer"); + + //default store + var defaultStore = _storeRepository.Table.FirstOrDefault(); + if (defaultStore == null) + throw new Exception("No default store could be loaded"); + + foreach (var newsItem in news) + { + newsItem.NewsComments.Add(new NewsComment + { + NewsItemId = newsItem.Id, + CustomerId = defaultCustomer.Id, + CommentTitle = "Sample comment title", + CommentText = "This is a sample comment...", + IsApproved = true, + StoreId = defaultStore.Id, + CreatedOnUtc = DateTime.UtcNow + }); + } + _newsItemRepository.Update(news); + } + + protected virtual void InstallPolls() + { + var defaultLanguage = _languageRepository.Table.FirstOrDefault(); + var poll1 = new Poll + { + Language = defaultLanguage, + Name = "Do you like nopCommerce?", + SystemKeyword = "", + Published = true, + ShowOnHomePage = true, + DisplayOrder = 1, + }; + poll1.PollAnswers.Add(new PollAnswer + { + Name = "Excellent", + DisplayOrder = 1, + }); + poll1.PollAnswers.Add(new PollAnswer + { + Name = "Good", + DisplayOrder = 2, + }); + poll1.PollAnswers.Add(new PollAnswer + { + Name = "Poor", + DisplayOrder = 3, + }); + poll1.PollAnswers.Add(new PollAnswer + { + Name = "Very bad", + DisplayOrder = 4, + }); + _pollRepository.Insert(poll1); + } + + protected virtual void InstallActivityLogTypes() + { + var activityLogTypes = new List + { + //admin area activities + new ActivityLogType + { + SystemKeyword = "AddNewAddressAttribute", + Enabled = true, + Name = "Add a new address attribute" + }, + new ActivityLogType + { + SystemKeyword = "AddNewAddressAttributeValue", + Enabled = true, + Name = "Add a new address attribute value" + }, + new ActivityLogType + { + SystemKeyword = "AddNewAffiliate", + Enabled = true, + Name = "Add a new affiliate" + }, + new ActivityLogType + { + SystemKeyword = "AddNewBlogPost", + Enabled = true, + Name = "Add a new blog post" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCampaign", + Enabled = true, + Name = "Add a new campaign" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCategory", + Enabled = true, + Name = "Add a new category" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCheckoutAttribute", + Enabled = true, + Name = "Add a new checkout attribute" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCountry", + Enabled = true, + Name = "Add a new country" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCurrency", + Enabled = true, + Name = "Add a new currency" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCustomer", + Enabled = true, + Name = "Add a new customer" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCustomerAttribute", + Enabled = true, + Name = "Add a new customer attribute" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCustomerAttributeValue", + Enabled = true, + Name = "Add a new customer attribute value" + }, + new ActivityLogType + { + SystemKeyword = "AddNewCustomerRole", + Enabled = true, + Name = "Add a new customer role" + }, + new ActivityLogType + { + SystemKeyword = "AddCustomerRewardPoints", + Enabled = true, + Name = "Add customer reward points" + }, + new ActivityLogType + { + SystemKeyword = "AddNewDiscount", + Enabled = true, + Name = "Add a new discount" + }, + new ActivityLogType + { + SystemKeyword = "AddNewEmailAccount", + Enabled = true, + Name = "Add a new email account" + }, + new ActivityLogType + { + SystemKeyword = "AddNewGiftCard", + Enabled = true, + Name = "Add a new gift card" + }, + new ActivityLogType + { + SystemKeyword = "AddNewLanguage", + Enabled = true, + Name = "Add a new language" + }, + new ActivityLogType + { + SystemKeyword = "AddNewManufacturer", + Enabled = true, + Name = "Add a new manufacturer" + }, + new ActivityLogType + { + SystemKeyword = "AddNewMeasureDimension", + Enabled = true, + Name = "Add a new measure dimension" + }, + new ActivityLogType + { + SystemKeyword = "AddNewMeasureWeight", + Enabled = true, + Name = "Add a new measure weight" + }, + new ActivityLogType + { + SystemKeyword = "AddNewNews", + Enabled = true, + Name = "Add a new news" + }, + new ActivityLogType + { + SystemKeyword = "AddNewProduct", + Enabled = true, + Name = "Add a new product" + }, + new ActivityLogType + { + SystemKeyword = "AddNewProductAttribute", + Enabled = true, + Name = "Add a new product attribute" + }, + new ActivityLogType + { + SystemKeyword = "AddNewSetting", + Enabled = true, + Name = "Add a new setting" + }, + new ActivityLogType + { + SystemKeyword = "AddNewSpecAttribute", + Enabled = true, + Name = "Add a new specification attribute" + }, + new ActivityLogType + { + SystemKeyword = "AddNewStateProvince", + Enabled = true, + Name = "Add a new state or province" + }, + new ActivityLogType + { + SystemKeyword = "AddNewStore", + Enabled = true, + Name = "Add a new store" + }, + new ActivityLogType + { + SystemKeyword = "AddNewTopic", + Enabled = true, + Name = "Add a new topic" + }, + new ActivityLogType + { + SystemKeyword = "AddNewVendor", + Enabled = true, + Name = "Add a new vendor" + }, + new ActivityLogType + { + SystemKeyword = "AddNewWarehouse", + Enabled = true, + Name = "Add a new warehouse" + }, + new ActivityLogType + { + SystemKeyword = "AddNewWidget", + Enabled = true, + Name = "Add a new widget" + }, + new ActivityLogType + { + SystemKeyword = "DeleteActivityLog", + Enabled = true, + Name = "Delete activity log" + }, + new ActivityLogType + { + SystemKeyword = "DeleteAddressAttribute", + Enabled = true, + Name = "Delete an address attribute" + }, + new ActivityLogType + { + SystemKeyword = "DeleteAddressAttributeValue", + Enabled = true, + Name = "Delete an address attribute value" + }, + new ActivityLogType + { + SystemKeyword = "DeleteAffiliate", + Enabled = true, + Name = "Delete an affiliate" + }, + new ActivityLogType + { + SystemKeyword = "DeleteBlogPost", + Enabled = true, + Name = "Delete a blog post" + }, + new ActivityLogType + { + SystemKeyword = "DeleteBlogPostComment", + Enabled = true, + Name = "Delete a blog post comment" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCampaign", + Enabled = true, + Name = "Delete a campaign" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCategory", + Enabled = true, + Name = "Delete category" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCheckoutAttribute", + Enabled = true, + Name = "Delete a checkout attribute" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCountry", + Enabled = true, + Name = "Delete a country" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCurrency", + Enabled = true, + Name = "Delete a currency" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCustomer", + Enabled = true, + Name = "Delete a customer" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCustomerAttribute", + Enabled = true, + Name = "Delete a customer attribute" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCustomerAttributeValue", + Enabled = true, + Name = "Delete a customer attribute value" + }, + new ActivityLogType + { + SystemKeyword = "DeleteCustomerRole", + Enabled = true, + Name = "Delete a customer role" + }, + new ActivityLogType + { + SystemKeyword = "DeleteDiscount", + Enabled = true, + Name = "Delete a discount" + }, + new ActivityLogType + { + SystemKeyword = "DeleteEmailAccount", + Enabled = true, + Name = "Delete an email account" + }, + new ActivityLogType + { + SystemKeyword = "DeleteGiftCard", + Enabled = true, + Name = "Delete a gift card" + }, + new ActivityLogType + { + SystemKeyword = "DeleteLanguage", + Enabled = true, + Name = "Delete a language" + }, + new ActivityLogType + { + SystemKeyword = "DeleteManufacturer", + Enabled = true, + Name = "Delete a manufacturer" + }, + new ActivityLogType + { + SystemKeyword = "DeleteMeasureDimension", + Enabled = true, + Name = "Delete a measure dimension" + }, + new ActivityLogType + { + SystemKeyword = "DeleteMeasureWeight", + Enabled = true, + Name = "Delete a measure weight" + }, + new ActivityLogType + { + SystemKeyword = "DeleteMessageTemplate", + Enabled = true, + Name = "Delete a message template" + }, + new ActivityLogType + { + SystemKeyword = "DeleteNews", + Enabled = true, + Name = "Delete a news" + }, + new ActivityLogType + { + SystemKeyword = "DeleteNewsComment", + Enabled = true, + Name = "Delete a news comment" + }, + new ActivityLogType + { + SystemKeyword = "DeleteOrder", + Enabled = true, + Name = "Delete an order" + }, + new ActivityLogType + { + SystemKeyword = "DeleteProduct", + Enabled = true, + Name = "Delete a product" + }, + new ActivityLogType + { + SystemKeyword = "DeleteProductAttribute", + Enabled = true, + Name = "Delete a product attribute" + }, + new ActivityLogType + { + SystemKeyword = "DeleteProductReview", + Enabled = true, + Name = "Delete a product review" + }, + new ActivityLogType + { + SystemKeyword = "DeleteReturnRequest", + Enabled = true, + Name = "Delete a return request" + }, + new ActivityLogType + { + SystemKeyword = "DeleteSetting", + Enabled = true, + Name = "Delete a setting" + }, + new ActivityLogType + { + SystemKeyword = "DeleteSpecAttribute", + Enabled = true, + Name = "Delete a specification attribute" + }, + new ActivityLogType + { + SystemKeyword = "DeleteStateProvince", + Enabled = true, + Name = "Delete a state or province" + }, + new ActivityLogType + { + SystemKeyword = "DeleteStore", + Enabled = true, + Name = "Delete a store" + }, + new ActivityLogType + { + SystemKeyword = "DeleteTopic", + Enabled = true, + Name = "Delete a topic" + }, + new ActivityLogType + { + SystemKeyword = "DeleteVendor", + Enabled = true, + Name = "Delete a vendor" + }, + new ActivityLogType + { + SystemKeyword = "DeleteWarehouse", + Enabled = true, + Name = "Delete a warehouse" + }, + new ActivityLogType + { + SystemKeyword = "DeleteWidget", + Enabled = true, + Name = "Delete a widget" + }, + new ActivityLogType + { + SystemKeyword = "EditActivityLogTypes", + Enabled = true, + Name = "Edit activity log types" + }, + new ActivityLogType + { + SystemKeyword = "EditAddressAttribute", + Enabled = true, + Name = "Edit an address attribute" + }, + new ActivityLogType + { + SystemKeyword = "EditAddressAttributeValue", + Enabled = true, + Name = "Edit an address attribute value" + }, + new ActivityLogType + { + SystemKeyword = "EditAffiliate", + Enabled = true, + Name = "Edit an affiliate" + }, + new ActivityLogType + { + SystemKeyword = "EditBlogPost", + Enabled = true, + Name = "Edit a blog post" + }, + new ActivityLogType + { + SystemKeyword = "EditCampaign", + Enabled = true, + Name = "Edit a campaign" + }, + new ActivityLogType + { + SystemKeyword = "EditCategory", + Enabled = true, + Name = "Edit category" + }, + new ActivityLogType + { + SystemKeyword = "EditCheckoutAttribute", + Enabled = true, + Name = "Edit a checkout attribute" + }, + new ActivityLogType + { + SystemKeyword = "EditCountry", + Enabled = true, + Name = "Edit a country" + }, + new ActivityLogType + { + SystemKeyword = "EditCurrency", + Enabled = true, + Name = "Edit a currency" + }, + new ActivityLogType + { + SystemKeyword = "EditCustomer", + Enabled = true, + Name = "Edit a customer" + }, + new ActivityLogType + { + SystemKeyword = "EditCustomerAttribute", + Enabled = true, + Name = "Edit a customer attribute" + }, + new ActivityLogType + { + SystemKeyword = "EditCustomerAttributeValue", + Enabled = true, + Name = "Edit a customer attribute value" + }, + new ActivityLogType + { + SystemKeyword = "EditCustomerRole", + Enabled = true, + Name = "Edit a customer role" + }, + new ActivityLogType + { + SystemKeyword = "EditCustomerRewardPoints", + Enabled = true, + Name = "Edit customer reward points" + }, + new ActivityLogType + { + SystemKeyword = "EditDiscount", + Enabled = true, + Name = "Edit a discount" + }, + new ActivityLogType + { + SystemKeyword = "EditEmailAccount", + Enabled = true, + Name = "Edit an email account" + }, + new ActivityLogType + { + SystemKeyword = "EditGiftCard", + Enabled = true, + Name = "Edit a gift card" + }, + new ActivityLogType + { + SystemKeyword = "EditLanguage", + Enabled = true, + Name = "Edit a language" + }, + new ActivityLogType + { + SystemKeyword = "EditManufacturer", + Enabled = true, + Name = "Edit a manufacturer" + }, + new ActivityLogType + { + SystemKeyword = "EditMeasureDimension", + Enabled = true, + Name = "Edit a measure dimension" + }, + new ActivityLogType + { + SystemKeyword = "EditMeasureWeight", + Enabled = true, + Name = "Edit a measure weight" + }, + new ActivityLogType + { + SystemKeyword = "EditMessageTemplate", + Enabled = true, + Name = "Edit a message template" + }, + new ActivityLogType + { + SystemKeyword = "EditNews", + Enabled = true, + Name = "Edit a news" + }, + new ActivityLogType + { + SystemKeyword = "EditOrder", + Enabled = true, + Name = "Edit an order" + }, + new ActivityLogType + { + SystemKeyword = "EditPlugin", + Enabled = true, + Name = "Edit a plugin" + }, + new ActivityLogType + { + SystemKeyword = "EditProduct", + Enabled = true, + Name = "Edit a product" + }, + new ActivityLogType + { + SystemKeyword = "EditProductAttribute", + Enabled = true, + Name = "Edit a product attribute" + }, + new ActivityLogType + { + SystemKeyword = "EditProductReview", + Enabled = true, + Name = "Edit a product review" + }, + new ActivityLogType + { + SystemKeyword = "EditPromotionProviders", + Enabled = true, + Name = "Edit promotion providers" + }, + new ActivityLogType + { + SystemKeyword = "EditReturnRequest", + Enabled = true, + Name = "Edit a return request" + }, + new ActivityLogType + { + SystemKeyword = "EditSettings", + Enabled = true, + Name = "Edit setting(s)" + }, + new ActivityLogType + { + SystemKeyword = "EditStateProvince", + Enabled = true, + Name = "Edit a state or province" + }, + new ActivityLogType + { + SystemKeyword = "EditStore", + Enabled = true, + Name = "Edit a store" + }, + new ActivityLogType + { + SystemKeyword = "EditTask", + Enabled = true, + Name = "Edit a task" + }, + new ActivityLogType + { + SystemKeyword = "EditSpecAttribute", + Enabled = true, + Name = "Edit a specification attribute" + }, + new ActivityLogType + { + SystemKeyword = "EditVendor", + Enabled = true, + Name = "Edit a vendor" + }, + new ActivityLogType + { + SystemKeyword = "EditWarehouse", + Enabled = true, + Name = "Edit a warehouse" + }, + new ActivityLogType + { + SystemKeyword = "EditTopic", + Enabled = true, + Name = "Edit a topic" + }, + new ActivityLogType + { + SystemKeyword = "EditWidget", + Enabled = true, + Name = "Edit a widget" + }, + new ActivityLogType + { + SystemKeyword = "Impersonation.Started", + Enabled = true, + Name = "Customer impersonation session. Started" + }, + new ActivityLogType + { + SystemKeyword = "Impersonation.Finished", + Enabled = true, + Name = "Customer impersonation session. Finished" + }, + new ActivityLogType + { + SystemKeyword = "ImportCategories", + Enabled = true, + Name = "Categories were imported" + }, + new ActivityLogType + { + SystemKeyword = "ImportManufacturers", + Enabled = true, + Name = "Manufacturers were imported" + }, + new ActivityLogType + { + SystemKeyword = "ImportProducts", + Enabled = true, + Name = "Products were imported" + }, + new ActivityLogType + { + SystemKeyword = "ImportStates", + Enabled = true, + Name = "States were imported" + }, + new ActivityLogType + { + SystemKeyword = "InstallNewPlugin", + Enabled = true, + Name = "Install a new plugin" + }, + new ActivityLogType + { + SystemKeyword = "UninstallPlugin", + Enabled = true, + Name = "Uninstall a plugin" + }, + //public store activities + new ActivityLogType + { + SystemKeyword = "PublicStore.ViewCategory", + Enabled = false, + Name = "Public store. View a category" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.ViewManufacturer", + Enabled = false, + Name = "Public store. View a manufacturer" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.ViewProduct", + Enabled = false, + Name = "Public store. View a product" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.PlaceOrder", + Enabled = false, + Name = "Public store. Place an order" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.SendPM", + Enabled = false, + Name = "Public store. Send PM" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.ContactUs", + Enabled = false, + Name = "Public store. Use contact us form" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddToCompareList", + Enabled = false, + Name = "Public store. Add to compare list" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddToShoppingCart", + Enabled = false, + Name = "Public store. Add to shopping cart" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddToWishlist", + Enabled = false, + Name = "Public store. Add to wishlist" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.Login", + Enabled = false, + Name = "Public store. Login" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.Logout", + Enabled = false, + Name = "Public store. Logout" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddProductReview", + Enabled = false, + Name = "Public store. Add product review" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddNewsComment", + Enabled = false, + Name = "Public store. Add news comment" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddBlogComment", + Enabled = false, + Name = "Public store. Add blog comment" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddForumTopic", + Enabled = false, + Name = "Public store. Add forum topic" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.EditForumTopic", + Enabled = false, + Name = "Public store. Edit forum topic" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.DeleteForumTopic", + Enabled = false, + Name = "Public store. Delete forum topic" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.AddForumPost", + Enabled = false, + Name = "Public store. Add forum post" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.EditForumPost", + Enabled = false, + Name = "Public store. Edit forum post" + }, + new ActivityLogType + { + SystemKeyword = "PublicStore.DeleteForumPost", + Enabled = false, + Name = "Public store. Delete forum post" + } + }; + _activityLogTypeRepository.Insert(activityLogTypes); + } + + protected virtual void InstallProductTemplates() + { + var productTemplates = new List + { + new ProductTemplate + { + Name = "Simple product", + ViewPath = "ProductTemplate.Simple", + DisplayOrder = 10, + IgnoredProductTypes = ((int)ProductType.GroupedProduct).ToString() + }, + new ProductTemplate + { + Name = "Grouped product (with variants)", + ViewPath = "ProductTemplate.Grouped", + DisplayOrder = 100, + IgnoredProductTypes = ((int)ProductType.SimpleProduct).ToString() + } + }; + _productTemplateRepository.Insert(productTemplates); + } + + protected virtual void InstallCategoryTemplates() + { + var categoryTemplates = new List + { + new CategoryTemplate + { + Name = "Products in Grid or Lines", + ViewPath = "CategoryTemplate.ProductsInGridOrLines", + DisplayOrder = 1 + }, + }; + _categoryTemplateRepository.Insert(categoryTemplates); + } + + protected virtual void InstallManufacturerTemplates() + { + var manufacturerTemplates = new List + { + new ManufacturerTemplate + { + Name = "Products in Grid or Lines", + ViewPath = "ManufacturerTemplate.ProductsInGridOrLines", + DisplayOrder = 1 + }, + }; + _manufacturerTemplateRepository.Insert(manufacturerTemplates); + } + + protected virtual void InstallTopicTemplates() + { + var topicTemplates = new List + { + new TopicTemplate + { + Name = "Default template", + ViewPath = "TopicDetails", + DisplayOrder = 1 + }, + }; + _topicTemplateRepository.Insert(topicTemplates); + } + + protected virtual void InstallScheduleTasks() + { + var tasks = new List + { + new ScheduleTask + { + Name = "Send emails", + Seconds = 60, + Type = "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services", + Enabled = true, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Keep alive", + Seconds = 300, + Type = "Nop.Services.Common.KeepAliveTask, Nop.Services", + Enabled = true, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Delete guests", + Seconds = 600, + Type = "Nop.Services.Customers.DeleteGuestsTask, Nop.Services", + Enabled = true, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Clear cache", + Seconds = 600, + Type = "Nop.Services.Caching.ClearCacheTask, Nop.Services", + Enabled = false, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Clear log", + //60 minutes + Seconds = 3600, + Type = "Nop.Services.Logging.ClearLogTask, Nop.Services", + Enabled = false, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Update currency exchange rates", + //60 minutes + Seconds = 3600, + Type = "Nop.Services.Directory.UpdateExchangeRateTask, Nop.Services", + Enabled = true, + StopOnError = false, + }, + new ScheduleTask + { + Name = "Assign invoice ident", + //60 minutes + Seconds = 60, + Type = "Nop.Services.Orders.AssignInvoiceIdentTask, Nop.Services", + Enabled = false, + StopOnError = false, + }, + }; + + _scheduleTaskRepository.Insert(tasks); + } + + protected virtual void InstallReturnRequestReasons() + { + var returnRequestReasons = new List + { + new ReturnRequestReason + { + Name = "Received Wrong Product", + DisplayOrder = 1 + }, + new ReturnRequestReason + { + Name = "Wrong Product Ordered", + DisplayOrder = 2 + }, + new ReturnRequestReason + { + Name = "There Was A Problem With The Product", + DisplayOrder = 3 + } + }; + _returnRequestReasonRepository.Insert(returnRequestReasons); + } + protected virtual void InstallReturnRequestActions() + { + var returnRequestActions = new List + { + new ReturnRequestAction + { + Name = "Repair", + DisplayOrder = 1 + }, + new ReturnRequestAction + { + Name = "Replacement", + DisplayOrder = 2 + }, + new ReturnRequestAction + { + Name = "Store Credit", + DisplayOrder = 3 + } + }; + _returnRequestActionRepository.Insert(returnRequestActions); + } + + protected virtual void InstallWarehouses() + { + var warehouse1address = new Address + { + Address1 = "21 West 52nd Street", + City = "New York", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + ZipPostalCode = "10021", + CreatedOnUtc = DateTime.UtcNow, + }; + _addressRepository.Insert(warehouse1address); + var warehouse2address = new Address + { + Address1 = "300 South Spring Stree", + City = "Los Angeles", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "California"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + ZipPostalCode = "90013", + CreatedOnUtc = DateTime.UtcNow, + }; + _addressRepository.Insert(warehouse2address); + var warehouses = new List + { + new Warehouse + { + Name = "Warehouse 1 (New York)", + AddressId = warehouse1address.Id + }, + new Warehouse + { + Name = "Warehouse 2 (Los Angeles)", + AddressId = warehouse2address.Id + } + }; + + _warehouseRepository.Insert(warehouses); + } + + protected virtual void InstallVendors() + { + var vendors = new List + { + new Vendor + { + Name = "Vendor 1", + Email = "vendor1email@gmail.com", + Description = "Some description...", + AdminComment = "", + PictureId = 0, + Active = true, + DisplayOrder = 1, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9, 18", + }, + new Vendor + { + Name = "Vendor 2", + Email = "vendor2email@gmail.com", + Description = "Some description...", + AdminComment = "", + PictureId = 0, + Active = true, + DisplayOrder = 2, + PageSize = 6, + AllowCustomersToSelectPageSize = true, + PageSizeOptions = "6, 3, 9, 18", + } + }; + + _vendorRepository.Insert(vendors); + + //search engine names + foreach (var vendor in vendors) + { + _urlRecordRepository.Insert(new UrlRecord + { + EntityId = vendor.Id, + EntityName = "Vendor", + LanguageId = 0, + IsActive = true, + Slug = vendor.ValidateSeName("", vendor.Name, true) + }); + } + } + + protected virtual void InstallAffiliates() + { + var affiliateAddress = new Address + { + FirstName = "John", + LastName = "Smith", + Email = "affiliate_email@gmail.com", + Company = "Company name here...", + City = "New York", + Address1 = "21 West 52nd Street", + ZipPostalCode = "10021", + PhoneNumber = "123456789", + StateProvince = _stateProvinceRepository.Table.FirstOrDefault(sp => sp.Name == "New York"), + Country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA"), + CreatedOnUtc = DateTime.UtcNow, + }; + _addressRepository.Insert(affiliateAddress); + var affilate = new Affiliate + { + Active = true, + Address = affiliateAddress + }; + _affiliateRepository.Insert(affilate); + } + + private void AddProductTag(Product product, string tag) + { + var productTag = _productTagRepository.Table.FirstOrDefault(pt => pt.Name == tag); + if (productTag == null) + { + productTag = new ProductTag + { + Name = tag, + }; + } + product.ProductTags.Add(productTag); + _productRepository.Update(product); + } + + #endregion + + #region Methods + + public virtual void InstallData(string defaultUserEmail, + string defaultUserPassword, bool installSampleData = true) + { + InstallStores(); + InstallMeasures(); + InstallTaxCategories(); + InstallLanguages(); + InstallCurrencies(); + InstallCountriesAndStates(); + InstallShippingMethods(); + InstallDeliveryDates(); + InstallProductAvailabilityRanges(); + InstallCustomersAndUsers(defaultUserEmail, defaultUserPassword); + InstallEmailAccounts(); + InstallMessageTemplates(); + InstallSettings(installSampleData); + InstallTopicTemplates(); + InstallTopics(); + InstallLocaleResources(); + InstallActivityLogTypes(); + InstallProductTemplates(); + InstallCategoryTemplates(); + InstallManufacturerTemplates(); + InstallScheduleTasks(); + InstallReturnRequestReasons(); + InstallReturnRequestActions(); + + if (installSampleData) + { + InstallCheckoutAttributes(); + InstallSpecificationAttributes(); + InstallProductAttributes(); + InstallCategories(); + InstallManufacturers(); + InstallProducts(defaultUserEmail); + InstallForums(); + InstallDiscounts(); + InstallBlogPosts(defaultUserEmail); + InstallNews(defaultUserEmail); + InstallPolls(); + InstallWarehouses(); + InstallVendors(); + InstallAffiliates(); + InstallOrders(); + InstallActivityLog(defaultUserEmail); + InstallSearchTerms(); + } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Messages/MessageTokenProvider.cs b/src/Libraries/Nop.Services/Messages/MessageTokenProvider.cs index 876a32dddbe..e3bd8d63cc9 100644 --- a/src/Libraries/Nop.Services/Messages/MessageTokenProvider.cs +++ b/src/Libraries/Nop.Services/Messages/MessageTokenProvider.cs @@ -1,1341 +1,1374 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Web; -using Nop.Core; -using Nop.Core.Domain; -using Nop.Core.Domain.Blogs; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Forums; -using Nop.Core.Domain.Messages; -using Nop.Core.Domain.News; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Stores; -using Nop.Core.Domain.Tax; -using Nop.Core.Domain.Vendors; -using Nop.Core.Html; -using Nop.Core.Infrastructure; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Events; -using Nop.Services.Forums; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Media; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Seo; -using Nop.Services.Shipping; -using Nop.Services.Shipping.Tracking; -using Nop.Services.Stores; - -namespace Nop.Services.Messages -{ - public partial class MessageTokenProvider : IMessageTokenProvider - { - #region Fields - - private readonly ILanguageService _languageService; - private readonly ILocalizationService _localizationService; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly IPriceFormatter _priceFormatter; - private readonly ICurrencyService _currencyService; - private readonly IWorkContext _workContext; - private readonly IDownloadService _downloadService; - private readonly IOrderService _orderService; - private readonly IPaymentService _paymentService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IAddressAttributeFormatter _addressAttributeFormatter; - private readonly ICustomerAttributeFormatter _customerAttributeFormatter; - private readonly IStoreService _storeService; - private readonly IStoreContext _storeContext; - - private readonly MessageTemplatesSettings _templatesSettings; - private readonly CatalogSettings _catalogSettings; - private readonly TaxSettings _taxSettings; - private readonly CurrencySettings _currencySettings; - private readonly ShippingSettings _shippingSettings; - private readonly PaymentSettings _paymentSettings; - - private readonly IEventPublisher _eventPublisher; - private readonly StoreInformationSettings _storeInformationSettings; - - #endregion - - #region Ctor - - public MessageTokenProvider(ILanguageService languageService, - ILocalizationService localizationService, - IDateTimeHelper dateTimeHelper, - IPriceFormatter priceFormatter, - ICurrencyService currencyService, - IWorkContext workContext, - IDownloadService downloadService, - IOrderService orderService, - IPaymentService paymentService, - IStoreService storeService, - IStoreContext storeContext, - IProductAttributeParser productAttributeParser, - IAddressAttributeFormatter addressAttributeFormatter, - ICustomerAttributeFormatter customerAttributeFormatter, - MessageTemplatesSettings templatesSettings, - CatalogSettings catalogSettings, - TaxSettings taxSettings, - CurrencySettings currencySettings, - ShippingSettings shippingSettings, - PaymentSettings paymentSettings, - IEventPublisher eventPublisher, - StoreInformationSettings storeInformationSettings) - { - this._languageService = languageService; - this._localizationService = localizationService; - this._dateTimeHelper = dateTimeHelper; - this._priceFormatter = priceFormatter; - this._currencyService = currencyService; - this._workContext = workContext; - this._downloadService = downloadService; - this._orderService = orderService; - this._paymentService = paymentService; - this._productAttributeParser = productAttributeParser; - this._addressAttributeFormatter = addressAttributeFormatter; - this._customerAttributeFormatter = customerAttributeFormatter; - this._storeService = storeService; - this._storeContext = storeContext; - - this._templatesSettings = templatesSettings; - this._catalogSettings = catalogSettings; - this._taxSettings = taxSettings; - this._currencySettings = currencySettings; - this._shippingSettings = shippingSettings; - this._paymentSettings = paymentSettings; - this._eventPublisher = eventPublisher; - this._storeInformationSettings = storeInformationSettings; - } - - #endregion - - #region Allowed tokens - - private Dictionary> _allowedTokens; - /// - /// Get all available tokens by token groups - /// - protected Dictionary> AllowedTokens - { - get - { - if (_allowedTokens != null) - return _allowedTokens; - - _allowedTokens = new Dictionary>(); - - //store tokens - _allowedTokens.Add(TokenGroupNames.StoreTokens, new[] - { - "%Store.Name%", - "%Store.URL%", - "%Store.Email%", - "%Store.CompanyName%", - "%Store.CompanyAddress%", - "%Store.CompanyPhoneNumber%", - "%Store.CompanyVat%", - "%Facebook.URL%", - "%Twitter.URL%", - "%YouTube.URL%", - "%GooglePlus.URL%" - }); - - //customer tokens - _allowedTokens.Add(TokenGroupNames.CustomerTokens, new[] - { - "%Customer.Email%", - "%Customer.Username%", - "%Customer.FullName%", - "%Customer.FirstName%", - "%Customer.LastName%", - "%Customer.VatNumber%", - "%Customer.VatNumberStatus%", - "%Customer.CustomAttributes%", - "%Customer.PasswordRecoveryURL%", - "%Customer.AccountActivationURL%", - "%Customer.EmailRevalidationURL%", - "%Wishlist.URLForCustomer%" - }); - - //order tokens - _allowedTokens.Add(TokenGroupNames.OrderTokens, new[] - { - "%Order.OrderNumber%", - "%Order.CustomerFullName%", - "%Order.CustomerEmail%", - "%Order.BillingFirstName%", - "%Order.BillingLastName%", - "%Order.BillingPhoneNumber%", - "%Order.BillingEmail%", - "%Order.BillingFaxNumber%", - "%Order.BillingCompany%", - "%Order.BillingAddress1%", - "%Order.BillingAddress2%", - "%Order.BillingCity%", - "%Order.BillingStateProvince%", - "%Order.BillingZipPostalCode%", - "%Order.BillingCountry%", - "%Order.BillingCustomAttributes%", - "%Order.Shippable%", - "%Order.ShippingMethod%", - "%Order.ShippingFirstName%", - "%Order.ShippingLastName%", - "%Order.ShippingPhoneNumber%", - "%Order.ShippingEmail%", - "%Order.ShippingFaxNumber%", - "%Order.ShippingCompany%", - "%Order.ShippingAddress1%", - "%Order.ShippingAddress2%", - "%Order.ShippingCity%", - "%Order.ShippingStateProvince%", - "%Order.ShippingZipPostalCode%", - "%Order.ShippingCountry%", - "%Order.ShippingCustomAttributes%", - "%Order.PaymentMethod%", - "%Order.VatNumber%", - "%Order.CustomValues%", - "%Order.Product(s)%", - "%Order.CreatedOn%", - "%Order.OrderURLForCustomer%" - }); - - //shipment tokens - _allowedTokens.Add(TokenGroupNames.ShipmentTokens, new[] - { - "%Shipment.ShipmentNumber%", - "%Shipment.TrackingNumber%", - "%Shipment.TrackingNumberURL%", - "%Shipment.Product(s)%", - "%Shipment.URLForCustomer%" - }); - - //refunded order tokens - _allowedTokens.Add(TokenGroupNames.RefundedOrderTokens, new[] - { - "%Order.AmountRefunded%" - }); - - //order note tokens - _allowedTokens.Add(TokenGroupNames.OrderNoteTokens, new[] - { - "%Order.NewNoteText%", - "%Order.OrderNoteAttachmentUrl%" - }); - - //recurring payment tokens - _allowedTokens.Add(TokenGroupNames.RecurringPaymentTokens, new[] - { - "%RecurringPayment.ID%", - "%RecurringPayment.CancelAfterFailedPayment%", - "%RecurringPayment.RecurringPaymentType%" - }); - - //newsletter subscription tokens - _allowedTokens.Add(TokenGroupNames.SubscriptionTokens, new[] - { - "%NewsLetterSubscription.Email%", - "%NewsLetterSubscription.ActivationUrl%", - "%NewsLetterSubscription.DeactivationUrl%" - }); - - //product tokens - _allowedTokens.Add(TokenGroupNames.ProductTokens, new[] - { - "%Product.ID%", - "%Product.Name%", - "%Product.ShortDescription%", - "%Product.ProductURLForCustomer%", - "%Product.SKU%", - "%Product.StockQuantity%" - }); - - //return request tokens - _allowedTokens.Add(TokenGroupNames.ReturnRequestTokens, new[] - { - "%ReturnRequest.CustomNumber%", - "%ReturnRequest.OrderId%", - "%ReturnRequest.Product.Quantity%", - "%ReturnRequest.Product.Name%", - "%ReturnRequest.Reason%", - "%ReturnRequest.RequestedAction%", - "%ReturnRequest.CustomerComment%", - "%ReturnRequest.StaffNotes%", - "%ReturnRequest.Status%" - }); - - //forum tokens - _allowedTokens.Add(TokenGroupNames.ForumTokens, new[] - { - "%Forums.ForumURL%", - "%Forums.ForumName%" - }); - - //forum topic tokens - _allowedTokens.Add(TokenGroupNames.ForumTopicTokens, new[] - { - "%Forums.TopicURL%", - "%Forums.TopicName%" - }); - - //forum post tokens - _allowedTokens.Add(TokenGroupNames.ForumPostTokens, new[] - { - "%Forums.PostAuthor%", - "%Forums.PostBody%" - }); - - //private message tokens - _allowedTokens.Add(TokenGroupNames.PrivateMessageTokens, new[] - { - "%PrivateMessage.Subject%", - "%PrivateMessage.Text%" - }); - - //vendor tokens - _allowedTokens.Add(TokenGroupNames.VendorTokens, new[] - { - "%Vendor.Name%", - "%Vendor.Email%" - }); - - //gift card tokens - _allowedTokens.Add(TokenGroupNames.GiftCardTokens, new[] - { - "%GiftCard.SenderName%", - "%GiftCard.SenderEmail%", - "%GiftCard.RecipientName%", - "%GiftCard.RecipientEmail%", - "%GiftCard.Amount%", - "%GiftCard.CouponCode%", - "%GiftCard.Message%" - }); - - //product review tokens - _allowedTokens.Add(TokenGroupNames.ProductReviewTokens, new[] - { - "%ProductReview.ProductName%" - }); - - //attribute combination tokens - _allowedTokens.Add(TokenGroupNames.AttributeCombinationTokens, new[] - { - "%AttributeCombination.Formatted%", - "%AttributeCombination.SKU%", - "%AttributeCombination.StockQuantity%" - }); - - //blog comment tokens - _allowedTokens.Add(TokenGroupNames.BlogCommentTokens, new[] - { - "%BlogComment.BlogPostTitle%" - }); - - //news comment tokens - _allowedTokens.Add(TokenGroupNames.NewsCommentTokens, new[] - { - "%NewsComment.NewsTitle%" - }); - - //product back in stock tokens - _allowedTokens.Add(TokenGroupNames.ProductBackInStockTokens, new[] - { - "%BackInStockSubscription.ProductName%", - "%BackInStockSubscription.ProductUrl%" - }); - - //email a friend tokens - _allowedTokens.Add(TokenGroupNames.EmailAFriendTokens, new[] - { - "%EmailAFriend.PersonalMessage%", - "%EmailAFriend.Email%" - }); - - //wishlist to friend tokens - _allowedTokens.Add(TokenGroupNames.WishlistToFriendTokens, new[] - { - "%Wishlist.PersonalMessage%", - "%Wishlist.Email%" - }); - - //VAT validation tokens - _allowedTokens.Add(TokenGroupNames.VatValidation, new[] - { - "%VatValidationResult.Name%", - "%VatValidationResult.Address%" - }); - - //contact us tokens - _allowedTokens.Add(TokenGroupNames.ContactUs, new[] - { - "%ContactUs.SenderEmail%", - "%ContactUs.SenderName%", - "%ContactUs.Body%" - }); - - //contact vendor tokens - _allowedTokens.Add(TokenGroupNames.ContactVendor, new[] - { - "%ContactUs.SenderEmail%", - "%ContactUs.SenderName%", - "%ContactUs.Body%" - }); - - return _allowedTokens; - } - } - - #endregion - - #region Utilities - - /// - /// Convert a collection to a HTML table - /// - /// Order - /// Language identifier - /// Vendor identifier (used to limit products by vendor - /// HTML table of products - protected virtual string ProductListToHtmlTable(Order order, int languageId, int vendorId) - { - string result; - - var language = _languageService.GetLanguageById(languageId); - - var sb = new StringBuilder(); - sb.AppendLine(""); - - #region Products - sb.AppendLine(string.Format("", _templatesSettings.Color1)); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Name", languageId))); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Price", languageId))); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Quantity", languageId))); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Total", languageId))); - sb.AppendLine(""); - - var table = order.OrderItems.ToList(); - for (int i = 0; i <= table.Count - 1; i++) - { - var orderItem = table[i]; - var product = orderItem.Product; - if (product == null) - continue; - - if (vendorId > 0 && product.VendorId != vendorId) - continue; - - sb.AppendLine(string.Format("", _templatesSettings.Color2)); - //product name - string productName = product.GetLocalized(x => x.Name, languageId); - - sb.AppendLine(""); - - string unitPriceStr; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate); - unitPriceStr = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - } - else - { - //excluding tax - var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate); - unitPriceStr = _priceFormatter.FormatPrice(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - } - sb.AppendLine(string.Format("", unitPriceStr)); - - sb.AppendLine(string.Format("", orderItem.Quantity)); - - string priceStr; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); - priceStr = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - } - else - { - //excluding tax - var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate); - priceStr = _priceFormatter.FormatPrice(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - } - sb.AppendLine(string.Format("", priceStr)); - - sb.AppendLine(""); - } - #endregion - - if (vendorId == 0) - { - //we render checkout attributes and totals only for store owners (hide for vendors) - - #region Checkout Attributes - - if (!String.IsNullOrEmpty(order.CheckoutAttributeDescription)) - { - sb.AppendLine(""); - } - - #endregion - - #region Totals - - //subtotal - string cusSubTotal; - bool displaySubTotalDiscount = false; - string cusSubTotalDiscount = string.Empty; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) - { - //including tax - - //subtotal - var orderSubtotalInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalInclTax, order.CurrencyRate); - cusSubTotal = _priceFormatter.FormatPrice(orderSubtotalInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - //discount (applied to order subtotal) - var orderSubTotalDiscountInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountInclTax, order.CurrencyRate); - if (orderSubTotalDiscountInclTaxInCustomerCurrency > decimal.Zero) - { - cusSubTotalDiscount = _priceFormatter.FormatPrice(-orderSubTotalDiscountInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - displaySubTotalDiscount = true; - } - } - else - { - //exсluding tax - - //subtotal - var orderSubtotalExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalExclTax, order.CurrencyRate); - cusSubTotal = _priceFormatter.FormatPrice(orderSubtotalExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - //discount (applied to order subtotal) - var orderSubTotalDiscountExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountExclTax, order.CurrencyRate); - if (orderSubTotalDiscountExclTaxInCustomerCurrency > decimal.Zero) - { - cusSubTotalDiscount = _priceFormatter.FormatPrice(-orderSubTotalDiscountExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - displaySubTotalDiscount = true; - } - } - - //shipping, payment method fee - string cusShipTotal; - string cusPaymentMethodAdditionalFee; - var taxRates = new SortedDictionary(); - string cusTaxTotal = string.Empty; - string cusDiscount = string.Empty; - string cusTotal; - if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - //including tax - - //shipping - var orderShippingInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingInclTax, order.CurrencyRate); - cusShipTotal = _priceFormatter.FormatShippingPrice(orderShippingInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - //payment method additional fee - var paymentMethodAdditionalFeeInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeInclTax, order.CurrencyRate); - cusPaymentMethodAdditionalFee = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); - } - else - { - //excluding tax - - //shipping - var orderShippingExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingExclTax, order.CurrencyRate); - cusShipTotal = _priceFormatter.FormatShippingPrice(orderShippingExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - //payment method additional fee - var paymentMethodAdditionalFeeExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeExclTax, order.CurrencyRate); - cusPaymentMethodAdditionalFee = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); - } - - //shipping - bool displayShipping = order.ShippingStatus != ShippingStatus.ShippingNotRequired; - - //payment method fee - bool displayPaymentMethodFee = order.PaymentMethodAdditionalFeeExclTax > decimal.Zero; - - //tax - bool displayTax = true; - bool displayTaxRates = true; - if (_taxSettings.HideTaxInOrderSummary && order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) - { - displayTax = false; - displayTaxRates = false; - } - else - { - if (order.OrderTax == 0 && _taxSettings.HideZeroTax) - { - displayTax = false; - displayTaxRates = false; - } - else - { - taxRates = new SortedDictionary(); - foreach (var tr in order.TaxRatesDictionary) - taxRates.Add(tr.Key, _currencyService.ConvertCurrency(tr.Value, order.CurrencyRate)); - - displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); - displayTax = !displayTaxRates; - - var orderTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTax, order.CurrencyRate); - string taxStr = _priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); - cusTaxTotal = taxStr; - } - } - - //discount - bool displayDiscount = false; - if (order.OrderDiscount > decimal.Zero) - { - var orderDiscountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderDiscount, order.CurrencyRate); - cusDiscount = _priceFormatter.FormatPrice(-orderDiscountInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); - displayDiscount = true; - } - - //total - var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); - cusTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); - - - - - //subtotal - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.SubTotal", languageId), cusSubTotal)); - - //discount (applied to order subtotal) - if (displaySubTotalDiscount) - { - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.SubTotalDiscount", languageId), cusSubTotalDiscount)); - } - - - //shipping - if (displayShipping) - { - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.Shipping", languageId), cusShipTotal)); - } - - //payment method fee - if (displayPaymentMethodFee) - { - string paymentMethodFeeTitle = _localizationService.GetResource("Messages.Order.PaymentMethodAdditionalFee", languageId); - sb.AppendLine(string.Format("", _templatesSettings.Color3, paymentMethodFeeTitle, cusPaymentMethodAdditionalFee)); - } - - //tax - if (displayTax) - { - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.Tax", languageId), cusTaxTotal)); - } - if (displayTaxRates) - { - foreach (var item in taxRates) - { - string taxRate = String.Format(_localizationService.GetResource("Messages.Order.TaxRateLine"), _priceFormatter.FormatTaxRate(item.Key)); - string taxValue = _priceFormatter.FormatPrice(item.Value, true, order.CustomerCurrencyCode, false, language); - sb.AppendLine(string.Format("", _templatesSettings.Color3, taxRate, taxValue)); - } - } - - //discount - if (displayDiscount) - { - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.TotalDiscount", languageId), cusDiscount)); - } - - //gift cards - var gcuhC = order.GiftCardUsageHistory; - foreach (var gcuh in gcuhC) - { - string giftCardText = String.Format(_localizationService.GetResource("Messages.Order.GiftCardInfo", languageId), HttpUtility.HtmlEncode(gcuh.GiftCard.GiftCardCouponCode)); - string giftCardAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(gcuh.UsedValue, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, language); - sb.AppendLine(string.Format("", _templatesSettings.Color3, giftCardText, giftCardAmount)); - } - - //reward points - if (order.RedeemedRewardPointsEntry != null) - { - string rpTitle = string.Format(_localizationService.GetResource("Messages.Order.RewardPoints", languageId), -order.RedeemedRewardPointsEntry.Points); - string rpAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(order.RedeemedRewardPointsEntry.UsedAmount, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, language); - sb.AppendLine(string.Format("", _templatesSettings.Color3, rpTitle, rpAmount)); - } - - //total - sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.OrderTotal", languageId), cusTotal)); - #endregion - - } - - sb.AppendLine("
{0}{0}{0}{0}
" + HttpUtility.HtmlEncode(productName)); - //add download link - if (_downloadService.IsDownloadAllowed(orderItem)) - { - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - string downloadUrl = string.Format("{0}download/getdownload/{1}", GetStoreUrl(order.StoreId), orderItem.OrderItemGuid); - string downloadLink = string.Format("{1}", downloadUrl, _localizationService.GetResource("Messages.Order.Product(s).Download", languageId)); - sb.AppendLine("
"); - sb.AppendLine(downloadLink); - } - //add download link - if (_downloadService.IsLicenseDownloadAllowed(orderItem)) - { - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - string licenseUrl = string.Format("{0}download/getlicense/{1}", GetStoreUrl(order.StoreId), orderItem.OrderItemGuid); - string licenseLink = string.Format("{1}", licenseUrl, _localizationService.GetResource("Messages.Order.Product(s).License", languageId)); - sb.AppendLine("
"); - sb.AppendLine(licenseLink); - } - //attributes - if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) - { - sb.AppendLine("
"); - sb.AppendLine(orderItem.AttributeDescription); - } - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : string.Empty; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : string.Empty; - var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - sb.AppendLine("
"); - sb.AppendLine(rentalInfo); - } - //sku - if (_catalogSettings.ShowSkuOnProductDetailsPage) - { - var sku = product.FormatSku(orderItem.AttributesXml, _productAttributeParser); - if (!String.IsNullOrEmpty(sku)) - { - sb.AppendLine("
"); - sb.AppendLine(string.Format(_localizationService.GetResource("Messages.Order.Product(s).SKU", languageId), HttpUtility.HtmlEncode(sku))); - } - } - sb.AppendLine("
{0}{0}{0}
 "); - sb.AppendLine(order.CheckoutAttributeDescription); - sb.AppendLine("
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
"); - result = sb.ToString(); - return result; - } - - /// - /// Convert a collection to a HTML table - /// - /// Shipment - /// Language identifier - /// HTML table of products - protected virtual string ProductListToHtmlTable(Shipment shipment, int languageId) - { - string result; - - var sb = new StringBuilder(); - sb.AppendLine(""); - - #region Products - sb.AppendLine(string.Format("", _templatesSettings.Color1)); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Name", languageId))); - sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Quantity", languageId))); - sb.AppendLine(""); - - var table = shipment.ShipmentItems.ToList(); - for (int i = 0; i <= table.Count - 1; i++) - { - var si = table[i]; - var orderItem = _orderService.GetOrderItemById(si.OrderItemId); - if (orderItem == null) - continue; - - var product = orderItem.Product; - if (product == null) - continue; - - sb.AppendLine(string.Format("", _templatesSettings.Color2)); - //product name - string productName = product.GetLocalized(x => x.Name, languageId); - - sb.AppendLine(""); - - sb.AppendLine(string.Format("", si.Quantity)); - - sb.AppendLine(""); - } - #endregion - - sb.AppendLine("
{0}{0}
" + HttpUtility.HtmlEncode(productName)); - //attributes - if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) - { - sb.AppendLine("
"); - sb.AppendLine(orderItem.AttributeDescription); - } - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : string.Empty; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : string.Empty; - var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - sb.AppendLine("
"); - sb.AppendLine(rentalInfo); - } - //sku - if (_catalogSettings.ShowSkuOnProductDetailsPage) - { - var sku = product.FormatSku(orderItem.AttributesXml, _productAttributeParser); - if (!String.IsNullOrEmpty(sku)) - { - sb.AppendLine("
"); - sb.AppendLine(string.Format(_localizationService.GetResource("Messages.Order.Product(s).SKU", languageId), HttpUtility.HtmlEncode(sku))); - } - } - sb.AppendLine("
{0}
"); - result = sb.ToString(); - return result; - } - - /// - /// Get store URL - /// - /// Store identifier; Pass 0 to load URL of the current store - /// - protected virtual string GetStoreUrl(int storeId = 0) - { - var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore; - - if (store == null) - throw new Exception("No store could be loaded"); - - return store.Url; - } - - #endregion - - #region Methods - - /// - /// Add store tokens - /// - /// List of already added tokens - /// Store - /// Email account - public virtual void AddStoreTokens(IList tokens, Store store, EmailAccount emailAccount) - { - if (emailAccount == null) - throw new ArgumentNullException("emailAccount"); - - tokens.Add(new Token("Store.Name", store.GetLocalized(x => x.Name))); - tokens.Add(new Token("Store.URL", store.Url, true)); - tokens.Add(new Token("Store.Email", emailAccount.Email)); - tokens.Add(new Token("Store.CompanyName", store.CompanyName)); - tokens.Add(new Token("Store.CompanyAddress", store.CompanyAddress)); - tokens.Add(new Token("Store.CompanyPhoneNumber", store.CompanyPhoneNumber)); - tokens.Add(new Token("Store.CompanyVat", store.CompanyVat)); - - tokens.Add(new Token("Facebook.URL", _storeInformationSettings.FacebookLink)); - tokens.Add(new Token("Twitter.URL", _storeInformationSettings.TwitterLink)); - tokens.Add(new Token("YouTube.URL", _storeInformationSettings.YoutubeLink)); - tokens.Add(new Token("GooglePlus.URL", _storeInformationSettings.GooglePlusLink)); - - //event notification - _eventPublisher.EntityTokensAdded(store, tokens); - } - - /// - /// Add order tokens - /// - /// List of already added tokens - /// - /// Language identifier - /// Vendor identifier - public virtual void AddOrderTokens(IList tokens, Order order, int languageId, int vendorId = 0) - { - tokens.Add(new Token("Order.OrderNumber", order.CustomOrderNumber)); - - tokens.Add(new Token("Order.CustomerFullName", string.Format("{0} {1}", order.BillingAddress.FirstName, order.BillingAddress.LastName))); - tokens.Add(new Token("Order.CustomerEmail", order.BillingAddress.Email)); - - - tokens.Add(new Token("Order.BillingFirstName", order.BillingAddress.FirstName)); - tokens.Add(new Token("Order.BillingLastName", order.BillingAddress.LastName)); - tokens.Add(new Token("Order.BillingPhoneNumber", order.BillingAddress.PhoneNumber)); - tokens.Add(new Token("Order.BillingEmail", order.BillingAddress.Email)); - tokens.Add(new Token("Order.BillingFaxNumber", order.BillingAddress.FaxNumber)); - tokens.Add(new Token("Order.BillingCompany", order.BillingAddress.Company)); - tokens.Add(new Token("Order.BillingAddress1", order.BillingAddress.Address1)); - tokens.Add(new Token("Order.BillingAddress2", order.BillingAddress.Address2)); - tokens.Add(new Token("Order.BillingCity", order.BillingAddress.City)); - tokens.Add(new Token("Order.BillingStateProvince", order.BillingAddress.StateProvince != null ? order.BillingAddress.StateProvince.GetLocalized(x => x.Name) : string.Empty)); - tokens.Add(new Token("Order.BillingZipPostalCode", order.BillingAddress.ZipPostalCode)); - tokens.Add(new Token("Order.BillingCountry", order.BillingAddress.Country != null ? order.BillingAddress.Country.GetLocalized(x => x.Name) : string.Empty)); - tokens.Add(new Token("Order.BillingCustomAttributes", _addressAttributeFormatter.FormatAttributes(order.BillingAddress.CustomAttributes), true)); - - tokens.Add(new Token("Order.Shippable", !string.IsNullOrEmpty(order.ShippingMethod))); - tokens.Add(new Token("Order.ShippingMethod", order.ShippingMethod)); - tokens.Add(new Token("Order.ShippingFirstName", order.ShippingAddress != null ? order.ShippingAddress.FirstName : string.Empty)); - tokens.Add(new Token("Order.ShippingLastName", order.ShippingAddress != null ? order.ShippingAddress.LastName : string.Empty)); - tokens.Add(new Token("Order.ShippingPhoneNumber", order.ShippingAddress != null ? order.ShippingAddress.PhoneNumber : string.Empty)); - tokens.Add(new Token("Order.ShippingEmail", order.ShippingAddress != null ? order.ShippingAddress.Email : string.Empty)); - tokens.Add(new Token("Order.ShippingFaxNumber", order.ShippingAddress != null ? order.ShippingAddress.FaxNumber : string.Empty)); - tokens.Add(new Token("Order.ShippingCompany", order.ShippingAddress != null ? order.ShippingAddress.Company : string.Empty)); - tokens.Add(new Token("Order.ShippingAddress1", order.ShippingAddress != null ? order.ShippingAddress.Address1 : string.Empty)); - tokens.Add(new Token("Order.ShippingAddress2", order.ShippingAddress != null ? order.ShippingAddress.Address2 : string.Empty)); - tokens.Add(new Token("Order.ShippingCity", order.ShippingAddress != null ? order.ShippingAddress.City : string.Empty)); - tokens.Add(new Token("Order.ShippingStateProvince", order.ShippingAddress != null && order.ShippingAddress.StateProvince != null ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name) : string.Empty)); - tokens.Add(new Token("Order.ShippingZipPostalCode", order.ShippingAddress != null ? order.ShippingAddress.ZipPostalCode : string.Empty)); - tokens.Add(new Token("Order.ShippingCountry", order.ShippingAddress != null && order.ShippingAddress.Country != null ? order.ShippingAddress.Country.GetLocalized(x => x.Name) : string.Empty)); - tokens.Add(new Token("Order.ShippingCustomAttributes", _addressAttributeFormatter.FormatAttributes(order.ShippingAddress != null ? order.ShippingAddress.CustomAttributes : string.Empty), true)); - - var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); - var paymentMethodName = paymentMethod != null ? paymentMethod.GetLocalizedFriendlyName(_localizationService, _workContext.WorkingLanguage.Id) : order.PaymentMethodSystemName; - tokens.Add(new Token("Order.PaymentMethod", paymentMethodName)); - tokens.Add(new Token("Order.VatNumber", order.VatNumber)); - var sbCustomValues = new StringBuilder(); - var customValues = order.DeserializeCustomValues(); - if (customValues != null) - { - foreach (var item in customValues) - { - sbCustomValues.AppendFormat("{0}: {1}", HttpUtility.HtmlEncode(item.Key), HttpUtility.HtmlEncode(item.Value != null ? item.Value.ToString() : string.Empty)); - sbCustomValues.Append("
"); - } - } - tokens.Add(new Token("Order.CustomValues", sbCustomValues.ToString(), true)); - - - - tokens.Add(new Token("Order.Product(s)", ProductListToHtmlTable(order, languageId, vendorId), true)); - - var language = _languageService.GetLanguageById(languageId); - if (language != null && !String.IsNullOrEmpty(language.LanguageCulture)) - { - DateTime createdOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, TimeZoneInfo.Utc, _dateTimeHelper.GetCustomerTimeZone(order.Customer)); - tokens.Add(new Token("Order.CreatedOn", createdOn.ToString("D", new CultureInfo(language.LanguageCulture)))); - } - else - { - tokens.Add(new Token("Order.CreatedOn", order.CreatedOnUtc.ToString("D"))); - } - - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - tokens.Add(new Token("Order.OrderURLForCustomer", string.Format("{0}orderdetails/{1}", GetStoreUrl(order.StoreId), order.Id), true)); - - //event notification - _eventPublisher.EntityTokensAdded(order, tokens); - } - - /// - /// Add refunded order tokens - /// - /// List of already added tokens - /// Order - /// Refunded amount of order - public virtual void AddOrderRefundedTokens(IList tokens, Order order, decimal refundedAmount) - { - //should we convert it to customer currency? - //most probably, no. It can cause some rounding or legal issues - //furthermore, exchange rate could be changed - //so let's display it the primary store currency - - var primaryStoreCurrencyCode = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode; - var refundedAmountStr = _priceFormatter.FormatPrice(refundedAmount, true, primaryStoreCurrencyCode, false, _workContext.WorkingLanguage); - - tokens.Add(new Token("Order.AmountRefunded", refundedAmountStr)); - - //event notification - _eventPublisher.EntityTokensAdded(order, tokens); - } - - /// - /// Add shipment tokens - /// - /// List of already added tokens - /// Shipment item - /// Language identifier - public virtual void AddShipmentTokens(IList tokens, Shipment shipment, int languageId) - { - tokens.Add(new Token("Shipment.ShipmentNumber", shipment.Id)); - tokens.Add(new Token("Shipment.TrackingNumber", shipment.TrackingNumber)); - var trackingNumberUrl = string.Empty; - if (!String.IsNullOrEmpty(shipment.TrackingNumber)) - { - //we cannot inject IShippingService into constructor because it'll cause circular references. - //that's why we resolve it here this way - var shipmentTracker = shipment.GetShipmentTracker(EngineContext.Current.Resolve(), _shippingSettings); - if (shipmentTracker != null) - trackingNumberUrl = shipmentTracker.GetUrl(shipment.TrackingNumber); - } - tokens.Add(new Token("Shipment.TrackingNumberURL", trackingNumberUrl, true)); - tokens.Add(new Token("Shipment.Product(s)", ProductListToHtmlTable(shipment, languageId), true)); - tokens.Add(new Token("Shipment.URLForCustomer", string.Format("{0}orderdetails/shipment/{1}", GetStoreUrl(shipment.Order.StoreId), shipment.Id), true)); - - //event notification - _eventPublisher.EntityTokensAdded(shipment, tokens); - } - - /// - /// Add order note tokens - /// - /// List of already added tokens - /// Order note - public virtual void AddOrderNoteTokens(IList tokens, OrderNote orderNote) - { - tokens.Add(new Token("Order.NewNoteText", orderNote.FormatOrderNoteText(), true)); - tokens.Add(new Token("Order.OrderNoteAttachmentUrl", string.Format("{0}download/ordernotefile/{1}", GetStoreUrl(orderNote.Order.StoreId), orderNote.Id), true)); - - //event notification - _eventPublisher.EntityTokensAdded(orderNote, tokens); - } - - /// - /// Add recurring payment tokens - /// - /// List of already added tokens - /// Recurring payment - public virtual void AddRecurringPaymentTokens(IList tokens, RecurringPayment recurringPayment) - { - tokens.Add(new Token("RecurringPayment.ID", recurringPayment.Id)); - tokens.Add(new Token("RecurringPayment.CancelAfterFailedPayment", - recurringPayment.LastPaymentFailed && _paymentSettings.CancelRecurringPaymentsAfterFailedPayment)); - if (recurringPayment.InitialOrder != null) - tokens.Add(new Token("RecurringPayment.RecurringPaymentType", _paymentService.GetRecurringPaymentType(recurringPayment.InitialOrder.PaymentMethodSystemName).ToString())); - - //event notification - _eventPublisher.EntityTokensAdded(recurringPayment, tokens); - } - - /// - /// Add return request tokens - /// - /// List of already added tokens - /// Return request - /// Order item - public virtual void AddReturnRequestTokens(IList tokens, ReturnRequest returnRequest, OrderItem orderItem) - { - tokens.Add(new Token("ReturnRequest.CustomNumber", returnRequest.CustomNumber)); - tokens.Add(new Token("ReturnRequest.OrderId", orderItem.OrderId)); - tokens.Add(new Token("ReturnRequest.Product.Quantity", returnRequest.Quantity)); - tokens.Add(new Token("ReturnRequest.Product.Name", orderItem.Product.Name)); - tokens.Add(new Token("ReturnRequest.Reason", returnRequest.ReasonForReturn)); - tokens.Add(new Token("ReturnRequest.RequestedAction", returnRequest.RequestedAction)); - tokens.Add(new Token("ReturnRequest.CustomerComment", HtmlHelper.FormatText(returnRequest.CustomerComments, false, true, false, false, false, false), true)); - tokens.Add(new Token("ReturnRequest.StaffNotes", HtmlHelper.FormatText(returnRequest.StaffNotes, false, true, false, false, false, false), true)); - tokens.Add(new Token("ReturnRequest.Status", returnRequest.ReturnRequestStatus.GetLocalizedEnum(_localizationService, _workContext))); - - //event notification - _eventPublisher.EntityTokensAdded(returnRequest, tokens); - } - - /// - /// Add gift card tokens - /// - /// List of already added tokens - /// Gift card - public virtual void AddGiftCardTokens(IList tokens, GiftCard giftCard) - { - tokens.Add(new Token("GiftCard.SenderName", giftCard.SenderName)); - tokens.Add(new Token("GiftCard.SenderEmail",giftCard.SenderEmail)); - tokens.Add(new Token("GiftCard.RecipientName", giftCard.RecipientName)); - tokens.Add(new Token("GiftCard.RecipientEmail", giftCard.RecipientEmail)); - tokens.Add(new Token("GiftCard.Amount", _priceFormatter.FormatPrice(giftCard.Amount, true, false))); - tokens.Add(new Token("GiftCard.CouponCode", giftCard.GiftCardCouponCode)); - - var giftCardMesage = !String.IsNullOrWhiteSpace(giftCard.Message) ? - HtmlHelper.FormatText(giftCard.Message, false, true, false, false, false, false) : string.Empty; - - tokens.Add(new Token("GiftCard.Message", giftCardMesage, true)); - - //event notification - _eventPublisher.EntityTokensAdded(giftCard, tokens); - } - - /// - /// Add customer tokens - /// - /// List of already added tokens - /// Customer - public virtual void AddCustomerTokens(IList tokens, Customer customer) - { - tokens.Add(new Token("Customer.Email", customer.Email)); - tokens.Add(new Token("Customer.Username", customer.Username)); - tokens.Add(new Token("Customer.FullName", customer.GetFullName())); - tokens.Add(new Token("Customer.FirstName", customer.GetAttribute(SystemCustomerAttributeNames.FirstName))); - tokens.Add(new Token("Customer.LastName", customer.GetAttribute(SystemCustomerAttributeNames.LastName))); - tokens.Add(new Token("Customer.VatNumber", customer.GetAttribute(SystemCustomerAttributeNames.VatNumber))); - tokens.Add(new Token("Customer.VatNumberStatus", ((VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId)).ToString())); - - var customAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CustomCustomerAttributes); - tokens.Add(new Token("Customer.CustomAttributes", _customerAttributeFormatter.FormatAttributes(customAttributesXml), true)); - - - //note: we do not use SEO friendly URLS because we can get errors caused by having .(dot) in the URL (from the email address) - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - var passwordRecoveryUrl = string.Format("{0}passwordrecovery/confirm?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.PasswordRecoveryToken), HttpUtility.UrlEncode(customer.Email)); - var accountActivationUrl = string.Format("{0}customer/activation?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.AccountActivationToken), HttpUtility.UrlEncode(customer.Email)); - var emailRevalidationUrl = string.Format("{0}customer/revalidateemail?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.EmailRevalidationToken), HttpUtility.UrlEncode(customer.Email)); - var wishlistUrl = string.Format("{0}wishlist/{1}", GetStoreUrl(), customer.CustomerGuid); - - tokens.Add(new Token("Customer.PasswordRecoveryURL", passwordRecoveryUrl, true)); - tokens.Add(new Token("Customer.AccountActivationURL", accountActivationUrl, true)); - tokens.Add(new Token("Customer.EmailRevalidationURL", emailRevalidationUrl, true)); - tokens.Add(new Token("Wishlist.URLForCustomer", wishlistUrl, true)); - - //event notification - _eventPublisher.EntityTokensAdded(customer, tokens); - } - - /// - /// Add vendor tokens - /// - /// List of already added tokens - /// Vendor - public virtual void AddVendorTokens(IList tokens, Vendor vendor) - { - tokens.Add(new Token("Vendor.Name", vendor.Name)); - tokens.Add(new Token("Vendor.Email", vendor.Email)); - - //event notification - _eventPublisher.EntityTokensAdded(vendor, tokens); - } - - /// - /// Add newsletter subscription tokens - /// - /// List of already added tokens - /// Newsletter subscription - public virtual void AddNewsLetterSubscriptionTokens(IList tokens, NewsLetterSubscription subscription) - { - tokens.Add(new Token("NewsLetterSubscription.Email", subscription.Email)); - - - const string urlFormat = "{0}newsletter/subscriptionactivation/{1}/{2}"; - - var activationUrl = String.Format(urlFormat, GetStoreUrl(), subscription.NewsLetterSubscriptionGuid, "true"); - tokens.Add(new Token("NewsLetterSubscription.ActivationUrl", activationUrl, true)); - - var deActivationUrl = String.Format(urlFormat, GetStoreUrl(), subscription.NewsLetterSubscriptionGuid, "false"); - tokens.Add(new Token("NewsLetterSubscription.DeactivationUrl", deActivationUrl, true)); - - //event notification - _eventPublisher.EntityTokensAdded(subscription, tokens); - } - - /// - /// Add product review tokens - /// - /// List of already added tokens - /// Product review - public virtual void AddProductReviewTokens(IList tokens, ProductReview productReview) - { - tokens.Add(new Token("ProductReview.ProductName", productReview.Product.Name)); - - //event notification - _eventPublisher.EntityTokensAdded(productReview, tokens); - } - - /// - /// Add blog comment tokens - /// - /// List of already added tokens - /// Blog post comment - public virtual void AddBlogCommentTokens(IList tokens, BlogComment blogComment) - { - tokens.Add(new Token("BlogComment.BlogPostTitle", blogComment.BlogPost.Title)); - - //event notification - _eventPublisher.EntityTokensAdded(blogComment, tokens); - } - - /// - /// Add news comment tokens - /// - /// List of already added tokens - /// News comment - public virtual void AddNewsCommentTokens(IList tokens, NewsComment newsComment) - { - tokens.Add(new Token("NewsComment.NewsTitle", newsComment.NewsItem.Title)); - - //event notification - _eventPublisher.EntityTokensAdded(newsComment, tokens); - } - - /// - /// Add product tokens - /// - /// List of already added tokens - /// Product - /// Language identifier - public virtual void AddProductTokens(IList tokens, Product product, int languageId) - { - tokens.Add(new Token("Product.ID", product.Id)); - tokens.Add(new Token("Product.Name", product.GetLocalized(x => x.Name, languageId))); - tokens.Add(new Token("Product.ShortDescription", product.GetLocalized(x => x.ShortDescription, languageId), true)); - tokens.Add(new Token("Product.SKU", product.Sku)); - tokens.Add(new Token("Product.StockQuantity", product.GetTotalStockQuantity())); - - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - var productUrl = string.Format("{0}{1}", GetStoreUrl(), product.GetSeName()); - tokens.Add(new Token("Product.ProductURLForCustomer", productUrl, true)); - - //event notification - _eventPublisher.EntityTokensAdded(product, tokens); - } - - /// - /// Add product attribute combination tokens - /// - /// List of already added tokens - /// Product attribute combination - /// Language identifier - public virtual void AddAttributeCombinationTokens(IList tokens, ProductAttributeCombination combination, int languageId) - { - //attributes - //we cannot inject IProductAttributeFormatter into constructor because it'll cause circular references. - //that's why we resolve it here this way - var productAttributeFormatter = EngineContext.Current.Resolve(); - string attributes = productAttributeFormatter.FormatAttributes(combination.Product, - combination.AttributesXml, - _workContext.CurrentCustomer, - renderPrices: false); - - - - tokens.Add(new Token("AttributeCombination.Formatted", attributes, true)); - tokens.Add(new Token("AttributeCombination.SKU", combination.Product.FormatSku(combination.AttributesXml, _productAttributeParser))); - tokens.Add(new Token("AttributeCombination.StockQuantity", combination.StockQuantity)); - - //event notification - _eventPublisher.EntityTokensAdded(combination, tokens); - } - - /// - /// Add forum topic tokens - /// - /// List of already added tokens - /// Forum topic - /// Friendly (starts with 1) forum topic page to use for URL generation - /// Forum post identifier - public virtual void AddForumTopicTokens(IList tokens, ForumTopic forumTopic, - int? friendlyForumTopicPageIndex = null, int? appendedPostIdentifierAnchor = null) - { - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - string topicUrl; - if (friendlyForumTopicPageIndex.HasValue && friendlyForumTopicPageIndex.Value > 1) - topicUrl = string.Format("{0}boards/topic/{1}/{2}/page/{3}", GetStoreUrl(), forumTopic.Id, forumTopic.GetSeName(), friendlyForumTopicPageIndex.Value); - else - topicUrl = string.Format("{0}boards/topic/{1}/{2}", GetStoreUrl(), forumTopic.Id, forumTopic.GetSeName()); - if (appendedPostIdentifierAnchor.HasValue && appendedPostIdentifierAnchor.Value > 0) - topicUrl = string.Format("{0}#{1}", topicUrl, appendedPostIdentifierAnchor.Value); - tokens.Add(new Token("Forums.TopicURL", topicUrl, true)); - tokens.Add(new Token("Forums.TopicName", forumTopic.Subject)); - - //event notification - _eventPublisher.EntityTokensAdded(forumTopic, tokens); - } - - /// - /// Add forum post tokens - /// - /// List of already added tokens - /// Forum post - public virtual void AddForumPostTokens(IList tokens, ForumPost forumPost) - { - tokens.Add(new Token("Forums.PostAuthor", forumPost.Customer.FormatUserName())); - tokens.Add(new Token("Forums.PostBody", forumPost.FormatPostText(), true)); - - //event notification - _eventPublisher.EntityTokensAdded(forumPost, tokens); - } - - /// - /// Add forum tokens - /// - /// List of already added tokens - /// Forum - public virtual void AddForumTokens(IList tokens, Forum forum) - { - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - var forumUrl = string.Format("{0}boards/forum/{1}/{2}", GetStoreUrl(), forum.Id, forum.GetSeName()); - tokens.Add(new Token("Forums.ForumURL", forumUrl, true)); - tokens.Add(new Token("Forums.ForumName", forum.Name)); - - //event notification - _eventPublisher.EntityTokensAdded(forum, tokens); - } - - /// - /// Add private message tokens - /// - /// List of already added tokens - /// Private message - public virtual void AddPrivateMessageTokens(IList tokens, PrivateMessage privateMessage) - { - tokens.Add(new Token("PrivateMessage.Subject", privateMessage.Subject)); - tokens.Add(new Token("PrivateMessage.Text", privateMessage.FormatPrivateMessageText(), true)); - - //event notification - _eventPublisher.EntityTokensAdded(privateMessage, tokens); - } - - /// - /// Add tokens of BackInStock subscription - /// - /// List of already added tokens - /// BackInStock subscription - public virtual void AddBackInStockTokens(IList tokens, BackInStockSubscription subscription) - { - tokens.Add(new Token("BackInStockSubscription.ProductName", subscription.Product.Name)); - //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) - var productUrl = string.Format("{0}{1}", GetStoreUrl(subscription.StoreId), subscription.Product.GetSeName()); - tokens.Add(new Token("BackInStockSubscription.ProductUrl", productUrl, true)); - - //event notification - _eventPublisher.EntityTokensAdded(subscription, tokens); - } - - /// - /// Get collection of allowed (supported) message tokens for campaigns - /// - /// Collection of allowed (supported) message tokens for campaigns - public virtual IEnumerable GetListOfCampaignAllowedTokens() - { - var additionTokens = new CampaignAdditionTokensAddedEvent(); - _eventPublisher.Publish(additionTokens); - - var allowedTokens = GetListOfAllowedTokens(new[] { TokenGroupNames.StoreTokens, TokenGroupNames.SubscriptionTokens }).ToList(); - allowedTokens.AddRange(additionTokens.AdditionTokens); - - return allowedTokens.Distinct(); - } - - /// - /// Get collection of allowed (supported) message tokens - /// - /// Collection of token groups; pass null to get all available tokens - /// Collection of allowed message tokens - public virtual IEnumerable GetListOfAllowedTokens(IEnumerable tokenGroups = null) - { - var additionTokens = new AdditionTokensAddedEvent(); - _eventPublisher.Publish(additionTokens); - - var allowedTokens = AllowedTokens.Where(x => tokenGroups == null || tokenGroups.Contains(x.Key)) - .SelectMany(x => x.Value).ToList(); - - allowedTokens.AddRange(additionTokens.AdditionTokens); - - return allowedTokens.Distinct(); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Web; +using Nop.Core; +using Nop.Core.Domain; +using Nop.Core.Domain.Blogs; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Forums; +using Nop.Core.Domain.Messages; +using Nop.Core.Domain.News; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Stores; +using Nop.Core.Domain.Tax; +using Nop.Core.Domain.Vendors; +using Nop.Core.Html; +using Nop.Core.Infrastructure; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Events; +using Nop.Services.Forums; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Media; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Seo; +using Nop.Services.Shipping; +using Nop.Services.Shipping.Tracking; +using Nop.Services.Stores; + +namespace Nop.Services.Messages +{ + public partial class MessageTokenProvider : IMessageTokenProvider + { + #region Fields + + private readonly ILanguageService _languageService; + private readonly ILocalizationService _localizationService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IPriceFormatter _priceFormatter; + private readonly ICurrencyService _currencyService; + private readonly IWorkContext _workContext; + private readonly IDownloadService _downloadService; + private readonly IOrderService _orderService; + private readonly IPaymentService _paymentService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IAddressAttributeFormatter _addressAttributeFormatter; + private readonly ICustomerAttributeFormatter _customerAttributeFormatter; + private readonly IStoreService _storeService; + private readonly IStoreContext _storeContext; + + private readonly MessageTemplatesSettings _templatesSettings; + private readonly CatalogSettings _catalogSettings; + private readonly TaxSettings _taxSettings; + private readonly CurrencySettings _currencySettings; + private readonly ShippingSettings _shippingSettings; + private readonly PaymentSettings _paymentSettings; + + private readonly IEventPublisher _eventPublisher; + private readonly StoreInformationSettings _storeInformationSettings; + + #endregion + + #region Ctor + + public MessageTokenProvider(ILanguageService languageService, + ILocalizationService localizationService, + IDateTimeHelper dateTimeHelper, + IPriceFormatter priceFormatter, + ICurrencyService currencyService, + IWorkContext workContext, + IDownloadService downloadService, + IOrderService orderService, + IPaymentService paymentService, + IStoreService storeService, + IStoreContext storeContext, + IProductAttributeParser productAttributeParser, + IAddressAttributeFormatter addressAttributeFormatter, + ICustomerAttributeFormatter customerAttributeFormatter, + MessageTemplatesSettings templatesSettings, + CatalogSettings catalogSettings, + TaxSettings taxSettings, + CurrencySettings currencySettings, + ShippingSettings shippingSettings, + PaymentSettings paymentSettings, + IEventPublisher eventPublisher, + StoreInformationSettings storeInformationSettings) + { + this._languageService = languageService; + this._localizationService = localizationService; + this._dateTimeHelper = dateTimeHelper; + this._priceFormatter = priceFormatter; + this._currencyService = currencyService; + this._workContext = workContext; + this._downloadService = downloadService; + this._orderService = orderService; + this._paymentService = paymentService; + this._productAttributeParser = productAttributeParser; + this._addressAttributeFormatter = addressAttributeFormatter; + this._customerAttributeFormatter = customerAttributeFormatter; + this._storeService = storeService; + this._storeContext = storeContext; + + this._templatesSettings = templatesSettings; + this._catalogSettings = catalogSettings; + this._taxSettings = taxSettings; + this._currencySettings = currencySettings; + this._shippingSettings = shippingSettings; + this._paymentSettings = paymentSettings; + this._eventPublisher = eventPublisher; + this._storeInformationSettings = storeInformationSettings; + } + + #endregion + + #region Allowed tokens + + private Dictionary> _allowedTokens; + /// + /// Get all available tokens by token groups + /// + protected Dictionary> AllowedTokens + { + get + { + if (_allowedTokens != null) + return _allowedTokens; + + _allowedTokens = new Dictionary>(); + + //store tokens + _allowedTokens.Add(TokenGroupNames.StoreTokens, new[] + { + "%Store.Name%", + "%Store.URL%", + "%Store.Email%", + "%Store.CompanyName%", + "%Store.CompanyAddress%", + "%Store.CompanyPhoneNumber%", + "%Store.CompanyVat%", + "%Facebook.URL%", + "%Twitter.URL%", + "%YouTube.URL%", + "%GooglePlus.URL%" + }); + + //customer tokens + _allowedTokens.Add(TokenGroupNames.CustomerTokens, new[] + { + "%Customer.Email%", + "%Customer.Username%", + "%Customer.FullName%", + "%Customer.FirstName%", + "%Customer.LastName%", + "%Customer.VatNumber%", + "%Customer.VatNumberStatus%", + "%Customer.CustomAttributes%", + "%Customer.PasswordRecoveryURL%", + "%Customer.AccountActivationURL%", + "%Customer.EmailRevalidationURL%", + "%Wishlist.URLForCustomer%" + }); + + //order tokens + _allowedTokens.Add(TokenGroupNames.OrderTokens, new[] + { + "%Order.OrderNumber%", + "%Order.CustomerFullName%", + "%Order.CustomerEmail%", + "%Order.BillingFirstName%", + "%Order.BillingLastName%", + "%Order.BillingPhoneNumber%", + "%Order.BillingEmail%", + "%Order.BillingFaxNumber%", + "%Order.BillingCompany%", + "%Order.BillingAddress1%", + "%Order.BillingAddress2%", + "%Order.BillingCity%", + "%Order.BillingStateProvince%", + "%Order.BillingZipPostalCode%", + "%Order.BillingCountry%", + "%Order.BillingCustomAttributes%", + "%Order.Shippable%", + "%Order.ShippingMethod%", + "%Order.ShippingFirstName%", + "%Order.ShippingLastName%", + "%Order.ShippingPhoneNumber%", + "%Order.ShippingEmail%", + "%Order.ShippingFaxNumber%", + "%Order.ShippingCompany%", + "%Order.ShippingAddress1%", + "%Order.ShippingAddress2%", + "%Order.ShippingCity%", + "%Order.ShippingStateProvince%", + "%Order.ShippingZipPostalCode%", + "%Order.ShippingCountry%", + "%Order.ShippingCustomAttributes%", + "%Order.PaymentMethod%", + "%Order.VatNumber%", + "%Order.CustomValues%", + "%Order.Product(s)%", + "%Order.CreatedOn%", + "%Order.OrderURLForCustomer%" + }); + + //shipment tokens + _allowedTokens.Add(TokenGroupNames.ShipmentTokens, new[] + { + "%Shipment.ShipmentNumber%", + "%Shipment.TrackingNumber%", + "%Shipment.TrackingNumberURL%", + "%Shipment.Product(s)%", + "%Shipment.URLForCustomer%" + }); + + //refunded order tokens + _allowedTokens.Add(TokenGroupNames.RefundedOrderTokens, new[] + { + "%Order.AmountRefunded%" + }); + + //order note tokens + _allowedTokens.Add(TokenGroupNames.OrderNoteTokens, new[] + { + "%Order.NewNoteText%", + "%Order.OrderNoteAttachmentUrl%" + }); + + //recurring payment tokens + _allowedTokens.Add(TokenGroupNames.RecurringPaymentTokens, new[] + { + "%RecurringPayment.ID%", + "%RecurringPayment.CancelAfterFailedPayment%", + "%RecurringPayment.RecurringPaymentType%" + }); + + //newsletter subscription tokens + _allowedTokens.Add(TokenGroupNames.SubscriptionTokens, new[] + { + "%NewsLetterSubscription.Email%", + "%NewsLetterSubscription.ActivationUrl%", + "%NewsLetterSubscription.DeactivationUrl%" + }); + + //product tokens + _allowedTokens.Add(TokenGroupNames.ProductTokens, new[] + { + "%Product.ID%", + "%Product.Name%", + "%Product.ShortDescription%", + "%Product.ProductURLForCustomer%", + "%Product.SKU%", + "%Product.StockQuantity%" + }); + + //return request tokens + _allowedTokens.Add(TokenGroupNames.ReturnRequestTokens, new[] + { + "%ReturnRequest.CustomNumber%", + "%ReturnRequest.OrderId%", + "%ReturnRequest.Product.Quantity%", + "%ReturnRequest.Product.Name%", + "%ReturnRequest.Reason%", + "%ReturnRequest.RequestedAction%", + "%ReturnRequest.CustomerComment%", + "%ReturnRequest.StaffNotes%", + "%ReturnRequest.Status%" + }); + + //forum tokens + _allowedTokens.Add(TokenGroupNames.ForumTokens, new[] + { + "%Forums.ForumURL%", + "%Forums.ForumName%" + }); + + //forum topic tokens + _allowedTokens.Add(TokenGroupNames.ForumTopicTokens, new[] + { + "%Forums.TopicURL%", + "%Forums.TopicName%" + }); + + //forum post tokens + _allowedTokens.Add(TokenGroupNames.ForumPostTokens, new[] + { + "%Forums.PostAuthor%", + "%Forums.PostBody%" + }); + + //private message tokens + _allowedTokens.Add(TokenGroupNames.PrivateMessageTokens, new[] + { + "%PrivateMessage.Subject%", + "%PrivateMessage.Text%" + }); + + //vendor tokens + _allowedTokens.Add(TokenGroupNames.VendorTokens, new[] + { + "%Vendor.Name%", + "%Vendor.Email%" + }); + + //gift card tokens + _allowedTokens.Add(TokenGroupNames.GiftCardTokens, new[] + { + "%GiftCard.SenderName%", + "%GiftCard.SenderEmail%", + "%GiftCard.RecipientName%", + "%GiftCard.RecipientEmail%", + "%GiftCard.Amount%", + "%GiftCard.CouponCode%", + "%GiftCard.Message%" + }); + + //product review tokens + _allowedTokens.Add(TokenGroupNames.ProductReviewTokens, new[] + { + "%ProductReview.ProductName%" + }); + + //attribute combination tokens + _allowedTokens.Add(TokenGroupNames.AttributeCombinationTokens, new[] + { + "%AttributeCombination.Formatted%", + "%AttributeCombination.SKU%", + "%AttributeCombination.StockQuantity%" + }); + + //blog comment tokens + _allowedTokens.Add(TokenGroupNames.BlogCommentTokens, new[] + { + "%BlogComment.BlogPostTitle%" + }); + + //news comment tokens + _allowedTokens.Add(TokenGroupNames.NewsCommentTokens, new[] + { + "%NewsComment.NewsTitle%" + }); + + //product back in stock tokens + _allowedTokens.Add(TokenGroupNames.ProductBackInStockTokens, new[] + { + "%BackInStockSubscription.ProductName%", + "%BackInStockSubscription.ProductUrl%" + }); + + //email a friend tokens + _allowedTokens.Add(TokenGroupNames.EmailAFriendTokens, new[] + { + "%EmailAFriend.PersonalMessage%", + "%EmailAFriend.Email%" + }); + + //wishlist to friend tokens + _allowedTokens.Add(TokenGroupNames.WishlistToFriendTokens, new[] + { + "%Wishlist.PersonalMessage%", + "%Wishlist.Email%" + }); + + //VAT validation tokens + _allowedTokens.Add(TokenGroupNames.VatValidation, new[] + { + "%VatValidationResult.Name%", + "%VatValidationResult.Address%" + }); + + //contact us tokens + _allowedTokens.Add(TokenGroupNames.ContactUs, new[] + { + "%ContactUs.SenderEmail%", + "%ContactUs.SenderName%", + "%ContactUs.Body%" + }); + + //contact vendor tokens + _allowedTokens.Add(TokenGroupNames.ContactVendor, new[] + { + "%ContactUs.SenderEmail%", + "%ContactUs.SenderName%", + "%ContactUs.Body%" + }); + + return _allowedTokens; + } + } + + #endregion + + #region Utilities + + /// + /// Convert a collection to a HTML table + /// + /// Order + /// Language identifier + /// Vendor identifier (used to limit products by vendor + /// HTML table of products + protected virtual string ProductListToHtmlTable(Order order, int languageId, int vendorId) + { + string result; + var includingTax = order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax; + var language = _languageService.GetLanguageById(languageId); + + var sb = new StringBuilder(); + sb.AppendLine(""); + + #region Products + sb.AppendLine(string.Format("", _templatesSettings.Color1)); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Name", languageId))); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Price", languageId))); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Quantity", languageId))); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Total", languageId))); + sb.AppendLine(""); + + var table = order.OrderItems.ToList(); + for (int i = 0; i <= table.Count - 1; i++) + { + var orderItem = table[i]; + var product = orderItem.Product; + if (product == null) + continue; + + if (vendorId > 0 && product.VendorId != vendorId) + continue; + + sb.AppendLine(string.Format("", _templatesSettings.Color2)); + //product name + string productName = product.GetLocalized(x => x.Name, languageId); + + sb.AppendLine(""); + + string unitPriceStr; + if (includingTax) + { + //including tax + var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate); + unitPriceStr = _priceFormatter.FormatPrice(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + } + else + { + //excluding tax + var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate); + unitPriceStr = _priceFormatter.FormatPrice(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + } + sb.AppendLine(string.Format("", unitPriceStr)); + + sb.AppendLine(string.Format("", orderItem.Quantity)); + + string priceStr; + if (includingTax) + { + //including tax + var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); + priceStr = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + } + else + { + //excluding tax + var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate); + priceStr = _priceFormatter.FormatPrice(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + } + sb.AppendLine(string.Format("", priceStr)); + + sb.AppendLine(""); + } + #endregion + + if (vendorId == 0) + { + //we render checkout attributes and totals only for store owners (hide for vendors) + + #region Checkout Attributes + + if (!String.IsNullOrEmpty(order.CheckoutAttributeDescription)) + { + sb.AppendLine(""); + } + + #endregion + + #region Totals + + //subtotal + string cusSubTotal; + bool displaySubTotalDiscount = false; + string cusSubTotalDiscount = string.Empty; + if (includingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal) + { + //including tax + + //subtotal + var orderSubtotalInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalInclTax, order.CurrencyRate); + cusSubTotal = _priceFormatter.FormatPrice(orderSubtotalInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + //discount (applied to order subtotal) + var orderSubTotalDiscountInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountInclTax, order.CurrencyRate); + if (orderSubTotalDiscountInclTaxInCustomerCurrency > decimal.Zero) + { + cusSubTotalDiscount = _priceFormatter.FormatPrice(-orderSubTotalDiscountInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + displaySubTotalDiscount = true; + } + } + else + { + //exсluding tax + + //subtotal + var orderSubtotalExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubtotalExclTax, order.CurrencyRate); + cusSubTotal = _priceFormatter.FormatPrice(orderSubtotalExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + //discount (applied to order subtotal) + var orderSubTotalDiscountExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderSubTotalDiscountExclTax, order.CurrencyRate); + if (orderSubTotalDiscountExclTaxInCustomerCurrency > decimal.Zero) + { + cusSubTotalDiscount = _priceFormatter.FormatPrice(-orderSubTotalDiscountExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + displaySubTotalDiscount = true; + } + } + + //shipping, payment method fee + string cusShipTotal; + string cusPaymentMethodAdditionalFee; + var taxRates = new SortedDictionary(); + string cusTaxTotal = string.Empty; + string cusDiscount = string.Empty; + string cusTotal; + string cusAmount; + string cusAmountIncl; + if (includingTax) + { + //including tax + + //shipping + var orderShippingInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingInclTax + order.OrderShippingNonTaxable, order.CurrencyRate); + cusShipTotal = _priceFormatter.FormatShippingPrice(orderShippingInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + //payment method additional fee + var paymentMethodAdditionalFeeInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeInclTax + order.PaymentMethodAdditionalFeeNonTaxable, order.CurrencyRate); + cusPaymentMethodAdditionalFee = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); + } + else + { + //excluding tax + + //shipping + var orderShippingExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderShippingExclTax + order.OrderShippingNonTaxable, order.CurrencyRate); + cusShipTotal = _priceFormatter.FormatShippingPrice(orderShippingExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + //payment method additional fee + var paymentMethodAdditionalFeeExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.PaymentMethodAdditionalFeeExclTax + order.PaymentMethodAdditionalFeeNonTaxable, order.CurrencyRate); + cusPaymentMethodAdditionalFee = _priceFormatter.FormatPaymentMethodAdditionalFee(paymentMethodAdditionalFeeExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false); + } + + //shipping + bool displayShipping = order.ShippingStatus != ShippingStatus.ShippingNotRequired; + + //payment method fee + bool displayPaymentMethodFee = order.PaymentMethodAdditionalFeeExclTax + order.PaymentMethodAdditionalFeeNonTaxable != decimal.Zero; //allow negative + + //tax + bool displayTax = true; + bool displayTaxRates = true; + if (_taxSettings.HideTaxInOrderSummary && includingTax) + { + displayTax = false; + displayTaxRates = false; + } + else + { + if (order.OrderTax == 0 && _taxSettings.HideZeroTax) + { + displayTax = false; + displayTaxRates = false; + } + else + { + taxRates = new SortedDictionary(); + foreach (var tr in order.TaxRatesDictionary) + //taxRates.Add(tr.Key, _currencyService.ConvertCurrency(tr.Value, order.CurrencyRate)); + taxRates.Add(tr.Key, new TaxRateRec() + { + TaxRate = tr.Key, + Amount = _currencyService.ConvertCurrency(tr.Value.Amount, order.CurrencyRate), + DiscountAmount = _currencyService.ConvertCurrency(tr.Value.DiscountAmount, order.CurrencyRate), + BaseAmount = _currencyService.ConvertCurrency(tr.Value.BaseAmount, order.CurrencyRate), + TaxAmount = _currencyService.ConvertCurrency(tr.Value.TaxAmount, order.CurrencyRate), + AmountIncludingTax = _currencyService.ConvertCurrency(tr.Value.AmountIncludingTax, order.CurrencyRate) + }); + + displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); + displayTax = !displayTaxRates; + + var orderTaxInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTax, order.CurrencyRate); + string taxStr = _priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); + cusTaxTotal = taxStr; + } + } + + //discount + bool displayDiscount = false; + if (order.OrderDiscount > decimal.Zero) + { + var orderDiscountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderDiscount, order.CurrencyRate); + cusDiscount = _priceFormatter.FormatPrice(-orderDiscountInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); + displayDiscount = true; + } + + //total + var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); + cusTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); + + var orderAmountInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderAmount, order.CurrencyRate); + cusAmount = _priceFormatter.FormatPrice(orderAmountInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); + + var orderAmountInclInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderAmountIncl, order.CurrencyRate); + cusAmountIncl = _priceFormatter.FormatPrice(orderAmountInclInCustomerCurrency, true, order.CustomerCurrencyCode, false, language); + + //subtotal + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.SubTotal", languageId), cusSubTotal)); + + //discount (applied to order subtotal) + if (displaySubTotalDiscount) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.SubTotalDiscount", languageId), cusSubTotalDiscount)); + } + + + //shipping + if (displayShipping) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.Shipping", languageId), cusShipTotal)); + } + + //payment method fee + if (displayPaymentMethodFee) + { + string paymentMethodFeeTitle = _localizationService.GetResource("Messages.Order.PaymentMethodAdditionalFee", languageId); + sb.AppendLine(string.Format("", _templatesSettings.Color3, paymentMethodFeeTitle, cusPaymentMethodAdditionalFee)); + } + + //discount + if (displayDiscount) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.TotalDiscount", languageId), cusDiscount)); + } + + //amount + if (includingTax) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.OrderAmountIncl", languageId), cusAmountIncl)); + } + + //tax + if (displayTax) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource(includingTax ? "Messages.Order.TaxIncl" : "Messages.Order.Tax", languageId), cusTaxTotal)); + } + + //amount + if (!includingTax) + { + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.OrderAmount", languageId), cusAmount)); + } + if (displayTaxRates) + { + foreach (var item in taxRates) + { + string taxRate = String.Format(_localizationService.GetResource("Messages.Order.TaxRateLine"), _priceFormatter.FormatTaxRate(item.Key)); + string OrderAmount = _priceFormatter.FormatPrice(item.Value.Amount, true, order.CustomerCurrencyCode, false, language); + string DiscountAmount = _priceFormatter.FormatPrice(item.Value.DiscountAmount, true, order.CustomerCurrencyCode, false, language); + string Amount = _priceFormatter.FormatPrice(item.Value.BaseAmount, true, order.CustomerCurrencyCode, false, language); + string TaxAmount = _priceFormatter.FormatPrice(item.Value.TaxAmount, true, order.CustomerCurrencyCode, false, language); + string AmountIncludingVAT = _priceFormatter.FormatPrice(item.Value.AmountIncludingTax, true, order.CustomerCurrencyCode, false, language); + + //TODO: fill whole tax table + sb.AppendLine(string.Format("", + _templatesSettings.Color3, taxRate, TaxAmount, OrderAmount, DiscountAmount, Amount, AmountIncludingVAT)); + } + } + + //gift cards + var gcuhC = order.GiftCardUsageHistory; + foreach (var gcuh in gcuhC) + { + string giftCardText = String.Format(_localizationService.GetResource("Messages.Order.GiftCardInfo", languageId), HttpUtility.HtmlEncode(gcuh.GiftCard.GiftCardCouponCode)); + string giftCardAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(gcuh.UsedValue, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, language); + sb.AppendLine(string.Format("", _templatesSettings.Color3, giftCardText, giftCardAmount)); + } + + //reward points + if (order.RedeemedRewardPointsEntry != null) + { + string rpTitle = string.Format(_localizationService.GetResource("Messages.Order.RewardPoints", languageId), - (order.RedeemedRewardPointsEntry.Points + order.RedeemedRewardPointsEntry.PointsPurchased)); + string rpAmount = _priceFormatter.FormatPrice(-(_currencyService.ConvertCurrency(order.RedeemedRewardPointsEntry.UsedAmount + order.RedeemedRewardPointsEntry.UsedAmountPurchased, order.CurrencyRate)), true, order.CustomerCurrencyCode, false, language); + sb.AppendLine(string.Format("", _templatesSettings.Color3, rpTitle, rpAmount)); + } + + //total + sb.AppendLine(string.Format("", _templatesSettings.Color3, _localizationService.GetResource("Messages.Order.OrderTotal", languageId), cusTotal)); + #endregion + + } + + sb.AppendLine("
{0}{0}{0}{0}
" + HttpUtility.HtmlEncode(productName)); + //add download link + if (_downloadService.IsDownloadAllowed(orderItem)) + { + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + string downloadUrl = string.Format("{0}download/getdownload/{1}", GetStoreUrl(order.StoreId), orderItem.OrderItemGuid); + string downloadLink = string.Format("{1}", downloadUrl, _localizationService.GetResource("Messages.Order.Product(s).Download", languageId)); + sb.AppendLine("
"); + sb.AppendLine(downloadLink); + } + //add download link + if (_downloadService.IsLicenseDownloadAllowed(orderItem)) + { + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + string licenseUrl = string.Format("{0}download/getlicense/{1}", GetStoreUrl(order.StoreId), orderItem.OrderItemGuid); + string licenseLink = string.Format("{1}", licenseUrl, _localizationService.GetResource("Messages.Order.Product(s).License", languageId)); + sb.AppendLine("
"); + sb.AppendLine(licenseLink); + } + //attributes + if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) + { + sb.AppendLine("
"); + sb.AppendLine(orderItem.AttributeDescription); + } + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : string.Empty; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : string.Empty; + var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + sb.AppendLine("
"); + sb.AppendLine(rentalInfo); + } + //sku + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + var sku = product.FormatSku(orderItem.AttributesXml, _productAttributeParser); + if (!String.IsNullOrEmpty(sku)) + { + sb.AppendLine("
"); + sb.AppendLine(string.Format(_localizationService.GetResource("Messages.Order.Product(s).SKU", languageId), HttpUtility.HtmlEncode(sku))); + } + } + sb.AppendLine("
{0}{0}{0}
 "); + sb.AppendLine(order.CheckoutAttributeDescription); + sb.AppendLine("
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
 {1} {2}
"); + result = sb.ToString(); + return result; + } + + /// + /// Convert a collection to a HTML table + /// + /// Shipment + /// Language identifier + /// HTML table of products + protected virtual string ProductListToHtmlTable(Shipment shipment, int languageId) + { + string result; + + var sb = new StringBuilder(); + sb.AppendLine(""); + + #region Products + sb.AppendLine(string.Format("", _templatesSettings.Color1)); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Name", languageId))); + sb.AppendLine(string.Format("", _localizationService.GetResource("Messages.Order.Product(s).Quantity", languageId))); + sb.AppendLine(""); + + var table = shipment.ShipmentItems.ToList(); + for (int i = 0; i <= table.Count - 1; i++) + { + var si = table[i]; + var orderItem = _orderService.GetOrderItemById(si.OrderItemId); + if (orderItem == null) + continue; + + var product = orderItem.Product; + if (product == null) + continue; + + sb.AppendLine(string.Format("", _templatesSettings.Color2)); + //product name + string productName = product.GetLocalized(x => x.Name, languageId); + + sb.AppendLine(""); + + sb.AppendLine(string.Format("", si.Quantity)); + + sb.AppendLine(""); + } + #endregion + + sb.AppendLine("
{0}{0}
" + HttpUtility.HtmlEncode(productName)); + //attributes + if (!String.IsNullOrEmpty(orderItem.AttributeDescription)) + { + sb.AppendLine("
"); + sb.AppendLine(orderItem.AttributeDescription); + } + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : string.Empty; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : string.Empty; + var rentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + sb.AppendLine("
"); + sb.AppendLine(rentalInfo); + } + //sku + if (_catalogSettings.ShowSkuOnProductDetailsPage) + { + var sku = product.FormatSku(orderItem.AttributesXml, _productAttributeParser); + if (!String.IsNullOrEmpty(sku)) + { + sb.AppendLine("
"); + sb.AppendLine(string.Format(_localizationService.GetResource("Messages.Order.Product(s).SKU", languageId), HttpUtility.HtmlEncode(sku))); + } + } + sb.AppendLine("
{0}
"); + result = sb.ToString(); + return result; + } + + /// + /// Get store URL + /// + /// Store identifier; Pass 0 to load URL of the current store + /// + protected virtual string GetStoreUrl(int storeId = 0) + { + var store = _storeService.GetStoreById(storeId) ?? _storeContext.CurrentStore; + + if (store == null) + throw new Exception("No store could be loaded"); + + return store.Url; + } + + #endregion + + #region Methods + + /// + /// Add store tokens + /// + /// List of already added tokens + /// Store + /// Email account + public virtual void AddStoreTokens(IList tokens, Store store, EmailAccount emailAccount) + { + if (emailAccount == null) + throw new ArgumentNullException("emailAccount"); + + tokens.Add(new Token("Store.Name", store.GetLocalized(x => x.Name))); + tokens.Add(new Token("Store.URL", store.Url, true)); + tokens.Add(new Token("Store.Email", emailAccount.Email)); + tokens.Add(new Token("Store.CompanyName", store.CompanyName)); + tokens.Add(new Token("Store.CompanyAddress", store.CompanyAddress)); + tokens.Add(new Token("Store.CompanyPhoneNumber", store.CompanyPhoneNumber)); + tokens.Add(new Token("Store.CompanyVat", store.CompanyVat)); + + tokens.Add(new Token("Facebook.URL", _storeInformationSettings.FacebookLink)); + tokens.Add(new Token("Twitter.URL", _storeInformationSettings.TwitterLink)); + tokens.Add(new Token("YouTube.URL", _storeInformationSettings.YoutubeLink)); + tokens.Add(new Token("GooglePlus.URL", _storeInformationSettings.GooglePlusLink)); + + //event notification + _eventPublisher.EntityTokensAdded(store, tokens); + } + + /// + /// Add order tokens + /// + /// List of already added tokens + /// + /// Language identifier + /// Vendor identifier + public virtual void AddOrderTokens(IList tokens, Order order, int languageId, int vendorId = 0) + { + tokens.Add(new Token("Order.OrderNumber", order.CustomOrderNumber)); + + tokens.Add(new Token("Order.CustomerFullName", string.Format("{0} {1}", order.BillingAddress.FirstName, order.BillingAddress.LastName))); + tokens.Add(new Token("Order.CustomerEmail", order.BillingAddress.Email)); + + + tokens.Add(new Token("Order.BillingFirstName", order.BillingAddress.FirstName)); + tokens.Add(new Token("Order.BillingLastName", order.BillingAddress.LastName)); + tokens.Add(new Token("Order.BillingPhoneNumber", order.BillingAddress.PhoneNumber)); + tokens.Add(new Token("Order.BillingEmail", order.BillingAddress.Email)); + tokens.Add(new Token("Order.BillingFaxNumber", order.BillingAddress.FaxNumber)); + tokens.Add(new Token("Order.BillingCompany", order.BillingAddress.Company)); + tokens.Add(new Token("Order.BillingAddress1", order.BillingAddress.Address1)); + tokens.Add(new Token("Order.BillingAddress2", order.BillingAddress.Address2)); + tokens.Add(new Token("Order.BillingCity", order.BillingAddress.City)); + tokens.Add(new Token("Order.BillingStateProvince", order.BillingAddress.StateProvince != null ? order.BillingAddress.StateProvince.GetLocalized(x => x.Name) : string.Empty)); + tokens.Add(new Token("Order.BillingZipPostalCode", order.BillingAddress.ZipPostalCode)); + tokens.Add(new Token("Order.BillingCountry", order.BillingAddress.Country != null ? order.BillingAddress.Country.GetLocalized(x => x.Name) : string.Empty)); + tokens.Add(new Token("Order.BillingCustomAttributes", _addressAttributeFormatter.FormatAttributes(order.BillingAddress.CustomAttributes), true)); + + tokens.Add(new Token("Order.Shippable", !string.IsNullOrEmpty(order.ShippingMethod))); + tokens.Add(new Token("Order.ShippingMethod", order.ShippingMethod)); + tokens.Add(new Token("Order.ShippingFirstName", order.ShippingAddress != null ? order.ShippingAddress.FirstName : string.Empty)); + tokens.Add(new Token("Order.ShippingLastName", order.ShippingAddress != null ? order.ShippingAddress.LastName : string.Empty)); + tokens.Add(new Token("Order.ShippingPhoneNumber", order.ShippingAddress != null ? order.ShippingAddress.PhoneNumber : string.Empty)); + tokens.Add(new Token("Order.ShippingEmail", order.ShippingAddress != null ? order.ShippingAddress.Email : string.Empty)); + tokens.Add(new Token("Order.ShippingFaxNumber", order.ShippingAddress != null ? order.ShippingAddress.FaxNumber : string.Empty)); + tokens.Add(new Token("Order.ShippingCompany", order.ShippingAddress != null ? order.ShippingAddress.Company : string.Empty)); + tokens.Add(new Token("Order.ShippingAddress1", order.ShippingAddress != null ? order.ShippingAddress.Address1 : string.Empty)); + tokens.Add(new Token("Order.ShippingAddress2", order.ShippingAddress != null ? order.ShippingAddress.Address2 : string.Empty)); + tokens.Add(new Token("Order.ShippingCity", order.ShippingAddress != null ? order.ShippingAddress.City : string.Empty)); + tokens.Add(new Token("Order.ShippingStateProvince", order.ShippingAddress != null && order.ShippingAddress.StateProvince != null ? order.ShippingAddress.StateProvince.GetLocalized(x => x.Name) : string.Empty)); + tokens.Add(new Token("Order.ShippingZipPostalCode", order.ShippingAddress != null ? order.ShippingAddress.ZipPostalCode : string.Empty)); + tokens.Add(new Token("Order.ShippingCountry", order.ShippingAddress != null && order.ShippingAddress.Country != null ? order.ShippingAddress.Country.GetLocalized(x => x.Name) : string.Empty)); + tokens.Add(new Token("Order.ShippingCustomAttributes", _addressAttributeFormatter.FormatAttributes(order.ShippingAddress != null ? order.ShippingAddress.CustomAttributes : string.Empty), true)); + + var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); + var paymentMethodName = paymentMethod != null ? paymentMethod.GetLocalizedFriendlyName(_localizationService, _workContext.WorkingLanguage.Id) : order.PaymentMethodSystemName; + tokens.Add(new Token("Order.PaymentMethod", paymentMethodName)); + tokens.Add(new Token("Order.VatNumber", order.VatNumber)); + var sbCustomValues = new StringBuilder(); + var customValues = order.DeserializeCustomValues(); + if (customValues != null) + { + foreach (var item in customValues) + { + sbCustomValues.AppendFormat("{0}: {1}", HttpUtility.HtmlEncode(item.Key), HttpUtility.HtmlEncode(item.Value != null ? item.Value.ToString() : string.Empty)); + sbCustomValues.Append("
"); + } + } + tokens.Add(new Token("Order.CustomValues", sbCustomValues.ToString(), true)); + + + + tokens.Add(new Token("Order.Product(s)", ProductListToHtmlTable(order, languageId, vendorId), true)); + + var language = _languageService.GetLanguageById(languageId); + if (language != null && !String.IsNullOrEmpty(language.LanguageCulture)) + { + DateTime createdOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, TimeZoneInfo.Utc, _dateTimeHelper.GetCustomerTimeZone(order.Customer)); + tokens.Add(new Token("Order.CreatedOn", createdOn.ToString("D", new CultureInfo(language.LanguageCulture)))); + } + else + { + tokens.Add(new Token("Order.CreatedOn", order.CreatedOnUtc.ToString("D"))); + } + + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + tokens.Add(new Token("Order.OrderURLForCustomer", string.Format("{0}orderdetails/{1}", GetStoreUrl(order.StoreId), order.Id), true)); + + //event notification + _eventPublisher.EntityTokensAdded(order, tokens); + } + + /// + /// Add refunded order tokens + /// + /// List of already added tokens + /// Order + /// Refunded amount of order + public virtual void AddOrderRefundedTokens(IList tokens, Order order, decimal refundedAmount) + { + //should we convert it to customer currency? + //most probably, no. It can cause some rounding or legal issues + //furthermore, exchange rate could be changed + //so let's display it the primary store currency + + var primaryStoreCurrencyCode = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode; + var refundedAmountStr = _priceFormatter.FormatPrice(refundedAmount, true, primaryStoreCurrencyCode, false, _workContext.WorkingLanguage); + + tokens.Add(new Token("Order.AmountRefunded", refundedAmountStr)); + + //event notification + _eventPublisher.EntityTokensAdded(order, tokens); + } + + /// + /// Add shipment tokens + /// + /// List of already added tokens + /// Shipment item + /// Language identifier + public virtual void AddShipmentTokens(IList tokens, Shipment shipment, int languageId) + { + tokens.Add(new Token("Shipment.ShipmentNumber", shipment.Id)); + tokens.Add(new Token("Shipment.TrackingNumber", shipment.TrackingNumber)); + var trackingNumberUrl = string.Empty; + if (!String.IsNullOrEmpty(shipment.TrackingNumber)) + { + //we cannot inject IShippingService into constructor because it'll cause circular references. + //that's why we resolve it here this way + var shipmentTracker = shipment.GetShipmentTracker(EngineContext.Current.Resolve(), _shippingSettings); + if (shipmentTracker != null) + trackingNumberUrl = shipmentTracker.GetUrl(shipment.TrackingNumber); + } + tokens.Add(new Token("Shipment.TrackingNumberURL", trackingNumberUrl, true)); + tokens.Add(new Token("Shipment.Product(s)", ProductListToHtmlTable(shipment, languageId), true)); + tokens.Add(new Token("Shipment.URLForCustomer", string.Format("{0}orderdetails/shipment/{1}", GetStoreUrl(shipment.Order.StoreId), shipment.Id), true)); + + //event notification + _eventPublisher.EntityTokensAdded(shipment, tokens); + } + + /// + /// Add order note tokens + /// + /// List of already added tokens + /// Order note + public virtual void AddOrderNoteTokens(IList tokens, OrderNote orderNote) + { + tokens.Add(new Token("Order.NewNoteText", orderNote.FormatOrderNoteText(), true)); + tokens.Add(new Token("Order.OrderNoteAttachmentUrl", string.Format("{0}download/ordernotefile/{1}", GetStoreUrl(orderNote.Order.StoreId), orderNote.Id), true)); + + //event notification + _eventPublisher.EntityTokensAdded(orderNote, tokens); + } + + /// + /// Add recurring payment tokens + /// + /// List of already added tokens + /// Recurring payment + public virtual void AddRecurringPaymentTokens(IList tokens, RecurringPayment recurringPayment) + { + tokens.Add(new Token("RecurringPayment.ID", recurringPayment.Id)); + tokens.Add(new Token("RecurringPayment.CancelAfterFailedPayment", + recurringPayment.LastPaymentFailed && _paymentSettings.CancelRecurringPaymentsAfterFailedPayment)); + if (recurringPayment.InitialOrder != null) + tokens.Add(new Token("RecurringPayment.RecurringPaymentType", _paymentService.GetRecurringPaymentType(recurringPayment.InitialOrder.PaymentMethodSystemName).ToString())); + + //event notification + _eventPublisher.EntityTokensAdded(recurringPayment, tokens); + } + + /// + /// Add return request tokens + /// + /// List of already added tokens + /// Return request + /// Order item + public virtual void AddReturnRequestTokens(IList tokens, ReturnRequest returnRequest, OrderItem orderItem) + { + tokens.Add(new Token("ReturnRequest.CustomNumber", returnRequest.CustomNumber)); + tokens.Add(new Token("ReturnRequest.OrderId", orderItem.OrderId)); + tokens.Add(new Token("ReturnRequest.Product.Quantity", returnRequest.Quantity)); + tokens.Add(new Token("ReturnRequest.Product.Name", orderItem.Product.Name)); + tokens.Add(new Token("ReturnRequest.Reason", returnRequest.ReasonForReturn)); + tokens.Add(new Token("ReturnRequest.RequestedAction", returnRequest.RequestedAction)); + tokens.Add(new Token("ReturnRequest.CustomerComment", HtmlHelper.FormatText(returnRequest.CustomerComments, false, true, false, false, false, false), true)); + tokens.Add(new Token("ReturnRequest.StaffNotes", HtmlHelper.FormatText(returnRequest.StaffNotes, false, true, false, false, false, false), true)); + tokens.Add(new Token("ReturnRequest.Status", returnRequest.ReturnRequestStatus.GetLocalizedEnum(_localizationService, _workContext))); + + //event notification + _eventPublisher.EntityTokensAdded(returnRequest, tokens); + } + + /// + /// Add gift card tokens + /// + /// List of already added tokens + /// Gift card + public virtual void AddGiftCardTokens(IList tokens, GiftCard giftCard) + { + tokens.Add(new Token("GiftCard.SenderName", giftCard.SenderName)); + tokens.Add(new Token("GiftCard.SenderEmail",giftCard.SenderEmail)); + tokens.Add(new Token("GiftCard.RecipientName", giftCard.RecipientName)); + tokens.Add(new Token("GiftCard.RecipientEmail", giftCard.RecipientEmail)); + tokens.Add(new Token("GiftCard.Amount", _priceFormatter.FormatPrice(giftCard.Amount, true, false))); + tokens.Add(new Token("GiftCard.CouponCode", giftCard.GiftCardCouponCode)); + + var giftCardMesage = !String.IsNullOrWhiteSpace(giftCard.Message) ? + HtmlHelper.FormatText(giftCard.Message, false, true, false, false, false, false) : string.Empty; + + tokens.Add(new Token("GiftCard.Message", giftCardMesage, true)); + + //event notification + _eventPublisher.EntityTokensAdded(giftCard, tokens); + } + + /// + /// Add customer tokens + /// + /// List of already added tokens + /// Customer + public virtual void AddCustomerTokens(IList tokens, Customer customer) + { + tokens.Add(new Token("Customer.Email", customer.Email)); + tokens.Add(new Token("Customer.Username", customer.Username)); + tokens.Add(new Token("Customer.FullName", customer.GetFullName())); + tokens.Add(new Token("Customer.FirstName", customer.GetAttribute(SystemCustomerAttributeNames.FirstName))); + tokens.Add(new Token("Customer.LastName", customer.GetAttribute(SystemCustomerAttributeNames.LastName))); + tokens.Add(new Token("Customer.VatNumber", customer.GetAttribute(SystemCustomerAttributeNames.VatNumber))); + tokens.Add(new Token("Customer.VatNumberStatus", ((VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId)).ToString())); + + var customAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CustomCustomerAttributes); + tokens.Add(new Token("Customer.CustomAttributes", _customerAttributeFormatter.FormatAttributes(customAttributesXml), true)); + + + //note: we do not use SEO friendly URLS because we can get errors caused by having .(dot) in the URL (from the email address) + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + var passwordRecoveryUrl = string.Format("{0}passwordrecovery/confirm?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.PasswordRecoveryToken), HttpUtility.UrlEncode(customer.Email)); + var accountActivationUrl = string.Format("{0}customer/activation?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.AccountActivationToken), HttpUtility.UrlEncode(customer.Email)); + var emailRevalidationUrl = string.Format("{0}customer/revalidateemail?token={1}&email={2}", GetStoreUrl(), customer.GetAttribute(SystemCustomerAttributeNames.EmailRevalidationToken), HttpUtility.UrlEncode(customer.Email)); + var wishlistUrl = string.Format("{0}wishlist/{1}", GetStoreUrl(), customer.CustomerGuid); + + tokens.Add(new Token("Customer.PasswordRecoveryURL", passwordRecoveryUrl, true)); + tokens.Add(new Token("Customer.AccountActivationURL", accountActivationUrl, true)); + tokens.Add(new Token("Customer.EmailRevalidationURL", emailRevalidationUrl, true)); + tokens.Add(new Token("Wishlist.URLForCustomer", wishlistUrl, true)); + + //event notification + _eventPublisher.EntityTokensAdded(customer, tokens); + } + + /// + /// Add vendor tokens + /// + /// List of already added tokens + /// Vendor + public virtual void AddVendorTokens(IList tokens, Vendor vendor) + { + tokens.Add(new Token("Vendor.Name", vendor.Name)); + tokens.Add(new Token("Vendor.Email", vendor.Email)); + + //event notification + _eventPublisher.EntityTokensAdded(vendor, tokens); + } + + /// + /// Add newsletter subscription tokens + /// + /// List of already added tokens + /// Newsletter subscription + public virtual void AddNewsLetterSubscriptionTokens(IList tokens, NewsLetterSubscription subscription) + { + tokens.Add(new Token("NewsLetterSubscription.Email", subscription.Email)); + + + const string urlFormat = "{0}newsletter/subscriptionactivation/{1}/{2}"; + + var activationUrl = String.Format(urlFormat, GetStoreUrl(), subscription.NewsLetterSubscriptionGuid, "true"); + tokens.Add(new Token("NewsLetterSubscription.ActivationUrl", activationUrl, true)); + + var deActivationUrl = String.Format(urlFormat, GetStoreUrl(), subscription.NewsLetterSubscriptionGuid, "false"); + tokens.Add(new Token("NewsLetterSubscription.DeactivationUrl", deActivationUrl, true)); + + //event notification + _eventPublisher.EntityTokensAdded(subscription, tokens); + } + + /// + /// Add product review tokens + /// + /// List of already added tokens + /// Product review + public virtual void AddProductReviewTokens(IList tokens, ProductReview productReview) + { + tokens.Add(new Token("ProductReview.ProductName", productReview.Product.Name)); + + //event notification + _eventPublisher.EntityTokensAdded(productReview, tokens); + } + + /// + /// Add blog comment tokens + /// + /// List of already added tokens + /// Blog post comment + public virtual void AddBlogCommentTokens(IList tokens, BlogComment blogComment) + { + tokens.Add(new Token("BlogComment.BlogPostTitle", blogComment.BlogPost.Title)); + + //event notification + _eventPublisher.EntityTokensAdded(blogComment, tokens); + } + + /// + /// Add news comment tokens + /// + /// List of already added tokens + /// News comment + public virtual void AddNewsCommentTokens(IList tokens, NewsComment newsComment) + { + tokens.Add(new Token("NewsComment.NewsTitle", newsComment.NewsItem.Title)); + + //event notification + _eventPublisher.EntityTokensAdded(newsComment, tokens); + } + + /// + /// Add product tokens + /// + /// List of already added tokens + /// Product + /// Language identifier + public virtual void AddProductTokens(IList tokens, Product product, int languageId) + { + tokens.Add(new Token("Product.ID", product.Id)); + tokens.Add(new Token("Product.Name", product.GetLocalized(x => x.Name, languageId))); + tokens.Add(new Token("Product.ShortDescription", product.GetLocalized(x => x.ShortDescription, languageId), true)); + tokens.Add(new Token("Product.SKU", product.Sku)); + tokens.Add(new Token("Product.StockQuantity", product.GetTotalStockQuantity())); + + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + var productUrl = string.Format("{0}{1}", GetStoreUrl(), product.GetSeName()); + tokens.Add(new Token("Product.ProductURLForCustomer", productUrl, true)); + + //event notification + _eventPublisher.EntityTokensAdded(product, tokens); + } + + /// + /// Add product attribute combination tokens + /// + /// List of already added tokens + /// Product attribute combination + /// Language identifier + public virtual void AddAttributeCombinationTokens(IList tokens, ProductAttributeCombination combination, int languageId) + { + //attributes + //we cannot inject IProductAttributeFormatter into constructor because it'll cause circular references. + //that's why we resolve it here this way + var productAttributeFormatter = EngineContext.Current.Resolve(); + string attributes = productAttributeFormatter.FormatAttributes(combination.Product, + combination.AttributesXml, + _workContext.CurrentCustomer, + renderPrices: false); + + + + tokens.Add(new Token("AttributeCombination.Formatted", attributes, true)); + tokens.Add(new Token("AttributeCombination.SKU", combination.Product.FormatSku(combination.AttributesXml, _productAttributeParser))); + tokens.Add(new Token("AttributeCombination.StockQuantity", combination.StockQuantity)); + + //event notification + _eventPublisher.EntityTokensAdded(combination, tokens); + } + + /// + /// Add forum topic tokens + /// + /// List of already added tokens + /// Forum topic + /// Friendly (starts with 1) forum topic page to use for URL generation + /// Forum post identifier + public virtual void AddForumTopicTokens(IList tokens, ForumTopic forumTopic, + int? friendlyForumTopicPageIndex = null, int? appendedPostIdentifierAnchor = null) + { + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + string topicUrl; + if (friendlyForumTopicPageIndex.HasValue && friendlyForumTopicPageIndex.Value > 1) + topicUrl = string.Format("{0}boards/topic/{1}/{2}/page/{3}", GetStoreUrl(), forumTopic.Id, forumTopic.GetSeName(), friendlyForumTopicPageIndex.Value); + else + topicUrl = string.Format("{0}boards/topic/{1}/{2}", GetStoreUrl(), forumTopic.Id, forumTopic.GetSeName()); + if (appendedPostIdentifierAnchor.HasValue && appendedPostIdentifierAnchor.Value > 0) + topicUrl = string.Format("{0}#{1}", topicUrl, appendedPostIdentifierAnchor.Value); + tokens.Add(new Token("Forums.TopicURL", topicUrl, true)); + tokens.Add(new Token("Forums.TopicName", forumTopic.Subject)); + + //event notification + _eventPublisher.EntityTokensAdded(forumTopic, tokens); + } + + /// + /// Add forum post tokens + /// + /// List of already added tokens + /// Forum post + public virtual void AddForumPostTokens(IList tokens, ForumPost forumPost) + { + tokens.Add(new Token("Forums.PostAuthor", forumPost.Customer.FormatUserName())); + tokens.Add(new Token("Forums.PostBody", forumPost.FormatPostText(), true)); + + //event notification + _eventPublisher.EntityTokensAdded(forumPost, tokens); + } + + /// + /// Add forum tokens + /// + /// List of already added tokens + /// Forum + public virtual void AddForumTokens(IList tokens, Forum forum) + { + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + var forumUrl = string.Format("{0}boards/forum/{1}/{2}", GetStoreUrl(), forum.Id, forum.GetSeName()); + tokens.Add(new Token("Forums.ForumURL", forumUrl, true)); + tokens.Add(new Token("Forums.ForumName", forum.Name)); + + //event notification + _eventPublisher.EntityTokensAdded(forum, tokens); + } + + /// + /// Add private message tokens + /// + /// List of already added tokens + /// Private message + public virtual void AddPrivateMessageTokens(IList tokens, PrivateMessage privateMessage) + { + tokens.Add(new Token("PrivateMessage.Subject", privateMessage.Subject)); + tokens.Add(new Token("PrivateMessage.Text", privateMessage.FormatPrivateMessageText(), true)); + + //event notification + _eventPublisher.EntityTokensAdded(privateMessage, tokens); + } + + /// + /// Add tokens of BackInStock subscription + /// + /// List of already added tokens + /// BackInStock subscription + public virtual void AddBackInStockTokens(IList tokens, BackInStockSubscription subscription) + { + tokens.Add(new Token("BackInStockSubscription.ProductName", subscription.Product.Name)); + //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs) + var productUrl = string.Format("{0}{1}", GetStoreUrl(subscription.StoreId), subscription.Product.GetSeName()); + tokens.Add(new Token("BackInStockSubscription.ProductUrl", productUrl, true)); + + //event notification + _eventPublisher.EntityTokensAdded(subscription, tokens); + } + + /// + /// Get collection of allowed (supported) message tokens for campaigns + /// + /// Collection of allowed (supported) message tokens for campaigns + public virtual IEnumerable GetListOfCampaignAllowedTokens() + { + var additionTokens = new CampaignAdditionTokensAddedEvent(); + _eventPublisher.Publish(additionTokens); + + var allowedTokens = GetListOfAllowedTokens(new[] { TokenGroupNames.StoreTokens, TokenGroupNames.SubscriptionTokens }).ToList(); + allowedTokens.AddRange(additionTokens.AdditionTokens); + + return allowedTokens.Distinct(); + } + + /// + /// Get collection of allowed (supported) message tokens + /// + /// Collection of token groups; pass null to get all available tokens + /// Collection of allowed message tokens + public virtual IEnumerable GetListOfAllowedTokens(IEnumerable tokenGroups = null) + { + var additionTokens = new AdditionTokensAddedEvent(); + _eventPublisher.Publish(additionTokens); + + var allowedTokens = AllowedTokens.Where(x => tokenGroups == null || tokenGroups.Contains(x.Key)) + .SelectMany(x => x.Value).ToList(); + + allowedTokens.AddRange(additionTokens.AdditionTokens); + + return allowedTokens.Distinct(); + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Nop.Services.csproj b/src/Libraries/Nop.Services/Nop.Services.csproj index 9aa328ea8b5..7a4a382bc8f 100644 --- a/src/Libraries/Nop.Services/Nop.Services.csproj +++ b/src/Libraries/Nop.Services/Nop.Services.csproj @@ -1,546 +1,580 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {210541AD-F659-47DA-8763-16F36C5CD2F4} - Library - Properties - Nop.Services - Nop.Services - v4.5.1 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\..\packages\Autofac.4.4.0\lib\net45\Autofac.dll - True - - - ..\..\packages\EPPlus.4.1.0\lib\net40\EPPlus.dll - True - - - ..\..\packages\ImageResizer.4.0.5\lib\net45\ImageResizer.dll - True - - - ..\..\packages\ImageResizer.Plugins.PrettyGifs.4.0.5\lib\net45\ImageResizer.Plugins.PrettyGifs.dll - True - - - ..\..\packages\iTextSharp.5.5.10\lib\itextsharp.dll - True - - - ..\..\packages\MaxMind.Db.2.1.3\lib\net45\MaxMind.Db.dll - True - - - ..\..\packages\MaxMind.GeoIP2.2.7.2\lib\net45\MaxMind.GeoIP2.dll - True - - - ..\..\packages\Microsoft.Azure.KeyVault.Core.2.0.4\lib\net45\Microsoft.Azure.KeyVault.Core.dll - True - - - - ..\..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll - True - - - ..\..\packages\Microsoft.Data.OData.5.8.2\lib\net40\Microsoft.Data.OData.dll - True - - - ..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll - True - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - - True - ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - ..\..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll - True - - - ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - True - - - - - - - ..\..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll - True - - - - - ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - - - ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - - - - - ..\..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll - True - - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll - - - False - ..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - - - False - ..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll - - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll - - - False - ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Settings.settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Reference.map - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6BDA8332-939F-45B7-A25E-7A797260AE59} - Nop.Core - - - {CCD7F2C9-6A2C-4CF0-8E89-076B8FC0F144} - Nop.Data - - - - - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - Reference.map - - - MSDiscoCodeGenerator - Reference.cs - - - - - Dynamic - Web References\EuropaCheckVatService\ - http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl - - - - - Settings - Nop_Services_EuropaCheckVatService_checkVatService - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {210541AD-F659-47DA-8763-16F36C5CD2F4} + Library + Properties + Nop.Services + Nop.Services + v4.5.1 + 512 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + ..\..\packages\Autofac.4.4.0\lib\net45\Autofac.dll + True + + + ..\..\packages\EPPlus.4.1.0\lib\net40\EPPlus.dll + True + + + ..\..\packages\ImageResizer.4.0.5\lib\net45\ImageResizer.dll + True + + + ..\..\packages\ImageResizer.Plugins.PrettyGifs.4.0.5\lib\net45\ImageResizer.Plugins.PrettyGifs.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.barcodes.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.forms.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.io.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.kernel.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.layout.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.pdfa.dll + True + + + ..\..\packages\itext7.7.0.1\lib\net40\itext.sign.dll + True + + + ..\..\packages\iTextSharp.5.5.10\lib\itextsharp.dll + True + + + ..\..\packages\MaxMind.Db.2.1.3\lib\net45\MaxMind.Db.dll + True + + + ..\..\packages\MaxMind.GeoIP2.2.7.2\lib\net45\MaxMind.GeoIP2.dll + True + + + ..\..\packages\Microsoft.Azure.KeyVault.Core.2.0.4\lib\net45\Microsoft.Azure.KeyVault.Core.dll + True + + + + ..\..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll + True + + + ..\..\packages\Microsoft.Data.OData.5.8.2\lib\net40\Microsoft.Data.OData.dll + True + + + ..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll + True + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + True + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll + True + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + + + + + ..\..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll + True + + + + + ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + + + ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + + + + + ..\..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll + True + + + + False + ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + + + False + ..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + + + False + ..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + + + + False + ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + + + False + ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + + + False + ..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Settings.settings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Reference.map + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6BDA8332-939F-45B7-A25E-7A797260AE59} + Nop.Core + + + {CCD7F2C9-6A2C-4CF0-8E89-076B8FC0F144} + Nop.Data + + + + + + + + + Designer + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + Reference.map + + + MSDiscoCodeGenerator + Reference.cs + + + + + Dynamic + Web References\EuropaCheckVatService\ + http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl + + + + + Settings + Nop_Services_EuropaCheckVatService_checkVatService + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Orders/AssignInvoiceIdentTask.cs b/src/Libraries/Nop.Services/Orders/AssignInvoiceIdentTask.cs new file mode 100644 index 00000000000..156c68f8696 --- /dev/null +++ b/src/Libraries/Nop.Services/Orders/AssignInvoiceIdentTask.cs @@ -0,0 +1,34 @@ + +using Nop.Services.Logging; +using Nop.Services.Tasks; +using System; + +namespace Nop.Services.Orders +{ + public partial class AssignInvoiceIdentTask : ITask + { + private readonly IOrderProcessingService _orderProcessingService; + private readonly ILogger _logger; + public AssignInvoiceIdentTask(IOrderProcessingService orderProcessingService, + ILogger logger) + { + this._orderProcessingService = orderProcessingService; + this._logger = logger; + } + + /// + /// Executes a task + /// + public void Execute() + { + try + { + _orderProcessingService.AssignInvoiceIdentToOrders(); + } + catch (Exception exc) + { + _logger.Error(string.Format("Error assigning invoice ident. {0}", exc.Message), exc); + } + } + } +} diff --git a/src/Libraries/Nop.Services/Orders/GiftCardService.cs b/src/Libraries/Nop.Services/Orders/GiftCardService.cs index d8d2e1f3f8b..596927044fd 100644 --- a/src/Libraries/Nop.Services/Orders/GiftCardService.cs +++ b/src/Libraries/Nop.Services/Orders/GiftCardService.cs @@ -1,198 +1,198 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Data; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Services.Customers; -using Nop.Services.Events; - -namespace Nop.Services.Orders -{ - /// - /// Gift card service - /// - public partial class GiftCardService : IGiftCardService - { - #region Fields - - private readonly IRepository _giftCardRepository; - private readonly IEventPublisher _eventPublisher; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Gift card context - /// Event published - public GiftCardService(IRepository giftCardRepository, IEventPublisher eventPublisher) - { - _giftCardRepository = giftCardRepository; - _eventPublisher = eventPublisher; - } - - #endregion - - #region Methods - - /// - /// Deletes a gift card - /// - /// Gift card - public virtual void DeleteGiftCard(GiftCard giftCard) - { - if (giftCard == null) - throw new ArgumentNullException("giftCard"); - - _giftCardRepository.Delete(giftCard); - - //event notification - _eventPublisher.EntityDeleted(giftCard); - } - - /// - /// Gets a gift card - /// - /// Gift card identifier - /// Gift card entry - public virtual GiftCard GetGiftCardById(int giftCardId) - { - if (giftCardId == 0) - return null; - - return _giftCardRepository.GetById(giftCardId); - } - - /// - /// Gets all gift cards - /// - /// Associated order ID; null to load all records - /// The order ID in which the gift card was used; null to load all records - /// Created date from (UTC); null to load all records - /// Created date to (UTC); null to load all records - /// Value indicating whether gift card is activated; null to load all records - /// Gift card coupon code; nullto load all records - /// Recipient name; null to load all records - /// Page index - /// Page size - /// Gift cards - public virtual IPagedList GetAllGiftCards(int? purchasedWithOrderId = null, int? usedWithOrderId = null, - DateTime? createdFromUtc = null, DateTime? createdToUtc = null, - bool? isGiftCardActivated = null, string giftCardCouponCode = null, - string recipientName = null, - int pageIndex = 0, int pageSize = int.MaxValue) - { - var query = _giftCardRepository.Table; - if (purchasedWithOrderId.HasValue) - query = query.Where(gc => gc.PurchasedWithOrderItem != null && gc.PurchasedWithOrderItem.OrderId == purchasedWithOrderId.Value); - if (usedWithOrderId.HasValue) - query = query.Where(gc => gc.GiftCardUsageHistory.Any(history => history.UsedWithOrderId == usedWithOrderId)); - if (createdFromUtc.HasValue) - query = query.Where(gc => createdFromUtc.Value <= gc.CreatedOnUtc); - if (createdToUtc.HasValue) - query = query.Where(gc => createdToUtc.Value >= gc.CreatedOnUtc); - if (isGiftCardActivated.HasValue) - query = query.Where(gc => gc.IsGiftCardActivated == isGiftCardActivated.Value); - if (!String.IsNullOrEmpty(giftCardCouponCode)) - query = query.Where(gc => gc.GiftCardCouponCode == giftCardCouponCode); - if (!String.IsNullOrWhiteSpace(recipientName)) - query = query.Where(c => c.RecipientName.Contains(recipientName)); - query = query.OrderByDescending(gc => gc.CreatedOnUtc); - - var giftCards = new PagedList(query, pageIndex, pageSize); - return giftCards; - } - - /// - /// Inserts a gift card - /// - /// Gift card - public virtual void InsertGiftCard(GiftCard giftCard) - { - if (giftCard == null) - throw new ArgumentNullException("giftCard"); - - _giftCardRepository.Insert(giftCard); - - //event notification - _eventPublisher.EntityInserted(giftCard); - } - - /// - /// Updates the gift card - /// - /// Gift card - public virtual void UpdateGiftCard(GiftCard giftCard) - { - if (giftCard == null) - throw new ArgumentNullException("giftCard"); - - _giftCardRepository.Update(giftCard); - - //event notification - _eventPublisher.EntityUpdated(giftCard); - } - - /// - /// Gets gift cards by 'PurchasedWithOrderItemId' - /// - /// Purchased with order item identifier - /// Gift card entries - public virtual IList GetGiftCardsByPurchasedWithOrderItemId(int purchasedWithOrderItemId) - { - if (purchasedWithOrderItemId == 0) - return new List(); - - var query = _giftCardRepository.Table; - query = query.Where(gc => gc.PurchasedWithOrderItemId.HasValue && gc.PurchasedWithOrderItemId.Value == purchasedWithOrderItemId); - query = query.OrderBy(gc => gc.Id); - - var giftCards = query.ToList(); - return giftCards; - } - - /// - /// Get active gift cards that are applied by a customer - /// - /// Customer - /// Active gift cards - public virtual IList GetActiveGiftCardsAppliedByCustomer(Customer customer) - { - var result = new List(); - if (customer == null) - return result; - - string[] couponCodes = customer.ParseAppliedGiftCardCouponCodes(); - foreach (var couponCode in couponCodes) - { - var giftCards = GetAllGiftCards(isGiftCardActivated: true, giftCardCouponCode: couponCode); - foreach (var gc in giftCards) - { - if (gc.IsGiftCardValid()) - result.Add(gc); - } - } - - return result; - } - - /// - /// Generate new gift card code - /// - /// Result - public virtual string GenerateGiftCardCode() - { - int length = 13; - string result = Guid.NewGuid().ToString(); - if (result.Length > length) - result = result.Substring(0, length); - return result; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Data; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Services.Customers; +using Nop.Services.Events; + +namespace Nop.Services.Orders +{ + /// + /// Gift card service + /// + public partial class GiftCardService : IGiftCardService + { + #region Fields + + private readonly IRepository _giftCardRepository; + private readonly IEventPublisher _eventPublisher; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Gift card context + /// Event published + public GiftCardService(IRepository giftCardRepository, IEventPublisher eventPublisher) + { + _giftCardRepository = giftCardRepository; + _eventPublisher = eventPublisher; + } + + #endregion + + #region Methods + + /// + /// Deletes a gift card + /// + /// Gift card + public virtual void DeleteGiftCard(GiftCard giftCard) + { + if (giftCard == null) + throw new ArgumentNullException("giftCard"); + + _giftCardRepository.Delete(giftCard); + + //event notification + _eventPublisher.EntityDeleted(giftCard); + } + + /// + /// Gets a gift card + /// + /// Gift card identifier + /// Gift card entry + public virtual GiftCard GetGiftCardById(int giftCardId) + { + if (giftCardId == 0) + return null; + + return _giftCardRepository.GetById(giftCardId); + } + + /// + /// Gets all gift cards + /// + /// Associated order ID; null to load all records + /// The order ID in which the gift card was used; null to load all records + /// Created date from (UTC); null to load all records + /// Created date to (UTC); null to load all records + /// Value indicating whether gift card is activated; null to load all records + /// Gift card coupon code; nullto load all records + /// Recipient name; null to load all records + /// Page index + /// Page size + /// Gift cards + public virtual IPagedList GetAllGiftCards(int? purchasedWithOrderId = null, int? usedWithOrderId = null, + DateTime? createdFromUtc = null, DateTime? createdToUtc = null, + bool? isGiftCardActivated = null, string giftCardCouponCode = null, + string recipientName = null, + int pageIndex = 0, int pageSize = int.MaxValue) + { + var query = _giftCardRepository.Table; + if (purchasedWithOrderId.HasValue) + query = query.Where(gc => gc.PurchasedWithOrderItem != null && gc.PurchasedWithOrderItem.OrderId == purchasedWithOrderId.Value); + if (usedWithOrderId.HasValue) + query = query.Where(gc => gc.GiftCardUsageHistory.Any(history => history.UsedWithOrderId == usedWithOrderId)); + if (createdFromUtc.HasValue) + query = query.Where(gc => createdFromUtc.Value <= gc.CreatedOnUtc); + if (createdToUtc.HasValue) + query = query.Where(gc => createdToUtc.Value >= gc.CreatedOnUtc); + if (isGiftCardActivated.HasValue) + query = query.Where(gc => gc.IsGiftCardActivated == isGiftCardActivated.Value); + if (!String.IsNullOrEmpty(giftCardCouponCode)) + query = query.Where(gc => gc.GiftCardCouponCode == giftCardCouponCode); + if (!String.IsNullOrWhiteSpace(recipientName)) + query = query.Where(c => c.RecipientName.Contains(recipientName)); + query = query.OrderByDescending(gc => gc.CreatedOnUtc); + + var giftCards = new PagedList(query, pageIndex, pageSize); + return giftCards; + } + + /// + /// Inserts a gift card + /// + /// Gift card + public virtual void InsertGiftCard(GiftCard giftCard) + { + if (giftCard == null) + throw new ArgumentNullException("giftCard"); + + _giftCardRepository.Insert(giftCard); + + //event notification + _eventPublisher.EntityInserted(giftCard); + } + + /// + /// Updates the gift card + /// + /// Gift card + public virtual void UpdateGiftCard(GiftCard giftCard) + { + if (giftCard == null) + throw new ArgumentNullException("giftCard"); + + _giftCardRepository.Update(giftCard); + + //event notification + _eventPublisher.EntityUpdated(giftCard); + } + + /// + /// Gets gift cards by 'PurchasedWithOrderItemId' + /// + /// Purchased with order item identifier + /// Gift card entries + public virtual IList GetGiftCardsByPurchasedWithOrderItemId(int purchasedWithOrderItemId) + { + if (purchasedWithOrderItemId == 0) + return new List(); + + var query = _giftCardRepository.Table; + query = query.Where(gc => gc.PurchasedWithOrderItemId.HasValue && gc.PurchasedWithOrderItemId.Value == purchasedWithOrderItemId); + query = query.OrderBy(gc => gc.Id); + + var giftCards = query.ToList(); + return giftCards; + } + + /// + /// Get active gift cards that are applied by a customer + /// + /// Customer + /// Active gift cards + public virtual IList GetActiveGiftCardsAppliedByCustomer(Customer customer) + { + var result = new List(); + if (customer == null) + return result; + + string[] couponCodes = customer.ParseAppliedGiftCardCouponCodes(); + foreach (var couponCode in couponCodes) + { + var giftCards = GetAllGiftCards(isGiftCardActivated: true, giftCardCouponCode: couponCode); + foreach (var gc in giftCards) + { + if (gc.IsGiftCardValid()) + result.Add(gc); + } + } + + return result; + } + + /// + /// Generate new gift card code + /// + /// Result + public virtual string GenerateGiftCardCode() + { + int length = 13; + string result = Guid.NewGuid().ToString(); + if (result.Length > length) + result = result.Substring(0, length); + return result; + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/IOrderProcessingService.cs b/src/Libraries/Nop.Services/Orders/IOrderProcessingService.cs index c5786a34bb0..e00e62308c8 100644 --- a/src/Libraries/Nop.Services/Orders/IOrderProcessingService.cs +++ b/src/Libraries/Nop.Services/Orders/IOrderProcessingService.cs @@ -1,276 +1,290 @@ -using System.Collections.Generic; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Shipping; -using Nop.Services.Payments; - -namespace Nop.Services.Orders -{ - /// - /// Order processing service interface - /// - public partial interface IOrderProcessingService - { - /// - /// Checks order status - /// - /// Order - /// Validated order - void CheckOrderStatus(Order order); - - /// - /// Places an order - /// - /// Process payment request - /// Place order result - PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentRequest); - - /// - /// Update order totals - /// - /// Parameters for the updating order - void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters); - - /// - /// Deletes an order - /// - /// The order - void DeleteOrder(Order order); - - - /// - /// Process next recurring payment - /// - /// Recurring payment - /// Process payment result (info about last payment for automatic recurring payments) - /// Collection of errors - IEnumerable ProcessNextRecurringPayment(RecurringPayment recurringPayment, ProcessPaymentResult paymentResult = null); - - /// - /// Cancels a recurring payment - /// - /// Recurring payment - IList CancelRecurringPayment(RecurringPayment recurringPayment); - - /// - /// Gets a value indicating whether a customer can cancel recurring payment - /// - /// Customer - /// Recurring Payment - /// value indicating whether a customer can cancel recurring payment - bool CanCancelRecurringPayment(Customer customerToValidate, RecurringPayment recurringPayment); - - /// - /// Gets a value indicating whether a customer can retry last failed recurring payment - /// - /// Customer - /// Recurring Payment - /// True if a customer can retry payment; otherwise false - bool CanRetryLastRecurringPayment(Customer customer, RecurringPayment recurringPayment); - - - - /// - /// Send a shipment - /// - /// Shipment - /// True to notify customer - void Ship(Shipment shipment, bool notifyCustomer); - - /// - /// Marks a shipment as delivered - /// - /// Shipment - /// True to notify customer - void Deliver(Shipment shipment, bool notifyCustomer); - - - - /// - /// Gets a value indicating whether cancel is allowed - /// - /// Order - /// A value indicating whether cancel is allowed - bool CanCancelOrder(Order order); - - /// - /// Cancels order - /// - /// Order - /// True to notify customer - void CancelOrder(Order order, bool notifyCustomer); - - - - /// - /// Gets a value indicating whether order can be marked as authorized - /// - /// Order - /// A value indicating whether order can be marked as authorized - bool CanMarkOrderAsAuthorized(Order order); - - /// - /// Marks order as authorized - /// - /// Order - void MarkAsAuthorized(Order order); - - - - /// - /// Gets a value indicating whether capture from admin panel is allowed - /// - /// Order - /// A value indicating whether capture from admin panel is allowed - bool CanCapture(Order order); - - /// - /// Capture an order (from admin panel) - /// - /// Order - /// A list of errors; empty list if no errors - IList Capture(Order order); - - /// - /// Gets a value indicating whether order can be marked as paid - /// - /// Order - /// A value indicating whether order can be marked as paid - bool CanMarkOrderAsPaid(Order order); - - /// - /// Marks order as paid - /// - /// Order - void MarkOrderAsPaid(Order order); - - - - /// - /// Gets a value indicating whether refund from admin panel is allowed - /// - /// Order - /// A value indicating whether refund from admin panel is allowed - bool CanRefund(Order order); - - /// - /// Refunds an order (from admin panel) - /// - /// Order - /// A list of errors; empty list if no errors - IList Refund(Order order); - - /// - /// Gets a value indicating whether order can be marked as refunded - /// - /// Order - /// A value indicating whether order can be marked as refunded - bool CanRefundOffline(Order order); - - /// - /// Refunds an order (offline) - /// - /// Order - void RefundOffline(Order order); - - /// - /// Gets a value indicating whether partial refund from admin panel is allowed - /// - /// Order - /// Amount to refund - /// A value indicating whether refund from admin panel is allowed - bool CanPartiallyRefund(Order order, decimal amountToRefund); - - /// - /// Partially refunds an order (from admin panel) - /// - /// Order - /// Amount to refund - /// A list of errors; empty list if no errors - IList PartiallyRefund(Order order, decimal amountToRefund); - - /// - /// Gets a value indicating whether order can be marked as partially refunded - /// - /// Order - /// Amount to refund - /// A value indicating whether order can be marked as partially refunded - bool CanPartiallyRefundOffline(Order order, decimal amountToRefund); - - /// - /// Partially refunds an order (offline) - /// - /// Order - /// Amount to refund - void PartiallyRefundOffline(Order order, decimal amountToRefund); - - - - /// - /// Gets a value indicating whether void from admin panel is allowed - /// - /// Order - /// A value indicating whether void from admin panel is allowed - bool CanVoid(Order order); - - /// - /// Voids order (from admin panel) - /// - /// Order - /// Voided order - IList Void(Order order); - - /// - /// Gets a value indicating whether order can be marked as voided - /// - /// Order - /// A value indicating whether order can be marked as voided - bool CanVoidOffline(Order order); - - /// - /// Voids order (offline) - /// - /// Order - void VoidOffline(Order order); - - - - - /// - /// Place order items in current user shopping cart. - /// - /// The order - void ReOrder(Order order); - - /// - /// Check whether return request is allowed - /// - /// Order - /// Result - bool IsReturnRequestAllowed(Order order); - - - - /// - /// Valdiate minimum order sub-total amount - /// - /// Shopping cart - /// true - OK; false - minimum order sub-total amount is not reached - bool ValidateMinOrderSubtotalAmount(IList cart); - - /// - /// Valdiate minimum order total amount - /// - /// Shopping cart - /// true - OK; false - minimum order total amount is not reached - bool ValidateMinOrderTotalAmount(IList cart); - - /// - /// Gets a value indicating whether payment workflow is required - /// - /// Shopping cart - /// A value indicating reward points should be used; null to detect current choice of the customer - /// true - OK; false - minimum order total amount is not reached - bool IsPaymentWorkflowRequired(IList cart, bool? useRewardPoints = null); - } -} +using System.Collections.Generic; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Services.Payments; + +namespace Nop.Services.Orders +{ + /// + /// Order processing service interface + /// + public partial interface IOrderProcessingService + { + /// + /// Checks order status + /// + /// Order + /// Validated order + void CheckOrderStatus(Order order); + + /// + /// Places an order + /// + /// Process payment request + /// Place order result + PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentRequest); + + /// + /// Update order totals + /// + /// Parameters for the updating order + void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters); + + /// + /// Deletes an order + /// + /// The order + void DeleteOrder(Order order); + + + /// + /// Process next recurring payment + /// + /// Recurring payment + /// Process payment result (info about last payment for automatic recurring payments) + /// Collection of errors + IEnumerable ProcessNextRecurringPayment(RecurringPayment recurringPayment, ProcessPaymentResult paymentResult = null); + + /// + /// Cancels a recurring payment + /// + /// Recurring payment + IList CancelRecurringPayment(RecurringPayment recurringPayment); + + /// + /// Gets a value indicating whether a customer can cancel recurring payment + /// + /// Customer + /// Recurring Payment + /// value indicating whether a customer can cancel recurring payment + bool CanCancelRecurringPayment(Customer customerToValidate, RecurringPayment recurringPayment); + + /// + /// Gets a value indicating whether a customer can retry last failed recurring payment + /// + /// Customer + /// Recurring Payment + /// True if a customer can retry payment; otherwise false + bool CanRetryLastRecurringPayment(Customer customer, RecurringPayment recurringPayment); + + + + /// + /// Send a shipment + /// + /// Shipment + /// True to notify customer + void Ship(Shipment shipment, bool notifyCustomer); + + /// + /// Marks a shipment as delivered + /// + /// Shipment + /// True to notify customer + void Deliver(Shipment shipment, bool notifyCustomer); + + + + /// + /// Gets a value indicating whether cancel is allowed + /// + /// Order + /// A value indicating whether cancel is allowed + bool CanCancelOrder(Order order); + + /// + /// Cancels order + /// + /// Order + /// True to notify customer + void CancelOrder(Order order, bool notifyCustomer); + + + + /// + /// Gets a value indicating whether order can be marked as authorized + /// + /// Order + /// A value indicating whether order can be marked as authorized + bool CanMarkOrderAsAuthorized(Order order); + + /// + /// Marks order as authorized + /// + /// Order + void MarkAsAuthorized(Order order); + + + + /// + /// Gets a value indicating whether capture from admin panel is allowed + /// + /// Order + /// A value indicating whether capture from admin panel is allowed + bool CanCapture(Order order); + + /// + /// Capture an order (from admin panel) + /// + /// Order + /// A list of errors; empty list if no errors + IList Capture(Order order); + + /// + /// Gets a value indicating whether order can be marked as paid + /// + /// Order + /// A value indicating whether order can be marked as paid + bool CanMarkOrderAsPaid(Order order); + + /// + /// Marks order as paid + /// + /// Order + void MarkOrderAsPaid(Order order); + + + + /// + /// Gets a value indicating whether refund from admin panel is allowed + /// + /// Order + /// A value indicating whether refund from admin panel is allowed + bool CanRefund(Order order); + + /// + /// Refunds an order (from admin panel) + /// + /// Order + /// A list of errors; empty list if no errors + IList Refund(Order order); + + /// + /// Gets a value indicating whether order can be marked as refunded + /// + /// Order + /// A value indicating whether order can be marked as refunded + bool CanRefundOffline(Order order); + + /// + /// Refunds an order (offline) + /// + /// Order + void RefundOffline(Order order); + + /// + /// Gets a value indicating whether partial refund from admin panel is allowed + /// + /// Order + /// Amount to refund + /// A value indicating whether refund from admin panel is allowed + bool CanPartiallyRefund(Order order, decimal amountToRefund); + + /// + /// Partially refunds an order (from admin panel) + /// + /// Order + /// Amount to refund + /// A list of errors; empty list if no errors + IList PartiallyRefund(Order order, decimal amountToRefund); + + /// + /// Gets a value indicating whether order can be marked as partially refunded + /// + /// Order + /// Amount to refund + /// A value indicating whether order can be marked as partially refunded + bool CanPartiallyRefundOffline(Order order, decimal amountToRefund); + + /// + /// Partially refunds an order (offline) + /// + /// Order + /// Amount to refund + void PartiallyRefundOffline(Order order, decimal amountToRefund); + + + + /// + /// Gets a value indicating whether void from admin panel is allowed + /// + /// Order + /// A value indicating whether void from admin panel is allowed + bool CanVoid(Order order); + + /// + /// Voids order (from admin panel) + /// + /// Order + /// Voided order + IList Void(Order order); + + /// + /// Gets a value indicating whether order can be marked as voided + /// + /// Order + /// A value indicating whether order can be marked as voided + bool CanVoidOffline(Order order); + + /// + /// Voids order (offline) + /// + /// Order + void VoidOffline(Order order); + + + + + /// + /// Place order items in current user shopping cart. + /// + /// The order + void ReOrder(Order order); + + /// + /// Check whether return request is allowed + /// + /// Order + /// Result + bool IsReturnRequestAllowed(Order order); + + + + /// + /// Valdiate minimum order sub-total amount + /// + /// Shopping cart + /// true - OK; false - minimum order sub-total amount is not reached + bool ValidateMinOrderSubtotalAmount(IList cart); + + /// + /// Valdiate minimum order total amount + /// + /// Shopping cart + /// true - OK; false - minimum order total amount is not reached + bool ValidateMinOrderTotalAmount(IList cart); + /// + /// Get next Invoice ID and store settings + /// + /// + string GetInvoiceId(); + + /// + /// Gets a value indicating whether payment workflow is required + /// + /// Shopping cart + /// A value indicating reward points should be used; null to detect current choice of the customer + /// true - OK; false - minimum order total amount is not reached + bool IsPaymentWorkflowRequired(IList cart, bool? useRewardPoints = null); + /// + /// Get next Invoice ID and store settings + /// + /// + string GetInvoiceId(int storeId); + /// + /// Set Invoice ID on orders which passed payment + /// + void AssignInvoiceIdentToOrders(); + } +} diff --git a/src/Libraries/Nop.Services/Orders/IOrderService.cs b/src/Libraries/Nop.Services/Orders/IOrderService.cs index bab91108fbd..8cffb224dd8 100644 --- a/src/Libraries/Nop.Services/Orders/IOrderService.cs +++ b/src/Libraries/Nop.Services/Orders/IOrderService.cs @@ -1,194 +1,199 @@ -using System; -using System.Collections.Generic; -using Nop.Core; -using Nop.Core.Domain.Orders; - -namespace Nop.Services.Orders -{ - /// - /// Order service interface - /// - public partial interface IOrderService - { - #region Orders - - /// - /// Gets an order - /// - /// The order identifier - /// Order - Order GetOrderById(int orderId); - - /// - /// Gets an order - /// - /// The custom order number - /// Order - Order GetOrderByCustomOrderNumber(string customOrderNumber); - - /// - /// Get orders by identifiers - /// - /// Order identifiers - /// Order - IList GetOrdersByIds(int[] orderIds); - - /// - /// Gets an order - /// - /// The order identifier - /// Order - Order GetOrderByGuid(Guid orderGuid); - - /// - /// Deletes an order - /// - /// The order - void DeleteOrder(Order order); - - /// - /// Search orders - /// - /// Store identifier; null to load all orders - /// Vendor identifier; null to load all orders - /// Customer identifier; null to load all orders - /// Product identifier which was purchased in an order; 0 to load all orders - /// Affiliate identifier; 0 to load all orders - /// Billing country identifier; 0 to load all orders - /// Warehouse identifier, only orders with products from a specified warehouse will be loaded; 0 to load all orders - /// Payment method system name; null to load all records - /// Created date from (UTC); null to load all records - /// Created date to (UTC); null to load all records - /// Order status identifiers; null to load all orders - /// Payment status identifiers; null to load all orders - /// Shipping status identifiers; null to load all orders - /// Billing email. Leave empty to load all records. - /// Billing last name. Leave empty to load all records. - /// Search in order notes. Leave empty to load all records. - /// Page index - /// Page size - /// Orders - IPagedList SearchOrders(int storeId = 0, - int vendorId = 0, int customerId = 0, - int productId = 0, int affiliateId = 0, int warehouseId = 0, - int billingCountryId = 0, string paymentMethodSystemName = null, - DateTime? createdFromUtc = null, DateTime? createdToUtc = null, - List osIds = null, List psIds = null, List ssIds = null, - string billingEmail = null, string billingLastName = "", - string orderNotes = null, int pageIndex = 0, int pageSize = int.MaxValue); - - /// - /// Inserts an order - /// - /// Order - void InsertOrder(Order order); - - /// - /// Updates the order - /// - /// The order - void UpdateOrder(Order order); - - /// - /// Get an order by authorization transaction ID and payment method system name - /// - /// Authorization transaction ID - /// Payment method system name - /// Order - Order GetOrderByAuthorizationTransactionIdAndPaymentMethod(string authorizationTransactionId, string paymentMethodSystemName); - - #endregion - - #region Orders items - - /// - /// Gets an order item - /// - /// Order item identifier - /// Order item - OrderItem GetOrderItemById(int orderItemId); - - /// - /// Gets an order item - /// - /// Order item identifier - /// Order item - OrderItem GetOrderItemByGuid(Guid orderItemGuid); - - /// - /// Gets all downloadable order items - /// - /// Customer identifier; null to load all records - /// Order items - IList GetDownloadableOrderItems(int customerId); - - /// - /// Delete an order item - /// - /// The order item - void DeleteOrderItem(OrderItem orderItem); - - #endregion - - #region Order notes - - /// - /// Gets an order note - /// - /// The order note identifier - /// Order note - OrderNote GetOrderNoteById(int orderNoteId); - - /// - /// Deletes an order note - /// - /// The order note - void DeleteOrderNote(OrderNote orderNote); - - #endregion - - #region Recurring payments - - /// - /// Deletes a recurring payment - /// - /// Recurring payment - void DeleteRecurringPayment(RecurringPayment recurringPayment); - - /// - /// Gets a recurring payment - /// - /// The recurring payment identifier - /// Recurring payment - RecurringPayment GetRecurringPaymentById(int recurringPaymentId); - - /// - /// Inserts a recurring payment - /// - /// Recurring payment - void InsertRecurringPayment(RecurringPayment recurringPayment); - - /// - /// Updates the recurring payment - /// - /// Recurring payment - void UpdateRecurringPayment(RecurringPayment recurringPayment); - - /// - /// Search recurring payments - /// - /// The store identifier; 0 to load all records - /// The customer identifier; 0 to load all records - /// The initial order identifier; 0 to load all records - /// Initial order status identifier; null to load all records - /// Page index - /// Page size - /// A value indicating whether to show hidden records - /// Recurring payments - IPagedList SearchRecurringPayments(int storeId = 0, - int customerId = 0, int initialOrderId = 0, OrderStatus? initialOrderStatus = null, - int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false); - - #endregion - } -} +using System; +using System.Collections.Generic; +using Nop.Core; +using Nop.Core.Domain.Orders; + +namespace Nop.Services.Orders +{ + /// + /// Order service interface + /// + public partial interface IOrderService + { + #region Orders + + /// + /// Gets an order + /// + /// The order identifier + /// Order + Order GetOrderById(int orderId); + + /// + /// Gets an order + /// + /// The custom order number + /// Order + Order GetOrderByCustomOrderNumber(string customOrderNumber); + + /// + /// Get orders by identifiers + /// + /// Order identifiers + /// Order + IList GetOrdersByIds(int[] orderIds); + + /// + /// Gets an order + /// + /// The order identifier + /// Order + Order GetOrderByGuid(Guid orderGuid); + + /// + /// Deletes an order + /// + /// The order + void DeleteOrder(Order order); + + /// + /// Search orders + /// + /// Store identifier; null to load all orders + /// Vendor identifier; null to load all orders + /// Customer identifier; null to load all orders + /// Product identifier which was purchased in an order; 0 to load all orders + /// Affiliate identifier; 0 to load all orders + /// Billing country identifier; 0 to load all orders + /// Warehouse identifier, only orders with products from a specified warehouse will be loaded; 0 to load all orders + /// Payment method system name; null to load all records + /// Created date from (UTC); null to load all records + /// Created date to (UTC); null to load all records + /// Order status identifiers; null to load all orders + /// Payment status identifiers; null to load all orders + /// Shipping status identifiers; null to load all orders + /// Billing email. Leave empty to load all records. + /// Billing last name. Leave empty to load all records. + /// Search in order notes. Leave empty to load all records. + /// Page index + /// Page size + /// Orders + IPagedList SearchOrders(int storeId = 0, + int vendorId = 0, int customerId = 0, + int productId = 0, int affiliateId = 0, int warehouseId = 0, + int billingCountryId = 0, string paymentMethodSystemName = null, + DateTime? createdFromUtc = null, DateTime? createdToUtc = null, + List osIds = null, List psIds = null, List ssIds = null, + string billingEmail = null, string billingLastName = "", + string orderNotes = null, int pageIndex = 0, int pageSize = int.MaxValue); + + /// + /// Inserts an order + /// + /// Order + void InsertOrder(Order order); + + /// + /// Updates the order + /// + /// The order + void UpdateOrder(Order order); + + /// + /// Get an order by authorization transaction ID and payment method system name + /// + /// Authorization transaction ID + /// Payment method system name + /// Order + Order GetOrderByAuthorizationTransactionIdAndPaymentMethod(string authorizationTransactionId, string paymentMethodSystemName); + + /// + /// Get all orders to whom an invoice id shouzld be assigned + /// + /// Order + IList GetOrdersToAssignInvoiceId(); + #endregion + + #region Orders items + + /// + /// Gets an order item + /// + /// Order item identifier + /// Order item + OrderItem GetOrderItemById(int orderItemId); + + /// + /// Gets an order item + /// + /// Order item identifier + /// Order item + OrderItem GetOrderItemByGuid(Guid orderItemGuid); + + /// + /// Gets all downloadable order items + /// + /// Customer identifier; null to load all records + /// Order items + IList GetDownloadableOrderItems(int customerId); + + /// + /// Delete an order item + /// + /// The order item + void DeleteOrderItem(OrderItem orderItem); + + #endregion + + #region Order notes + + /// + /// Gets an order note + /// + /// The order note identifier + /// Order note + OrderNote GetOrderNoteById(int orderNoteId); + + /// + /// Deletes an order note + /// + /// The order note + void DeleteOrderNote(OrderNote orderNote); + + #endregion + + #region Recurring payments + + /// + /// Deletes a recurring payment + /// + /// Recurring payment + void DeleteRecurringPayment(RecurringPayment recurringPayment); + + /// + /// Gets a recurring payment + /// + /// The recurring payment identifier + /// Recurring payment + RecurringPayment GetRecurringPaymentById(int recurringPaymentId); + + /// + /// Inserts a recurring payment + /// + /// Recurring payment + void InsertRecurringPayment(RecurringPayment recurringPayment); + + /// + /// Updates the recurring payment + /// + /// Recurring payment + void UpdateRecurringPayment(RecurringPayment recurringPayment); + + /// + /// Search recurring payments + /// + /// The store identifier; 0 to load all records + /// The customer identifier; 0 to load all records + /// The initial order identifier; 0 to load all records + /// Initial order status identifier; null to load all records + /// Page index + /// Page size + /// A value indicating whether to show hidden records + /// Recurring payments + IPagedList SearchRecurringPayments(int storeId = 0, + int customerId = 0, int initialOrderId = 0, OrderStatus? initialOrderStatus = null, + int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false); + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/IOrderTotalCalculationService.cs b/src/Libraries/Nop.Services/Orders/IOrderTotalCalculationService.cs index 55de95480d4..ef53f457ac0 100644 --- a/src/Libraries/Nop.Services/Orders/IOrderTotalCalculationService.cs +++ b/src/Libraries/Nop.Services/Orders/IOrderTotalCalculationService.cs @@ -1,209 +1,205 @@ -using System.Collections.Generic; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Services.Discounts; - -namespace Nop.Services.Orders -{ - /// - /// Order service interface - /// - public partial interface IOrderTotalCalculationService - { - /// - /// Gets shopping cart subtotal - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied discount amount - /// Applied discounts - /// Sub total (without discount) - /// Sub total (with discount) - void GetShoppingCartSubTotal(IList cart, - bool includingTax, - out decimal discountAmount, out List appliedDiscounts, - out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount); - - /// - /// Gets shopping cart subtotal - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied discount amount - /// Applied discounts - /// Sub total (without discount) - /// Sub total (with discount) - /// Tax rates (of order sub total) - void GetShoppingCartSubTotal(IList cart, - bool includingTax, - out decimal discountAmount, out List appliedDiscounts, - out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount, - out SortedDictionary taxRates); - - - - - - /// - /// Adjust shipping rate (free shipping, additional charges, discounts) - /// - /// Shipping rate to adjust - /// Cart - /// Applied discounts - /// Adjusted shipping rate - decimal AdjustShippingRate(decimal shippingRate, - IList cart, out List appliedDiscounts); - - /// - /// Gets shopping cart additional shipping charge - /// - /// Cart - /// Additional shipping charge - decimal GetShoppingCartAdditionalShippingCharge(IList cart); - - /// - /// Gets a value indicating whether shipping is free - /// - /// Cart - /// Subtotal amount; pass null to calculate subtotal - /// A value indicating whether shipping is free - bool IsFreeShipping(IList cart, decimal? subTotal = null); - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// Shipping total - decimal? GetShoppingCartShippingTotal(IList cart); - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Shipping total - decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax); - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied tax rate - /// Shipping total - decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, - out decimal taxRate); - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied tax rate - /// Applied discounts - /// Shipping total - decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, - out decimal taxRate, out List appliedDiscounts); - - - - - - - /// - /// Gets tax - /// - /// Shopping cart - /// A value indicating whether we should use payment method additional fee when calculating tax - /// Tax total - decimal GetTaxTotal(IList cart, bool usePaymentMethodAdditionalFee = true); - - /// - /// Gets tax - /// - /// Shopping cart - /// Tax rates - /// A value indicating whether we should use payment method additional fee when calculating tax - /// Tax total - decimal GetTaxTotal(IList cart, out SortedDictionary taxRates, - bool usePaymentMethodAdditionalFee = true); - - - - - - /// - /// Gets shopping cart total - /// - /// Cart - /// A value indicating reward points should be used; null to detect current choice of the customer - /// A value indicating whether we should use payment method additional fee when calculating order total - /// Shopping cart total;Null if shopping cart total couldn't be calculated now - decimal? GetShoppingCartTotal(IList cart, - bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true); - - /// - /// Gets shopping cart total - /// - /// Cart - /// Applied gift cards - /// Applied discount amount - /// Applied discounts - /// Reward points to redeem - /// Reward points amount in primary store currency to redeem - /// A value indicating reward points should be used; null to detect current choice of the customer - /// A value indicating whether we should use payment method additional fee when calculating order total - /// Shopping cart total;Null if shopping cart total couldn't be calculated now - decimal? GetShoppingCartTotal(IList cart, - out decimal discountAmount, out List appliedDiscounts, - out List appliedGiftCards, - out int redeemedRewardPoints, out decimal redeemedRewardPointsAmount, - bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true); - - - - - /// - /// Update order totals - /// - /// Parameters for the updating order - /// Shopping cart - void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters, IList restoredCart); - - /// - /// Converts existing reward points to amount - /// - /// Reward points - /// Converted value - decimal ConvertRewardPointsToAmount(int rewardPoints); - - /// - /// Converts an amount to reward points - /// - /// Amount - /// Converted value - int ConvertAmountToRewardPoints(decimal amount); - - /// - /// Gets a value indicating whether a customer has minimum amount of reward points to use (if enabled) - /// - /// Reward points to check - /// true - reward points could use; false - cannot be used. - bool CheckMinimumRewardPointsToUseRequirement(int rewardPoints); - - /// - /// Calculate how order total (maximum amount) for which reward points could be earned/reduced - /// - /// Order shipping (including tax) - /// Order total - /// Applicable order total - decimal CalculateApplicableOrderTotalForRewardPoints(decimal orderShippingInclTax, decimal orderTotal); - /// - /// Calculate how much reward points will be earned/reduced based on certain amount spent - /// - /// Customer - /// Amount (in primary store currency) - /// Number of reward points - int CalculateRewardPoints(Customer customer, decimal amount); - } -} +using System.Collections.Generic; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Services.Discounts; +using Nop.Services.Tax; + +namespace Nop.Services.Orders +{ + /// + /// Order service interface + /// + public partial interface IOrderTotalCalculationService + { + /// + /// Gets shopping cart subtotal + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied discount amount + /// Applied discounts + /// Sub total (without discount) + /// Sub total (with discount) + void GetShoppingCartSubTotal(IList cart, + bool includingTax, + out decimal discountAmount, out List appliedDiscounts, + out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount); + + /// + /// Gets shopping cart subtotal + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied discount amount + /// Applied discounts + /// Sub total (without discount) + /// Sub total (with discount) + /// Tax rates summary (of order sub total) + /// Subtotal base amount for earned reward points calculation + void GetShoppingCartSubTotal(IList cart, + bool includingTax, + out decimal discountAmount, out List appliedDiscounts, + out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount, + out TaxSummary taxSummary, + out decimal subTotalEarnedRewardPointsBaseAmount); + + + + + + /// + /// Adjust shipping rate (free shipping, additional charges, discounts) + /// + /// Shipping rate to adjust + /// Cart + /// Applied discounts + /// Adjusted shipping rate + decimal AdjustShippingRate(decimal shippingRate, + IList cart, out List appliedDiscounts); + + /// + /// Gets shopping cart additional shipping charge + /// + /// Cart + /// Additional shipping charge + decimal GetShoppingCartAdditionalShippingCharge(IList cart); + + /// + /// Gets a value indicating whether shipping is free + /// + /// Cart + /// Subtotal amount; pass null to calculate subtotal + /// A value indicating whether shipping is free + bool IsFreeShipping(IList cart, decimal? subTotal = null); + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// Shipping total + decimal? GetShoppingCartShippingTotal(IList cart); + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Shipping total + decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax); + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied tax rate + /// Shipping total + decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, + out decimal taxRate); + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied tax rate + /// Applied discounts + /// Shipping total + decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, + out decimal taxRate, out List appliedDiscounts); + + + + + + + /// + /// Gets tax + /// + /// Shopping cart + /// Tax Summary + /// A value indicating whether we should use payment method additional fee when calculating tax + /// Tax total + decimal GetTaxTotal(IList cart, out TaxSummary taxSummary, bool usePaymentMethodAdditionalFee = true); + + /// + /// Gets tax + /// + /// Shopping cart + /// A value indicating whether calculated amounts should include tax + /// Tax rates summary + /// Applied invoice discounts + /// Applied subtotal discounts + /// Applied shipping discounts + /// Applied gift cards + /// Taxable reward points to redeem + /// Reward points base amount for earned points + /// A value indicating whether we should use payment method additional fee when calculating tax + /// A value indicating reward points should be used; null to detect current choice of the customer + /// Only in the case of updating a stored order: give the reward points amount used in the order. + /// Tax total + decimal GetTaxTotal(IList cart, + bool includingTax, + out TaxSummary taxSummary, + out List appliedDiscounts, + out List subTotalAppliedDiscounts, + out List shippingAppliedDiscounts, + out List appliedGiftCards, + out RewardPoints redeemedRewardPoints, + out decimal earnedRewardPointsBaseAmount, + + bool usePaymentMethodAdditionalFee = true, + bool? useRewardPoints = null, + int? rewardPointsOfOrder = null); + + + + /// + /// Gets shopping cart total + /// + /// Cart + /// A value indicating reward points should be used; null to detect current choice of the customer + /// A value indicating whether we should use payment method additional fee when calculating order total + /// Shopping cart total;Null if shopping cart total couldn't be calculated now + decimal? GetShoppingCartTotal(IList cart, + bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true); + + /// + /// Gets shopping cart total + /// + /// Cart + /// Applied discount amount + /// Applied discounts + /// Applied subtotal discounts + /// Applied shipping discounts + /// Applied gift cards + /// Array of reward points to redeem: earned, purchased, total + /// Tax summary + /// Base amount for reward points to earn + /// A value indicating whether calculated amounts should include tax + /// A value indicating reward points should be used; null to detect current choice of the customer + /// A value indicating whether we should use payment method additional fee when calculating order total + /// Shopping cart total;Null if shopping cart total couldn't be calculated now + decimal? GetShoppingCartTotal(IList cart, + out decimal discountAmount, out List appliedDiscounts, + out List subTotalAppliedDiscounts, + out List shippingAppliedDiscounts, + out List appliedGiftCards, + out RewardPoints redeemedRewardPoints, + out TaxSummary taxSummary, + out decimal earnedRewardPointsBaseAmount, + bool? includingTax = null, + bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true); + + + + + /// + /// Update order totals + /// + /// Parameters for the updating order + /// Shopping cart + void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters, IList restoredCart); + + } +} diff --git a/src/Libraries/Nop.Services/Orders/IRewardPointService.cs b/src/Libraries/Nop.Services/Orders/IRewardPointService.cs index c55cbf79957..98fa364a0d6 100644 --- a/src/Libraries/Nop.Services/Orders/IRewardPointService.cs +++ b/src/Libraries/Nop.Services/Orders/IRewardPointService.cs @@ -19,31 +19,32 @@ public partial interface IRewardPointService /// Page index /// Page size /// Reward point history records - IPagedList GetRewardPointsHistory(int customerId = 0, bool showHidden = false, + IPagedList GetRewardPointsHistory(int customerId = 0, bool showHidden = false, bool showNotActivated = false, int pageIndex = 0, int pageSize = int.MaxValue); /// - /// Add reward points history record + /// Add reward points history record. /// /// Customer - /// Number of points to add + /// Reward points to add /// Store identifier /// Message - /// the order for which points were redeemed as a payment - /// Used amount + /// The order for which points were redeemed (spent) as a payment + /// Flag that indicates if passed amounts in points are used amounts /// Date and time of activating reward points; pass null to immediately activating + /// OrderItem used to purchase reward points /// Reward points history entry identifier int AddRewardPointsHistoryEntry(Customer customer, - int points, int storeId, string message = "", - Order usedWithOrder = null, decimal usedAmount = 0M, DateTime? activatingDate = null); + RewardPoints rewardPoints, int storeId, string message = "", + Order usedWithOrder = null, bool hasUsedAmount = false, DateTime? activatingDate = null, OrderItem orderItem = null); /// /// Gets reward points balance /// /// Customer identifier /// Store identifier; pass - /// Balance - int GetRewardPointsBalance(int customerId, int storeId); + /// RewardPoints class + RewardPoints GetRewardPointsBalance(int customerId, int storeId); /// /// Gets a reward point history entry @@ -57,11 +58,49 @@ int AddRewardPointsHistoryEntry(Customer customer, /// /// Reward point history entry void DeleteRewardPointsHistoryEntry(RewardPointsHistory rewardPointsHistory); - + /// /// Updates the reward point history entry /// /// Reward point history entry void UpdateRewardPointsHistoryEntry(RewardPointsHistory rewardPointsHistory); + + /// + /// Converts existing reward points to amount + /// + /// Reward points + /// Converted value + decimal ConvertRewardPointsToAmount(int rewardPoints); + + /// + /// Converts an amount to reward points + /// + /// Amount + /// overriden exchange rate + /// Converted value + int ConvertAmountToRewardPoints(decimal amount, decimal? overridenExchangeRate = null); + + /// + /// Gets a value indicating whether a customer has minimum amount of reward points to use (if enabled) + /// + /// Reward points to check + /// true - reward points could use; false - cannot be used. + bool CheckMinimumRewardPointsToUseRequirement(int rewardPoints); + + /// + /// Calculate how much reward points will be earned/reduced based on certain amount spent + /// + /// Customer + /// Base amount (in primary store currency) for points calculation + /// Number of reward points + int CalculateRewardPoints(Customer customer, decimal amount); + + /// + /// Calculate base amount for reward points calculation + /// + /// Base amount (in primary store currency) for points calculation + /// Amount of used purchased reward points + /// base amount + decimal GetRewardPointsBaseAmount(decimal amount, decimal purchasedPointsAmount); } } diff --git a/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs b/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs index 97d4a94335b..bb9eea1ee6e 100644 --- a/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs +++ b/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs @@ -1,3167 +1,3336 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Logging; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Core.Domain.Vendors; -using Nop.Services.Affiliates; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Discounts; -using Nop.Services.Events; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Messages; -using Nop.Services.Payments; -using Nop.Services.Security; -using Nop.Services.Shipping; -using Nop.Services.Tax; -using Nop.Services.Vendors; - -namespace Nop.Services.Orders -{ - /// - /// Order processing service - /// - public partial class OrderProcessingService : IOrderProcessingService - { - #region Fields - - private readonly IOrderService _orderService; - private readonly IWebHelper _webHelper; - private readonly ILocalizationService _localizationService; - private readonly ILanguageService _languageService; - private readonly IProductService _productService; - private readonly IPaymentService _paymentService; - private readonly ILogger _logger; - private readonly IOrderTotalCalculationService _orderTotalCalculationService; - private readonly IPriceCalculationService _priceCalculationService; - private readonly IPriceFormatter _priceFormatter; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IProductAttributeFormatter _productAttributeFormatter; - private readonly IGiftCardService _giftCardService; - private readonly IShoppingCartService _shoppingCartService; - private readonly ICheckoutAttributeFormatter _checkoutAttributeFormatter; - private readonly IShippingService _shippingService; - private readonly IShipmentService _shipmentService; - private readonly ITaxService _taxService; - private readonly ICustomerService _customerService; - private readonly IDiscountService _discountService; - private readonly IEncryptionService _encryptionService; - private readonly IWorkContext _workContext; - private readonly IWorkflowMessageService _workflowMessageService; - private readonly IVendorService _vendorService; - private readonly ICustomerActivityService _customerActivityService; - private readonly ICurrencyService _currencyService; - private readonly IAffiliateService _affiliateService; - private readonly IEventPublisher _eventPublisher; - private readonly IPdfService _pdfService; - private readonly IRewardPointService _rewardPointService; - private readonly IGenericAttributeService _genericAttributeService; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - - private readonly ShippingSettings _shippingSettings; - private readonly PaymentSettings _paymentSettings; - private readonly RewardPointsSettings _rewardPointsSettings; - private readonly OrderSettings _orderSettings; - private readonly TaxSettings _taxSettings; - private readonly LocalizationSettings _localizationSettings; - private readonly CurrencySettings _currencySettings; - private readonly ICustomNumberFormatter _customNumberFormatter; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Order service - /// Web helper - /// Localization service - /// Language service - /// Product service - /// Payment service - /// Logger - /// Order total calculationservice - /// Price calculation service - /// Price formatter - /// Product attribute parser - /// Product attribute formatter - /// Gift card service - /// Shopping cart service - /// Checkout attribute service - /// Shipping service - /// Shipment service - /// Tax service - /// Customer service - /// Discount service - /// Encryption service - /// Work context - /// Workflow message service - /// Vendor service - /// Customer activity service - /// Currency service - /// Affiliate service - /// Event published - /// PDF service - /// Reward point service - /// Generic attribute service - /// Country service - /// Payment settings - /// Shipping settings - /// Reward points settings - /// Order settings - /// Tax settings - /// Localization settings - /// Currency settings - /// Custom number formatter - public OrderProcessingService(IOrderService orderService, - IWebHelper webHelper, - ILocalizationService localizationService, - ILanguageService languageService, - IProductService productService, - IPaymentService paymentService, - ILogger logger, - IOrderTotalCalculationService orderTotalCalculationService, - IPriceCalculationService priceCalculationService, - IPriceFormatter priceFormatter, - IProductAttributeParser productAttributeParser, - IProductAttributeFormatter productAttributeFormatter, - IGiftCardService giftCardService, - IShoppingCartService shoppingCartService, - ICheckoutAttributeFormatter checkoutAttributeFormatter, - IShippingService shippingService, - IShipmentService shipmentService, - ITaxService taxService, - ICustomerService customerService, - IDiscountService discountService, - IEncryptionService encryptionService, - IWorkContext workContext, - IWorkflowMessageService workflowMessageService, - IVendorService vendorService, - ICustomerActivityService customerActivityService, - ICurrencyService currencyService, - IAffiliateService affiliateService, - IEventPublisher eventPublisher, - IPdfService pdfService, - IRewardPointService rewardPointService, - IGenericAttributeService genericAttributeService, - ICountryService countryService, - IStateProvinceService stateProvinceService, - ShippingSettings shippingSettings, - PaymentSettings paymentSettings, - RewardPointsSettings rewardPointsSettings, - OrderSettings orderSettings, - TaxSettings taxSettings, - LocalizationSettings localizationSettings, - CurrencySettings currencySettings, - ICustomNumberFormatter customNumberFormatter) - { - this._orderService = orderService; - this._webHelper = webHelper; - this._localizationService = localizationService; - this._languageService = languageService; - this._productService = productService; - this._paymentService = paymentService; - this._logger = logger; - this._orderTotalCalculationService = orderTotalCalculationService; - this._priceCalculationService = priceCalculationService; - this._priceFormatter = priceFormatter; - this._productAttributeParser = productAttributeParser; - this._productAttributeFormatter = productAttributeFormatter; - this._giftCardService = giftCardService; - this._shoppingCartService = shoppingCartService; - this._checkoutAttributeFormatter = checkoutAttributeFormatter; - this._workContext = workContext; - this._workflowMessageService = workflowMessageService; - this._vendorService = vendorService; - this._shippingService = shippingService; - this._shipmentService = shipmentService; - this._taxService = taxService; - this._customerService = customerService; - this._discountService = discountService; - this._encryptionService = encryptionService; - this._customerActivityService = customerActivityService; - this._currencyService = currencyService; - this._affiliateService = affiliateService; - this._eventPublisher = eventPublisher; - this._pdfService = pdfService; - this._rewardPointService = rewardPointService; - this._genericAttributeService = genericAttributeService; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - - this._paymentSettings = paymentSettings; - this._shippingSettings = shippingSettings; - this._rewardPointsSettings = rewardPointsSettings; - this._orderSettings = orderSettings; - this._taxSettings = taxSettings; - this._localizationSettings = localizationSettings; - this._currencySettings = currencySettings; - this._customNumberFormatter = customNumberFormatter; - } - - #endregion - - #region Nested classes - - protected class PlaceOrderContainter - { - public PlaceOrderContainter() - { - this.Cart = new List(); - this.AppliedDiscounts = new List(); - this.AppliedGiftCards = new List(); - } - - public Customer Customer { get; set; } - public Language CustomerLanguage { get; set; } - public int AffiliateId { get; set; } - public TaxDisplayType CustomerTaxDisplayType {get; set; } - public string CustomerCurrencyCode { get; set; } - public decimal CustomerCurrencyRate { get; set; } - - public Address BillingAddress { get; set; } - public Address ShippingAddress {get; set; } - public ShippingStatus ShippingStatus { get; set; } - public string ShippingMethodName { get; set; } - public string ShippingRateComputationMethodSystemName { get; set; } - public bool PickUpInStore { get; set; } - public Address PickupAddress { get; set; } - - public bool IsRecurringShoppingCart { get; set; } - //initial order (used with recurring payments) - public Order InitialOrder { get; set; } - - public string CheckoutAttributeDescription { get; set; } - public string CheckoutAttributesXml { get; set; } - - public IList Cart { get; set; } - public List AppliedDiscounts { get; set; } - public List AppliedGiftCards { get; set; } - - public decimal OrderSubTotalInclTax { get; set; } - public decimal OrderSubTotalExclTax { get; set; } - public decimal OrderSubTotalDiscountInclTax { get; set; } - public decimal OrderSubTotalDiscountExclTax { get; set; } - public decimal OrderShippingTotalInclTax { get; set; } - public decimal OrderShippingTotalExclTax { get; set; } - public decimal PaymentAdditionalFeeInclTax {get; set; } - public decimal PaymentAdditionalFeeExclTax { get; set; } - public decimal OrderTaxTotal {get; set; } - public string VatNumber {get; set; } - public string TaxRates {get; set; } - public decimal OrderDiscountAmount { get; set; } - public int RedeemedRewardPoints { get; set; } - public decimal RedeemedRewardPointsAmount { get; set; } - public decimal OrderTotal { get; set; } - } - - #endregion - - #region Utilities - - /// - /// Prepare details to place an order. It also sets some properties to "processPaymentRequest" - /// - /// Process payment request - /// Details - protected virtual PlaceOrderContainter PreparePlaceOrderDetails(ProcessPaymentRequest processPaymentRequest) - { - var details = new PlaceOrderContainter(); - - //customer - details.Customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); - if (details.Customer == null) - throw new ArgumentException("Customer is not set"); - - //affiliate - var affiliate = _affiliateService.GetAffiliateById(details.Customer.AffiliateId); - if (affiliate != null && affiliate.Active && !affiliate.Deleted) - details.AffiliateId = affiliate.Id; - - //check whether customer is guest - if (details.Customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed) - throw new NopException("Anonymous checkout is not allowed"); - - //customer currency - var currencyTmp = _currencyService.GetCurrencyById( - details.Customer.GetAttribute(SystemCustomerAttributeNames.CurrencyId, processPaymentRequest.StoreId)); - var customerCurrency = (currencyTmp != null && currencyTmp.Published) ? currencyTmp : _workContext.WorkingCurrency; - var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - details.CustomerCurrencyCode = customerCurrency.CurrencyCode; - details.CustomerCurrencyRate = customerCurrency.Rate / primaryStoreCurrency.Rate; - - //customer language - details.CustomerLanguage = _languageService.GetLanguageById( - details.Customer.GetAttribute(SystemCustomerAttributeNames.LanguageId, processPaymentRequest.StoreId)); - if (details.CustomerLanguage == null || !details.CustomerLanguage.Published) - details.CustomerLanguage = _workContext.WorkingLanguage; - - //billing address - if (details.Customer.BillingAddress == null) - throw new NopException("Billing address is not provided"); - - if (!CommonHelper.IsValidEmail(details.Customer.BillingAddress.Email)) - throw new NopException("Email is not valid"); - - details.BillingAddress = (Address)details.Customer.BillingAddress.Clone(); - if (details.BillingAddress.Country != null && !details.BillingAddress.Country.AllowsBilling) - throw new NopException(string.Format("Country '{0}' is not allowed for billing", details.BillingAddress.Country.Name)); - - //checkout attributes - details.CheckoutAttributesXml = details.Customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, processPaymentRequest.StoreId); - details.CheckoutAttributeDescription = _checkoutAttributeFormatter.FormatAttributes(details.CheckoutAttributesXml, details.Customer); - - //load shopping cart - details.Cart = details.Customer.ShoppingCartItems.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart) - .LimitPerStore(processPaymentRequest.StoreId).ToList(); - - if (!details.Cart.Any()) - throw new NopException("Cart is empty"); - - //validate the entire shopping cart - var warnings = _shoppingCartService.GetShoppingCartWarnings(details.Cart, details.CheckoutAttributesXml, true); - if (warnings.Any()) - throw new NopException(warnings.Aggregate(string.Empty, (current, next) => string.Format("{0}{1};", current, next))); - - //validate individual cart items - foreach (var sci in details.Cart) - { - var sciWarnings = _shoppingCartService.GetShoppingCartItemWarnings(details.Customer, - sci.ShoppingCartType, sci.Product, processPaymentRequest.StoreId, sci.AttributesXml, - sci.CustomerEnteredPrice, sci.RentalStartDateUtc, sci.RentalEndDateUtc, sci.Quantity, false); - if (sciWarnings.Any()) - throw new NopException(sciWarnings.Aggregate(string.Empty, (current, next) => string.Format("{0}{1};", current, next))); - } - - //min totals validation - if (!ValidateMinOrderSubtotalAmount(details.Cart)) - { - var minOrderSubtotalAmount = _currencyService.ConvertFromPrimaryStoreCurrency(_orderSettings.MinOrderSubtotalAmount, _workContext.WorkingCurrency); - throw new NopException(string.Format(_localizationService.GetResource("Checkout.MinOrderSubtotalAmount"), - _priceFormatter.FormatPrice(minOrderSubtotalAmount, true, false))); - } - - if (!ValidateMinOrderTotalAmount(details.Cart)) - { - var minOrderTotalAmount = _currencyService.ConvertFromPrimaryStoreCurrency(_orderSettings.MinOrderTotalAmount, _workContext.WorkingCurrency); - throw new NopException(string.Format(_localizationService.GetResource("Checkout.MinOrderTotalAmount"), - _priceFormatter.FormatPrice(minOrderTotalAmount, true, false))); - } - - //tax display type - if (_taxSettings.AllowCustomersToSelectTaxDisplayType) - details.CustomerTaxDisplayType = (TaxDisplayType)details.Customer.GetAttribute(SystemCustomerAttributeNames.TaxDisplayTypeId, processPaymentRequest.StoreId); - else - details.CustomerTaxDisplayType = _taxSettings.TaxDisplayType; - - //sub total (incl tax) - decimal orderSubTotalDiscountAmount; - List orderSubTotalAppliedDiscounts; - decimal subTotalWithoutDiscountBase; - decimal subTotalWithDiscountBase; - _orderTotalCalculationService.GetShoppingCartSubTotal(details.Cart, true, out orderSubTotalDiscountAmount, - out orderSubTotalAppliedDiscounts, out subTotalWithoutDiscountBase, out subTotalWithDiscountBase); - details.OrderSubTotalInclTax = subTotalWithoutDiscountBase; - details.OrderSubTotalDiscountInclTax = orderSubTotalDiscountAmount; - - //discount history - foreach (var disc in orderSubTotalAppliedDiscounts) - if (!details.AppliedDiscounts.ContainsDiscount(disc)) - details.AppliedDiscounts.Add(disc); - - //sub total (excl tax) - _orderTotalCalculationService.GetShoppingCartSubTotal(details.Cart, false, out orderSubTotalDiscountAmount, - out orderSubTotalAppliedDiscounts, out subTotalWithoutDiscountBase, out subTotalWithDiscountBase); - details.OrderSubTotalExclTax = subTotalWithoutDiscountBase; - details.OrderSubTotalDiscountExclTax = orderSubTotalDiscountAmount; - - //shipping info - if (details.Cart.RequiresShipping()) - { - var pickupPoint = details.Customer.GetAttribute(SystemCustomerAttributeNames.SelectedPickupPoint, processPaymentRequest.StoreId); - if (_shippingSettings.AllowPickUpInStore && pickupPoint != null) - { - var country = _countryService.GetCountryByTwoLetterIsoCode(pickupPoint.CountryCode); - var state = _stateProvinceService.GetStateProvinceByAbbreviation(pickupPoint.StateAbbreviation); - - details.PickUpInStore = true; - details.PickupAddress = new Address - { - Address1 = pickupPoint.Address, - City = pickupPoint.City, - Country = country, - StateProvince = state, - ZipPostalCode = pickupPoint.ZipPostalCode, - CreatedOnUtc = DateTime.UtcNow, - }; - } - else - { - if (details.Customer.ShippingAddress == null) - throw new NopException("Shipping address is not provided"); - - if (!CommonHelper.IsValidEmail(details.Customer.ShippingAddress.Email)) - throw new NopException("Email is not valid"); - - //clone shipping address - details.ShippingAddress = (Address)details.Customer.ShippingAddress.Clone(); - if (details.ShippingAddress.Country != null && !details.ShippingAddress.Country.AllowsShipping) - throw new NopException(string.Format("Country '{0}' is not allowed for shipping", details.ShippingAddress.Country.Name)); - } - - var shippingOption = details.Customer.GetAttribute(SystemCustomerAttributeNames.SelectedShippingOption, processPaymentRequest.StoreId); - if (shippingOption != null) - { - details.ShippingMethodName = shippingOption.Name; - details.ShippingRateComputationMethodSystemName = shippingOption.ShippingRateComputationMethodSystemName; - } - - details.ShippingStatus = ShippingStatus.NotYetShipped; - } - else - details.ShippingStatus = ShippingStatus.ShippingNotRequired; - - //shipping total - decimal tax; - List shippingTotalDiscounts; - var orderShippingTotalInclTax = _orderTotalCalculationService.GetShoppingCartShippingTotal(details.Cart, true, out tax, out shippingTotalDiscounts); - var orderShippingTotalExclTax = _orderTotalCalculationService.GetShoppingCartShippingTotal(details.Cart, false); - if (!orderShippingTotalInclTax.HasValue || !orderShippingTotalExclTax.HasValue) - throw new NopException("Shipping total couldn't be calculated"); - - details.OrderShippingTotalInclTax = orderShippingTotalInclTax.Value; - details.OrderShippingTotalExclTax = orderShippingTotalExclTax.Value; - - foreach(var disc in shippingTotalDiscounts) - if (!details.AppliedDiscounts.ContainsDiscount(disc)) - details.AppliedDiscounts.Add(disc); - - //payment total - var paymentAdditionalFee = _paymentService.GetAdditionalHandlingFee(details.Cart, processPaymentRequest.PaymentMethodSystemName); - details.PaymentAdditionalFeeInclTax = _taxService.GetPaymentMethodAdditionalFee(paymentAdditionalFee, true, details.Customer); - details.PaymentAdditionalFeeExclTax = _taxService.GetPaymentMethodAdditionalFee(paymentAdditionalFee, false, details.Customer); - - //tax amount - SortedDictionary taxRatesDictionary; - details.OrderTaxTotal = _orderTotalCalculationService.GetTaxTotal(details.Cart, out taxRatesDictionary); - - //VAT number - var customerVatStatus = (VatNumberStatus)details.Customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); - if (_taxSettings.EuVatEnabled && customerVatStatus == VatNumberStatus.Valid) - details.VatNumber = details.Customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); - - //tax rates - details.TaxRates = taxRatesDictionary.Aggregate(string.Empty, (current, next) => - string.Format("{0}{1}:{2}; ", current, next.Key.ToString(CultureInfo.InvariantCulture), next.Value.ToString(CultureInfo.InvariantCulture))); - - //order total (and applied discounts, gift cards, reward points) - List appliedGiftCards; - List orderAppliedDiscounts; - decimal orderDiscountAmount; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - var orderTotal = _orderTotalCalculationService.GetShoppingCartTotal(details.Cart, out orderDiscountAmount, - out orderAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount); - if (!orderTotal.HasValue) - throw new NopException("Order total couldn't be calculated"); - - details.OrderDiscountAmount = orderDiscountAmount; - details.RedeemedRewardPoints = redeemedRewardPoints; - details.RedeemedRewardPointsAmount = redeemedRewardPointsAmount; - details.AppliedGiftCards = appliedGiftCards; - details.OrderTotal = orderTotal.Value; - - //discount history - foreach (var disc in orderAppliedDiscounts) - if (!details.AppliedDiscounts.ContainsDiscount(disc)) - details.AppliedDiscounts.Add(disc); - - processPaymentRequest.OrderTotal = details.OrderTotal; - - //recurring or standard shopping cart? - details.IsRecurringShoppingCart = details.Cart.IsRecurring(); - if (details.IsRecurringShoppingCart) - { - int recurringCycleLength; - RecurringProductCyclePeriod recurringCyclePeriod; - int recurringTotalCycles; - var recurringCyclesError = details.Cart.GetRecurringCycleInfo(_localizationService, - out recurringCycleLength, out recurringCyclePeriod, out recurringTotalCycles); - if (!string.IsNullOrEmpty(recurringCyclesError)) - throw new NopException(recurringCyclesError); - - processPaymentRequest.RecurringCycleLength = recurringCycleLength; - processPaymentRequest.RecurringCyclePeriod = recurringCyclePeriod; - processPaymentRequest.RecurringTotalCycles = recurringTotalCycles; - } - - return details; - } - - /// - /// Prepare details to place order based on the recurring payment. - /// - /// Process payment request - /// Details - protected virtual PlaceOrderContainter PrepareRecurringOrderDetails(ProcessPaymentRequest processPaymentRequest) - { - var details = new PlaceOrderContainter(); - details.IsRecurringShoppingCart = true; - - //Load initial order - details.InitialOrder = _orderService.GetOrderById(processPaymentRequest.InitialOrderId); - if (details.InitialOrder == null) - throw new ArgumentException("Initial order is not set for recurring payment"); - - processPaymentRequest.PaymentMethodSystemName = details.InitialOrder.PaymentMethodSystemName; - - //customer - details.Customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); - if (details.Customer == null) - throw new ArgumentException("Customer is not set"); - - //affiliate - var affiliate = _affiliateService.GetAffiliateById(details.Customer.AffiliateId); - if (affiliate != null && affiliate.Active && !affiliate.Deleted) - details.AffiliateId = affiliate.Id; - - //check whether customer is guest - if (details.Customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed) - throw new NopException("Anonymous checkout is not allowed"); - - //customer currency - details.CustomerCurrencyCode = details.InitialOrder.CustomerCurrencyCode; - details.CustomerCurrencyRate = details.InitialOrder.CurrencyRate; - - //customer language - details.CustomerLanguage = _languageService.GetLanguageById(details.InitialOrder.CustomerLanguageId); - if (details.CustomerLanguage == null || !details.CustomerLanguage.Published) - details.CustomerLanguage = _workContext.WorkingLanguage; - - //billing address - if (details.InitialOrder.BillingAddress == null) - throw new NopException("Billing address is not available"); - - details.BillingAddress = (Address)details.InitialOrder.BillingAddress.Clone(); - if (details.BillingAddress.Country != null && !details.BillingAddress.Country.AllowsBilling) - throw new NopException(string.Format("Country '{0}' is not allowed for billing", details.BillingAddress.Country.Name)); - - //checkout attributes - details.CheckoutAttributesXml = details.InitialOrder.CheckoutAttributesXml; - details.CheckoutAttributeDescription = details.InitialOrder.CheckoutAttributeDescription; - - //tax display type - details.CustomerTaxDisplayType = details.InitialOrder.CustomerTaxDisplayType; - - //sub total - details.OrderSubTotalInclTax = details.InitialOrder.OrderSubtotalInclTax; - details.OrderSubTotalExclTax = details.InitialOrder.OrderSubtotalExclTax; - - //shipping info - if (details.InitialOrder.ShippingStatus != ShippingStatus.ShippingNotRequired) - { - details.PickUpInStore = details.InitialOrder.PickUpInStore; - if (!details.PickUpInStore) - { - if (details.InitialOrder.ShippingAddress == null) - throw new NopException("Shipping address is not available"); - - //clone shipping address - details.ShippingAddress = (Address)details.InitialOrder.ShippingAddress.Clone(); - if (details.ShippingAddress.Country != null && !details.ShippingAddress.Country.AllowsShipping) - throw new NopException(string.Format("Country '{0}' is not allowed for shipping", details.ShippingAddress.Country.Name)); - } - else - if (details.InitialOrder.PickupAddress != null) - details.PickupAddress = (Address)details.InitialOrder.PickupAddress.Clone(); - details.ShippingMethodName = details.InitialOrder.ShippingMethod; - details.ShippingRateComputationMethodSystemName = details.InitialOrder.ShippingRateComputationMethodSystemName; - details.ShippingStatus = ShippingStatus.NotYetShipped; - } - else - details.ShippingStatus = ShippingStatus.ShippingNotRequired; - - //shipping total - details.OrderShippingTotalInclTax = details.InitialOrder.OrderShippingInclTax; - details.OrderShippingTotalExclTax = details.InitialOrder.OrderShippingExclTax; - - //payment total - details.PaymentAdditionalFeeInclTax = details.InitialOrder.PaymentMethodAdditionalFeeInclTax; - details.PaymentAdditionalFeeExclTax = details.InitialOrder.PaymentMethodAdditionalFeeExclTax; - - //tax total - details.OrderTaxTotal = details.InitialOrder.OrderTax; - - //VAT number - details.VatNumber = details.InitialOrder.VatNumber; - - //order total - details.OrderDiscountAmount = details.InitialOrder.OrderDiscount; - details.OrderTotal = details.InitialOrder.OrderTotal; - processPaymentRequest.OrderTotal = details.OrderTotal; - - return details; - } - - /// - /// Save order and add order notes - /// - /// Process payment request - /// Process payment result - /// Details - /// Order - protected virtual Order SaveOrderDetails(ProcessPaymentRequest processPaymentRequest, - ProcessPaymentResult processPaymentResult, PlaceOrderContainter details) - { - var order = new Order - { - StoreId = processPaymentRequest.StoreId, - OrderGuid = processPaymentRequest.OrderGuid, - CustomerId = details.Customer.Id, - CustomerLanguageId = details.CustomerLanguage.Id, - CustomerTaxDisplayType = details.CustomerTaxDisplayType, - CustomerIp = _webHelper.GetCurrentIpAddress(), - OrderSubtotalInclTax = details.OrderSubTotalInclTax, - OrderSubtotalExclTax = details.OrderSubTotalExclTax, - OrderSubTotalDiscountInclTax = details.OrderSubTotalDiscountInclTax, - OrderSubTotalDiscountExclTax = details.OrderSubTotalDiscountExclTax, - OrderShippingInclTax = details.OrderShippingTotalInclTax, - OrderShippingExclTax = details.OrderShippingTotalExclTax, - PaymentMethodAdditionalFeeInclTax = details.PaymentAdditionalFeeInclTax, - PaymentMethodAdditionalFeeExclTax = details.PaymentAdditionalFeeExclTax, - TaxRates = details.TaxRates, - OrderTax = details.OrderTaxTotal, - OrderTotal = details.OrderTotal, - RefundedAmount = decimal.Zero, - OrderDiscount = details.OrderDiscountAmount, - CheckoutAttributeDescription = details.CheckoutAttributeDescription, - CheckoutAttributesXml = details.CheckoutAttributesXml, - CustomerCurrencyCode = details.CustomerCurrencyCode, - CurrencyRate = details.CustomerCurrencyRate, - AffiliateId = details.AffiliateId, - OrderStatus = OrderStatus.Pending, - AllowStoringCreditCardNumber = processPaymentResult.AllowStoringCreditCardNumber, - CardType = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardType) : string.Empty, - CardName = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardName) : string.Empty, - CardNumber = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardNumber) : string.Empty, - MaskedCreditCardNumber = _encryptionService.EncryptText(_paymentService.GetMaskedCreditCardNumber(processPaymentRequest.CreditCardNumber)), - CardCvv2 = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardCvv2) : string.Empty, - CardExpirationMonth = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardExpireMonth.ToString()) : string.Empty, - CardExpirationYear = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardExpireYear.ToString()) : string.Empty, - PaymentMethodSystemName = processPaymentRequest.PaymentMethodSystemName, - AuthorizationTransactionId = processPaymentResult.AuthorizationTransactionId, - AuthorizationTransactionCode = processPaymentResult.AuthorizationTransactionCode, - AuthorizationTransactionResult = processPaymentResult.AuthorizationTransactionResult, - CaptureTransactionId = processPaymentResult.CaptureTransactionId, - CaptureTransactionResult = processPaymentResult.CaptureTransactionResult, - SubscriptionTransactionId = processPaymentResult.SubscriptionTransactionId, - PaymentStatus = processPaymentResult.NewPaymentStatus, - PaidDateUtc = null, - BillingAddress = details.BillingAddress, - ShippingAddress = details.ShippingAddress, - ShippingStatus = details.ShippingStatus, - ShippingMethod = details.ShippingMethodName, - PickUpInStore = details.PickUpInStore, - PickupAddress = details.PickupAddress, - ShippingRateComputationMethodSystemName = details.ShippingRateComputationMethodSystemName, - CustomValuesXml = processPaymentRequest.SerializeCustomValues(), - VatNumber = details.VatNumber, - CreatedOnUtc = DateTime.UtcNow, - CustomOrderNumber = string.Empty - }; - - _orderService.InsertOrder(order); - - //generate and set custom order number - order.CustomOrderNumber = _customNumberFormatter.GenerateOrderCustomNumber(order); - _orderService.UpdateOrder(order); - - //reward points history - if (details.RedeemedRewardPointsAmount > decimal.Zero) - { - _rewardPointService.AddRewardPointsHistoryEntry(details.Customer, -details.RedeemedRewardPoints, order.StoreId, - string.Format(_localizationService.GetResource("RewardPoints.Message.RedeemedForOrder", order.CustomerLanguageId), order.CustomOrderNumber), - order, details.RedeemedRewardPointsAmount); - _customerService.UpdateCustomer(details.Customer); - } - - return order; - } - - /// - /// Send "order placed" notifications and save order notes - /// - /// Order - protected virtual void SendNotificationsAndSaveNotes(Order order) - { - //notes, messages - if (_workContext.OriginalCustomerIfImpersonated != null) - //this order is placed by a store administrator impersonating a customer - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order placed by a store owner ('{0}'. ID = {1}) impersonating the customer.", - _workContext.OriginalCustomerIfImpersonated.Email, _workContext.OriginalCustomerIfImpersonated.Id), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - else - order.OrderNotes.Add(new OrderNote - { - Note = "Order placed", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //send email notifications - var orderPlacedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderPlacedStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId); - if (orderPlacedStoreOwnerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order placed\" email (to store owner) has been queued. Queued email identifier: {0}.", orderPlacedStoreOwnerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - - var orderPlacedAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderPlacedEmail ? - _pdfService.PrintOrderToPdf(order) : null; - var orderPlacedAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderPlacedEmail ? - "order.pdf" : null; - var orderPlacedCustomerNotificationQueuedEmailId = _workflowMessageService - .SendOrderPlacedCustomerNotification(order, order.CustomerLanguageId, orderPlacedAttachmentFilePath, orderPlacedAttachmentFileName); - if (orderPlacedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order placed\" email (to customer) has been queued. Queued email identifier: {0}.", orderPlacedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - - var vendors = GetVendorsInOrder(order); - foreach (var vendor in vendors) - { - var orderPlacedVendorNotificationQueuedEmailId = _workflowMessageService.SendOrderPlacedVendorNotification(order, vendor, _localizationSettings.DefaultAdminLanguageId); - if (orderPlacedVendorNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order placed\" email (to vendor) has been queued. Queued email identifier: {0}.", orderPlacedVendorNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - } - } - /// - /// Award (earn) reward points (for placing a new order) - /// - /// Order - protected virtual void AwardRewardPoints(Order order) - { - var totalForRewardPoints = _orderTotalCalculationService.CalculateApplicableOrderTotalForRewardPoints(order.OrderShippingInclTax, order.OrderTotal); - int points = _orderTotalCalculationService.CalculateRewardPoints(order.Customer, totalForRewardPoints); - if (points == 0) - return; - - //Ensure that reward points were not added (earned) before. We should not add reward points if they were already earned for this order - if (order.RewardPointsHistoryEntryId.HasValue) - return; - - //check whether delay is set - DateTime? activatingDate = null; - if (_rewardPointsSettings.ActivationDelay > 0) - { - var delayPeriod = (RewardPointsActivatingDelayPeriod)_rewardPointsSettings.ActivationDelayPeriodId; - var delayInHours = delayPeriod.ToHours(_rewardPointsSettings.ActivationDelay); - activatingDate = DateTime.UtcNow.AddHours(delayInHours); - } - - //add reward points - order.RewardPointsHistoryEntryId = _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, points, order.StoreId, - string.Format(_localizationService.GetResource("RewardPoints.Message.EarnedForOrder"), order.CustomOrderNumber), activatingDate: activatingDate); - - _orderService.UpdateOrder(order); - } - - /// - /// Reduce (cancel) reward points (previously awarded for placing an order) - /// - /// Order - protected virtual void ReduceRewardPoints(Order order) - { - var totalForRewardPoints = _orderTotalCalculationService.CalculateApplicableOrderTotalForRewardPoints(order.OrderShippingInclTax, order.OrderTotal); - int points = _orderTotalCalculationService.CalculateRewardPoints(order.Customer, totalForRewardPoints); - if (points == 0) - return; - - //ensure that reward points were already earned for this order before - if (!order.RewardPointsHistoryEntryId.HasValue) - return; - - //get appropriate history entry - var rewardPointsHistoryEntry = _rewardPointService.GetRewardPointsHistoryEntryById(order.RewardPointsHistoryEntryId.Value); - if (rewardPointsHistoryEntry != null && rewardPointsHistoryEntry.CreatedOnUtc > DateTime.UtcNow) - { - //just delete the upcoming entry (points were not granted yet) - _rewardPointService.DeleteRewardPointsHistoryEntry(rewardPointsHistoryEntry); - } - else - { - //or reduce reward points if the entry already exists - _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, -points, order.StoreId, - string.Format(_localizationService.GetResource("RewardPoints.Message.ReducedForOrder"), order.CustomOrderNumber)); - } - - _orderService.UpdateOrder(order); - } - - /// - /// Return back redeemded reward points to a customer (spent when placing an order) - /// - /// Order - protected virtual void ReturnBackRedeemedRewardPoints(Order order) - { - //were some points redeemed when placing an order? - if (order.RedeemedRewardPointsEntry == null) - return; - - //return back - _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, -order.RedeemedRewardPointsEntry.Points, order.StoreId, - string.Format(_localizationService.GetResource("RewardPoints.Message.ReturnedForOrder"), order.CustomOrderNumber)); - _orderService.UpdateOrder(order); - } - - - /// - /// Set IsActivated value for purchase gift cards for particular order - /// - /// Order - /// A value indicating whether to activate gift cards; true - activate, false - deactivate - protected virtual void SetActivatedValueForPurchasedGiftCards(Order order, bool activate) - { - var giftCards = _giftCardService.GetAllGiftCards(purchasedWithOrderId: order.Id, - isGiftCardActivated: !activate); - foreach (var gc in giftCards) - { - if (activate) - { - //activate - bool isRecipientNotified = gc.IsRecipientNotified; - if (gc.GiftCardType == GiftCardType.Virtual) - { - //send email for virtual gift card - if (!String.IsNullOrEmpty(gc.RecipientEmail) && - !String.IsNullOrEmpty(gc.SenderEmail)) - { - var customerLang = _languageService.GetLanguageById(order.CustomerLanguageId); - if (customerLang == null) - customerLang = _languageService.GetAllLanguages().FirstOrDefault(); - if (customerLang == null) - throw new Exception("No languages could be loaded"); - int queuedEmailId = _workflowMessageService.SendGiftCardNotification(gc, customerLang.Id); - if (queuedEmailId > 0) - isRecipientNotified = true; - } - } - gc.IsGiftCardActivated = true; - gc.IsRecipientNotified = isRecipientNotified; - _giftCardService.UpdateGiftCard(gc); - } - else - { - //deactivate - gc.IsGiftCardActivated = false; - _giftCardService.UpdateGiftCard(gc); - } - } - } - - /// - /// Sets an order status - /// - /// Order - /// New order status - /// True to notify customer - protected virtual void SetOrderStatus(Order order, OrderStatus os, bool notifyCustomer) - { - if (order == null) - throw new ArgumentNullException("order"); - - OrderStatus prevOrderStatus = order.OrderStatus; - if (prevOrderStatus == os) - return; - - //set and save new order status - order.OrderStatusId = (int)os; - _orderService.UpdateOrder(order); - - //order notes, notifications - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order status has been changed to {0}", os.ToString()), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - - if (prevOrderStatus != OrderStatus.Complete && - os == OrderStatus.Complete - && notifyCustomer) - { - //notification - var orderCompletedAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ? - _pdfService.PrintOrderToPdf(order) : null; - var orderCompletedAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ? - "order.pdf" : null; - int orderCompletedCustomerNotificationQueuedEmailId = _workflowMessageService - .SendOrderCompletedCustomerNotification(order, order.CustomerLanguageId, orderCompletedAttachmentFilePath, - orderCompletedAttachmentFileName); - if (orderCompletedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order completed\" email (to customer) has been queued. Queued email identifier: {0}.", orderCompletedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - } - - if (prevOrderStatus != OrderStatus.Cancelled && - os == OrderStatus.Cancelled - && notifyCustomer) - { - //notification - int orderCancelledCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderCancelledCustomerNotification(order, order.CustomerLanguageId); - if (orderCancelledCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order cancelled\" email (to customer) has been queued. Queued email identifier: {0}.", orderCancelledCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - } - - //reward points - if (order.OrderStatus == OrderStatus.Complete) - { - AwardRewardPoints(order); - } - if (order.OrderStatus == OrderStatus.Cancelled) - { - ReduceRewardPoints(order); - } - - //gift cards activation - if (_orderSettings.ActivateGiftCardsAfterCompletingOrder && order.OrderStatus == OrderStatus.Complete) - { - SetActivatedValueForPurchasedGiftCards(order, true); - } - - //gift cards deactivation - if (_orderSettings.DeactivateGiftCardsAfterCancellingOrder && order.OrderStatus == OrderStatus.Cancelled) - { - SetActivatedValueForPurchasedGiftCards(order, false); - } - } - - /// - /// Process order paid status - /// - /// Order - protected virtual void ProcessOrderPaid(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - //raise event - _eventPublisher.Publish(new OrderPaidEvent(order)); - - //order paid email notification - if (order.OrderTotal != decimal.Zero) - { - //we should not send it for free ($0 total) orders? - //remove this "if" statement if you want to send it in this case - - var orderPaidAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderPaidEmail ? - _pdfService.PrintOrderToPdf(order) : null; - var orderPaidAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderPaidEmail ? - "order.pdf" : null; - _workflowMessageService.SendOrderPaidCustomerNotification(order, order.CustomerLanguageId, - orderPaidAttachmentFilePath, orderPaidAttachmentFileName); - - _workflowMessageService.SendOrderPaidStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId); - var vendors = GetVendorsInOrder(order); - foreach (var vendor in vendors) - { - _workflowMessageService.SendOrderPaidVendorNotification(order, vendor, _localizationSettings.DefaultAdminLanguageId); - } - //TODO add "order paid email sent" order note - } - - //customer roles with "purchased with product" specified - ProcessCustomerRolesWithPurchasedProductSpecified(order, true); - } - - /// - /// Process customer roles with "Purchased with Product" property configured - /// - /// Order - /// A value indicating whether to add configured customer role; true - add, false - remove - protected virtual void ProcessCustomerRolesWithPurchasedProductSpecified(Order order, bool add) - { - if (order == null) - throw new ArgumentNullException("order"); - - //purchased product identifiers - var purchasedProductIds = new List(); - foreach (var orderItem in order.OrderItems) - { - //standard items - purchasedProductIds.Add(orderItem.ProductId); - - //bundled (associated) products - var attributeValues = _productAttributeParser.ParseProductAttributeValues(orderItem.AttributesXml); - foreach (var attributeValue in attributeValues) - { - if (attributeValue.AttributeValueType == AttributeValueType.AssociatedToProduct) - { - purchasedProductIds.Add(attributeValue.AssociatedProductId); - } - } - } - - //list of customer roles - var customerRoles = _customerService - .GetAllCustomerRoles(true) - .Where(cr => purchasedProductIds.Contains(cr.PurchasedWithProductId)) - .ToList(); - - if (customerRoles.Any()) - { - var customer = order.Customer; - foreach (var customerRole in customerRoles) - { - if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) == 0) - { - //not in the list yet - if (add) - { - //add - customer.CustomerRoles.Add(customerRole); - } - } - else - { - //already in the list - if (!add) - { - //remove - customer.CustomerRoles.Remove(customerRole); - } - } - } - _customerService.UpdateCustomer(customer); - } - } - - /// - /// Get a list of vendors in order (order items) - /// - /// Order - /// Vendors - protected virtual IList GetVendorsInOrder(Order order) - { - var vendors = new List(); - foreach (var orderItem in order.OrderItems) - { - var vendorId = orderItem.Product.VendorId; - //find existing - var vendor = vendors.FirstOrDefault(v => v.Id == vendorId); - if (vendor == null) - { - //not found. load by Id - vendor = _vendorService.GetVendorById(vendorId); - if (vendor != null && !vendor.Deleted && vendor.Active) - { - vendors.Add(vendor); - } - } - } - - return vendors; - } - - #endregion - - #region Methods - - /// - /// Checks order status - /// - /// Order - /// Validated order - public virtual void CheckOrderStatus(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.PaymentStatus == PaymentStatus.Paid && !order.PaidDateUtc.HasValue) - { - //ensure that paid date is set - order.PaidDateUtc = DateTime.UtcNow; - _orderService.UpdateOrder(order); - } - - if (order.OrderStatus == OrderStatus.Pending) - { - if (order.PaymentStatus == PaymentStatus.Authorized || - order.PaymentStatus == PaymentStatus.Paid) - { - SetOrderStatus(order, OrderStatus.Processing, false); - } - } - - if (order.OrderStatus == OrderStatus.Pending) - { - if (order.ShippingStatus == ShippingStatus.PartiallyShipped || - order.ShippingStatus == ShippingStatus.Shipped || - order.ShippingStatus == ShippingStatus.Delivered) - { - SetOrderStatus(order, OrderStatus.Processing, false); - } - } - - //is order complete? - if (order.OrderStatus != OrderStatus.Cancelled && - order.OrderStatus != OrderStatus.Complete) - { - if (order.PaymentStatus == PaymentStatus.Paid) - { - var completed = false; - if (order.ShippingStatus == ShippingStatus.ShippingNotRequired) - { - //shipping is not required - completed = true; - } - else - { - //shipping is required - if (_orderSettings.CompleteOrderWhenDelivered) - { - completed = order.ShippingStatus == ShippingStatus.Delivered; - } - else - { - completed = order.ShippingStatus == ShippingStatus.Shipped || - order.ShippingStatus == ShippingStatus.Delivered; - } - } - - if (completed) - { - SetOrderStatus(order, OrderStatus.Complete, true); - } - } - } - } - - /// - /// Places an order - /// - /// Process payment request - /// Place order result - public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentRequest) - { - if (processPaymentRequest == null) - throw new ArgumentNullException("processPaymentRequest"); - - var result = new PlaceOrderResult(); - try - { - if (processPaymentRequest.OrderGuid == Guid.Empty) - processPaymentRequest.OrderGuid = Guid.NewGuid(); - - //prepare order details - var details = PreparePlaceOrderDetails(processPaymentRequest); - - #region Payment workflow - - - //process payment - ProcessPaymentResult processPaymentResult = null; - //skip payment workflow if order total equals zero - var skipPaymentWorkflow = details.OrderTotal == decimal.Zero; - if (!skipPaymentWorkflow) - { - var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - - //ensure that payment method is active - if (!paymentMethod.IsPaymentMethodActive(_paymentSettings)) - throw new NopException("Payment method is not active"); - - if (details.IsRecurringShoppingCart) - { - //recurring cart - switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) - { - case RecurringPaymentType.NotSupported: - throw new NopException("Recurring payments are not supported by selected payment method"); - case RecurringPaymentType.Manual: - case RecurringPaymentType.Automatic: - processPaymentResult = _paymentService.ProcessRecurringPayment(processPaymentRequest); - break; - default: - throw new NopException("Not supported recurring payment type"); - } - } - else - //standard cart - processPaymentResult = _paymentService.ProcessPayment(processPaymentRequest); - } - else - //payment is not required - processPaymentResult = new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid }; - - if (processPaymentResult == null) - throw new NopException("processPaymentResult is not available"); - - #endregion - - if (processPaymentResult.Success) - { - #region Save order details - - var order = SaveOrderDetails(processPaymentRequest, processPaymentResult, details); - result.PlacedOrder = order; - - //move shopping cart items to order items - foreach (var sc in details.Cart) - { - //prices - decimal taxRate; - List scDiscounts; - decimal discountAmount; - int? maximumDiscountQty; - var scUnitPrice = _priceCalculationService.GetUnitPrice(sc); - var scSubTotal = _priceCalculationService.GetSubTotal(sc, true, out discountAmount, out scDiscounts, out maximumDiscountQty); - var scUnitPriceInclTax = _taxService.GetProductPrice(sc.Product, scUnitPrice, true, details.Customer, out taxRate); - var scUnitPriceExclTax = _taxService.GetProductPrice(sc.Product, scUnitPrice, false, details.Customer, out taxRate); - var scSubTotalInclTax = _taxService.GetProductPrice(sc.Product, scSubTotal, true, details.Customer, out taxRate); - var scSubTotalExclTax = _taxService.GetProductPrice(sc.Product, scSubTotal, false, details.Customer, out taxRate); - var discountAmountInclTax = _taxService.GetProductPrice(sc.Product, discountAmount, true, details.Customer, out taxRate); - var discountAmountExclTax = _taxService.GetProductPrice(sc.Product, discountAmount, false, details.Customer, out taxRate); - foreach (var disc in scDiscounts) - if (!details.AppliedDiscounts.ContainsDiscount(disc)) - details.AppliedDiscounts.Add(disc); - - //attributes - var attributeDescription = _productAttributeFormatter.FormatAttributes(sc.Product, sc.AttributesXml, details.Customer); - - var itemWeight = _shippingService.GetShoppingCartItemWeight(sc); - - //save order item - var orderItem = new OrderItem - { - OrderItemGuid = Guid.NewGuid(), - Order = order, - ProductId = sc.ProductId, - UnitPriceInclTax = scUnitPriceInclTax, - UnitPriceExclTax = scUnitPriceExclTax, - PriceInclTax = scSubTotalInclTax, - PriceExclTax = scSubTotalExclTax, - OriginalProductCost = _priceCalculationService.GetProductCost(sc.Product, sc.AttributesXml), - AttributeDescription = attributeDescription, - AttributesXml = sc.AttributesXml, - Quantity = sc.Quantity, - DiscountAmountInclTax = discountAmountInclTax, - DiscountAmountExclTax = discountAmountExclTax, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = itemWeight, - RentalStartDateUtc = sc.RentalStartDateUtc, - RentalEndDateUtc = sc.RentalEndDateUtc - }; - order.OrderItems.Add(orderItem); - _orderService.UpdateOrder(order); - - //gift cards - if (sc.Product.IsGiftCard) - { - string giftCardRecipientName; - string giftCardRecipientEmail; - string giftCardSenderName; - string giftCardSenderEmail; - string giftCardMessage; - _productAttributeParser.GetGiftCardAttribute(sc.AttributesXml, out giftCardRecipientName, - out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); - - for (var i = 0; i < sc.Quantity; i++) - { - _giftCardService.InsertGiftCard(new GiftCard - { - GiftCardType = sc.Product.GiftCardType, - PurchasedWithOrderItem = orderItem, - Amount = sc.Product.OverriddenGiftCardAmount.HasValue ? sc.Product.OverriddenGiftCardAmount.Value : scUnitPriceExclTax, - IsGiftCardActivated = false, - GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), - RecipientName = giftCardRecipientName, - RecipientEmail = giftCardRecipientEmail, - SenderName = giftCardSenderName, - SenderEmail = giftCardSenderEmail, - Message = giftCardMessage, - IsRecipientNotified = false, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - - //inventory - _productService.AdjustInventory(sc.Product, -sc.Quantity, sc.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.PlaceOrder"), order.Id)); - } - - //clear shopping cart - details.Cart.ToList().ForEach(sci => _shoppingCartService.DeleteShoppingCartItem(sci, false)); - - //discount usage history - foreach (var discount in details.AppliedDiscounts) - { - var d = _discountService.GetDiscountById(discount.Id); - if (d != null) - { - _discountService.InsertDiscountUsageHistory(new DiscountUsageHistory - { - Discount = d, - Order = order, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - - //gift card usage history - if (details.AppliedGiftCards != null) - foreach (var agc in details.AppliedGiftCards) - { - agc.GiftCard.GiftCardUsageHistory.Add(new GiftCardUsageHistory - { - GiftCard = agc.GiftCard, - UsedWithOrder = order, - UsedValue = agc.AmountCanBeUsed, - CreatedOnUtc = DateTime.UtcNow - }); - _giftCardService.UpdateGiftCard(agc.GiftCard); - } - - //recurring orders - if (details.IsRecurringShoppingCart) - { - //create recurring payment (the first payment) - var rp = new RecurringPayment - { - CycleLength = processPaymentRequest.RecurringCycleLength, - CyclePeriod = processPaymentRequest.RecurringCyclePeriod, - TotalCycles = processPaymentRequest.RecurringTotalCycles, - StartDateUtc = DateTime.UtcNow, - IsActive = true, - CreatedOnUtc = DateTime.UtcNow, - InitialOrder = order, - }; - _orderService.InsertRecurringPayment(rp); - - switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) - { - case RecurringPaymentType.NotSupported: - //not supported - break; - case RecurringPaymentType.Manual: - rp.RecurringPaymentHistory.Add(new RecurringPaymentHistory - { - RecurringPayment = rp, - CreatedOnUtc = DateTime.UtcNow, - OrderId = order.Id, - }); - _orderService.UpdateRecurringPayment(rp); - break; - case RecurringPaymentType.Automatic: - //will be created later (process is automated) - break; - default: - break; - } - } - - #endregion - - //notifications - SendNotificationsAndSaveNotes(order); - - //reset checkout data - _customerService.ResetCheckoutData(details.Customer, processPaymentRequest.StoreId, clearCouponCodes: true, clearCheckoutAttributes: true); - _customerActivityService.InsertActivity("PublicStore.PlaceOrder", _localizationService.GetResource("ActivityLog.PublicStore.PlaceOrder"), order.Id); - - //check order status - CheckOrderStatus(order); - - //raise event - _eventPublisher.Publish(new OrderPlacedEvent(order)); - - if (order.PaymentStatus == PaymentStatus.Paid) - ProcessOrderPaid(order); - } - else - foreach (var paymentError in processPaymentResult.Errors) - result.AddError(string.Format(_localizationService.GetResource("Checkout.PaymentError"), paymentError)); - } - catch (Exception exc) - { - _logger.Error(exc.Message, exc); - result.AddError(exc.Message); - } - - #region Process errors - - if (!result.Success) - { - //log errors - var logError = result.Errors.Aggregate("Error while placing order. ", - (current, next) => string.Format("{0}Error {1}: {2}. ", current, result.Errors.IndexOf(next) + 1, next)); - var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); - _logger.Error(logError, customer: customer); - } - - #endregion - - return result; - } - - /// - /// Update order totals - /// - /// Parameters for the updating order - public virtual void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters) - { - if (!_orderSettings.AutoUpdateOrderTotalsOnEditingOrder) - return; - - var updatedOrder = updateOrderParameters.UpdatedOrder; - var updatedOrderItem = updateOrderParameters.UpdatedOrderItem; - - //restore shopping cart from order items - var restoredCart = updatedOrder.OrderItems.Select(orderItem => new ShoppingCartItem - { - Id = orderItem.Id, - AttributesXml = orderItem.AttributesXml, - Customer = updatedOrder.Customer, - Product = orderItem.Product, - Quantity = orderItem.Id == updatedOrderItem.Id ? updateOrderParameters.Quantity : orderItem.Quantity, - RentalEndDateUtc = orderItem.RentalEndDateUtc, - RentalStartDateUtc = orderItem.RentalStartDateUtc, - ShoppingCartType = ShoppingCartType.ShoppingCart, - StoreId = updatedOrder.StoreId - }).ToList(); - - //get shopping cart item which has been updated - var updatedShoppingCartItem = restoredCart.FirstOrDefault(shoppingCartItem => shoppingCartItem.Id == updatedOrderItem.Id); - var itemDeleted = updatedShoppingCartItem == null; - - //validate shopping cart for warnings - updateOrderParameters.Warnings.AddRange(_shoppingCartService.GetShoppingCartWarnings(restoredCart, string.Empty, false)); - if (!itemDeleted) - updateOrderParameters.Warnings.AddRange(_shoppingCartService.GetShoppingCartItemWarnings(updatedOrder.Customer, updatedShoppingCartItem.ShoppingCartType, - updatedShoppingCartItem.Product, updatedOrder.StoreId, updatedShoppingCartItem.AttributesXml, updatedShoppingCartItem.CustomerEnteredPrice, - updatedShoppingCartItem.RentalStartDateUtc, updatedShoppingCartItem.RentalEndDateUtc, updatedShoppingCartItem.Quantity, false)); - - _orderTotalCalculationService.UpdateOrderTotals(updateOrderParameters, restoredCart); - - if (updateOrderParameters.PickupPoint != null) - { - updatedOrder.PickUpInStore = true; - updatedOrder.PickupAddress = new Address - { - Address1 = updateOrderParameters.PickupPoint.Address, - City = updateOrderParameters.PickupPoint.City, - Country = _countryService.GetCountryByTwoLetterIsoCode(updateOrderParameters.PickupPoint.CountryCode), - ZipPostalCode = updateOrderParameters.PickupPoint.ZipPostalCode, - CreatedOnUtc = DateTime.UtcNow, - }; - updatedOrder.ShippingMethod = string.Format(_localizationService.GetResource("Checkout.PickupPoints.Name"), updateOrderParameters.PickupPoint.Name); - updatedOrder.ShippingRateComputationMethodSystemName = updateOrderParameters.PickupPoint.ProviderSystemName; - } - - if (!itemDeleted) - { - updatedOrderItem.ItemWeight = _shippingService.GetShoppingCartItemWeight(updatedShoppingCartItem); - updatedOrderItem.OriginalProductCost = _priceCalculationService.GetProductCost(updatedShoppingCartItem.Product, updatedShoppingCartItem.AttributesXml); - updatedOrderItem.AttributeDescription = _productAttributeFormatter.FormatAttributes(updatedShoppingCartItem.Product, - updatedShoppingCartItem.AttributesXml, updatedOrder.Customer); - - //gift cards - if (updatedShoppingCartItem.Product.IsGiftCard) - { - string giftCardRecipientName; - string giftCardRecipientEmail; - string giftCardSenderName; - string giftCardSenderEmail; - string giftCardMessage; - _productAttributeParser.GetGiftCardAttribute(updatedShoppingCartItem.AttributesXml, out giftCardRecipientName, - out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); - - for (var i = 0; i < updatedShoppingCartItem.Quantity; i++) - { - _giftCardService.InsertGiftCard(new GiftCard - { - GiftCardType = updatedShoppingCartItem.Product.GiftCardType, - PurchasedWithOrderItem = updatedOrderItem, - Amount = updatedShoppingCartItem.Product.OverriddenGiftCardAmount.HasValue ? - updatedShoppingCartItem.Product.OverriddenGiftCardAmount.Value : updatedOrderItem.UnitPriceExclTax, - IsGiftCardActivated = false, - GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), - RecipientName = giftCardRecipientName, - RecipientEmail = giftCardRecipientEmail, - SenderName = giftCardSenderName, - SenderEmail = giftCardSenderEmail, - Message = giftCardMessage, - IsRecipientNotified = false, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - } - - _orderService.UpdateOrder(updatedOrder); - - //discount usage history - var discountUsageHistoryForOrder = _discountService.GetAllDiscountUsageHistory(null, updatedOrder.Customer.Id, updatedOrder.Id); - foreach (var discount in updateOrderParameters.AppliedDiscounts) - { - if (!discountUsageHistoryForOrder.Any(history => history.DiscountId == discount.Id)) - { - var d = _discountService.GetDiscountById(discount.Id); - if (d != null) - { - _discountService.InsertDiscountUsageHistory(new DiscountUsageHistory - { - Discount = d, - Order = updatedOrder, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - } - - CheckOrderStatus(updatedOrder); - } - - /// - /// Deletes an order - /// - /// The order - public virtual void DeleteOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - //check whether the order wasn't cancelled before - //if it already was cancelled, then there's no need to make the following adjustments - //(such as reward points, inventory, recurring payments) - //they already was done when cancelling the order - if (order.OrderStatus != OrderStatus.Cancelled) - { - //return (add) back redeemded reward points - ReturnBackRedeemedRewardPoints(order); - //reduce (cancel) back reward points (previously awarded for this order) - ReduceRewardPoints(order); - - //cancel recurring payments - var recurringPayments = _orderService.SearchRecurringPayments(initialOrderId: order.Id); - foreach (var rp in recurringPayments) - { - var errors = CancelRecurringPayment(rp); - //use "errors" variable? - } - - //Adjust inventory for already shipped shipments - //only products with "use multiple warehouses" - foreach (var shipment in order.Shipments) - { - foreach (var shipmentItem in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); - if (orderItem == null) - continue; - - _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrder"), order.Id)); - } - } - - //Adjust inventory - foreach (var orderItem in order.OrderItems) - { - _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrder"), order.Id)); - } - - } - - //deactivate gift cards - if (_orderSettings.DeactivateGiftCardsAfterDeletingOrder) - SetActivatedValueForPurchasedGiftCards(order, false); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been deleted", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //now delete an order - _orderService.DeleteOrder(order); - } - - /// - /// Process next recurring payment - /// - /// Recurring payment - /// Process payment result (info about last payment for automatic recurring payments) - /// Collection of errors - public virtual IEnumerable ProcessNextRecurringPayment(RecurringPayment recurringPayment, ProcessPaymentResult paymentResult = null) - { - if (recurringPayment == null) - throw new ArgumentNullException("recurringPayment"); - - try - { - if (!recurringPayment.IsActive) - throw new NopException("Recurring payment is not active"); - - var initialOrder = recurringPayment.InitialOrder; - if (initialOrder == null) - throw new NopException("Initial order could not be loaded"); - - var customer = initialOrder.Customer; - if (customer == null) - throw new NopException("Customer could not be loaded"); - - var nextPaymentDate = recurringPayment.NextPaymentDate; - if (!nextPaymentDate.HasValue) - throw new NopException("Next payment date could not be calculated"); - - //payment info - var processPaymentRequest = new ProcessPaymentRequest - { - StoreId = initialOrder.StoreId, - CustomerId = customer.Id, - OrderGuid = Guid.NewGuid(), - InitialOrderId = initialOrder.Id, - RecurringCycleLength = recurringPayment.CycleLength, - RecurringCyclePeriod = recurringPayment.CyclePeriod, - RecurringTotalCycles = recurringPayment.TotalCycles, - CustomValues = initialOrder.DeserializeCustomValues() - }; - - //prepare order details - var details = PrepareRecurringOrderDetails(processPaymentRequest); - - ProcessPaymentResult processPaymentResult; - //skip payment workflow if order total equals zero - var skipPaymentWorkflow = details.OrderTotal == decimal.Zero; - if (!skipPaymentWorkflow) - { - var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - - if (!paymentMethod.IsPaymentMethodActive(_paymentSettings)) - throw new NopException("Payment method is not active"); - - //Old credit card info - if (details.InitialOrder.AllowStoringCreditCardNumber) - { - processPaymentRequest.CreditCardType = _encryptionService.DecryptText(details.InitialOrder.CardType); - processPaymentRequest.CreditCardName = _encryptionService.DecryptText(details.InitialOrder.CardName); - processPaymentRequest.CreditCardNumber = _encryptionService.DecryptText(details.InitialOrder.CardNumber); - processPaymentRequest.CreditCardCvv2 = _encryptionService.DecryptText(details.InitialOrder.CardCvv2); - try - { - processPaymentRequest.CreditCardExpireMonth = Convert.ToInt32(_encryptionService.DecryptText(details.InitialOrder.CardExpirationMonth)); - processPaymentRequest.CreditCardExpireYear = Convert.ToInt32(_encryptionService.DecryptText(details.InitialOrder.CardExpirationYear)); - } - catch { } - } - - //payment type - switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) - { - case RecurringPaymentType.NotSupported: - throw new NopException("Recurring payments are not supported by selected payment method"); - case RecurringPaymentType.Manual: - processPaymentResult = _paymentService.ProcessRecurringPayment(processPaymentRequest); - break; - case RecurringPaymentType.Automatic: - //payment is processed on payment gateway site, info about last transaction in paymentResult parameter - processPaymentResult = paymentResult ?? new ProcessPaymentResult(); - break; - default: - throw new NopException("Not supported recurring payment type"); - } - } - else - processPaymentResult = paymentResult ?? new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid }; - - if (processPaymentResult == null) - throw new NopException("processPaymentResult is not available"); - - if (processPaymentResult.Success) - { - //save order details - var order = SaveOrderDetails(processPaymentRequest, processPaymentResult, details); - - foreach (var orderItem in details.InitialOrder.OrderItems) - { - //save item - var newOrderItem = new OrderItem - { - OrderItemGuid = Guid.NewGuid(), - Order = order, - ProductId = orderItem.ProductId, - UnitPriceInclTax = orderItem.UnitPriceInclTax, - UnitPriceExclTax = orderItem.UnitPriceExclTax, - PriceInclTax = orderItem.PriceInclTax, - PriceExclTax = orderItem.PriceExclTax, - OriginalProductCost = orderItem.OriginalProductCost, - AttributeDescription = orderItem.AttributeDescription, - AttributesXml = orderItem.AttributesXml, - Quantity = orderItem.Quantity, - DiscountAmountInclTax = orderItem.DiscountAmountInclTax, - DiscountAmountExclTax = orderItem.DiscountAmountExclTax, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - ItemWeight = orderItem.ItemWeight, - RentalStartDateUtc = orderItem.RentalStartDateUtc, - RentalEndDateUtc = orderItem.RentalEndDateUtc - }; - order.OrderItems.Add(newOrderItem); - _orderService.UpdateOrder(order); - - //gift cards - if (orderItem.Product.IsGiftCard) - { - string giftCardRecipientName; - string giftCardRecipientEmail; - string giftCardSenderName; - string giftCardSenderEmail; - string giftCardMessage; - - _productAttributeParser.GetGiftCardAttribute(orderItem.AttributesXml, out giftCardRecipientName, - out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); - - for (var i = 0; i < orderItem.Quantity; i++) - { - _giftCardService.InsertGiftCard(new GiftCard - { - GiftCardType = orderItem.Product.GiftCardType, - PurchasedWithOrderItem = newOrderItem, - Amount = orderItem.UnitPriceExclTax, - IsGiftCardActivated = false, - GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), - RecipientName = giftCardRecipientName, - RecipientEmail = giftCardRecipientEmail, - SenderName = giftCardSenderName, - SenderEmail = giftCardSenderEmail, - Message = giftCardMessage, - IsRecipientNotified = false, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - - //inventory - _productService.AdjustInventory(orderItem.Product, -orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.PlaceOrder"), order.Id)); - } - - //notifications - SendNotificationsAndSaveNotes(order); - - //check order status - CheckOrderStatus(order); - - //raise event - _eventPublisher.Publish(new OrderPlacedEvent(order)); - - if (order.PaymentStatus == PaymentStatus.Paid) - ProcessOrderPaid(order); - - //last payment succeeded - recurringPayment.LastPaymentFailed = false; - - //next recurring payment - recurringPayment.RecurringPaymentHistory.Add(new RecurringPaymentHistory - { - RecurringPayment = recurringPayment, - CreatedOnUtc = DateTime.UtcNow, - OrderId = order.Id, - }); - _orderService.UpdateRecurringPayment(recurringPayment); - - return new List(); - } - else - { - //log errors - var logError = processPaymentResult.Errors.Aggregate("Error while processing recurring order. ", - (current, next) => string.Format("{0}Error {1}: {2}. ", current, processPaymentResult.Errors.IndexOf(next) + 1, next)); - _logger.Error(logError, customer: customer); - - if (processPaymentResult.RecurringPaymentFailed) - { - //set flag that last payment failed - recurringPayment.LastPaymentFailed = true; - _orderService.UpdateRecurringPayment(recurringPayment); - - if (_paymentSettings.CancelRecurringPaymentsAfterFailedPayment) - { - //cancel recurring payment - CancelRecurringPayment(recurringPayment).ToList().ForEach(error => _logger.Error(error)); - - //notify a customer about cancelled payment - _workflowMessageService.SendRecurringPaymentCancelledCustomerNotification(recurringPayment, initialOrder.CustomerLanguageId); - } - else - //notify a customer about failed payment - _workflowMessageService.SendRecurringPaymentFailedCustomerNotification(recurringPayment, initialOrder.CustomerLanguageId); - } - - return processPaymentResult.Errors; - } - } - catch (Exception exc) - { - _logger.Error(string.Format("Error while processing recurring order. {0}", exc.Message), exc); - throw; - } - } - - /// - /// Cancels a recurring payment - /// - /// Recurring payment - public virtual IList CancelRecurringPayment(RecurringPayment recurringPayment) - { - if (recurringPayment == null) - throw new ArgumentNullException("recurringPayment"); - - var initialOrder = recurringPayment.InitialOrder; - if (initialOrder == null) - return new List { "Initial order could not be loaded" }; - - - var request = new CancelRecurringPaymentRequest(); - CancelRecurringPaymentResult result = null; - try - { - request.Order = initialOrder; - result = _paymentService.CancelRecurringPayment(request); - if (result.Success) - { - //update recurring payment - recurringPayment.IsActive = false; - _orderService.UpdateRecurringPayment(recurringPayment); - - - //add a note - initialOrder.OrderNotes.Add(new OrderNote - { - Note = "Recurring payment has been cancelled", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(initialOrder); - - //notify a store owner - _workflowMessageService - .SendRecurringPaymentCancelledStoreOwnerNotification(recurringPayment, - _localizationSettings.DefaultAdminLanguageId); - } - } - catch (Exception exc) - { - if (result == null) - result = new CancelRecurringPaymentResult(); - result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); - } - - - //process errors - string error = ""; - for (int i = 0; i < result.Errors.Count; i++) - { - error += string.Format("Error {0}: {1}", i, result.Errors[i]); - if (i != result.Errors.Count - 1) - error += ". "; - } - if (!String.IsNullOrEmpty(error)) - { - //add a note - initialOrder.OrderNotes.Add(new OrderNote - { - Note = string.Format("Unable to cancel recurring payment. {0}", error), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(initialOrder); - - //log it - string logError = string.Format("Error cancelling recurring payment. Order #{0}. Error: {1}", initialOrder.Id, error); - _logger.InsertLog(LogLevel.Error, logError, logError); - } - return result.Errors; - } - - /// - /// Gets a value indicating whether a customer can cancel recurring payment - /// - /// Customer - /// Recurring Payment - /// value indicating whether a customer can cancel recurring payment - public virtual bool CanCancelRecurringPayment(Customer customerToValidate, RecurringPayment recurringPayment) - { - if (recurringPayment == null) - return false; - - if (customerToValidate == null) - return false; - - var initialOrder = recurringPayment.InitialOrder; - if (initialOrder == null) - return false; - - var customer = recurringPayment.InitialOrder.Customer; - if (customer == null) - return false; - - if (initialOrder.OrderStatus == OrderStatus.Cancelled) - return false; - - if (!customerToValidate.IsAdmin()) - { - if (customer.Id != customerToValidate.Id) - return false; - } - - if (!recurringPayment.NextPaymentDate.HasValue) - return false; - - return true; - } - - - /// - /// Gets a value indicating whether a customer can retry last failed recurring payment - /// - /// Customer - /// Recurring Payment - /// True if a customer can retry payment; otherwise false - public virtual bool CanRetryLastRecurringPayment(Customer customer, RecurringPayment recurringPayment) - { - if (recurringPayment == null || customer == null) - return false; - - if (recurringPayment.InitialOrder == null || recurringPayment.InitialOrder.OrderStatus == OrderStatus.Cancelled) - return false; - - if (!recurringPayment.LastPaymentFailed || _paymentService.GetRecurringPaymentType(recurringPayment.InitialOrder.PaymentMethodSystemName) != RecurringPaymentType.Manual) - return false; - - if (recurringPayment.InitialOrder.Customer == null || (!customer.IsAdmin() && recurringPayment.InitialOrder.Customer.Id != customer.Id)) - return false; - - return true; - } - - - /// - /// Send a shipment - /// - /// Shipment - /// True to notify customer - public virtual void Ship(Shipment shipment, bool notifyCustomer) - { - if (shipment == null) - throw new ArgumentNullException("shipment"); - - var order = _orderService.GetOrderById(shipment.OrderId); - if (order == null) - throw new Exception("Order cannot be loaded"); - - if (shipment.ShippedDateUtc.HasValue) - throw new Exception("This shipment is already shipped"); - - shipment.ShippedDateUtc = DateTime.UtcNow; - _shipmentService.UpdateShipment(shipment); - - //process products with "Multiple warehouse" support enabled - foreach (var item in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(item.OrderItemId); - _productService.BookReservedInventory(orderItem.Product, item.WarehouseId, -item.Quantity, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.Ship"), shipment.OrderId)); - } - - //check whether we have more items to ship - if (order.HasItemsToAddToShipment() || order.HasItemsToShip()) - order.ShippingStatusId = (int)ShippingStatus.PartiallyShipped; - else - order.ShippingStatusId = (int)ShippingStatus.Shipped; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Shipment# {0} has been sent", shipment.Id), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - if (notifyCustomer) - { - //notify customer - int queuedEmailId = _workflowMessageService.SendShipmentSentCustomerNotification(shipment, order.CustomerLanguageId); - if (queuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Shipped\" email (to customer) has been queued. Queued email identifier: {0}.", queuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - } - - //event - _eventPublisher.PublishShipmentSent(shipment); - - //check order status - CheckOrderStatus(order); - } - - /// - /// Marks a shipment as delivered - /// - /// Shipment - /// True to notify customer - public virtual void Deliver(Shipment shipment, bool notifyCustomer) - { - if (shipment == null) - throw new ArgumentNullException("shipment"); - - var order = shipment.Order; - if (order == null) - throw new Exception("Order cannot be loaded"); - - if (!shipment.ShippedDateUtc.HasValue) - throw new Exception("This shipment is not shipped yet"); - - if (shipment.DeliveryDateUtc.HasValue) - throw new Exception("This shipment is already delivered"); - - shipment.DeliveryDateUtc = DateTime.UtcNow; - _shipmentService.UpdateShipment(shipment); - - if (!order.HasItemsToAddToShipment() && !order.HasItemsToShip() && !order.HasItemsToDeliver()) - order.ShippingStatusId = (int)ShippingStatus.Delivered; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Shipment# {0} has been delivered", shipment.Id), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - if (notifyCustomer) - { - //send email notification - int queuedEmailId = _workflowMessageService.SendShipmentDeliveredCustomerNotification(shipment, order.CustomerLanguageId); - if (queuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Delivered\" email (to customer) has been queued. Queued email identifier: {0}.", queuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - } - - //event - _eventPublisher.PublishShipmentDelivered(shipment); - - //check order status - CheckOrderStatus(order); - } - - - - /// - /// Gets a value indicating whether cancel is allowed - /// - /// Order - /// A value indicating whether cancel is allowed - public virtual bool CanCancelOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderStatus == OrderStatus.Cancelled) - return false; - - return true; - } - - /// - /// Cancels order - /// - /// Order - /// True to notify customer - public virtual void CancelOrder(Order order, bool notifyCustomer) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanCancelOrder(order)) - throw new NopException("Cannot do cancel for order."); - - //Cancel order - SetOrderStatus(order, OrderStatus.Cancelled, notifyCustomer); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been cancelled", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //return (add) back redeemded reward points - ReturnBackRedeemedRewardPoints(order); - - //cancel recurring payments - var recurringPayments = _orderService.SearchRecurringPayments(initialOrderId: order.Id); - foreach (var rp in recurringPayments) - { - var errors = CancelRecurringPayment(rp); - //use "errors" variable? - } - - //Adjust inventory for already shipped shipments - //only products with "use multiple warehouses" - foreach (var shipment in order.Shipments) - { - foreach (var shipmentItem in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); - if (orderItem == null) - continue; - - _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CancelOrder"), order.Id)); - } - } - //Adjust inventory - foreach (var orderItem in order.OrderItems) - { - _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CancelOrder"), order.Id)); - } - - _eventPublisher.Publish(new OrderCancelledEvent(order)); - - } - - /// - /// Gets a value indicating whether order can be marked as authorized - /// - /// Order - /// A value indicating whether order can be marked as authorized - public virtual bool CanMarkOrderAsAuthorized(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderStatus == OrderStatus.Cancelled) - return false; - - if (order.PaymentStatus == PaymentStatus.Pending) - return true; - - return false; - } - - /// - /// Marks order as authorized - /// - /// Order - public virtual void MarkAsAuthorized(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - order.PaymentStatusId = (int)PaymentStatus.Authorized; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been marked as authorized", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - } - - - - /// - /// Gets a value indicating whether capture from admin panel is allowed - /// - /// Order - /// A value indicating whether capture from admin panel is allowed - public virtual bool CanCapture(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderStatus == OrderStatus.Cancelled || - order.OrderStatus == OrderStatus.Pending) - return false; - - if (order.PaymentStatus == PaymentStatus.Authorized && - _paymentService.SupportCapture(order.PaymentMethodSystemName)) - return true; - - return false; - } - - /// - /// Capture an order (from admin panel) - /// - /// Order - /// A list of errors; empty list if no errors - public virtual IList Capture(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanCapture(order)) - throw new NopException("Cannot do capture for order."); - - var request = new CapturePaymentRequest(); - CapturePaymentResult result = null; - try - { - //old info from placing order - request.Order = order; - result = _paymentService.Capture(request); - - if (result.Success) - { - var paidDate = order.PaidDateUtc; - if (result.NewPaymentStatus == PaymentStatus.Paid) - paidDate = DateTime.UtcNow; - - order.CaptureTransactionId = result.CaptureTransactionId; - order.CaptureTransactionResult = result.CaptureTransactionResult; - order.PaymentStatus = result.NewPaymentStatus; - order.PaidDateUtc = paidDate; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been captured", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - CheckOrderStatus(order); - - if (order.PaymentStatus == PaymentStatus.Paid) - { - ProcessOrderPaid(order); - } - } - } - catch (Exception exc) - { - if (result == null) - result = new CapturePaymentResult(); - result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); - } - - - //process errors - string error = ""; - for (int i = 0; i < result.Errors.Count; i++) - { - error += string.Format("Error {0}: {1}", i, result.Errors[i]); - if (i != result.Errors.Count - 1) - error += ". "; - } - if (!String.IsNullOrEmpty(error)) - { - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Unable to capture order. {0}", error), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //log it - string logError = string.Format("Error capturing order #{0}. Error: {1}", order.Id, error); - _logger.InsertLog(LogLevel.Error, logError, logError); - } - return result.Errors; - } - - /// - /// Gets a value indicating whether order can be marked as paid - /// - /// Order - /// A value indicating whether order can be marked as paid - public virtual bool CanMarkOrderAsPaid(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderStatus == OrderStatus.Cancelled) - return false; - - if (order.PaymentStatus == PaymentStatus.Paid || - order.PaymentStatus == PaymentStatus.Refunded || - order.PaymentStatus == PaymentStatus.Voided) - return false; - - return true; - } - - /// - /// Marks order as paid - /// - /// Order - public virtual void MarkOrderAsPaid(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanMarkOrderAsPaid(order)) - throw new NopException("You can't mark this order as paid"); - - order.PaymentStatusId = (int)PaymentStatus.Paid; - order.PaidDateUtc = DateTime.UtcNow; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been marked as paid", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - CheckOrderStatus(order); - - if (order.PaymentStatus == PaymentStatus.Paid) - { - ProcessOrderPaid(order); - } - } - - - - /// - /// Gets a value indicating whether refund from admin panel is allowed - /// - /// Order - /// A value indicating whether refund from admin panel is allowed - public virtual bool CanRefund(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //refund cannot be made if previously a partial refund has been already done. only other partial refund can be made in this case - if (order.RefundedAmount > decimal.Zero) - return false; - - //uncomment the lines below in order to disallow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - if (order.PaymentStatus == PaymentStatus.Paid && - _paymentService.SupportRefund(order.PaymentMethodSystemName)) - return true; - - return false; - } - - /// - /// Refunds an order (from admin panel) - /// - /// Order - /// A list of errors; empty list if no errors - public virtual IList Refund(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanRefund(order)) - throw new NopException("Cannot do refund for order."); - - var request = new RefundPaymentRequest(); - RefundPaymentResult result = null; - try - { - request.Order = order; - request.AmountToRefund = order.OrderTotal; - request.IsPartialRefund = false; - result = _paymentService.Refund(request); - if (result.Success) - { - //total amount refunded - decimal totalAmountRefunded = order.RefundedAmount + request.AmountToRefund; - - //update order info - order.RefundedAmount = totalAmountRefunded; - order.PaymentStatus = result.NewPaymentStatus; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order has been refunded. Amount = {0}", request.AmountToRefund), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - - //notifications - var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, request.AmountToRefund, _localizationSettings.DefaultAdminLanguageId); - if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, request.AmountToRefund, order.CustomerLanguageId); - if (orderRefundedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - - //raise event - _eventPublisher.Publish(new OrderRefundedEvent(order, request.AmountToRefund)); - } - - } - catch (Exception exc) - { - if (result == null) - result = new RefundPaymentResult(); - result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); - } - - //process errors - string error = ""; - for (int i = 0; i < result.Errors.Count; i++) - { - error += string.Format("Error {0}: {1}", i, result.Errors[i]); - if (i != result.Errors.Count - 1) - error += ". "; - } - if (!String.IsNullOrEmpty(error)) - { - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Unable to refund order. {0}", error), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //log it - string logError = string.Format("Error refunding order #{0}. Error: {1}", order.Id, error); - _logger.InsertLog(LogLevel.Error, logError, logError); - } - return result.Errors; - } - - /// - /// Gets a value indicating whether order can be marked as refunded - /// - /// Order - /// A value indicating whether order can be marked as refunded - public virtual bool CanRefundOffline(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //refund cannot be made if previously a partial refund has been already done. only other partial refund can be made in this case - if (order.RefundedAmount > decimal.Zero) - return false; - - //uncomment the lines below in order to disallow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - if (order.PaymentStatus == PaymentStatus.Paid) - return true; - - return false; - } - - /// - /// Refunds an order (offline) - /// - /// Order - public virtual void RefundOffline(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanRefundOffline(order)) - throw new NopException("You can't refund this order"); - - //amout to refund - decimal amountToRefund = order.OrderTotal; - - //total amount refunded - decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; - - //update order info - order.RefundedAmount = totalAmountRefunded; - order.PaymentStatus = PaymentStatus.Refunded; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order has been marked as refunded. Amount = {0}", amountToRefund), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - - //notifications - var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); - if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); - if (orderRefundedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - - //raise event - _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); - } - - /// - /// Gets a value indicating whether partial refund from admin panel is allowed - /// - /// Order - /// Amount to refund - /// A value indicating whether refund from admin panel is allowed - public virtual bool CanPartiallyRefund(Order order, decimal amountToRefund) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //uncomment the lines below in order to allow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - decimal canBeRefunded = order.OrderTotal - order.RefundedAmount; - if (canBeRefunded <= decimal.Zero) - return false; - - if (amountToRefund > canBeRefunded) - return false; - - if ((order.PaymentStatus == PaymentStatus.Paid || - order.PaymentStatus == PaymentStatus.PartiallyRefunded) && - _paymentService.SupportPartiallyRefund(order.PaymentMethodSystemName)) - return true; - - return false; - } - - /// - /// Partially refunds an order (from admin panel) - /// - /// Order - /// Amount to refund - /// A list of errors; empty list if no errors - public virtual IList PartiallyRefund(Order order, decimal amountToRefund) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanPartiallyRefund(order, amountToRefund)) - throw new NopException("Cannot do partial refund for order."); - - var request = new RefundPaymentRequest(); - RefundPaymentResult result = null; - try - { - request.Order = order; - request.AmountToRefund = amountToRefund; - request.IsPartialRefund = true; - - result = _paymentService.Refund(request); - - if (result.Success) - { - //total amount refunded - decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; - - //update order info - order.RefundedAmount = totalAmountRefunded; - //mark payment status as 'Refunded' if the order total amount is fully refunded - order.PaymentStatus = order.OrderTotal == totalAmountRefunded && result.NewPaymentStatus == PaymentStatus.PartiallyRefunded ? PaymentStatus.Refunded : result.NewPaymentStatus; - _orderService.UpdateOrder(order); - - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order has been partially refunded. Amount = {0}", amountToRefund), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - - //notifications - var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); - if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); - if (orderRefundedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - - //raise event - _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); - } - } - catch (Exception exc) - { - if (result == null) - result = new RefundPaymentResult(); - result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); - } - - //process errors - string error = ""; - for (int i = 0; i < result.Errors.Count; i++) - { - error += string.Format("Error {0}: {1}", i, result.Errors[i]); - if (i != result.Errors.Count - 1) - error += ". "; - } - if (!String.IsNullOrEmpty(error)) - { - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Unable to partially refund order. {0}", error), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //log it - string logError = string.Format("Error refunding order #{0}. Error: {1}", order.Id, error); - _logger.InsertLog(LogLevel.Error, logError, logError); - } - return result.Errors; - } - - /// - /// Gets a value indicating whether order can be marked as partially refunded - /// - /// Order - /// Amount to refund - /// A value indicating whether order can be marked as partially refunded - public virtual bool CanPartiallyRefundOffline(Order order, decimal amountToRefund) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //uncomment the lines below in order to allow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - decimal canBeRefunded = order.OrderTotal - order.RefundedAmount; - if (canBeRefunded <= decimal.Zero) - return false; - - if (amountToRefund > canBeRefunded) - return false; - - if (order.PaymentStatus == PaymentStatus.Paid || - order.PaymentStatus == PaymentStatus.PartiallyRefunded) - return true; - - return false; - } - - /// - /// Partially refunds an order (offline) - /// - /// Order - /// Amount to refund - public virtual void PartiallyRefundOffline(Order order, decimal amountToRefund) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanPartiallyRefundOffline(order, amountToRefund)) - throw new NopException("You can't partially refund (offline) this order"); - - //total amount refunded - decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; - - //update order info - order.RefundedAmount = totalAmountRefunded; - //mark payment status as 'Refunded' if the order total amount is fully refunded - order.PaymentStatus = order.OrderTotal == totalAmountRefunded ? PaymentStatus.Refunded : PaymentStatus.PartiallyRefunded; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order has been marked as partially refunded. Amount = {0}", amountToRefund), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - - //notifications - var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); - if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); - if (orderRefundedCustomerNotificationQueuedEmailId > 0) - { - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - } - //raise event - _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); - } - - - - /// - /// Gets a value indicating whether void from admin panel is allowed - /// - /// Order - /// A value indicating whether void from admin panel is allowed - public virtual bool CanVoid(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //uncomment the lines below in order to allow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - if (order.PaymentStatus == PaymentStatus.Authorized && - _paymentService.SupportVoid(order.PaymentMethodSystemName)) - return true; - - return false; - } - - /// - /// Voids order (from admin panel) - /// - /// Order - /// Voided order - public virtual IList Void(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanVoid(order)) - throw new NopException("Cannot do void for order."); - - var request = new VoidPaymentRequest(); - VoidPaymentResult result = null; - try - { - request.Order = order; - result = _paymentService.Void(request); - - if (result.Success) - { - //update order info - order.PaymentStatus = result.NewPaymentStatus; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been voided", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check order status - CheckOrderStatus(order); - } - } - catch (Exception exc) - { - if (result == null) - result = new VoidPaymentResult(); - result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); - } - - //process errors - string error = ""; - for (int i = 0; i < result.Errors.Count; i++) - { - error += string.Format("Error {0}: {1}", i, result.Errors[i]); - if (i != result.Errors.Count - 1) - error += ". "; - } - if (!String.IsNullOrEmpty(error)) - { - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Unable to voiding order. {0}", error), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //log it - string logError = string.Format("Error voiding order #{0}. Error: {1}", order.Id, error); - _logger.InsertLog(LogLevel.Error, logError, logError); - } - return result.Errors; - } - - /// - /// Gets a value indicating whether order can be marked as voided - /// - /// Order - /// A value indicating whether order can be marked as voided - public virtual bool CanVoidOffline(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (order.OrderTotal == decimal.Zero) - return false; - - //uncomment the lines below in order to allow this operation for cancelled orders - //if (order.OrderStatus == OrderStatus.Cancelled) - // return false; - - if (order.PaymentStatus == PaymentStatus.Authorized) - return true; - - return false; - } - - /// - /// Voids order (offline) - /// - /// Order - public virtual void VoidOffline(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!CanVoidOffline(order)) - throw new NopException("You can't void this order"); - - order.PaymentStatusId = (int)PaymentStatus.Voided; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order has been marked as voided", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - - //check orer status - CheckOrderStatus(order); - } - - - - /// - /// Place order items in current user shopping cart. - /// - /// The order - public virtual void ReOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - //move shopping cart items (if possible) - foreach (var orderItem in order.OrderItems) - { - _shoppingCartService.AddToCart(order.Customer, orderItem.Product, - ShoppingCartType.ShoppingCart, order.StoreId, - orderItem.AttributesXml, orderItem.UnitPriceExclTax, - orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc, - orderItem.Quantity, false); - } - - //set checkout attributes - //comment the code below if you want to disable this functionality - _genericAttributeService.SaveAttribute(order.Customer, SystemCustomerAttributeNames.CheckoutAttributes, order.CheckoutAttributesXml, order.StoreId); - } - - /// - /// Check whether return request is allowed - /// - /// Order - /// Result - public virtual bool IsReturnRequestAllowed(Order order) - { - if (!_orderSettings.ReturnRequestsEnabled) - return false; - - if (order == null || order.Deleted) - return false; - - //status should be compelte - if (order.OrderStatus != OrderStatus.Complete) - return false; - - //validate allowed number of days - if (_orderSettings.NumberOfDaysReturnRequestAvailable > 0) - { - var daysPassed = (DateTime.UtcNow - order.CreatedOnUtc).TotalDays; - if (daysPassed >= _orderSettings.NumberOfDaysReturnRequestAvailable) - return false; - } - - //ensure that we have at least one returnable product - return order.OrderItems.Any(oi => !oi.Product.NotReturnable); - } - - - - /// - /// Valdiate minimum order sub-total amount - /// - /// Shopping cart - /// true - OK; false - minimum order sub-total amount is not reached - public virtual bool ValidateMinOrderSubtotalAmount(IList cart) - { - if (cart == null) - throw new ArgumentNullException("cart"); - - //min order amount sub-total validation - if (cart.Any() && _orderSettings.MinOrderSubtotalAmount > decimal.Zero) - { - //subtotal - decimal orderSubTotalDiscountAmountBase; - List orderSubTotalAppliedDiscounts; - decimal subTotalWithoutDiscountBase; - decimal subTotalWithDiscountBase; - _orderTotalCalculationService.GetShoppingCartSubTotal(cart, _orderSettings.MinOrderSubtotalAmountIncludingTax, - out orderSubTotalDiscountAmountBase, out orderSubTotalAppliedDiscounts, - out subTotalWithoutDiscountBase, out subTotalWithDiscountBase); - - if (subTotalWithoutDiscountBase < _orderSettings.MinOrderSubtotalAmount) - return false; - } - - return true; - } - - /// - /// Valdiate minimum order total amount - /// - /// Shopping cart - /// true - OK; false - minimum order total amount is not reached - public virtual bool ValidateMinOrderTotalAmount(IList cart) - { - if (cart == null) - throw new ArgumentNullException("cart"); - - if (cart.Any() && _orderSettings.MinOrderTotalAmount > decimal.Zero) - { - decimal? shoppingCartTotalBase = _orderTotalCalculationService.GetShoppingCartTotal(cart); - if (shoppingCartTotalBase.HasValue && shoppingCartTotalBase.Value < _orderSettings.MinOrderTotalAmount) - return false; - } - - return true; - } - - /// - /// Gets a value indicating whether payment workflow is required - /// - /// Shopping cart - /// A value indicating reward points should be used; null to detect current choice of the customer - /// true - OK; false - minimum order total amount is not reached - public virtual bool IsPaymentWorkflowRequired(IList cart, bool? useRewardPoints = null) - { - if (cart == null) - throw new ArgumentNullException("cart"); - - bool result = true; - - //check whether order total equals zero - decimal? shoppingCartTotalBase = _orderTotalCalculationService.GetShoppingCartTotal(cart, useRewardPoints: useRewardPoints); - if (shoppingCartTotalBase.HasValue && shoppingCartTotalBase.Value == decimal.Zero) - result = false; - return result; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Logging; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Domain.Vendors; +using Nop.Services.Affiliates; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Discounts; +using Nop.Services.Events; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Messages; +using Nop.Services.Payments; +using Nop.Services.Security; +using Nop.Services.Shipping; +using Nop.Services.Tax; +using Nop.Services.Vendors; +using Nop.Services.Configuration; +using System.Text; + +namespace Nop.Services.Orders +{ + /// + /// Order processing service + /// + public partial class OrderProcessingService : IOrderProcessingService + { + #region Fields + + private readonly IOrderService _orderService; + private readonly IWebHelper _webHelper; + private readonly ILocalizationService _localizationService; + private readonly ILanguageService _languageService; + private readonly IProductService _productService; + private readonly IPaymentService _paymentService; + private readonly ILogger _logger; + private readonly IOrderTotalCalculationService _orderTotalCalculationService; + private readonly IPriceCalculationService _priceCalculationService; + private readonly IPriceFormatter _priceFormatter; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IProductAttributeFormatter _productAttributeFormatter; + private readonly IGiftCardService _giftCardService; + private readonly IShoppingCartService _shoppingCartService; + private readonly ICheckoutAttributeFormatter _checkoutAttributeFormatter; + private readonly IShippingService _shippingService; + private readonly IShipmentService _shipmentService; + private readonly ITaxService _taxService; + private readonly ICustomerService _customerService; + private readonly IDiscountService _discountService; + private readonly IEncryptionService _encryptionService; + private readonly IWorkContext _workContext; + private readonly IWorkflowMessageService _workflowMessageService; + private readonly IVendorService _vendorService; + private readonly ICustomerActivityService _customerActivityService; + private readonly ICurrencyService _currencyService; + private readonly IAffiliateService _affiliateService; + private readonly IEventPublisher _eventPublisher; + private readonly IPdfService _pdfService; + private readonly IRewardPointService _rewardPointService; + private readonly IGenericAttributeService _genericAttributeService; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + + private readonly ShippingSettings _shippingSettings; + private readonly PaymentSettings _paymentSettings; + private readonly RewardPointsSettings _rewardPointsSettings; + private readonly OrderSettings _orderSettings; + private readonly TaxSettings _taxSettings; + private readonly LocalizationSettings _localizationSettings; + private readonly CurrencySettings _currencySettings; + private readonly ICustomNumberFormatter _customNumberFormatter; + + private readonly ISettingService _settingService; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Order service + /// Web helper + /// Localization service + /// Language service + /// Product service + /// Payment service + /// Logger + /// Order total calculationservice + /// Price calculation service + /// Price formatter + /// Product attribute parser + /// Product attribute formatter + /// Gift card service + /// Shopping cart service + /// Checkout attribute service + /// Shipping service + /// Shipment service + /// Tax service + /// Customer service + /// Discount service + /// Encryption service + /// Work context + /// Workflow message service + /// Vendor service + /// Customer activity service + /// Currency service + /// Affiliate service + /// Event published + /// PDF service + /// Reward point service + /// Generic attribute service + /// Country service + /// Payment settings + /// Shipping settings + /// Reward points settings + /// Order settings + /// Tax settings + /// Localization settings + /// Currency settings + /// Setting service + /// Custom number formatter + public OrderProcessingService(IOrderService orderService, + IWebHelper webHelper, + ILocalizationService localizationService, + ILanguageService languageService, + IProductService productService, + IPaymentService paymentService, + ILogger logger, + IOrderTotalCalculationService orderTotalCalculationService, + IPriceCalculationService priceCalculationService, + IPriceFormatter priceFormatter, + IProductAttributeParser productAttributeParser, + IProductAttributeFormatter productAttributeFormatter, + IGiftCardService giftCardService, + IShoppingCartService shoppingCartService, + ICheckoutAttributeFormatter checkoutAttributeFormatter, + IShippingService shippingService, + IShipmentService shipmentService, + ITaxService taxService, + ICustomerService customerService, + IDiscountService discountService, + IEncryptionService encryptionService, + IWorkContext workContext, + IWorkflowMessageService workflowMessageService, + IVendorService vendorService, + ICustomerActivityService customerActivityService, + ICurrencyService currencyService, + IAffiliateService affiliateService, + IEventPublisher eventPublisher, + IPdfService pdfService, + IRewardPointService rewardPointService, + IGenericAttributeService genericAttributeService, + ICountryService countryService, + IStateProvinceService stateProvinceService, + ShippingSettings shippingSettings, + PaymentSettings paymentSettings, + RewardPointsSettings rewardPointsSettings, + OrderSettings orderSettings, + TaxSettings taxSettings, + LocalizationSettings localizationSettings, + CurrencySettings currencySettings, + ISettingService settingService, + ICustomNumberFormatter customNumberFormatter) + { + this._orderService = orderService; + this._webHelper = webHelper; + this._localizationService = localizationService; + this._languageService = languageService; + this._productService = productService; + this._paymentService = paymentService; + this._logger = logger; + this._orderTotalCalculationService = orderTotalCalculationService; + this._priceCalculationService = priceCalculationService; + this._priceFormatter = priceFormatter; + this._productAttributeParser = productAttributeParser; + this._productAttributeFormatter = productAttributeFormatter; + this._giftCardService = giftCardService; + this._shoppingCartService = shoppingCartService; + this._checkoutAttributeFormatter = checkoutAttributeFormatter; + this._workContext = workContext; + this._workflowMessageService = workflowMessageService; + this._vendorService = vendorService; + this._shippingService = shippingService; + this._shipmentService = shipmentService; + this._taxService = taxService; + this._customerService = customerService; + this._discountService = discountService; + this._encryptionService = encryptionService; + this._customerActivityService = customerActivityService; + this._currencyService = currencyService; + this._affiliateService = affiliateService; + this._eventPublisher = eventPublisher; + this._pdfService = pdfService; + this._rewardPointService = rewardPointService; + this._genericAttributeService = genericAttributeService; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + + this._paymentSettings = paymentSettings; + this._shippingSettings = shippingSettings; + this._rewardPointsSettings = rewardPointsSettings; + this._orderSettings = orderSettings; + this._taxSettings = taxSettings; + this._localizationSettings = localizationSettings; + this._currencySettings = currencySettings; + this._settingService = settingService; + this._customNumberFormatter = customNumberFormatter; + } + + #endregion + + #region Nested classes + + protected class PlaceOrderContainter + { + public PlaceOrderContainter() + { + this.Cart = new List(); + this.AppliedDiscounts = new List(); + this.AppliedGiftCards = new List(); + } + + public Customer Customer { get; set; } + public Language CustomerLanguage { get; set; } + public int AffiliateId { get; set; } + public TaxDisplayType CustomerTaxDisplayType {get; set; } + public string CustomerCurrencyCode { get; set; } + public decimal CustomerCurrencyRate { get; set; } + + public Address BillingAddress { get; set; } + public Address ShippingAddress {get; set; } + public ShippingStatus ShippingStatus { get; set; } + public string ShippingMethodName { get; set; } + public string ShippingRateComputationMethodSystemName { get; set; } + public bool PickUpInStore { get; set; } + public Address PickupAddress { get; set; } + + public bool IsRecurringShoppingCart { get; set; } + //initial order (used with recurring payments) + public Order InitialOrder { get; set; } + + public string CheckoutAttributeDescription { get; set; } + public string CheckoutAttributesXml { get; set; } + + public IList Cart { get; set; } + public List AppliedDiscounts { get; set; } + public List AppliedGiftCards { get; set; } + + public decimal OrderSubTotalInclTax { get; set; } + public decimal OrderSubTotalExclTax { get; set; } + public decimal OrderSubTotalDiscountInclTax { get; set; } + public decimal OrderSubTotalDiscountExclTax { get; set; } + public decimal OrderShippingTotalInclTax { get; set; } + public decimal OrderShippingTotalExclTax { get; set; } + public decimal OrderShippingTotalNonTaxable { get; set; } + public decimal PaymentAdditionalFeeInclTax {get; set; } + public decimal PaymentAdditionalFeeExclTax { get; set; } + public decimal PaymentAdditionalFeeNonTaxable { get; set; } + public decimal OrderTaxTotal {get; set; } + public string VatNumber {get; set; } + public string TaxRates {get; set; } + public decimal OrderDiscountAmount { get; set; } + public RewardPoints RedeemedRewardPoints { get; set; } + public decimal OrderTotal { get; set; } + public decimal OrderAmount { get; set; } //MF 09.12.16 + public decimal OrderAmountIncl { get; set; } //MF 09.12.16 + public decimal OrderDiscountAmountIncl { get; set; } + public decimal EarnedRewardPointsBaseAmountIncl { get; set; } + public decimal EarnedRewardPointsBaseAmountExcl { get; set; } + public bool RewardPointsTaxable { get; set; } + + } + + #endregion + + #region Utilities + + /// + /// Prepare details to place an order. It also sets some properties to "processPaymentRequest" + /// + /// Process payment request + /// Details + protected virtual PlaceOrderContainter PreparePlaceOrderDetails(ProcessPaymentRequest processPaymentRequest) + { + var details = new PlaceOrderContainter(); + + //customer + details.Customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); + if (details.Customer == null) + throw new ArgumentException("Customer is not set"); + + //affiliate + var affiliate = _affiliateService.GetAffiliateById(details.Customer.AffiliateId); + if (affiliate != null && affiliate.Active && !affiliate.Deleted) + details.AffiliateId = affiliate.Id; + + //check whether customer is guest + if (details.Customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed) + throw new NopException("Anonymous checkout is not allowed"); + + //customer currency + var currencyTmp = _currencyService.GetCurrencyById( + details.Customer.GetAttribute(SystemCustomerAttributeNames.CurrencyId, processPaymentRequest.StoreId)); + var customerCurrency = (currencyTmp != null && currencyTmp.Published) ? currencyTmp : _workContext.WorkingCurrency; + var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + details.CustomerCurrencyCode = customerCurrency.CurrencyCode; + details.CustomerCurrencyRate = customerCurrency.Rate / primaryStoreCurrency.Rate; + + //customer language + details.CustomerLanguage = _languageService.GetLanguageById( + details.Customer.GetAttribute(SystemCustomerAttributeNames.LanguageId, processPaymentRequest.StoreId)); + if (details.CustomerLanguage == null || !details.CustomerLanguage.Published) + details.CustomerLanguage = _workContext.WorkingLanguage; + + //billing address + if (details.Customer.BillingAddress == null) + throw new NopException("Billing address is not provided"); + + if (!CommonHelper.IsValidEmail(details.Customer.BillingAddress.Email)) + throw new NopException("Email is not valid"); + + details.BillingAddress = (Address)details.Customer.BillingAddress.Clone(); + if (details.BillingAddress.Country != null && !details.BillingAddress.Country.AllowsBilling) + throw new NopException(string.Format("Country '{0}' is not allowed for billing", details.BillingAddress.Country.Name)); + + //checkout attributes + details.CheckoutAttributesXml = details.Customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, processPaymentRequest.StoreId); + details.CheckoutAttributeDescription = _checkoutAttributeFormatter.FormatAttributes(details.CheckoutAttributesXml, details.Customer); + + //load shopping cart + details.Cart = details.Customer.ShoppingCartItems.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart) + .LimitPerStore(processPaymentRequest.StoreId).ToList(); + + if (!details.Cart.Any()) + throw new NopException("Cart is empty"); + + //validate the entire shopping cart + var warnings = _shoppingCartService.GetShoppingCartWarnings(details.Cart, details.CheckoutAttributesXml, true); + if (warnings.Any()) + throw new NopException(warnings.Aggregate(string.Empty, (current, next) => string.Format("{0}{1};", current, next))); + + //validate individual cart items + foreach (var sci in details.Cart) + { + var sciWarnings = _shoppingCartService.GetShoppingCartItemWarnings(details.Customer, + sci.ShoppingCartType, sci.Product, processPaymentRequest.StoreId, sci.AttributesXml, + sci.CustomerEnteredPrice, sci.RentalStartDateUtc, sci.RentalEndDateUtc, sci.Quantity, false); + if (sciWarnings.Any()) + throw new NopException(sciWarnings.Aggregate(string.Empty, (current, next) => string.Format("{0}{1};", current, next))); + } + + //min totals validation + if (!ValidateMinOrderSubtotalAmount(details.Cart)) + { + var minOrderSubtotalAmount = _currencyService.ConvertFromPrimaryStoreCurrency(_orderSettings.MinOrderSubtotalAmount, _workContext.WorkingCurrency); + throw new NopException(string.Format(_localizationService.GetResource("Checkout.MinOrderSubtotalAmount"), + _priceFormatter.FormatPrice(minOrderSubtotalAmount, true, false))); + } + + if (!ValidateMinOrderTotalAmount(details.Cart)) + { + var minOrderTotalAmount = _currencyService.ConvertFromPrimaryStoreCurrency(_orderSettings.MinOrderTotalAmount, _workContext.WorkingCurrency); + throw new NopException(string.Format(_localizationService.GetResource("Checkout.MinOrderTotalAmount"), + _priceFormatter.FormatPrice(minOrderTotalAmount, true, false))); + } + + //tax display type + if (_taxSettings.AllowCustomersToSelectTaxDisplayType) + details.CustomerTaxDisplayType = (TaxDisplayType)details.Customer.GetAttribute(SystemCustomerAttributeNames.TaxDisplayTypeId, processPaymentRequest.StoreId); + else + details.CustomerTaxDisplayType = _taxSettings.TaxDisplayType; + + + //order total (and applied discounts, gift cards, reward points) + List appliedGiftCardsIncl; + List appliedGiftCardsExcl; + List orderAppliedDiscounts; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + decimal orderDiscountAmount; + RewardPoints redeemedRewardPointsIncl; + RewardPoints redeemedRewardPointsExcl; + TaxSummary taxSummaryIncl; + TaxSummary taxSummaryExcl; + decimal earnedRewardPointsBaseAmountIncl; + decimal earnedRewardPointsBaseAmountExcl; + + //calculate two times to get correct incl./excl. tax + var orderTotalIncl = _orderTotalCalculationService.GetShoppingCartTotal(details.Cart, out orderDiscountAmount, + out orderAppliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, + out appliedGiftCardsIncl, out redeemedRewardPointsIncl, + out taxSummaryIncl, out earnedRewardPointsBaseAmountIncl, true); + + var orderTotalExcl = _orderTotalCalculationService.GetShoppingCartTotal(details.Cart, out orderDiscountAmount, + out orderAppliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, + out appliedGiftCardsExcl, out redeemedRewardPointsExcl, + out taxSummaryExcl, out earnedRewardPointsBaseAmountExcl, false); + + //sub total (incl tax) (excl tax) + details.OrderSubTotalInclTax = taxSummaryIncl.TotalSubTotalAmount; + details.OrderSubTotalDiscountInclTax = taxSummaryIncl.TotalSubTotalDiscAmount; + + details.OrderSubTotalExclTax = taxSummaryExcl.TotalSubTotalAmount; + details.OrderSubTotalDiscountExclTax = taxSummaryExcl.TotalSubTotalDiscAmount; + + + //discount history + foreach (var disc in subTotalAppliedDiscounts) + if (!details.AppliedDiscounts.ContainsDiscount(disc)) + details.AppliedDiscounts.Add(disc); + + //shipping info + if (details.Cart.RequiresShipping()) + { + var pickupPoint = details.Customer.GetAttribute(SystemCustomerAttributeNames.SelectedPickupPoint, processPaymentRequest.StoreId); + if (_shippingSettings.AllowPickUpInStore && pickupPoint != null) + { + var country = _countryService.GetCountryByTwoLetterIsoCode(pickupPoint.CountryCode); + var state = _stateProvinceService.GetStateProvinceByAbbreviation(pickupPoint.StateAbbreviation); + + details.PickUpInStore = true; + details.PickupAddress = new Address + { + Address1 = pickupPoint.Address, + City = pickupPoint.City, + Country = country, + StateProvince = state, + ZipPostalCode = pickupPoint.ZipPostalCode, + CreatedOnUtc = DateTime.UtcNow, + }; + } + else + { + if (details.Customer.ShippingAddress == null) + throw new NopException("Shipping address is not provided"); + + if (!CommonHelper.IsValidEmail(details.Customer.ShippingAddress.Email)) + throw new NopException("Email is not valid"); + + //clone shipping address + details.ShippingAddress = (Address)details.Customer.ShippingAddress.Clone(); + if (details.ShippingAddress.Country != null && !details.ShippingAddress.Country.AllowsShipping) + throw new NopException(string.Format("Country '{0}' is not allowed for shipping", details.ShippingAddress.Country.Name)); + } + + var shippingOption = details.Customer.GetAttribute(SystemCustomerAttributeNames.SelectedShippingOption, processPaymentRequest.StoreId); + if (shippingOption != null) + { + details.ShippingMethodName = shippingOption.Name; + details.ShippingRateComputationMethodSystemName = shippingOption.ShippingRateComputationMethodSystemName; + } + + details.ShippingStatus = ShippingStatus.NotYetShipped; + } + else + details.ShippingStatus = ShippingStatus.ShippingNotRequired; + + //shipping total + details.OrderShippingTotalInclTax = taxSummaryIncl.TotalShippingAmountTaxable ?? decimal.Zero; + details.OrderShippingTotalExclTax = taxSummaryExcl.TotalShippingAmountTaxable ?? decimal.Zero; + details.OrderShippingTotalNonTaxable = taxSummaryIncl.TotalShippingAmountNonTaxable ?? decimal.Zero; + + foreach (var disc in shippingAppliedDiscounts) + if (!details.AppliedDiscounts.ContainsDiscount(disc)) + details.AppliedDiscounts.Add(disc); + + //payment total + details.PaymentAdditionalFeeInclTax = taxSummaryIncl.TotalPaymentFeeAmountTaxable; + details.PaymentAdditionalFeeExclTax = taxSummaryExcl.TotalPaymentFeeAmountTaxable; + details.PaymentAdditionalFeeNonTaxable = taxSummaryExcl.TotalPaymentFeeAmountNonTaxable ?? decimal.Zero; + + //tax amount + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + details.OrderTaxTotal = includingTax? taxSummaryIncl.TotalAmountTax : taxSummaryExcl.TotalAmountTax; + + //VAT number + var customerVatStatus = (VatNumberStatus)details.Customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); + if (_taxSettings.EuVatEnabled && customerVatStatus == VatNumberStatus.Valid) + details.VatNumber = details.Customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); + + //tax rates + //var taxrates = includingTax ? taxSummaryIncl.GenerateOldTaxrateDict() : taxSummaryExcl.GenerateOldTaxrateDict(); + var taxrates = includingTax ? taxSummaryIncl : taxSummaryExcl; + details.TaxRates = taxrates.GenerateTaxRateString(); + + //order total (and applied discounts, gift cards, reward points) + details.OrderDiscountAmount = taxSummaryExcl.TotalInvDiscAmount; + details.OrderDiscountAmountIncl = taxSummaryIncl.TotalInvDiscAmount; + details.RedeemedRewardPoints = includingTax ? redeemedRewardPointsIncl : redeemedRewardPointsExcl; + details.AppliedGiftCards = includingTax ? appliedGiftCardsIncl : appliedGiftCardsExcl; + details.OrderTotal = includingTax ? taxSummaryIncl.TotalPaymentAmount : taxSummaryExcl.TotalPaymentAmount; + details.OrderAmount = includingTax ? taxSummaryIncl.TotalAmount : taxSummaryExcl.TotalAmount; + details.OrderAmountIncl = includingTax ? taxSummaryIncl.TotalAmountIncludingTax : taxSummaryExcl.TotalAmountIncludingTax; + details.EarnedRewardPointsBaseAmountIncl = earnedRewardPointsBaseAmountIncl; + details.EarnedRewardPointsBaseAmountExcl = earnedRewardPointsBaseAmountExcl; + details.RewardPointsTaxable = _rewardPointsSettings.EarnedRewardPointsAreTaxable; + + + //discount history + foreach (var disc in orderAppliedDiscounts) + if (!details.AppliedDiscounts.ContainsDiscount(disc)) + details.AppliedDiscounts.Add(disc); + + processPaymentRequest.OrderTotal = details.OrderTotal; + + //recurring or standard shopping cart? + details.IsRecurringShoppingCart = details.Cart.IsRecurring(); + if (details.IsRecurringShoppingCart) + { + int recurringCycleLength; + RecurringProductCyclePeriod recurringCyclePeriod; + int recurringTotalCycles; + var recurringCyclesError = details.Cart.GetRecurringCycleInfo(_localizationService, + out recurringCycleLength, out recurringCyclePeriod, out recurringTotalCycles); + if (!string.IsNullOrEmpty(recurringCyclesError)) + throw new NopException(recurringCyclesError); + + processPaymentRequest.RecurringCycleLength = recurringCycleLength; + processPaymentRequest.RecurringCyclePeriod = recurringCyclePeriod; + processPaymentRequest.RecurringTotalCycles = recurringTotalCycles; + } + + return details; + } + + /// + /// Prepare details to place order based on the recurring payment. + /// + /// Process payment request + /// Details + protected virtual PlaceOrderContainter PrepareRecurringOrderDetails(ProcessPaymentRequest processPaymentRequest) + { + var details = new PlaceOrderContainter(); + details.IsRecurringShoppingCart = true; + + //Load initial order + details.InitialOrder = _orderService.GetOrderById(processPaymentRequest.InitialOrderId); + if (details.InitialOrder == null) + throw new ArgumentException("Initial order is not set for recurring payment"); + + processPaymentRequest.PaymentMethodSystemName = details.InitialOrder.PaymentMethodSystemName; + + //customer + details.Customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); + if (details.Customer == null) + throw new ArgumentException("Customer is not set"); + + //affiliate + var affiliate = _affiliateService.GetAffiliateById(details.Customer.AffiliateId); + if (affiliate != null && affiliate.Active && !affiliate.Deleted) + details.AffiliateId = affiliate.Id; + + //check whether customer is guest + if (details.Customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed) + throw new NopException("Anonymous checkout is not allowed"); + + //customer currency + details.CustomerCurrencyCode = details.InitialOrder.CustomerCurrencyCode; + details.CustomerCurrencyRate = details.InitialOrder.CurrencyRate; + + //customer language + details.CustomerLanguage = _languageService.GetLanguageById(details.InitialOrder.CustomerLanguageId); + if (details.CustomerLanguage == null || !details.CustomerLanguage.Published) + details.CustomerLanguage = _workContext.WorkingLanguage; + + //billing address + if (details.InitialOrder.BillingAddress == null) + throw new NopException("Billing address is not available"); + + details.BillingAddress = (Address)details.InitialOrder.BillingAddress.Clone(); + if (details.BillingAddress.Country != null && !details.BillingAddress.Country.AllowsBilling) + throw new NopException(string.Format("Country '{0}' is not allowed for billing", details.BillingAddress.Country.Name)); + + //checkout attributes + details.CheckoutAttributesXml = details.InitialOrder.CheckoutAttributesXml; + details.CheckoutAttributeDescription = details.InitialOrder.CheckoutAttributeDescription; + + //tax display type + details.CustomerTaxDisplayType = details.InitialOrder.CustomerTaxDisplayType; + + //sub total + details.OrderSubTotalInclTax = details.InitialOrder.OrderSubtotalInclTax; + details.OrderSubTotalExclTax = details.InitialOrder.OrderSubtotalExclTax; + + //shipping info + if (details.InitialOrder.ShippingStatus != ShippingStatus.ShippingNotRequired) + { + details.PickUpInStore = details.InitialOrder.PickUpInStore; + if (!details.PickUpInStore) + { + if (details.InitialOrder.ShippingAddress == null) + throw new NopException("Shipping address is not available"); + + //clone shipping address + details.ShippingAddress = (Address)details.InitialOrder.ShippingAddress.Clone(); + if (details.ShippingAddress.Country != null && !details.ShippingAddress.Country.AllowsShipping) + throw new NopException(string.Format("Country '{0}' is not allowed for shipping", details.ShippingAddress.Country.Name)); + } + else + if (details.InitialOrder.PickupAddress != null) + details.PickupAddress = (Address)details.InitialOrder.PickupAddress.Clone(); + details.ShippingMethodName = details.InitialOrder.ShippingMethod; + details.ShippingRateComputationMethodSystemName = details.InitialOrder.ShippingRateComputationMethodSystemName; + details.ShippingStatus = ShippingStatus.NotYetShipped; + } + else + details.ShippingStatus = ShippingStatus.ShippingNotRequired; + + //shipping total + details.OrderShippingTotalInclTax = details.InitialOrder.OrderShippingInclTax; + details.OrderShippingTotalExclTax = details.InitialOrder.OrderShippingExclTax; + details.OrderShippingTotalNonTaxable = details.InitialOrder.OrderShippingNonTaxable; + + //payment total + details.PaymentAdditionalFeeInclTax = details.InitialOrder.PaymentMethodAdditionalFeeInclTax; + details.PaymentAdditionalFeeExclTax = details.InitialOrder.PaymentMethodAdditionalFeeExclTax; + details.PaymentAdditionalFeeNonTaxable = details.InitialOrder.PaymentMethodAdditionalFeeNonTaxable; + + //tax total + details.OrderTaxTotal = details.InitialOrder.OrderTax; + + //VAT number + details.VatNumber = details.InitialOrder.VatNumber; + + //order total + details.OrderDiscountAmount = details.InitialOrder.OrderDiscount; + details.OrderTotal = details.InitialOrder.OrderTotal; + details.OrderAmount = details.InitialOrder.OrderAmount; + details.OrderAmountIncl = details.InitialOrder.OrderAmountIncl; + details.OrderDiscountAmountIncl = details.InitialOrder.OrderDiscountIncl; + details.EarnedRewardPointsBaseAmountIncl = details.InitialOrder.EarnedRewardPointsBaseAmountIncl; + details.EarnedRewardPointsBaseAmountExcl = details.InitialOrder.EarnedRewardPointsBaseAmountExcl; + details.RewardPointsTaxable = _rewardPointsSettings.EarnedRewardPointsAreTaxable; + processPaymentRequest.OrderTotal = details.OrderTotal; + + return details; + } + + /// + /// Save order and add order notes + /// + /// Process payment request + /// Process payment result + /// Details + /// Order + protected virtual Order SaveOrderDetails(ProcessPaymentRequest processPaymentRequest, + ProcessPaymentResult processPaymentResult, PlaceOrderContainter details) + { + var order = new Order + { + StoreId = processPaymentRequest.StoreId, + OrderGuid = processPaymentRequest.OrderGuid, + CustomerId = details.Customer.Id, + CustomerLanguageId = details.CustomerLanguage.Id, + CustomerTaxDisplayType = details.CustomerTaxDisplayType, + CustomerIp = _webHelper.GetCurrentIpAddress(), + OrderSubtotalInclTax = details.OrderSubTotalInclTax, + OrderSubtotalExclTax = details.OrderSubTotalExclTax, + OrderSubTotalDiscountInclTax = details.OrderSubTotalDiscountInclTax, + OrderSubTotalDiscountExclTax = details.OrderSubTotalDiscountExclTax, + OrderShippingInclTax = details.OrderShippingTotalInclTax, + OrderShippingExclTax = details.OrderShippingTotalExclTax, + OrderShippingNonTaxable = details.OrderShippingTotalNonTaxable, + PaymentMethodAdditionalFeeInclTax = details.PaymentAdditionalFeeInclTax, + PaymentMethodAdditionalFeeExclTax = details.PaymentAdditionalFeeExclTax, + PaymentMethodAdditionalFeeNonTaxable = details.PaymentAdditionalFeeNonTaxable, + TaxRates = details.TaxRates, + OrderTax = details.OrderTaxTotal, + OrderTotal = details.OrderTotal, + OrderAmount = details.OrderAmount, + OrderAmountIncl = details.OrderAmountIncl, + OrderDiscountIncl = details.OrderDiscountAmountIncl, + EarnedRewardPointsBaseAmountIncl = details.EarnedRewardPointsBaseAmountIncl, + EarnedRewardPointsBaseAmountExcl = details.EarnedRewardPointsBaseAmountExcl, + RewardPointsTaxable = details.RewardPointsTaxable, + RefundedAmount = decimal.Zero, + OrderDiscount = details.OrderDiscountAmount, + CheckoutAttributeDescription = details.CheckoutAttributeDescription, + CheckoutAttributesXml = details.CheckoutAttributesXml, + CustomerCurrencyCode = details.CustomerCurrencyCode, + CurrencyRate = details.CustomerCurrencyRate, + AffiliateId = details.AffiliateId, + OrderStatus = OrderStatus.Pending, + AllowStoringCreditCardNumber = processPaymentResult.AllowStoringCreditCardNumber, + CardType = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardType) : string.Empty, + CardName = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardName) : string.Empty, + CardNumber = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardNumber) : string.Empty, + MaskedCreditCardNumber = _encryptionService.EncryptText(_paymentService.GetMaskedCreditCardNumber(processPaymentRequest.CreditCardNumber)), + CardCvv2 = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardCvv2) : string.Empty, + CardExpirationMonth = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardExpireMonth.ToString()) : string.Empty, + CardExpirationYear = processPaymentResult.AllowStoringCreditCardNumber ? _encryptionService.EncryptText(processPaymentRequest.CreditCardExpireYear.ToString()) : string.Empty, + PaymentMethodSystemName = processPaymentRequest.PaymentMethodSystemName, + AuthorizationTransactionId = processPaymentResult.AuthorizationTransactionId, + AuthorizationTransactionCode = processPaymentResult.AuthorizationTransactionCode, + AuthorizationTransactionResult = processPaymentResult.AuthorizationTransactionResult, + CaptureTransactionId = processPaymentResult.CaptureTransactionId, + CaptureTransactionResult = processPaymentResult.CaptureTransactionResult, + SubscriptionTransactionId = processPaymentResult.SubscriptionTransactionId, + PaymentStatus = processPaymentResult.NewPaymentStatus, + PaidDateUtc = null, + BillingAddress = details.BillingAddress, + ShippingAddress = details.ShippingAddress, + ShippingStatus = details.ShippingStatus, + ShippingMethod = details.ShippingMethodName, + PickUpInStore = details.PickUpInStore, + PickupAddress = details.PickupAddress, + ShippingRateComputationMethodSystemName = details.ShippingRateComputationMethodSystemName, + CustomValuesXml = processPaymentRequest.SerializeCustomValues(), + VatNumber = details.VatNumber, + CreatedOnUtc = DateTime.UtcNow, + InvoiceId = null, + InvoiceDateUtc = null, + CustomOrderNumber = string.Empty + }; + + _orderService.InsertOrder(order); + + //generate and set custom order number + order.CustomOrderNumber = _customNumberFormatter.GenerateOrderCustomNumber(order); + _orderService.UpdateOrder(order); + + //reward points history + if (details.RedeemedRewardPoints.AmountTotal > decimal.Zero) + { + //set to negative + details.RedeemedRewardPoints.RevertSign(); + //add entry + _rewardPointService.AddRewardPointsHistoryEntry(details.Customer, details.RedeemedRewardPoints, order.StoreId, + string.Format(_localizationService.GetResource("RewardPoints.Message.RedeemedForOrder", order.CustomerLanguageId), order.CustomOrderNumber), + order, hasUsedAmount: true); + + _customerService.UpdateCustomer(details.Customer); + } + + return order; + } + + /// + /// Send "order placed" notifications and save order notes + /// + /// Order + protected virtual void SendNotificationsAndSaveNotes(Order order) + { + //notes, messages + if (_workContext.OriginalCustomerIfImpersonated != null) + //this order is placed by a store administrator impersonating a customer + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order placed by a store owner ('{0}'. ID = {1}) impersonating the customer.", + _workContext.OriginalCustomerIfImpersonated.Email, _workContext.OriginalCustomerIfImpersonated.Id), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + else + order.OrderNotes.Add(new OrderNote + { + Note = "Order placed", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //send email notifications + var orderPlacedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderPlacedStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId); + if (orderPlacedStoreOwnerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order placed\" email (to store owner) has been queued. Queued email identifier: {0}.", orderPlacedStoreOwnerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + + var orderPlacedAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderPlacedEmail ? + _pdfService.PrintOrderToPdf(order) : null; + var orderPlacedAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderPlacedEmail ? + "order.pdf" : null; + var orderPlacedCustomerNotificationQueuedEmailId = _workflowMessageService + .SendOrderPlacedCustomerNotification(order, order.CustomerLanguageId, orderPlacedAttachmentFilePath, orderPlacedAttachmentFileName); + if (orderPlacedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order placed\" email (to customer) has been queued. Queued email identifier: {0}.", orderPlacedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + + var vendors = GetVendorsInOrder(order); + foreach (var vendor in vendors) + { + var orderPlacedVendorNotificationQueuedEmailId = _workflowMessageService.SendOrderPlacedVendorNotification(order, vendor, _localizationSettings.DefaultAdminLanguageId); + if (orderPlacedVendorNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order placed\" email (to vendor) has been queued. Queued email identifier: {0}.", orderPlacedVendorNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + } + } + /// + /// Award (earn) reward points (for placing a new order) + /// + /// Order + protected virtual void AwardRewardPoints(Order order) + { + //Ensure that reward points were not added (earned) before. We should not add reward points if they were already earned for this order + if (order.RewardPointsHistoryEntryId.HasValue) + return; + + var points = new RewardPoints(_rewardPointService); + + //earned points + decimal usedPurchasedRewardPointsAmount = order.RedeemedRewardPointsEntry != null ? order.RedeemedRewardPointsEntry.UsedAmountPurchased : decimal.Zero; + + bool includingTax = order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax; + decimal amount = _rewardPointService.GetRewardPointsBaseAmount(includingTax ? order.EarnedRewardPointsBaseAmountIncl : order.EarnedRewardPointsBaseAmountExcl, usedPurchasedRewardPointsAmount); + points.Points = _rewardPointService.CalculateRewardPoints(order.Customer, amount); + if (points.Points == 0) + return; + + //check whether delay is set + DateTime? activatingDate = null; + if (_rewardPointsSettings.ActivationDelay > 0) + { + var delayPeriod = (RewardPointsActivatingDelayPeriod)_rewardPointsSettings.ActivationDelayPeriodId; + var delayInHours = delayPeriod.ToHours(_rewardPointsSettings.ActivationDelay); + activatingDate = DateTime.UtcNow.AddHours(delayInHours); + } + + //add reward points + order.RewardPointsHistoryEntryId = _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, points, order.StoreId, + string.Format(_localizationService.GetResource("RewardPoints.Message.EarnedForOrder"), order.CustomOrderNumber, amount), activatingDate: activatingDate); + + _orderService.UpdateOrder(order); + } + + /// + /// Reduce (cancel) reward points (previously awarded for placing an order) + /// + /// Order + protected virtual void ReduceRewardPoints(Order order) + { + //ensure that reward points were already earned for this order before + if (!order.RewardPointsHistoryEntryId.HasValue) + return; + + //is this needed? points have already been assigned, why recalculate them? Use what was assigned + //var totalForRewardPoints = _orderTotalCalculationService.CalculateApplicableOrderTotalForRewardPoints(order.OrderShippingInclTax, order.OrderTotal); + //int points = _orderTotalCalculationService.CalculateRewardPoints(order.Customer, totalForRewardPoints); + //if (points == 0) + // return; + + //get appropriate history entry + var rewardPointsHistoryEntry = _rewardPointService.GetRewardPointsHistoryEntryById(order.RewardPointsHistoryEntryId.Value); + if (rewardPointsHistoryEntry != null && rewardPointsHistoryEntry.CreatedOnUtc > DateTime.UtcNow && !rewardPointsHistoryEntry.PointsBalance.HasValue && rewardPointsHistoryEntry.PointsPurchased == 0) + { + //just delete the upcoming entry (points were not granted yet); assure PointsBalance.HasValue is null and points where not purchased + _rewardPointService.DeleteRewardPointsHistoryEntry(rewardPointsHistoryEntry); + } + else + { + //or reduce reward points if the entry already exists + var rewardPoints = new RewardPoints(_rewardPointService) + { + Points = -rewardPointsHistoryEntry.Points, + PointsPurchased = -rewardPointsHistoryEntry.PointsPurchased + }; + _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, rewardPoints, order.StoreId, + string.Format(_localizationService.GetResource("RewardPoints.Message.ReducedForOrder"), order.CustomOrderNumber)); + } + + _orderService.UpdateOrder(order); + } + + /// + /// Return back redeemded reward points to a customer (spent when placing an order) + /// + /// Order + protected virtual void ReturnBackRedeemedRewardPoints(Order order) + { + //were some points redeemed when placing an order? + if (order.RedeemedRewardPointsEntry == null) + return; + + //return back + var redeemdRewardPoints = new RewardPoints(_rewardPointService) + { + Points = -order.RedeemedRewardPointsEntry.Points, + PointsPurchased = -order.RedeemedRewardPointsEntry.PointsPurchased + }; + _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, redeemdRewardPoints, order.StoreId, + string.Format(_localizationService.GetResource("RewardPoints.Message.ReturnedForOrder"), order.CustomOrderNumber)); + _orderService.UpdateOrder(order); + } + + /// + /// Award purchased reward points + /// + /// Order + /// shoppingcart item + protected virtual void AwardPurchasedRewardPoints(Order order, ShoppingCartItem sc, OrderItem orderItem) + { + //Ensure that reward points were not added before. + if (order.RewardPointsHistoryEntryId.HasValue) + return; + + var points = new RewardPoints(_rewardPointService) + { + PointsPurchased = _rewardPointService.ConvertAmountToRewardPoints(orderItem.PriceInclTax, sc.Product.OverriddenRPExchangeRate) + }; + + //When puchasing reward points, earned points are immediately added. As points get pruchased, points can be earned independently of the setting EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints. + //earned points + bool includingTax = order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax; + decimal baseAmount = includingTax ? order.EarnedRewardPointsBaseAmountIncl : order.EarnedRewardPointsBaseAmountExcl; + points.Points = _rewardPointService.CalculateRewardPoints(order.Customer, baseAmount); + + //total points + if (points.PointsPurchased == 0 && points.Points == 0) + return; + + //add reward points + string message = string.Format( + points.Points == 0 ? _localizationService.GetResource("RewardPoints.Message.PurchasedWithOrder") + : _localizationService.GetResource("RewardPoints.Message.PurchasedEarnedWithOrder") + , order.CustomOrderNumber, baseAmount); + + order.RewardPointsHistoryEntryId = _rewardPointService.AddRewardPointsHistoryEntry(order.Customer, points, order.StoreId, + message.ToString(), orderItem: orderItem); + + _orderService.UpdateOrder(order); + } + /// + /// Set IsActivated value for purchase gift cards for particular order + /// + /// Order + /// A value indicating whether to activate gift cards; true - activate, false - deactivate + protected virtual void SetActivatedValueForPurchasedGiftCards(Order order, bool activate) + { + var giftCards = _giftCardService.GetAllGiftCards(purchasedWithOrderId: order.Id, + isGiftCardActivated: !activate); + foreach (var gc in giftCards) + { + if (activate) + { + //activate + bool isRecipientNotified = gc.IsRecipientNotified; + if (gc.GiftCardType == GiftCardType.Virtual) + { + //send email for virtual gift card + if (!String.IsNullOrEmpty(gc.RecipientEmail) && + !String.IsNullOrEmpty(gc.SenderEmail)) + { + var customerLang = _languageService.GetLanguageById(order.CustomerLanguageId); + if (customerLang == null) + customerLang = _languageService.GetAllLanguages().FirstOrDefault(); + if (customerLang == null) + throw new Exception("No languages could be loaded"); + int queuedEmailId = _workflowMessageService.SendGiftCardNotification(gc, customerLang.Id); + if (queuedEmailId > 0) + isRecipientNotified = true; + } + } + gc.IsGiftCardActivated = true; + gc.IsRecipientNotified = isRecipientNotified; + _giftCardService.UpdateGiftCard(gc); + } + else + { + //deactivate + gc.IsGiftCardActivated = false; + _giftCardService.UpdateGiftCard(gc); + } + } + } + + /// + /// Sets an order status + /// + /// Order + /// New order status + /// True to notify customer + protected virtual void SetOrderStatus(Order order, OrderStatus os, bool notifyCustomer) + { + if (order == null) + throw new ArgumentNullException("order"); + + OrderStatus prevOrderStatus = order.OrderStatus; + if (prevOrderStatus == os) + return; + + //set and save new order status + order.OrderStatusId = (int)os; + _orderService.UpdateOrder(order); + + //order notes, notifications + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order status has been changed to {0}", os.ToString()), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + + if (prevOrderStatus != OrderStatus.Complete && + os == OrderStatus.Complete + && notifyCustomer) + { + //notification + var orderCompletedAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ? + _pdfService.PrintOrderToPdf(order) : null; + var orderCompletedAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ? + "order.pdf" : null; + int orderCompletedCustomerNotificationQueuedEmailId = _workflowMessageService + .SendOrderCompletedCustomerNotification(order, order.CustomerLanguageId, orderCompletedAttachmentFilePath, + orderCompletedAttachmentFileName); + if (orderCompletedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order completed\" email (to customer) has been queued. Queued email identifier: {0}.", orderCompletedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + } + + if (prevOrderStatus != OrderStatus.Cancelled && + os == OrderStatus.Cancelled + && notifyCustomer) + { + //notification + int orderCancelledCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderCancelledCustomerNotification(order, order.CustomerLanguageId); + if (orderCancelledCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order cancelled\" email (to customer) has been queued. Queued email identifier: {0}.", orderCancelledCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + } + + //reward points + if (order.OrderStatus == OrderStatus.Complete) + { + AwardRewardPoints(order); + } + if (order.OrderStatus == OrderStatus.Cancelled) + { + ReduceRewardPoints(order); + } + + //gift cards activation + if (_orderSettings.ActivateGiftCardsAfterCompletingOrder && order.OrderStatus == OrderStatus.Complete) + { + SetActivatedValueForPurchasedGiftCards(order, true); + } + + //gift cards deactivation + if (_orderSettings.DeactivateGiftCardsAfterCancellingOrder && order.OrderStatus == OrderStatus.Cancelled) + { + SetActivatedValueForPurchasedGiftCards(order, false); + } + } + + /// + /// Process order paid status + /// + /// Order + protected virtual void ProcessOrderPaid(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + //raise event + _eventPublisher.Publish(new OrderPaidEvent(order)); + + //order paid email notification + if (order.OrderTotal != decimal.Zero) + { + //we should not send it for free ($0 total) orders? + //remove this "if" statement if you want to send it in this case + + var orderPaidAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderPaidEmail ? + _pdfService.PrintOrderToPdf(order) : null; + var orderPaidAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderPaidEmail ? + "order.pdf" : null; + _workflowMessageService.SendOrderPaidCustomerNotification(order, order.CustomerLanguageId, + orderPaidAttachmentFilePath, orderPaidAttachmentFileName); + + _workflowMessageService.SendOrderPaidStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId); + var vendors = GetVendorsInOrder(order); + foreach (var vendor in vendors) + { + _workflowMessageService.SendOrderPaidVendorNotification(order, vendor, _localizationSettings.DefaultAdminLanguageId); + } + //TODO add "order paid email sent" order note + } + + //customer roles with "purchased with product" specified + ProcessCustomerRolesWithPurchasedProductSpecified(order, true); + } + + /// + /// Process customer roles with "Purchased with Product" property configured + /// + /// Order + /// A value indicating whether to add configured customer role; true - add, false - remove + protected virtual void ProcessCustomerRolesWithPurchasedProductSpecified(Order order, bool add) + { + if (order == null) + throw new ArgumentNullException("order"); + + //purchased product identifiers + var purchasedProductIds = new List(); + foreach (var orderItem in order.OrderItems) + { + //standard items + purchasedProductIds.Add(orderItem.ProductId); + + //bundled (associated) products + var attributeValues = _productAttributeParser.ParseProductAttributeValues(orderItem.AttributesXml); + foreach (var attributeValue in attributeValues) + { + if (attributeValue.AttributeValueType == AttributeValueType.AssociatedToProduct) + { + purchasedProductIds.Add(attributeValue.AssociatedProductId); + } + } + } + + //list of customer roles + var customerRoles = _customerService + .GetAllCustomerRoles(true) + .Where(cr => purchasedProductIds.Contains(cr.PurchasedWithProductId)) + .ToList(); + + if (customerRoles.Any()) + { + var customer = order.Customer; + foreach (var customerRole in customerRoles) + { + if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) == 0) + { + //not in the list yet + if (add) + { + //add + customer.CustomerRoles.Add(customerRole); + } + } + else + { + //already in the list + if (!add) + { + //remove + customer.CustomerRoles.Remove(customerRole); + } + } + } + _customerService.UpdateCustomer(customer); + } + } + + /// + /// Get a list of vendors in order (order items) + /// + /// Order + /// Vendors + protected virtual IList GetVendorsInOrder(Order order) + { + var vendors = new List(); + foreach (var orderItem in order.OrderItems) + { + var vendorId = orderItem.Product.VendorId; + //find existing + var vendor = vendors.FirstOrDefault(v => v.Id == vendorId); + if (vendor == null) + { + //not found. load by Id + vendor = _vendorService.GetVendorById(vendorId); + if (vendor != null && !vendor.Deleted && vendor.Active) + { + vendors.Add(vendor); + } + } + } + + return vendors; + } + + #endregion + + #region Methods + + /// + /// Checks order status + /// + /// Order + /// Validated order + public virtual void CheckOrderStatus(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.PaymentStatus == PaymentStatus.Paid && !order.PaidDateUtc.HasValue) + { + //ensure that paid date is set + order.PaidDateUtc = DateTime.UtcNow; + _orderService.UpdateOrder(order); + } + + //set invoice id + if (order.PaymentStatus == PaymentStatus.Paid && order.InvoiceId == null) + { + if (_orderSettings.AssignInvoiceIdentFromTask) + order.InvoiceId = "ToBeAssigned"; + else + { + order.InvoiceDateUtc = DateTime.UtcNow; + order.InvoiceId = GetInvoiceId(order.StoreId); + } + _orderService.UpdateOrder(order); + } + + if (order.OrderStatus == OrderStatus.Pending) + { + if (order.PaymentStatus == PaymentStatus.Authorized || + order.PaymentStatus == PaymentStatus.Paid) + { + SetOrderStatus(order, OrderStatus.Processing, false); + } + } + + if (order.OrderStatus == OrderStatus.Pending) + { + if (order.ShippingStatus == ShippingStatus.PartiallyShipped || + order.ShippingStatus == ShippingStatus.Shipped || + order.ShippingStatus == ShippingStatus.Delivered) + { + SetOrderStatus(order, OrderStatus.Processing, false); + } + } + + //is order complete? + if (order.OrderStatus != OrderStatus.Cancelled && + order.OrderStatus != OrderStatus.Complete) + { + if (order.PaymentStatus == PaymentStatus.Paid) + { + var completed = false; + if (order.ShippingStatus == ShippingStatus.ShippingNotRequired) + { + //shipping is not required + completed = true; + } + else + { + //shipping is required + if (_orderSettings.CompleteOrderWhenDelivered) + { + completed = order.ShippingStatus == ShippingStatus.Delivered; + } + else + { + completed = order.ShippingStatus == ShippingStatus.Shipped || + order.ShippingStatus == ShippingStatus.Delivered; + } + } + + if (completed) + { + SetOrderStatus(order, OrderStatus.Complete, true); + } + } + } + } + + /// + /// Places an order + /// + /// Process payment request + /// Place order result + public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentRequest) + { + if (processPaymentRequest == null) + throw new ArgumentNullException("processPaymentRequest"); + + var result = new PlaceOrderResult(); + try + { + if (processPaymentRequest.OrderGuid == Guid.Empty) + processPaymentRequest.OrderGuid = Guid.NewGuid(); + + //prepare order details + var details = PreparePlaceOrderDetails(processPaymentRequest); + + #region Payment workflow + + + //process payment + ProcessPaymentResult processPaymentResult = null; + //skip payment workflow if order total equals zero + var skipPaymentWorkflow = details.OrderTotal == decimal.Zero; + if (!skipPaymentWorkflow) + { + var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + + //ensure that payment method is active + if (!paymentMethod.IsPaymentMethodActive(_paymentSettings)) + throw new NopException("Payment method is not active"); + + if (details.IsRecurringShoppingCart) + { + //recurring cart + switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) + { + case RecurringPaymentType.NotSupported: + throw new NopException("Recurring payments are not supported by selected payment method"); + case RecurringPaymentType.Manual: + case RecurringPaymentType.Automatic: + processPaymentResult = _paymentService.ProcessRecurringPayment(processPaymentRequest); + break; + default: + throw new NopException("Not supported recurring payment type"); + } + } + else + //standard cart + processPaymentResult = _paymentService.ProcessPayment(processPaymentRequest); + } + else + //payment is not required + processPaymentResult = new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid }; + + if (processPaymentResult == null) + throw new NopException("processPaymentResult is not available"); + + #endregion + + if (processPaymentResult.Success) + { + #region Save order details + + var order = SaveOrderDetails(processPaymentRequest, processPaymentResult, details); + result.PlacedOrder = order; + + //move shopping cart items to order items + foreach (var sc in details.Cart) + { + //prices + decimal taxRate; + List scDiscounts; + decimal discountAmount; + int? maximumDiscountQty; + var scUnitPrice = _priceCalculationService.GetUnitPrice(sc); + var scSubTotal = _priceCalculationService.GetSubTotal(sc, true, out discountAmount, out scDiscounts, out maximumDiscountQty); + var scUnitPriceInclTax = _taxService.GetProductPrice(sc.Product, scUnitPrice, true, details.Customer, out taxRate); + var scUnitPriceExclTax = _taxService.GetProductPrice(sc.Product, scUnitPrice, false, details.Customer, out taxRate); + var scSubTotalInclTax = _taxService.GetProductPrice(sc.Product, scSubTotal, true, details.Customer, out taxRate); + var scSubTotalExclTax = _taxService.GetProductPrice(sc.Product, scSubTotal, false, details.Customer, out taxRate); + var discountAmountInclTax = _taxService.GetProductPrice(sc.Product, discountAmount, true, details.Customer, out taxRate); + var discountAmountExclTax = _taxService.GetProductPrice(sc.Product, discountAmount, false, details.Customer, out taxRate); + foreach (var disc in scDiscounts) + if (!details.AppliedDiscounts.ContainsDiscount(disc)) + details.AppliedDiscounts.Add(disc); + + //attributes + var attributeDescription = _productAttributeFormatter.FormatAttributes(sc.Product, sc.AttributesXml, details.Customer, subTotal: _taxSettings.PricesIncludeTax ? scSubTotalInclTax : scSubTotalExclTax); + + var itemWeight = _shippingService.GetShoppingCartItemWeight(sc); + + //save order item + var orderItem = new OrderItem + { + OrderItemGuid = Guid.NewGuid(), + Order = order, + ProductId = sc.ProductId, + UnitPriceInclTax = scUnitPriceInclTax, + UnitPriceExclTax = scUnitPriceExclTax, + PriceInclTax = scSubTotalInclTax, + PriceExclTax = scSubTotalExclTax, + OriginalProductCost = _priceCalculationService.GetProductCost(sc.Product, sc.AttributesXml), + AttributeDescription = attributeDescription, + AttributesXml = sc.AttributesXml, + Quantity = sc.Quantity, + DiscountAmountInclTax = discountAmountInclTax, + DiscountAmountExclTax = discountAmountExclTax, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = itemWeight, + RentalStartDateUtc = sc.RentalStartDateUtc, + RentalEndDateUtc = sc.RentalEndDateUtc, + TaxRate = taxRate //MF 25.11.16 + }; + order.OrderItems.Add(orderItem); + _orderService.UpdateOrder(order); + + //gift cards + if (sc.Product.IsGiftCard) + { + string giftCardRecipientName; + string giftCardRecipientEmail; + string giftCardSenderName; + string giftCardSenderEmail; + string giftCardMessage; + _productAttributeParser.GetGiftCardAttribute(sc.AttributesXml, out giftCardRecipientName, + out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); + + for (var i = 0; i < sc.Quantity; i++) + { + _giftCardService.InsertGiftCard(new GiftCard + { + GiftCardType = sc.Product.GiftCardType, + PurchasedWithOrderItem = orderItem, + Amount = sc.Product.OverriddenGiftCardAmount.HasValue ? sc.Product.OverriddenGiftCardAmount.Value : scUnitPriceExclTax, + IsGiftCardActivated = false, + GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), + RecipientName = giftCardRecipientName, + RecipientEmail = giftCardRecipientEmail, + SenderName = giftCardSenderName, + SenderEmail = giftCardSenderEmail, + Message = giftCardMessage, + IsRecipientNotified = false, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + + //purchased reward points from product + if (sc.Product.IsRewardPoints && scUnitPriceExclTax > decimal.Zero) + { + AwardPurchasedRewardPoints(order, sc, orderItem); + } + + //inventory + _productService.AdjustInventory(sc.Product, -sc.Quantity, sc.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.PlaceOrder"), order.Id)); + } + + //clear shopping cart + details.Cart.ToList().ForEach(sci => _shoppingCartService.DeleteShoppingCartItem(sci, false)); + + //discount usage history + foreach (var discount in details.AppliedDiscounts) + { + var d = _discountService.GetDiscountById(discount.Id); + if (d != null) + { + _discountService.InsertDiscountUsageHistory(new DiscountUsageHistory + { + Discount = d, + Order = order, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + + //gift card usage history + if (details.AppliedGiftCards != null) + foreach (var agc in details.AppliedGiftCards) + { + agc.GiftCard.GiftCardUsageHistory.Add(new GiftCardUsageHistory + { + GiftCard = agc.GiftCard, + UsedWithOrder = order, + UsedValue = agc.AmountCanBeUsed, + CreatedOnUtc = DateTime.UtcNow + }); + _giftCardService.UpdateGiftCard(agc.GiftCard); + } + + //recurring orders + if (details.IsRecurringShoppingCart) + { + //create recurring payment (the first payment) + var rp = new RecurringPayment + { + CycleLength = processPaymentRequest.RecurringCycleLength, + CyclePeriod = processPaymentRequest.RecurringCyclePeriod, + TotalCycles = processPaymentRequest.RecurringTotalCycles, + StartDateUtc = DateTime.UtcNow, + IsActive = true, + CreatedOnUtc = DateTime.UtcNow, + InitialOrder = order, + }; + _orderService.InsertRecurringPayment(rp); + + switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) + { + case RecurringPaymentType.NotSupported: + //not supported + break; + case RecurringPaymentType.Manual: + rp.RecurringPaymentHistory.Add(new RecurringPaymentHistory + { + RecurringPayment = rp, + CreatedOnUtc = DateTime.UtcNow, + OrderId = order.Id, + }); + _orderService.UpdateRecurringPayment(rp); + break; + case RecurringPaymentType.Automatic: + //will be created later (process is automated) + break; + default: + break; + } + } + + #endregion + + //notifications + SendNotificationsAndSaveNotes(order); + + //reset checkout data + _customerService.ResetCheckoutData(details.Customer, processPaymentRequest.StoreId, clearCouponCodes: true, clearCheckoutAttributes: true); + _customerActivityService.InsertActivity("PublicStore.PlaceOrder", _localizationService.GetResource("ActivityLog.PublicStore.PlaceOrder"), order.Id); + + //check order status + CheckOrderStatus(order); + + //raise event + _eventPublisher.Publish(new OrderPlacedEvent(order)); + + if (order.PaymentStatus == PaymentStatus.Paid) + ProcessOrderPaid(order); + } + else + foreach (var paymentError in processPaymentResult.Errors) + result.AddError(string.Format(_localizationService.GetResource("Checkout.PaymentError"), paymentError)); + } + catch (Exception exc) + { + _logger.Error(exc.Message, exc); + result.AddError(exc.Message); + } + + #region Process errors + + if (!result.Success) + { + //log errors + var logError = result.Errors.Aggregate("Error while placing order. ", + (current, next) => string.Format("{0}Error {1}: {2}. ", current, result.Errors.IndexOf(next) + 1, next)); + var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); + _logger.Error(logError, customer: customer); + } + + #endregion + + return result; + } + + /// + /// Update order totals + /// + /// Parameters for the updating order + public virtual void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters) + { + if (!_orderSettings.AutoUpdateOrderTotalsOnEditingOrder) + return; + + var updatedOrder = updateOrderParameters.UpdatedOrder; + var updatedOrderItem = updateOrderParameters.UpdatedOrderItem; + + //restore shopping cart from order items + var restoredCart = updatedOrder.OrderItems.Select(orderItem => new ShoppingCartItem + { + Id = orderItem.Id, + AttributesXml = orderItem.AttributesXml, + Customer = updatedOrder.Customer, + Product = orderItem.Product, + Quantity = orderItem.Id == updatedOrderItem.Id ? updateOrderParameters.Quantity : orderItem.Quantity, + RentalEndDateUtc = orderItem.RentalEndDateUtc, + RentalStartDateUtc = orderItem.RentalStartDateUtc, + ShoppingCartType = ShoppingCartType.ShoppingCart, + StoreId = updatedOrder.StoreId, + TaxRate = orderItem.Id == updatedOrderItem.Id ? updateOrderParameters.TaxRate : orderItem.TaxRate, + SubTotalInclTax = orderItem.Id == updatedOrderItem.Id ? updateOrderParameters.SubTotalInclTax : orderItem.PriceInclTax, + SubTotalExclTax = orderItem.Id == updatedOrderItem.Id ? updateOrderParameters.SubTotalExclTax : orderItem.PriceExclTax + }).ToList(); + + //get shopping cart item which has been updated + var updatedShoppingCartItem = restoredCart.FirstOrDefault(shoppingCartItem => shoppingCartItem.Id == updatedOrderItem.Id); + var itemDeleted = updatedShoppingCartItem == null; + + //validate shopping cart for warnings + updateOrderParameters.Warnings.AddRange(_shoppingCartService.GetShoppingCartWarnings(restoredCart, string.Empty, false)); + if (!itemDeleted) + updateOrderParameters.Warnings.AddRange(_shoppingCartService.GetShoppingCartItemWarnings(updatedOrder.Customer, updatedShoppingCartItem.ShoppingCartType, + updatedShoppingCartItem.Product, updatedOrder.StoreId, updatedShoppingCartItem.AttributesXml, updatedShoppingCartItem.CustomerEnteredPrice, + updatedShoppingCartItem.RentalStartDateUtc, updatedShoppingCartItem.RentalEndDateUtc, updatedShoppingCartItem.Quantity, false)); + + _orderTotalCalculationService.UpdateOrderTotals(updateOrderParameters, restoredCart); + + if (updateOrderParameters.PickupPoint != null) + { + updatedOrder.PickUpInStore = true; + updatedOrder.PickupAddress = new Address + { + Address1 = updateOrderParameters.PickupPoint.Address, + City = updateOrderParameters.PickupPoint.City, + Country = _countryService.GetCountryByTwoLetterIsoCode(updateOrderParameters.PickupPoint.CountryCode), + ZipPostalCode = updateOrderParameters.PickupPoint.ZipPostalCode, + CreatedOnUtc = DateTime.UtcNow, + }; + updatedOrder.ShippingMethod = string.Format(_localizationService.GetResource("Checkout.PickupPoints.Name"), updateOrderParameters.PickupPoint.Name); + updatedOrder.ShippingRateComputationMethodSystemName = updateOrderParameters.PickupPoint.ProviderSystemName; + } + + if (!itemDeleted) + { + updatedOrderItem.ItemWeight = _shippingService.GetShoppingCartItemWeight(updatedShoppingCartItem); + updatedOrderItem.OriginalProductCost = _priceCalculationService.GetProductCost(updatedShoppingCartItem.Product, updatedShoppingCartItem.AttributesXml); + updatedOrderItem.AttributeDescription = _productAttributeFormatter.FormatAttributes(updatedShoppingCartItem.Product, + updatedShoppingCartItem.AttributesXml, updatedOrder.Customer,subTotal: updatedOrder.CustomerTaxDisplayType == TaxDisplayType.IncludingTax ? updatedOrderItem.PriceInclTax : updatedOrderItem.PriceExclTax); + + //gift cards + if (updatedShoppingCartItem.Product.IsGiftCard) + { + string giftCardRecipientName; + string giftCardRecipientEmail; + string giftCardSenderName; + string giftCardSenderEmail; + string giftCardMessage; + _productAttributeParser.GetGiftCardAttribute(updatedShoppingCartItem.AttributesXml, out giftCardRecipientName, + out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); + + for (var i = 0; i < updatedShoppingCartItem.Quantity; i++) + { + _giftCardService.InsertGiftCard(new GiftCard + { + GiftCardType = updatedShoppingCartItem.Product.GiftCardType, + PurchasedWithOrderItem = updatedOrderItem, + Amount = updatedShoppingCartItem.Product.OverriddenGiftCardAmount.HasValue ? + updatedShoppingCartItem.Product.OverriddenGiftCardAmount.Value : updatedOrderItem.UnitPriceExclTax, + IsGiftCardActivated = false, + GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), + RecipientName = giftCardRecipientName, + RecipientEmail = giftCardRecipientEmail, + SenderName = giftCardSenderName, + SenderEmail = giftCardSenderEmail, + Message = giftCardMessage, + IsRecipientNotified = false, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + } + + _orderService.UpdateOrder(updatedOrder); + + //discount usage history + var discountUsageHistoryForOrder = _discountService.GetAllDiscountUsageHistory(null, updatedOrder.Customer.Id, updatedOrder.Id); + foreach (var discount in updateOrderParameters.AppliedDiscounts) + { + if (!discountUsageHistoryForOrder.Any(history => history.DiscountId == discount.Id)) + { + var d = _discountService.GetDiscountById(discount.Id); + if (d != null) + { + _discountService.InsertDiscountUsageHistory(new DiscountUsageHistory + { + Discount = d, + Order = updatedOrder, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + } + + CheckOrderStatus(updatedOrder); + } + + /// + /// Deletes an order + /// + /// The order + public virtual void DeleteOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + //check whether the order wasn't cancelled before + //if it already was cancelled, then there's no need to make the following adjustments + //(such as reward points, inventory, recurring payments) + //they already was done when cancelling the order + if (order.OrderStatus != OrderStatus.Cancelled) + { + //return (add) back redeemded reward points + ReturnBackRedeemedRewardPoints(order); + //reduce (cancel) back reward points (previously awarded for this order) + ReduceRewardPoints(order); + + //cancel recurring payments + var recurringPayments = _orderService.SearchRecurringPayments(initialOrderId: order.Id); + foreach (var rp in recurringPayments) + { + var errors = CancelRecurringPayment(rp); + //use "errors" variable? + } + + //Adjust inventory for already shipped shipments + //only products with "use multiple warehouses" + foreach (var shipment in order.Shipments) + { + foreach (var shipmentItem in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); + if (orderItem == null) + continue; + + _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrder"), order.Id)); + } + } + + //Adjust inventory + foreach (var orderItem in order.OrderItems) + { + _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrder"), order.Id)); + } + + } + + //deactivate gift cards + if (_orderSettings.DeactivateGiftCardsAfterDeletingOrder) + SetActivatedValueForPurchasedGiftCards(order, false); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been deleted", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //now delete an order + _orderService.DeleteOrder(order); + } + + /// + /// Process next recurring payment + /// + /// Recurring payment + /// Process payment result (info about last payment for automatic recurring payments) + /// Collection of errors + public virtual IEnumerable ProcessNextRecurringPayment(RecurringPayment recurringPayment, ProcessPaymentResult paymentResult = null) + { + if (recurringPayment == null) + throw new ArgumentNullException("recurringPayment"); + + try + { + if (!recurringPayment.IsActive) + throw new NopException("Recurring payment is not active"); + + var initialOrder = recurringPayment.InitialOrder; + if (initialOrder == null) + throw new NopException("Initial order could not be loaded"); + + var customer = initialOrder.Customer; + if (customer == null) + throw new NopException("Customer could not be loaded"); + + var nextPaymentDate = recurringPayment.NextPaymentDate; + if (!nextPaymentDate.HasValue) + throw new NopException("Next payment date could not be calculated"); + + //payment info + var processPaymentRequest = new ProcessPaymentRequest + { + StoreId = initialOrder.StoreId, + CustomerId = customer.Id, + OrderGuid = Guid.NewGuid(), + InitialOrderId = initialOrder.Id, + RecurringCycleLength = recurringPayment.CycleLength, + RecurringCyclePeriod = recurringPayment.CyclePeriod, + RecurringTotalCycles = recurringPayment.TotalCycles, + CustomValues = initialOrder.DeserializeCustomValues() + }; + + //prepare order details + var details = PrepareRecurringOrderDetails(processPaymentRequest); + + ProcessPaymentResult processPaymentResult; + //skip payment workflow if order total equals zero + var skipPaymentWorkflow = details.OrderTotal == decimal.Zero; + if (!skipPaymentWorkflow) + { + var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + + if (!paymentMethod.IsPaymentMethodActive(_paymentSettings)) + throw new NopException("Payment method is not active"); + + //Old credit card info + if (details.InitialOrder.AllowStoringCreditCardNumber) + { + processPaymentRequest.CreditCardType = _encryptionService.DecryptText(details.InitialOrder.CardType); + processPaymentRequest.CreditCardName = _encryptionService.DecryptText(details.InitialOrder.CardName); + processPaymentRequest.CreditCardNumber = _encryptionService.DecryptText(details.InitialOrder.CardNumber); + processPaymentRequest.CreditCardCvv2 = _encryptionService.DecryptText(details.InitialOrder.CardCvv2); + try + { + processPaymentRequest.CreditCardExpireMonth = Convert.ToInt32(_encryptionService.DecryptText(details.InitialOrder.CardExpirationMonth)); + processPaymentRequest.CreditCardExpireYear = Convert.ToInt32(_encryptionService.DecryptText(details.InitialOrder.CardExpirationYear)); + } + catch { } + } + + //payment type + switch (_paymentService.GetRecurringPaymentType(processPaymentRequest.PaymentMethodSystemName)) + { + case RecurringPaymentType.NotSupported: + throw new NopException("Recurring payments are not supported by selected payment method"); + case RecurringPaymentType.Manual: + processPaymentResult = _paymentService.ProcessRecurringPayment(processPaymentRequest); + break; + case RecurringPaymentType.Automatic: + //payment is processed on payment gateway site, info about last transaction in paymentResult parameter + processPaymentResult = paymentResult ?? new ProcessPaymentResult(); + break; + default: + throw new NopException("Not supported recurring payment type"); + } + } + else + processPaymentResult = paymentResult ?? new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid }; + + if (processPaymentResult == null) + throw new NopException("processPaymentResult is not available"); + + if (processPaymentResult.Success) + { + //save order details + var order = SaveOrderDetails(processPaymentRequest, processPaymentResult, details); + + foreach (var orderItem in details.InitialOrder.OrderItems) + { + //save item + var newOrderItem = new OrderItem + { + OrderItemGuid = Guid.NewGuid(), + Order = order, + ProductId = orderItem.ProductId, + UnitPriceInclTax = orderItem.UnitPriceInclTax, + UnitPriceExclTax = orderItem.UnitPriceExclTax, + PriceInclTax = orderItem.PriceInclTax, + PriceExclTax = orderItem.PriceExclTax, + OriginalProductCost = orderItem.OriginalProductCost, + AttributeDescription = orderItem.AttributeDescription, + AttributesXml = orderItem.AttributesXml, + Quantity = orderItem.Quantity, + DiscountAmountInclTax = orderItem.DiscountAmountInclTax, + DiscountAmountExclTax = orderItem.DiscountAmountExclTax, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + ItemWeight = orderItem.ItemWeight, + RentalStartDateUtc = orderItem.RentalStartDateUtc, + RentalEndDateUtc = orderItem.RentalEndDateUtc, + TaxRate = orderItem.TaxRate + }; + order.OrderItems.Add(newOrderItem); + _orderService.UpdateOrder(order); + + //gift cards + if (orderItem.Product.IsGiftCard) + { + string giftCardRecipientName; + string giftCardRecipientEmail; + string giftCardSenderName; + string giftCardSenderEmail; + string giftCardMessage; + + _productAttributeParser.GetGiftCardAttribute(orderItem.AttributesXml, out giftCardRecipientName, + out giftCardRecipientEmail, out giftCardSenderName, out giftCardSenderEmail, out giftCardMessage); + + for (var i = 0; i < orderItem.Quantity; i++) + { + _giftCardService.InsertGiftCard(new GiftCard + { + GiftCardType = orderItem.Product.GiftCardType, + PurchasedWithOrderItem = newOrderItem, + Amount = orderItem.UnitPriceExclTax, + IsGiftCardActivated = false, + GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), + RecipientName = giftCardRecipientName, + RecipientEmail = giftCardRecipientEmail, + SenderName = giftCardSenderName, + SenderEmail = giftCardSenderEmail, + Message = giftCardMessage, + IsRecipientNotified = false, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + + //inventory + _productService.AdjustInventory(orderItem.Product, -orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.PlaceOrder"), order.Id)); + } + + //notifications + SendNotificationsAndSaveNotes(order); + + //check order status + CheckOrderStatus(order); + + //raise event + _eventPublisher.Publish(new OrderPlacedEvent(order)); + + if (order.PaymentStatus == PaymentStatus.Paid) + ProcessOrderPaid(order); + + //last payment succeeded + recurringPayment.LastPaymentFailed = false; + + //next recurring payment + recurringPayment.RecurringPaymentHistory.Add(new RecurringPaymentHistory + { + RecurringPayment = recurringPayment, + CreatedOnUtc = DateTime.UtcNow, + OrderId = order.Id, + }); + _orderService.UpdateRecurringPayment(recurringPayment); + + return new List(); + } + else + { + //log errors + var logError = processPaymentResult.Errors.Aggregate("Error while processing recurring order. ", + (current, next) => string.Format("{0}Error {1}: {2}. ", current, processPaymentResult.Errors.IndexOf(next) + 1, next)); + _logger.Error(logError, customer: customer); + + if (processPaymentResult.RecurringPaymentFailed) + { + //set flag that last payment failed + recurringPayment.LastPaymentFailed = true; + _orderService.UpdateRecurringPayment(recurringPayment); + + if (_paymentSettings.CancelRecurringPaymentsAfterFailedPayment) + { + //cancel recurring payment + CancelRecurringPayment(recurringPayment).ToList().ForEach(error => _logger.Error(error)); + + //notify a customer about cancelled payment + _workflowMessageService.SendRecurringPaymentCancelledCustomerNotification(recurringPayment, initialOrder.CustomerLanguageId); + } + else + //notify a customer about failed payment + _workflowMessageService.SendRecurringPaymentFailedCustomerNotification(recurringPayment, initialOrder.CustomerLanguageId); + } + + return processPaymentResult.Errors; + } + } + catch (Exception exc) + { + _logger.Error(string.Format("Error while processing recurring order. {0}", exc.Message), exc); + throw; + } + } + + /// + /// Cancels a recurring payment + /// + /// Recurring payment + public virtual IList CancelRecurringPayment(RecurringPayment recurringPayment) + { + if (recurringPayment == null) + throw new ArgumentNullException("recurringPayment"); + + var initialOrder = recurringPayment.InitialOrder; + if (initialOrder == null) + return new List { "Initial order could not be loaded" }; + + + var request = new CancelRecurringPaymentRequest(); + CancelRecurringPaymentResult result = null; + try + { + request.Order = initialOrder; + result = _paymentService.CancelRecurringPayment(request); + if (result.Success) + { + //update recurring payment + recurringPayment.IsActive = false; + _orderService.UpdateRecurringPayment(recurringPayment); + + + //add a note + initialOrder.OrderNotes.Add(new OrderNote + { + Note = "Recurring payment has been cancelled", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(initialOrder); + + //notify a store owner + _workflowMessageService + .SendRecurringPaymentCancelledStoreOwnerNotification(recurringPayment, + _localizationSettings.DefaultAdminLanguageId); + } + } + catch (Exception exc) + { + if (result == null) + result = new CancelRecurringPaymentResult(); + result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); + } + + + //process errors + string error = ""; + for (int i = 0; i < result.Errors.Count; i++) + { + error += string.Format("Error {0}: {1}", i, result.Errors[i]); + if (i != result.Errors.Count - 1) + error += ". "; + } + if (!String.IsNullOrEmpty(error)) + { + //add a note + initialOrder.OrderNotes.Add(new OrderNote + { + Note = string.Format("Unable to cancel recurring payment. {0}", error), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(initialOrder); + + //log it + string logError = string.Format("Error cancelling recurring payment. Order #{0}. Error: {1}", initialOrder.Id, error); + _logger.InsertLog(LogLevel.Error, logError, logError); + } + return result.Errors; + } + + /// + /// Gets a value indicating whether a customer can cancel recurring payment + /// + /// Customer + /// Recurring Payment + /// value indicating whether a customer can cancel recurring payment + public virtual bool CanCancelRecurringPayment(Customer customerToValidate, RecurringPayment recurringPayment) + { + if (recurringPayment == null) + return false; + + if (customerToValidate == null) + return false; + + var initialOrder = recurringPayment.InitialOrder; + if (initialOrder == null) + return false; + + var customer = recurringPayment.InitialOrder.Customer; + if (customer == null) + return false; + + if (initialOrder.OrderStatus == OrderStatus.Cancelled) + return false; + + if (!customerToValidate.IsAdmin()) + { + if (customer.Id != customerToValidate.Id) + return false; + } + + if (!recurringPayment.NextPaymentDate.HasValue) + return false; + + return true; + } + + + /// + /// Gets a value indicating whether a customer can retry last failed recurring payment + /// + /// Customer + /// Recurring Payment + /// True if a customer can retry payment; otherwise false + public virtual bool CanRetryLastRecurringPayment(Customer customer, RecurringPayment recurringPayment) + { + if (recurringPayment == null || customer == null) + return false; + + if (recurringPayment.InitialOrder == null || recurringPayment.InitialOrder.OrderStatus == OrderStatus.Cancelled) + return false; + + if (!recurringPayment.LastPaymentFailed || _paymentService.GetRecurringPaymentType(recurringPayment.InitialOrder.PaymentMethodSystemName) != RecurringPaymentType.Manual) + return false; + + if (recurringPayment.InitialOrder.Customer == null || (!customer.IsAdmin() && recurringPayment.InitialOrder.Customer.Id != customer.Id)) + return false; + + return true; + } + + + /// + /// Send a shipment + /// + /// Shipment + /// True to notify customer + public virtual void Ship(Shipment shipment, bool notifyCustomer) + { + if (shipment == null) + throw new ArgumentNullException("shipment"); + + var order = _orderService.GetOrderById(shipment.OrderId); + if (order == null) + throw new Exception("Order cannot be loaded"); + + if (shipment.ShippedDateUtc.HasValue) + throw new Exception("This shipment is already shipped"); + + shipment.ShippedDateUtc = DateTime.UtcNow; + _shipmentService.UpdateShipment(shipment); + + //process products with "Multiple warehouse" support enabled + foreach (var item in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(item.OrderItemId); + _productService.BookReservedInventory(orderItem.Product, item.WarehouseId, -item.Quantity, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.Ship"), shipment.OrderId)); + } + + //check whether we have more items to ship + if (order.HasItemsToAddToShipment() || order.HasItemsToShip()) + order.ShippingStatusId = (int)ShippingStatus.PartiallyShipped; + else + order.ShippingStatusId = (int)ShippingStatus.Shipped; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Shipment# {0} has been sent", shipment.Id), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + if (notifyCustomer) + { + //notify customer + int queuedEmailId = _workflowMessageService.SendShipmentSentCustomerNotification(shipment, order.CustomerLanguageId); + if (queuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Shipped\" email (to customer) has been queued. Queued email identifier: {0}.", queuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + } + + //event + _eventPublisher.PublishShipmentSent(shipment); + + //check order status + CheckOrderStatus(order); + } + + /// + /// Marks a shipment as delivered + /// + /// Shipment + /// True to notify customer + public virtual void Deliver(Shipment shipment, bool notifyCustomer) + { + if (shipment == null) + throw new ArgumentNullException("shipment"); + + var order = shipment.Order; + if (order == null) + throw new Exception("Order cannot be loaded"); + + if (!shipment.ShippedDateUtc.HasValue) + throw new Exception("This shipment is not shipped yet"); + + if (shipment.DeliveryDateUtc.HasValue) + throw new Exception("This shipment is already delivered"); + + shipment.DeliveryDateUtc = DateTime.UtcNow; + _shipmentService.UpdateShipment(shipment); + + if (!order.HasItemsToAddToShipment() && !order.HasItemsToShip() && !order.HasItemsToDeliver()) + order.ShippingStatusId = (int)ShippingStatus.Delivered; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Shipment# {0} has been delivered", shipment.Id), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + if (notifyCustomer) + { + //send email notification + int queuedEmailId = _workflowMessageService.SendShipmentDeliveredCustomerNotification(shipment, order.CustomerLanguageId); + if (queuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Delivered\" email (to customer) has been queued. Queued email identifier: {0}.", queuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + } + + //event + _eventPublisher.PublishShipmentDelivered(shipment); + + //check order status + CheckOrderStatus(order); + } + + + + /// + /// Gets a value indicating whether cancel is allowed + /// + /// Order + /// A value indicating whether cancel is allowed + public virtual bool CanCancelOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderStatus == OrderStatus.Cancelled) + return false; + + return true; + } + + /// + /// Cancels order + /// + /// Order + /// True to notify customer + public virtual void CancelOrder(Order order, bool notifyCustomer) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanCancelOrder(order)) + throw new NopException("Cannot do cancel for order."); + + //Cancel order + SetOrderStatus(order, OrderStatus.Cancelled, notifyCustomer); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been cancelled", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //return (add) back redeemded reward points + ReturnBackRedeemedRewardPoints(order); + + //cancel recurring payments + var recurringPayments = _orderService.SearchRecurringPayments(initialOrderId: order.Id); + foreach (var rp in recurringPayments) + { + var errors = CancelRecurringPayment(rp); + //use "errors" variable? + } + + //Adjust inventory for already shipped shipments + //only products with "use multiple warehouses" + foreach (var shipment in order.Shipments) + { + foreach (var shipmentItem in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); + if (orderItem == null) + continue; + + _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CancelOrder"), order.Id)); + } + } + //Adjust inventory + foreach (var orderItem in order.OrderItems) + { + _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.CancelOrder"), order.Id)); + } + + _eventPublisher.Publish(new OrderCancelledEvent(order)); + + } + + /// + /// Gets a value indicating whether order can be marked as authorized + /// + /// Order + /// A value indicating whether order can be marked as authorized + public virtual bool CanMarkOrderAsAuthorized(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderStatus == OrderStatus.Cancelled) + return false; + + if (order.PaymentStatus == PaymentStatus.Pending) + return true; + + return false; + } + + /// + /// Marks order as authorized + /// + /// Order + public virtual void MarkAsAuthorized(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + order.PaymentStatusId = (int)PaymentStatus.Authorized; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been marked as authorized", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + } + + + + /// + /// Gets a value indicating whether capture from admin panel is allowed + /// + /// Order + /// A value indicating whether capture from admin panel is allowed + public virtual bool CanCapture(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderStatus == OrderStatus.Cancelled || + order.OrderStatus == OrderStatus.Pending) + return false; + + if (order.PaymentStatus == PaymentStatus.Authorized && + _paymentService.SupportCapture(order.PaymentMethodSystemName)) + return true; + + return false; + } + + /// + /// Capture an order (from admin panel) + /// + /// Order + /// A list of errors; empty list if no errors + public virtual IList Capture(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanCapture(order)) + throw new NopException("Cannot do capture for order."); + + var request = new CapturePaymentRequest(); + CapturePaymentResult result = null; + try + { + //old info from placing order + request.Order = order; + result = _paymentService.Capture(request); + + if (result.Success) + { + var paidDate = order.PaidDateUtc; + if (result.NewPaymentStatus == PaymentStatus.Paid) + paidDate = DateTime.UtcNow; + + order.CaptureTransactionId = result.CaptureTransactionId; + order.CaptureTransactionResult = result.CaptureTransactionResult; + order.PaymentStatus = result.NewPaymentStatus; + order.PaidDateUtc = paidDate; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been captured", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + CheckOrderStatus(order); + + if (order.PaymentStatus == PaymentStatus.Paid) + { + ProcessOrderPaid(order); + } + } + } + catch (Exception exc) + { + if (result == null) + result = new CapturePaymentResult(); + result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); + } + + + //process errors + string error = ""; + for (int i = 0; i < result.Errors.Count; i++) + { + error += string.Format("Error {0}: {1}", i, result.Errors[i]); + if (i != result.Errors.Count - 1) + error += ". "; + } + if (!String.IsNullOrEmpty(error)) + { + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Unable to capture order. {0}", error), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //log it + string logError = string.Format("Error capturing order #{0}. Error: {1}", order.Id, error); + _logger.InsertLog(LogLevel.Error, logError, logError); + } + return result.Errors; + } + + /// + /// Gets a value indicating whether order can be marked as paid + /// + /// Order + /// A value indicating whether order can be marked as paid + public virtual bool CanMarkOrderAsPaid(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderStatus == OrderStatus.Cancelled) + return false; + + if (order.PaymentStatus == PaymentStatus.Paid || + order.PaymentStatus == PaymentStatus.Refunded || + order.PaymentStatus == PaymentStatus.Voided) + return false; + + return true; + } + + /// + /// Marks order as paid + /// + /// Order + public virtual void MarkOrderAsPaid(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanMarkOrderAsPaid(order)) + throw new NopException("You can't mark this order as paid"); + + order.PaymentStatusId = (int)PaymentStatus.Paid; + order.PaidDateUtc = DateTime.UtcNow; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been marked as paid", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + CheckOrderStatus(order); + + if (order.PaymentStatus == PaymentStatus.Paid) + { + ProcessOrderPaid(order); + } + } + + + + /// + /// Gets a value indicating whether refund from admin panel is allowed + /// + /// Order + /// A value indicating whether refund from admin panel is allowed + public virtual bool CanRefund(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //refund cannot be made if previously a partial refund has been already done. only other partial refund can be made in this case + if (order.RefundedAmount > decimal.Zero) + return false; + + //uncomment the lines below in order to disallow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + if (order.PaymentStatus == PaymentStatus.Paid && + _paymentService.SupportRefund(order.PaymentMethodSystemName)) + return true; + + return false; + } + + /// + /// Refunds an order (from admin panel) + /// + /// Order + /// A list of errors; empty list if no errors + public virtual IList Refund(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanRefund(order)) + throw new NopException("Cannot do refund for order."); + + var request = new RefundPaymentRequest(); + RefundPaymentResult result = null; + try + { + request.Order = order; + request.AmountToRefund = order.OrderTotal; + request.IsPartialRefund = false; + result = _paymentService.Refund(request); + if (result.Success) + { + //total amount refunded + decimal totalAmountRefunded = order.RefundedAmount + request.AmountToRefund; + + //update order info + order.RefundedAmount = totalAmountRefunded; + order.PaymentStatus = result.NewPaymentStatus; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order has been refunded. Amount = {0}", request.AmountToRefund), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + + //notifications + var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, request.AmountToRefund, _localizationSettings.DefaultAdminLanguageId); + if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, request.AmountToRefund, order.CustomerLanguageId); + if (orderRefundedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + + //raise event + _eventPublisher.Publish(new OrderRefundedEvent(order, request.AmountToRefund)); + } + + } + catch (Exception exc) + { + if (result == null) + result = new RefundPaymentResult(); + result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); + } + + //process errors + string error = ""; + for (int i = 0; i < result.Errors.Count; i++) + { + error += string.Format("Error {0}: {1}", i, result.Errors[i]); + if (i != result.Errors.Count - 1) + error += ". "; + } + if (!String.IsNullOrEmpty(error)) + { + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Unable to refund order. {0}", error), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //log it + string logError = string.Format("Error refunding order #{0}. Error: {1}", order.Id, error); + _logger.InsertLog(LogLevel.Error, logError, logError); + } + return result.Errors; + } + + /// + /// Gets a value indicating whether order can be marked as refunded + /// + /// Order + /// A value indicating whether order can be marked as refunded + public virtual bool CanRefundOffline(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //refund cannot be made if previously a partial refund has been already done. only other partial refund can be made in this case + if (order.RefundedAmount > decimal.Zero) + return false; + + //uncomment the lines below in order to disallow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + if (order.PaymentStatus == PaymentStatus.Paid) + return true; + + return false; + } + + /// + /// Refunds an order (offline) + /// + /// Order + public virtual void RefundOffline(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanRefundOffline(order)) + throw new NopException("You can't refund this order"); + + //amout to refund + decimal amountToRefund = order.OrderTotal; + + //total amount refunded + decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; + + //update order info + order.RefundedAmount = totalAmountRefunded; + order.PaymentStatus = PaymentStatus.Refunded; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order has been marked as refunded. Amount = {0}", amountToRefund), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + + //notifications + var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); + if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); + if (orderRefundedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + + //raise event + _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); + } + + /// + /// Gets a value indicating whether partial refund from admin panel is allowed + /// + /// Order + /// Amount to refund + /// A value indicating whether refund from admin panel is allowed + public virtual bool CanPartiallyRefund(Order order, decimal amountToRefund) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //uncomment the lines below in order to allow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + decimal canBeRefunded = order.OrderTotal - order.RefundedAmount; + if (canBeRefunded <= decimal.Zero) + return false; + + if (amountToRefund > canBeRefunded) + return false; + + if ((order.PaymentStatus == PaymentStatus.Paid || + order.PaymentStatus == PaymentStatus.PartiallyRefunded) && + _paymentService.SupportPartiallyRefund(order.PaymentMethodSystemName)) + return true; + + return false; + } + + /// + /// Partially refunds an order (from admin panel) + /// + /// Order + /// Amount to refund + /// A list of errors; empty list if no errors + public virtual IList PartiallyRefund(Order order, decimal amountToRefund) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanPartiallyRefund(order, amountToRefund)) + throw new NopException("Cannot do partial refund for order."); + + var request = new RefundPaymentRequest(); + RefundPaymentResult result = null; + try + { + request.Order = order; + request.AmountToRefund = amountToRefund; + request.IsPartialRefund = true; + + result = _paymentService.Refund(request); + + if (result.Success) + { + //total amount refunded + decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; + + //update order info + order.RefundedAmount = totalAmountRefunded; + //mark payment status as 'Refunded' if the order total amount is fully refunded + order.PaymentStatus = order.OrderTotal == totalAmountRefunded && result.NewPaymentStatus == PaymentStatus.PartiallyRefunded ? PaymentStatus.Refunded : result.NewPaymentStatus; + _orderService.UpdateOrder(order); + + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order has been partially refunded. Amount = {0}", amountToRefund), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + + //notifications + var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); + if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); + if (orderRefundedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + + //raise event + _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); + } + } + catch (Exception exc) + { + if (result == null) + result = new RefundPaymentResult(); + result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); + } + + //process errors + string error = ""; + for (int i = 0; i < result.Errors.Count; i++) + { + error += string.Format("Error {0}: {1}", i, result.Errors[i]); + if (i != result.Errors.Count - 1) + error += ". "; + } + if (!String.IsNullOrEmpty(error)) + { + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Unable to partially refund order. {0}", error), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //log it + string logError = string.Format("Error refunding order #{0}. Error: {1}", order.Id, error); + _logger.InsertLog(LogLevel.Error, logError, logError); + } + return result.Errors; + } + + /// + /// Gets a value indicating whether order can be marked as partially refunded + /// + /// Order + /// Amount to refund + /// A value indicating whether order can be marked as partially refunded + public virtual bool CanPartiallyRefundOffline(Order order, decimal amountToRefund) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //uncomment the lines below in order to allow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + decimal canBeRefunded = order.OrderTotal - order.RefundedAmount; + if (canBeRefunded <= decimal.Zero) + return false; + + if (amountToRefund > canBeRefunded) + return false; + + if (order.PaymentStatus == PaymentStatus.Paid || + order.PaymentStatus == PaymentStatus.PartiallyRefunded) + return true; + + return false; + } + + /// + /// Partially refunds an order (offline) + /// + /// Order + /// Amount to refund + public virtual void PartiallyRefundOffline(Order order, decimal amountToRefund) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanPartiallyRefundOffline(order, amountToRefund)) + throw new NopException("You can't partially refund (offline) this order"); + + //total amount refunded + decimal totalAmountRefunded = order.RefundedAmount + amountToRefund; + + //update order info + order.RefundedAmount = totalAmountRefunded; + //mark payment status as 'Refunded' if the order total amount is fully refunded + order.PaymentStatus = order.OrderTotal == totalAmountRefunded ? PaymentStatus.Refunded : PaymentStatus.PartiallyRefunded; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order has been marked as partially refunded. Amount = {0}", amountToRefund), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + + //notifications + var orderRefundedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedStoreOwnerNotification(order, amountToRefund, _localizationSettings.DefaultAdminLanguageId); + if (orderRefundedStoreOwnerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to store owner) has been queued. Queued email identifier: {0}.", orderRefundedStoreOwnerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + var orderRefundedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderRefundedCustomerNotification(order, amountToRefund, order.CustomerLanguageId); + if (orderRefundedCustomerNotificationQueuedEmailId > 0) + { + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("\"Order refunded\" email (to customer) has been queued. Queued email identifier: {0}.", orderRefundedCustomerNotificationQueuedEmailId), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + } + //raise event + _eventPublisher.Publish(new OrderRefundedEvent(order, amountToRefund)); + } + + + + /// + /// Gets a value indicating whether void from admin panel is allowed + /// + /// Order + /// A value indicating whether void from admin panel is allowed + public virtual bool CanVoid(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //uncomment the lines below in order to allow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + if (order.PaymentStatus == PaymentStatus.Authorized && + _paymentService.SupportVoid(order.PaymentMethodSystemName)) + return true; + + return false; + } + + /// + /// Voids order (from admin panel) + /// + /// Order + /// Voided order + public virtual IList Void(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanVoid(order)) + throw new NopException("Cannot do void for order."); + + var request = new VoidPaymentRequest(); + VoidPaymentResult result = null; + try + { + request.Order = order; + result = _paymentService.Void(request); + + if (result.Success) + { + //update order info + order.PaymentStatus = result.NewPaymentStatus; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been voided", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check order status + CheckOrderStatus(order); + } + } + catch (Exception exc) + { + if (result == null) + result = new VoidPaymentResult(); + result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString())); + } + + //process errors + string error = ""; + for (int i = 0; i < result.Errors.Count; i++) + { + error += string.Format("Error {0}: {1}", i, result.Errors[i]); + if (i != result.Errors.Count - 1) + error += ". "; + } + if (!String.IsNullOrEmpty(error)) + { + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Unable to voiding order. {0}", error), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //log it + string logError = string.Format("Error voiding order #{0}. Error: {1}", order.Id, error); + _logger.InsertLog(LogLevel.Error, logError, logError); + } + return result.Errors; + } + + /// + /// Gets a value indicating whether order can be marked as voided + /// + /// Order + /// A value indicating whether order can be marked as voided + public virtual bool CanVoidOffline(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (order.OrderTotal == decimal.Zero) + return false; + + //uncomment the lines below in order to allow this operation for cancelled orders + //if (order.OrderStatus == OrderStatus.Cancelled) + // return false; + + if (order.PaymentStatus == PaymentStatus.Authorized) + return true; + + return false; + } + + /// + /// Voids order (offline) + /// + /// Order + public virtual void VoidOffline(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!CanVoidOffline(order)) + throw new NopException("You can't void this order"); + + order.PaymentStatusId = (int)PaymentStatus.Voided; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order has been marked as voided", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + + //check orer status + CheckOrderStatus(order); + } + + + + /// + /// Place order items in current user shopping cart. + /// + /// The order + public virtual void ReOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + //move shopping cart items (if possible) + foreach (var orderItem in order.OrderItems) + { + _shoppingCartService.AddToCart(order.Customer, orderItem.Product, + ShoppingCartType.ShoppingCart, order.StoreId, + orderItem.AttributesXml, orderItem.UnitPriceExclTax, + orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc, + orderItem.Quantity, false); + } + + //set checkout attributes + //comment the code below if you want to disable this functionality + _genericAttributeService.SaveAttribute(order.Customer, SystemCustomerAttributeNames.CheckoutAttributes, order.CheckoutAttributesXml, order.StoreId); + } + + /// + /// Check whether return request is allowed + /// + /// Order + /// Result + public virtual bool IsReturnRequestAllowed(Order order) + { + if (!_orderSettings.ReturnRequestsEnabled) + return false; + + if (order == null || order.Deleted) + return false; + + //status should be compelte + if (order.OrderStatus != OrderStatus.Complete) + return false; + + //validate allowed number of days + if (_orderSettings.NumberOfDaysReturnRequestAvailable > 0) + { + var daysPassed = (DateTime.UtcNow - order.CreatedOnUtc).TotalDays; + if (daysPassed >= _orderSettings.NumberOfDaysReturnRequestAvailable) + return false; + } + + //ensure that we have at least one returnable product + return order.OrderItems.Any(oi => !oi.Product.NotReturnable); + } + + + + /// + /// Valdiate minimum order sub-total amount + /// + /// Shopping cart + /// true - OK; false - minimum order sub-total amount is not reached + public virtual bool ValidateMinOrderSubtotalAmount(IList cart) + { + if (cart == null) + throw new ArgumentNullException("cart"); + + //min order amount sub-total validation + if (cart.Any() && _orderSettings.MinOrderSubtotalAmount > decimal.Zero) + { + //subtotal + decimal orderSubTotalDiscountAmountBase; + List orderSubTotalAppliedDiscounts; + decimal subTotalWithoutDiscountBase; + decimal subTotalWithDiscountBase; + _orderTotalCalculationService.GetShoppingCartSubTotal(cart, _orderSettings.MinOrderSubtotalAmountIncludingTax, + out orderSubTotalDiscountAmountBase, out orderSubTotalAppliedDiscounts, + out subTotalWithoutDiscountBase, out subTotalWithDiscountBase); + + if (subTotalWithoutDiscountBase < _orderSettings.MinOrderSubtotalAmount) + return false; + } + + return true; + } + + /// + /// Valdiate minimum order total amount + /// + /// Shopping cart + /// true - OK; false - minimum order total amount is not reached + public virtual bool ValidateMinOrderTotalAmount(IList cart) + { + if (cart == null) + throw new ArgumentNullException("cart"); + + if (cart.Any() && _orderSettings.MinOrderTotalAmount > decimal.Zero) + { + decimal? shoppingCartTotalBase = _orderTotalCalculationService.GetShoppingCartTotal(cart); + if (shoppingCartTotalBase.HasValue && shoppingCartTotalBase.Value < _orderSettings.MinOrderTotalAmount) + return false; + } + + return true; + } + + /// + /// Get invoice ID + /// + /// + public virtual string GetInvoiceId(int storeId) + { + var actYear = DateTime.UtcNow.Year; + int ident = _orderSettings.InvoiceIdent; + if (_orderSettings.InvoiceYear < actYear) + { + // Reset counter if a new year + ident = 1; + _orderSettings.InvoiceYear = actYear; + var settingYear = _settingService.GetSetting("ordersettings.invoiceyear", storeId); + if (settingYear != null) + _settingService.SetSetting("ordersettings.invoiceyear", _orderSettings.InvoiceYear, storeId); + else + _settingService.SetSetting("ordersettings.invoiceyear", _orderSettings.InvoiceYear); + } + else + { + ident += 1; + } + _orderSettings.InvoiceIdent = ident; + // Update settings + var settingIdent = _settingService.GetSetting("ordersettings.invoiceident", storeId); + if (settingIdent != null) + _settingService.SetSetting("ordersettings.invoiceident", _orderSettings.InvoiceIdent, storeId); + else + _settingService.SetSetting("ordersettings.invoiceident", _orderSettings.InvoiceIdent); + + return string.Format("I-{0}.{1}", DateTime.UtcNow.Year, ident.ToString("D5")); + } + /// + /// Set Invoice ID on orders which passed payment + /// + public virtual void AssignInvoiceIdentToOrders() + { + var orders = _orderService.GetOrdersToAssignInvoiceId(); + foreach (var order in orders) + { + order.InvoiceDateUtc = DateTime.UtcNow; + order.InvoiceId = GetInvoiceId(order.StoreId); + _orderService.UpdateOrder(order); + } + } + /// + /// Gets a value indicating whether payment workflow is required + /// + /// Shopping cart + /// A value indicating reward points should be used; null to detect current choice of the customer + /// true - OK; false - minimum order total amount is not reached + public virtual bool IsPaymentWorkflowRequired(IList cart, bool? useRewardPoints = null) + { + if (cart == null) + throw new ArgumentNullException("cart"); + + bool result = true; + + //check whether order total equals zero + decimal? shoppingCartTotalBase = _orderTotalCalculationService.GetShoppingCartTotal(cart, useRewardPoints: useRewardPoints); + if (shoppingCartTotalBase.HasValue && shoppingCartTotalBase.Value == decimal.Zero) + result = false; + return result; + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/OrderReportService.cs b/src/Libraries/Nop.Services/Orders/OrderReportService.cs index 4ede06f25d2..6ac7cd28263 100644 --- a/src/Libraries/Nop.Services/Orders/OrderReportService.cs +++ b/src/Libraries/Nop.Services/Orders/OrderReportService.cs @@ -1,559 +1,562 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Nop.Core; -using Nop.Core.Data; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Stores; -using Nop.Services.Helpers; - -namespace Nop.Services.Orders -{ - /// - /// Order report service - /// - public partial class OrderReportService : IOrderReportService - { - #region Fields - - private readonly IRepository _orderRepository; - private readonly IRepository _orderItemRepository; - private readonly IRepository _productRepository; - private readonly IRepository _storeMappingRepository; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly CatalogSettings _catalogSettings; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Order repository - /// Order item repository - /// Product repository - /// Store mapping repository - /// Datetime helper - /// Catalog settings - public OrderReportService(IRepository orderRepository, - IRepository orderItemRepository, - IRepository productRepository, - IRepository storeMappingRepository, - IDateTimeHelper dateTimeHelper, - CatalogSettings catalogSettings) - { - this._orderRepository = orderRepository; - this._orderItemRepository = orderItemRepository; - this._productRepository = productRepository; - this._storeMappingRepository = storeMappingRepository; - this._dateTimeHelper = dateTimeHelper; - this._catalogSettings = catalogSettings; - } - - #endregion - - #region Methods - - /// - /// Get "order by country" report - /// - /// Store identifier - /// Order status - /// Payment status - /// Shipping status - /// Start date - /// End date - /// Result - public virtual IList GetCountryReport(int storeId, OrderStatus? os, - PaymentStatus? ps, ShippingStatus? ss, DateTime? startTimeUtc, DateTime? endTimeUtc) - { - int? orderStatusId = null; - if (os.HasValue) - orderStatusId = (int)os.Value; - - int? paymentStatusId = null; - if (ps.HasValue) - paymentStatusId = (int)ps.Value; - - int? shippingStatusId = null; - if (ss.HasValue) - shippingStatusId = (int)ss.Value; - - var query = _orderRepository.Table; - query = query.Where(o => !o.Deleted); - if (storeId > 0) - query = query.Where(o => o.StoreId == storeId); - if (orderStatusId.HasValue) - query = query.Where(o => o.OrderStatusId == orderStatusId.Value); - if (paymentStatusId.HasValue) - query = query.Where(o => o.PaymentStatusId == paymentStatusId.Value); - if (shippingStatusId.HasValue) - query = query.Where(o => o.ShippingStatusId == shippingStatusId.Value); - if (startTimeUtc.HasValue) - query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc); - if (endTimeUtc.HasValue) - query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc); - - var report = (from oq in query - group oq by oq.BillingAddress.CountryId into result - select new - { - CountryId = result.Key, - TotalOrders = result.Count(), - SumOrders = result.Sum(o => o.OrderTotal) - } - ) - .OrderByDescending(x => x.SumOrders) - .Select(r => new OrderByCountryReportLine - { - CountryId = r.CountryId, - TotalOrders = r.TotalOrders, - SumOrders = r.SumOrders - }) - - .ToList(); - - return report; - } - - /// - /// Get order average report - /// - /// Store identifier; pass 0 to ignore this parameter - /// Vendor identifier; pass 0 to ignore this parameter - /// Billing country identifier; 0 to load all orders - /// Order identifier; pass 0 to ignore this parameter - /// Payment method system name; null to load all records - /// Order status identifiers - /// Payment status identifiers - /// Shipping status identifiers - /// Start date - /// End date - /// Billing email. Leave empty to load all records. - /// Billing last name. Leave empty to load all records. - /// Search in order notes. Leave empty to load all records. - /// Result - public virtual OrderAverageReportLine GetOrderAverageReportLine(int storeId = 0, - int vendorId = 0, int billingCountryId = 0, - int orderId = 0, string paymentMethodSystemName = null, - List osIds = null, List psIds = null, List ssIds = null, - DateTime? startTimeUtc = null, DateTime? endTimeUtc = null, - string billingEmail = null, string billingLastName = "", string orderNotes = null) - { - var query = _orderRepository.Table; - query = query.Where(o => !o.Deleted); - if (storeId > 0) - query = query.Where(o => o.StoreId == storeId); - if (orderId > 0) - query = query.Where(o => o.Id == orderId); - if (vendorId > 0) - { - query = query - .Where(o => o.OrderItems - .Any(orderItem => orderItem.Product.VendorId == vendorId)); - } - if (billingCountryId > 0) - query = query.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId); - if (!String.IsNullOrEmpty(paymentMethodSystemName)) - query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); - if (osIds != null && osIds.Any()) - query = query.Where(o => osIds.Contains(o.OrderStatusId)); - if (psIds != null && psIds.Any()) - query = query.Where(o => psIds.Contains(o.PaymentStatusId)); - if (ssIds != null && ssIds.Any()) - query = query.Where(o => ssIds.Contains(o.ShippingStatusId)); - if (startTimeUtc.HasValue) - query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc); - if (endTimeUtc.HasValue) - query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc); - if (!String.IsNullOrEmpty(billingEmail)) - query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail)); - if (!String.IsNullOrEmpty(billingLastName)) - query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName)); - if (!String.IsNullOrEmpty(orderNotes)) - query = query.Where(o => o.OrderNotes.Any(on => on.Note.Contains(orderNotes))); - - var item = (from oq in query - group oq by 1 into result - select new - { - OrderCount = result.Count(), - OrderShippingExclTaxSum = result.Sum(o => o.OrderShippingExclTax), - OrderTaxSum = result.Sum(o => o.OrderTax), - OrderTotalSum = result.Sum(o => o.OrderTotal) - } - ).Select(r => new OrderAverageReportLine - { - CountOrders = r.OrderCount, - SumShippingExclTax = r.OrderShippingExclTaxSum, - SumTax = r.OrderTaxSum, - SumOrders = r.OrderTotalSum - }) - .FirstOrDefault(); - - item = item ?? new OrderAverageReportLine - { - CountOrders = 0, - SumShippingExclTax = decimal.Zero, - SumTax = decimal.Zero, - SumOrders = decimal.Zero, - }; - return item; - } - - /// - /// Get order average report - /// - /// Store identifier - /// Order status - /// Result - public virtual OrderAverageReportLineSummary OrderAverageReport(int storeId, OrderStatus os) - { - var item = new OrderAverageReportLineSummary(); - item.OrderStatus = os; - var orderStatuses = new List() { (int)os }; - - DateTime nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); - TimeZoneInfo timeZone = _dateTimeHelper.CurrentTimeZone; - - //today - var t1 = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day); - if (!timeZone.IsInvalidTime(t1)) - { - DateTime? startTime1 = _dateTimeHelper.ConvertToUtcTime(t1, timeZone); - var todayResult = GetOrderAverageReportLine(storeId: storeId, - osIds: orderStatuses, - startTimeUtc: startTime1); - item.SumTodayOrders = todayResult.SumOrders; - item.CountTodayOrders = todayResult.CountOrders; - } - //week - DayOfWeek fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; - var today = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day); - DateTime t2 = today.AddDays(-(today.DayOfWeek - fdow)); - if (!timeZone.IsInvalidTime(t2)) - { - DateTime? startTime2 = _dateTimeHelper.ConvertToUtcTime(t2, timeZone); - var weekResult = GetOrderAverageReportLine(storeId: storeId, - osIds: orderStatuses, - startTimeUtc: startTime2); - item.SumThisWeekOrders = weekResult.SumOrders; - item.CountThisWeekOrders = weekResult.CountOrders; - } - //month - var t3 = new DateTime(nowDt.Year, nowDt.Month, 1); - if (!timeZone.IsInvalidTime(t3)) - { - DateTime? startTime3 = _dateTimeHelper.ConvertToUtcTime(t3, timeZone); - var monthResult = GetOrderAverageReportLine(storeId: storeId, - osIds: orderStatuses, - startTimeUtc: startTime3); - item.SumThisMonthOrders = monthResult.SumOrders; - item.CountThisMonthOrders = monthResult.CountOrders; - } - //year - var t4 = new DateTime(nowDt.Year, 1, 1); - if (!timeZone.IsInvalidTime(t4)) - { - DateTime? startTime4 = _dateTimeHelper.ConvertToUtcTime(t4, timeZone); - var yearResult = GetOrderAverageReportLine(storeId: storeId, - osIds: orderStatuses, - startTimeUtc: startTime4); - item.SumThisYearOrders = yearResult.SumOrders; - item.CountThisYearOrders = yearResult.CountOrders; - } - //all time - var allTimeResult = GetOrderAverageReportLine(storeId: storeId, osIds: orderStatuses); - item.SumAllTimeOrders = allTimeResult.SumOrders; - item.CountAllTimeOrders = allTimeResult.CountOrders; - - return item; - } - - /// - /// Get best sellers report - /// - /// Store identifier (orders placed in a specific store); 0 to load all records - /// Vendor identifier; 0 to load all records - /// Category identifier; 0 to load all records - /// Manufacturer identifier; 0 to load all records - /// Order created date from (UTC); null to load all records - /// Order created date to (UTC); null to load all records - /// Order status; null to load all records - /// Order payment status; null to load all records - /// Shipping status; null to load all records - /// Billing country identifier; 0 to load all records - /// 1 - order by quantity, 2 - order by total amount - /// Page index - /// Page size - /// A value indicating whether to show hidden records - /// Result - public virtual IPagedList BestSellersReport( - int categoryId = 0, int manufacturerId = 0, - int storeId = 0, int vendorId = 0, - DateTime? createdFromUtc = null, DateTime? createdToUtc = null, - OrderStatus? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null, - int billingCountryId = 0, - int orderBy = 1, - int pageIndex = 0, int pageSize = int.MaxValue, - bool showHidden = false) - { - int? orderStatusId = null; - if (os.HasValue) - orderStatusId = (int)os.Value; - - int? paymentStatusId = null; - if (ps.HasValue) - paymentStatusId = (int)ps.Value; - - int? shippingStatusId = null; - if (ss.HasValue) - shippingStatusId = (int)ss.Value; - - var query1 = from orderItem in _orderItemRepository.Table - join o in _orderRepository.Table on orderItem.OrderId equals o.Id - join p in _productRepository.Table on orderItem.ProductId equals p.Id - //join pc in _productCategoryRepository.Table on p.Id equals pc.ProductId into p_pc from pc in p_pc.DefaultIfEmpty() - //join pm in _productManufacturerRepository.Table on p.Id equals pm.ProductId into p_pm from pm in p_pm.DefaultIfEmpty() - where (storeId == 0 || storeId == o.StoreId) && - (!createdFromUtc.HasValue || createdFromUtc.Value <= o.CreatedOnUtc) && - (!createdToUtc.HasValue || createdToUtc.Value >= o.CreatedOnUtc) && - (!orderStatusId.HasValue || orderStatusId == o.OrderStatusId) && - (!paymentStatusId.HasValue || paymentStatusId == o.PaymentStatusId) && - (!shippingStatusId.HasValue || shippingStatusId == o.ShippingStatusId) && - (!o.Deleted) && - (!p.Deleted) && - (vendorId == 0 || p.VendorId == vendorId) && - //(categoryId == 0 || pc.CategoryId == categoryId) && - //(manufacturerId == 0 || pm.ManufacturerId == manufacturerId) && - (categoryId == 0 || p.ProductCategories.Count(pc => pc.CategoryId == categoryId) > 0) && - (manufacturerId == 0 || p.ProductManufacturers.Count(pm => pm.ManufacturerId == manufacturerId) > 0) && - (billingCountryId == 0 || o.BillingAddress.CountryId == billingCountryId) && - (showHidden || p.Published) - select orderItem; - - IQueryable query2 = - //group by products - from orderItem in query1 - group orderItem by orderItem.ProductId into g - select new BestsellersReportLine - { - ProductId = g.Key, - TotalAmount = g.Sum(x => x.PriceExclTax), - TotalQuantity = g.Sum(x => x.Quantity), - } - ; - - switch (orderBy) - { - case 1: - { - query2 = query2.OrderByDescending(x => x.TotalQuantity); - } - break; - case 2: - { - query2 = query2.OrderByDescending(x => x.TotalAmount); - } - break; - default: - throw new ArgumentException("Wrong orderBy parameter", "orderBy"); - } - - var result = new PagedList(query2, pageIndex, pageSize); - return result; - } - - /// - /// Gets a list of products (identifiers) purchased by other customers who purchased a specified product - /// - /// Store identifier - /// Product identifier - /// Records to return - /// A values indicating whether to load only products marked as "visible individually"; "false" to load all records; "true" to load "visible individually" only - /// A value indicating whether to show hidden records - /// Products - public virtual int[] GetAlsoPurchasedProductsIds(int storeId, int productId, - int recordsToReturn = 5, bool visibleIndividuallyOnly = true, bool showHidden = false) - { - if (productId == 0) - throw new ArgumentException("Product ID is not specified"); - - //this inner query should retrieve all orders that contains a specified product ID - var query1 = from orderItem in _orderItemRepository.Table - where orderItem.ProductId == productId - select orderItem.OrderId; - - var query2 = from orderItem in _orderItemRepository.Table - join p in _productRepository.Table on orderItem.ProductId equals p.Id - where (query1.Contains(orderItem.OrderId)) && - (p.Id != productId) && - (showHidden || p.Published) && - (!orderItem.Order.Deleted) && - (storeId == 0 || orderItem.Order.StoreId == storeId) && - (!p.Deleted) && - (!visibleIndividuallyOnly || p.VisibleIndividually) - select new { orderItem, p }; - - var query3 = from orderItem_p in query2 - group orderItem_p by orderItem_p.p.Id into g - select new - { - ProductId = g.Key, - ProductsPurchased = g.Sum(x => x.orderItem.Quantity), - }; - query3 = query3.OrderByDescending(x => x.ProductsPurchased); - - if (recordsToReturn > 0) - query3 = query3.Take(recordsToReturn); - - var report = query3.ToList(); - - var ids = new List(); - foreach (var reportLine in report) - ids.Add(reportLine.ProductId); - - return ids.ToArray(); - } - - /// - /// Gets a list of products that were never sold - /// - /// Vendor identifier (filter products by a specific vendor); 0 to load all records - /// Store identifier (filter products by a specific store); 0 to load all records - /// Category identifier; 0 to load all records - /// Manufacturer identifier; 0 to load all records - /// Order created date from (UTC); null to load all records - /// Order created date to (UTC); null to load all records - /// Page index - /// Page size - /// A value indicating whether to show hidden records - /// Products - public virtual IPagedList ProductsNeverSold(int vendorId = 0, int storeId = 0, - int categoryId = 0, int manufacturerId = 0, - DateTime? createdFromUtc = null, DateTime? createdToUtc = null, - int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false) - { - //this inner query should retrieve all purchased product identifiers - var query_tmp = (from orderItem in _orderItemRepository.Table - join o in _orderRepository.Table on orderItem.OrderId equals o.Id - where (!createdFromUtc.HasValue || createdFromUtc.Value <= o.CreatedOnUtc) && - (!createdToUtc.HasValue || createdToUtc.Value >= o.CreatedOnUtc) && - (!o.Deleted) - select orderItem.ProductId).Distinct(); - - var simpleProductTypeId = (int) ProductType.SimpleProduct; - - var query = from p in _productRepository.Table - where (!query_tmp.Contains(p.Id)) && - //include only simple products - (p.ProductTypeId == simpleProductTypeId) && - (!p.Deleted) && - (vendorId == 0 || p.VendorId == vendorId) && - (categoryId == 0 || p.ProductCategories.Count(pc => pc.CategoryId == categoryId) > 0) && - (manufacturerId == 0 || p.ProductManufacturers.Count(pm => pm.ManufacturerId == manufacturerId) > 0) && - (showHidden || p.Published) - select p; - - - if (storeId > 0 && !_catalogSettings.IgnoreStoreLimitations) - { - query = from p in query - join sm in _storeMappingRepository.Table - on new { c1 = p.Id, c2 = "Product" } equals new { c1 = sm.EntityId, c2 = sm.EntityName } into p_sm - from sm in p_sm.DefaultIfEmpty() - where !p.LimitedToStores || storeId == sm.StoreId - select p; - } - - query = query.OrderBy(p => p.Name); - - var products = new PagedList(query, pageIndex, pageSize); - return products; - } - - /// - /// Get profit report - /// - /// Store identifier; pass 0 to ignore this parameter - /// Vendor identifier; pass 0 to ignore this parameter - /// Order identifier; pass 0 to ignore this parameter - /// Billing country identifier; 0 to load all orders - /// Payment method system name; null to load all records - /// Start date - /// End date - /// Order status identifiers; null to load all records - /// Payment status identifiers; null to load all records - /// Shipping status identifiers; null to load all records - /// Billing email. Leave empty to load all records. - /// Billing last name. Leave empty to load all records. - /// Search in order notes. Leave empty to load all records. - /// Result - public virtual decimal ProfitReport(int storeId = 0, int vendorId = 0, - int billingCountryId = 0, int orderId = 0, string paymentMethodSystemName = null, - List osIds = null, List psIds = null, List ssIds = null, - DateTime? startTimeUtc = null, DateTime? endTimeUtc = null, - string billingEmail = null, string billingLastName = "", string orderNotes = null) - { - //We cannot use String.IsNullOrEmpty() in SQL Compact - bool dontSearchEmail = String.IsNullOrEmpty(billingEmail); - //We cannot use String.IsNullOrEmpty() in SQL Compact - bool dontSearchLastName = String.IsNullOrEmpty(billingLastName); - //We cannot use String.IsNullOrEmpty() in SQL Compact - bool dontSearchOrderNotes = String.IsNullOrEmpty(orderNotes); - //We cannot use String.IsNullOrEmpty() in SQL Compact - bool dontSearchPaymentMethods = String.IsNullOrEmpty(paymentMethodSystemName); - - var orders = _orderRepository.Table; - if (osIds != null && osIds.Any()) - orders = orders.Where(o => osIds.Contains(o.OrderStatusId)); - if (psIds != null && psIds.Any()) - orders = orders.Where(o => psIds.Contains(o.PaymentStatusId)); - if (ssIds != null && ssIds.Any()) - orders = orders.Where(o => ssIds.Contains(o.ShippingStatusId)); - - var query = from orderItem in _orderItemRepository.Table - join o in orders on orderItem.OrderId equals o.Id - where (storeId == 0 || storeId == o.StoreId) && - (orderId == 0 || orderId == o.Id) && - (billingCountryId ==0 || (o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId)) && - (dontSearchPaymentMethods || paymentMethodSystemName == o.PaymentMethodSystemName) && - (!startTimeUtc.HasValue || startTimeUtc.Value <= o.CreatedOnUtc) && - (!endTimeUtc.HasValue || endTimeUtc.Value >= o.CreatedOnUtc) && - (!o.Deleted) && - (vendorId == 0 || orderItem.Product.VendorId == vendorId) && - //we do not ignore deleted products when calculating order reports - //(!p.Deleted) - (dontSearchEmail || (o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail))) && - (dontSearchLastName || (o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName))) && - (dontSearchOrderNotes || o.OrderNotes.Any(oNote => oNote.Note.Contains(orderNotes))) - select orderItem; - - var productCost = Convert.ToDecimal(query.Sum(orderItem => (decimal?)orderItem.OriginalProductCost * orderItem.Quantity)); - - var reportSummary = GetOrderAverageReportLine( - storeId: storeId, - vendorId: vendorId, - billingCountryId: billingCountryId, - orderId: orderId, - paymentMethodSystemName: paymentMethodSystemName, - osIds: osIds, - psIds: psIds, - ssIds: ssIds, - startTimeUtc: startTimeUtc, - endTimeUtc: endTimeUtc, - billingEmail: billingEmail, - billingLastName: billingLastName, - orderNotes: orderNotes); - var profit = reportSummary.SumOrders - reportSummary.SumShippingExclTax - reportSummary.SumTax - productCost; - return profit; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Nop.Core; +using Nop.Core.Data; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Stores; +using Nop.Services.Helpers; + +namespace Nop.Services.Orders +{ + /// + /// Order report service + /// + public partial class OrderReportService : IOrderReportService + { + #region Fields + + private readonly IRepository _orderRepository; + private readonly IRepository _orderItemRepository; + private readonly IRepository _productRepository; + private readonly IRepository _storeMappingRepository; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly CatalogSettings _catalogSettings; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Order repository + /// Order item repository + /// Product repository + /// Store mapping repository + /// Datetime helper + /// Catalog settings + public OrderReportService(IRepository orderRepository, + IRepository orderItemRepository, + IRepository productRepository, + IRepository storeMappingRepository, + IDateTimeHelper dateTimeHelper, + CatalogSettings catalogSettings) + { + this._orderRepository = orderRepository; + this._orderItemRepository = orderItemRepository; + this._productRepository = productRepository; + this._storeMappingRepository = storeMappingRepository; + this._dateTimeHelper = dateTimeHelper; + this._catalogSettings = catalogSettings; + } + + #endregion + + #region Methods + + /// + /// Get "order by country" report + /// + /// Store identifier + /// Order status + /// Payment status + /// Shipping status + /// Start date + /// End date + /// Result + public virtual IList GetCountryReport(int storeId, OrderStatus? os, + PaymentStatus? ps, ShippingStatus? ss, DateTime? startTimeUtc, DateTime? endTimeUtc) + { + int? orderStatusId = null; + if (os.HasValue) + orderStatusId = (int)os.Value; + + int? paymentStatusId = null; + if (ps.HasValue) + paymentStatusId = (int)ps.Value; + + int? shippingStatusId = null; + if (ss.HasValue) + shippingStatusId = (int)ss.Value; + + var query = _orderRepository.Table; + query = query.Where(o => !o.Deleted); + if (storeId > 0) + query = query.Where(o => o.StoreId == storeId); + if (orderStatusId.HasValue) + query = query.Where(o => o.OrderStatusId == orderStatusId.Value); + if (paymentStatusId.HasValue) + query = query.Where(o => o.PaymentStatusId == paymentStatusId.Value); + if (shippingStatusId.HasValue) + query = query.Where(o => o.ShippingStatusId == shippingStatusId.Value); + if (startTimeUtc.HasValue) + query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc); + if (endTimeUtc.HasValue) + query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc); + + var report = (from oq in query + group oq by oq.BillingAddress.CountryId into result + select new + { + CountryId = result.Key, + TotalOrders = result.Count(), + SumOrders = result.Sum(o => o.OrderTotal) + } + ) + .OrderByDescending(x => x.SumOrders) + .Select(r => new OrderByCountryReportLine + { + CountryId = r.CountryId, + TotalOrders = r.TotalOrders, + SumOrders = r.SumOrders + }) + + .ToList(); + + return report; + } + + /// + /// Get order average report + /// + /// Store identifier; pass 0 to ignore this parameter + /// Vendor identifier; pass 0 to ignore this parameter + /// Billing country identifier; 0 to load all orders + /// Order identifier; pass 0 to ignore this parameter + /// Payment method system name; null to load all records + /// Order status identifiers + /// Payment status identifiers + /// Shipping status identifiers + /// Start date + /// End date + /// Billing email. Leave empty to load all records. + /// Billing last name. Leave empty to load all records. + /// Search in order notes. Leave empty to load all records. + /// Result + public virtual OrderAverageReportLine GetOrderAverageReportLine(int storeId = 0, + int vendorId = 0, int billingCountryId = 0, + int orderId = 0, string paymentMethodSystemName = null, + List osIds = null, List psIds = null, List ssIds = null, + DateTime? startTimeUtc = null, DateTime? endTimeUtc = null, + string billingEmail = null, string billingLastName = "", string orderNotes = null) + { + var query = _orderRepository.Table; + query = query.Where(o => !o.Deleted); + if (storeId > 0) + query = query.Where(o => o.StoreId == storeId); + if (orderId > 0) + query = query.Where(o => o.Id == orderId); + if (vendorId > 0) + { + query = query + .Where(o => o.OrderItems + .Any(orderItem => orderItem.Product.VendorId == vendorId)); + } + if (billingCountryId > 0) + query = query.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId); + if (!String.IsNullOrEmpty(paymentMethodSystemName)) + query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); + if (osIds != null && osIds.Any()) + query = query.Where(o => osIds.Contains(o.OrderStatusId)); + if (psIds != null && psIds.Any()) + query = query.Where(o => psIds.Contains(o.PaymentStatusId)); + if (ssIds != null && ssIds.Any()) + query = query.Where(o => ssIds.Contains(o.ShippingStatusId)); + if (startTimeUtc.HasValue) + query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc); + if (endTimeUtc.HasValue) + query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc); + if (!String.IsNullOrEmpty(billingEmail)) + query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail)); + if (!String.IsNullOrEmpty(billingLastName)) + query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName)); + if (!String.IsNullOrEmpty(orderNotes)) + query = query.Where(o => o.OrderNotes.Any(on => on.Note.Contains(orderNotes))); + + var item = (from oq in query + group oq by 1 into result + select new + { + OrderCount = result.Count(), + OrderShippingExclTaxSum = result.Sum(o => o.OrderShippingExclTax), + OrderTaxSum = result.Sum(o => o.OrderTax), + OrderTotalAmountInclSum = result.Sum(o => o.OrderAmountIncl + o.OrderShippingNonTaxable + o.PaymentMethodAdditionalFeeNonTaxable - (o.RedeemedRewardPointsEntry != null ? o.RedeemedRewardPointsEntry.UsedAmount : decimal.Zero)), + OrderTotalSum = result.Sum(o => o.OrderTotal), + } + ).Select(r => new OrderAverageReportLine + { + CountOrders = r.OrderCount, + SumShippingExclTax = r.OrderShippingExclTaxSum, + SumTax = r.OrderTaxSum, + SumOrdersTotalAmountIncl = r.OrderTotalAmountInclSum, + SumOrders = r.OrderTotalSum, + }) + .FirstOrDefault(); + + item = item ?? new OrderAverageReportLine + { + CountOrders = 0, + SumShippingExclTax = decimal.Zero, + SumTax = decimal.Zero, + SumOrdersTotalAmountIncl = decimal.Zero, + SumOrders = decimal.Zero, + }; + return item; + } + + /// + /// Get order average report + /// + /// Store identifier + /// Order status + /// Result + public virtual OrderAverageReportLineSummary OrderAverageReport(int storeId, OrderStatus os) + { + var item = new OrderAverageReportLineSummary(); + item.OrderStatus = os; + var orderStatuses = new List() { (int)os }; + + DateTime nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); + TimeZoneInfo timeZone = _dateTimeHelper.CurrentTimeZone; + + //today + var t1 = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day); + if (!timeZone.IsInvalidTime(t1)) + { + DateTime? startTime1 = _dateTimeHelper.ConvertToUtcTime(t1, timeZone); + var todayResult = GetOrderAverageReportLine(storeId: storeId, + osIds: orderStatuses, + startTimeUtc: startTime1); + item.SumTodayOrders = todayResult.SumOrders; + item.CountTodayOrders = todayResult.CountOrders; + } + //week + DayOfWeek fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; + var today = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day); + DateTime t2 = today.AddDays(-(today.DayOfWeek - fdow)); + if (!timeZone.IsInvalidTime(t2)) + { + DateTime? startTime2 = _dateTimeHelper.ConvertToUtcTime(t2, timeZone); + var weekResult = GetOrderAverageReportLine(storeId: storeId, + osIds: orderStatuses, + startTimeUtc: startTime2); + item.SumThisWeekOrders = weekResult.SumOrders; + item.CountThisWeekOrders = weekResult.CountOrders; + } + //month + var t3 = new DateTime(nowDt.Year, nowDt.Month, 1); + if (!timeZone.IsInvalidTime(t3)) + { + DateTime? startTime3 = _dateTimeHelper.ConvertToUtcTime(t3, timeZone); + var monthResult = GetOrderAverageReportLine(storeId: storeId, + osIds: orderStatuses, + startTimeUtc: startTime3); + item.SumThisMonthOrders = monthResult.SumOrders; + item.CountThisMonthOrders = monthResult.CountOrders; + } + //year + var t4 = new DateTime(nowDt.Year, 1, 1); + if (!timeZone.IsInvalidTime(t4)) + { + DateTime? startTime4 = _dateTimeHelper.ConvertToUtcTime(t4, timeZone); + var yearResult = GetOrderAverageReportLine(storeId: storeId, + osIds: orderStatuses, + startTimeUtc: startTime4); + item.SumThisYearOrders = yearResult.SumOrders; + item.CountThisYearOrders = yearResult.CountOrders; + } + //all time + var allTimeResult = GetOrderAverageReportLine(storeId: storeId, osIds: orderStatuses); + item.SumAllTimeOrders = allTimeResult.SumOrders; + item.CountAllTimeOrders = allTimeResult.CountOrders; + + return item; + } + + /// + /// Get best sellers report + /// + /// Store identifier (orders placed in a specific store); 0 to load all records + /// Vendor identifier; 0 to load all records + /// Category identifier; 0 to load all records + /// Manufacturer identifier; 0 to load all records + /// Order created date from (UTC); null to load all records + /// Order created date to (UTC); null to load all records + /// Order status; null to load all records + /// Order payment status; null to load all records + /// Shipping status; null to load all records + /// Billing country identifier; 0 to load all records + /// 1 - order by quantity, 2 - order by total amount + /// Page index + /// Page size + /// A value indicating whether to show hidden records + /// Result + public virtual IPagedList BestSellersReport( + int categoryId = 0, int manufacturerId = 0, + int storeId = 0, int vendorId = 0, + DateTime? createdFromUtc = null, DateTime? createdToUtc = null, + OrderStatus? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null, + int billingCountryId = 0, + int orderBy = 1, + int pageIndex = 0, int pageSize = int.MaxValue, + bool showHidden = false) + { + int? orderStatusId = null; + if (os.HasValue) + orderStatusId = (int)os.Value; + + int? paymentStatusId = null; + if (ps.HasValue) + paymentStatusId = (int)ps.Value; + + int? shippingStatusId = null; + if (ss.HasValue) + shippingStatusId = (int)ss.Value; + + var query1 = from orderItem in _orderItemRepository.Table + join o in _orderRepository.Table on orderItem.OrderId equals o.Id + join p in _productRepository.Table on orderItem.ProductId equals p.Id + //join pc in _productCategoryRepository.Table on p.Id equals pc.ProductId into p_pc from pc in p_pc.DefaultIfEmpty() + //join pm in _productManufacturerRepository.Table on p.Id equals pm.ProductId into p_pm from pm in p_pm.DefaultIfEmpty() + where (storeId == 0 || storeId == o.StoreId) && + (!createdFromUtc.HasValue || createdFromUtc.Value <= o.CreatedOnUtc) && + (!createdToUtc.HasValue || createdToUtc.Value >= o.CreatedOnUtc) && + (!orderStatusId.HasValue || orderStatusId == o.OrderStatusId) && + (!paymentStatusId.HasValue || paymentStatusId == o.PaymentStatusId) && + (!shippingStatusId.HasValue || shippingStatusId == o.ShippingStatusId) && + (!o.Deleted) && + (!p.Deleted) && + (vendorId == 0 || p.VendorId == vendorId) && + //(categoryId == 0 || pc.CategoryId == categoryId) && + //(manufacturerId == 0 || pm.ManufacturerId == manufacturerId) && + (categoryId == 0 || p.ProductCategories.Count(pc => pc.CategoryId == categoryId) > 0) && + (manufacturerId == 0 || p.ProductManufacturers.Count(pm => pm.ManufacturerId == manufacturerId) > 0) && + (billingCountryId == 0 || o.BillingAddress.CountryId == billingCountryId) && + (showHidden || p.Published) + select orderItem; + + IQueryable query2 = + //group by products + from orderItem in query1 + group orderItem by orderItem.ProductId into g + select new BestsellersReportLine + { + ProductId = g.Key, + TotalAmount = g.Sum(x => x.PriceExclTax), + TotalQuantity = g.Sum(x => x.Quantity), + } + ; + + switch (orderBy) + { + case 1: + { + query2 = query2.OrderByDescending(x => x.TotalQuantity); + } + break; + case 2: + { + query2 = query2.OrderByDescending(x => x.TotalAmount); + } + break; + default: + throw new ArgumentException("Wrong orderBy parameter", "orderBy"); + } + + var result = new PagedList(query2, pageIndex, pageSize); + return result; + } + + /// + /// Gets a list of products (identifiers) purchased by other customers who purchased a specified product + /// + /// Store identifier + /// Product identifier + /// Records to return + /// A values indicating whether to load only products marked as "visible individually"; "false" to load all records; "true" to load "visible individually" only + /// A value indicating whether to show hidden records + /// Products + public virtual int[] GetAlsoPurchasedProductsIds(int storeId, int productId, + int recordsToReturn = 5, bool visibleIndividuallyOnly = true, bool showHidden = false) + { + if (productId == 0) + throw new ArgumentException("Product ID is not specified"); + + //this inner query should retrieve all orders that contains a specified product ID + var query1 = from orderItem in _orderItemRepository.Table + where orderItem.ProductId == productId + select orderItem.OrderId; + + var query2 = from orderItem in _orderItemRepository.Table + join p in _productRepository.Table on orderItem.ProductId equals p.Id + where (query1.Contains(orderItem.OrderId)) && + (p.Id != productId) && + (showHidden || p.Published) && + (!orderItem.Order.Deleted) && + (storeId == 0 || orderItem.Order.StoreId == storeId) && + (!p.Deleted) && + (!visibleIndividuallyOnly || p.VisibleIndividually) + select new { orderItem, p }; + + var query3 = from orderItem_p in query2 + group orderItem_p by orderItem_p.p.Id into g + select new + { + ProductId = g.Key, + ProductsPurchased = g.Sum(x => x.orderItem.Quantity), + }; + query3 = query3.OrderByDescending(x => x.ProductsPurchased); + + if (recordsToReturn > 0) + query3 = query3.Take(recordsToReturn); + + var report = query3.ToList(); + + var ids = new List(); + foreach (var reportLine in report) + ids.Add(reportLine.ProductId); + + return ids.ToArray(); + } + + /// + /// Gets a list of products that were never sold + /// + /// Vendor identifier (filter products by a specific vendor); 0 to load all records + /// Store identifier (filter products by a specific store); 0 to load all records + /// Category identifier; 0 to load all records + /// Manufacturer identifier; 0 to load all records + /// Order created date from (UTC); null to load all records + /// Order created date to (UTC); null to load all records + /// Page index + /// Page size + /// A value indicating whether to show hidden records + /// Products + public virtual IPagedList ProductsNeverSold(int vendorId = 0, int storeId = 0, + int categoryId = 0, int manufacturerId = 0, + DateTime? createdFromUtc = null, DateTime? createdToUtc = null, + int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false) + { + //this inner query should retrieve all purchased product identifiers + var query_tmp = (from orderItem in _orderItemRepository.Table + join o in _orderRepository.Table on orderItem.OrderId equals o.Id + where (!createdFromUtc.HasValue || createdFromUtc.Value <= o.CreatedOnUtc) && + (!createdToUtc.HasValue || createdToUtc.Value >= o.CreatedOnUtc) && + (!o.Deleted) + select orderItem.ProductId).Distinct(); + + var simpleProductTypeId = (int) ProductType.SimpleProduct; + + var query = from p in _productRepository.Table + where (!query_tmp.Contains(p.Id)) && + //include only simple products + (p.ProductTypeId == simpleProductTypeId) && + (!p.Deleted) && + (vendorId == 0 || p.VendorId == vendorId) && + (categoryId == 0 || p.ProductCategories.Count(pc => pc.CategoryId == categoryId) > 0) && + (manufacturerId == 0 || p.ProductManufacturers.Count(pm => pm.ManufacturerId == manufacturerId) > 0) && + (showHidden || p.Published) + select p; + + + if (storeId > 0 && !_catalogSettings.IgnoreStoreLimitations) + { + query = from p in query + join sm in _storeMappingRepository.Table + on new { c1 = p.Id, c2 = "Product" } equals new { c1 = sm.EntityId, c2 = sm.EntityName } into p_sm + from sm in p_sm.DefaultIfEmpty() + where !p.LimitedToStores || storeId == sm.StoreId + select p; + } + + query = query.OrderBy(p => p.Name); + + var products = new PagedList(query, pageIndex, pageSize); + return products; + } + + /// + /// Get profit report + /// + /// Store identifier; pass 0 to ignore this parameter + /// Vendor identifier; pass 0 to ignore this parameter + /// Order identifier; pass 0 to ignore this parameter + /// Billing country identifier; 0 to load all orders + /// Payment method system name; null to load all records + /// Start date + /// End date + /// Order status identifiers; null to load all records + /// Payment status identifiers; null to load all records + /// Shipping status identifiers; null to load all records + /// Billing email. Leave empty to load all records. + /// Billing last name. Leave empty to load all records. + /// Search in order notes. Leave empty to load all records. + /// Result + public virtual decimal ProfitReport(int storeId = 0, int vendorId = 0, + int billingCountryId = 0, int orderId = 0, string paymentMethodSystemName = null, + List osIds = null, List psIds = null, List ssIds = null, + DateTime? startTimeUtc = null, DateTime? endTimeUtc = null, + string billingEmail = null, string billingLastName = "", string orderNotes = null) + { + //We cannot use String.IsNullOrEmpty() in SQL Compact + bool dontSearchEmail = String.IsNullOrEmpty(billingEmail); + //We cannot use String.IsNullOrEmpty() in SQL Compact + bool dontSearchLastName = String.IsNullOrEmpty(billingLastName); + //We cannot use String.IsNullOrEmpty() in SQL Compact + bool dontSearchOrderNotes = String.IsNullOrEmpty(orderNotes); + //We cannot use String.IsNullOrEmpty() in SQL Compact + bool dontSearchPaymentMethods = String.IsNullOrEmpty(paymentMethodSystemName); + + var orders = _orderRepository.Table; + if (osIds != null && osIds.Any()) + orders = orders.Where(o => osIds.Contains(o.OrderStatusId)); + if (psIds != null && psIds.Any()) + orders = orders.Where(o => psIds.Contains(o.PaymentStatusId)); + if (ssIds != null && ssIds.Any()) + orders = orders.Where(o => ssIds.Contains(o.ShippingStatusId)); + + var query = from orderItem in _orderItemRepository.Table + join o in orders on orderItem.OrderId equals o.Id + where (storeId == 0 || storeId == o.StoreId) && + (orderId == 0 || orderId == o.Id) && + (billingCountryId ==0 || (o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId)) && + (dontSearchPaymentMethods || paymentMethodSystemName == o.PaymentMethodSystemName) && + (!startTimeUtc.HasValue || startTimeUtc.Value <= o.CreatedOnUtc) && + (!endTimeUtc.HasValue || endTimeUtc.Value >= o.CreatedOnUtc) && + (!o.Deleted) && + (vendorId == 0 || orderItem.Product.VendorId == vendorId) && + //we do not ignore deleted products when calculating order reports + //(!p.Deleted) + (dontSearchEmail || (o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail))) && + (dontSearchLastName || (o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName))) && + (dontSearchOrderNotes || o.OrderNotes.Any(oNote => oNote.Note.Contains(orderNotes))) + select orderItem; + + var productCost = Convert.ToDecimal(query.Sum(orderItem => (decimal?)orderItem.OriginalProductCost * orderItem.Quantity)); + + var reportSummary = GetOrderAverageReportLine( + storeId: storeId, + vendorId: vendorId, + billingCountryId: billingCountryId, + orderId: orderId, + paymentMethodSystemName: paymentMethodSystemName, + osIds: osIds, + psIds: psIds, + ssIds: ssIds, + startTimeUtc: startTimeUtc, + endTimeUtc: endTimeUtc, + billingEmail: billingEmail, + billingLastName: billingLastName, + orderNotes: orderNotes); + var profit = reportSummary.SumOrders - reportSummary.SumShippingExclTax - reportSummary.SumTax - productCost; + return profit; + } + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/OrderService.cs b/src/Libraries/Nop.Services/Orders/OrderService.cs index 496ca96fd26..a483fdf3631 100644 --- a/src/Libraries/Nop.Services/Orders/OrderService.cs +++ b/src/Libraries/Nop.Services/Orders/OrderService.cs @@ -1,508 +1,522 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Data; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Services.Events; - -namespace Nop.Services.Orders -{ - /// - /// Order service - /// - public partial class OrderService : IOrderService - { - #region Fields - - private readonly IRepository _orderRepository; - private readonly IRepository _orderItemRepository; - private readonly IRepository _orderNoteRepository; - private readonly IRepository _productRepository; - private readonly IRepository _recurringPaymentRepository; - private readonly IRepository _customerRepository; - private readonly IEventPublisher _eventPublisher; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Order repository - /// Order item repository - /// Order note repository - /// Product repository - /// Recurring payment repository - /// Customer repository - /// Event published - public OrderService(IRepository orderRepository, - IRepository orderItemRepository, - IRepository orderNoteRepository, - IRepository productRepository, - IRepository recurringPaymentRepository, - IRepository customerRepository, - IEventPublisher eventPublisher) - { - this._orderRepository = orderRepository; - this._orderItemRepository = orderItemRepository; - this._orderNoteRepository = orderNoteRepository; - this._productRepository = productRepository; - this._recurringPaymentRepository = recurringPaymentRepository; - this._customerRepository = customerRepository; - this._eventPublisher = eventPublisher; - } - - #endregion - - #region Methods - - #region Orders - - /// - /// Gets an order - /// - /// The order identifier - /// Order - public virtual Order GetOrderById(int orderId) - { - if (orderId == 0) - return null; - - return _orderRepository.GetById(orderId); - } - - /// - /// Gets an order - /// - /// The custom order number - /// Order - public virtual Order GetOrderByCustomOrderNumber(string customOrderNumber) - { - if (string.IsNullOrEmpty(customOrderNumber)) - return null; - - return _orderRepository.Table.FirstOrDefault(o => o.CustomOrderNumber == customOrderNumber); - } - - /// - /// Get orders by identifiers - /// - /// Order identifiers - /// Order - public virtual IList GetOrdersByIds(int[] orderIds) - { - if (orderIds == null || orderIds.Length == 0) - return new List(); - - var query = from o in _orderRepository.Table - where orderIds.Contains(o.Id) && !o.Deleted - select o; - var orders = query.ToList(); - //sort by passed identifiers - var sortedOrders = new List(); - foreach (int id in orderIds) - { - var order = orders.Find(x => x.Id == id); - if (order != null) - sortedOrders.Add(order); - } - return sortedOrders; - } - - /// - /// Gets an order - /// - /// The order identifier - /// Order - public virtual Order GetOrderByGuid(Guid orderGuid) - { - if (orderGuid == Guid.Empty) - return null; - - var query = from o in _orderRepository.Table - where o.OrderGuid == orderGuid - select o; - var order = query.FirstOrDefault(); - return order; - } - - /// - /// Deletes an order - /// - /// The order - public virtual void DeleteOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - order.Deleted = true; - UpdateOrder(order); - - //event notification - _eventPublisher.EntityDeleted(order); - } - - /// - /// Search orders - /// - /// Store identifier; 0 to load all orders - /// Vendor identifier; null to load all orders - /// Customer identifier; 0 to load all orders - /// Product identifier which was purchased in an order; 0 to load all orders - /// Affiliate identifier; 0 to load all orders - /// Billing country identifier; 0 to load all orders - /// Warehouse identifier, only orders with products from a specified warehouse will be loaded; 0 to load all orders - /// Payment method system name; null to load all records - /// Created date from (UTC); null to load all records - /// Created date to (UTC); null to load all records - /// Order status identifiers; null to load all orders - /// Payment status identifiers; null to load all orders - /// Shipping status identifiers; null to load all orders - /// Billing email. Leave empty to load all records. - /// Billing last name. Leave empty to load all records. - /// Search in order notes. Leave empty to load all records. - /// Page index - /// Page size - /// Orders - public virtual IPagedList SearchOrders(int storeId = 0, - int vendorId = 0, int customerId = 0, - int productId = 0, int affiliateId = 0, int warehouseId = 0, - int billingCountryId = 0, string paymentMethodSystemName = null, - DateTime? createdFromUtc = null, DateTime? createdToUtc = null, - List osIds = null, List psIds = null, List ssIds = null, - string billingEmail = null, string billingLastName = "", - string orderNotes = null, int pageIndex = 0, int pageSize = int.MaxValue) - { - var query = _orderRepository.Table; - if (storeId > 0) - query = query.Where(o => o.StoreId == storeId); - if (vendorId > 0) - { - query = query - .Where(o => o.OrderItems - .Any(orderItem => orderItem.Product.VendorId == vendorId)); - } - if (customerId > 0) - query = query.Where(o => o.CustomerId == customerId); - if (productId > 0) - { - query = query - .Where(o => o.OrderItems - .Any(orderItem => orderItem.Product.Id == productId)); - } - if (warehouseId > 0) - { - var manageStockInventoryMethodId = (int)ManageInventoryMethod.ManageStock; - query = query - .Where(o => o.OrderItems - .Any(orderItem => - //"Use multiple warehouses" enabled - //we search in each warehouse - (orderItem.Product.ManageInventoryMethodId == manageStockInventoryMethodId && - orderItem.Product.UseMultipleWarehouses && - orderItem.Product.ProductWarehouseInventory.Any(pwi => pwi.WarehouseId == warehouseId)) - || - //"Use multiple warehouses" disabled - //we use standard "warehouse" property - ((orderItem.Product.ManageInventoryMethodId != manageStockInventoryMethodId || - !orderItem.Product.UseMultipleWarehouses) && - orderItem.Product.WarehouseId == warehouseId)) - ); - } - if (billingCountryId > 0) - query = query.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId); - if (!String.IsNullOrEmpty(paymentMethodSystemName)) - query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); - if (affiliateId > 0) - query = query.Where(o => o.AffiliateId == affiliateId); - if (createdFromUtc.HasValue) - query = query.Where(o => createdFromUtc.Value <= o.CreatedOnUtc); - if (createdToUtc.HasValue) - query = query.Where(o => createdToUtc.Value >= o.CreatedOnUtc); - if (osIds != null && osIds.Any()) - query = query.Where(o => osIds.Contains(o.OrderStatusId)); - if (psIds != null && psIds.Any()) - query = query.Where(o => psIds.Contains(o.PaymentStatusId)); - if (ssIds != null && ssIds.Any()) - query = query.Where(o => ssIds.Contains(o.ShippingStatusId)); - if (!String.IsNullOrEmpty(billingEmail)) - query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail)); - if (!String.IsNullOrEmpty(billingLastName)) - query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName)); - if (!String.IsNullOrEmpty(orderNotes)) - query = query.Where(o => o.OrderNotes.Any(on => on.Note.Contains(orderNotes))); - query = query.Where(o => !o.Deleted); - query = query.OrderByDescending(o => o.CreatedOnUtc); - - //database layer paging - return new PagedList(query, pageIndex, pageSize); - } - - /// - /// Inserts an order - /// - /// Order - public virtual void InsertOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - _orderRepository.Insert(order); - - //event notification - _eventPublisher.EntityInserted(order); - } - - /// - /// Updates the order - /// - /// The order - public virtual void UpdateOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - _orderRepository.Update(order); - - //event notification - _eventPublisher.EntityUpdated(order); - } - - /// - /// Get an order by authorization transaction ID and payment method system name - /// - /// Authorization transaction ID - /// Payment method system name - /// Order - public virtual Order GetOrderByAuthorizationTransactionIdAndPaymentMethod(string authorizationTransactionId, - string paymentMethodSystemName) - { - var query = _orderRepository.Table; - if (!String.IsNullOrWhiteSpace(authorizationTransactionId)) - query = query.Where(o => o.AuthorizationTransactionId == authorizationTransactionId); - - if (!String.IsNullOrWhiteSpace(paymentMethodSystemName)) - query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); - - query = query.OrderByDescending(o => o.CreatedOnUtc); - var order = query.FirstOrDefault(); - return order; - } - - #endregion - - #region Orders items - - /// - /// Gets an order item - /// - /// Order item identifier - /// Order item - public virtual OrderItem GetOrderItemById(int orderItemId) - { - if (orderItemId == 0) - return null; - - return _orderItemRepository.GetById(orderItemId); - } - - /// - /// Gets an item - /// - /// Order identifier - /// Order item - public virtual OrderItem GetOrderItemByGuid(Guid orderItemGuid) - { - if (orderItemGuid == Guid.Empty) - return null; - - var query = from orderItem in _orderItemRepository.Table - where orderItem.OrderItemGuid == orderItemGuid - select orderItem; - var item = query.FirstOrDefault(); - return item; - } - - /// - /// Gets all downloadable order items - /// - /// Customer identifier; null to load all records - /// Order items - public virtual IList GetDownloadableOrderItems(int customerId) - { - if (customerId == 0) - throw new ArgumentOutOfRangeException("customerId"); - - var query = from orderItem in _orderItemRepository.Table - join o in _orderRepository.Table on orderItem.OrderId equals o.Id - join p in _productRepository.Table on orderItem.ProductId equals p.Id - where customerId == o.CustomerId && - p.IsDownload && - !o.Deleted - orderby o.CreatedOnUtc descending, orderItem.Id - select orderItem; - - var orderItems = query.ToList(); - return orderItems; - } - - /// - /// Delete an order item - /// - /// The order item - public virtual void DeleteOrderItem(OrderItem orderItem) - { - if (orderItem == null) - throw new ArgumentNullException("orderItem"); - - _orderItemRepository.Delete(orderItem); - - //event notification - _eventPublisher.EntityDeleted(orderItem); - } - - #endregion - - #region Orders notes - - /// - /// Gets an order note - /// - /// The order note identifier - /// Order note - public virtual OrderNote GetOrderNoteById(int orderNoteId) - { - if (orderNoteId == 0) - return null; - - return _orderNoteRepository.GetById(orderNoteId); - } - - /// - /// Deletes an order note - /// - /// The order note - public virtual void DeleteOrderNote(OrderNote orderNote) - { - if (orderNote == null) - throw new ArgumentNullException("orderNote"); - - _orderNoteRepository.Delete(orderNote); - - //event notification - _eventPublisher.EntityDeleted(orderNote); - } - - #endregion - - #region Recurring payments - - /// - /// Deletes a recurring payment - /// - /// Recurring payment - public virtual void DeleteRecurringPayment(RecurringPayment recurringPayment) - { - if (recurringPayment == null) - throw new ArgumentNullException("recurringPayment"); - - recurringPayment.Deleted = true; - UpdateRecurringPayment(recurringPayment); - - //event notification - _eventPublisher.EntityDeleted(recurringPayment); - } - - /// - /// Gets a recurring payment - /// - /// The recurring payment identifier - /// Recurring payment - public virtual RecurringPayment GetRecurringPaymentById(int recurringPaymentId) - { - if (recurringPaymentId == 0) - return null; - - return _recurringPaymentRepository.GetById(recurringPaymentId); - } - - /// - /// Inserts a recurring payment - /// - /// Recurring payment - public virtual void InsertRecurringPayment(RecurringPayment recurringPayment) - { - if (recurringPayment == null) - throw new ArgumentNullException("recurringPayment"); - - _recurringPaymentRepository.Insert(recurringPayment); - - //event notification - _eventPublisher.EntityInserted(recurringPayment); - } - - /// - /// Updates the recurring payment - /// - /// Recurring payment - public virtual void UpdateRecurringPayment(RecurringPayment recurringPayment) - { - if (recurringPayment == null) - throw new ArgumentNullException("recurringPayment"); - - _recurringPaymentRepository.Update(recurringPayment); - - //event notification - _eventPublisher.EntityUpdated(recurringPayment); - } - - /// - /// Search recurring payments - /// - /// The store identifier; 0 to load all records - /// The customer identifier; 0 to load all records - /// The initial order identifier; 0 to load all records - /// Initial order status identifier; null to load all records - /// Page index - /// Page size - /// A value indicating whether to show hidden records - /// Recurring payments - public virtual IPagedList SearchRecurringPayments(int storeId = 0, - int customerId = 0, int initialOrderId = 0, OrderStatus? initialOrderStatus = null, - int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false) - { - int? initialOrderStatusId = null; - if (initialOrderStatus.HasValue) - initialOrderStatusId = (int)initialOrderStatus.Value; - - var query1 = from rp in _recurringPaymentRepository.Table - join c in _customerRepository.Table on rp.InitialOrder.CustomerId equals c.Id - where - (!rp.Deleted) && - (showHidden || !rp.InitialOrder.Deleted) && - (showHidden || !c.Deleted) && - (showHidden || rp.IsActive) && - (customerId == 0 || rp.InitialOrder.CustomerId == customerId) && - (storeId == 0 || rp.InitialOrder.StoreId == storeId) && - (initialOrderId == 0 || rp.InitialOrder.Id == initialOrderId) && - (!initialOrderStatusId.HasValue || initialOrderStatusId.Value == 0 || rp.InitialOrder.OrderStatusId == initialOrderStatusId.Value) - select rp.Id; - - var query2 = from rp in _recurringPaymentRepository.Table - where query1.Contains(rp.Id) - orderby rp.StartDateUtc, rp.Id - select rp; - - var recurringPayments = new PagedList(query2, pageIndex, pageSize); - return recurringPayments; - } - - #endregion - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Data; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Services.Events; + +namespace Nop.Services.Orders +{ + /// + /// Order service + /// + public partial class OrderService : IOrderService + { + #region Fields + + private readonly IRepository _orderRepository; + private readonly IRepository _orderItemRepository; + private readonly IRepository _orderNoteRepository; + private readonly IRepository _productRepository; + private readonly IRepository _recurringPaymentRepository; + private readonly IRepository _customerRepository; + private readonly IEventPublisher _eventPublisher; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Order repository + /// Order item repository + /// Order note repository + /// Product repository + /// Recurring payment repository + /// Customer repository + /// Event published + public OrderService(IRepository orderRepository, + IRepository orderItemRepository, + IRepository orderNoteRepository, + IRepository productRepository, + IRepository recurringPaymentRepository, + IRepository customerRepository, + IEventPublisher eventPublisher) + { + this._orderRepository = orderRepository; + this._orderItemRepository = orderItemRepository; + this._orderNoteRepository = orderNoteRepository; + this._productRepository = productRepository; + this._recurringPaymentRepository = recurringPaymentRepository; + this._customerRepository = customerRepository; + this._eventPublisher = eventPublisher; + } + + #endregion + + #region Methods + + #region Orders + + /// + /// Gets an order + /// + /// The order identifier + /// Order + public virtual Order GetOrderById(int orderId) + { + if (orderId == 0) + return null; + + return _orderRepository.GetById(orderId); + } + + /// + /// Gets an order + /// + /// The custom order number + /// Order + public virtual Order GetOrderByCustomOrderNumber(string customOrderNumber) + { + if (string.IsNullOrEmpty(customOrderNumber)) + return null; + + return _orderRepository.Table.FirstOrDefault(o => o.CustomOrderNumber == customOrderNumber); + } + + /// + /// Get orders by identifiers + /// + /// Order identifiers + /// Order + public virtual IList GetOrdersByIds(int[] orderIds) + { + if (orderIds == null || orderIds.Length == 0) + return new List(); + + var query = from o in _orderRepository.Table + where orderIds.Contains(o.Id) && !o.Deleted + select o; + var orders = query.ToList(); + //sort by passed identifiers + var sortedOrders = new List(); + foreach (int id in orderIds) + { + var order = orders.Find(x => x.Id == id); + if (order != null) + sortedOrders.Add(order); + } + return sortedOrders; + } + + /// + /// Gets an order + /// + /// The order identifier + /// Order + public virtual Order GetOrderByGuid(Guid orderGuid) + { + if (orderGuid == Guid.Empty) + return null; + + var query = from o in _orderRepository.Table + where o.OrderGuid == orderGuid + select o; + var order = query.FirstOrDefault(); + return order; + } + + /// + /// Deletes an order + /// + /// The order + public virtual void DeleteOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + order.Deleted = true; + UpdateOrder(order); + + //event notification + _eventPublisher.EntityDeleted(order); + } + + /// + /// Search orders + /// + /// Store identifier; 0 to load all orders + /// Vendor identifier; null to load all orders + /// Customer identifier; 0 to load all orders + /// Product identifier which was purchased in an order; 0 to load all orders + /// Affiliate identifier; 0 to load all orders + /// Billing country identifier; 0 to load all orders + /// Warehouse identifier, only orders with products from a specified warehouse will be loaded; 0 to load all orders + /// Payment method system name; null to load all records + /// Created date from (UTC); null to load all records + /// Created date to (UTC); null to load all records + /// Order status identifiers; null to load all orders + /// Payment status identifiers; null to load all orders + /// Shipping status identifiers; null to load all orders + /// Billing email. Leave empty to load all records. + /// Billing last name. Leave empty to load all records. + /// Search in order notes. Leave empty to load all records. + /// Page index + /// Page size + /// Orders + public virtual IPagedList SearchOrders(int storeId = 0, + int vendorId = 0, int customerId = 0, + int productId = 0, int affiliateId = 0, int warehouseId = 0, + int billingCountryId = 0, string paymentMethodSystemName = null, + DateTime? createdFromUtc = null, DateTime? createdToUtc = null, + List osIds = null, List psIds = null, List ssIds = null, + string billingEmail = null, string billingLastName = "", + string orderNotes = null, int pageIndex = 0, int pageSize = int.MaxValue) + { + var query = _orderRepository.Table; + if (storeId > 0) + query = query.Where(o => o.StoreId == storeId); + if (vendorId > 0) + { + query = query + .Where(o => o.OrderItems + .Any(orderItem => orderItem.Product.VendorId == vendorId)); + } + if (customerId > 0) + query = query.Where(o => o.CustomerId == customerId); + if (productId > 0) + { + query = query + .Where(o => o.OrderItems + .Any(orderItem => orderItem.Product.Id == productId)); + } + if (warehouseId > 0) + { + var manageStockInventoryMethodId = (int)ManageInventoryMethod.ManageStock; + query = query + .Where(o => o.OrderItems + .Any(orderItem => + //"Use multiple warehouses" enabled + //we search in each warehouse + (orderItem.Product.ManageInventoryMethodId == manageStockInventoryMethodId && + orderItem.Product.UseMultipleWarehouses && + orderItem.Product.ProductWarehouseInventory.Any(pwi => pwi.WarehouseId == warehouseId)) + || + //"Use multiple warehouses" disabled + //we use standard "warehouse" property + ((orderItem.Product.ManageInventoryMethodId != manageStockInventoryMethodId || + !orderItem.Product.UseMultipleWarehouses) && + orderItem.Product.WarehouseId == warehouseId)) + ); + } + if (billingCountryId > 0) + query = query.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId); + if (!String.IsNullOrEmpty(paymentMethodSystemName)) + query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); + if (affiliateId > 0) + query = query.Where(o => o.AffiliateId == affiliateId); + if (createdFromUtc.HasValue) + query = query.Where(o => createdFromUtc.Value <= o.CreatedOnUtc); + if (createdToUtc.HasValue) + query = query.Where(o => createdToUtc.Value >= o.CreatedOnUtc); + if (osIds != null && osIds.Any()) + query = query.Where(o => osIds.Contains(o.OrderStatusId)); + if (psIds != null && psIds.Any()) + query = query.Where(o => psIds.Contains(o.PaymentStatusId)); + if (ssIds != null && ssIds.Any()) + query = query.Where(o => ssIds.Contains(o.ShippingStatusId)); + if (!String.IsNullOrEmpty(billingEmail)) + query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail)); + if (!String.IsNullOrEmpty(billingLastName)) + query = query.Where(o => o.BillingAddress != null && !String.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName)); + if (!String.IsNullOrEmpty(orderNotes)) + query = query.Where(o => o.OrderNotes.Any(on => on.Note.Contains(orderNotes))); + query = query.Where(o => !o.Deleted); + query = query.OrderByDescending(o => o.CreatedOnUtc); + + //database layer paging + return new PagedList(query, pageIndex, pageSize); + } + + /// + /// Inserts an order + /// + /// Order + public virtual void InsertOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + _orderRepository.Insert(order); + + //event notification + _eventPublisher.EntityInserted(order); + } + + /// + /// Updates the order + /// + /// The order + public virtual void UpdateOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + _orderRepository.Update(order); + + //event notification + _eventPublisher.EntityUpdated(order); + } + + /// + /// Get an order by authorization transaction ID and payment method system name + /// + /// Authorization transaction ID + /// Payment method system name + /// Order + public virtual Order GetOrderByAuthorizationTransactionIdAndPaymentMethod(string authorizationTransactionId, + string paymentMethodSystemName) + { + var query = _orderRepository.Table; + if (!String.IsNullOrWhiteSpace(authorizationTransactionId)) + query = query.Where(o => o.AuthorizationTransactionId == authorizationTransactionId); + + if (!String.IsNullOrWhiteSpace(paymentMethodSystemName)) + query = query.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName); + + query = query.OrderByDescending(o => o.CreatedOnUtc); + var order = query.FirstOrDefault(); + return order; + } + + /// + /// Get all orders to whom an invoice id should be assigned + /// + /// Order + public virtual IList GetOrdersToAssignInvoiceId() + { + + var query = from o in _orderRepository.Table + where (o.InvoiceId == "ToBeAssigned") + select o; + var orders = query.ToList(); + + return orders; + } + #endregion + + #region Orders items + + /// + /// Gets an order item + /// + /// Order item identifier + /// Order item + public virtual OrderItem GetOrderItemById(int orderItemId) + { + if (orderItemId == 0) + return null; + + return _orderItemRepository.GetById(orderItemId); + } + + /// + /// Gets an item + /// + /// Order identifier + /// Order item + public virtual OrderItem GetOrderItemByGuid(Guid orderItemGuid) + { + if (orderItemGuid == Guid.Empty) + return null; + + var query = from orderItem in _orderItemRepository.Table + where orderItem.OrderItemGuid == orderItemGuid + select orderItem; + var item = query.FirstOrDefault(); + return item; + } + + /// + /// Gets all downloadable order items + /// + /// Customer identifier; null to load all records + /// Order items + public virtual IList GetDownloadableOrderItems(int customerId) + { + if (customerId == 0) + throw new ArgumentOutOfRangeException("customerId"); + + var query = from orderItem in _orderItemRepository.Table + join o in _orderRepository.Table on orderItem.OrderId equals o.Id + join p in _productRepository.Table on orderItem.ProductId equals p.Id + where customerId == o.CustomerId && + p.IsDownload && + !o.Deleted + orderby o.CreatedOnUtc descending, orderItem.Id + select orderItem; + + var orderItems = query.ToList(); + return orderItems; + } + + /// + /// Delete an order item + /// + /// The order item + public virtual void DeleteOrderItem(OrderItem orderItem) + { + if (orderItem == null) + throw new ArgumentNullException("orderItem"); + + _orderItemRepository.Delete(orderItem); + + //event notification + _eventPublisher.EntityDeleted(orderItem); + } + + #endregion + + #region Orders notes + + /// + /// Gets an order note + /// + /// The order note identifier + /// Order note + public virtual OrderNote GetOrderNoteById(int orderNoteId) + { + if (orderNoteId == 0) + return null; + + return _orderNoteRepository.GetById(orderNoteId); + } + + /// + /// Deletes an order note + /// + /// The order note + public virtual void DeleteOrderNote(OrderNote orderNote) + { + if (orderNote == null) + throw new ArgumentNullException("orderNote"); + + _orderNoteRepository.Delete(orderNote); + + //event notification + _eventPublisher.EntityDeleted(orderNote); + } + + #endregion + + #region Recurring payments + + /// + /// Deletes a recurring payment + /// + /// Recurring payment + public virtual void DeleteRecurringPayment(RecurringPayment recurringPayment) + { + if (recurringPayment == null) + throw new ArgumentNullException("recurringPayment"); + + recurringPayment.Deleted = true; + UpdateRecurringPayment(recurringPayment); + + //event notification + _eventPublisher.EntityDeleted(recurringPayment); + } + + /// + /// Gets a recurring payment + /// + /// The recurring payment identifier + /// Recurring payment + public virtual RecurringPayment GetRecurringPaymentById(int recurringPaymentId) + { + if (recurringPaymentId == 0) + return null; + + return _recurringPaymentRepository.GetById(recurringPaymentId); + } + + /// + /// Inserts a recurring payment + /// + /// Recurring payment + public virtual void InsertRecurringPayment(RecurringPayment recurringPayment) + { + if (recurringPayment == null) + throw new ArgumentNullException("recurringPayment"); + + _recurringPaymentRepository.Insert(recurringPayment); + + //event notification + _eventPublisher.EntityInserted(recurringPayment); + } + + /// + /// Updates the recurring payment + /// + /// Recurring payment + public virtual void UpdateRecurringPayment(RecurringPayment recurringPayment) + { + if (recurringPayment == null) + throw new ArgumentNullException("recurringPayment"); + + _recurringPaymentRepository.Update(recurringPayment); + + //event notification + _eventPublisher.EntityUpdated(recurringPayment); + } + + /// + /// Search recurring payments + /// + /// The store identifier; 0 to load all records + /// The customer identifier; 0 to load all records + /// The initial order identifier; 0 to load all records + /// Initial order status identifier; null to load all records + /// Page index + /// Page size + /// A value indicating whether to show hidden records + /// Recurring payments + public virtual IPagedList SearchRecurringPayments(int storeId = 0, + int customerId = 0, int initialOrderId = 0, OrderStatus? initialOrderStatus = null, + int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false) + { + int? initialOrderStatusId = null; + if (initialOrderStatus.HasValue) + initialOrderStatusId = (int)initialOrderStatus.Value; + + var query1 = from rp in _recurringPaymentRepository.Table + join c in _customerRepository.Table on rp.InitialOrder.CustomerId equals c.Id + where + (!rp.Deleted) && + (showHidden || !rp.InitialOrder.Deleted) && + (showHidden || !c.Deleted) && + (showHidden || rp.IsActive) && + (customerId == 0 || rp.InitialOrder.CustomerId == customerId) && + (storeId == 0 || rp.InitialOrder.StoreId == storeId) && + (initialOrderId == 0 || rp.InitialOrder.Id == initialOrderId) && + (!initialOrderStatusId.HasValue || initialOrderStatusId.Value == 0 || rp.InitialOrder.OrderStatusId == initialOrderStatusId.Value) + select rp.Id; + + var query2 = from rp in _recurringPaymentRepository.Table + where query1.Contains(rp.Id) + orderby rp.StartDateUtc, rp.Id + select rp; + + var recurringPayments = new PagedList(query2, pageIndex, pageSize); + return recurringPayments; + } + + #endregion + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/OrderTotalCalculationService.cs b/src/Libraries/Nop.Services/Orders/OrderTotalCalculationService.cs index 5af55fdec13..0e53e93d3fe 100644 --- a/src/Libraries/Nop.Services/Orders/OrderTotalCalculationService.cs +++ b/src/Libraries/Nop.Services/Orders/OrderTotalCalculationService.cs @@ -1,1429 +1,1235 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Discounts; -using Nop.Services.Payments; -using Nop.Services.Shipping; -using Nop.Services.Tax; - -namespace Nop.Services.Orders -{ - /// - /// Order service - /// - public partial class OrderTotalCalculationService : IOrderTotalCalculationService - { - #region Fields - - private readonly IWorkContext _workContext; - private readonly IStoreContext _storeContext; - private readonly IPriceCalculationService _priceCalculationService; - private readonly ITaxService _taxService; - private readonly IShippingService _shippingService; - private readonly IPaymentService _paymentService; - private readonly ICheckoutAttributeParser _checkoutAttributeParser; - private readonly IDiscountService _discountService; - private readonly IGiftCardService _giftCardService; - private readonly IGenericAttributeService _genericAttributeService; - private readonly IRewardPointService _rewardPointService; - private readonly TaxSettings _taxSettings; - private readonly RewardPointsSettings _rewardPointsSettings; - private readonly ShippingSettings _shippingSettings; - private readonly ShoppingCartSettings _shoppingCartSettings; - private readonly CatalogSettings _catalogSettings; - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Work context - /// Store context - /// Price calculation service - /// Tax service - /// Shipping service - /// Payment service - /// Checkout attribute parser - /// Discount service - /// Gift card service - /// Generic attribute service - /// Reward point service - /// Tax settings - /// Reward points settings - /// Shipping settings - /// Shopping cart settings - /// Catalog settings - public OrderTotalCalculationService(IWorkContext workContext, - IStoreContext storeContext, - IPriceCalculationService priceCalculationService, - ITaxService taxService, - IShippingService shippingService, - IPaymentService paymentService, - ICheckoutAttributeParser checkoutAttributeParser, - IDiscountService discountService, - IGiftCardService giftCardService, - IGenericAttributeService genericAttributeService, - IRewardPointService rewardPointService, - TaxSettings taxSettings, - RewardPointsSettings rewardPointsSettings, - ShippingSettings shippingSettings, - ShoppingCartSettings shoppingCartSettings, - CatalogSettings catalogSettings) - { - this._workContext = workContext; - this._storeContext = storeContext; - this._priceCalculationService = priceCalculationService; - this._taxService = taxService; - this._shippingService = shippingService; - this._paymentService = paymentService; - this._checkoutAttributeParser = checkoutAttributeParser; - this._discountService = discountService; - this._giftCardService = giftCardService; - this._genericAttributeService = genericAttributeService; - this._rewardPointService = rewardPointService; - this._taxSettings = taxSettings; - this._rewardPointsSettings = rewardPointsSettings; - this._shippingSettings = shippingSettings; - this._shoppingCartSettings = shoppingCartSettings; - this._catalogSettings = catalogSettings; - } - - #endregion - - #region Utilities - - /// - /// Gets an order discount (applied to order subtotal) - /// - /// Customer - /// Order subtotal - /// Applied discounts - /// Order discount - protected virtual decimal GetOrderSubtotalDiscount(Customer customer, - decimal orderSubTotal, out List appliedDiscounts) - { - appliedDiscounts = new List(); - decimal discountAmount = decimal.Zero; - if (_catalogSettings.IgnoreDiscounts) - return discountAmount; - - var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal); - var allowedDiscounts = new List(); - if (allDiscounts != null) - foreach (var discount in allDiscounts) - if (_discountService.ValidateDiscount(discount, customer).IsValid && - !allowedDiscounts.ContainsDiscount(discount)) - { - allowedDiscounts.Add(discount); - } - - appliedDiscounts = allowedDiscounts.GetPreferredDiscount(orderSubTotal, out discountAmount); - - if (discountAmount < decimal.Zero) - discountAmount = decimal.Zero; - - return discountAmount; - } - - /// - /// Gets a shipping discount - /// - /// Customer - /// Shipping total - /// Applied discounts - /// Shipping discount - protected virtual decimal GetShippingDiscount(Customer customer, decimal shippingTotal, out List appliedDiscounts) - { - appliedDiscounts = new List(); - decimal shippingDiscountAmount = decimal.Zero; - if (_catalogSettings.IgnoreDiscounts) - return shippingDiscountAmount; - - var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToShipping); - var allowedDiscounts = new List(); - if (allDiscounts != null) - foreach (var discount in allDiscounts) - if (_discountService.ValidateDiscount(discount, customer).IsValid && - !allowedDiscounts.ContainsDiscount(discount)) - { - allowedDiscounts.Add(discount); - } - - appliedDiscounts = allowedDiscounts.GetPreferredDiscount(shippingTotal, out shippingDiscountAmount); - - if (shippingDiscountAmount < decimal.Zero) - shippingDiscountAmount = decimal.Zero; - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - shippingDiscountAmount = RoundingHelper.RoundPrice(shippingDiscountAmount); - - return shippingDiscountAmount; - } - - /// - /// Gets an order discount (applied to order total) - /// - /// Customer - /// Order total - /// Applied discounts - /// Order discount - protected virtual decimal GetOrderTotalDiscount(Customer customer, decimal orderTotal, out List appliedDiscounts) - { - appliedDiscounts = new List(); - decimal discountAmount = decimal.Zero; - if (_catalogSettings.IgnoreDiscounts) - return discountAmount; - - var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToOrderTotal); - var allowedDiscounts = new List(); - if (allDiscounts != null) - foreach (var discount in allDiscounts) - if (_discountService.ValidateDiscount(discount, customer).IsValid && - !allowedDiscounts.ContainsDiscount(discount)) - { - allowedDiscounts.Add(discount); - } - - appliedDiscounts = allowedDiscounts.GetPreferredDiscount(orderTotal, out discountAmount); - - if (discountAmount < decimal.Zero) - discountAmount = decimal.Zero; - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - discountAmount = RoundingHelper.RoundPrice(discountAmount); - - return discountAmount; - } - - #endregion - - #region Methods - - /// - /// Gets shopping cart subtotal - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied discount amount - /// Applied discounts - /// Sub total (without discount) - /// Sub total (with discount) - public virtual void GetShoppingCartSubTotal(IList cart, - bool includingTax, - out decimal discountAmount, out List appliedDiscounts, - out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount) - { - SortedDictionary taxRates; - GetShoppingCartSubTotal(cart, includingTax, - out discountAmount, out appliedDiscounts, - out subTotalWithoutDiscount, out subTotalWithDiscount, out taxRates); - } - - /// - /// Gets shopping cart subtotal - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied discount amount - /// Applied discounts - /// Sub total (without discount) - /// Sub total (with discount) - /// Tax rates (of order sub total) - public virtual void GetShoppingCartSubTotal(IList cart, - bool includingTax, - out decimal discountAmount, out List appliedDiscounts, - out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount, - out SortedDictionary taxRates) - { - discountAmount = decimal.Zero; - appliedDiscounts = new List(); - subTotalWithoutDiscount = decimal.Zero; - subTotalWithDiscount = decimal.Zero; - taxRates = new SortedDictionary(); - - if (!cart.Any()) - return; - - //get the customer - Customer customer = cart.GetCustomer(); - - //sub totals - decimal subTotalExclTaxWithoutDiscount = decimal.Zero; - decimal subTotalInclTaxWithoutDiscount = decimal.Zero; - foreach (var shoppingCartItem in cart) - { - decimal sciSubTotal = _priceCalculationService.GetSubTotal(shoppingCartItem); - - decimal taxRate; - decimal sciExclTax = _taxService.GetProductPrice(shoppingCartItem.Product, sciSubTotal, false, customer, out taxRate); - decimal sciInclTax = _taxService.GetProductPrice(shoppingCartItem.Product, sciSubTotal, true, customer, out taxRate); - subTotalExclTaxWithoutDiscount += sciExclTax; - subTotalInclTaxWithoutDiscount += sciInclTax; - - //tax rates - decimal sciTax = sciInclTax - sciExclTax; - if (taxRate > decimal.Zero && sciTax > decimal.Zero) - { - if (!taxRates.ContainsKey(taxRate)) - { - taxRates.Add(taxRate, sciTax); - } - else - { - taxRates[taxRate] = taxRates[taxRate] + sciTax; - } - } - } - - //checkout attributes - if (customer != null) - { - var checkoutAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, _genericAttributeService, _storeContext.CurrentStore.Id); - var attributeValues = _checkoutAttributeParser.ParseCheckoutAttributeValues(checkoutAttributesXml); - if (attributeValues != null) - { - foreach (var attributeValue in attributeValues) - { - decimal taxRate; - - decimal caExclTax = _taxService.GetCheckoutAttributePrice(attributeValue, false, customer, out taxRate); - decimal caInclTax = _taxService.GetCheckoutAttributePrice(attributeValue, true, customer, out taxRate); - subTotalExclTaxWithoutDiscount += caExclTax; - subTotalInclTaxWithoutDiscount += caInclTax; - - //tax rates - decimal caTax = caInclTax - caExclTax; - if (taxRate > decimal.Zero && caTax > decimal.Zero) - { - if (!taxRates.ContainsKey(taxRate)) - { - taxRates.Add(taxRate, caTax); - } - else - { - taxRates[taxRate] = taxRates[taxRate] + caTax; - } - } - } - } - } - - //subtotal without discount - subTotalWithoutDiscount = includingTax ? subTotalInclTaxWithoutDiscount : subTotalExclTaxWithoutDiscount; - if (subTotalWithoutDiscount < decimal.Zero) - subTotalWithoutDiscount = decimal.Zero; - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - subTotalWithoutDiscount = RoundingHelper.RoundPrice(subTotalWithoutDiscount); - - //We calculate discount amount on order subtotal excl tax (discount first) - //calculate discount amount ('Applied to order subtotal' discount) - decimal discountAmountExclTax = GetOrderSubtotalDiscount(customer, subTotalExclTaxWithoutDiscount, out appliedDiscounts); - if (subTotalExclTaxWithoutDiscount < discountAmountExclTax) - discountAmountExclTax = subTotalExclTaxWithoutDiscount; - decimal discountAmountInclTax = discountAmountExclTax; - //subtotal with discount (excl tax) - decimal subTotalExclTaxWithDiscount = subTotalExclTaxWithoutDiscount - discountAmountExclTax; - decimal subTotalInclTaxWithDiscount = subTotalExclTaxWithDiscount; - - //add tax for shopping items & checkout attributes - var tempTaxRates = new Dictionary(taxRates); - foreach (KeyValuePair kvp in tempTaxRates) - { - decimal taxRate = kvp.Key; - decimal taxValue = kvp.Value; - - if (taxValue != decimal.Zero) - { - //discount the tax amount that applies to subtotal items - if (subTotalExclTaxWithoutDiscount > decimal.Zero) - { - decimal discountTax = taxRates[taxRate] * (discountAmountExclTax / subTotalExclTaxWithoutDiscount); - discountAmountInclTax += discountTax; - taxValue = taxRates[taxRate] - discountTax; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - taxValue = RoundingHelper.RoundPrice(taxValue); - taxRates[taxRate] = taxValue; - } - - //subtotal with discount (incl tax) - subTotalInclTaxWithDiscount += taxValue; - } - } - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - { - discountAmountInclTax = RoundingHelper.RoundPrice(discountAmountInclTax); - discountAmountExclTax = RoundingHelper.RoundPrice(discountAmountExclTax); - } - - if (includingTax) - { - subTotalWithDiscount = subTotalInclTaxWithDiscount; - discountAmount = discountAmountInclTax; - } - else - { - subTotalWithDiscount = subTotalExclTaxWithDiscount; - discountAmount = discountAmountExclTax; - } - - if (subTotalWithDiscount < decimal.Zero) - subTotalWithDiscount = decimal.Zero; - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - subTotalWithDiscount = RoundingHelper.RoundPrice(subTotalWithDiscount); - } - - /// - /// Update order totals - /// - /// Parameters for the updating order - /// Shopping cart - public virtual void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters, IList restoredCart) - { - var updatedOrder = updateOrderParameters.UpdatedOrder; - var updatedOrderItem = updateOrderParameters.UpdatedOrderItem; - - //get the customer - var customer = restoredCart.GetCustomer(); - - #region Sub total - - var subTotalExclTax = decimal.Zero; - var subTotalInclTax = decimal.Zero; - var subTotalTaxRates = new SortedDictionary(); - - foreach (var shoppingCartItem in restoredCart) - { - var itemSubTotalExclTax = decimal.Zero; - var itemSubTotalInclTax = decimal.Zero; - var taxRate = decimal.Zero; - var itemDiscounts = new List(); - - //calculate subtotal for the updated order item - if (shoppingCartItem.Id == updatedOrderItem.Id) - { - //update order item - updatedOrderItem.UnitPriceExclTax = updateOrderParameters.PriceExclTax; - updatedOrderItem.UnitPriceInclTax = updateOrderParameters.PriceInclTax; - updatedOrderItem.DiscountAmountExclTax = updateOrderParameters.DiscountAmountExclTax; - updatedOrderItem.DiscountAmountInclTax = updateOrderParameters.DiscountAmountInclTax; - updatedOrderItem.PriceExclTax = itemSubTotalExclTax = updateOrderParameters.SubTotalExclTax; - updatedOrderItem.PriceInclTax = itemSubTotalInclTax = updateOrderParameters.SubTotalInclTax; - updatedOrderItem.Quantity = shoppingCartItem.Quantity; - - taxRate = Math.Round((100 * (itemSubTotalInclTax - itemSubTotalExclTax)) / itemSubTotalExclTax, 3); - } - else - { - //get the already calculated subtotal from the order item - itemSubTotalExclTax = updatedOrder.OrderItems.FirstOrDefault(item => item.Id == shoppingCartItem.Id).PriceExclTax; - itemSubTotalInclTax = updatedOrder.OrderItems.FirstOrDefault(item => item.Id == shoppingCartItem.Id).PriceInclTax; - taxRate = Math.Round((100 * (itemSubTotalInclTax - itemSubTotalExclTax)) / itemSubTotalExclTax, 3); - } - - foreach (var discount in itemDiscounts) - if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) - updateOrderParameters.AppliedDiscounts.Add(discount); - - subTotalExclTax += itemSubTotalExclTax; - subTotalInclTax += itemSubTotalInclTax; - - //tax rates - var itemTaxValue = itemSubTotalInclTax - itemSubTotalExclTax; - if (taxRate > decimal.Zero && itemTaxValue > decimal.Zero) - { - if (!subTotalTaxRates.ContainsKey(taxRate)) - subTotalTaxRates.Add(taxRate, itemTaxValue); - else - subTotalTaxRates[taxRate] = subTotalTaxRates[taxRate] + itemTaxValue; - } - } - - if (subTotalExclTax < decimal.Zero) - subTotalExclTax = decimal.Zero; - - if (subTotalInclTax < decimal.Zero) - subTotalInclTax = decimal.Zero; - - //We calculate discount amount on order subtotal excl tax (discount first) - //calculate discount amount ('Applied to order subtotal' discount) - List subTotalDiscounts; - var discountAmountExclTax = GetOrderSubtotalDiscount(customer, subTotalExclTax, out subTotalDiscounts); - if (subTotalExclTax < discountAmountExclTax) - discountAmountExclTax = subTotalExclTax; - var discountAmountInclTax = discountAmountExclTax; - - //add tax for shopping items - var tempTaxRates = new Dictionary(subTotalTaxRates); - foreach (var kvp in tempTaxRates) - { - if (kvp.Value != decimal.Zero && subTotalExclTax > decimal.Zero) - { - var discountTaxValue = kvp.Value * (discountAmountExclTax / subTotalExclTax); - discountAmountInclTax += discountTaxValue; - subTotalTaxRates[kvp.Key] = kvp.Value - discountTaxValue; - } - } - - //rounding - if (_shoppingCartSettings.RoundPricesDuringCalculation) - { - subTotalExclTax = RoundingHelper.RoundPrice(subTotalExclTax); - subTotalInclTax = RoundingHelper.RoundPrice(subTotalInclTax); - discountAmountExclTax = RoundingHelper.RoundPrice(discountAmountExclTax); - discountAmountInclTax = RoundingHelper.RoundPrice(discountAmountInclTax); - } - - updatedOrder.OrderSubtotalExclTax = subTotalExclTax; - updatedOrder.OrderSubtotalInclTax = subTotalInclTax; - updatedOrder.OrderSubTotalDiscountExclTax = discountAmountExclTax; - updatedOrder.OrderSubTotalDiscountInclTax = discountAmountInclTax; - - foreach (var discount in subTotalDiscounts) - if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) - updateOrderParameters.AppliedDiscounts.Add(discount); - - #endregion - - #region Shipping - - var shippingTotalExclTax = decimal.Zero; - var shippingTotalInclTax = decimal.Zero; - var shippingTaxRate = decimal.Zero; - - if (restoredCart.RequiresShipping()) - { - if (!IsFreeShipping(restoredCart, _shippingSettings.FreeShippingOverXIncludingTax ? subTotalInclTax : subTotalExclTax)) - { - var shippingTotal = decimal.Zero; - if (!string.IsNullOrEmpty(updatedOrder.ShippingRateComputationMethodSystemName)) - { - //in the updated order were shipping items - if (updatedOrder.PickUpInStore) - { - //customer chose pickup in store method, try to get chosen pickup point - if (_shippingSettings.AllowPickUpInStore) - { - var pickupPointsResponse = _shippingService.GetPickupPoints(updatedOrder.BillingAddress, updatedOrder.Customer, - updatedOrder.ShippingRateComputationMethodSystemName, _storeContext.CurrentStore.Id); - if (pickupPointsResponse.Success) - { - var selectedPickupPoint = pickupPointsResponse.PickupPoints.FirstOrDefault(point => updatedOrder.ShippingMethod.Contains(point.Name)); - if (selectedPickupPoint != null) - shippingTotal = selectedPickupPoint.PickupFee; - else - updateOrderParameters.Warnings.Add(string.Format("Shipping method {0} could not be loaded", updatedOrder.ShippingMethod)); - } - else - updateOrderParameters.Warnings.AddRange(pickupPointsResponse.Errors); - } - else - updateOrderParameters.Warnings.Add("Pick up in store is not available"); - } - else - { - //customer chose shipping to address, try to get chosen shipping option - var shippingOptionsResponse = _shippingService.GetShippingOptions(restoredCart, - updatedOrder.ShippingAddress, updatedOrder.Customer, updatedOrder.ShippingRateComputationMethodSystemName, _storeContext.CurrentStore.Id); - if (shippingOptionsResponse.Success) - { - var shippingOption = shippingOptionsResponse.ShippingOptions.FirstOrDefault(option => updatedOrder.ShippingMethod.Contains(option.Name)); - if (shippingOption != null) - shippingTotal = shippingOption.Rate; - else - updateOrderParameters.Warnings.Add(string.Format("Shipping method {0} could not be loaded", updatedOrder.ShippingMethod)); - } - else - updateOrderParameters.Warnings.AddRange(shippingOptionsResponse.Errors); - } - } - else - { - //before updating order was without shipping - if (_shippingSettings.AllowPickUpInStore) - { - //try to get the cheapest pickup point - var pickupPointsResponse = _shippingService.GetPickupPoints(updatedOrder.BillingAddress, _workContext.CurrentCustomer, storeId: _storeContext.CurrentStore.Id); - if (pickupPointsResponse.Success) - { - updateOrderParameters.PickupPoint = pickupPointsResponse.PickupPoints.OrderBy(point => point.PickupFee).First(); - shippingTotal = updateOrderParameters.PickupPoint.PickupFee; - } - else - updateOrderParameters.Warnings.AddRange(pickupPointsResponse.Errors); - } - else - updateOrderParameters.Warnings.Add("Pick up in store is not available"); - - if (updateOrderParameters.PickupPoint == null) - { - //or try to get the cheapest shipping option for the shipping to the customer address - var shippingRateComputationMethods = _shippingService.LoadActiveShippingRateComputationMethods(_workContext.CurrentCustomer, _storeContext.CurrentStore.Id); - if (shippingRateComputationMethods.Any()) - { - var shippingOptionsResponse = _shippingService.GetShippingOptions(restoredCart, customer.ShippingAddress, _workContext.CurrentCustomer, storeId: _storeContext.CurrentStore.Id); - if (shippingOptionsResponse.Success) - { - var shippingOption = shippingOptionsResponse.ShippingOptions.OrderBy(option => option.Rate).First(); - updatedOrder.ShippingRateComputationMethodSystemName = shippingOption.ShippingRateComputationMethodSystemName; - updatedOrder.ShippingMethod = shippingOption.Name; - updatedOrder.ShippingAddress = (Address)customer.ShippingAddress.Clone(); - shippingTotal = shippingOption.Rate; - } - else - updateOrderParameters.Warnings.AddRange(shippingOptionsResponse.Errors); - } - else - updateOrderParameters.Warnings.Add("Shipping rate computation method could not be loaded"); - } - } - - //additional shipping charge - shippingTotal += restoredCart.Where(item => item.IsShipEnabled && !item.IsFreeShipping).Sum(item => item.Product.AdditionalShippingCharge); - - //shipping discounts - List shippingTotalDiscounts; - shippingTotal -= GetShippingDiscount(customer, shippingTotal, out shippingTotalDiscounts); - if (shippingTotal < decimal.Zero) - shippingTotal = decimal.Zero; - - shippingTotalExclTax = _taxService.GetShippingPrice(shippingTotal, false, customer); - shippingTotalInclTax = _taxService.GetShippingPrice(shippingTotal, true, customer, out shippingTaxRate); - - //rounding - if (_shoppingCartSettings.RoundPricesDuringCalculation) - { - shippingTotalExclTax = RoundingHelper.RoundPrice(shippingTotalExclTax); - shippingTotalInclTax = RoundingHelper.RoundPrice(shippingTotalInclTax); - } - - //change shipping status - if (updatedOrder.ShippingStatus == ShippingStatus.ShippingNotRequired || updatedOrder.ShippingStatus == ShippingStatus.NotYetShipped) - updatedOrder.ShippingStatus = ShippingStatus.NotYetShipped; - else - updatedOrder.ShippingStatus = ShippingStatus.PartiallyShipped; - - foreach (var discount in shippingTotalDiscounts) - if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) - updateOrderParameters.AppliedDiscounts.Add(discount); - } - } - else - updatedOrder.ShippingStatus = ShippingStatus.ShippingNotRequired; - - updatedOrder.OrderShippingExclTax = shippingTotalExclTax; - updatedOrder.OrderShippingInclTax = shippingTotalInclTax; - - #endregion - - #region Tax rates - - var taxRates = new SortedDictionary(); - - //order subtotal taxes - var subTotalTax = decimal.Zero; - foreach (var kvp in subTotalTaxRates) - { - subTotalTax += kvp.Value; - if (kvp.Key > decimal.Zero && kvp.Value > decimal.Zero) - { - if (!taxRates.ContainsKey(kvp.Key)) - taxRates.Add(kvp.Key, kvp.Value); - else - taxRates[kvp.Key] = taxRates[kvp.Key] + kvp.Value; - } - } - - //shipping taxes - var shippingTax = decimal.Zero; - if (_taxSettings.ShippingIsTaxable) - { - shippingTax = shippingTotalInclTax - shippingTotalExclTax; - if (shippingTax < decimal.Zero) - shippingTax = decimal.Zero; - - if (shippingTaxRate > decimal.Zero && shippingTax > decimal.Zero) - { - if (!taxRates.ContainsKey(shippingTaxRate)) - taxRates.Add(shippingTaxRate, shippingTax); - else - taxRates[shippingTaxRate] = taxRates[shippingTaxRate] + shippingTax; - } - } - - //payment method additional fee tax - var paymentMethodAdditionalFeeTax = decimal.Zero; - if (_taxSettings.PaymentMethodAdditionalFeeIsTaxable) - { - paymentMethodAdditionalFeeTax = updatedOrder.PaymentMethodAdditionalFeeInclTax - updatedOrder.PaymentMethodAdditionalFeeExclTax; - if (paymentMethodAdditionalFeeTax < decimal.Zero) - paymentMethodAdditionalFeeTax = decimal.Zero; - - if (updatedOrder.PaymentMethodAdditionalFeeExclTax > decimal.Zero) - { - var paymentTaxRate = Math.Round(100 * paymentMethodAdditionalFeeTax / updatedOrder.PaymentMethodAdditionalFeeExclTax, 3); - if (paymentTaxRate > decimal.Zero && paymentMethodAdditionalFeeTax > decimal.Zero) - { - if (!taxRates.ContainsKey(paymentTaxRate)) - taxRates.Add(paymentTaxRate, paymentMethodAdditionalFeeTax); - else - taxRates[paymentTaxRate] = taxRates[paymentTaxRate] + paymentMethodAdditionalFeeTax; - } - } - } - - //add at least one tax rate (0%) - if (!taxRates.Any()) - taxRates.Add(decimal.Zero, decimal.Zero); - - //summarize taxes - var taxTotal = subTotalTax + shippingTax + paymentMethodAdditionalFeeTax; - if (taxTotal < decimal.Zero) - taxTotal = decimal.Zero; - - //round tax - if (_shoppingCartSettings.RoundPricesDuringCalculation) - taxTotal = RoundingHelper.RoundPrice(taxTotal); - - updatedOrder.OrderTax = taxTotal; - updatedOrder.TaxRates = taxRates.Aggregate(string.Empty, (current, next) => - string.Format("{0}{1}:{2}; ", current, next.Key.ToString(CultureInfo.InvariantCulture), next.Value.ToString(CultureInfo.InvariantCulture))); - - #endregion - - #region Total - - var total = (subTotalExclTax - discountAmountExclTax) + shippingTotalExclTax + updatedOrder.PaymentMethodAdditionalFeeExclTax + taxTotal; - - //get discounts for the order total - List orderAppliedDiscounts; - var discountAmountTotal = GetOrderTotalDiscount(customer, total, out orderAppliedDiscounts); - if (total < discountAmountTotal) - discountAmountTotal = total; - total -= discountAmountTotal; - - //applied giftcards - foreach (var giftCard in _giftCardService.GetAllGiftCards(usedWithOrderId: updatedOrder.Id)) - { - if (total > decimal.Zero) - { - var remainingAmount = giftCard.GiftCardUsageHistory.Where(history => history.UsedWithOrderId == updatedOrder.Id).Sum(history => history.UsedValue); - var amountCanBeUsed = total > remainingAmount ? remainingAmount : total; - total -= amountCanBeUsed; - } - } - - //reward points - var rewardPointsOfOrder = _rewardPointService.GetRewardPointsHistory(customer.Id, true).FirstOrDefault(history => history.UsedWithOrder == updatedOrder); - if (rewardPointsOfOrder != null) - { - var rewardPoints = -rewardPointsOfOrder.Points; - var rewardPointsAmount = ConvertRewardPointsToAmount(rewardPoints); - if (total < rewardPointsAmount) - { - rewardPoints = ConvertAmountToRewardPoints(total); - rewardPointsAmount = total; - } - if (total > decimal.Zero) - total -= rewardPointsAmount; - - //uncomment here for the return unused reward points if new order total less redeemed reward points amount - //if (rewardPoints < -rewardPointsOfOrder.Points) - // _rewardPointService.AddRewardPointsHistoryEntry(customer, -rewardPointsOfOrder.Points - rewardPoints, _storeContext.CurrentStore.Id, "Return unused reward points"); - - if (rewardPointsAmount != rewardPointsOfOrder.UsedAmount) - { - rewardPointsOfOrder.UsedAmount = rewardPointsAmount; - rewardPointsOfOrder.Points = -rewardPoints; - _rewardPointService.UpdateRewardPointsHistoryEntry(rewardPointsOfOrder); - } - } - - //rounding - if (total < decimal.Zero) - total = decimal.Zero; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - total = RoundingHelper.RoundPrice(total); - - updatedOrder.OrderDiscount = discountAmountTotal; - updatedOrder.OrderTotal = total; - - foreach (var discount in orderAppliedDiscounts) - if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) - updateOrderParameters.AppliedDiscounts.Add(discount); - - #endregion - } - - /// - /// Gets shopping cart additional shipping charge - /// - /// Cart - /// Additional shipping charge - public virtual decimal GetShoppingCartAdditionalShippingCharge(IList cart) - { - decimal additionalShippingCharge = decimal.Zero; - - bool isFreeShipping = IsFreeShipping(cart); - if (isFreeShipping) - return decimal.Zero; - - foreach (var sci in cart) - if (sci.IsShipEnabled && !sci.IsFreeShipping) - additionalShippingCharge += sci.AdditionalShippingCharge; - - return additionalShippingCharge; - } - - /// - /// Gets a value indicating whether shipping is free - /// - /// Cart - /// Subtotal amount; pass null to calculate subtotal - /// A value indicating whether shipping is free - public virtual bool IsFreeShipping(IList cart, decimal? subTotal = null) - { - if (!cart.RequiresShipping()) - return true; - - //check whether customer is in a customer role with free shipping applied - var customer = cart.GetCustomer(); - if (customer != null && customer.CustomerRoles.Where(role => role.Active).Any(role => role.FreeShipping)) - return true; - - //check whether all shopping cart items are marked as free shipping - if (cart.All(item => item.IsShipEnabled && item.IsFreeShipping)) - return true; - - //free shipping over $X - if (_shippingSettings.FreeShippingOverXEnabled) - { - if (!subTotal.HasValue) - { - decimal discountAmount; - List appliedDiscounts; - decimal subTotalWithoutDiscount; - decimal subTotalWithDiscount; - GetShoppingCartSubTotal(cart, _shippingSettings.FreeShippingOverXIncludingTax, out discountAmount, - out appliedDiscounts, out subTotalWithoutDiscount, out subTotalWithDiscount); - subTotal = subTotalWithDiscount; - } - - //check whether we have subtotal enough to have free shipping - if (subTotal.Value > _shippingSettings.FreeShippingOverXValue) - return true; - } - - return false; - } - - /// - /// Adjust shipping rate (free shipping, additional charges, discounts) - /// - /// Shipping rate to adjust - /// Cart - /// Applied discounts - /// Adjusted shipping rate - public virtual decimal AdjustShippingRate(decimal shippingRate, - IList cart, out List appliedDiscounts) - { - appliedDiscounts = new List(); - - //free shipping - if (IsFreeShipping(cart)) - return decimal.Zero; - - //additional shipping charges - decimal additionalShippingCharge = GetShoppingCartAdditionalShippingCharge(cart); - var adjustedRate = shippingRate + additionalShippingCharge; - - //discount - var customer = cart.GetCustomer(); - decimal discountAmount = GetShippingDiscount(customer, adjustedRate, out appliedDiscounts); - adjustedRate = adjustedRate - discountAmount; - - if (adjustedRate < decimal.Zero) - adjustedRate = decimal.Zero; - - if (_shoppingCartSettings.RoundPricesDuringCalculation) - adjustedRate = RoundingHelper.RoundPrice(adjustedRate); - - return adjustedRate; - } - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// Shipping total - public virtual decimal? GetShoppingCartShippingTotal(IList cart) - { - bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return GetShoppingCartShippingTotal(cart, includingTax); - } - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Shipping total - public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax) - { - decimal taxRate; - return GetShoppingCartShippingTotal(cart, includingTax, out taxRate); - } - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied tax rate - /// Shipping total - public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, - out decimal taxRate) - { - List appliedDiscounts; - return GetShoppingCartShippingTotal(cart, includingTax, out taxRate, out appliedDiscounts); - } - - /// - /// Gets shopping cart shipping total - /// - /// Cart - /// A value indicating whether calculated price should include tax - /// Applied tax rate - /// Applied discounts - /// Shipping total - public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, - out decimal taxRate, out List appliedDiscounts) - { - decimal? shippingTotal = null; - decimal? shippingTotalTaxed = null; - appliedDiscounts = new List(); - taxRate = decimal.Zero; - - var customer = cart.GetCustomer(); - - bool isFreeShipping = IsFreeShipping(cart); - if (isFreeShipping) - return decimal.Zero; - - ShippingOption shippingOption = null; - if (customer != null) - shippingOption = customer.GetAttribute(SystemCustomerAttributeNames.SelectedShippingOption, _genericAttributeService, _storeContext.CurrentStore.Id); - - if (shippingOption != null) - { - //use last shipping option (get from cache) - shippingTotal = AdjustShippingRate(shippingOption.Rate, cart, out appliedDiscounts); - } - else - { - //use fixed rate (if possible) - Address shippingAddress = null; - if (customer != null) - shippingAddress = customer.ShippingAddress; - - var shippingRateComputationMethods = _shippingService.LoadActiveShippingRateComputationMethods(_workContext.CurrentCustomer, _storeContext.CurrentStore.Id); - if (!shippingRateComputationMethods.Any() && !_shippingSettings.AllowPickUpInStore) - throw new NopException("Shipping rate computation method could not be loaded"); - - if (shippingRateComputationMethods.Count == 1) - { - var shippingRateComputationMethod = shippingRateComputationMethods[0]; - - bool shippingFromMultipleLocations; - var shippingOptionRequests = _shippingService.CreateShippingOptionRequests(cart, - shippingAddress, - _storeContext.CurrentStore.Id, - out shippingFromMultipleLocations); - decimal? fixedRate = null; - foreach (var shippingOptionRequest in shippingOptionRequests) - { - //calculate fixed rates for each request-package - var fixedRateTmp = shippingRateComputationMethod.GetFixedRate(shippingOptionRequest); - if (fixedRateTmp.HasValue) - { - if (!fixedRate.HasValue) - fixedRate = decimal.Zero; - - fixedRate += fixedRateTmp.Value; - } - } - - if (fixedRate.HasValue) - { - //adjust shipping rate - shippingTotal = AdjustShippingRate(fixedRate.Value, cart, out appliedDiscounts); - } - } - } - - if (shippingTotal.HasValue) - { - if (shippingTotal.Value < decimal.Zero) - shippingTotal = decimal.Zero; - - //round - if (_shoppingCartSettings.RoundPricesDuringCalculation) - shippingTotal = RoundingHelper.RoundPrice(shippingTotal.Value); - - shippingTotalTaxed = _taxService.GetShippingPrice(shippingTotal.Value, - includingTax, - customer, - out taxRate); - - //round - if (_shoppingCartSettings.RoundPricesDuringCalculation) - shippingTotalTaxed = RoundingHelper.RoundPrice(shippingTotalTaxed.Value); - } - - return shippingTotalTaxed; - } - - - - - - /// - /// Gets tax - /// - /// Shopping cart - /// A value indicating whether we should use payment method additional fee when calculating tax - /// Tax total - public virtual decimal GetTaxTotal(IList cart, bool usePaymentMethodAdditionalFee = true) - { - if (cart == null) - throw new ArgumentNullException("cart"); - - SortedDictionary taxRates; - return GetTaxTotal(cart, out taxRates, usePaymentMethodAdditionalFee); - } - - /// - /// Gets tax - /// - /// Shopping cart - /// Tax rates - /// A value indicating whether we should use payment method additional fee when calculating tax - /// Tax total - public virtual decimal GetTaxTotal(IList cart, - out SortedDictionary taxRates, bool usePaymentMethodAdditionalFee = true) - { - if (cart == null) - throw new ArgumentNullException("cart"); - - taxRates = new SortedDictionary(); - - var customer = cart.GetCustomer(); - string paymentMethodSystemName = ""; - if (customer != null) - { - paymentMethodSystemName = customer.GetAttribute( - SystemCustomerAttributeNames.SelectedPaymentMethod, - _genericAttributeService, - _storeContext.CurrentStore.Id); - } - - //order sub total (items + checkout attributes) - decimal subTotalTaxTotal = decimal.Zero; - decimal orderSubTotalDiscountAmount; - List orderSubTotalAppliedDiscounts; - decimal subTotalWithoutDiscountBase; - decimal subTotalWithDiscountBase; - SortedDictionary orderSubTotalTaxRates; - GetShoppingCartSubTotal(cart, false, - out orderSubTotalDiscountAmount, out orderSubTotalAppliedDiscounts, - out subTotalWithoutDiscountBase, out subTotalWithDiscountBase, - out orderSubTotalTaxRates); - foreach (KeyValuePair kvp in orderSubTotalTaxRates) - { - decimal taxRate = kvp.Key; - decimal taxValue = kvp.Value; - subTotalTaxTotal += taxValue; - - if (taxRate > decimal.Zero && taxValue > decimal.Zero) - { - if (!taxRates.ContainsKey(taxRate)) - taxRates.Add(taxRate, taxValue); - else - taxRates[taxRate] = taxRates[taxRate] + taxValue; - } - } - - //shipping - decimal shippingTax = decimal.Zero; - if (_taxSettings.ShippingIsTaxable) - { - decimal taxRate; - decimal? shippingExclTax = GetShoppingCartShippingTotal(cart, false, out taxRate); - decimal? shippingInclTax = GetShoppingCartShippingTotal(cart, true, out taxRate); - if (shippingExclTax.HasValue && shippingInclTax.HasValue) - { - shippingTax = shippingInclTax.Value - shippingExclTax.Value; - //ensure that tax is equal or greater than zero - if (shippingTax < decimal.Zero) - shippingTax = decimal.Zero; - - //tax rates - if (taxRate > decimal.Zero && shippingTax > decimal.Zero) - { - if (!taxRates.ContainsKey(taxRate)) - taxRates.Add(taxRate, shippingTax); - else - taxRates[taxRate] = taxRates[taxRate] + shippingTax; - } - } - } - - //payment method additional fee - decimal paymentMethodAdditionalFeeTax = decimal.Zero; - if (usePaymentMethodAdditionalFee && _taxSettings.PaymentMethodAdditionalFeeIsTaxable) - { - decimal taxRate; - decimal paymentMethodAdditionalFee = _paymentService.GetAdditionalHandlingFee(cart, paymentMethodSystemName); - decimal paymentMethodAdditionalFeeExclTax = _taxService.GetPaymentMethodAdditionalFee(paymentMethodAdditionalFee, false, customer, out taxRate); - decimal paymentMethodAdditionalFeeInclTax = _taxService.GetPaymentMethodAdditionalFee(paymentMethodAdditionalFee, true, customer, out taxRate); - - paymentMethodAdditionalFeeTax = paymentMethodAdditionalFeeInclTax - paymentMethodAdditionalFeeExclTax; - //ensure that tax is equal or greater than zero - if (paymentMethodAdditionalFeeTax < decimal.Zero) - paymentMethodAdditionalFeeTax = decimal.Zero; - - //tax rates - if (taxRate > decimal.Zero && paymentMethodAdditionalFeeTax > decimal.Zero) - { - if (!taxRates.ContainsKey(taxRate)) - taxRates.Add(taxRate, paymentMethodAdditionalFeeTax); - else - taxRates[taxRate] = taxRates[taxRate] + paymentMethodAdditionalFeeTax; - } - } - - //add at least one tax rate (0%) - if (!taxRates.Any()) - taxRates.Add(decimal.Zero, decimal.Zero); - - //summarize taxes - decimal taxTotal = subTotalTaxTotal + shippingTax + paymentMethodAdditionalFeeTax; - //ensure that tax is equal or greater than zero - if (taxTotal < decimal.Zero) - taxTotal = decimal.Zero; - //round tax - if (_shoppingCartSettings.RoundPricesDuringCalculation) - taxTotal = RoundingHelper.RoundPrice(taxTotal); - return taxTotal; - } - - - - - - /// - /// Gets shopping cart total - /// - /// Cart - /// A value indicating reward points should be used; null to detect current choice of the customer - /// A value indicating whether we should use payment method additional fee when calculating order total - /// Shopping cart total;Null if shopping cart total couldn't be calculated now - public virtual decimal? GetShoppingCartTotal(IList cart, - bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true) - { - decimal discountAmount; - List appliedDiscounts; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - List appliedGiftCards; - return GetShoppingCartTotal(cart, - out discountAmount, - out appliedDiscounts, - out appliedGiftCards, - out redeemedRewardPoints, - out redeemedRewardPointsAmount, - useRewardPoints, - usePaymentMethodAdditionalFee); - } - - /// - /// Gets shopping cart total - /// - /// Cart - /// Applied gift cards - /// Applied discount amount - /// Applied discounts - /// Reward points to redeem - /// Reward points amount in primary store currency to redeem - /// A value indicating reward points should be used; null to detect current choice of the customer - /// A value indicating whether we should use payment method additional fee when calculating order total - /// Shopping cart total;Null if shopping cart total couldn't be calculated now - public virtual decimal? GetShoppingCartTotal(IList cart, - out decimal discountAmount, out List appliedDiscounts, - out List appliedGiftCards, - out int redeemedRewardPoints, out decimal redeemedRewardPointsAmount, - bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true) - { - redeemedRewardPoints = 0; - redeemedRewardPointsAmount = decimal.Zero; - - var customer = cart.GetCustomer(); - string paymentMethodSystemName = ""; - if (customer != null) - { - paymentMethodSystemName = customer.GetAttribute( - SystemCustomerAttributeNames.SelectedPaymentMethod, - _genericAttributeService, - _storeContext.CurrentStore.Id); - } - - - //subtotal without tax - decimal orderSubTotalDiscountAmount; - List orderSubTotalAppliedDiscounts; - decimal subTotalWithoutDiscountBase; - decimal subTotalWithDiscountBase; - GetShoppingCartSubTotal(cart, false, - out orderSubTotalDiscountAmount, out orderSubTotalAppliedDiscounts, - out subTotalWithoutDiscountBase, out subTotalWithDiscountBase); - //subtotal with discount - decimal subtotalBase = subTotalWithDiscountBase; - - - - //shipping without tax - decimal? shoppingCartShipping = GetShoppingCartShippingTotal(cart, false); - - - - //payment method additional fee without tax - decimal paymentMethodAdditionalFeeWithoutTax = decimal.Zero; - if (usePaymentMethodAdditionalFee && !String.IsNullOrEmpty(paymentMethodSystemName)) - { - decimal paymentMethodAdditionalFee = _paymentService.GetAdditionalHandlingFee(cart, - paymentMethodSystemName); - paymentMethodAdditionalFeeWithoutTax = - _taxService.GetPaymentMethodAdditionalFee(paymentMethodAdditionalFee, - false, customer); - } - - - - - //tax - decimal shoppingCartTax = GetTaxTotal(cart, usePaymentMethodAdditionalFee); - - - - - //order total - decimal resultTemp = decimal.Zero; - resultTemp += subtotalBase; - if (shoppingCartShipping.HasValue) - { - resultTemp += shoppingCartShipping.Value; - } - resultTemp += paymentMethodAdditionalFeeWithoutTax; - resultTemp += shoppingCartTax; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - resultTemp = RoundingHelper.RoundPrice(resultTemp); - - #region Order total discount - - discountAmount = GetOrderTotalDiscount(customer, resultTemp, out appliedDiscounts); - - //sub totals with discount - if (resultTemp < discountAmount) - discountAmount = resultTemp; - - //reduce subtotal - resultTemp -= discountAmount; - - if (resultTemp < decimal.Zero) - resultTemp = decimal.Zero; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - resultTemp = RoundingHelper.RoundPrice(resultTemp); - - #endregion - - #region Applied gift cards - - //let's apply gift cards now (gift cards that can be used) - appliedGiftCards = new List(); - if (!cart.IsRecurring()) - { - //we don't apply gift cards for recurring products - var giftCards = _giftCardService.GetActiveGiftCardsAppliedByCustomer(customer); - if (giftCards != null) - foreach (var gc in giftCards) - if (resultTemp > decimal.Zero) - { - decimal remainingAmount = gc.GetGiftCardRemainingAmount(); - decimal amountCanBeUsed = resultTemp > remainingAmount ? - remainingAmount : - resultTemp; - - //reduce subtotal - resultTemp -= amountCanBeUsed; - - var appliedGiftCard = new AppliedGiftCard(); - appliedGiftCard.GiftCard = gc; - appliedGiftCard.AmountCanBeUsed = amountCanBeUsed; - appliedGiftCards.Add(appliedGiftCard); - } - } - - #endregion - - if (resultTemp < decimal.Zero) - resultTemp = decimal.Zero; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - resultTemp = RoundingHelper.RoundPrice(resultTemp); - - if (!shoppingCartShipping.HasValue) - { - //we have errors - return null; - } - - decimal orderTotal = resultTemp; - - #region Reward points - - if (_rewardPointsSettings.Enabled) - { - if (!useRewardPoints.HasValue) - useRewardPoints = customer.GetAttribute(SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, _genericAttributeService, _storeContext.CurrentStore.Id); - if (useRewardPoints.Value) - { - - int rewardPointsBalance = _rewardPointService.GetRewardPointsBalance(customer.Id, _storeContext.CurrentStore.Id); - if (CheckMinimumRewardPointsToUseRequirement(rewardPointsBalance)) - { - decimal rewardPointsBalanceAmount = ConvertRewardPointsToAmount(rewardPointsBalance); - if (orderTotal > decimal.Zero) - { - if (orderTotal > rewardPointsBalanceAmount) - { - redeemedRewardPoints = rewardPointsBalance; - redeemedRewardPointsAmount = rewardPointsBalanceAmount; - } - else - { - redeemedRewardPointsAmount = orderTotal; - redeemedRewardPoints = ConvertAmountToRewardPoints(redeemedRewardPointsAmount); - } - } - } - } - } - - #endregion - - orderTotal = orderTotal - redeemedRewardPointsAmount; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - orderTotal = RoundingHelper.RoundPrice(orderTotal); - return orderTotal; - } - - - - - - /// - /// Converts existing reward points to amount - /// - /// Reward points - /// Converted value - public virtual decimal ConvertRewardPointsToAmount(int rewardPoints) - { - if (rewardPoints <= 0) - return decimal.Zero; - - var result = rewardPoints * _rewardPointsSettings.ExchangeRate; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - result = RoundingHelper.RoundPrice(result); - return result; - } - - /// - /// Converts an amount to reward points - /// - /// Amount - /// Converted value - public virtual int ConvertAmountToRewardPoints(decimal amount) - { - int result = 0; - if (amount <= 0) - return 0; - - if (_rewardPointsSettings.ExchangeRate > 0) - result = (int)Math.Ceiling(amount / _rewardPointsSettings.ExchangeRate); - return result; - } - - /// - /// Gets a value indicating whether a customer has minimum amount of reward points to use (if enabled) - /// - /// Reward points to check - /// true - reward points could use; false - cannot be used. - public virtual bool CheckMinimumRewardPointsToUseRequirement(int rewardPoints) - { - if (_rewardPointsSettings.MinimumRewardPointsToUse <= 0) - return true; - - return rewardPoints >= _rewardPointsSettings.MinimumRewardPointsToUse; - } - - /// - /// Calculate how order total (maximum amount) for which reward points could be earned/reduced - /// - /// Order shipping (including tax) - /// Order total - /// Applicable order total - public virtual decimal CalculateApplicableOrderTotalForRewardPoints(decimal orderShippingInclTax, decimal orderTotal) - { - //do you give reward points for order total? or do you exclude shipping? - //since shipping costs vary some of store owners don't give reward points based on shipping total - //you can put your custom logic here - return orderTotal - orderShippingInclTax; - } - /// - /// Calculate how much reward points will be earned/reduced based on certain amount spent - /// - /// Customer - /// Amount (in primary store currency) - /// Number of reward points - public virtual int CalculateRewardPoints(Customer customer, decimal amount) - { - if (!_rewardPointsSettings.Enabled) - return 0; - - if (_rewardPointsSettings.PointsForPurchases_Amount <= decimal.Zero) - return 0; - - //ensure that reward points are applied only to registered users - if (customer == null || customer.IsGuest()) - return 0; - - var points = (int)Math.Truncate(amount / _rewardPointsSettings.PointsForPurchases_Amount * _rewardPointsSettings.PointsForPurchases_Points); - return points; - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Discounts; +using Nop.Services.Payments; +using Nop.Services.Shipping; +using Nop.Services.Tax; +using System.Diagnostics; + +namespace Nop.Services.Orders +{ + /// + /// Order service + /// + public partial class OrderTotalCalculationService : IOrderTotalCalculationService + { + #region Fields + + private readonly IWorkContext _workContext; + private readonly IStoreContext _storeContext; + private readonly IPriceCalculationService _priceCalculationService; + private readonly ITaxService _taxService; + private readonly IShippingService _shippingService; + private readonly IPaymentService _paymentService; + private readonly ICheckoutAttributeParser _checkoutAttributeParser; + private readonly IDiscountService _discountService; + private readonly IGiftCardService _giftCardService; + private readonly IGenericAttributeService _genericAttributeService; + private readonly IRewardPointService _rewardPointService; + private readonly TaxSettings _taxSettings; + private readonly RewardPointsSettings _rewardPointsSettings; + private readonly ShippingSettings _shippingSettings; + private readonly ShoppingCartSettings _shoppingCartSettings; + private readonly CatalogSettings _catalogSettings; + private readonly IProductAttributeParser _productAttributeParser; + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Work context + /// Store context + /// Price calculation service + /// Tax service + /// Shipping service + /// Payment service + /// Checkout attribute parser + /// Discount service + /// Gift card service + /// Generic attribute service + /// Reward point service + /// Tax settings + /// Reward points settings + /// Shipping settings + /// Shopping cart settings + /// Catalog settings + /// Product Attribute Parser + public OrderTotalCalculationService(IWorkContext workContext, + IStoreContext storeContext, + IPriceCalculationService priceCalculationService, + ITaxService taxService, + IShippingService shippingService, + IPaymentService paymentService, + ICheckoutAttributeParser checkoutAttributeParser, + IDiscountService discountService, + IGiftCardService giftCardService, + IGenericAttributeService genericAttributeService, + IRewardPointService rewardPointService, + TaxSettings taxSettings, + RewardPointsSettings rewardPointsSettings, + ShippingSettings shippingSettings, + ShoppingCartSettings shoppingCartSettings, + CatalogSettings catalogSettings, + IProductAttributeParser productAttributeParser) + { + this._workContext = workContext; + this._storeContext = storeContext; + this._priceCalculationService = priceCalculationService; + this._taxService = taxService; + this._shippingService = shippingService; + this._paymentService = paymentService; + this._checkoutAttributeParser = checkoutAttributeParser; + this._discountService = discountService; + this._giftCardService = giftCardService; + this._genericAttributeService = genericAttributeService; + this._rewardPointService = rewardPointService; + this._taxSettings = taxSettings; + this._rewardPointsSettings = rewardPointsSettings; + this._shippingSettings = shippingSettings; + this._shoppingCartSettings = shoppingCartSettings; + this._catalogSettings = catalogSettings; + this._productAttributeParser = productAttributeParser; + } + + #endregion + + #region Utilities + + /// + /// Gets an order discount (applied to order subtotal) + /// + /// Customer + /// Order subtotal + /// Applied discounts + /// Order discount + protected virtual decimal GetOrderSubtotalDiscount(Customer customer, + decimal orderSubTotal, out List appliedDiscounts) + { + appliedDiscounts = new List(); + decimal discountAmount = decimal.Zero; + if (_catalogSettings.IgnoreDiscounts) + return discountAmount; + + var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal); + var allowedDiscounts = new List(); + if (allDiscounts != null) + foreach (var discount in allDiscounts) + if (_discountService.ValidateDiscount(discount, customer).IsValid && + !allowedDiscounts.ContainsDiscount(discount)) + { + allowedDiscounts.Add(discount); + } + + appliedDiscounts = allowedDiscounts.GetPreferredDiscount(orderSubTotal, out discountAmount); + + if (discountAmount < decimal.Zero) + discountAmount = decimal.Zero; + + return RoundingHelper.RoundAmount(discountAmount); //round amount as it is displayed in this way and rounding errors my happen + } + + /// + /// Gets a shipping discount + /// + /// Customer + /// Shipping total + /// Applied discounts + /// Shipping discount + protected virtual decimal GetShippingDiscount(Customer customer, decimal shippingTotal, out List appliedDiscounts) + { + appliedDiscounts = new List(); + decimal shippingDiscountAmount = decimal.Zero; + if (_catalogSettings.IgnoreDiscounts) + return shippingDiscountAmount; + + var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToShipping); + var allowedDiscounts = new List(); + if (allDiscounts != null) + foreach (var discount in allDiscounts) + if (_discountService.ValidateDiscount(discount, customer).IsValid && + !allowedDiscounts.ContainsDiscount(discount)) + { + allowedDiscounts.Add(discount); + } + + appliedDiscounts = allowedDiscounts.GetPreferredDiscount(shippingTotal, out shippingDiscountAmount); + + if (shippingDiscountAmount < decimal.Zero) + shippingDiscountAmount = decimal.Zero; + + if (_shoppingCartSettings.RoundPricesDuringCalculation) + shippingDiscountAmount = RoundingHelper.RoundAmount(shippingDiscountAmount); + + return shippingDiscountAmount; + } + + /// + /// Gets an order discount (applied to order total) + /// + /// Customer + /// Order total + /// Applied discounts + /// Order discount + protected virtual decimal GetOrderTotalDiscount(Customer customer, decimal orderTotal, out List appliedDiscounts) + { + appliedDiscounts = new List(); + decimal discountAmount = decimal.Zero; + if (_catalogSettings.IgnoreDiscounts) + return discountAmount; + + var allDiscounts = _discountService.GetAllDiscountsForCaching(DiscountType.AssignedToOrderTotal); + var allowedDiscounts = new List(); + if (allDiscounts != null) + foreach (var discount in allDiscounts) + if (_discountService.ValidateDiscount(discount, customer).IsValid && + !allowedDiscounts.ContainsDiscount(discount)) + { + allowedDiscounts.Add(discount); + } + + appliedDiscounts = allowedDiscounts.GetPreferredDiscount(orderTotal, out discountAmount); + + if (discountAmount < decimal.Zero) + discountAmount = decimal.Zero; + + if (_shoppingCartSettings.RoundPricesDuringCalculation) + discountAmount = RoundingHelper.RoundAmount(discountAmount); + + return RoundingHelper.RoundAmount(discountAmount); //round amount as it is displayed in this way and rounding errors my happen + } + + protected virtual RewardPoints GetRedeemableRewardPoints(decimal rewardpointsbase, RewardPoints redeemedRewardPoints, Customer customer, bool? useRewardPoints = null, int ? rewardPointsOfOrder = null) + { + if (_rewardPointsSettings.Enabled && rewardpointsbase > decimal.Zero) + { + if (!rewardPointsOfOrder.HasValue) + { + if (!useRewardPoints.HasValue) + useRewardPoints = customer.GetAttribute(SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, _genericAttributeService, _storeContext.CurrentStore.Id); + if (useRewardPoints.Value) + { + var rewardPointsBalance = _rewardPointService.GetRewardPointsBalance(customer.Id, _storeContext.CurrentStore.Id); + + //taxable points. + if ( _rewardPointService.CheckMinimumRewardPointsToUseRequirement(rewardPointsBalance.Points)) + { + if (rewardpointsbase > rewardPointsBalance.Amount) + { + redeemedRewardPoints.Points = rewardPointsBalance.Points; + } + else + { + if (rewardpointsbase > decimal.Zero) + redeemedRewardPoints.Points = _rewardPointService.ConvertAmountToRewardPoints(rewardpointsbase); + } + rewardpointsbase -= redeemedRewardPoints.Amount; + } + //purchased reward points (can be always spent) + if (rewardpointsbase > rewardPointsBalance.AmountPurchased) + { + redeemedRewardPoints.PointsPurchased = rewardPointsBalance.PointsPurchased; + } + else + { + if (rewardpointsbase > decimal.Zero) + redeemedRewardPoints.PointsPurchased = _rewardPointService.ConvertAmountToRewardPoints(rewardpointsbase); + } + } + } + else + { //return corrected taxable points (only for updateorder total). Purchased points not needed here. + redeemedRewardPoints.Points = _rewardPointService.ConvertAmountToRewardPoints(Math.Min(_rewardPointService.ConvertRewardPointsToAmount(rewardPointsOfOrder ?? 0), rewardpointsbase)); + } + } + + return redeemedRewardPoints; + } + #endregion + + #region Methods + + /// + /// Gets shopping cart subtotal + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied discount amount + /// Applied discounts + /// Sub total (without discount) + /// Sub total (with discount) + public virtual void GetShoppingCartSubTotal(IList cart, + bool includingTax, + out decimal discountAmount, out List appliedDiscounts, + out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount) + { + TaxSummary taxSummary; + decimal subTotalRewardPointsBaseAmount; + + GetShoppingCartSubTotal(cart, includingTax, + out discountAmount, out appliedDiscounts, + out subTotalWithoutDiscount, out subTotalWithDiscount, out taxSummary, + out subTotalRewardPointsBaseAmount); + } + + /// + /// Gets shopping cart subtotal + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied discount amount + /// Applied discounts + /// Sub total (without discount) + /// Sub total (with discount) + /// Tax rates summary (of order sub total) + /// Subtotal base amount for earned reward points calculation + public virtual void GetShoppingCartSubTotal(IList cart, + bool includingTax, + out decimal discountAmount, out List appliedDiscounts, + out decimal subTotalWithoutDiscount, out decimal subTotalWithDiscount, + out TaxSummary taxSummary, + out decimal subTotalEarnedRewardPointsBaseAmount) + { + taxSummary = new TaxSummary(includingTax); + discountAmount = decimal.Zero; + appliedDiscounts = new List(); + subTotalWithoutDiscount = decimal.Zero; + subTotalWithDiscount = decimal.Zero; + subTotalEarnedRewardPointsBaseAmount = decimal.Zero; + + decimal subTotalAmount = decimal.Zero; + + if (!cart.Any()) + return; + + //get the customer + Customer customer = cart.GetCustomer(); + + //sub totals + foreach (var shoppingCartItem in cart) + { + decimal itemAmount = decimal.Zero; + decimal taxRate = decimal.Zero; + + //restored cartitem + if (shoppingCartItem.TaxRate.HasValue && shoppingCartItem.SubTotalExclTax != null && shoppingCartItem.SubTotalInclTax != null) + { + itemAmount = includingTax ? shoppingCartItem.SubTotalInclTax ?? 0 : shoppingCartItem.SubTotalExclTax ?? 0; + taxRate = shoppingCartItem.TaxRate ?? 0; + subTotalAmount += itemAmount; + } + //normal item + else + { + decimal sciSubTotal = _priceCalculationService.GetSubTotal(shoppingCartItem); + var newAttributesXml = shoppingCartItem.AttributesXml; + itemAmount = _taxService.GetProductPrice(shoppingCartItem.Product, sciSubTotal, out taxRate, ref newAttributesXml, includingTax); + shoppingCartItem.AttributesXml = newAttributesXml; + subTotalAmount += itemAmount; + } + + //reward points base + subTotalEarnedRewardPointsBaseAmount += !shoppingCartItem.Product.ExcludeFromRewardPoints ? itemAmount : decimal.Zero; + + //tax rates + string attributesXml = shoppingCartItem.AttributesXml; + SortedDictionary attributeTaxWeight = !String.IsNullOrEmpty(attributesXml) ? _productAttributeParser.ParseTaxAttribute(attributesXml) : null; + if (attributeTaxWeight == null || !attributeTaxWeight.Any()) + { + if (itemAmount > decimal.Zero) //MF 22.11.16 taxRate > decimal.Zero &&: VatBase is need also when tax is 0 to show up in summary + taxSummary.AddRate(taxRate, itemAmount); + } + else //tax in attributes + { + taxSummary.AddAttributeRate(itemAmount, attributeTaxWeight); + } + } + + //checkout attributes + if (customer != null) + { + var checkoutAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, _genericAttributeService, _storeContext.CurrentStore.Id); + var attributeValues = _checkoutAttributeParser.ParseCheckoutAttributeValues(checkoutAttributesXml); + if (attributeValues != null && attributeValues.Any()) //MF 16.11.16 any + { + foreach (var attributeValue in attributeValues) + { + decimal taxRate; + decimal itemAmount = _taxService.GetCheckoutAttributePrice(attributeValue, includingTax, customer, out taxRate); + subTotalAmount += itemAmount; + subTotalEarnedRewardPointsBaseAmount += itemAmount; + //tax rates + if (itemAmount > decimal.Zero) //taxRate > decimal.Zero && + taxSummary.AddRate(taxRate, itemAmount); + } + } + } + + //subtotal discount + var subDisc = RoundingHelper.RoundAmount(GetOrderSubtotalDiscount(customer, subTotalAmount, out appliedDiscounts)); //round discount, otherwise rounding errors may happen + if (subDisc != decimal.Zero) + { + taxSummary.SetSubtotalDiscAmount(subDisc); + + //adjust earned reward points base amount + if (subTotalAmount != decimal.Zero) + subTotalEarnedRewardPointsBaseAmount = subTotalEarnedRewardPointsBaseAmount * (1 - subDisc / subTotalAmount); + if (_shoppingCartSettings.RoundPricesDuringCalculation) + subTotalEarnedRewardPointsBaseAmount = RoundingHelper.RoundAmount(subTotalEarnedRewardPointsBaseAmount); + } + + + //overall totals + discountAmount = taxSummary.TotalSubTotalDiscAmount; + subTotalWithoutDiscount = taxSummary.TotalSubTotalAmount; + subTotalWithDiscount = includingTax ? taxSummary.TotalAmountIncludingTax : taxSummary.TotalAmount; + + if (subTotalWithDiscount < decimal.Zero) + subTotalWithDiscount = decimal.Zero; + + if (subTotalWithoutDiscount < decimal.Zero) + subTotalWithoutDiscount = decimal.Zero; + + } + + /// + /// Update order totals + /// + /// Parameters for the updating order + /// Shopping cart + public virtual void UpdateOrderTotals(UpdateOrderParameters updateOrderParameters, IList restoredCart) + { + var updatedOrder = updateOrderParameters.UpdatedOrder; + var updatedOrderItem = updateOrderParameters.UpdatedOrderItem; + + //get the customer + var customer = restoredCart.GetCustomer(); + + + bool includingTax = updatedOrder.CustomerTaxDisplayType == TaxDisplayType.IncludingTax; + List orderAppliedDiscounts; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + List appliedGiftCards; + TaxSummary taxSummaryIncl; + TaxSummary taxSummaryExcl; + + RewardPoints redeemedRewardPointsIncl; + RewardPoints redeemedRewardPointsExcl; + bool earnedRewardPointsAreTaxable = _rewardPointsSettings.EarnedRewardPointsAreTaxable; + + //reward points of order + var rewardPointsOfOrder = _rewardPointService.GetRewardPointsHistory(customer.Id, true).FirstOrDefault(history => history.UsedWithOrder == updatedOrder); + var redeemedPointsToOrderAmount = rewardPointsOfOrder != null && earnedRewardPointsAreTaxable ? -rewardPointsOfOrder.Points : 0; + decimal earnedRewardPointsBaseAmountIncl; + decimal earnedRewardPointsBaseAmountExcl; + + decimal shoppingCartTaxExcl = GetTaxTotal(restoredCart, false, out taxSummaryExcl, out orderAppliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPointsExcl, out earnedRewardPointsBaseAmountExcl, useRewardPoints: false, rewardPointsOfOrder: redeemedPointsToOrderAmount); + decimal shoppingCartTaxIncl = GetTaxTotal(restoredCart, true, out taxSummaryIncl, out orderAppliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPointsIncl, out earnedRewardPointsBaseAmountIncl, useRewardPoints: false, rewardPointsOfOrder: redeemedPointsToOrderAmount); + + #region discounts + foreach (var discount in orderAppliedDiscounts) + if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) + updateOrderParameters.AppliedDiscounts.Add(discount); + + foreach (var discount in subTotalAppliedDiscounts) + if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) + updateOrderParameters.AppliedDiscounts.Add(discount); + + foreach (var discount in shippingAppliedDiscounts) + if (!updateOrderParameters.AppliedDiscounts.ContainsDiscount(discount)) + updateOrderParameters.AppliedDiscounts.Add(discount); + + #endregion + + #region order + + updatedOrder.OrderSubtotalExclTax = taxSummaryExcl.TotalSubTotalAmount; + updatedOrder.OrderSubtotalInclTax = taxSummaryIncl.TotalSubTotalAmount; + updatedOrder.OrderSubTotalDiscountExclTax = taxSummaryExcl.TotalSubTotalDiscAmount; + updatedOrder.OrderSubTotalDiscountInclTax = taxSummaryIncl.TotalSubTotalDiscAmount; + updatedOrder.OrderShippingExclTax = taxSummaryExcl.TotalShippingAmountTaxable ?? decimal.Zero; + updatedOrder.OrderShippingInclTax = taxSummaryIncl.TotalShippingAmountTaxable ?? decimal.Zero; + updatedOrder.OrderShippingNonTaxable = includingTax ? (taxSummaryIncl.TotalShippingAmountNonTaxable ?? decimal.Zero) : (taxSummaryExcl.TotalShippingAmountNonTaxable ?? decimal.Zero); + updatedOrder.OrderTax = includingTax ? shoppingCartTaxIncl : shoppingCartTaxExcl; + updatedOrder.OrderDiscount = taxSummaryExcl.TotalInvDiscAmount; + updatedOrder.OrderDiscountIncl = taxSummaryIncl.TotalInvDiscAmount; + updatedOrder.OrderAmount = includingTax ? taxSummaryIncl.TotalAmount : taxSummaryExcl.TotalAmount; + updatedOrder.OrderAmountIncl = includingTax ? taxSummaryIncl.TotalAmountIncludingTax : taxSummaryExcl.TotalAmountIncludingTax; + updatedOrder.EarnedRewardPointsBaseAmountExcl = earnedRewardPointsBaseAmountExcl; + updatedOrder.EarnedRewardPointsBaseAmountIncl = earnedRewardPointsBaseAmountIncl; + updatedOrder.PaymentMethodAdditionalFeeInclTax = taxSummaryIncl.TotalPaymentFeeAmountTaxable; + updatedOrder.PaymentMethodAdditionalFeeExclTax = taxSummaryExcl.TotalPaymentFeeAmountTaxable; + updatedOrder.PaymentMethodAdditionalFeeNonTaxable = includingTax ? (taxSummaryIncl.TotalPaymentFeeAmountNonTaxable ?? decimal.Zero) : (taxSummaryExcl.TotalPaymentFeeAmountNonTaxable ?? decimal.Zero); + + var total = includingTax ? taxSummaryIncl.TotalAmountIncludingTax : taxSummaryExcl.TotalAmountIncludingTax; //gets updated later on + + //get shopping cart item which has been updated + var updatedShoppingCartItem = restoredCart.FirstOrDefault(shoppingCartItem => shoppingCartItem.Id == updatedOrderItem.Id); + var itemDeleted = updatedShoppingCartItem == null; + if (!itemDeleted) + { + //update order item + updatedOrderItem.UnitPriceExclTax = updateOrderParameters.PriceExclTax; + updatedOrderItem.UnitPriceInclTax = updateOrderParameters.PriceInclTax; + updatedOrderItem.DiscountAmountExclTax = updateOrderParameters.DiscountAmountExclTax; + updatedOrderItem.DiscountAmountInclTax = updateOrderParameters.DiscountAmountInclTax; + updatedOrderItem.PriceExclTax = updateOrderParameters.SubTotalExclTax; + updatedOrderItem.PriceInclTax = updateOrderParameters.SubTotalInclTax; + updatedOrderItem.Quantity = restoredCart.FirstOrDefault(item => item.Id == updatedOrderItem.Id).Quantity; + updatedOrderItem.TaxRate = restoredCart.FirstOrDefault(item => item.Id == updatedOrderItem.Id).TaxRate ?? 0; + } + #endregion + + #region Shipping + + if (restoredCart.RequiresShipping()) + { + if (!IsFreeShipping(restoredCart, _shippingSettings.FreeShippingOverXIncludingTax ? taxSummaryIncl.TotalSubTotalAmount : taxSummaryExcl.TotalSubTotalAmount)) + { + if (!string.IsNullOrEmpty(updatedOrder.ShippingRateComputationMethodSystemName)) + { + //in the updated order were shipping items + if (updatedOrder.PickUpInStore) + { + //customer chose pickup in store method, try to get chosen pickup point + if (_shippingSettings.AllowPickUpInStore) + { + var pickupPointsResponse = _shippingService.GetPickupPoints(updatedOrder.BillingAddress, updatedOrder.Customer, + updatedOrder.ShippingRateComputationMethodSystemName, _storeContext.CurrentStore.Id); + if (pickupPointsResponse.Success) + { + var selectedPickupPoint = pickupPointsResponse.PickupPoints.FirstOrDefault(point => updatedOrder.ShippingMethod.Contains(point.Name)); + if (selectedPickupPoint == null) + updateOrderParameters.Warnings.Add(string.Format("Shipping method {0} could not be loaded", updatedOrder.ShippingMethod)); + } + else + updateOrderParameters.Warnings.AddRange(pickupPointsResponse.Errors); + } + else + updateOrderParameters.Warnings.Add("Pick up in store is not available"); + } + else + { + //customer chose shipping to address, try to get chosen shipping option + var shippingOptionsResponse = _shippingService.GetShippingOptions(restoredCart, + updatedOrder.ShippingAddress, updatedOrder.Customer, updatedOrder.ShippingRateComputationMethodSystemName, _storeContext.CurrentStore.Id); + if (shippingOptionsResponse.Success) + { + var shippingOption = shippingOptionsResponse.ShippingOptions.FirstOrDefault(option => updatedOrder.ShippingMethod.Contains(option.Name)); + if (shippingOption == null) + updateOrderParameters.Warnings.Add(string.Format("Shipping method {0} could not be loaded", updatedOrder.ShippingMethod)); + } + else + updateOrderParameters.Warnings.AddRange(shippingOptionsResponse.Errors); + } + } + else + { + //before updating order was without shipping + if (_shippingSettings.AllowPickUpInStore) + { + //try to get the cheapest pickup point + var pickupPointsResponse = _shippingService.GetPickupPoints(updatedOrder.BillingAddress, _workContext.CurrentCustomer, storeId: _storeContext.CurrentStore.Id); + if (pickupPointsResponse.Success) + { + updateOrderParameters.PickupPoint = pickupPointsResponse.PickupPoints.OrderBy(point => point.PickupFee).First(); + } + else + updateOrderParameters.Warnings.AddRange(pickupPointsResponse.Errors); + } + else + updateOrderParameters.Warnings.Add("Pick up in store is not available"); + + if (updateOrderParameters.PickupPoint == null) + { + //or try to get the cheapest shipping option for the shipping to the customer address + var shippingRateComputationMethods = _shippingService.LoadActiveShippingRateComputationMethods(_workContext.CurrentCustomer, _storeContext.CurrentStore.Id); + if (shippingRateComputationMethods.Any()) + { + var shippingOptionsResponse = _shippingService.GetShippingOptions(restoredCart, customer.ShippingAddress, _workContext.CurrentCustomer, storeId: _storeContext.CurrentStore.Id); + if (shippingOptionsResponse.Success) + { + var shippingOption = shippingOptionsResponse.ShippingOptions.OrderBy(option => option.Rate).First(); + updatedOrder.ShippingRateComputationMethodSystemName = shippingOption.ShippingRateComputationMethodSystemName; + updatedOrder.ShippingMethod = shippingOption.Name; + updatedOrder.ShippingAddress = (Address)customer.ShippingAddress.Clone(); + } + else + updateOrderParameters.Warnings.AddRange(shippingOptionsResponse.Errors); + } + else + updateOrderParameters.Warnings.Add("Shipping rate computation method could not be loaded"); + } + } + + //change shipping status + if (updatedOrder.ShippingStatus == ShippingStatus.ShippingNotRequired || updatedOrder.ShippingStatus == ShippingStatus.NotYetShipped) + updatedOrder.ShippingStatus = ShippingStatus.NotYetShipped; + else + updatedOrder.ShippingStatus = ShippingStatus.PartiallyShipped; + } + } + else + updatedOrder.ShippingStatus = ShippingStatus.ShippingNotRequired; + + + + #endregion + + #region Tax rates + //tax rates + var taxrates = includingTax ? taxSummaryIncl : taxSummaryExcl; + updatedOrder.TaxRates = taxrates.GenerateTaxRateString(); + + #endregion + + #region total + + //applied giftcards + foreach (var giftCard in _giftCardService.GetAllGiftCards(usedWithOrderId: updatedOrder.Id)) + { + if (total > decimal.Zero) + { + var remainingAmount = giftCard.GiftCardUsageHistory.Where(history => history.UsedWithOrderId == updatedOrder.Id).Sum(history => history.UsedValue); + var amountCanBeUsed = total > remainingAmount ? remainingAmount : total; + total -= amountCanBeUsed; + } + } + + //reward points + if (rewardPointsOfOrder != null) + { + var rewardPoints = new RewardPoints(_rewardPointService) + { + Points = -rewardPointsOfOrder.Points, + PointsPurchased = -rewardPointsOfOrder.PointsPurchased + }; + + var redeemedRewardPoints = includingTax ? redeemedRewardPointsIncl : redeemedRewardPointsExcl; + + if (earnedRewardPointsAreTaxable && redeemedRewardPoints.Amount != rewardPoints.Amount) + { + rewardPoints.Points = redeemedRewardPoints.Points; + var corrtotal = Math.Max(total - redeemedRewardPoints.Amount, decimal.Zero); + + if (corrtotal < rewardPoints.AmountPurchased) + { + rewardPoints.PointsPurchased = _rewardPointService.ConvertAmountToRewardPoints(corrtotal); + } + } + else + { + //purchased points have been applied to order total. To get base for reward points add them again. + var corrtotal = Math.Max(total - rewardPoints.AmountPurchased, decimal.Zero); + if (corrtotal < rewardPoints.Amount) + { + rewardPoints.Points = _rewardPointService.ConvertAmountToRewardPoints(corrtotal); + } + corrtotal = Math.Max(total - rewardPoints.Amount, decimal.Zero); + if (corrtotal < rewardPoints.AmountPurchased) + { + rewardPoints.PointsPurchased = _rewardPointService.ConvertAmountToRewardPoints(corrtotal); + } + } + + total += -rewardPoints.Amount + -rewardPoints.AmountPurchased; + + var corrRewardPoints = new RewardPoints(_rewardPointService); + //uncomment here for the return unused reward points if new order total less redeemed reward points amount + if (rewardPoints.Points < -rewardPointsOfOrder.Points || rewardPoints.PointsPurchased < -rewardPointsOfOrder.PointsPurchased) + { + corrRewardPoints.Points = -rewardPointsOfOrder.Points - rewardPoints.Points; + corrRewardPoints.PointsPurchased = -rewardPointsOfOrder.PointsPurchased - rewardPoints.PointsPurchased; + _rewardPointService.AddRewardPointsHistoryEntry(customer, corrRewardPoints, _storeContext.CurrentStore.Id, "Returned unused reward points due to order correction."); + } + //comment end + + if (rewardPoints.Amount != rewardPointsOfOrder.UsedAmount || rewardPoints.AmountPurchased != rewardPointsOfOrder.UsedAmountPurchased) + { + rewardPointsOfOrder.UsedAmount = rewardPoints.Amount; + rewardPointsOfOrder.Points = -rewardPoints.Points; + rewardPointsOfOrder.UsedAmountPurchased = rewardPoints.AmountPurchased; + rewardPointsOfOrder.PointsPurchased = -rewardPoints.PointsPurchased; + rewardPointsOfOrder.PointsBalance += -corrRewardPoints.Points; + rewardPointsOfOrder.PointsBalancePurchased = -corrRewardPoints.PointsPurchased; + _rewardPointService.UpdateRewardPointsHistoryEntry(rewardPointsOfOrder); + } + } + + updatedOrder.OrderTotal = total; + #endregion + } + + /// + /// Gets shopping cart additional shipping charge + /// + /// Cart + /// Additional shipping charge + public virtual decimal GetShoppingCartAdditionalShippingCharge(IList cart) + { + decimal additionalShippingCharge = decimal.Zero; + + bool isFreeShipping = IsFreeShipping(cart); + if (isFreeShipping) + return decimal.Zero; + + foreach (var sci in cart) + if (sci.IsShipEnabled && !sci.IsFreeShipping) + additionalShippingCharge += sci.AdditionalShippingCharge; + + return additionalShippingCharge; + } + + /// + /// Gets a value indicating whether shipping is free + /// + /// Cart + /// Subtotal amount; pass null to calculate subtotal + /// A value indicating whether shipping is free + public virtual bool IsFreeShipping(IList cart, decimal? subTotal = null) + { + if (!cart.RequiresShipping()) + return true; + + //check whether customer is in a customer role with free shipping applied + var customer = cart.GetCustomer(); + if (customer != null && customer.CustomerRoles.Where(role => role.Active).Any(role => role.FreeShipping)) + return true; + + //check whether all shopping cart items are marked as free shipping + if (cart.All(item => item.IsShipEnabled && item.IsFreeShipping)) + return true; + + //free shipping over $X + if (_shippingSettings.FreeShippingOverXEnabled) + { + if (!subTotal.HasValue) + { + decimal discountAmount; + List appliedDiscounts; + decimal subTotalWithoutDiscount; + decimal subTotalWithDiscount; + GetShoppingCartSubTotal(cart, _shippingSettings.FreeShippingOverXIncludingTax, out discountAmount, + out appliedDiscounts, out subTotalWithoutDiscount, out subTotalWithDiscount); + subTotal = subTotalWithDiscount; + } + + //check whether we have subtotal enough to have free shipping + if (subTotal.Value > _shippingSettings.FreeShippingOverXValue) + return true; + } + + return false; + } + + /// + /// Adjust shipping rate (free shipping, additional charges, discounts) + /// + /// Shipping rate to adjust + /// Cart + /// Applied discounts + /// Adjusted shipping rate + public virtual decimal AdjustShippingRate(decimal shippingRate, + IList cart, out List appliedDiscounts) + { + appliedDiscounts = new List(); + + //free shipping + if (IsFreeShipping(cart)) + return decimal.Zero; + + //additional shipping charges + decimal additionalShippingCharge = GetShoppingCartAdditionalShippingCharge(cart); + var adjustedRate = shippingRate + additionalShippingCharge; + + //discount + var customer = cart.GetCustomer(); + decimal discountAmount = GetShippingDiscount(customer, adjustedRate, out appliedDiscounts); + adjustedRate = adjustedRate - discountAmount; + + if (adjustedRate < decimal.Zero) + adjustedRate = decimal.Zero; + + if (_shoppingCartSettings.RoundPricesDuringCalculation) + adjustedRate = RoundingHelper.RoundAmount(adjustedRate); + + return adjustedRate; + } + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// Shipping total + public virtual decimal? GetShoppingCartShippingTotal(IList cart) + { + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + return GetShoppingCartShippingTotal(cart, includingTax); + } + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Shipping total + public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax) + { + decimal taxRate; + return GetShoppingCartShippingTotal(cart, includingTax, out taxRate); + } + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied tax rate + /// Shipping total + public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, + out decimal taxRate) + { + List appliedDiscounts; + return GetShoppingCartShippingTotal(cart, includingTax, out taxRate, out appliedDiscounts); + } + + /// + /// Gets shopping cart shipping total + /// + /// Cart + /// A value indicating whether calculated amounts should include tax + /// Applied tax rate + /// Applied discounts + /// Shipping total + public virtual decimal? GetShoppingCartShippingTotal(IList cart, bool includingTax, + out decimal taxRate, out List appliedDiscounts) + { + decimal? shippingTotal = null; + decimal? shippingTotalTaxed = null; + appliedDiscounts = new List(); + taxRate = decimal.Zero; + + var customer = cart.GetCustomer(); + + + + bool isFreeShipping = IsFreeShipping(cart); + if (isFreeShipping) + { + //we always need a taxrate, get it from GetShippingPrice with price Zero + return _taxService.GetShippingPrice(decimal.Zero, includingTax, customer, out taxRate); + } + + ShippingOption shippingOption = null; + if (customer != null) + shippingOption = customer.GetAttribute(SystemCustomerAttributeNames.SelectedShippingOption, _genericAttributeService, _storeContext.CurrentStore.Id); + + + if (shippingOption != null) + { + //use last shipping option (get from cache) + shippingTotal = AdjustShippingRate(shippingOption.Rate, cart, out appliedDiscounts); + } + else + { + //use fixed rate (if possible) + Address shippingAddress = null; + if (customer != null) + shippingAddress = customer.ShippingAddress; + + var shippingRateComputationMethods = _shippingService.LoadActiveShippingRateComputationMethods(_workContext.CurrentCustomer, _storeContext.CurrentStore.Id); + if (!shippingRateComputationMethods.Any() && !_shippingSettings.AllowPickUpInStore) + throw new NopException("Shipping rate computation method could not be loaded"); + + if (shippingRateComputationMethods.Count == 1) + { + var shippingRateComputationMethod = shippingRateComputationMethods[0]; + + bool shippingFromMultipleLocations; + var shippingOptionRequests = _shippingService.CreateShippingOptionRequests(cart, + shippingAddress, + _storeContext.CurrentStore.Id, + out shippingFromMultipleLocations); + decimal? fixedRate = null; + foreach (var shippingOptionRequest in shippingOptionRequests) + { + //calculate fixed rates for each request-package + var fixedRateTmp = shippingRateComputationMethod.GetFixedRate(shippingOptionRequest); + if (fixedRateTmp.HasValue) + { + if (!fixedRate.HasValue) + fixedRate = decimal.Zero; + + fixedRate += fixedRateTmp.Value; + } + } + + + if (fixedRate.HasValue) + { + //adjust shipping rate + shippingTotal = AdjustShippingRate(fixedRate.Value, cart, out appliedDiscounts); + } + } + } + + if (shippingTotal.HasValue) + { + if (shippingTotal.Value < decimal.Zero) + shippingTotal = decimal.Zero; + + //round + if (_shoppingCartSettings.RoundPricesDuringCalculation) + shippingTotal = RoundingHelper.RoundAmount(shippingTotal.Value); + + shippingTotalTaxed = _taxService.GetShippingPrice(shippingTotal.Value, + includingTax, + customer, + out taxRate); + + //round + if (_shoppingCartSettings.RoundPricesDuringCalculation) + shippingTotalTaxed = RoundingHelper.RoundAmount(shippingTotalTaxed.Value); + } + + return shippingTotalTaxed; + } + + /// + /// Gets tax + /// + /// Shopping cart + /// Tax Summary + /// A value indicating whether we should use payment method additional fee when calculating tax + /// Tax total + public virtual decimal GetTaxTotal(IList cart, out TaxSummary taxSummary, bool usePaymentMethodAdditionalFee = true) + { + if (cart == null) + throw new ArgumentNullException("cart"); + + List appliedDiscounts; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + List appliedGiftCards; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + RewardPoints redeemedRewardPoints; + decimal earnedRewardPointsBaseAmount; + return GetTaxTotal(cart, includingTax, out taxSummary, out appliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out earnedRewardPointsBaseAmount, usePaymentMethodAdditionalFee); + } + /// + /// Gets tax + /// + /// Shopping cart + /// A value indicating whether calculated amounts should include tax + /// Tax rates summary + /// Applied invoice discounts + /// Applied subtotal discounts + /// Applied shipping discounts + /// Applied gift cards + /// Taxable reward points to redeem + /// Reward points base amount for earned points + /// A value indicating whether we should use payment method additional fee when calculating tax + /// A value indicating reward points should be used; null to detect current choice of the customer + /// Only in the case of updating a stored order: give the reward points amount used in the order. + /// Tax total + public virtual decimal GetTaxTotal(IList cart, + bool includingTax, + out TaxSummary taxSummary, + out List appliedDiscounts, + out List subTotalAppliedDiscounts, + out List shippingAppliedDiscounts, + out List appliedGiftCards, + out RewardPoints redeemedRewardPoints, + out decimal earnedRewardPointsBaseAmount, + bool usePaymentMethodAdditionalFee = true, + bool? useRewardPoints = null, + int? rewardPointsOfOrder = null + ) + + { + redeemedRewardPoints = new RewardPoints(_rewardPointService); + + if (cart == null) + throw new ArgumentNullException("cart"); + + var customer = cart.GetCustomer(); + string paymentMethodSystemName = ""; + if (customer != null) + { + paymentMethodSystemName = customer.GetAttribute( + SystemCustomerAttributeNames.SelectedPaymentMethod, + _genericAttributeService, + _storeContext.CurrentStore.Id); + } + + //order sub total (items + checkout attributes) + decimal orderSubTotalDiscountAmount; + decimal subTotalWithoutDiscountBase; + decimal subTotalWithDiscountBase; + + GetShoppingCartSubTotal(cart, includingTax, + out orderSubTotalDiscountAmount, out subTotalAppliedDiscounts, + out subTotalWithoutDiscountBase, out subTotalWithDiscountBase, + out taxSummary, out earnedRewardPointsBaseAmount); + + decimal taxRate; + + //shipping + decimal? shippingAmount = GetShoppingCartShippingTotal(cart, includingTax, out taxRate, out shippingAppliedDiscounts); + if ((shippingAmount ?? decimal.Zero) >= decimal.Zero) //pass also zero, otherwise taxsummary does not know that there is a shipping + if (_taxSettings.ShippingIsTaxable) + { + taxSummary.AddRate(taxRate, shippingAmount: shippingAmount ?? decimal.Zero); + } + else + { + taxSummary.TotalShippingAmountNonTaxable = shippingAmount; //no need to recalulate without tax. GetShippingPrice returns price without tax when _taxSettings.ShippingIsTaxable = false. + } + + if (_rewardPointsSettings.AwardPointsIncludeShipping) + earnedRewardPointsBaseAmount += shippingAmount ?? decimal.Zero; + + + //Order total invoice discount + + //note if shipping is not taxable then no ivDiscount is calculated for it. It would be possible to do it separately. It can't be added here as tax amount would get changed. + //please note also, then when considering it, ivDiscount must be split + decimal discountbase = includingTax ? taxSummary.TotalAmountIncludingTax : taxSummary.TotalAmount; + var ivDiscount = GetOrderTotalDiscount(customer, discountbase, out appliedDiscounts); + if (ivDiscount != decimal.Zero) + taxSummary.SetTotalInvDiscAmount(Math.Min(ivDiscount, discountbase), discountbase); + + earnedRewardPointsBaseAmount -= ivDiscount; + + + #region reward points + //redeemed reward points applied to order amount (taxable) and payment amount + //we anticipate non taxable reward points here for taxable payment fee calculation + //if hasRewardPointsProduct, then don't redeem points. Would lead to discount plus it generates new reward points when buying a reward points product and paying with purchased points. + if (cart.HasRewardPointsProduct()) + earnedRewardPointsBaseAmount = decimal.Zero; + + if (_rewardPointsSettings.Enabled && earnedRewardPointsBaseAmount > decimal.Zero) + { + if (!useRewardPoints.HasValue) + useRewardPoints = customer.GetAttribute(SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, _genericAttributeService, _storeContext.CurrentStore.Id); + + if (useRewardPoints.Value) + { + redeemedRewardPoints = GetRedeemableRewardPoints(earnedRewardPointsBaseAmount, redeemedRewardPoints, customer, useRewardPoints, rewardPointsOfOrder); + decimal consumedEarnedPointsAmount = Math.Min(redeemedRewardPoints.Amount, earnedRewardPointsBaseAmount); + if (_rewardPointsSettings.EarnedRewardPointsAreTaxable && redeemedRewardPoints.Amount != decimal.Zero) + taxSummary.SetRewardPointsDiscAmount(consumedEarnedPointsAmount, earnedRewardPointsBaseAmount); + else + taxSummary.TotalRewardPointsAmountNonTaxable = consumedEarnedPointsAmount; + + earnedRewardPointsBaseAmount -= consumedEarnedPointsAmount; + + taxSummary.TotalRewardPointsAmountPurchased = redeemedRewardPoints.AmountPurchased; + + if (!_rewardPointsSettings.AwardPointsExcludePurchasedRewardPoints) + earnedRewardPointsBaseAmount -= redeemedRewardPoints.AmountPurchased; + } + } + + #endregion + + //we anticipate gift cards here for taxable payment fee calculation + #region Applied gift cards + + //let's apply gift cards now (gift cards that can be used) + decimal giftCardBase = taxSummary.TotalPaymentAmount; + appliedGiftCards = new List(); + if (!cart.IsRecurring()) + { + //we don't apply gift cards for recurring products + var giftCards = _giftCardService.GetActiveGiftCardsAppliedByCustomer(customer); + if (giftCards != null) + foreach (var gc in giftCards) + if (giftCardBase > decimal.Zero) + { + decimal remainingAmount = gc.GetGiftCardRemainingAmount(); + decimal amountCanBeUsed = giftCardBase > remainingAmount ? + remainingAmount : + giftCardBase; + + //round + if (_shoppingCartSettings.RoundPricesDuringCalculation) + amountCanBeUsed = RoundingHelper.RoundAmount(amountCanBeUsed); + + //reduce base + giftCardBase -= amountCanBeUsed; + taxSummary.TotalGiftcardsAmount += amountCanBeUsed; + + if (!_rewardPointsSettings.AwardPointsExcludeGiftCard) + earnedRewardPointsBaseAmount -= amountCanBeUsed; + + var appliedGiftCard = new AppliedGiftCard(); + appliedGiftCard.GiftCard = gc; + appliedGiftCard.AmountCanBeUsed = amountCanBeUsed; + appliedGiftCards.Add(appliedGiftCard); + } + } + if (!_rewardPointsSettings.AwardPointsExcludeGiftCard) + earnedRewardPointsBaseAmount -= taxSummary.TotalGiftcardsAmount ?? decimal.Zero; + + #endregion + + #region Payment Fee + //payment method additional fee + if (usePaymentMethodAdditionalFee && !String.IsNullOrEmpty(paymentMethodSystemName)) + { + decimal additionalFee = _paymentService.GetAdditionalHandlingFee(cart, paymentMethodSystemName); + decimal paymentMethodAdditionalFee = _taxService.GetPaymentMethodAdditionalFee(additionalFee, includingTax, customer, out taxRate); //if not taxable returns price + + if (_taxSettings.PaymentMethodAdditionalFeeIsTaxable) + { + if (paymentMethodAdditionalFee != decimal.Zero) + //case of normal taxable fee > 0, taxcategory != 0 + if (paymentMethodAdditionalFee > decimal.Zero && _taxSettings.PaymentMethodAdditionalFeeTaxClassId != 0) + taxSummary.AddRate(taxRate, paymentFeeAmount: paymentMethodAdditionalFee); + //case of fee < 0 considered as discount or > 0 considered as surcharge when taxcategory is not set + else + { + decimal discountbaseFee = taxSummary.TotalBaseAmountForPaymentFeeCalculation; + taxSummary.SetPaymentFeeOrDiscAmount(paymentMethodAdditionalFee, discountbaseFee); + } + } + else + taxSummary.TotalPaymentFeeAmountNonTaxable = paymentMethodAdditionalFee; + + if (_rewardPointsSettings.AwardPointsIncludePaymentMethodAdditionalFee && paymentMethodAdditionalFee > decimal.Zero) + earnedRewardPointsBaseAmount += paymentMethodAdditionalFee; + else + //independent of AwardPointsIncludePaymentMethodAdditionalFee setting, reduce for a possible discount + earnedRewardPointsBaseAmount += paymentMethodAdditionalFee; + } + #endregion + + //add at least one tax rate (0%) + if (!taxSummary.TaxRates.Any()) + taxSummary.AddRate(0, 0); + + //total tax + decimal taxTotal = taxSummary.TotalAmountTax; + + //ensure that tax is equal or greater than zero + if (taxTotal < decimal.Zero) + taxTotal = decimal.Zero; + + //ensure that base amount for earning reward points is not negative + if (earnedRewardPointsBaseAmount < decimal.Zero) + earnedRewardPointsBaseAmount = decimal.Zero; + + return taxTotal; + } + + /// + /// Gets shopping cart total + /// + /// Cart + /// A value indicating reward points should be used; null to detect current choice of the customer + /// A value indicating whether we should use payment method additional fee when calculating order total + /// Shopping cart total;Null if shopping cart total couldn't be calculated now + public virtual decimal? GetShoppingCartTotal(IList cart, + bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true) + { + decimal discountAmount; + List appliedDiscounts; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + RewardPoints redeemedRewardPoints; + List appliedGiftCards; + TaxSummary taxSummary; + decimal earnedRewardPointsBaseAmount; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + + return GetShoppingCartTotal(cart, + out discountAmount, + out appliedDiscounts, + out subTotalAppliedDiscounts, + out shippingAppliedDiscounts, + out appliedGiftCards, + out redeemedRewardPoints, + out taxSummary, + out earnedRewardPointsBaseAmount, + includingTax, + useRewardPoints, + usePaymentMethodAdditionalFee); + } + + /// + /// Gets shopping cart total + /// + /// Cart + /// Applied discount amount + /// Applied discounts + /// Applied subtotal discounts + /// Applied shipping discounts + /// Applied gift cards + /// Redeemed reward points + /// Tax summary + /// Base amount for reward points to earn + /// A value indicating whether calculated amounts should include tax + /// A value indicating reward points should be used; null to detect current choice of the customer + /// A value indicating whether we should use payment method additional fee when calculating order total + /// Shopping cart total;Null if shopping cart total couldn't be calculated now + public virtual decimal? GetShoppingCartTotal(IList cart, + out decimal discountAmount, out List appliedDiscounts, + out List subTotalAppliedDiscounts, + out List shippingAppliedDiscounts, + out List appliedGiftCards, + out RewardPoints redeemedRewardPoints, + out TaxSummary taxSummary, + out decimal earnedRewardPointsBaseAmount, + bool? includingTax = null, + bool? useRewardPoints = null, bool usePaymentMethodAdditionalFee = true) + { + + redeemedRewardPoints = new RewardPoints(_rewardPointService); + + //order totals and tax + decimal shoppingCartTax = GetTaxTotal(cart, includingTax ?? _workContext.TaxDisplayType == TaxDisplayType.IncludingTax, out taxSummary, out appliedDiscounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out earnedRewardPointsBaseAmount, usePaymentMethodAdditionalFee, useRewardPoints); + discountAmount = taxSummary.TotalInvDiscAmount; + + + //No shipping method found, hence total can't be calculated + if (cart.RequiresShipping() && !taxSummary.TotalShippingAmount.HasValue) + { + //we have no total -> display total on checkout + return null; + } + + decimal orderTotal = taxSummary.TotalPaymentAmount; + + + //due to rounding of reward points and different reward points base amount corrections, ordertotal and earnedRewardPointsBaseAmount can be negative + if (orderTotal < decimal.Zero) + orderTotal = decimal.Zero; + + if (_shoppingCartSettings.RoundPricesDuringCalculation) + { + orderTotal = RoundingHelper.RoundAmount(orderTotal); + earnedRewardPointsBaseAmount = RoundingHelper.RoundAmount(earnedRewardPointsBaseAmount); + } + return orderTotal; + } + + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Orders/RewardPointService.cs b/src/Libraries/Nop.Services/Orders/RewardPointService.cs index babc354407d..b42ec9d0ed5 100644 --- a/src/Libraries/Nop.Services/Orders/RewardPointService.cs +++ b/src/Libraries/Nop.Services/Orders/RewardPointService.cs @@ -5,6 +5,7 @@ using Nop.Core.Domain.Customers; using Nop.Core.Domain.Orders; using Nop.Services.Events; +using Nop.Services.Catalog; namespace Nop.Services.Orders { @@ -19,6 +20,7 @@ public partial class RewardPointService : IRewardPointService private readonly RewardPointsSettings _rewardPointsSettings; private readonly IStoreContext _storeContext; private readonly IEventPublisher _eventPublisher; + private readonly ShoppingCartSettings _shoppingCartSettings; #endregion @@ -31,15 +33,18 @@ public partial class RewardPointService : IRewardPointService /// Reward points settings /// Store context /// Event published + /// Shopping cart settings public RewardPointService(IRepository rphRepository, RewardPointsSettings rewardPointsSettings, IStoreContext storeContext, - IEventPublisher eventPublisher) + IEventPublisher eventPublisher, + ShoppingCartSettings shoppingCartSettings) { this._rphRepository = rphRepository; this._rewardPointsSettings = rewardPointsSettings; this._storeContext = storeContext; this._eventPublisher = eventPublisher; + this._shoppingCartSettings = shoppingCartSettings; } #endregion @@ -56,7 +61,8 @@ protected void UpdateRewardPointsBalance(IQueryable query) query = query.OrderBy(rph => rph.CreatedOnUtc).ThenBy(rph => rph.Id); //get has not yet activated points, but it's time to do it - var notActivatedRph = query.Where(rph => !rph.PointsBalance.HasValue && rph.CreatedOnUtc < DateTime.UtcNow).ToList(); + //no need to search for !rph.PointsBalancePurchased.HasValue additionally to !rph.PointsBalance as both values will be set contemporarily + var notActivatedRph = query.Where(rph => (!rph.PointsBalance.HasValue) && rph.CreatedOnUtc < DateTime.UtcNow).ToList(); //nothing to update if (!notActivatedRph.Any()) @@ -64,17 +70,107 @@ protected void UpdateRewardPointsBalance(IQueryable query) //get current points balance, LINQ to entities does not support Last method, thus order by desc and use First one var lastActive = query.OrderByDescending(rph => rph.CreatedOnUtc).ThenByDescending(rph => rph.Id).FirstOrDefault(rph => rph.PointsBalance.HasValue); + //no need to get lastActivePurchased + //var lastActivePurchased = query.OrderByDescending(rph => rph.CreatedOnUtc).ThenByDescending(rph => rph.Id).FirstOrDefault(rph => rph.PointsBalancePurchased.HasValue); var currentPointsBalance = lastActive != null ? lastActive.PointsBalance : 0; + var currentPointsBalancePurchased = lastActive != null ? lastActive.PointsBalancePurchased : 0; //update appropriate records foreach (var rph in notActivatedRph) { rph.PointsBalance = currentPointsBalance + rph.Points; + rph.PointsBalancePurchased = currentPointsBalancePurchased + rph.PointsPurchased; UpdateRewardPointsHistoryEntry(rph); currentPointsBalance = rph.PointsBalance; + currentPointsBalancePurchased = rph.PointsBalancePurchased; } } + /// + /// Converts existing reward points to amount + /// + /// Reward points + /// Converted value + public virtual decimal ConvertRewardPointsToAmount(int rewardPoints) + { + //convert all + //if (rewardPoints <= 0) + // return decimal.Zero; + + var result = rewardPoints * _rewardPointsSettings.ExchangeRate; + if (_shoppingCartSettings.RoundPricesDuringCalculation) + result = RoundingHelper.RoundAmount(result); + return result; + } + + /// + /// Converts an amount to reward points + /// + /// Amount + /// Converted value + public virtual int ConvertAmountToRewardPoints(decimal amount, decimal? overridenExchangeRate = null) + { + int result = 0; + //convert all + //if (amount <= 0) + // return 0; + var exchangeRate = overridenExchangeRate.HasValue ? overridenExchangeRate.Value : _rewardPointsSettings.ExchangeRate; + + if (exchangeRate > 0) + result = (int)Math.Ceiling(amount / exchangeRate); + return result; + } + + /// + /// Gets a value indicating whether a customer has minimum amount of reward points to use (if enabled) + /// + /// Reward points to check + /// true - reward points could use; false - cannot be used. + public virtual bool CheckMinimumRewardPointsToUseRequirement(int rewardPoints) + { + if (_rewardPointsSettings.MinimumRewardPointsToUse <= 0) + return true; + + return rewardPoints >= _rewardPointsSettings.MinimumRewardPointsToUse; + } + + /// + /// Calculate how much reward points will be earned/reduced based on certain amount spent + /// + /// Customer + /// Base amount (in primary store currency) for points calculation + /// Number of reward points + public virtual int CalculateRewardPoints(Customer customer, decimal amount) + { + if (!_rewardPointsSettings.Enabled) + return 0; + + if (_rewardPointsSettings.PointsForPurchases_Amount <= decimal.Zero) + return 0; + + //ensure that reward points are applied only to registered users + if (customer == null || customer.IsGuest()) + return 0; + + var points = (int)Math.Truncate(amount / _rewardPointsSettings.PointsForPurchases_Amount * _rewardPointsSettings.PointsForPurchases_Points); + return points; + } + + /// + /// Calculate base amount for reward points calculation + /// + /// Base amount (in primary store currency) for points calculation + /// Amount of used purchased reward points + /// base amount + public virtual decimal GetRewardPointsBaseAmount(decimal amount, decimal purchasedPointsAmount) + { + if (_rewardPointsSettings.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints) + { + return Math.Min(amount, purchasedPointsAmount); + } + else + return amount; + } #endregion #region Methods @@ -119,15 +215,16 @@ public virtual IPagedList GetRewardPointsHistory(int custom /// Add reward points history record ///
/// Customer - /// Number of points to add + /// Reward points to add /// Store identifier /// Message /// The order for which points were redeemed (spent) as a payment - /// Used amount + /// Flag that indicates if passed amounts in points are used amounts /// Date and time of activating reward points; pass null to immediately activating + /// OrderItem used to purchase reward points /// Reward points history entry identifier - public virtual int AddRewardPointsHistoryEntry(Customer customer, int points, int storeId, string message = "", - Order usedWithOrder = null, decimal usedAmount = 0M, DateTime? activatingDate = null) + public virtual int AddRewardPointsHistoryEntry(Customer customer, RewardPoints rewardPoints, int storeId, string message = "", + Order usedWithOrder = null, bool hasUsedAmount = false, DateTime? activatingDate = null, OrderItem orderItem = null) { if (customer == null) throw new ArgumentNullException("customer"); @@ -135,16 +232,26 @@ public virtual int AddRewardPointsHistoryEntry(Customer customer, int points, in if (storeId <= 0) throw new ArgumentException("Store ID should be valid"); + RewardPoints rewardPointsBalance = new RewardPoints(this); + + if (!activatingDate.HasValue) + rewardPointsBalance = GetRewardPointsBalance(customer.Id, storeId); + var rph = new RewardPointsHistory { Customer = customer, StoreId = storeId, UsedWithOrder = usedWithOrder, - Points = points, - PointsBalance = activatingDate.HasValue ? null : (int?)(GetRewardPointsBalance(customer.Id, storeId) + points), - UsedAmount = usedAmount, + Points = rewardPoints.Points, + PointsPurchased = rewardPoints.PointsPurchased, + PointsBalance = activatingDate.HasValue ? null : (int?)(rewardPointsBalance.Points + rewardPoints.Points), + PointsBalancePurchased = activatingDate.HasValue ? null : (int?)(rewardPointsBalance.PointsPurchased + rewardPoints.PointsPurchased), + //revert sign of used amounts as rph entry has opposite sign + UsedAmount = hasUsedAmount ? -rewardPoints.Amount : 0M, + UsedAmountPurchased = hasUsedAmount ? -rewardPoints.AmountPurchased : 0M, Message = message, - CreatedOnUtc = activatingDate ?? DateTime.UtcNow + CreatedOnUtc = activatingDate ?? DateTime.UtcNow, + PurchasedWithOrderItem = orderItem }; _rphRepository.Insert(rph); @@ -160,9 +267,11 @@ public virtual int AddRewardPointsHistoryEntry(Customer customer, int points, in ///
/// Customer identifier /// Store identifier; pass - /// Balance - public virtual int GetRewardPointsBalance(int customerId, int storeId) + /// RewardPoints class + public virtual RewardPoints GetRewardPointsBalance(int customerId, int storeId) { + var result = new RewardPoints(this); + var query = _rphRepository.Table; if (customerId > 0) query = query.Where(rph => rph.CustomerId == customerId); @@ -178,7 +287,11 @@ public virtual int GetRewardPointsBalance(int customerId, int storeId) query = query.OrderByDescending(rph => rph.CreatedOnUtc).ThenByDescending(rph => rph.Id); var lastRph = query.FirstOrDefault(); - return lastRph != null && lastRph.PointsBalance.HasValue ? lastRph.PointsBalance.Value : 0; + var totBalance = lastRph != null && lastRph.PointsBalance.HasValue ? lastRph.PointsBalance.Value : 0; + var totBalancePurchased = lastRph != null && lastRph.PointsBalancePurchased.HasValue ? lastRph.PointsBalancePurchased.Value : 0; + result.Points = totBalance; + result.PointsPurchased = totBalancePurchased; + return result; } @@ -227,4 +340,4 @@ public virtual void UpdateRewardPointsHistoryEntry(RewardPointsHistory rewardPoi #endregion } -} +} \ No newline at end of file diff --git a/src/Libraries/Nop.Services/Orders/RewardPoints.cs b/src/Libraries/Nop.Services/Orders/RewardPoints.cs new file mode 100644 index 00000000000..baf5004406a --- /dev/null +++ b/src/Libraries/Nop.Services/Orders/RewardPoints.cs @@ -0,0 +1,83 @@ + + +using System; + +namespace Nop.Services.Orders +{ + /// + /// Reward points + /// + public class RewardPoints + { + #region Fields + private readonly IRewardPointService _rewardPointService; + #endregion + #region Ctor + /// + /// Ctor + /// + /// Reward point service + public RewardPoints(IRewardPointService rewardPointService) + { + this._rewardPointService = rewardPointService; + } + #endregion + /// + /// Points + /// + public int Points { get; set; } = 0; + /// + /// Points Amount. Same sign as points. + /// + public decimal Amount + { + get { return _rewardPointService.ConvertRewardPointsToAmount(Points); } + } + /// + /// Purchased Points + /// + public int PointsPurchased { get; set; } = 0; + /// + /// Purchased Points Amount. Same sign as points purchased. + /// + public decimal AmountPurchased + { + get { return _rewardPointService.ConvertRewardPointsToAmount(PointsPurchased); } + } + + /// + /// Total Points + /// + public int PointsTotal + { + get { return Points + PointsPurchased; } + } + /// + /// Total Points Amount + /// + public decimal AmountTotal + { + get { return Amount + AmountPurchased; } + } + /// + /// Total Points + /// + public int PointsTotalCorrectedForMinPointsToUse + { + get { return (_rewardPointService.CheckMinimumRewardPointsToUseRequirement(Math.Abs(Points)) ? Points : 0 ) + PointsPurchased; } + } + /// + /// Total Points Amount + /// + public decimal AmountTotalCorrectedForMinPointsToUse + { + get { return (_rewardPointService.CheckMinimumRewardPointsToUseRequirement(Math.Abs(Points)) ? Amount : decimal.Zero ) + AmountPurchased; } + } + + public void RevertSign() + { + Points = -Points; + PointsPurchased = -PointsPurchased; + } + } +} diff --git a/src/Libraries/Nop.Services/Orders/ShoppingCartExtensions.cs b/src/Libraries/Nop.Services/Orders/ShoppingCartExtensions.cs index eb9bb66a302..3ff04beb449 100644 --- a/src/Libraries/Nop.Services/Orders/ShoppingCartExtensions.cs +++ b/src/Libraries/Nop.Services/Orders/ShoppingCartExtensions.cs @@ -1,143 +1,159 @@ -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Core.Infrastructure; -using Nop.Services.Localization; - -namespace Nop.Services.Orders -{ - /// - /// Represents a shopping cart - /// - public static class ShoppingCartExtensions - { - /// - /// Indicates whether the shopping cart requires shipping - /// - /// Shopping cart - /// True if the shopping cart requires shipping; otherwise, false. - public static bool RequiresShipping(this IList shoppingCart) - { - foreach (var shoppingCartItem in shoppingCart) - if (shoppingCartItem.IsShipEnabled) - return true; - return false; - } - - /// - /// Gets a number of product in the cart - /// - /// Shopping cart - /// Result - public static int GetTotalProducts(this IList shoppingCart) - { - int result = 0; - foreach (ShoppingCartItem sci in shoppingCart) - { - result += sci.Quantity; - } - return result; - } - - /// - /// Gets a value indicating whether shopping cart is recurring - /// - /// Shopping cart - /// Result - public static bool IsRecurring(this IList shoppingCart) - { - foreach (ShoppingCartItem sci in shoppingCart) - { - var product = sci.Product; - if (product != null && product.IsRecurring) - return true; - } - return false; - } - - /// - /// Get a recurring cycle information - /// - /// Shopping cart - /// Localization service - /// Cycle length - /// Cycle period - /// Total cycles - /// Error (if exists); otherwise, empty string - public static string GetRecurringCycleInfo(this IList shoppingCart, - ILocalizationService localizationService, - out int cycleLength, out RecurringProductCyclePeriod cyclePeriod, out int totalCycles) - { - cycleLength = 0; - cyclePeriod = 0; - totalCycles = 0; - - int? _cycleLength = null; - RecurringProductCyclePeriod? _cyclePeriod = null; - int? _totalCycles = null; - - foreach (var sci in shoppingCart) - { - var product= sci.Product; - if (product == null) - { - throw new NopException(string.Format("Product (Id={0}) cannot be loaded", sci.ProductId)); - } - - if (product.IsRecurring) - { - string conflictError = localizationService.GetResource("ShoppingCart.ConflictingShipmentSchedules"); - - //cycle length - if (_cycleLength.HasValue && _cycleLength.Value != product.RecurringCycleLength) - return conflictError; - _cycleLength = product.RecurringCycleLength; - - //cycle period - if (_cyclePeriod.HasValue && _cyclePeriod.Value != product.RecurringCyclePeriod) - return conflictError; - _cyclePeriod = product.RecurringCyclePeriod; - - //total cycles - if (_totalCycles.HasValue && _totalCycles.Value != product.RecurringTotalCycles) - return conflictError; - _totalCycles = product.RecurringTotalCycles; - } - } - - if (_cycleLength.HasValue && _cyclePeriod.HasValue && _totalCycles.HasValue) - { - cycleLength = _cycleLength.Value; - cyclePeriod = _cyclePeriod.Value; - totalCycles = _totalCycles.Value; - } - - return ""; - } - - /// - /// Get customer of shopping cart - /// - /// Shopping cart - /// Customer of shopping cart - public static Customer GetCustomer(this IList shoppingCart) - { - if (!shoppingCart.Any()) - return null; - - return shoppingCart[0].Customer; - } - - public static IEnumerable LimitPerStore(this IEnumerable cart, int storeId) - { - var shoppingCartSettings = EngineContext.Current.Resolve(); - if (shoppingCartSettings.CartsSharedBetweenStores) - return cart; - - return cart.Where(x => x.StoreId == storeId); - } - } -} +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Core.Infrastructure; +using Nop.Services.Localization; + +namespace Nop.Services.Orders +{ + /// + /// Represents a shopping cart + /// + public static class ShoppingCartExtensions + { + /// + /// Indicates whether the shopping cart requires shipping + /// + /// Shopping cart + /// True if the shopping cart requires shipping; otherwise, false. + public static bool RequiresShipping(this IList shoppingCart) + { + foreach (var shoppingCartItem in shoppingCart) + if (shoppingCartItem.IsShipEnabled) + return true; + return false; + } + + /// + /// Gets a number of product in the cart + /// + /// Shopping cart + /// Result + public static int GetTotalProducts(this IList shoppingCart) + { + int result = 0; + foreach (ShoppingCartItem sci in shoppingCart) + { + result += sci.Quantity; + } + return result; + } + + /// + /// Gets a value indicating whether shopping cart is recurring + /// + /// Shopping cart + /// Result + public static bool IsRecurring(this IList shoppingCart) + { + foreach (ShoppingCartItem sci in shoppingCart) + { + var product = sci.Product; + if (product != null && product.IsRecurring) + return true; + } + return false; + } + + /// + /// Get a recurring cycle information + /// + /// Shopping cart + /// Localization service + /// Cycle length + /// Cycle period + /// Total cycles + /// Error (if exists); otherwise, empty string + public static string GetRecurringCycleInfo(this IList shoppingCart, + ILocalizationService localizationService, + out int cycleLength, out RecurringProductCyclePeriod cyclePeriod, out int totalCycles) + { + cycleLength = 0; + cyclePeriod = 0; + totalCycles = 0; + + int? _cycleLength = null; + RecurringProductCyclePeriod? _cyclePeriod = null; + int? _totalCycles = null; + + foreach (var sci in shoppingCart) + { + var product= sci.Product; + if (product == null) + { + throw new NopException(string.Format("Product (Id={0}) cannot be loaded", sci.ProductId)); + } + + if (product.IsRecurring) + { + string conflictError = localizationService.GetResource("ShoppingCart.ConflictingShipmentSchedules"); + + //cycle length + if (_cycleLength.HasValue && _cycleLength.Value != product.RecurringCycleLength) + return conflictError; + _cycleLength = product.RecurringCycleLength; + + //cycle period + if (_cyclePeriod.HasValue && _cyclePeriod.Value != product.RecurringCyclePeriod) + return conflictError; + _cyclePeriod = product.RecurringCyclePeriod; + + //total cycles + if (_totalCycles.HasValue && _totalCycles.Value != product.RecurringTotalCycles) + return conflictError; + _totalCycles = product.RecurringTotalCycles; + } + } + + if (_cycleLength.HasValue && _cyclePeriod.HasValue && _totalCycles.HasValue) + { + cycleLength = _cycleLength.Value; + cyclePeriod = _cyclePeriod.Value; + totalCycles = _totalCycles.Value; + } + + return ""; + } + + /// + /// Get customer of shopping cart + /// + /// Shopping cart + /// Customer of shopping cart + public static Customer GetCustomer(this IList shoppingCart) + { + if (!shoppingCart.Any()) + return null; + + return shoppingCart[0].Customer; + } + + public static IEnumerable LimitPerStore(this IEnumerable cart, int storeId) + { + var shoppingCartSettings = EngineContext.Current.Resolve(); + if (shoppingCartSettings.CartsSharedBetweenStores) + return cart; + + return cart.Where(x => x.StoreId == storeId); + } + + /// + /// Indicates whether the shopping cart has at least one purchased reward points product + /// + /// Shopping cart + /// True if the shopping cart conatins one reward points product; otherwise, false. + public static bool HasRewardPointsProduct(this IList shoppingCart) + { + foreach (ShoppingCartItem sci in shoppingCart) + { + var product = sci.Product; + if (product != null && product.IsRewardPoints) + return true; + } + return false; + } + } +} diff --git a/src/Libraries/Nop.Services/Orders/UpdateOrderParameters.cs b/src/Libraries/Nop.Services/Orders/UpdateOrderParameters.cs index d4af994fb77..287c1f8c70a 100644 --- a/src/Libraries/Nop.Services/Orders/UpdateOrderParameters.cs +++ b/src/Libraries/Nop.Services/Orders/UpdateOrderParameters.cs @@ -75,5 +75,7 @@ public UpdateOrderParameters() /// Pickup point ///
public PickupPoint PickupPoint { get; set; } + + public decimal TaxRate { get; set; } } } diff --git a/src/Libraries/Nop.Services/Payments/PaymentExtensions.cs b/src/Libraries/Nop.Services/Payments/PaymentExtensions.cs index abf7bb42c29..2ce5d878d38 100644 --- a/src/Libraries/Nop.Services/Payments/PaymentExtensions.cs +++ b/src/Libraries/Nop.Services/Payments/PaymentExtensions.cs @@ -1,208 +1,208 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Services.Orders; - -namespace Nop.Services.Payments -{ - /// - /// Payment extensions - /// - public static class PaymentExtensions - { - /// - /// Is payment method active? - /// - /// Payment method - /// Payment settings - /// Result - public static bool IsPaymentMethodActive(this IPaymentMethod paymentMethod, - PaymentSettings paymentSettings) - { - if (paymentMethod == null) - throw new ArgumentNullException("paymentMethod"); - - if (paymentSettings == null) - throw new ArgumentNullException("paymentSettings"); - - if (paymentSettings.ActivePaymentMethodSystemNames == null) - return false; - foreach (string activeMethodSystemName in paymentSettings.ActivePaymentMethodSystemNames) - if (paymentMethod.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase)) - return true; - return false; - } - - /// - /// Calculate payment method fee - /// - /// Payment method - /// Order total calculation service - /// Shopping cart - /// Fee value - /// Is fee amount specified as percentage or fixed value? - /// Result - public static decimal CalculateAdditionalFee(this IPaymentMethod paymentMethod, - IOrderTotalCalculationService orderTotalCalculationService, IList cart, - decimal fee, bool usePercentage) - { - if (paymentMethod == null) - throw new ArgumentNullException("paymentMethod"); - if (fee <= 0) - return fee; - - decimal result; - if (usePercentage) - { - //percentage - var orderTotalWithoutPaymentFee = orderTotalCalculationService.GetShoppingCartTotal(cart, usePaymentMethodAdditionalFee: false); - result = (decimal)((((float)orderTotalWithoutPaymentFee) * ((float)fee)) / 100f); - } - else - { - //fixed value - result = fee; - } - return result; - } - - - /// - /// Serialize CustomValues of ProcessPaymentRequest - /// - /// Request - /// Serialized CustomValues - public static string SerializeCustomValues(this ProcessPaymentRequest request) - { - if (request == null) - throw new ArgumentNullException("request"); - - if (!request.CustomValues.Any()) - return null; - - //XmlSerializer won't serialize objects that implement IDictionary by default. - //http://msdn.microsoft.com/en-us/magazine/cc164135.aspx - - //also see http://ropox.ru/tag/ixmlserializable/ (Russian language) - - var ds = new DictionarySerializer(request.CustomValues); - var xs = new XmlSerializer(typeof(DictionarySerializer)); - - using (var textWriter = new StringWriter()) - { - using (var xmlWriter = XmlWriter.Create(textWriter)) - { - xs.Serialize(xmlWriter, ds); - } - var result = textWriter.ToString(); - return result; - } - } - /// - /// Deerialize CustomValues of Order - /// - /// Order - /// Serialized CustomValues CustomValues - public static Dictionary DeserializeCustomValues(this Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - var request = new ProcessPaymentRequest(); - return request.DeserializeCustomValues(order.CustomValuesXml); - } - /// - /// Deerialize CustomValues of ProcessPaymentRequest - /// - /// Request - /// Serialized CustomValues - /// Serialized CustomValues CustomValues - public static Dictionary DeserializeCustomValues(this ProcessPaymentRequest request, string customValuesXml) - { - if (string.IsNullOrWhiteSpace(customValuesXml)) - { - return new Dictionary(); - } - - var serializer = new XmlSerializer(typeof(DictionarySerializer)); - - using (var textReader = new StringReader(customValuesXml)) - { - using (var xmlReader = XmlReader.Create(textReader)) - { - var ds = serializer.Deserialize(xmlReader) as DictionarySerializer; - if (ds != null) - return ds.Dictionary; - return new Dictionary(); - } - } - } - /// - /// Dictonary serializer - /// - public class DictionarySerializer : IXmlSerializable - { - public Dictionary Dictionary; - - public DictionarySerializer() - { - this.Dictionary = new Dictionary(); - } - - public DictionarySerializer(Dictionary dictionary) - { - this.Dictionary = dictionary; - } - - public void WriteXml(XmlWriter writer) - { - if (!Dictionary.Any()) - return; - - foreach (var key in this.Dictionary.Keys) - { - writer.WriteStartElement("item"); - writer.WriteElementString("key", key); - var value = this.Dictionary[key]; - //please note that we use ToString() for objects here - //of course, we can Serialize them - //but let's keep it simple and leave it for developers to handle it - //just put required serialization into ToString method of your object(s) - //because some objects don't implement ISerializable - //the question is how should we deserialize null values? - writer.WriteElementString("value", value != null ? value.ToString() : null); - writer.WriteEndElement(); - } - } - - public void ReadXml(XmlReader reader) - { - bool wasEmpty = reader.IsEmptyElement; - reader.Read(); - if (wasEmpty) - return; - while (reader.NodeType != XmlNodeType.EndElement) - { - reader.ReadStartElement("item"); - string key = reader.ReadElementString("key"); - string value = reader.ReadElementString("value"); - this.Dictionary.Add(key, value); - reader.ReadEndElement(); - reader.MoveToContent(); - } - reader.ReadEndElement(); - } - - public XmlSchema GetSchema() - { - return null; - } - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Services.Orders; + +namespace Nop.Services.Payments +{ + /// + /// Payment extensions + /// + public static class PaymentExtensions + { + /// + /// Is payment method active? + /// + /// Payment method + /// Payment settings + /// Result + public static bool IsPaymentMethodActive(this IPaymentMethod paymentMethod, + PaymentSettings paymentSettings) + { + if (paymentMethod == null) + throw new ArgumentNullException("paymentMethod"); + + if (paymentSettings == null) + throw new ArgumentNullException("paymentSettings"); + + if (paymentSettings.ActivePaymentMethodSystemNames == null) + return false; + foreach (string activeMethodSystemName in paymentSettings.ActivePaymentMethodSystemNames) + if (paymentMethod.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase)) + return true; + return false; + } + + /// + /// Calculate payment method fee + /// + /// Payment method + /// Order total calculation service + /// Shopping cart + /// Fee value + /// Is fee amount specified as percentage or fixed value? + /// Result + public static decimal CalculateAdditionalFee(this IPaymentMethod paymentMethod, + IOrderTotalCalculationService orderTotalCalculationService, IList cart, + decimal fee, bool usePercentage) + { + if (paymentMethod == null) + throw new ArgumentNullException("paymentMethod"); + if (fee == decimal.Zero) //tfc allow negative fee + return fee; + + decimal result; + if (usePercentage) + { + //percentage + var orderTotalWithoutPaymentFee = orderTotalCalculationService.GetShoppingCartTotal(cart, usePaymentMethodAdditionalFee: false); + result = (decimal)((((float)orderTotalWithoutPaymentFee) * ((float)fee)) / 100f); + } + else + { + //fixed value + result = fee; + } + return result; + } + + + /// + /// Serialize CustomValues of ProcessPaymentRequest + /// + /// Request + /// Serialized CustomValues + public static string SerializeCustomValues(this ProcessPaymentRequest request) + { + if (request == null) + throw new ArgumentNullException("request"); + + if (!request.CustomValues.Any()) + return null; + + //XmlSerializer won't serialize objects that implement IDictionary by default. + //http://msdn.microsoft.com/en-us/magazine/cc164135.aspx + + //also see http://ropox.ru/tag/ixmlserializable/ (Russian language) + + var ds = new DictionarySerializer(request.CustomValues); + var xs = new XmlSerializer(typeof(DictionarySerializer)); + + using (var textWriter = new StringWriter()) + { + using (var xmlWriter = XmlWriter.Create(textWriter)) + { + xs.Serialize(xmlWriter, ds); + } + var result = textWriter.ToString(); + return result; + } + } + /// + /// Deerialize CustomValues of Order + /// + /// Order + /// Serialized CustomValues CustomValues + public static Dictionary DeserializeCustomValues(this Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + var request = new ProcessPaymentRequest(); + return request.DeserializeCustomValues(order.CustomValuesXml); + } + /// + /// Deerialize CustomValues of ProcessPaymentRequest + /// + /// Request + /// Serialized CustomValues + /// Serialized CustomValues CustomValues + public static Dictionary DeserializeCustomValues(this ProcessPaymentRequest request, string customValuesXml) + { + if (string.IsNullOrWhiteSpace(customValuesXml)) + { + return new Dictionary(); + } + + var serializer = new XmlSerializer(typeof(DictionarySerializer)); + + using (var textReader = new StringReader(customValuesXml)) + { + using (var xmlReader = XmlReader.Create(textReader)) + { + var ds = serializer.Deserialize(xmlReader) as DictionarySerializer; + if (ds != null) + return ds.Dictionary; + return new Dictionary(); + } + } + } + /// + /// Dictonary serializer + /// + public class DictionarySerializer : IXmlSerializable + { + public Dictionary Dictionary; + + public DictionarySerializer() + { + this.Dictionary = new Dictionary(); + } + + public DictionarySerializer(Dictionary dictionary) + { + this.Dictionary = dictionary; + } + + public void WriteXml(XmlWriter writer) + { + if (!Dictionary.Any()) + return; + + foreach (var key in this.Dictionary.Keys) + { + writer.WriteStartElement("item"); + writer.WriteElementString("key", key); + var value = this.Dictionary[key]; + //please note that we use ToString() for objects here + //of course, we can Serialize them + //but let's keep it simple and leave it for developers to handle it + //just put required serialization into ToString method of your object(s) + //because some objects don't implement ISerializable + //the question is how should we deserialize null values? + writer.WriteElementString("value", value != null ? value.ToString() : null); + writer.WriteEndElement(); + } + } + + public void ReadXml(XmlReader reader) + { + bool wasEmpty = reader.IsEmptyElement; + reader.Read(); + if (wasEmpty) + return; + while (reader.NodeType != XmlNodeType.EndElement) + { + reader.ReadStartElement("item"); + string key = reader.ReadElementString("key"); + string value = reader.ReadElementString("value"); + this.Dictionary.Add(key, value); + reader.ReadEndElement(); + reader.MoveToContent(); + } + reader.ReadEndElement(); + } + + public XmlSchema GetSchema() + { + return null; + } + } + } +} diff --git a/src/Libraries/Nop.Services/Payments/PaymentService.cs b/src/Libraries/Nop.Services/Payments/PaymentService.cs index 6fe9c008895..d69362838f7 100644 --- a/src/Libraries/Nop.Services/Payments/PaymentService.cs +++ b/src/Libraries/Nop.Services/Payments/PaymentService.cs @@ -1,418 +1,419 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Plugins; -using Nop.Services.Catalog; -using Nop.Services.Configuration; - -namespace Nop.Services.Payments -{ - /// - /// Payment service - /// - public partial class PaymentService : IPaymentService - { - #region Fields - - private readonly PaymentSettings _paymentSettings; - private readonly IPluginFinder _pluginFinder; - private readonly ISettingService _settingService; - private readonly ShoppingCartSettings _shoppingCartSettings; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Payment settings - /// Plugin finder - /// Setting service - /// Shopping cart settings - public PaymentService(PaymentSettings paymentSettings, - IPluginFinder pluginFinder, - ISettingService settingService, - ShoppingCartSettings shoppingCartSettings) - { - this._paymentSettings = paymentSettings; - this._pluginFinder = pluginFinder; - this._settingService = settingService; - this._shoppingCartSettings = shoppingCartSettings; - } - - #endregion - - #region Methods - - #region Payment methods - - /// - /// Load active payment methods - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Load records allowed only in a specified store; pass 0 to load all records - /// Load records allowed only in a specified country; pass 0 to load all records - /// Payment methods - public virtual IList LoadActivePaymentMethods(Customer customer = null, int storeId = 0, int filterByCountryId = 0) - { - return LoadAllPaymentMethods(customer, storeId, filterByCountryId) - .Where(provider => _paymentSettings.ActivePaymentMethodSystemNames - .Contains(provider.PluginDescriptor.SystemName, StringComparer.InvariantCultureIgnoreCase)).ToList(); - } - - /// - /// Load payment provider by system name - /// - /// System name - /// Found payment provider - public virtual IPaymentMethod LoadPaymentMethodBySystemName(string systemName) - { - var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); - if (descriptor != null) - return descriptor.Instance(); - - return null; - } - - /// - /// Load all payment providers - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Load records allowed only in a specified store; pass 0 to load all records - /// Load records allowed only in a specified country; pass 0 to load all records - /// Payment providers - public virtual IList LoadAllPaymentMethods(Customer customer = null, int storeId = 0, int filterByCountryId = 0) - { - var paymentMethods = _pluginFinder.GetPlugins(customer: customer, storeId: storeId).ToList(); - if (filterByCountryId == 0) - return paymentMethods; - - //filter by country - var paymentMetodsByCountry = new List(); - foreach (var pm in paymentMethods) - { - var restictedCountryIds = GetRestictedCountryIds(pm); - if (!restictedCountryIds.Contains(filterByCountryId)) - { - paymentMetodsByCountry.Add(pm); - } - } - - return paymentMetodsByCountry; - } - - #endregion - - #region Restrictions - - /// - /// Gets a list of coutnry identifiers in which a certain payment method is now allowed - /// - /// Payment method - /// A list of country identifiers - public virtual IList GetRestictedCountryIds(IPaymentMethod paymentMethod) - { - if (paymentMethod == null) - throw new ArgumentNullException("paymentMethod"); - - var settingKey = string.Format("PaymentMethodRestictions.{0}", paymentMethod.PluginDescriptor.SystemName); - var restictedCountryIds = _settingService.GetSettingByKey>(settingKey); - if (restictedCountryIds == null) - restictedCountryIds = new List(); - return restictedCountryIds; - } - - /// - /// Saves a list of coutnry identifiers in which a certain payment method is now allowed - /// - /// Payment method - /// A list of country identifiers - public virtual void SaveRestictedCountryIds(IPaymentMethod paymentMethod, List countryIds) - { - if (paymentMethod == null) - throw new ArgumentNullException("paymentMethod"); - - //we should be sure that countryIds is of type List (not IList) - var settingKey = string.Format("PaymentMethodRestictions.{0}", paymentMethod.PluginDescriptor.SystemName); - _settingService.SetSetting(settingKey, countryIds); - } - - #endregion - - #region Processing - - /// - /// Process a payment - /// - /// Payment info required for an order processing - /// Process payment result - public virtual ProcessPaymentResult ProcessPayment(ProcessPaymentRequest processPaymentRequest) - { - if (processPaymentRequest.OrderTotal == decimal.Zero) - { - var result = new ProcessPaymentResult - { - NewPaymentStatus = PaymentStatus.Paid - }; - return result; - } - - //We should strip out any white space or dash in the CC number entered. - if (!String.IsNullOrWhiteSpace(processPaymentRequest.CreditCardNumber)) - { - processPaymentRequest.CreditCardNumber = processPaymentRequest.CreditCardNumber.Replace(" ", ""); - processPaymentRequest.CreditCardNumber = processPaymentRequest.CreditCardNumber.Replace("-", ""); - } - var paymentMethod = LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.ProcessPayment(processPaymentRequest); - } - - /// - /// Post process payment (used by payment gateways that require redirecting to a third-party URL) - /// - /// Payment info required for an order processing - public virtual void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest) - { - //already paid or order.OrderTotal == decimal.Zero - if (postProcessPaymentRequest.Order.PaymentStatus == PaymentStatus.Paid) - return; - - var paymentMethod = LoadPaymentMethodBySystemName(postProcessPaymentRequest.Order.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - paymentMethod.PostProcessPayment(postProcessPaymentRequest); - } - - /// - /// Gets a value indicating whether customers can complete a payment after order is placed but not completed (for redirection payment methods) - /// - /// Order - /// Result - public virtual bool CanRePostProcessPayment(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (!_paymentSettings.AllowRePostingPayments) - return false; - - var paymentMethod = LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); - if (paymentMethod == null) - return false; //Payment method couldn't be loaded (for example, was uninstalled) - - if (paymentMethod.PaymentMethodType != PaymentMethodType.Redirection) - return false; //this option is available only for redirection payment methods - - if (order.Deleted) - return false; //do not allow for deleted orders - - if (order.OrderStatus == OrderStatus.Cancelled) - return false; //do not allow for cancelled orders - - if (order.PaymentStatus != PaymentStatus.Pending) - return false; //payment status should be Pending - - return paymentMethod.CanRePostProcessPayment(order); - } - - /// - /// Gets an additional handling fee of a payment method - /// - /// Shoping cart - /// Payment method system name - /// Additional handling fee - public virtual decimal GetAdditionalHandlingFee(IList cart, string paymentMethodSystemName) - { - if (String.IsNullOrEmpty(paymentMethodSystemName)) - return decimal.Zero; - - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return decimal.Zero; - - decimal result = paymentMethod.GetAdditionalHandlingFee(cart); - if (result < decimal.Zero) - result = decimal.Zero; - if (_shoppingCartSettings.RoundPricesDuringCalculation) - { - result = RoundingHelper.RoundPrice(result); - } - return result; - } - - /// - /// Gets a value indicating whether capture is supported by payment method - /// - /// Payment method system name - /// A value indicating whether capture is supported - public virtual bool SupportCapture(string paymentMethodSystemName) - { - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return false; - return paymentMethod.SupportCapture; - } - - /// - /// Captures payment - /// - /// Capture payment request - /// Capture payment result - public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest) - { - var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.Capture(capturePaymentRequest); - } - - /// - /// Gets a value indicating whether partial refund is supported by payment method - /// - /// Payment method system name - /// A value indicating whether partial refund is supported - public virtual bool SupportPartiallyRefund(string paymentMethodSystemName) - { - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return false; - return paymentMethod.SupportPartiallyRefund; - } - - /// - /// Gets a value indicating whether refund is supported by payment method - /// - /// Payment method system name - /// A value indicating whether refund is supported - public virtual bool SupportRefund(string paymentMethodSystemName) - { - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return false; - return paymentMethod.SupportRefund; - } - - /// - /// Refunds a payment - /// - /// Request - /// Result - public virtual RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequest) - { - var paymentMethod = LoadPaymentMethodBySystemName(refundPaymentRequest.Order.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.Refund(refundPaymentRequest); - } - - /// - /// Gets a value indicating whether void is supported by payment method - /// - /// Payment method system name - /// A value indicating whether void is supported - public virtual bool SupportVoid(string paymentMethodSystemName) - { - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return false; - return paymentMethod.SupportVoid; - } - - /// - /// Voids a payment - /// - /// Request - /// Result - public virtual VoidPaymentResult Void(VoidPaymentRequest voidPaymentRequest) - { - var paymentMethod = LoadPaymentMethodBySystemName(voidPaymentRequest.Order.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.Void(voidPaymentRequest); - } - - /// - /// Gets a recurring payment type of payment method - /// - /// Payment method system name - /// A recurring payment type of payment method - public virtual RecurringPaymentType GetRecurringPaymentType(string paymentMethodSystemName) - { - var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); - if (paymentMethod == null) - return RecurringPaymentType.NotSupported; - return paymentMethod.RecurringPaymentType; - } - - /// - /// Process recurring payment - /// - /// Payment info required for an order processing - /// Process payment result - public virtual ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) - { - if (processPaymentRequest.OrderTotal == decimal.Zero) - { - var result = new ProcessPaymentResult - { - NewPaymentStatus = PaymentStatus.Paid - }; - return result; - } - - var paymentMethod = LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.ProcessRecurringPayment(processPaymentRequest); - } - - /// - /// Cancels a recurring payment - /// - /// Request - /// Result - public virtual CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurringPaymentRequest cancelPaymentRequest) - { - if (cancelPaymentRequest.Order.OrderTotal == decimal.Zero) - return new CancelRecurringPaymentResult(); - - var paymentMethod = LoadPaymentMethodBySystemName(cancelPaymentRequest.Order.PaymentMethodSystemName); - if (paymentMethod == null) - throw new NopException("Payment method couldn't be loaded"); - return paymentMethod.CancelRecurringPayment(cancelPaymentRequest); - } - - /// - /// Gets masked credit card number - /// - /// Credit card number - /// Masked credit card number - public virtual string GetMaskedCreditCardNumber(string creditCardNumber) - { - if (String.IsNullOrEmpty(creditCardNumber)) - return string.Empty; - - if (creditCardNumber.Length <= 4) - return creditCardNumber; - - string last4 = creditCardNumber.Substring(creditCardNumber.Length - 4, 4); - string maskedChars = string.Empty; - for (int i = 0; i < creditCardNumber.Length - 4; i++) - { - maskedChars += "*"; - } - return maskedChars + last4; - } - - #endregion - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Plugins; +using Nop.Services.Catalog; +using Nop.Services.Configuration; + +namespace Nop.Services.Payments +{ + /// + /// Payment service + /// + public partial class PaymentService : IPaymentService + { + #region Fields + + private readonly PaymentSettings _paymentSettings; + private readonly IPluginFinder _pluginFinder; + private readonly ISettingService _settingService; + private readonly ShoppingCartSettings _shoppingCartSettings; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Payment settings + /// Plugin finder + /// Setting service + /// Shopping cart settings + public PaymentService(PaymentSettings paymentSettings, + IPluginFinder pluginFinder, + ISettingService settingService, + ShoppingCartSettings shoppingCartSettings) + { + this._paymentSettings = paymentSettings; + this._pluginFinder = pluginFinder; + this._settingService = settingService; + this._shoppingCartSettings = shoppingCartSettings; + } + + #endregion + + #region Methods + + #region Payment methods + + /// + /// Load active payment methods + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Load records allowed only in a specified store; pass 0 to load all records + /// Load records allowed only in a specified country; pass 0 to load all records + /// Payment methods + public virtual IList LoadActivePaymentMethods(Customer customer = null, int storeId = 0, int filterByCountryId = 0) + { + return LoadAllPaymentMethods(customer, storeId, filterByCountryId) + .Where(provider => _paymentSettings.ActivePaymentMethodSystemNames + .Contains(provider.PluginDescriptor.SystemName, StringComparer.InvariantCultureIgnoreCase)).ToList(); + } + + /// + /// Load payment provider by system name + /// + /// System name + /// Found payment provider + public virtual IPaymentMethod LoadPaymentMethodBySystemName(string systemName) + { + var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); + if (descriptor != null) + return descriptor.Instance(); + + return null; + } + + /// + /// Load all payment providers + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Load records allowed only in a specified store; pass 0 to load all records + /// Load records allowed only in a specified country; pass 0 to load all records + /// Payment providers + public virtual IList LoadAllPaymentMethods(Customer customer = null, int storeId = 0, int filterByCountryId = 0) + { + var paymentMethods = _pluginFinder.GetPlugins(customer: customer, storeId: storeId).ToList(); + if (filterByCountryId == 0) + return paymentMethods; + + //filter by country + var paymentMetodsByCountry = new List(); + foreach (var pm in paymentMethods) + { + var restictedCountryIds = GetRestictedCountryIds(pm); + if (!restictedCountryIds.Contains(filterByCountryId)) + { + paymentMetodsByCountry.Add(pm); + } + } + + return paymentMetodsByCountry; + } + + #endregion + + #region Restrictions + + /// + /// Gets a list of coutnry identifiers in which a certain payment method is now allowed + /// + /// Payment method + /// A list of country identifiers + public virtual IList GetRestictedCountryIds(IPaymentMethod paymentMethod) + { + if (paymentMethod == null) + throw new ArgumentNullException("paymentMethod"); + + var settingKey = string.Format("PaymentMethodRestictions.{0}", paymentMethod.PluginDescriptor.SystemName); + var restictedCountryIds = _settingService.GetSettingByKey>(settingKey); + if (restictedCountryIds == null) + restictedCountryIds = new List(); + return restictedCountryIds; + } + + /// + /// Saves a list of coutnry identifiers in which a certain payment method is now allowed + /// + /// Payment method + /// A list of country identifiers + public virtual void SaveRestictedCountryIds(IPaymentMethod paymentMethod, List countryIds) + { + if (paymentMethod == null) + throw new ArgumentNullException("paymentMethod"); + + //we should be sure that countryIds is of type List (not IList) + var settingKey = string.Format("PaymentMethodRestictions.{0}", paymentMethod.PluginDescriptor.SystemName); + _settingService.SetSetting(settingKey, countryIds); + } + + #endregion + + #region Processing + + /// + /// Process a payment + /// + /// Payment info required for an order processing + /// Process payment result + public virtual ProcessPaymentResult ProcessPayment(ProcessPaymentRequest processPaymentRequest) + { + if (processPaymentRequest.OrderTotal == decimal.Zero) + { + var result = new ProcessPaymentResult + { + NewPaymentStatus = PaymentStatus.Paid + }; + return result; + } + + //We should strip out any white space or dash in the CC number entered. + if (!String.IsNullOrWhiteSpace(processPaymentRequest.CreditCardNumber)) + { + processPaymentRequest.CreditCardNumber = processPaymentRequest.CreditCardNumber.Replace(" ", ""); + processPaymentRequest.CreditCardNumber = processPaymentRequest.CreditCardNumber.Replace("-", ""); + } + var paymentMethod = LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.ProcessPayment(processPaymentRequest); + } + + /// + /// Post process payment (used by payment gateways that require redirecting to a third-party URL) + /// + /// Payment info required for an order processing + public virtual void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest) + { + //already paid or order.OrderTotal == decimal.Zero + if (postProcessPaymentRequest.Order.PaymentStatus == PaymentStatus.Paid) + return; + + var paymentMethod = LoadPaymentMethodBySystemName(postProcessPaymentRequest.Order.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + paymentMethod.PostProcessPayment(postProcessPaymentRequest); + } + + /// + /// Gets a value indicating whether customers can complete a payment after order is placed but not completed (for redirection payment methods) + /// + /// Order + /// Result + public virtual bool CanRePostProcessPayment(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (!_paymentSettings.AllowRePostingPayments) + return false; + + var paymentMethod = LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); + if (paymentMethod == null) + return false; //Payment method couldn't be loaded (for example, was uninstalled) + + if (paymentMethod.PaymentMethodType != PaymentMethodType.Redirection) + return false; //this option is available only for redirection payment methods + + if (order.Deleted) + return false; //do not allow for deleted orders + + if (order.OrderStatus == OrderStatus.Cancelled) + return false; //do not allow for cancelled orders + + if (order.PaymentStatus != PaymentStatus.Pending) + return false; //payment status should be Pending + + return paymentMethod.CanRePostProcessPayment(order); + } + + /// + /// Gets an additional handling fee of a payment method + /// + /// Shoping cart + /// Payment method system name + /// Additional handling fee + public virtual decimal GetAdditionalHandlingFee(IList cart, string paymentMethodSystemName) + { + if (String.IsNullOrEmpty(paymentMethodSystemName)) + return decimal.Zero; + + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return decimal.Zero; + + decimal result = paymentMethod.GetAdditionalHandlingFee(cart); + //tfc allow negative fee + //if (result < decimal.Zero) + // result = decimal.Zero; + if (_shoppingCartSettings.RoundPricesDuringCalculation) + { + result = RoundingHelper.RoundAmount(result); + } + return result; + } + + /// + /// Gets a value indicating whether capture is supported by payment method + /// + /// Payment method system name + /// A value indicating whether capture is supported + public virtual bool SupportCapture(string paymentMethodSystemName) + { + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return false; + return paymentMethod.SupportCapture; + } + + /// + /// Captures payment + /// + /// Capture payment request + /// Capture payment result + public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest) + { + var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.Capture(capturePaymentRequest); + } + + /// + /// Gets a value indicating whether partial refund is supported by payment method + /// + /// Payment method system name + /// A value indicating whether partial refund is supported + public virtual bool SupportPartiallyRefund(string paymentMethodSystemName) + { + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return false; + return paymentMethod.SupportPartiallyRefund; + } + + /// + /// Gets a value indicating whether refund is supported by payment method + /// + /// Payment method system name + /// A value indicating whether refund is supported + public virtual bool SupportRefund(string paymentMethodSystemName) + { + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return false; + return paymentMethod.SupportRefund; + } + + /// + /// Refunds a payment + /// + /// Request + /// Result + public virtual RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequest) + { + var paymentMethod = LoadPaymentMethodBySystemName(refundPaymentRequest.Order.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.Refund(refundPaymentRequest); + } + + /// + /// Gets a value indicating whether void is supported by payment method + /// + /// Payment method system name + /// A value indicating whether void is supported + public virtual bool SupportVoid(string paymentMethodSystemName) + { + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return false; + return paymentMethod.SupportVoid; + } + + /// + /// Voids a payment + /// + /// Request + /// Result + public virtual VoidPaymentResult Void(VoidPaymentRequest voidPaymentRequest) + { + var paymentMethod = LoadPaymentMethodBySystemName(voidPaymentRequest.Order.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.Void(voidPaymentRequest); + } + + /// + /// Gets a recurring payment type of payment method + /// + /// Payment method system name + /// A recurring payment type of payment method + public virtual RecurringPaymentType GetRecurringPaymentType(string paymentMethodSystemName) + { + var paymentMethod = LoadPaymentMethodBySystemName(paymentMethodSystemName); + if (paymentMethod == null) + return RecurringPaymentType.NotSupported; + return paymentMethod.RecurringPaymentType; + } + + /// + /// Process recurring payment + /// + /// Payment info required for an order processing + /// Process payment result + public virtual ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) + { + if (processPaymentRequest.OrderTotal == decimal.Zero) + { + var result = new ProcessPaymentResult + { + NewPaymentStatus = PaymentStatus.Paid + }; + return result; + } + + var paymentMethod = LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.ProcessRecurringPayment(processPaymentRequest); + } + + /// + /// Cancels a recurring payment + /// + /// Request + /// Result + public virtual CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurringPaymentRequest cancelPaymentRequest) + { + if (cancelPaymentRequest.Order.OrderTotal == decimal.Zero) + return new CancelRecurringPaymentResult(); + + var paymentMethod = LoadPaymentMethodBySystemName(cancelPaymentRequest.Order.PaymentMethodSystemName); + if (paymentMethod == null) + throw new NopException("Payment method couldn't be loaded"); + return paymentMethod.CancelRecurringPayment(cancelPaymentRequest); + } + + /// + /// Gets masked credit card number + /// + /// Credit card number + /// Masked credit card number + public virtual string GetMaskedCreditCardNumber(string creditCardNumber) + { + if (String.IsNullOrEmpty(creditCardNumber)) + return string.Empty; + + if (creditCardNumber.Length <= 4) + return creditCardNumber; + + string last4 = creditCardNumber.Substring(creditCardNumber.Length - 4, 4); + string maskedChars = string.Empty; + for (int i = 0; i < creditCardNumber.Length - 4; i++) + { + maskedChars += "*"; + } + return maskedChars + last4; + } + + #endregion + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Tax/ITaxService.cs b/src/Libraries/Nop.Services/Tax/ITaxService.cs index 53a86303cce..8834a811ec1 100644 --- a/src/Libraries/Nop.Services/Tax/ITaxService.cs +++ b/src/Libraries/Nop.Services/Tax/ITaxService.cs @@ -1,266 +1,287 @@ -using System; -using System.Collections.Generic; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Tax; - -namespace Nop.Services.Tax -{ - /// - /// Tax service - /// - public partial interface ITaxService - { - #region Tax providers - - /// - /// Load active tax provider - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Active tax provider - ITaxProvider LoadActiveTaxProvider(Customer customer = null); - - /// - /// Load tax provider by system name - /// - /// System name - /// Found tax provider - ITaxProvider LoadTaxProviderBySystemName(string systemName); - - /// - /// Load all tax providers - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Tax providers - IList LoadAllTaxProviders(Customer customer = null); - - #endregion - - #region Product price - - /// - /// Gets price - /// - /// Product - /// Price - /// Tax rate - /// Price - decimal GetProductPrice(Product product, decimal price, - out decimal taxRate); - - /// - /// Gets price - /// - /// Product - /// Price - /// Customer - /// Tax rate - /// Price - decimal GetProductPrice(Product product, decimal price, - Customer customer, out decimal taxRate); - - /// - /// Gets price - /// - /// Product - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - decimal GetProductPrice(Product product, decimal price, - bool includingTax, Customer customer, out decimal taxRate); - - /// - /// Gets price - /// - /// Product - /// Tax category identifier - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// A value indicating whether price already includes tax - /// Tax rate - /// Price - decimal GetProductPrice(Product product, int taxCategoryId, decimal price, - bool includingTax, Customer customer, - bool priceIncludesTax, out decimal taxRate); - - #endregion - - #region Shipping price - - /// - /// Gets shipping price - /// - /// Price - /// Customer - /// Price - decimal GetShippingPrice(decimal price, Customer customer); - - /// - /// Gets shipping price - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - decimal GetShippingPrice(decimal price, bool includingTax, Customer customer); - - /// - /// Gets shipping price - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - decimal GetShippingPrice(decimal price, bool includingTax, Customer customer, out decimal taxRate); - - #endregion - - #region Payment additional fee - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// Customer - /// Price - decimal GetPaymentMethodAdditionalFee(decimal price, Customer customer); - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer); - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer, out decimal taxRate); - - #endregion - - #region Checkout attribute price - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// Price - decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav); - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// Customer - /// Price - decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, Customer customer); - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, - bool includingTax, Customer customer); - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, - bool includingTax, Customer customer, out decimal taxRate); - - #endregion - - #region VAT - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) - /// VAT Number status - VatNumberStatus GetVatNumberStatus(string fullVatNumber); - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) - /// Name (if received) - /// Address (if received) - /// VAT Number status - VatNumberStatus GetVatNumberStatus(string fullVatNumber, - out string name, out string address); - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country - /// VAT number - /// VAT Number status - VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber); - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country - /// VAT number - /// Name (if received) - /// Address (if received) - /// VAT Number status - VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber, - out string name, out string address); - - /// - /// Performs a basic check of a VAT number for validity - /// - /// Two letter ISO code of a country - /// VAT number - /// Company name - /// Address - /// Exception - /// VAT number status - VatNumberStatus DoVatCheck(string twoLetterIsoCode, string vatNumber, - out string name, out string address, out Exception exception); - - #endregion - - #region Exempts - - /// - /// Gets a value indicating whether a product is tax exempt - /// - /// Product - /// Customer - /// A value indicating whether a product is tax exempt - bool IsTaxExempt(Product product, Customer customer); - - /// - /// Gets a value indicating whether EU VAT exempt (the European Union Value Added Tax) - /// - /// Address - /// Customer - /// Result - bool IsVatExempt(Address address, Customer customer); - - #endregion - } -} +using System; +using System.Collections.Generic; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Tax; + +namespace Nop.Services.Tax +{ + /// + /// Tax service + /// + public partial interface ITaxService + { + #region Tax providers + + /// + /// Load active tax provider + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Active tax provider + ITaxProvider LoadActiveTaxProvider(Customer customer = null); + + /// + /// Load tax provider by system name + /// + /// System name + /// Found tax provider + ITaxProvider LoadTaxProviderBySystemName(string systemName); + + /// + /// Load all tax providers + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Tax providers + IList LoadAllTaxProviders(Customer customer = null); + + #endregion + + #region Product price + + /// + /// Gets price + /// + /// Product + /// Price + /// Tax rate + /// Price + decimal GetProductPrice(Product product, decimal price, + out decimal taxRate); + + /// + /// Gets price using tax attributes + /// + /// Product + /// Price + /// Tax rate + /// Product atrributes (XML format) + /// Optional value indicating whether calculated price should include tax + /// Price + decimal GetProductPrice(Product product, decimal price, + out decimal taxRate, ref string attributesXml, bool? includingTax = null); + + /// + /// Gets price + /// + /// Product + /// Price + /// Customer + /// Tax rate + /// Price + decimal GetProductPrice(Product product, decimal price, + Customer customer, out decimal taxRate); + + /// + /// Gets price + /// + /// Product + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + decimal GetProductPrice(Product product, decimal price, + bool includingTax, Customer customer, out decimal taxRate); + + /// + /// Gets price + /// + /// Product + /// Tax category identifier + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// A value indicating whether price already includes tax + /// Tax rate + /// Product atrributes (XML format) + /// Price + decimal GetProductPrice(Product product, int taxCategoryId, decimal price, + bool includingTax, Customer customer, + bool priceIncludesTax, out decimal taxRate, ref string attributesXml); + + #endregion + + #region Shipping price + + /// + /// Gets shipping price + /// + /// Price + /// Customer + /// Price + decimal GetShippingPrice(decimal price, Customer customer); + + /// + /// Gets shipping price + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + decimal GetShippingPrice(decimal price, bool includingTax, Customer customer); + + /// + /// Gets shipping price + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + decimal GetShippingPrice(decimal price, bool includingTax, Customer customer, out decimal taxRate); + + #endregion + + #region Payment additional fee + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// Customer + /// Price + decimal GetPaymentMethodAdditionalFee(decimal price, Customer customer); + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer); + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer, out decimal taxRate); + + #endregion + + #region Checkout attribute price + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// Price + decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav); + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// Customer + /// Price + decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, Customer customer); + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, + bool includingTax, Customer customer); + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, + bool includingTax, Customer customer, out decimal taxRate); + + #endregion + + #region VAT + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) + /// VAT Number status + VatNumberStatus GetVatNumberStatus(string fullVatNumber); + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) + /// Name (if received) + /// Address (if received) + /// VAT Number status + VatNumberStatus GetVatNumberStatus(string fullVatNumber, + out string name, out string address); + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country + /// VAT number + /// VAT Number status + VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber); + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country + /// VAT number + /// Name (if received) + /// Address (if received) + /// VAT Number status + VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber, + out string name, out string address); + + /// + /// Performs a basic check of a VAT number for validity + /// + /// Two letter ISO code of a country + /// VAT number + /// Company name + /// Address + /// Exception + /// VAT number status + VatNumberStatus DoVatCheck(string twoLetterIsoCode, string vatNumber, + out string name, out string address, out Exception exception); + + #endregion + + #region Exempts + + /// + /// Gets a value indicating whether a product is tax exempt + /// + /// Product + /// Customer + /// A value indicating whether a product is tax exempt + bool IsTaxExempt(Product product, Customer customer); + + /// + /// Gets a value indicating whether EU VAT exempt (the European Union Value Added Tax) + /// + /// Address + /// Customer + /// Result + bool IsVatExempt(Address address, Customer customer); + + #endregion + + #region utilities + /// + /// Get a value indicating whether prices do include tax + /// + /// Result + bool PricesIncludeTax(); + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Tax/TaxService.cs b/src/Libraries/Nop.Services/Tax/TaxService.cs index 656859122c8..927955e2ec4 100644 --- a/src/Libraries/Nop.Services/Tax/TaxService.cs +++ b/src/Libraries/Nop.Services/Tax/TaxService.cs @@ -1,851 +1,933 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Core.Plugins; -using Nop.Services.Common; -using Nop.Services.Directory; -using Nop.Services.Logging; - -namespace Nop.Services.Tax -{ - /// - /// Tax service - /// - public partial class TaxService : ITaxService - { - #region Fields - - private readonly IAddressService _addressService; - private readonly IWorkContext _workContext; - private readonly IStoreContext _storeContext; - private readonly TaxSettings _taxSettings; - private readonly IPluginFinder _pluginFinder; - private readonly IGeoLookupService _geoLookupService; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly ILogger _logger; - private readonly CustomerSettings _customerSettings; - private readonly ShippingSettings _shippingSettings; - private readonly AddressSettings _addressSettings; - - #endregion - - #region Ctor - - /// - /// Ctor - /// - /// Address service - /// Work context - /// Store context - /// Tax settings - /// Plugin finder - /// GEO lookup service - /// Country service - /// State province service - /// Logger service - /// Customer settings - /// Shipping settings - /// Address settings - public TaxService(IAddressService addressService, - IWorkContext workContext, - IStoreContext storeContext, - TaxSettings taxSettings, - IPluginFinder pluginFinder, - IGeoLookupService geoLookupService, - ICountryService countryService, - IStateProvinceService stateProvinceService, - ILogger logger, - CustomerSettings customerSettings, - ShippingSettings shippingSettings, - AddressSettings addressSettings) - { - this._addressService = addressService; - this._workContext = workContext; - this._storeContext = storeContext; - this._taxSettings = taxSettings; - this._pluginFinder = pluginFinder; - this._geoLookupService = geoLookupService; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._logger = logger; - this._customerSettings = customerSettings; - this._shippingSettings = shippingSettings; - this._addressSettings = addressSettings; - } - - #endregion - - #region Utilities - - /// - /// Get a value indicating whether a customer is consumer (a person, not a company) located in Europe Union - /// - /// Customer - /// Result - protected virtual bool IsEuConsumer(Customer customer) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - Country country = null; - - //get country from billing address - if (_addressSettings.CountryEnabled && customer.BillingAddress != null) - country = customer.BillingAddress.Country; - - //get country specified during registration? - if (country == null && _customerSettings.CountryEnabled) - { - var countryId = customer.GetAttribute(SystemCustomerAttributeNames.CountryId); - country = _countryService.GetCountryById(countryId); - } - - //get country by IP address - if (country == null) - { - var ipAddress = customer.LastIpAddress; - //ipAddress = _webHelper.GetCurrentIpAddress(); - var countryIsoCode = _geoLookupService.LookupCountryIsoCode(ipAddress); - country = _countryService.GetCountryByTwoLetterIsoCode(countryIsoCode); - } - - //we cannot detect country - if (country == null) - return false; - - //outside EU - if (!country.SubjectToVat) - return false; - - //company (business) or consumer? - var customerVatStatus = (VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); - if (customerVatStatus == VatNumberStatus.Valid) - return false; - - //TODO: use specified company name? (both address and registration one) - - //consumer - return true; - } - - /// - /// Create request for tax calculation - /// - /// Product - /// Tax category identifier - /// Customer - /// Price - /// Package for tax calculation - protected virtual CalculateTaxRequest CreateCalculateTaxRequest(Product product, - int taxCategoryId, Customer customer, decimal price) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - var calculateTaxRequest = new CalculateTaxRequest - { - Customer = customer, - Product = product, - Price = price, - TaxCategoryId = taxCategoryId > 0 ? taxCategoryId : (product != null ? product.TaxCategoryId : 0) - }; - - var basedOn = _taxSettings.TaxBasedOn; - - //new EU VAT rules starting January 1st 2015 - //find more info at http://ec.europa.eu/taxation_customs/taxation/vat/how_vat_works/telecom/index_en.htm#new_rules - var overridenBasedOn = _taxSettings.EuVatEnabled //EU VAT enabled? - && product != null && product.IsTelecommunicationsOrBroadcastingOrElectronicServices //telecommunications, broadcasting and electronic services? - && DateTime.UtcNow > new DateTime(2015, 1, 1, 0, 0, 0, DateTimeKind.Utc) //January 1st 2015 passed? - && IsEuConsumer(customer); //Europe Union consumer? - if (overridenBasedOn) - { - //We must charge VAT in the EU country where the customer belongs (not where the business is based) - basedOn = TaxBasedOn.BillingAddress; - } - - //tax is based on pickup point address - if (!overridenBasedOn && _taxSettings.TaxBasedOnPickupPointAddress && _shippingSettings.AllowPickUpInStore) - { - var pickupPoint = customer.GetAttribute(SystemCustomerAttributeNames.SelectedPickupPoint, _storeContext.CurrentStore.Id); - if (pickupPoint != null) - { - var country = _countryService.GetCountryByTwoLetterIsoCode(pickupPoint.CountryCode); - var state = _stateProvinceService.GetStateProvinceByAbbreviation(pickupPoint.StateAbbreviation); - - calculateTaxRequest.Address = new Address - { - Address1 = pickupPoint.Address, - City = pickupPoint.City, - Country = country, - CountryId = country.Return(c => c.Id, 0), - StateProvince = state, - StateProvinceId = state.Return(sp => sp.Id, 0), - ZipPostalCode = pickupPoint.ZipPostalCode, - CreatedOnUtc = DateTime.UtcNow - }; - - return calculateTaxRequest; - } - } - - if (basedOn == TaxBasedOn.BillingAddress && customer.BillingAddress == null || - basedOn == TaxBasedOn.ShippingAddress && customer.ShippingAddress == null) - { - basedOn = TaxBasedOn.DefaultAddress; - } - - switch (basedOn) - { - case TaxBasedOn.BillingAddress: - calculateTaxRequest.Address = customer.BillingAddress; - break; - case TaxBasedOn.ShippingAddress: - calculateTaxRequest.Address = customer.ShippingAddress; - break; - case TaxBasedOn.DefaultAddress: - default: - calculateTaxRequest.Address = _addressService.GetAddressById(_taxSettings.DefaultTaxAddressId); - break; - } - - return calculateTaxRequest; - } - - /// - /// Calculated price - /// - /// Price - /// Percent - /// Increase - /// New price - protected virtual decimal CalculatePrice(decimal price, decimal percent, bool increase) - { - if (percent == decimal.Zero) - return price; - - decimal result; - if (increase) - { - result = price * (1 + percent / 100); - } - else - { - result = price - (price) / (100 + percent) * percent; - } - return result; - } - - /// - /// Gets tax rate - /// - /// Product - /// Tax category identifier - /// Customer - /// Price (taxable value) - /// Calculated tax rate - /// A value indicating whether a request is taxable - protected virtual void GetTaxRate(Product product, int taxCategoryId, - Customer customer, decimal price, out decimal taxRate, out bool isTaxable) - { - taxRate = decimal.Zero; - isTaxable = true; - - //active tax provider - var activeTaxProvider = LoadActiveTaxProvider(customer); - if (activeTaxProvider == null) - return; - - //tax request - var calculateTaxRequest = CreateCalculateTaxRequest(product, taxCategoryId, customer, price); - - //tax exempt - if (IsTaxExempt(product, calculateTaxRequest.Customer)) - { - isTaxable = false; - } - //make EU VAT exempt validation (the European Union Value Added Tax) - if (isTaxable && - _taxSettings.EuVatEnabled && - IsVatExempt(calculateTaxRequest.Address, calculateTaxRequest.Customer)) - { - //VAT is not chargeable - isTaxable = false; - } - - //get tax rate - var calculateTaxResult = activeTaxProvider.GetTaxRate(calculateTaxRequest); - if (calculateTaxResult.Success) - { - //ensure that tax is equal or greater than zero - if (calculateTaxResult.TaxRate < decimal.Zero) - calculateTaxResult.TaxRate = decimal.Zero; - - taxRate = calculateTaxResult.TaxRate; - } - else - if (_taxSettings.LogErrors) - { - foreach (var error in calculateTaxResult.Errors) - { - _logger.Error(string.Format("{0} - {1}", activeTaxProvider.PluginDescriptor.FriendlyName, error), null, customer); - } - } - } - - #endregion - - #region Methods - - #region Tax providers - - /// - /// Load active tax provider - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Active tax provider - public virtual ITaxProvider LoadActiveTaxProvider(Customer customer = null) - { - var taxProvider = LoadTaxProviderBySystemName(_taxSettings.ActiveTaxProviderSystemName); - if (taxProvider == null) - taxProvider = LoadAllTaxProviders(customer).FirstOrDefault(); - return taxProvider; - } - - /// - /// Load tax provider by system name - /// - /// System name - /// Found tax provider - public virtual ITaxProvider LoadTaxProviderBySystemName(string systemName) - { - var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); - if (descriptor != null) - return descriptor.Instance(); - - return null; - } - - /// - /// Load all tax providers - /// - /// Load records allowed only to a specified customer; pass null to ignore ACL permissions - /// Tax providers - public virtual IList LoadAllTaxProviders(Customer customer = null) - { - return _pluginFinder.GetPlugins(customer: customer).ToList(); - } - - #endregion - - #region Product price - - /// - /// Gets price - /// - /// Product - /// Price - /// Tax rate - /// Price - public virtual decimal GetProductPrice(Product product, decimal price, - out decimal taxRate) - { - var customer = _workContext.CurrentCustomer; - return GetProductPrice(product, price, customer, out taxRate); - } - - /// - /// Gets price - /// - /// Product - /// Price - /// Customer - /// Tax rate - /// Price - public virtual decimal GetProductPrice(Product product, decimal price, - Customer customer, out decimal taxRate) - { - bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return GetProductPrice(product, price, includingTax, customer, out taxRate); - } - - /// - /// Gets price - /// - /// Product - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - public virtual decimal GetProductPrice(Product product, decimal price, - bool includingTax, Customer customer, out decimal taxRate) - { - bool priceIncludesTax = _taxSettings.PricesIncludeTax; - int taxCategoryId = 0; - return GetProductPrice(product, taxCategoryId, price, includingTax, - customer, priceIncludesTax, out taxRate); - } - - /// - /// Gets price - /// - /// Product - /// Tax category identifier - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// A value indicating whether price already includes tax - /// Tax rate - /// Price - public virtual decimal GetProductPrice(Product product, int taxCategoryId, - decimal price, bool includingTax, Customer customer, - bool priceIncludesTax, out decimal taxRate) - { - //no need to calculate tax rate if passed "price" is 0 - if (price == decimal.Zero) - { - taxRate = decimal.Zero; - return taxRate; - } - - - bool isTaxable; - GetTaxRate(product, taxCategoryId, customer, price, out taxRate, out isTaxable); - - if (priceIncludesTax) - { - //"price" already includes tax - if (includingTax) - { - //we should calculate price WITH tax - if (!isTaxable) - { - //but our request is not taxable - //hence we should calculate price WITHOUT tax - price = CalculatePrice(price, taxRate, false); - } - } - else - { - //we should calculate price WITHOUT tax - price = CalculatePrice(price, taxRate, false); - } - } - else - { - //"price" doesn't include tax - if (includingTax) - { - //we should calculate price WITH tax - //do it only when price is taxable - if (isTaxable) - { - price = CalculatePrice(price, taxRate, true); - } - } - } - - - if (!isTaxable) - { - //we return 0% tax rate in case a request is not taxable - taxRate = decimal.Zero; - } - - //allowed to support negative price adjustments - //if (price < decimal.Zero) - // price = decimal.Zero; - - return price; - } - - #endregion - - #region Shipping price - - /// - /// Gets shipping price - /// - /// Price - /// Customer - /// Price - public virtual decimal GetShippingPrice(decimal price, Customer customer) - { - bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return GetShippingPrice(price, includingTax, customer); - } - - /// - /// Gets shipping price - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - public virtual decimal GetShippingPrice(decimal price, bool includingTax, Customer customer) - { - decimal taxRate; - return GetShippingPrice(price, includingTax, customer, out taxRate); - } - - /// - /// Gets shipping price - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - public virtual decimal GetShippingPrice(decimal price, bool includingTax, Customer customer, out decimal taxRate) - { - taxRate = decimal.Zero; - - if (!_taxSettings.ShippingIsTaxable) - { - return price; - } - int taxClassId = _taxSettings.ShippingTaxClassId; - bool priceIncludesTax = _taxSettings.ShippingPriceIncludesTax; - return GetProductPrice(null, taxClassId, price, includingTax, customer, - priceIncludesTax, out taxRate); - } - - #endregion - - #region Payment additional fee - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// Customer - /// Price - public virtual decimal GetPaymentMethodAdditionalFee(decimal price, Customer customer) - { - bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return GetPaymentMethodAdditionalFee(price, includingTax, customer); - } - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - public virtual decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer) - { - decimal taxRate; - return GetPaymentMethodAdditionalFee(price, includingTax, - customer, out taxRate); - } - - /// - /// Gets payment method additional handling fee - /// - /// Price - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - public virtual decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer, out decimal taxRate) - { - taxRate = decimal.Zero; - - if (!_taxSettings.PaymentMethodAdditionalFeeIsTaxable) - { - return price; - } - int taxClassId = _taxSettings.PaymentMethodAdditionalFeeTaxClassId; - bool priceIncludesTax = _taxSettings.PaymentMethodAdditionalFeeIncludesTax; - return GetProductPrice(null, taxClassId, price, includingTax, customer, - priceIncludesTax, out taxRate); - } - - #endregion - - #region Checkout attribute price - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// Price - public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav) - { - var customer = _workContext.CurrentCustomer; - return GetCheckoutAttributePrice(cav, customer); - } - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// Customer - /// Price - public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, Customer customer) - { - bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; - return GetCheckoutAttributePrice(cav, includingTax, customer); - } - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// A value indicating whether calculated price should include tax - /// Customer - /// Price - public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, - bool includingTax, Customer customer) - { - decimal taxRate; - return GetCheckoutAttributePrice(cav, includingTax, customer, out taxRate); - } - - /// - /// Gets checkout attribute value price - /// - /// Checkout attribute value - /// A value indicating whether calculated price should include tax - /// Customer - /// Tax rate - /// Price - public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, - bool includingTax, Customer customer, out decimal taxRate) - { - if (cav == null) - throw new ArgumentNullException("cav"); - - taxRate = decimal.Zero; - - decimal price = cav.PriceAdjustment; - if (cav.CheckoutAttribute.IsTaxExempt) - { - return price; - } - - bool priceIncludesTax = _taxSettings.PricesIncludeTax; - int taxClassId = cav.CheckoutAttribute.TaxCategoryId; - return GetProductPrice(null, taxClassId, price, includingTax, customer, - priceIncludesTax, out taxRate); - } - - #endregion - - #region VAT - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) - /// VAT Number status - public virtual VatNumberStatus GetVatNumberStatus(string fullVatNumber) - { - string name, address; - return GetVatNumberStatus(fullVatNumber, out name, out address); - } - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) - /// Name (if received) - /// Address (if received) - /// VAT Number status - public virtual VatNumberStatus GetVatNumberStatus(string fullVatNumber, - out string name, out string address) - { - name = string.Empty; - address = string.Empty; - - if (String.IsNullOrWhiteSpace(fullVatNumber)) - return VatNumberStatus.Empty; - fullVatNumber = fullVatNumber.Trim(); - - //GB 111 1111 111 or GB 1111111111 - //more advanced regex - http://codeigniter.com/wiki/European_Vat_Checker - var r = new Regex(@"^(\w{2})(.*)"); - var match = r.Match(fullVatNumber); - if (!match.Success) - return VatNumberStatus.Invalid; - var twoLetterIsoCode = match.Groups[1].Value; - var vatNumber = match.Groups[2].Value; - - return GetVatNumberStatus(twoLetterIsoCode, vatNumber, out name, out address); - } - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country - /// VAT number - /// VAT Number status - public virtual VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber) - { - string name, address; - return GetVatNumberStatus(twoLetterIsoCode, vatNumber, out name, out address); - } - - /// - /// Gets VAT Number status - /// - /// Two letter ISO code of a country - /// VAT number - /// Name (if received) - /// Address (if received) - /// VAT Number status - public virtual VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber, - out string name, out string address) - { - name = string.Empty; - address = string.Empty; - - if (String.IsNullOrEmpty(twoLetterIsoCode)) - return VatNumberStatus.Empty; - - if (String.IsNullOrEmpty(vatNumber)) - return VatNumberStatus.Empty; - - if (_taxSettings.EuVatAssumeValid) - return VatNumberStatus.Valid; - - if (!_taxSettings.EuVatUseWebService) - return VatNumberStatus.Unknown; - - Exception exception; - return DoVatCheck(twoLetterIsoCode, vatNumber, out name, out address, out exception); - } - - /// - /// Performs a basic check of a VAT number for validity - /// - /// Two letter ISO code of a country - /// VAT number - /// Company name - /// Address - /// Exception - /// VAT number status - public virtual VatNumberStatus DoVatCheck(string twoLetterIsoCode, string vatNumber, - out string name, out string address, out Exception exception) - { - name = string.Empty; - address = string.Empty; - - if (vatNumber == null) - vatNumber = string.Empty; - vatNumber = vatNumber.Trim().Replace(" ", ""); - - if (twoLetterIsoCode == null) - twoLetterIsoCode = string.Empty; - if (!String.IsNullOrEmpty(twoLetterIsoCode)) - //The service returns INVALID_INPUT for country codes that are not uppercase. - twoLetterIsoCode = twoLetterIsoCode.ToUpper(); - - EuropaCheckVatService.checkVatService s = null; - - try - { - bool valid; - - s = new EuropaCheckVatService.checkVatService(); - s.checkVat(ref twoLetterIsoCode, ref vatNumber, out valid, out name, out address); - exception = null; - return valid ? VatNumberStatus.Valid : VatNumberStatus.Invalid; - } - catch (Exception ex) - { - name = address = string.Empty; - exception = ex; - return VatNumberStatus.Unknown; - } - finally - { - if (name == null) - name = string.Empty; - - if (address == null) - address = string.Empty; - - if (s != null) - s.Dispose(); - } - } - - #endregion - - #region Exempts - - /// - /// Gets a value indicating whether a product is tax exempt - /// - /// Product - /// Customer - /// A value indicating whether a product is tax exempt - public virtual bool IsTaxExempt(Product product, Customer customer) - { - if (customer != null) - { - if (customer.IsTaxExempt) - return true; - - if (customer.CustomerRoles.Where(cr => cr.Active).Any(cr => cr.TaxExempt)) - return true; - } - - if (product == null) - { - return false; - } - - if (product.IsTaxExempt) - { - return true; - } - - return false; - } - - /// - /// Gets a value indicating whether EU VAT exempt (the European Union Value Added Tax) - /// - /// Address - /// Customer - /// Result - public virtual bool IsVatExempt(Address address, Customer customer) - { - if (!_taxSettings.EuVatEnabled) - return false; - - if (address == null || address.Country == null || customer == null) - return false; - - - if (!address.Country.SubjectToVat) - // VAT not chargeable if shipping outside VAT zone - return true; - - // VAT not chargeable if address, customer and config meet our VAT exemption requirements: - // returns true if this customer is VAT exempt because they are shipping within the EU but outside our shop country, they have supplied a validated VAT number, and the shop is configured to allow VAT exemption - var customerVatStatus = (VatNumberStatus) customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); - return address.CountryId != _taxSettings.EuVatShopCountryId && - customerVatStatus == VatNumberStatus.Valid && - _taxSettings.EuVatAllowVatExemption; - } - - #endregion - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Plugins; +using Nop.Services.Common; +using Nop.Services.Directory; +using Nop.Services.Logging; +using Nop.Services.Catalog; + +namespace Nop.Services.Tax +{ + /// + /// Tax service + /// + public partial class TaxService : ITaxService + { + #region Fields + + private readonly IAddressService _addressService; + private readonly IWorkContext _workContext; + private readonly IStoreContext _storeContext; + private readonly TaxSettings _taxSettings; + private readonly IPluginFinder _pluginFinder; + private readonly IGeoLookupService _geoLookupService; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly ILogger _logger; + private readonly CustomerSettings _customerSettings; + private readonly ShippingSettings _shippingSettings; + private readonly AddressSettings _addressSettings; + private readonly IProductAttributeParser _productAttributeParser; + + #endregion + + #region Ctor + + /// + /// Ctor + /// + /// Address service + /// Work context + /// Store context + /// Tax settings + /// Plugin finder + /// GEO lookup service + /// Country service + /// State province service + /// Logger service + /// Customer settings + /// Shipping settings + /// Address settings + /// Product attribute parser + public TaxService(IAddressService addressService, + IWorkContext workContext, + IStoreContext storeContext, + TaxSettings taxSettings, + IPluginFinder pluginFinder, + IGeoLookupService geoLookupService, + ICountryService countryService, + IStateProvinceService stateProvinceService, + ILogger logger, + CustomerSettings customerSettings, + ShippingSettings shippingSettings, + AddressSettings addressSettings, + IProductAttributeParser productAttributeParser) + { + this._addressService = addressService; + this._workContext = workContext; + this._storeContext = storeContext; + this._taxSettings = taxSettings; + this._pluginFinder = pluginFinder; + this._geoLookupService = geoLookupService; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._logger = logger; + this._customerSettings = customerSettings; + this._shippingSettings = shippingSettings; + this._addressSettings = addressSettings; + this._productAttributeParser = productAttributeParser; + } + + #endregion + + #region Utilities + + /// + /// Get a value indicating whether a customer is consumer (a person, not a company) located in Europe Union + /// + /// Customer + /// Result + protected virtual bool IsEuConsumer(Customer customer) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + Country country = null; + + //get country from billing address + if (_addressSettings.CountryEnabled && customer.BillingAddress != null) + country = customer.BillingAddress.Country; + + //get country specified during registration? + if (country == null && _customerSettings.CountryEnabled) + { + var countryId = customer.GetAttribute(SystemCustomerAttributeNames.CountryId); + country = _countryService.GetCountryById(countryId); + } + + //get country by IP address + if (country == null) + { + var ipAddress = customer.LastIpAddress; + //ipAddress = _webHelper.GetCurrentIpAddress(); + var countryIsoCode = _geoLookupService.LookupCountryIsoCode(ipAddress); + country = _countryService.GetCountryByTwoLetterIsoCode(countryIsoCode); + } + + //we cannot detect country + if (country == null) + return false; + + //outside EU + if (!country.SubjectToVat) + return false; + + //company (business) or consumer? + var customerVatStatus = (VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); + if (customerVatStatus == VatNumberStatus.Valid) + return false; + + //TODO: use specified company name? (both address and registration one) + + //consumer + return true; + } + + /// + /// Get a value indicating whether prices do include tax + /// + /// Result + public virtual bool PricesIncludeTax() + { + return _taxSettings.PricesIncludeTax; + } + /// + /// Create request for tax calculation + /// + /// Product + /// Tax category identifier + /// Customer + /// Price + /// Package for tax calculation + protected virtual CalculateTaxRequest CreateCalculateTaxRequest(Product product, + int taxCategoryId, Customer customer, decimal price) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + var calculateTaxRequest = new CalculateTaxRequest + { + Customer = customer, + Product = product, + Price = price, + TaxCategoryId = taxCategoryId > 0 ? taxCategoryId : (product != null ? product.TaxCategoryId : 0) + }; + + var basedOn = _taxSettings.TaxBasedOn; + + //new EU VAT rules starting January 1st 2015 + //find more info at http://ec.europa.eu/taxation_customs/taxation/vat/how_vat_works/telecom/index_en.htm#new_rules + var overridenBasedOn = _taxSettings.EuVatEnabled //EU VAT enabled? + && product != null && product.IsTelecommunicationsOrBroadcastingOrElectronicServices //telecommunications, broadcasting and electronic services? + && DateTime.UtcNow > new DateTime(2015, 1, 1, 0, 0, 0, DateTimeKind.Utc) //January 1st 2015 passed? + && IsEuConsumer(customer); //Europe Union consumer? + if (overridenBasedOn) + { + //We must charge VAT in the EU country where the customer belongs (not where the business is based) + basedOn = TaxBasedOn.BillingAddress; + } + + //tax is based on pickup point address + if (!overridenBasedOn && _taxSettings.TaxBasedOnPickupPointAddress && _shippingSettings.AllowPickUpInStore) + { + var pickupPoint = customer.GetAttribute(SystemCustomerAttributeNames.SelectedPickupPoint, _storeContext.CurrentStore.Id); + if (pickupPoint != null) + { + var country = _countryService.GetCountryByTwoLetterIsoCode(pickupPoint.CountryCode); + var state = _stateProvinceService.GetStateProvinceByAbbreviation(pickupPoint.StateAbbreviation); + + calculateTaxRequest.Address = new Address + { + Address1 = pickupPoint.Address, + City = pickupPoint.City, + Country = country, + CountryId = country.Return(c => c.Id, 0), + StateProvince = state, + StateProvinceId = state.Return(sp => sp.Id, 0), + ZipPostalCode = pickupPoint.ZipPostalCode, + CreatedOnUtc = DateTime.UtcNow + }; + + return calculateTaxRequest; + } + } + + if (basedOn == TaxBasedOn.BillingAddress && customer.BillingAddress == null || + basedOn == TaxBasedOn.ShippingAddress && customer.ShippingAddress == null) + { + basedOn = TaxBasedOn.DefaultAddress; + } + + switch (basedOn) + { + case TaxBasedOn.BillingAddress: + calculateTaxRequest.Address = customer.BillingAddress; + break; + case TaxBasedOn.ShippingAddress: + calculateTaxRequest.Address = customer.ShippingAddress; + break; + case TaxBasedOn.DefaultAddress: + default: + calculateTaxRequest.Address = _addressService.GetAddressById(_taxSettings.DefaultTaxAddressId); + break; + } + + return calculateTaxRequest; + } + + /// + /// Calculated price + /// + /// Price + /// Percent + /// Increase + /// New price + protected virtual decimal CalculatePrice(decimal price, decimal percent, bool increase) + { + if (percent == decimal.Zero) + return price; + + decimal result; + if (increase) + { + result = price * (1 + percent / 100); + } + else + { + result = price / (1 + percent / 100); //MF 13.11.16: is the same but written in a complicated way: price - (price) / (100 + percent) * percent; + } + return result; + } + + /// + /// Gets tax rate + /// + /// Product + /// Tax category identifier + /// Customer + /// Price (taxable value) + /// Calculated tax rate + /// A value indicating whether a request is taxable + protected virtual void GetTaxRate(Product product, int taxCategoryId, + Customer customer, decimal price, out decimal taxRate, out bool isTaxable) + { + taxRate = decimal.Zero; + isTaxable = true; + + //active tax provider + var activeTaxProvider = LoadActiveTaxProvider(customer); + if (activeTaxProvider == null) + return; + + //tax request + var calculateTaxRequest = CreateCalculateTaxRequest(product, taxCategoryId, customer, price); + + //tax exempt + if (IsTaxExempt(product, calculateTaxRequest.Customer)) + { + isTaxable = false; + } + //make EU VAT exempt validation (the European Union Value Added Tax) + if (isTaxable && + _taxSettings.EuVatEnabled && + IsVatExempt(calculateTaxRequest.Address, calculateTaxRequest.Customer)) + { + //VAT is not chargeable + isTaxable = false; + } + + //get tax rate + var calculateTaxResult = activeTaxProvider.GetTaxRate(calculateTaxRequest); + if (calculateTaxResult.Success) + { + //ensure that tax is equal or greater than zero + if (calculateTaxResult.TaxRate < decimal.Zero) + calculateTaxResult.TaxRate = decimal.Zero; + + taxRate = calculateTaxResult.TaxRate; + } + else + if (_taxSettings.LogErrors) + { + foreach (var error in calculateTaxResult.Errors) + { + _logger.Error(string.Format("{0} - {1}", activeTaxProvider.PluginDescriptor.FriendlyName, error), null, customer); + } + } + } + + #endregion + + #region Methods + + #region Tax providers + + /// + /// Load active tax provider + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Active tax provider + public virtual ITaxProvider LoadActiveTaxProvider(Customer customer = null) + { + var taxProvider = LoadTaxProviderBySystemName(_taxSettings.ActiveTaxProviderSystemName); + if (taxProvider == null) + taxProvider = LoadAllTaxProviders(customer).FirstOrDefault(); + return taxProvider; + } + + /// + /// Load tax provider by system name + /// + /// System name + /// Found tax provider + public virtual ITaxProvider LoadTaxProviderBySystemName(string systemName) + { + var descriptor = _pluginFinder.GetPluginDescriptorBySystemName(systemName); + if (descriptor != null) + return descriptor.Instance(); + + return null; + } + + /// + /// Load all tax providers + /// + /// Load records allowed only to a specified customer; pass null to ignore ACL permissions + /// Tax providers + public virtual IList LoadAllTaxProviders(Customer customer = null) + { + return _pluginFinder.GetPlugins(customer: customer).ToList(); + } + + #endregion + + #region Product price + + /// + /// Gets price + /// + /// Product + /// Price + /// Tax rate + /// Price + public virtual decimal GetProductPrice(Product product, decimal price, + out decimal taxRate) + { + var customer = _workContext.CurrentCustomer; + return GetProductPrice(product, price, customer, out taxRate); + } + + /// + /// Gets price using tax attributes + /// + /// Product + /// Price + /// Tax rate + /// Product atrributes (XML format) + /// Optional value indicating whether calculated price should include tax + /// Price + public virtual decimal GetProductPrice(Product product, decimal price, + out decimal taxRate, ref string attributesXml, bool? includingTax = null) + { + var customer = _workContext.CurrentCustomer; + bool priceIncludesTax = _taxSettings.PricesIncludeTax; + int taxCategoryId = 0; + return GetProductPrice(product, taxCategoryId, price, + includingTax ?? _workContext.TaxDisplayType == TaxDisplayType.IncludingTax, + customer, priceIncludesTax, out taxRate, ref attributesXml); + } + /// + /// Gets price + /// + /// Product + /// Price + /// Customer + /// Tax rate + /// Price + public virtual decimal GetProductPrice(Product product, decimal price, + Customer customer, out decimal taxRate) + { + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + return GetProductPrice(product, price, includingTax, customer, out taxRate); + } + + /// + /// Gets price + /// + /// Product + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + public virtual decimal GetProductPrice(Product product, decimal price, + bool includingTax, Customer customer, out decimal taxRate) + { + bool priceIncludesTax = _taxSettings.PricesIncludeTax; + int taxCategoryId = 0; + string attributesXml = ""; + return GetProductPrice(product, taxCategoryId, price, includingTax, + customer, priceIncludesTax, out taxRate, ref attributesXml); + } + + /// + /// Gets price + /// + /// Product + /// Tax category identifier + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// A value indicating whether price already includes tax + /// Tax rate + /// Product atrributes (XML format) + /// Price + public virtual decimal GetProductPrice(Product product, int taxCategoryId, + decimal price, bool includingTax, Customer customer, + bool priceIncludesTax, out decimal taxRate, ref string attributesXml) + { + bool isTaxable; + //taxrate should be always passed + GetTaxRate(product, taxCategoryId, customer, price, out taxRate, out isTaxable); + + //get taxWeights of product attributes + SortedDictionary attributeTaxWeight = !String.IsNullOrEmpty(attributesXml) ? _productAttributeParser.ParseTaxAttribute(attributesXml) : null; + + //normal price or no need for taxinfo to attributesXml + if (String.IsNullOrEmpty(attributesXml) || attributeTaxWeight == null || !attributeTaxWeight.Any()) + { + price = GetPrice(price, includingTax, priceIncludesTax, taxRate, isTaxable); + } + //add taxinfo to attributesXml + else + { + int numtaxRates = attributeTaxWeight.Count(); + taxRate = attributeTaxWeight.FirstOrDefault().Key; // pass the first taxRate as it might be different from product taxrate. Will be used when #rates == 1 + + //need to change attributeXML (otherwise already set by unitprice calculation) + if (priceIncludesTax != includingTax) + { + //no need to change attributeXML when only one rate + if (numtaxRates == 1) + { + price = GetPrice(price, includingTax, priceIncludesTax, taxRate, isTaxable); + } + else + { + var taxWeightSummary = new TaxSummary(includingTax); + foreach (KeyValuePair kvp in attributeTaxWeight) + { + decimal attribtaxRate = kvp.Key; + decimal rateWeight = kvp.Value; + var priceWeighted = price * rateWeight; + var attributePrice = RoundingHelper.RoundAmount(GetPrice(priceWeighted, includingTax, priceIncludesTax, attribtaxRate, isTaxable)); + taxWeightSummary.AddRate(attribtaxRate, attributePrice); + } + + taxWeightSummary.CalculateWeights(); + attributesXml = _productAttributeParser.AddTaxAttribute(attributesXml, taxWeightSummary); + price = includingTax ? taxWeightSummary.TotalAmountIncludingTax : taxWeightSummary.TotalAmount; + } + } + } + return price; + } + + protected virtual decimal GetPrice(decimal price, bool includingTax, + bool priceIncludesTax, decimal taxRate, bool isTaxable) + { + //no need to calculate new price if passed "price" is 0 + if (price == decimal.Zero) + { + return price; + } + + if (priceIncludesTax) + { + //"price" already includes tax + if (includingTax) + { + //we should calculate price WITH tax + if (!isTaxable) + { + //but our request is not taxable + //hence we should calculate price WITHOUT tax + price = CalculatePrice(price, taxRate, false); + } + } + else + { + //we should calculate price WITHOUT tax + price = CalculatePrice(price, taxRate, false); + } + } + else + { + //"price" doesn't include tax + if (includingTax) + { + //we should calculate price WITH tax + //do it only when price is taxable + if (isTaxable) + { + price = CalculatePrice(price, taxRate, true); + } + } + } + + + if (!isTaxable) + { + //we return 0% tax rate in case a request is not taxable + taxRate = decimal.Zero; + } + + //commented out to allow negative price adjustments + //if (price < decimal.Zero) + // price = decimal.Zero; + + return price; + } + + #endregion + + #region Shipping price + + /// + /// Gets shipping price + /// + /// Price + /// Customer + /// Price + public virtual decimal GetShippingPrice(decimal price, Customer customer) + { + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + return GetShippingPrice(price, includingTax, customer); + } + + /// + /// Gets shipping price + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + public virtual decimal GetShippingPrice(decimal price, bool includingTax, Customer customer) + { + decimal taxRate; + return GetShippingPrice(price, includingTax, customer, out taxRate); + } + + /// + /// Gets shipping price + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + public virtual decimal GetShippingPrice(decimal price, bool includingTax, Customer customer, out decimal taxRate) + { + taxRate = decimal.Zero; + + if (!_taxSettings.ShippingIsTaxable) + { + return price; + } + int taxClassId = _taxSettings.ShippingTaxClassId; + bool priceIncludesTax = _taxSettings.ShippingPriceIncludesTax; + string attributesXml = ""; + return GetProductPrice(null, taxClassId, price, includingTax, customer, + priceIncludesTax, out taxRate, ref attributesXml); + } + + #endregion + + #region Payment additional fee + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// Customer + /// Price + public virtual decimal GetPaymentMethodAdditionalFee(decimal price, Customer customer) + { + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + return GetPaymentMethodAdditionalFee(price, includingTax, customer); + } + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + public virtual decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer) + { + decimal taxRate; + return GetPaymentMethodAdditionalFee(price, includingTax, + customer, out taxRate); + } + + /// + /// Gets payment method additional handling fee + /// + /// Price + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + public virtual decimal GetPaymentMethodAdditionalFee(decimal price, bool includingTax, Customer customer, out decimal taxRate) + { + taxRate = decimal.Zero; + + if (!_taxSettings.PaymentMethodAdditionalFeeIsTaxable) + { + return price; + } + int taxClassId = _taxSettings.PaymentMethodAdditionalFeeTaxClassId; + bool priceIncludesTax = _taxSettings.PaymentMethodAdditionalFeeIncludesTax; + string attributesXml = ""; + return GetProductPrice(null, taxClassId, price, includingTax, customer, + priceIncludesTax, out taxRate, ref attributesXml); + } + + #endregion + + #region Checkout attribute price + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// Price + public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav) + { + var customer = _workContext.CurrentCustomer; + return GetCheckoutAttributePrice(cav, customer); + } + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// Customer + /// Price + public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, Customer customer) + { + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + return GetCheckoutAttributePrice(cav, includingTax, customer); + } + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// A value indicating whether calculated price should include tax + /// Customer + /// Price + public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, + bool includingTax, Customer customer) + { + decimal taxRate; + return GetCheckoutAttributePrice(cav, includingTax, customer, out taxRate); + } + + /// + /// Gets checkout attribute value price + /// + /// Checkout attribute value + /// A value indicating whether calculated price should include tax + /// Customer + /// Tax rate + /// Price + public virtual decimal GetCheckoutAttributePrice(CheckoutAttributeValue cav, + bool includingTax, Customer customer, out decimal taxRate) + { + if (cav == null) + throw new ArgumentNullException("cav"); + + taxRate = decimal.Zero; + + decimal price = cav.PriceAdjustment; + if (cav.CheckoutAttribute.IsTaxExempt) + { + return price; + } + + bool priceIncludesTax = _taxSettings.PricesIncludeTax; + int taxClassId = cav.CheckoutAttribute.TaxCategoryId; + string attributesXml = ""; + return GetProductPrice(null, taxClassId, price, includingTax, customer, + priceIncludesTax, out taxRate, ref attributesXml); + } + + #endregion + + #region VAT + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) + /// VAT Number status + public virtual VatNumberStatus GetVatNumberStatus(string fullVatNumber) + { + string name, address; + return GetVatNumberStatus(fullVatNumber, out name, out address); + } + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country and VAT number (e.g. GB 111 1111 111) + /// Name (if received) + /// Address (if received) + /// VAT Number status + public virtual VatNumberStatus GetVatNumberStatus(string fullVatNumber, + out string name, out string address) + { + name = string.Empty; + address = string.Empty; + + if (String.IsNullOrWhiteSpace(fullVatNumber)) + return VatNumberStatus.Empty; + fullVatNumber = fullVatNumber.Trim(); + + //GB 111 1111 111 or GB 1111111111 + //more advanced regex - http://codeigniter.com/wiki/European_Vat_Checker + var r = new Regex(@"^(\w{2})(.*)"); + var match = r.Match(fullVatNumber); + if (!match.Success) + return VatNumberStatus.Invalid; + var twoLetterIsoCode = match.Groups[1].Value; + var vatNumber = match.Groups[2].Value; + + return GetVatNumberStatus(twoLetterIsoCode, vatNumber, out name, out address); + } + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country + /// VAT number + /// VAT Number status + public virtual VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber) + { + string name, address; + return GetVatNumberStatus(twoLetterIsoCode, vatNumber, out name, out address); + } + + /// + /// Gets VAT Number status + /// + /// Two letter ISO code of a country + /// VAT number + /// Name (if received) + /// Address (if received) + /// VAT Number status + public virtual VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber, + out string name, out string address) + { + name = string.Empty; + address = string.Empty; + + if (String.IsNullOrEmpty(twoLetterIsoCode)) + return VatNumberStatus.Empty; + + if (String.IsNullOrEmpty(vatNumber)) + return VatNumberStatus.Empty; + + if (_taxSettings.EuVatAssumeValid) + return VatNumberStatus.Valid; + + if (!_taxSettings.EuVatUseWebService) + return VatNumberStatus.Unknown; + + Exception exception; + return DoVatCheck(twoLetterIsoCode, vatNumber, out name, out address, out exception); + } + + /// + /// Performs a basic check of a VAT number for validity + /// + /// Two letter ISO code of a country + /// VAT number + /// Company name + /// Address + /// Exception + /// VAT number status + public virtual VatNumberStatus DoVatCheck(string twoLetterIsoCode, string vatNumber, + out string name, out string address, out Exception exception) + { + name = string.Empty; + address = string.Empty; + + if (vatNumber == null) + vatNumber = string.Empty; + vatNumber = vatNumber.Trim().Replace(" ", ""); + + if (twoLetterIsoCode == null) + twoLetterIsoCode = string.Empty; + if (!String.IsNullOrEmpty(twoLetterIsoCode)) + //The service returns INVALID_INPUT for country codes that are not uppercase. + twoLetterIsoCode = twoLetterIsoCode.ToUpper(); + + EuropaCheckVatService.checkVatService s = null; + + try + { + bool valid; + + s = new EuropaCheckVatService.checkVatService(); + s.checkVat(ref twoLetterIsoCode, ref vatNumber, out valid, out name, out address); + exception = null; + return valid ? VatNumberStatus.Valid : VatNumberStatus.Invalid; + } + catch (Exception ex) + { + name = address = string.Empty; + exception = ex; + return VatNumberStatus.Unknown; + } + finally + { + if (name == null) + name = string.Empty; + + if (address == null) + address = string.Empty; + + if (s != null) + s.Dispose(); + } + } + + #endregion + + #region Exempts + + /// + /// Gets a value indicating whether a product is tax exempt + /// + /// Product + /// Customer + /// A value indicating whether a product is tax exempt + public virtual bool IsTaxExempt(Product product, Customer customer) + { + if (customer != null) + { + if (customer.IsTaxExempt) + return true; + + if (customer.CustomerRoles.Where(cr => cr.Active).Any(cr => cr.TaxExempt)) + return true; + } + + if (product == null) + { + return false; + } + + if (product.IsTaxExempt) + { + return true; + } + + return false; + } + + /// + /// Gets a value indicating whether EU VAT exempt (the European Union Value Added Tax) + /// + /// Address + /// Customer + /// Result + public virtual bool IsVatExempt(Address address, Customer customer) + { + if (!_taxSettings.EuVatEnabled) + return false; + + if (address == null || address.Country == null || customer == null) + return false; + + + if (!address.Country.SubjectToVat) + // VAT not chargeable if shipping outside VAT zone + return true; + + // VAT not chargeable if address, customer and config meet our VAT exemption requirements: + // returns true if this customer is VAT exempt because they are shipping within the EU but outside our shop country, they have supplied a validated VAT number, and the shop is configured to allow VAT exemption + var customerVatStatus = (VatNumberStatus) customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId); + return address.CountryId != _taxSettings.EuVatShopCountryId && + customerVatStatus == VatNumberStatus.Valid && + _taxSettings.EuVatAllowVatExemption; + } + + #endregion + + #endregion + } +} diff --git a/src/Libraries/Nop.Services/Tax/TaxSummary.cs b/src/Libraries/Nop.Services/Tax/TaxSummary.cs new file mode 100644 index 00000000000..cddddb8a3c8 --- /dev/null +++ b/src/Libraries/Nop.Services/Tax/TaxSummary.cs @@ -0,0 +1,675 @@ + +using Nop.Services.Catalog; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; + +namespace Nop.Services.Tax +{ + #region taxrateEntry + /// + /// TaxRate entry to store amounts per taxrate + /// all values are per rate and most of them calculated + /// only TaxRate, ItemAmount, ShippingAmount and PaymentFeeAmount can be set + /// + public partial class TaxRateEntry + { + public decimal TaxRate { get; set; } + public decimal TaxRateWeight { get; internal set; } //weight of TaxRate used for product sets [it's (sum of associated products price per TaxRate) / (total price of assoc. prod.) ] + public decimal SubtotalAmount { get; set; } + public decimal ShippingAmount { get; set; } + public decimal PaymentFeeAmount { get; set; } //when set as fee + public decimal EntryAmount //sum of above amounts + { + get { return SubtotalAmount + ShippingAmount + PaymentFeeAmount; } + } + public decimal SubTotalDiscountAmount { get; internal set; } + public decimal InvoiceDiscountAmount { get; internal set; } + public decimal PaymentFeeDiscountAmount { get; set; } //when set as discount or surcharge + public decimal RewardPointsDiscountAmount { get; set; } //earned reward points + public decimal DiscountAmount//sum of above discount amounts + { + get { return SubTotalDiscountAmount + InvoiceDiscountAmount + PaymentFeeDiscountAmount + RewardPointsDiscountAmount; } + } + public decimal BaseAmount { get; internal set; } //base amount excl. tax + public decimal TaxAmount { get; internal set; } //tax + public decimal AmountIncludingTax { get; internal set; } //base + tax + } + + #endregion + + /// + /// TaxSummary to store TaxRates and overall totals + /// + public partial class TaxSummary + { + //private + decimal _totalSubTotalAmount; + decimal? _totalShippingAmountTaxable; + decimal _totalAmount; + decimal _totalAmountTax; + decimal _totalAmountIncludingTax; + decimal _totalPaymentFeeDiscAmount; + decimal _totalPaymentFeeAmount; + decimal _totalRewardPointsAmountTaxable; + decimal _totalSubTotalDiscAmount; + decimal _totalInvDiscAmount; + + //externally set amounts + decimal? _totalShippingAmountNonTaxable; + decimal? _totalRewardPointsAmountNonTaxable; + decimal? _totalPaymentFeeAmountNonTaxable; + decimal? _totalRewardPointsAmountPurchased; + decimal? _totalGiftcardsAmount; + + #region Ctor + /// + /// Ctor + /// + /// Indicates if given amounts do include tax + public TaxSummary(bool pricesIncludingTax) + { + TaxRates = new SortedDictionary(); + PricesIncludeTax = pricesIncludingTax; + } + #endregion + + public SortedDictionary TaxRates { get; private set; } + /// + /// Indicates if supplied prices and amounts do include tax + /// + public bool PricesIncludeTax { get; } + public decimal PercentageInvDiscount { get; private set; } = decimal.Zero; //set via sub + public decimal PercentageSubTotalDiscount { get; private set; } = decimal.Zero; //set via sub + public decimal PercentageRewardPointsDiscount { get; private set; } = decimal.Zero; //earned points, set via sub + public decimal PercentagePaymentFeeOrDiscount { get; private set; } = decimal.Zero; //set via sub + /// + /// Total subtotal of taxrates + /// + public decimal TotalSubTotalAmount { get { if (HasChanges) CalculateAmounts(); return _totalSubTotalAmount; } } + /// + /// Total shipping of taxrates + /// + public decimal? TotalShippingAmountTaxable { get { if (HasChanges) CalculateAmounts(); return _totalShippingAmountTaxable; } } + /// + /// Total shipping not taxable + /// + public decimal? TotalShippingAmountNonTaxable + { + get { return _totalShippingAmountNonTaxable; } + set + { + _totalShippingAmountNonTaxable = value; + if (value.HasValue) + { + _totalShippingAmountNonTaxable = RoundingHelper.RoundAmount(value.Value); + HasShipping = true; + } + } + } + /// + /// Total shipping amount (taxable + nontaxable) + /// + public decimal? TotalShippingAmount { get { return GetSum(SumType.TotalShippingAmount); } } //sum of shipping amounts + /// + /// Total reward points amount (taxable) = earned points + /// + public decimal TotalRewardPointsAmountTaxable { get { if (HasChanges) CalculateAmounts(); return _totalRewardPointsAmountTaxable; } } //set via percentage + /// + /// Total reward points amount (nontaxable) = earned points set as nontaxable + /// + public decimal? TotalRewardPointsAmountNonTaxable + { + get { return _totalRewardPointsAmountNonTaxable; } + set { _totalRewardPointsAmountNonTaxable = value.HasValue ? RoundingHelper.RoundAmount(value.Value) : value; } + } + /// + /// Total payment fee amount (taxable) + /// + public decimal TotalPaymentFeeAmount { get { if (HasChanges) CalculateAmounts(); return _totalPaymentFeeAmount; } } //set via percentage + /// + /// Total payment fee amount (nontaxable) + /// + public decimal? TotalPaymentFeeAmountNonTaxable + { + get { return _totalPaymentFeeAmountNonTaxable; } + set { _totalPaymentFeeAmountNonTaxable = value.HasValue ? RoundingHelper.RoundAmount(value.Value) : value; } + } + /// + /// Total payment fee discount amount (taxable) + /// + public decimal TotalPaymentFeeDiscAmount { get { if (HasChanges) CalculateAmounts(); return _totalPaymentFeeDiscAmount; } } //set via percentage + /// + /// Total payment fee + discount amount (taxable) + /// + public decimal TotalPaymentFeeAmountTaxable { get { return GetSum(SumType.TotalPaymentFeeAmountTaxable) ?? decimal.Zero; } } //sum of payment fees + /// + /// Total subtotal discount of taxrates + /// + public decimal TotalSubTotalDiscAmount { get { if (HasChanges) CalculateAmounts(); return _totalSubTotalDiscAmount; } } //set via percentage + /// + /// Total invoice discount of taxrates + /// + public decimal TotalInvDiscAmount { get { if (HasChanges) CalculateAmounts(); return _totalInvDiscAmount; } } //set via percentage + /// + /// Total base amount (excl. tax= + /// + public decimal TotalAmount { get { if (HasChanges) CalculateAmounts(); return _totalAmount; } } + /// + /// Total tax amount + /// + public decimal TotalAmountTax { get { if (HasChanges) CalculateAmounts(); return _totalAmountTax; } } + /// + /// Total amount incl. tax (base + tax) + /// + public decimal TotalAmountIncludingTax { get { if (HasChanges) CalculateAmounts(); return _totalAmountIncludingTax; } } + /// + /// Total purchased reward points amount (nontaxable) + /// + public decimal? TotalRewardPointsAmountPurchased + { + get { return _totalRewardPointsAmountPurchased; } + set { _totalRewardPointsAmountPurchased = value.HasValue ? RoundingHelper.RoundAmount(value.Value) : value; } + } + /// + /// Total gift cards amount (nontaxable) + /// + public decimal? TotalGiftcardsAmount + { + get { return _totalGiftcardsAmount; } + set { _totalGiftcardsAmount = value.HasValue ? RoundingHelper.RoundAmount(value.Value) : value; } + } + /// + /// Total to pay (Amount incl. vat + non tax payment fee + non tax shipp - rewardpoints - gift cards) + /// + public decimal TotalPaymentAmount { get { return GetSum(SumType.TotalPaymentAmount) ?? decimal.Zero; } } + /// + /// Total base amount for payment fee calculation (total amount or total incl.) + /// + public decimal TotalBaseAmountForPaymentFeeCalculation { get { return GetSum(SumType.TotalBaseAmountForPaymentFeeCalculation) ?? decimal.Zero; } } + /// + /// Total order amount (base + fee (nontax) + shipp (nontax) - reward (nontax) + /// + public decimal TotalOrderAmountExcl { get { return GetSum(SumType.TotalOrderAmount) ?? decimal.Zero; } } + /// + /// Total order amount (base + tax + fee (nontax) + shipp (nontax) - reward (nontax) + /// + public decimal TotalOrderAmountIncl { get { return GetSum(SumType.TotalOrderAmountIncl) ?? decimal.Zero; } } + + + private bool HasChanges; + private bool HasPaymentFeeTax + { + get + { + foreach (var tr in TaxRates) + { + if (tr.Value.PaymentFeeAmount != decimal.Zero) + return true; + } + return false; + } + } + private bool HasShipping { get; set; } = false; + + + #region sums + private enum SumType { TotalShippingAmount, TotalPaymentFeeAmountTaxable, TotalPaymentAmount, TotalBaseAmountForPaymentFeeCalculation, TotalOrderAmount, TotalOrderAmountIncl }; + private decimal? GetSum(SumType type) + { + + if (HasChanges) + CalculateAmounts(); + + switch (type) + { + case SumType.TotalShippingAmount: + if (TotalShippingAmountTaxable.HasValue && !TotalShippingAmountNonTaxable.HasValue) + return TotalShippingAmountTaxable; + if (!TotalShippingAmountTaxable.HasValue && TotalShippingAmountNonTaxable.HasValue) + return TotalShippingAmountNonTaxable; + + return TotalShippingAmountTaxable + TotalShippingAmountNonTaxable; + + case SumType.TotalPaymentFeeAmountTaxable: + return TotalPaymentFeeAmount - TotalPaymentFeeDiscAmount; + + case SumType.TotalPaymentAmount: + decimal amountPay = TotalAmountIncludingTax + + (TotalShippingAmountNonTaxable ?? decimal.Zero) + + (TotalPaymentFeeAmountNonTaxable ?? decimal.Zero) + - (TotalRewardPointsAmountNonTaxable ?? decimal.Zero) + - (TotalGiftcardsAmount ?? decimal.Zero) + - (TotalRewardPointsAmountPurchased ?? decimal.Zero); + + if (amountPay < decimal.Zero) + amountPay = decimal.Zero; + + return amountPay; + + case SumType.TotalBaseAmountForPaymentFeeCalculation: + return PricesIncludeTax ? TotalOrderAmountIncl : TotalOrderAmountExcl; + + case SumType.TotalOrderAmount: + decimal amountOrder = TotalAmount + + (TotalShippingAmountNonTaxable ?? decimal.Zero) + + (TotalPaymentFeeAmountNonTaxable ?? decimal.Zero) + - (TotalRewardPointsAmountNonTaxable ?? decimal.Zero); + + if (amountOrder < decimal.Zero) + amountOrder = decimal.Zero; + return amountOrder; + + case SumType.TotalOrderAmountIncl: + decimal amountOrderIncl = TotalAmountIncludingTax + + (TotalShippingAmountNonTaxable ?? decimal.Zero) + + (TotalPaymentFeeAmountNonTaxable ?? decimal.Zero) + - (TotalRewardPointsAmountNonTaxable ?? decimal.Zero); + + if (amountOrderIncl < decimal.Zero) + amountOrderIncl = decimal.Zero; + return amountOrderIncl; + + default: + return decimal.Zero; + } + } + + #endregion + + #region utilities + public string GenerateTaxRateString() + { + return this.TaxRates.Aggregate(string.Empty, (current, next) => + string.Format("{0}{1}:{2}:{3}:{4}:{5}:{6}; ", current, + next.Value.TaxRate.ToString(CultureInfo.InvariantCulture), + next.Value.EntryAmount.ToString(CultureInfo.InvariantCulture), + next.Value.DiscountAmount.ToString(CultureInfo.InvariantCulture), + next.Value.BaseAmount.ToString(CultureInfo.InvariantCulture), + next.Value.TaxAmount.ToString(CultureInfo.InvariantCulture), + next.Value.AmountIncludingTax.ToString(CultureInfo.InvariantCulture) + ) + ); + } + public SortedDictionary GenerateOldTaxrateDict() + { + return new SortedDictionary(TaxRates.ToDictionary(x => x.Value.TaxRate, x => x.Value.TaxAmount)); + + } + + protected decimal CalcDiscountPercentage(ref decimal discAmount, decimal baseAmount) + { + decimal PercentageDiscount; + + if (baseAmount == decimal.Zero) + { + PercentageDiscount = decimal.Zero; + discAmount = decimal.Zero; + } + else + { + if (discAmount > baseAmount) + discAmount = baseAmount; + + PercentageDiscount = discAmount / baseAmount * 100; + } + return PercentageDiscount; + } + + #endregion + + #region methods + + #region rates + /// + /// Add amounts to taxrate + /// + /// Vat % + /// Item amount + /// Shipping amount + /// Payment method fee amount + public void AddRate(decimal taxRate, decimal itemAmount = decimal.Zero, decimal? shippingAmount = null, decimal paymentFeeAmount = decimal.Zero) + { + if (shippingAmount.HasValue) + HasShipping = true; + + if (!TaxRates.ContainsKey(taxRate)) + TaxRates.Add(taxRate, new TaxRateEntry() + { + TaxRate = taxRate, + SubtotalAmount = itemAmount, + ShippingAmount = shippingAmount ?? decimal.Zero, + PaymentFeeAmount = paymentFeeAmount + }); + else + { + TaxRates[taxRate].SubtotalAmount += itemAmount; + TaxRates[taxRate].ShippingAmount += shippingAmount ?? decimal.Zero; + TaxRates[taxRate].PaymentFeeAmount += paymentFeeAmount; + } + + HasChanges = true; + } + /// + /// + /// + /// Total Amount of Attributes + /// dictionary of taxRate weights on that amount + public void AddAttributeRate(decimal amount, SortedDictionary attributeTaxWeight) + { + var dummyResult = ApplyOrAddAttributeRate(amount, attributeTaxWeight, doAdd: true); + } + /// + /// Parses taxWeights and calculates respective amounts + /// + /// amount to weight + /// tax weights + /// SortedDictionary of weighted amounts + public SortedDictionary ApplyAttributeRate(decimal amount, SortedDictionary attributeTaxWeight) + { + return ApplyOrAddAttributeRate(amount, attributeTaxWeight, doAdd: false); + } + #endregion + + protected SortedDictionary ApplyOrAddAttributeRate(decimal amount, SortedDictionary attributeTaxWeight, bool doAdd = true) + { + var result = new SortedDictionary(); + int i = 0; + var c = attributeTaxWeight.Count(); + decimal reminder = amount; + foreach (KeyValuePair kvp in attributeTaxWeight) + { + i += 1; + decimal vatpercentage = kvp.Key; + decimal rateWeight = kvp.Value; + var amountWeighted = RoundingHelper.RoundAmount(amount * rateWeight); + if (i < c) + { + if (doAdd) + AddRate(vatpercentage, amountWeighted); + else + result.Add(vatpercentage, amountWeighted); + reminder -= amountWeighted; + } + else + { + reminder = RoundingHelper.RoundAmount(reminder); + if (doAdd) + AddRate(vatpercentage, reminder); + else + result.Add(vatpercentage, reminder); + } + } + + return result; + } + + #region discount percentages + /// + /// Set subtotal discount amount. Converted internally to percentage + /// + /// Subtotal discount amount + /// Base amount to which apply discount + public void SetSubtotalDiscAmount(decimal totalSubTotalDiscAmount, decimal baseAmount = 0) + { + totalSubTotalDiscAmount = RoundingHelper.RoundAmount(totalSubTotalDiscAmount); + if (baseAmount == decimal.Zero) + baseAmount = TaxRates.Sum(x => x.Value.SubtotalAmount); + + totalSubTotalDiscAmount = Math.Min(totalSubTotalDiscAmount, baseAmount); + PercentageSubTotalDiscount = CalcDiscountPercentage(ref totalSubTotalDiscAmount, baseAmount); + _totalSubTotalDiscAmount = totalSubTotalDiscAmount; + + HasChanges = true; + } + + /// + /// Set redeemed reward points amount. Converted internally to a percentage + /// + /// Redeemed reward points amount + /// Base amount to which apply discount + public void SetRewardPointsDiscAmount(decimal totalRewardPointsAmount, decimal baseAmount = 0) + { + totalRewardPointsAmount = RoundingHelper.RoundAmount(totalRewardPointsAmount); + totalRewardPointsAmount = Math.Min(totalRewardPointsAmount, baseAmount); + + PercentageRewardPointsDiscount = CalcDiscountPercentage(ref totalRewardPointsAmount, baseAmount); + _totalRewardPointsAmountTaxable = totalRewardPointsAmount; + + HasChanges = true; + } + + /// + /// Set PaymentFee as discount (negative amount) or surcharge (positive amount) (used for taxable fee as discount or surcharge) + /// + /// Fee Amount + /// Base amount to which apply discount fee + public void SetPaymentFeeOrDiscAmount(decimal totalPaymentFeeOrDiscAmount, decimal baseAmount) + { + totalPaymentFeeOrDiscAmount = RoundingHelper.RoundAmount(totalPaymentFeeOrDiscAmount); + totalPaymentFeeOrDiscAmount = Math.Min(totalPaymentFeeOrDiscAmount, baseAmount); + + //totalPaymentFeeDiscAmount is passed as negative number + var sign = Math.Sign(totalPaymentFeeOrDiscAmount); + totalPaymentFeeOrDiscAmount = Math.Abs(totalPaymentFeeOrDiscAmount); + _totalPaymentFeeAmount = decimal.Zero; + _totalPaymentFeeDiscAmount = decimal.Zero; + + PercentagePaymentFeeOrDiscount = CalcDiscountPercentage(ref totalPaymentFeeOrDiscAmount, baseAmount); + if (sign == -1) + _totalPaymentFeeDiscAmount = totalPaymentFeeOrDiscAmount; + else + _totalPaymentFeeAmount = totalPaymentFeeOrDiscAmount; + + HasChanges = true; + } + + /// + /// Set total invoice discount amount, it will be converted to an internal discount percentage + /// + /// invoice discount amount + /// Base amount to which apply discount + public void SetTotalInvDiscAmount(decimal totalInvDiscAmount, decimal baseAmount) + { + totalInvDiscAmount = RoundingHelper.RoundAmount(totalInvDiscAmount); + totalInvDiscAmount = Math.Min(totalInvDiscAmount, baseAmount); + + PercentageInvDiscount = CalcDiscountPercentage(ref totalInvDiscAmount, baseAmount); + _totalInvDiscAmount = totalInvDiscAmount; + + HasChanges = true; + } + #endregion + + /// + /// Calculate amounts and tax + /// + private void CalculateAmounts() + { + if (!HasChanges) + return; + + //reset totals + _totalSubTotalAmount = decimal.Zero; + if (HasShipping) + _totalShippingAmountTaxable = decimal.Zero; + else + _totalShippingAmountTaxable = null; + _totalAmount = decimal.Zero; + _totalAmountTax = decimal.Zero; + _totalAmountIncludingTax = decimal.Zero; + + HasChanges = false; + + //payment fee with tax + if (HasPaymentFeeTax) + { + _totalPaymentFeeAmount = decimal.Zero; + _totalPaymentFeeDiscAmount = decimal.Zero; + PercentagePaymentFeeOrDiscount = decimal.Zero; + } + + //init remainder + decimal remainderSubTotalDisc = decimal.Zero; decimal sumSubTotalDisc = decimal.Zero; + decimal remainderInvDisc = decimal.Zero; decimal sumInvDisc = decimal.Zero; + decimal remainderRewardPointsDisc = decimal.Zero; decimal sumRewardPointsDisc = decimal.Zero; + decimal remainderPaymentFeeOrDisc = decimal.Zero; decimal sumPaymentFeeOrDisc = decimal.Zero; + + var n = TaxRates.Count(); + var i = 0; + + //calc and sum up tax + foreach (KeyValuePair kvp in TaxRates) + { + decimal vatpercentage = kvp.Key; + TaxRateEntry taxrate = kvp.Value; + i += 1; + + //subtotal discount + if (PercentageSubTotalDiscount != 0) + { + if (i == n) + { + var diff = TotalSubTotalDiscAmount - sumSubTotalDisc; + taxrate.SubTotalDiscountAmount = diff; + } + else + { + var discountbase = taxrate.SubtotalAmount; + remainderSubTotalDisc += discountbase * PercentageSubTotalDiscount / 100; + taxrate.SubTotalDiscountAmount = RoundingHelper.RoundAmount(remainderSubTotalDisc); + remainderSubTotalDisc -= taxrate.SubTotalDiscountAmount; + sumSubTotalDisc += taxrate.SubTotalDiscountAmount; + } + } + + //Invoice discount is in sequence to other discounts, i.e. applied to already discounted amounts + if (PercentageInvDiscount != 0) + { + if (i == n) + { + var diff = TotalInvDiscAmount - sumInvDisc; + taxrate.InvoiceDiscountAmount = diff; + } + else + { + var discountbase = taxrate.SubtotalAmount - taxrate.SubTotalDiscountAmount + taxrate.ShippingAmount; + remainderInvDisc += discountbase * PercentageInvDiscount / 100; + taxrate.InvoiceDiscountAmount = RoundingHelper.RoundAmount(remainderInvDisc); + remainderInvDisc -= taxrate.InvoiceDiscountAmount; + sumInvDisc += taxrate.InvoiceDiscountAmount; + } + } + + //Reward points are in sequence to other discounts, i.e. applied to already discounted amounts + if (PercentageRewardPointsDiscount != 0) + { + if (i == n) + { + var diff =TotalRewardPointsAmountTaxable - sumRewardPointsDisc; + taxrate.RewardPointsDiscountAmount = diff; + } + else + { + var discountbase = taxrate.SubtotalAmount - taxrate.SubTotalDiscountAmount + taxrate.ShippingAmount - taxrate.InvoiceDiscountAmount; + remainderRewardPointsDisc += discountbase * PercentageRewardPointsDiscount / 100; + taxrate.RewardPointsDiscountAmount = RoundingHelper.RoundAmount(remainderRewardPointsDisc); + remainderRewardPointsDisc -= taxrate.RewardPointsDiscountAmount; + sumRewardPointsDisc += taxrate.RewardPointsDiscountAmount; + } + } + + //percentage payment fee discount. + if (PercentagePaymentFeeOrDiscount != 0) + { + if (i == n) + { + var diff = TotalPaymentFeeAmount + TotalPaymentFeeDiscAmount - sumPaymentFeeOrDisc; //TotalPaymentFeeAmount and TotalPaymentFeeDiscAmount are mutual zero + taxrate.PaymentFeeAmount = TotalPaymentFeeAmount != decimal.Zero ? diff : decimal.Zero; + taxrate.PaymentFeeDiscountAmount = TotalPaymentFeeDiscAmount != decimal.Zero ? diff : decimal.Zero; + + } + else + { + var discountbase = taxrate.SubtotalAmount - taxrate.SubTotalDiscountAmount + taxrate.ShippingAmount - taxrate.InvoiceDiscountAmount - taxrate.RewardPointsDiscountAmount; + remainderPaymentFeeOrDisc += discountbase * PercentagePaymentFeeOrDiscount / 100; + taxrate.PaymentFeeAmount = decimal.Zero; taxrate.PaymentFeeDiscountAmount = decimal.Zero; + if (TotalPaymentFeeAmount != decimal.Zero) + taxrate.PaymentFeeAmount = RoundingHelper.RoundAmount(remainderPaymentFeeOrDisc); + else + taxrate.PaymentFeeDiscountAmount = RoundingHelper.RoundAmount(remainderPaymentFeeOrDisc); + remainderPaymentFeeOrDisc -= taxrate.PaymentFeeAmount + taxrate.PaymentFeeDiscountAmount; + sumPaymentFeeOrDisc += taxrate.PaymentFeeAmount + taxrate.PaymentFeeDiscountAmount; + } + } + + //TAX: always round tax first + decimal rateamount = taxrate.EntryAmount - taxrate.DiscountAmount; + if (PricesIncludeTax) + { + taxrate.AmountIncludingTax = rateamount; + taxrate.TaxAmount = RoundingHelper.RoundTax(taxrate.AmountIncludingTax / (100 + vatpercentage) * vatpercentage); // this is (1+p/100) * p/100 + taxrate.BaseAmount = taxrate.AmountIncludingTax - taxrate.TaxAmount; + } + else + { + taxrate.BaseAmount = rateamount; + taxrate.TaxAmount = RoundingHelper.RoundTax(taxrate.BaseAmount * vatpercentage / 100); + taxrate.AmountIncludingTax = taxrate.BaseAmount + taxrate.TaxAmount; + } + + + //taxrate totals + _totalSubTotalAmount += taxrate.SubtotalAmount; + if (HasShipping) //to maintain null + _totalShippingAmountTaxable += taxrate.ShippingAmount; + + if (PercentagePaymentFeeOrDiscount == 0) //sum only when not set as discount or surcharge + _totalPaymentFeeAmount += taxrate.PaymentFeeAmount; + + _totalAmount += taxrate.BaseAmount; + _totalAmountTax += taxrate.TaxAmount; + _totalAmountIncludingTax += taxrate.AmountIncludingTax; + } + } + /// + /// Calculate tax weights used in attributes + /// + public void CalculateWeights() + { + if (HasChanges) + CalculateAmounts(); + + //calculate tax weights + int i = 0; + int c = TaxRates.Count(); + decimal totWeight = decimal.Zero; + foreach (KeyValuePair kvp in this.TaxRates) + { + i++; + decimal vatpercentage = kvp.Key; + TaxRateEntry taxrate = kvp.Value; + if (i < c) + { + if (this.TotalAmount != 0) + { + taxrate.TaxRateWeight = PricesIncludeTax ? taxrate.AmountIncludingTax / this.TotalAmountIncludingTax : taxrate.BaseAmount / this.TotalAmount; + } + else + { + taxrate.TaxRateWeight = 0; + } + totWeight += taxrate.TaxRateWeight; + } + else + { + //assure sum of TaxRateWeight = 1 + taxrate.TaxRateWeight = decimal.One - totWeight; + } + } + } + #endregion + } +} diff --git a/src/Libraries/Nop.Services/packages.config b/src/Libraries/Nop.Services/packages.config index fc47eb76dab..a9a10cb517b 100644 --- a/src/Libraries/Nop.Services/packages.config +++ b/src/Libraries/Nop.Services/packages.config @@ -1,31 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/Nop.Plugin.Payments.PayPalDirect/PayPalDirectPaymentProcessor.cs b/src/Plugins/Nop.Plugin.Payments.PayPalDirect/PayPalDirectPaymentProcessor.cs index 9af41128d1a..37b17751fde 100644 --- a/src/Plugins/Nop.Plugin.Payments.PayPalDirect/PayPalDirectPaymentProcessor.cs +++ b/src/Plugins/Nop.Plugin.Payments.PayPalDirect/PayPalDirectPaymentProcessor.cs @@ -1,1197 +1,1203 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Web.Routing; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Plugins; -using Nop.Plugin.Payments.PayPalDirect.Controllers; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Configuration; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Discounts; -using Nop.Services.Localization; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Tax; -using PayPal.Api; - -namespace Nop.Plugin.Payments.PayPalDirect -{ - /// - /// PayPalDirect payment processor - /// - public class PayPalDirectPaymentProcessor : BasePlugin, IPaymentMethod - { - #region Fields - - private readonly CurrencySettings _currencySettings; - private readonly ICheckoutAttributeParser _checkoutAttributeParser; - private readonly ICurrencyService _currencyService; - private readonly ICustomerService _customerService; - private readonly ILocalizationService _localizationService; - private readonly IOrderTotalCalculationService _orderTotalCalculationService; - private readonly IPaymentService _paymentService; - private readonly IPriceCalculationService _priceCalculationService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly ISettingService _settingService; - private readonly IStoreContext _storeContext; - private readonly ITaxService _taxService; - private readonly IWebHelper _webHelper; - private readonly PayPalDirectPaymentSettings _paypalDirectPaymentSettings; - - #endregion - - #region Ctor - - public PayPalDirectPaymentProcessor(CurrencySettings currencySettings, - ICheckoutAttributeParser checkoutAttributeParser, - ICurrencyService currencyService, - ICustomerService customerService, - ILocalizationService localizationService, - IOrderTotalCalculationService orderTotalCalculationService, - IPaymentService paymentService, - IPriceCalculationService priceCalculationService, - IProductAttributeParser productAttributeParser, - ISettingService settingService, - IStoreContext storeContext, - ITaxService taxService, - IWebHelper webHelper, - PayPalDirectPaymentSettings paypalDirectPaymentSettings) - { - this._currencySettings = currencySettings; - this._checkoutAttributeParser = checkoutAttributeParser; - this._currencyService = currencyService; - this._customerService = customerService; - this._localizationService = localizationService; - this._orderTotalCalculationService = orderTotalCalculationService; - this._paymentService = paymentService; - this._priceCalculationService = priceCalculationService; - this._productAttributeParser = productAttributeParser; - this._settingService = settingService; - this._storeContext = storeContext; - this._taxService = taxService; - this._webHelper = webHelper; - this._paypalDirectPaymentSettings = paypalDirectPaymentSettings; - } - - #endregion - - #region Utilities - - /// - /// Gets a payment status - /// - /// PayPal state - /// Payment status - protected PaymentStatus GetPaymentStatus(string state) - { - state = state ?? string.Empty; - var result = PaymentStatus.Pending; - - switch (state.ToLowerInvariant()) - { - case "pending": - result = PaymentStatus.Pending; - break; - case "authorized": - result = PaymentStatus.Authorized; - break; - case "captured": - case "completed": - result = PaymentStatus.Paid; - break; - case "expired": - case "voided": - result = PaymentStatus.Voided; - break; - case "refunded": - result = PaymentStatus.Refunded; - break; - case "partially_refunded": - result = PaymentStatus.PartiallyRefunded; - break; - default: - break; - } - - return result; - } - - /// - /// Get start date of recurring payments - /// - /// Cycle period - /// Cycle length - /// Start date in ISO8601 format - protected string GetStartDate(RecurringProductCyclePeriod period, int length) - { - //PayPal expects date in PDT timezone (UTC -7) - var startDate = DateTime.UtcNow.AddHours(-7); - switch (period) - { - case RecurringProductCyclePeriod.Days: - startDate = startDate.AddDays(length); - break; - case RecurringProductCyclePeriod.Weeks: - startDate = startDate.AddDays(length * 7); - break; - case RecurringProductCyclePeriod.Months: - startDate = startDate.AddMonths(length); - break; - case RecurringProductCyclePeriod.Years: - startDate = startDate.AddYears(length); - break; - } - - return string.Format("{0}Z", startDate.ToString("s")); - } - - #region Items - - /// - /// Get PayPal items - /// - /// Shopping cart - /// Customer - /// Store identifier - /// Currency code - /// List of PayPal items - protected List GetItems(IList shoppingCart, Customer customer, int storeId, string currencyCode) - { - var items = new List(); - - if (!_paypalDirectPaymentSettings.PassPurchasedItems) - return items; - - //create PayPal items from shopping cart items - items.AddRange(CreateItems(shoppingCart)); - - //create PayPal items from checkout attributes - items.AddRange(CreateItemsForCheckoutAttributes(customer, storeId)); - - //create PayPal item for payment method additional fee - items.Add(CreateItemForPaymentAdditionalFee(shoppingCart, customer)); - - //currently there are no ways to add discount for all order directly to amount details, so we add them as extra items - //create PayPal item for subtotal discount - items.Add(CreateItemForSubtotalDiscount(shoppingCart)); - - //create PayPal item for total discount - items.Add(CreateItemForTotalDiscount(shoppingCart)); - - items.RemoveAll(item => item == null); - - //add currency code for all items - items.ForEach(item => item.currency = currencyCode); - - return items; - } - - /// - /// Create items from shopping cart - /// - /// Shopping cart - /// Collection of PayPal items - protected IEnumerable CreateItems(IEnumerable shoppingCart) - { - return shoppingCart.Select(shoppingCartItem => - { - if (shoppingCartItem.Product == null) - return null; - - var item = new Item(); - - //name - item.name = shoppingCartItem.Product.Name; - - //sku - if (!string.IsNullOrEmpty(shoppingCartItem.AttributesXml)) - { - var combination = _productAttributeParser.FindProductAttributeCombination(shoppingCartItem.Product, shoppingCartItem.AttributesXml); - item.sku = combination != null && !string.IsNullOrEmpty(combination.Sku) ? combination.Sku : shoppingCartItem.Product.Sku; - } - else - item.sku = shoppingCartItem.Product.Sku; - - //item price - decimal taxRate; - var unitPrice = _priceCalculationService.GetUnitPrice(shoppingCartItem); - var price = _taxService.GetProductPrice(shoppingCartItem.Product, unitPrice, false, shoppingCartItem.Customer, out taxRate); - item.price = price.ToString("N", new CultureInfo("en-US")); - - //quantity - item.quantity = shoppingCartItem.Quantity.ToString(); - - return item; - }); - } - - /// - /// Create items for checkout attributes - /// - /// Customer - /// Store identifier - /// Collection of PayPal items - protected IEnumerable CreateItemsForCheckoutAttributes(Customer customer, int storeId) - { - var checkoutAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, storeId); - if (string.IsNullOrEmpty(checkoutAttributesXml)) - return new List(); - - //get attribute values - var attributeValues = _checkoutAttributeParser.ParseCheckoutAttributeValues(checkoutAttributesXml); - - return attributeValues.Select(checkoutAttributeValue => - { - if (checkoutAttributeValue.CheckoutAttribute == null) - return null; - - //get price - var attributePrice = _taxService.GetCheckoutAttributePrice(checkoutAttributeValue, false, customer); - - //create item - return new Item - { - name = string.Format("{0} ({1})", checkoutAttributeValue.CheckoutAttribute.Name, checkoutAttributeValue.Name), - price = attributePrice.ToString("N", new CultureInfo("en-US")), - quantity = "1" - }; - }); - } - - /// - /// Create item for payment method additional fee - /// - /// Shopping cart - /// Customer - /// PayPal item - protected Item CreateItemForPaymentAdditionalFee(IList shoppingCart, Customer customer) - { - //get price - var paymentAdditionalFee = _paymentService.GetAdditionalHandlingFee(shoppingCart, PluginDescriptor.SystemName); - var paymentPrice = _taxService.GetPaymentMethodAdditionalFee(paymentAdditionalFee, false, customer); - - if (paymentPrice <= decimal.Zero) - return null; - - //create item - return new Item - { - name = string.Format("Payment method ({0}) additional fee", PluginDescriptor.FriendlyName), - price = paymentPrice.ToString("N", new CultureInfo("en-US")), - quantity = "1" - }; - } - - /// - /// Create item for discount to order subtotal - /// - /// Shopping cart - /// PayPal item - protected Item CreateItemForSubtotalDiscount(IList shoppingCart) - { - //get subtotal discount amount - decimal discountAmount; - List discounts; - decimal withoutDiscount; - decimal subtotal; - _orderTotalCalculationService.GetShoppingCartSubTotal(shoppingCart, false, out discountAmount, out discounts, out withoutDiscount, out subtotal); - - if (discountAmount <= decimal.Zero) - return null; - - //create item with negative price - return new Item - { - name = "Discount for the subtotal of order", - price = (-discountAmount).ToString("N", new CultureInfo("en-US")), - quantity = "1" - }; - } - - /// - /// Create item for discount to order total - /// - /// Shopping cart - /// PayPal item - protected Item CreateItemForTotalDiscount(IList shoppingCart) - { - //get total discount amount - decimal discountAmount; - List giftCards; - List discounts; - int rewardPoints; - decimal rewardPointsAmount; - var orderTotal = _orderTotalCalculationService.GetShoppingCartTotal(shoppingCart, out discountAmount, - out discounts, out giftCards, out rewardPoints, out rewardPointsAmount); - - if (discountAmount <= decimal.Zero) - return null; - - //create item with negative price - return new Item - { - name = "Discount for the total of order", - price = (-discountAmount).ToString("N", new CultureInfo("en-US")), - quantity = "1" - }; - } - - #endregion - - /// - /// Get transaction amount details - /// - /// Payment info required for an order processing - /// Shopping cart - /// List of PayPal items - /// Amount details object - protected Details GetAmountDetails(ProcessPaymentRequest paymentRequest, IList shoppingCart, IList items) - { - //get shipping total - var shipping = _orderTotalCalculationService.GetShoppingCartShippingTotal(shoppingCart, false); - var shippingTotal = shipping.HasValue ? shipping.Value : 0; - - //get tax total - SortedDictionary taxRatesDictionary; - var taxTotal = _orderTotalCalculationService.GetTaxTotal(shoppingCart, out taxRatesDictionary); - - //get subtotal - var subTotal = decimal.Zero; - if (items != null && items.Any()) - { - //items passed to PayPal, so calculate subtotal based on them - var tmpPrice = decimal.Zero; - var tmpQuantity = 0; - subTotal = items.Sum(item => !decimal.TryParse(item.price, out tmpPrice) || !int.TryParse(item.quantity, out tmpQuantity) ? 0 : tmpPrice * tmpQuantity); - } - else - subTotal = paymentRequest.OrderTotal - shippingTotal - taxTotal; - - //adjust order total to avoid PayPal payment error: "Transaction amount details (subtotal, tax, shipping) must add up to specified amount total" - paymentRequest.OrderTotal = Math.Round(shippingTotal, 2) + Math.Round(subTotal, 2) + Math.Round(taxTotal, 2); - - //create amount details - return new Details - { - shipping = shippingTotal.ToString("N", new CultureInfo("en-US")), - subtotal = subTotal.ToString("N", new CultureInfo("en-US")), - tax = taxTotal.ToString("N", new CultureInfo("en-US")) - }; - } - - #endregion - - #region Methods - - /// - /// Process a payment - /// - /// Payment info required for an order processing - /// Process payment result - public ProcessPaymentResult ProcessPayment(ProcessPaymentRequest processPaymentRequest) - { - var result = new ProcessPaymentResult(); - - var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); - if (customer == null) - throw new Exception("Customer cannot be loaded"); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - - //currency - var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - - //get current shopping cart - var shoppingCart = customer.ShoppingCartItems - .Where(shoppingCartItem => shoppingCartItem.ShoppingCartType == ShoppingCartType.ShoppingCart) - .LimitPerStore(processPaymentRequest.StoreId).ToList(); - - //items - var items = GetItems(shoppingCart, customer, processPaymentRequest.StoreId, currency.CurrencyCode); - - //amount details - var amountDetails = GetAmountDetails(processPaymentRequest, shoppingCart, items); - - //payment - var payment = new Payment() - { - #region payer - - payer = new Payer() - { - payment_method = "credit_card", - - #region credit card info - - funding_instruments = new List - { - new FundingInstrument - { - credit_card = new CreditCard - { - type = processPaymentRequest.CreditCardType.ToLowerInvariant(), - number = processPaymentRequest.CreditCardNumber, - cvv2 = processPaymentRequest.CreditCardCvv2, - expire_month = processPaymentRequest.CreditCardExpireMonth, - expire_year = processPaymentRequest.CreditCardExpireYear - } - } - }, - - #endregion - - #region payer info - - payer_info = new PayerInfo - { - #region billing address - - billing_address = customer.BillingAddress == null ? null : new Address - { - country_code = customer.BillingAddress.Country != null ? customer.BillingAddress.Country.TwoLetterIsoCode : null, - state = customer.BillingAddress.StateProvince != null ? customer.BillingAddress.StateProvince.Abbreviation : null, - city = customer.BillingAddress.City, - line1 = customer.BillingAddress.Address1, - line2 = customer.BillingAddress.Address2, - phone = customer.BillingAddress.PhoneNumber, - postal_code = customer.BillingAddress.ZipPostalCode - }, - - #endregion - - email = customer.BillingAddress != null ? customer.BillingAddress.Email : null, - first_name = customer.BillingAddress != null ? customer.BillingAddress.FirstName : null, - last_name = customer.BillingAddress != null ? customer.BillingAddress.LastName : null - } - - #endregion - }, - - #endregion - - #region transaction - - transactions = new List() - { - new Transaction - { - #region amount - - amount = new Amount - { - details = amountDetails, - total = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")), - currency = currency != null ? currency.CurrencyCode : null - }, - - #endregion - - item_list = new ItemList - { - items = items, - - #region shipping address - - shipping_address = customer.ShippingAddress == null ? null : new ShippingAddress - { - country_code = customer.ShippingAddress.Country != null ? customer.ShippingAddress.Country.TwoLetterIsoCode : null, - state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null, - city = customer.ShippingAddress.City, - line1 = customer.ShippingAddress.Address1, - line2 = customer.ShippingAddress.Address2, - phone = customer.ShippingAddress.PhoneNumber, - postal_code = customer.ShippingAddress.ZipPostalCode, - recipient_name = string.Format("{0} {1}", customer.ShippingAddress.FirstName, customer.ShippingAddress.LastName) - } - - #endregion - }, - - invoice_number = processPaymentRequest.OrderGuid != Guid.Empty ? processPaymentRequest.OrderGuid.ToString() : null - } - }, - - #endregion - - intent = _paypalDirectPaymentSettings.TransactMode == TransactMode.Authorize ? "authorize" : "sale", - }.Create(apiContext); - - if (payment.transactions[0].related_resources.Any() && payment.transactions[0].related_resources[0] != null) - if (_paypalDirectPaymentSettings.TransactMode == TransactMode.Authorize) - { - var authorization = payment.transactions[0].related_resources[0].authorization; - if (authorization != null) - { - if (authorization.fmf_details != null && !string.IsNullOrEmpty(authorization.fmf_details.filter_id)) - { - result.AuthorizationTransactionResult = string.Format("Authorization is {0}. Based on fraud filter: {1}. {2}", - authorization.fmf_details.filter_type, authorization.fmf_details.name, authorization.fmf_details.description); - result.NewPaymentStatus = GetPaymentStatus(Authorization.Get(apiContext, authorization.id).state); - } - else - { - result.AuthorizationTransactionResult = authorization.state; - result.NewPaymentStatus = GetPaymentStatus(authorization.state); - } - result.AuthorizationTransactionId = authorization.id; - } - } - else - { - var sale = payment.transactions[0].related_resources[0].sale; - if (sale != null) - { - if (sale.fmf_details != null && !string.IsNullOrEmpty(sale.fmf_details.filter_id)) - { - result.CaptureTransactionResult = string.Format("Sale is {0}. Based on fraud filter: {1}. {2}", - sale.fmf_details.filter_type, sale.fmf_details.name, sale.fmf_details.description); - result.NewPaymentStatus = GetPaymentStatus(Sale.Get(apiContext, sale.id).state); - } - else - { - result.CaptureTransactionResult = sale.state; - result.NewPaymentStatus = GetPaymentStatus(sale.state); - } - result.CaptureTransactionId = sale.id; - result.AvsResult = sale.processor_response != null ? sale.processor_response.avs_code : string.Empty; - - } - } - else - result.AddError("PayPal error"); - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Post process payment (used by payment gateways that require redirecting to a third-party URL) - /// - /// Payment info required for an order processing - public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest) - { - } - - /// - /// Returns a value indicating whether payment method should be hidden during checkout - /// - /// Shoping cart - /// true - hide; false - display. - public bool HidePaymentMethod(IList cart) - { - //you can put any logic here - //for example, hide this payment method if all products in the cart are downloadable - //or hide this payment method if current customer is from certain country - return false; - } - - /// - /// Gets additional handling fee - /// - /// Shopping cart - /// Additional handling fee - public decimal GetAdditionalHandlingFee(IList cart) - { - var result = this.CalculateAdditionalFee(_orderTotalCalculationService, cart, - _paypalDirectPaymentSettings.AdditionalFee, _paypalDirectPaymentSettings.AdditionalFeePercentage); - - return result; - } - - /// - /// Captures payment - /// - /// Capture payment request - /// Capture payment result - public CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest) - { - var result = new CapturePaymentResult(); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - var authorization = Authorization.Get(apiContext, capturePaymentRequest.Order.AuthorizationTransactionId); - var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - var capture = new Capture - { - amount = new Amount - { - total = capturePaymentRequest.Order.OrderTotal.ToString("N", new CultureInfo("en-US")), - currency = currency != null ? currency.CurrencyCode : null - }, - is_final_capture = true - }; - capture = authorization.Capture(apiContext, capture); - - result.CaptureTransactionId = capture.id; - result.CaptureTransactionResult = capture.state; - result.NewPaymentStatus = GetPaymentStatus(capture.state); - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Refunds a payment - /// - /// Request - /// Result - public RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequest) - { - var result = new RefundPaymentResult(); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - var refundRequest = new RefundRequest - { - amount = new Amount - { - total = refundPaymentRequest.AmountToRefund.ToString("N", new CultureInfo("en-US")), - currency = currency != null ? currency.CurrencyCode : null - } - }; - PayPal.Api.Capture.Refund(apiContext, refundPaymentRequest.Order.CaptureTransactionId, refundRequest); - var capture = PayPal.Api.Capture.Get(apiContext, refundPaymentRequest.Order.CaptureTransactionId); - result.NewPaymentStatus = GetPaymentStatus(capture.state); - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Voids a payment - /// - /// Request - /// Result - public VoidPaymentResult Void(VoidPaymentRequest voidPaymentRequest) - { - var result = new VoidPaymentResult(); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - var authorization = Authorization.Get(apiContext, voidPaymentRequest.Order.AuthorizationTransactionId); - authorization = authorization.Void(apiContext); - - result.NewPaymentStatus = GetPaymentStatus(authorization.state); - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Process recurring payment - /// - /// Payment info required for an order processing - /// Process payment result - public ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) - { - var result = new ProcessPaymentResult(); - - var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); - if (customer == null) - throw new Exception("Customer cannot be loaded"); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - - //check that webhook exists - if (string.IsNullOrEmpty(_paypalDirectPaymentSettings.WebhookId)) - { - result.AddError("Recurring payments are not available until you create a webhook"); - return result; - } - - Webhook.Get(apiContext, _paypalDirectPaymentSettings.WebhookId); - - //create the plan - var url = _webHelper.GetStoreLocation(_storeContext.CurrentStore.SslEnabled); - var billingPlan = new Plan - { - name = processPaymentRequest.OrderGuid.ToString(), - description = string.Format("nopCommerce billing plan for the {0} order", processPaymentRequest.OrderGuid), - type = "fixed", - merchant_preferences = new MerchantPreferences - { - return_url = url, - cancel_url = url, - auto_bill_amount = "YES", - //setting setup fee as the first payment (workaround for the processing first payment immediately) - setup_fee = new PayPal.Api.Currency - { - currency = currency != null ? currency.CurrencyCode : null, - value = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")) - } - }, - payment_definitions = new List - { - new PaymentDefinition - { - name = "nopCommerce payment for the billing plan", - type = "REGULAR", - frequency_interval = processPaymentRequest.RecurringCycleLength.ToString(), - frequency = processPaymentRequest.RecurringCyclePeriod.ToString().TrimEnd('s'), - cycles = (processPaymentRequest.RecurringTotalCycles - 1).ToString(), - amount = new PayPal.Api.Currency - { - currency = currency != null ? currency.CurrencyCode : null, - value = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")) - } - } - } - }.Create(apiContext); - - //activate the plan - var patchRequest = new PatchRequest() - { - new Patch() - { - op = "replace", - path = "/", - value = new Plan - { - state = "ACTIVE" - } - } - }; - billingPlan.Update(apiContext, patchRequest); - - //create subscription - var subscription = new Agreement - { - name = string.Format("nopCommerce subscription for the {0} order", processPaymentRequest.OrderGuid), - //we set order guid in the description, then use it in the webhook handler - description = processPaymentRequest.OrderGuid.ToString(), - //setting start date as the next date of recurring payments as the setup fee was the first payment - start_date = GetStartDate(processPaymentRequest.RecurringCyclePeriod, processPaymentRequest.RecurringCycleLength), - - #region payer - - payer = new Payer() - { - payment_method = "credit_card", - - #region credit card info - - funding_instruments = new List - { - new FundingInstrument - { - credit_card = new CreditCard - { - type = processPaymentRequest.CreditCardType.ToLowerInvariant(), - number = processPaymentRequest.CreditCardNumber, - cvv2 = processPaymentRequest.CreditCardCvv2, - expire_month = processPaymentRequest.CreditCardExpireMonth, - expire_year = processPaymentRequest.CreditCardExpireYear - } - } - }, - - #endregion - - #region payer info - - payer_info = new PayerInfo - { - #region billing address - - billing_address = customer.BillingAddress == null ? null : new Address - { - country_code = customer.BillingAddress.Country != null ? customer.BillingAddress.Country.TwoLetterIsoCode : null, - state = customer.BillingAddress.StateProvince != null ? customer.BillingAddress.StateProvince.Abbreviation : null, - city = customer.BillingAddress.City, - line1 = customer.BillingAddress.Address1, - line2 = customer.BillingAddress.Address2, - phone = customer.BillingAddress.PhoneNumber, - postal_code = customer.BillingAddress.ZipPostalCode - }, - - #endregion - - email = customer.BillingAddress.Email, - first_name = customer.BillingAddress.FirstName, - last_name = customer.BillingAddress.LastName - } - - #endregion - }, - - #endregion - - #region shipping address - - shipping_address = customer.ShippingAddress == null ? null : new ShippingAddress - { - country_code = customer.ShippingAddress.Country != null ? customer.ShippingAddress.Country.TwoLetterIsoCode : null, - state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null, - city = customer.ShippingAddress.City, - line1 = customer.ShippingAddress.Address1, - line2 = customer.ShippingAddress.Address2, - phone = customer.ShippingAddress.PhoneNumber, - postal_code = customer.ShippingAddress.ZipPostalCode - }, - - #endregion - - plan = new Plan - { - id = billingPlan.id - } - }.Create(apiContext); - - //if first payment failed, try again - if (string.IsNullOrEmpty(subscription.agreement_details.last_payment_date)) - subscription.BillBalance(apiContext, new AgreementStateDescriptor { amount = subscription.agreement_details.outstanding_balance }); - - result.SubscriptionTransactionId = subscription.id; - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Cancels a recurring payment - /// - /// Request - /// Result - public CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurringPaymentRequest cancelPaymentRequest) - { - var result = new CancelRecurringPaymentResult(); - - try - { - var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); - var subscription = Agreement.Get(apiContext, cancelPaymentRequest.Order.SubscriptionTransactionId); - var reason = new AgreementStateDescriptor - { - note = string.Format("Cancel subscription {0}", cancelPaymentRequest.Order.OrderGuid) - }; - subscription.Cancel(apiContext, reason); - } - catch (PayPal.PayPalException exc) - { - if (exc is PayPal.ConnectionException) - { - var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); - if (error != null) - { - result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); - if (error.details != null) - error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); - } - } - - //if there are not the specific errors add exception message - if (result.Success) - result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); - } - - return result; - } - - /// - /// Gets a value indicating whether customers can complete a payment after order is placed but not completed (for redirection payment methods) - /// - /// Order - /// Result - public bool CanRePostProcessPayment(Core.Domain.Orders.Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - //it's not a redirection payment method. So we always return false - return false; - } - - /// - /// Gets a route for provider configuration - /// - /// Action name - /// Controller name - /// Route values - public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues) - { - actionName = "Configure"; - controllerName = "PaymentPayPalDirect"; - routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Payments.PayPalDirect.Controllers" }, { "area", null } }; - } - - /// - /// Gets a route for payment info - /// - /// Action name - /// Controller name - /// Route values - public void GetPaymentInfoRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues) - { - actionName = "PaymentInfo"; - controllerName = "PaymentPayPalDirect"; - routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Payments.PayPalDirect.Controllers" }, { "area", null } }; - } - - /// - /// Get type of controller - /// - /// Type - public Type GetControllerType() - { - return typeof(PaymentPayPalDirectController); - } - - /// - /// Install the plugin - /// - public override void Install() - { - //settings - var settings = new PayPalDirectPaymentSettings - { - TransactMode = TransactMode.Authorize, - UseSandbox = true, - }; - _settingService.SaveSetting(settings); - - //locales - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee", "Additional fee"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage", "Additional fee. Use percentage"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId", "Client ID"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId.Hint", "Specify client ID."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret", "Client secret"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret.Hint", "Specify secret key."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems", "Pass purchased items"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems.Hint", "Check to pass information about purchased items to PayPal."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode", "Transaction mode"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode.Hint", "Choose transaction mode."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox", "Use Sandbox"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment)."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId", "Webhook ID"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId.Hint", "Specify webhook ID."); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Instructions", "

If you're using this gateway ensure that your primary store currency is supported by Paypal.

To configure plugin follow these steps:
1. Log into your Developer PayPal account (click here to create your account).
2. Click on My Apps & Credentials from the Dashboard.
3. Create new REST API app.
4. Copy your Client ID and Secret key below.
5. To be able to use recurring payments you need to set the webhook ID. You can get it manually in your PayPal account (enter the URL https://www.yourStore.com/Plugins/PaymentPayPalDirect/Webhook below REST API application credentials), or automatically by pressing \"@T(\"Plugins.Payments.PayPalDirect.WebhookCreate\")\" button (not visible when running the site locally).

"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription", "Pay by credit / debit card"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookCreate", "Get webhook ID"); - this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookError", "Webhook was not created (see details in the log)"); - - base.Install(); - } - - /// - /// Uninstall the plugin - /// - public override void Uninstall() - { - //delete webhook - var settings = _settingService.LoadSetting(); - if (!string.IsNullOrEmpty(settings.WebhookId)) - { - try - { - var apiContext = PaypalHelper.GetApiContext(settings); - Webhook.Delete(apiContext, settings.WebhookId); - } - catch (PayPal.PayPalException) { } - } - - //settings - _settingService.DeleteSetting(); - - //locales - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId.Hint"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Instructions"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookCreate"); - this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookError"); - - base.Uninstall(); - } - - #endregion - - #region Properties - - /// - /// Gets a value indicating whether capture is supported - /// - public bool SupportCapture - { - get { return true; } - } - - /// - /// Gets a value indicating whether partial refund is supported - /// - public bool SupportPartiallyRefund - { - get { return true; } - } - - /// - /// Gets a value indicating whether refund is supported - /// - public bool SupportRefund - { - get { return true; } - } - - /// - /// Gets a value indicating whether void is supported - /// - public bool SupportVoid - { - get { return true; } - } - - /// - /// Gets a recurring payment type of payment method - /// - public RecurringPaymentType RecurringPaymentType - { - get { return RecurringPaymentType.Automatic; } - } - - /// - /// Gets a payment method type - /// - public PaymentMethodType PaymentMethodType - { - get { return PaymentMethodType.Standard; } - } - - /// - /// Gets a value indicating whether we should display a payment information page for this plugin - /// - public bool SkipPaymentInfo - { - get { return false; } - } - - /// - /// Gets a payment method description that will be displayed on checkout pages in the public store - /// - public string PaymentMethodDescription - { - //return description of this payment method to be display on "payment method" checkout step. good practice is to make it localizable - //for example, for a redirection payment method, description may be like this: "You will be redirected to PayPal site to complete the payment" - get { return _localizationService.GetResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription"); } - } - - #endregion - } +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web.Routing; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Plugins; +using Nop.Plugin.Payments.PayPalDirect.Controllers; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Configuration; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Discounts; +using Nop.Services.Localization; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Tax; +using PayPal.Api; + +namespace Nop.Plugin.Payments.PayPalDirect +{ + /// + /// PayPalDirect payment processor + /// + public class PayPalDirectPaymentProcessor : BasePlugin, IPaymentMethod + { + #region Fields + + private readonly CurrencySettings _currencySettings; + private readonly ICheckoutAttributeParser _checkoutAttributeParser; + private readonly ICurrencyService _currencyService; + private readonly ICustomerService _customerService; + private readonly ILocalizationService _localizationService; + private readonly IOrderTotalCalculationService _orderTotalCalculationService; + private readonly IPaymentService _paymentService; + private readonly IPriceCalculationService _priceCalculationService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly ISettingService _settingService; + private readonly IStoreContext _storeContext; + private readonly ITaxService _taxService; + private readonly IWebHelper _webHelper; + private readonly PayPalDirectPaymentSettings _paypalDirectPaymentSettings; + + #endregion + + #region Ctor + + public PayPalDirectPaymentProcessor(CurrencySettings currencySettings, + ICheckoutAttributeParser checkoutAttributeParser, + ICurrencyService currencyService, + ICustomerService customerService, + ILocalizationService localizationService, + IOrderTotalCalculationService orderTotalCalculationService, + IPaymentService paymentService, + IPriceCalculationService priceCalculationService, + IProductAttributeParser productAttributeParser, + ISettingService settingService, + IStoreContext storeContext, + ITaxService taxService, + IWebHelper webHelper, + PayPalDirectPaymentSettings paypalDirectPaymentSettings) + { + this._currencySettings = currencySettings; + this._checkoutAttributeParser = checkoutAttributeParser; + this._currencyService = currencyService; + this._customerService = customerService; + this._localizationService = localizationService; + this._orderTotalCalculationService = orderTotalCalculationService; + this._paymentService = paymentService; + this._priceCalculationService = priceCalculationService; + this._productAttributeParser = productAttributeParser; + this._settingService = settingService; + this._storeContext = storeContext; + this._taxService = taxService; + this._webHelper = webHelper; + this._paypalDirectPaymentSettings = paypalDirectPaymentSettings; + } + + #endregion + + #region Utilities + + /// + /// Gets a payment status + /// + /// PayPal state + /// Payment status + protected PaymentStatus GetPaymentStatus(string state) + { + state = state ?? string.Empty; + var result = PaymentStatus.Pending; + + switch (state.ToLowerInvariant()) + { + case "pending": + result = PaymentStatus.Pending; + break; + case "authorized": + result = PaymentStatus.Authorized; + break; + case "captured": + case "completed": + result = PaymentStatus.Paid; + break; + case "expired": + case "voided": + result = PaymentStatus.Voided; + break; + case "refunded": + result = PaymentStatus.Refunded; + break; + case "partially_refunded": + result = PaymentStatus.PartiallyRefunded; + break; + default: + break; + } + + return result; + } + + /// + /// Get start date of recurring payments + /// + /// Cycle period + /// Cycle length + /// Start date in ISO8601 format + protected string GetStartDate(RecurringProductCyclePeriod period, int length) + { + //PayPal expects date in PDT timezone (UTC -7) + var startDate = DateTime.UtcNow.AddHours(-7); + switch (period) + { + case RecurringProductCyclePeriod.Days: + startDate = startDate.AddDays(length); + break; + case RecurringProductCyclePeriod.Weeks: + startDate = startDate.AddDays(length * 7); + break; + case RecurringProductCyclePeriod.Months: + startDate = startDate.AddMonths(length); + break; + case RecurringProductCyclePeriod.Years: + startDate = startDate.AddYears(length); + break; + } + + return string.Format("{0}Z", startDate.ToString("s")); + } + + #region Items + + /// + /// Get PayPal items + /// + /// Shopping cart + /// Customer + /// Store identifier + /// Currency code + /// List of PayPal items + protected List GetItems(IList shoppingCart, Customer customer, int storeId, string currencyCode) + { + var items = new List(); + + if (!_paypalDirectPaymentSettings.PassPurchasedItems) + return items; + + //create PayPal items from shopping cart items + items.AddRange(CreateItems(shoppingCart)); + + //create PayPal items from checkout attributes + items.AddRange(CreateItemsForCheckoutAttributes(customer, storeId)); + + //create PayPal item for payment method additional fee + items.Add(CreateItemForPaymentAdditionalFee(shoppingCart, customer)); + + //currently there are no ways to add discount for all order directly to amount details, so we add them as extra items + //create PayPal item for subtotal discount + items.Add(CreateItemForSubtotalDiscount(shoppingCart)); + + //create PayPal item for total discount + items.Add(CreateItemForTotalDiscount(shoppingCart)); + + items.RemoveAll(item => item == null); + + //add currency code for all items + items.ForEach(item => item.currency = currencyCode); + + return items; + } + + /// + /// Create items from shopping cart + /// + /// Shopping cart + /// Collection of PayPal items + protected IEnumerable CreateItems(IEnumerable shoppingCart) + { + return shoppingCart.Select(shoppingCartItem => + { + if (shoppingCartItem.Product == null) + return null; + + var item = new Item(); + + //name + item.name = shoppingCartItem.Product.Name; + + //sku + if (!string.IsNullOrEmpty(shoppingCartItem.AttributesXml)) + { + var combination = _productAttributeParser.FindProductAttributeCombination(shoppingCartItem.Product, shoppingCartItem.AttributesXml); + item.sku = combination != null && !string.IsNullOrEmpty(combination.Sku) ? combination.Sku : shoppingCartItem.Product.Sku; + } + else + item.sku = shoppingCartItem.Product.Sku; + + //item price + decimal taxRate; + var unitPrice = _priceCalculationService.GetUnitPrice(shoppingCartItem); + var price = _taxService.GetProductPrice(shoppingCartItem.Product, unitPrice, false, shoppingCartItem.Customer, out taxRate); + item.price = price.ToString("N", new CultureInfo("en-US")); + + //quantity + item.quantity = shoppingCartItem.Quantity.ToString(); + + return item; + }); + } + + /// + /// Create items for checkout attributes + /// + /// Customer + /// Store identifier + /// Collection of PayPal items + protected IEnumerable CreateItemsForCheckoutAttributes(Customer customer, int storeId) + { + var checkoutAttributesXml = customer.GetAttribute(SystemCustomerAttributeNames.CheckoutAttributes, storeId); + if (string.IsNullOrEmpty(checkoutAttributesXml)) + return new List(); + + //get attribute values + var attributeValues = _checkoutAttributeParser.ParseCheckoutAttributeValues(checkoutAttributesXml); + + return attributeValues.Select(checkoutAttributeValue => + { + if (checkoutAttributeValue.CheckoutAttribute == null) + return null; + + //get price + var attributePrice = _taxService.GetCheckoutAttributePrice(checkoutAttributeValue, false, customer); + + //create item + return new Item + { + name = string.Format("{0} ({1})", checkoutAttributeValue.CheckoutAttribute.Name, checkoutAttributeValue.Name), + price = attributePrice.ToString("N", new CultureInfo("en-US")), + quantity = "1" + }; + }); + } + + /// + /// Create item for payment method additional fee + /// + /// Shopping cart + /// Customer + /// PayPal item + protected Item CreateItemForPaymentAdditionalFee(IList shoppingCart, Customer customer) + { + //get price + var paymentAdditionalFee = _paymentService.GetAdditionalHandlingFee(shoppingCart, PluginDescriptor.SystemName); + var paymentPrice = _taxService.GetPaymentMethodAdditionalFee(paymentAdditionalFee, false, customer); + + if (paymentPrice <= decimal.Zero) + return null; + + //create item + return new Item + { + name = string.Format("Payment method ({0}) additional fee", PluginDescriptor.FriendlyName), + price = paymentPrice.ToString("N", new CultureInfo("en-US")), + quantity = "1" + }; + } + + /// + /// Create item for discount to order subtotal + /// + /// Shopping cart + /// PayPal item + protected Item CreateItemForSubtotalDiscount(IList shoppingCart) + { + //get subtotal discount amount + decimal discountAmount; + List discounts; + decimal withoutDiscount; + decimal subtotal; + _orderTotalCalculationService.GetShoppingCartSubTotal(shoppingCart, false, out discountAmount, out discounts, out withoutDiscount, out subtotal); + + if (discountAmount <= decimal.Zero) + return null; + + //create item with negative price + return new Item + { + name = "Discount for the subtotal of order", + price = (-discountAmount).ToString("N", new CultureInfo("en-US")), + quantity = "1" + }; + } + + /// + /// Create item for discount to order total + /// + /// Shopping cart + /// PayPal item + protected Item CreateItemForTotalDiscount(IList shoppingCart) + { + //get total discount amount + decimal discountAmount; + List giftCards; + List discounts; + RewardPoints rewardPoints; + TaxSummary taxSummary; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + decimal earnedRewardPointsBaseAmount; + + var orderTotal = _orderTotalCalculationService.GetShoppingCartTotal(shoppingCart, out discountAmount, + out discounts, out subTotalAppliedDiscounts, out shippingAppliedDiscounts, out giftCards, out rewardPoints, out taxSummary, out earnedRewardPointsBaseAmount); + + if (discountAmount <= decimal.Zero) + return null; + + //create item with negative price + return new Item + { + name = "Discount for the total of order", + price = (-discountAmount).ToString("N", new CultureInfo("en-US")), + quantity = "1" + }; + } + + #endregion + + /// + /// Get transaction amount details + /// + /// Payment info required for an order processing + /// Shopping cart + /// List of PayPal items + /// Amount details object + protected Details GetAmountDetails(ProcessPaymentRequest paymentRequest, IList shoppingCart, IList items) + { + //get shipping total + var shipping = _orderTotalCalculationService.GetShoppingCartShippingTotal(shoppingCart, false); + var shippingTotal = shipping.HasValue ? shipping.Value : 0; + + //get tax total + TaxSummary taxSummary; + SortedDictionary taxRatesDictionary; + var taxTotal = _orderTotalCalculationService.GetTaxTotal(shoppingCart, out taxSummary); + taxRatesDictionary = taxSummary.GenerateOldTaxrateDict(); + + //get subtotal + var subTotal = decimal.Zero; + if (items != null && items.Any()) + { + //items passed to PayPal, so calculate subtotal based on them + var tmpPrice = decimal.Zero; + var tmpQuantity = 0; + subTotal = items.Sum(item => !decimal.TryParse(item.price, out tmpPrice) || !int.TryParse(item.quantity, out tmpQuantity) ? 0 : tmpPrice * tmpQuantity); + } + else + subTotal = paymentRequest.OrderTotal - shippingTotal - taxTotal; + + //adjust order total to avoid PayPal payment error: "Transaction amount details (subtotal, tax, shipping) must add up to specified amount total" + paymentRequest.OrderTotal = Math.Round(shippingTotal, 2) + Math.Round(subTotal, 2) + Math.Round(taxTotal, 2); + + //create amount details + return new Details + { + shipping = shippingTotal.ToString("N", new CultureInfo("en-US")), + subtotal = subTotal.ToString("N", new CultureInfo("en-US")), + tax = taxTotal.ToString("N", new CultureInfo("en-US")) + }; + } + + #endregion + + #region Methods + + /// + /// Process a payment + /// + /// Payment info required for an order processing + /// Process payment result + public ProcessPaymentResult ProcessPayment(ProcessPaymentRequest processPaymentRequest) + { + var result = new ProcessPaymentResult(); + + var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); + if (customer == null) + throw new Exception("Customer cannot be loaded"); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + + //currency + var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + + //get current shopping cart + var shoppingCart = customer.ShoppingCartItems + .Where(shoppingCartItem => shoppingCartItem.ShoppingCartType == ShoppingCartType.ShoppingCart) + .LimitPerStore(processPaymentRequest.StoreId).ToList(); + + //items + var items = GetItems(shoppingCart, customer, processPaymentRequest.StoreId, currency.CurrencyCode); + + //amount details + var amountDetails = GetAmountDetails(processPaymentRequest, shoppingCart, items); + + //payment + var payment = new Payment() + { + #region payer + + payer = new Payer() + { + payment_method = "credit_card", + + #region credit card info + + funding_instruments = new List + { + new FundingInstrument + { + credit_card = new CreditCard + { + type = processPaymentRequest.CreditCardType.ToLowerInvariant(), + number = processPaymentRequest.CreditCardNumber, + cvv2 = processPaymentRequest.CreditCardCvv2, + expire_month = processPaymentRequest.CreditCardExpireMonth, + expire_year = processPaymentRequest.CreditCardExpireYear + } + } + }, + + #endregion + + #region payer info + + payer_info = new PayerInfo + { + #region billing address + + billing_address = customer.BillingAddress == null ? null : new Address + { + country_code = customer.BillingAddress.Country != null ? customer.BillingAddress.Country.TwoLetterIsoCode : null, + state = customer.BillingAddress.StateProvince != null ? customer.BillingAddress.StateProvince.Abbreviation : null, + city = customer.BillingAddress.City, + line1 = customer.BillingAddress.Address1, + line2 = customer.BillingAddress.Address2, + phone = customer.BillingAddress.PhoneNumber, + postal_code = customer.BillingAddress.ZipPostalCode + }, + + #endregion + + email = customer.BillingAddress != null ? customer.BillingAddress.Email : null, + first_name = customer.BillingAddress != null ? customer.BillingAddress.FirstName : null, + last_name = customer.BillingAddress != null ? customer.BillingAddress.LastName : null + } + + #endregion + }, + + #endregion + + #region transaction + + transactions = new List() + { + new Transaction + { + #region amount + + amount = new Amount + { + details = amountDetails, + total = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")), + currency = currency != null ? currency.CurrencyCode : null + }, + + #endregion + + item_list = new ItemList + { + items = items, + + #region shipping address + + shipping_address = customer.ShippingAddress == null ? null : new ShippingAddress + { + country_code = customer.ShippingAddress.Country != null ? customer.ShippingAddress.Country.TwoLetterIsoCode : null, + state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null, + city = customer.ShippingAddress.City, + line1 = customer.ShippingAddress.Address1, + line2 = customer.ShippingAddress.Address2, + phone = customer.ShippingAddress.PhoneNumber, + postal_code = customer.ShippingAddress.ZipPostalCode, + recipient_name = string.Format("{0} {1}", customer.ShippingAddress.FirstName, customer.ShippingAddress.LastName) + } + + #endregion + }, + + invoice_number = processPaymentRequest.OrderGuid != Guid.Empty ? processPaymentRequest.OrderGuid.ToString() : null + } + }, + + #endregion + + intent = _paypalDirectPaymentSettings.TransactMode == TransactMode.Authorize ? "authorize" : "sale", + }.Create(apiContext); + + if (payment.transactions[0].related_resources.Any() && payment.transactions[0].related_resources[0] != null) + if (_paypalDirectPaymentSettings.TransactMode == TransactMode.Authorize) + { + var authorization = payment.transactions[0].related_resources[0].authorization; + if (authorization != null) + { + if (authorization.fmf_details != null && !string.IsNullOrEmpty(authorization.fmf_details.filter_id)) + { + result.AuthorizationTransactionResult = string.Format("Authorization is {0}. Based on fraud filter: {1}. {2}", + authorization.fmf_details.filter_type, authorization.fmf_details.name, authorization.fmf_details.description); + result.NewPaymentStatus = GetPaymentStatus(Authorization.Get(apiContext, authorization.id).state); + } + else + { + result.AuthorizationTransactionResult = authorization.state; + result.NewPaymentStatus = GetPaymentStatus(authorization.state); + } + result.AuthorizationTransactionId = authorization.id; + } + } + else + { + var sale = payment.transactions[0].related_resources[0].sale; + if (sale != null) + { + if (sale.fmf_details != null && !string.IsNullOrEmpty(sale.fmf_details.filter_id)) + { + result.CaptureTransactionResult = string.Format("Sale is {0}. Based on fraud filter: {1}. {2}", + sale.fmf_details.filter_type, sale.fmf_details.name, sale.fmf_details.description); + result.NewPaymentStatus = GetPaymentStatus(Sale.Get(apiContext, sale.id).state); + } + else + { + result.CaptureTransactionResult = sale.state; + result.NewPaymentStatus = GetPaymentStatus(sale.state); + } + result.CaptureTransactionId = sale.id; + result.AvsResult = sale.processor_response != null ? sale.processor_response.avs_code : string.Empty; + + } + } + else + result.AddError("PayPal error"); + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Post process payment (used by payment gateways that require redirecting to a third-party URL) + /// + /// Payment info required for an order processing + public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest) + { + } + + /// + /// Returns a value indicating whether payment method should be hidden during checkout + /// + /// Shoping cart + /// true - hide; false - display. + public bool HidePaymentMethod(IList cart) + { + //you can put any logic here + //for example, hide this payment method if all products in the cart are downloadable + //or hide this payment method if current customer is from certain country + return false; + } + + /// + /// Gets additional handling fee + /// + /// Shopping cart + /// Additional handling fee + public decimal GetAdditionalHandlingFee(IList cart) + { + var result = this.CalculateAdditionalFee(_orderTotalCalculationService, cart, + _paypalDirectPaymentSettings.AdditionalFee, _paypalDirectPaymentSettings.AdditionalFeePercentage); + + return result; + } + + /// + /// Captures payment + /// + /// Capture payment request + /// Capture payment result + public CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest) + { + var result = new CapturePaymentResult(); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + var authorization = Authorization.Get(apiContext, capturePaymentRequest.Order.AuthorizationTransactionId); + var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + var capture = new Capture + { + amount = new Amount + { + total = capturePaymentRequest.Order.OrderTotal.ToString("N", new CultureInfo("en-US")), + currency = currency != null ? currency.CurrencyCode : null + }, + is_final_capture = true + }; + capture = authorization.Capture(apiContext, capture); + + result.CaptureTransactionId = capture.id; + result.CaptureTransactionResult = capture.state; + result.NewPaymentStatus = GetPaymentStatus(capture.state); + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Refunds a payment + /// + /// Request + /// Result + public RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequest) + { + var result = new RefundPaymentResult(); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + var refundRequest = new RefundRequest + { + amount = new Amount + { + total = refundPaymentRequest.AmountToRefund.ToString("N", new CultureInfo("en-US")), + currency = currency != null ? currency.CurrencyCode : null + } + }; + PayPal.Api.Capture.Refund(apiContext, refundPaymentRequest.Order.CaptureTransactionId, refundRequest); + var capture = PayPal.Api.Capture.Get(apiContext, refundPaymentRequest.Order.CaptureTransactionId); + result.NewPaymentStatus = GetPaymentStatus(capture.state); + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Voids a payment + /// + /// Request + /// Result + public VoidPaymentResult Void(VoidPaymentRequest voidPaymentRequest) + { + var result = new VoidPaymentResult(); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + var authorization = Authorization.Get(apiContext, voidPaymentRequest.Order.AuthorizationTransactionId); + authorization = authorization.Void(apiContext); + + result.NewPaymentStatus = GetPaymentStatus(authorization.state); + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Process recurring payment + /// + /// Payment info required for an order processing + /// Process payment result + public ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) + { + var result = new ProcessPaymentResult(); + + var customer = _customerService.GetCustomerById(processPaymentRequest.CustomerId); + if (customer == null) + throw new Exception("Customer cannot be loaded"); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + var currency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + + //check that webhook exists + if (string.IsNullOrEmpty(_paypalDirectPaymentSettings.WebhookId)) + { + result.AddError("Recurring payments are not available until you create a webhook"); + return result; + } + + Webhook.Get(apiContext, _paypalDirectPaymentSettings.WebhookId); + + //create the plan + var url = _webHelper.GetStoreLocation(_storeContext.CurrentStore.SslEnabled); + var billingPlan = new Plan + { + name = processPaymentRequest.OrderGuid.ToString(), + description = string.Format("nopCommerce billing plan for the {0} order", processPaymentRequest.OrderGuid), + type = "fixed", + merchant_preferences = new MerchantPreferences + { + return_url = url, + cancel_url = url, + auto_bill_amount = "YES", + //setting setup fee as the first payment (workaround for the processing first payment immediately) + setup_fee = new PayPal.Api.Currency + { + currency = currency != null ? currency.CurrencyCode : null, + value = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")) + } + }, + payment_definitions = new List + { + new PaymentDefinition + { + name = "nopCommerce payment for the billing plan", + type = "REGULAR", + frequency_interval = processPaymentRequest.RecurringCycleLength.ToString(), + frequency = processPaymentRequest.RecurringCyclePeriod.ToString().TrimEnd('s'), + cycles = (processPaymentRequest.RecurringTotalCycles - 1).ToString(), + amount = new PayPal.Api.Currency + { + currency = currency != null ? currency.CurrencyCode : null, + value = processPaymentRequest.OrderTotal.ToString("N", new CultureInfo("en-US")) + } + } + } + }.Create(apiContext); + + //activate the plan + var patchRequest = new PatchRequest() + { + new Patch() + { + op = "replace", + path = "/", + value = new Plan + { + state = "ACTIVE" + } + } + }; + billingPlan.Update(apiContext, patchRequest); + + //create subscription + var subscription = new Agreement + { + name = string.Format("nopCommerce subscription for the {0} order", processPaymentRequest.OrderGuid), + //we set order guid in the description, then use it in the webhook handler + description = processPaymentRequest.OrderGuid.ToString(), + //setting start date as the next date of recurring payments as the setup fee was the first payment + start_date = GetStartDate(processPaymentRequest.RecurringCyclePeriod, processPaymentRequest.RecurringCycleLength), + + #region payer + + payer = new Payer() + { + payment_method = "credit_card", + + #region credit card info + + funding_instruments = new List + { + new FundingInstrument + { + credit_card = new CreditCard + { + type = processPaymentRequest.CreditCardType.ToLowerInvariant(), + number = processPaymentRequest.CreditCardNumber, + cvv2 = processPaymentRequest.CreditCardCvv2, + expire_month = processPaymentRequest.CreditCardExpireMonth, + expire_year = processPaymentRequest.CreditCardExpireYear + } + } + }, + + #endregion + + #region payer info + + payer_info = new PayerInfo + { + #region billing address + + billing_address = customer.BillingAddress == null ? null : new Address + { + country_code = customer.BillingAddress.Country != null ? customer.BillingAddress.Country.TwoLetterIsoCode : null, + state = customer.BillingAddress.StateProvince != null ? customer.BillingAddress.StateProvince.Abbreviation : null, + city = customer.BillingAddress.City, + line1 = customer.BillingAddress.Address1, + line2 = customer.BillingAddress.Address2, + phone = customer.BillingAddress.PhoneNumber, + postal_code = customer.BillingAddress.ZipPostalCode + }, + + #endregion + + email = customer.BillingAddress.Email, + first_name = customer.BillingAddress.FirstName, + last_name = customer.BillingAddress.LastName + } + + #endregion + }, + + #endregion + + #region shipping address + + shipping_address = customer.ShippingAddress == null ? null : new ShippingAddress + { + country_code = customer.ShippingAddress.Country != null ? customer.ShippingAddress.Country.TwoLetterIsoCode : null, + state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null, + city = customer.ShippingAddress.City, + line1 = customer.ShippingAddress.Address1, + line2 = customer.ShippingAddress.Address2, + phone = customer.ShippingAddress.PhoneNumber, + postal_code = customer.ShippingAddress.ZipPostalCode + }, + + #endregion + + plan = new Plan + { + id = billingPlan.id + } + }.Create(apiContext); + + //if first payment failed, try again + if (string.IsNullOrEmpty(subscription.agreement_details.last_payment_date)) + subscription.BillBalance(apiContext, new AgreementStateDescriptor { amount = subscription.agreement_details.outstanding_balance }); + + result.SubscriptionTransactionId = subscription.id; + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Cancels a recurring payment + /// + /// Request + /// Result + public CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurringPaymentRequest cancelPaymentRequest) + { + var result = new CancelRecurringPaymentResult(); + + try + { + var apiContext = PaypalHelper.GetApiContext(_paypalDirectPaymentSettings); + var subscription = Agreement.Get(apiContext, cancelPaymentRequest.Order.SubscriptionTransactionId); + var reason = new AgreementStateDescriptor + { + note = string.Format("Cancel subscription {0}", cancelPaymentRequest.Order.OrderGuid) + }; + subscription.Cancel(apiContext, reason); + } + catch (PayPal.PayPalException exc) + { + if (exc is PayPal.ConnectionException) + { + var error = JsonFormatter.ConvertFromJson((exc as PayPal.ConnectionException).Response); + if (error != null) + { + result.AddError(string.Format("PayPal error: {0} ({1})", error.message, error.name)); + if (error.details != null) + error.details.ForEach(x => result.AddError(string.Format("{0} {1}", x.field, x.issue))); + } + } + + //if there are not the specific errors add exception message + if (result.Success) + result.AddError(exc.InnerException != null ? exc.InnerException.Message : exc.Message); + } + + return result; + } + + /// + /// Gets a value indicating whether customers can complete a payment after order is placed but not completed (for redirection payment methods) + /// + /// Order + /// Result + public bool CanRePostProcessPayment(Core.Domain.Orders.Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + //it's not a redirection payment method. So we always return false + return false; + } + + /// + /// Gets a route for provider configuration + /// + /// Action name + /// Controller name + /// Route values + public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues) + { + actionName = "Configure"; + controllerName = "PaymentPayPalDirect"; + routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Payments.PayPalDirect.Controllers" }, { "area", null } }; + } + + /// + /// Gets a route for payment info + /// + /// Action name + /// Controller name + /// Route values + public void GetPaymentInfoRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues) + { + actionName = "PaymentInfo"; + controllerName = "PaymentPayPalDirect"; + routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Payments.PayPalDirect.Controllers" }, { "area", null } }; + } + + /// + /// Get type of controller + /// + /// Type + public Type GetControllerType() + { + return typeof(PaymentPayPalDirectController); + } + + /// + /// Install the plugin + /// + public override void Install() + { + //settings + var settings = new PayPalDirectPaymentSettings + { + TransactMode = TransactMode.Authorize, + UseSandbox = true, + }; + _settingService.SaveSetting(settings); + + //locales + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee", "Additional fee"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage", "Additional fee. Use percentage"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId", "Client ID"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId.Hint", "Specify client ID."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret", "Client secret"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret.Hint", "Specify secret key."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems", "Pass purchased items"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems.Hint", "Check to pass information about purchased items to PayPal."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode", "Transaction mode"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode.Hint", "Choose transaction mode."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox", "Use Sandbox"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment)."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId", "Webhook ID"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId.Hint", "Specify webhook ID."); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.Instructions", "

If you're using this gateway ensure that your primary store currency is supported by Paypal.

To configure plugin follow these steps:
1. Log into your Developer PayPal account (click here to create your account).
2. Click on My Apps & Credentials from the Dashboard.
3. Create new REST API app.
4. Copy your Client ID and Secret key below.
5. To be able to use recurring payments you need to set the webhook ID. You can get it manually in your PayPal account (enter the URL https://www.yourStore.com/Plugins/PaymentPayPalDirect/Webhook below REST API application credentials), or automatically by pressing \"@T(\"Plugins.Payments.PayPalDirect.WebhookCreate\")\" button (not visible when running the site locally).

"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription", "Pay by credit / debit card"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookCreate", "Get webhook ID"); + this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookError", "Webhook was not created (see details in the log)"); + + base.Install(); + } + + /// + /// Uninstall the plugin + /// + public override void Uninstall() + { + //delete webhook + var settings = _settingService.LoadSetting(); + if (!string.IsNullOrEmpty(settings.WebhookId)) + { + try + { + var apiContext = PaypalHelper.GetApiContext(settings); + Webhook.Delete(apiContext, settings.WebhookId); + } + catch (PayPal.PayPalException) { } + } + + //settings + _settingService.DeleteSetting(); + + //locales + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFee.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.AdditionalFeePercentage.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientId.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.ClientSecret.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.PassPurchasedItems.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.TransactMode.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.UseSandbox.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Fields.WebhookId.Hint"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.Instructions"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookCreate"); + this.DeletePluginLocaleResource("Plugins.Payments.PayPalDirect.WebhookError"); + + base.Uninstall(); + } + + #endregion + + #region Properties + + /// + /// Gets a value indicating whether capture is supported + /// + public bool SupportCapture + { + get { return true; } + } + + /// + /// Gets a value indicating whether partial refund is supported + /// + public bool SupportPartiallyRefund + { + get { return true; } + } + + /// + /// Gets a value indicating whether refund is supported + /// + public bool SupportRefund + { + get { return true; } + } + + /// + /// Gets a value indicating whether void is supported + /// + public bool SupportVoid + { + get { return true; } + } + + /// + /// Gets a recurring payment type of payment method + /// + public RecurringPaymentType RecurringPaymentType + { + get { return RecurringPaymentType.Automatic; } + } + + /// + /// Gets a payment method type + /// + public PaymentMethodType PaymentMethodType + { + get { return PaymentMethodType.Standard; } + } + + /// + /// Gets a value indicating whether we should display a payment information page for this plugin + /// + public bool SkipPaymentInfo + { + get { return false; } + } + + /// + /// Gets a payment method description that will be displayed on checkout pages in the public store + /// + public string PaymentMethodDescription + { + //return description of this payment method to be display on "payment method" checkout step. good practice is to make it localizable + //for example, for a redirection payment method, description may be like this: "You will be redirected to PayPal site to complete the payment" + get { return _localizationService.GetResource("Plugins.Payments.PayPalDirect.PaymentMethodDescription"); } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs b/src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs index 1f594580387..ca5518b8f25 100644 --- a/src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs +++ b/src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs @@ -1,264 +1,264 @@ -using System; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Web.Mvc; -using Nop.Core; -using Nop.Core.Domain.Orders; -using Nop.Plugin.Widgets.GoogleAnalytics.Models; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Configuration; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Orders; -using Nop.Services.Stores; -using Nop.Web.Framework.Controllers; - -namespace Nop.Plugin.Widgets.GoogleAnalytics.Controllers -{ - public class WidgetsGoogleAnalyticsController : BasePluginController - { - private const string ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME = "GoogleAnalytics.OrderAlreadyProcessed"; - private readonly IWorkContext _workContext; - private readonly IStoreContext _storeContext; - private readonly IStoreService _storeService; - private readonly ISettingService _settingService; - private readonly IOrderService _orderService; - private readonly ILogger _logger; - private readonly ICategoryService _categoryService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly ILocalizationService _localizationService; - private readonly IGenericAttributeService _genericAttributeService; - - public WidgetsGoogleAnalyticsController(IWorkContext workContext, - IStoreContext storeContext, - IStoreService storeService, - ISettingService settingService, - IOrderService orderService, - ILogger logger, - ICategoryService categoryService, - IProductAttributeParser productAttributeParser, - ILocalizationService localizationService, - IGenericAttributeService genericAttributeService) - { - this._workContext = workContext; - this._storeContext = storeContext; - this._storeService = storeService; - this._settingService = settingService; - this._orderService = orderService; - this._logger = logger; - this._categoryService = categoryService; - this._productAttributeParser = productAttributeParser; - this._localizationService = localizationService; - this._genericAttributeService = genericAttributeService; - } - - [AdminAuthorize] - [ChildActionOnly] - public ActionResult Configure() - { - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var googleAnalyticsSettings = _settingService.LoadSetting(storeScope); - var model = new ConfigurationModel(); - model.GoogleId = googleAnalyticsSettings.GoogleId; - model.TrackingScript = googleAnalyticsSettings.TrackingScript; - model.EcommerceScript = googleAnalyticsSettings.EcommerceScript; - model.EcommerceDetailScript = googleAnalyticsSettings.EcommerceDetailScript; - model.IncludingTax = googleAnalyticsSettings.IncludingTax; - model.ZoneId = googleAnalyticsSettings.WidgetZone; - model.AvailableZones.Add(new SelectListItem() { Text = "Before body end html tag", Value = "body_end_html_tag_before" }); - model.AvailableZones.Add(new SelectListItem() { Text = "Head html tag", Value = "head_html_tag" }); - - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.GoogleId_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.GoogleId, storeScope); - model.TrackingScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.TrackingScript, storeScope); - model.EcommerceScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.EcommerceScript, storeScope); - model.EcommerceDetailScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.EcommerceDetailScript, storeScope); - model.IncludingTax_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.IncludingTax, storeScope); - model.ZoneId_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.WidgetZone, storeScope); - } - - return View("~/Plugins/Widgets.GoogleAnalytics/Views/Configure.cshtml", model); - } - - [HttpPost] - [AdminAuthorize] - [ChildActionOnly] - public ActionResult Configure(ConfigurationModel model) - { - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var googleAnalyticsSettings = _settingService.LoadSetting(storeScope); - googleAnalyticsSettings.GoogleId = model.GoogleId; - googleAnalyticsSettings.TrackingScript = model.TrackingScript; - googleAnalyticsSettings.EcommerceScript = model.EcommerceScript; - googleAnalyticsSettings.EcommerceDetailScript = model.EcommerceDetailScript; - googleAnalyticsSettings.IncludingTax = model.IncludingTax; - googleAnalyticsSettings.WidgetZone = model.ZoneId; - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.GoogleId, model.GoogleId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.TrackingScript, model.TrackingScript_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.EcommerceScript, model.EcommerceScript_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.EcommerceDetailScript, model.EcommerceDetailScript_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.IncludingTax, model.IncludingTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.WidgetZone, model.ZoneId_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); - - return Configure(); - } - - [ChildActionOnly] - public ActionResult PublicInfo(string widgetZone, object additionalData = null) - { - string globalScript = ""; - var routeData = ((System.Web.UI.Page)this.HttpContext.CurrentHandler).RouteData; - - try - { - var controller = routeData.Values["controller"]; - var action = routeData.Values["action"]; - - if (controller == null || action == null) - return Content(""); - - //Special case, if we are in last step of checkout, we can use order total for conversion value - if (controller.ToString().Equals("checkout", StringComparison.InvariantCultureIgnoreCase) && - action.ToString().Equals("completed", StringComparison.InvariantCultureIgnoreCase)) - { - var lastOrder = GetLastOrder(); - globalScript += GetEcommerceScript(lastOrder); - } - else - { - globalScript += GetEcommerceScript(null); - } - } - catch (Exception ex) - { - _logger.InsertLog(Core.Domain.Logging.LogLevel.Error, "Error creating scripts for google ecommerce tracking", ex.ToString()); - } - return Content(globalScript); - } - - private Order GetLastOrder() - { - var order = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, - customerId: _workContext.CurrentCustomer.Id, pageSize: 1).FirstOrDefault(); - return order; - } - - // - private string GetEcommerceScript(Order order) - { - var googleAnalyticsSettings = _settingService.LoadSetting(_storeContext.CurrentStore.Id); - var analyticsTrackingScript = googleAnalyticsSettings.TrackingScript + "\n"; - analyticsTrackingScript = analyticsTrackingScript.Replace("{GOOGLEID}", googleAnalyticsSettings.GoogleId); - - //ensure that ecommerce tracking code is renderred only once (avoid duplicated data in Google Analytics) - if (order != null && !order.GetAttribute(ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME)) - { - var usCulture = new CultureInfo("en-US"); - - var analyticsEcommerceScript = googleAnalyticsSettings.EcommerceScript + "\n"; - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{GOOGLEID}", googleAnalyticsSettings.GoogleId); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{ORDERID}", order.Id.ToString()); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{SITE}", _storeContext.CurrentStore.Url.Replace("http://", "").Replace("/", "")); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{TOTAL}", order.OrderTotal.ToString("0.00", usCulture)); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{TAX}", order.OrderTax.ToString("0.00", usCulture)); - var orderShipping = googleAnalyticsSettings.IncludingTax ? order.OrderShippingInclTax : order.OrderShippingExclTax; - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{SHIP}", orderShipping.ToString("0.00", usCulture)); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{CITY}", order.BillingAddress == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.City)); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{STATEPROVINCE}", order.BillingAddress == null || order.BillingAddress.StateProvince == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.StateProvince.Name)); - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{COUNTRY}", order.BillingAddress == null || order.BillingAddress.Country == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.Country.Name)); - - var sb = new StringBuilder(); - foreach (var item in order.OrderItems) - { - string analyticsEcommerceDetailScript = googleAnalyticsSettings.EcommerceDetailScript; - //get category - string category = ""; - var defaultProductCategory = _categoryService.GetProductCategoriesByProductId(item.ProductId).FirstOrDefault(); - if (defaultProductCategory != null) - category = defaultProductCategory.Category.Name; - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{ORDERID}", item.OrderId.ToString()); - //The SKU code is a required parameter for every item that is added to the transaction - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{PRODUCTSKU}", FixIllegalJavaScriptChars(item.Product.FormatSku(item.AttributesXml, _productAttributeParser))); - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{PRODUCTNAME}", FixIllegalJavaScriptChars(item.Product.Name)); - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{CATEGORYNAME}", FixIllegalJavaScriptChars(category)); - var unitPrice = googleAnalyticsSettings.IncludingTax ? item.UnitPriceInclTax : item.UnitPriceExclTax; - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{UNITPRICE}", unitPrice.ToString("0.00", usCulture)); - analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{QUANTITY}", item.Quantity.ToString()); - sb.AppendLine(analyticsEcommerceDetailScript); - } - - analyticsEcommerceScript = analyticsEcommerceScript.Replace("{DETAILS}", sb.ToString()); - - analyticsTrackingScript = analyticsTrackingScript.Replace("{ECOMMERCE}", analyticsEcommerceScript); - - _genericAttributeService.SaveAttribute(order, ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME, true); - } - else - { - analyticsTrackingScript = analyticsTrackingScript.Replace("{ECOMMERCE}", ""); - } - - return analyticsTrackingScript; - } - - private string FixIllegalJavaScriptChars(string text) - { - if (String.IsNullOrEmpty(text)) - return text; - - //replace ' with \' (http://stackoverflow.com/questions/4292761/need-to-url-encode-labels-when-tracking-events-with-google-analytics) - text = text.Replace("'", "\\'"); - return text; - } - } +using System; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Web.Mvc; +using Nop.Core; +using Nop.Core.Domain.Orders; +using Nop.Plugin.Widgets.GoogleAnalytics.Models; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Configuration; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Orders; +using Nop.Services.Stores; +using Nop.Web.Framework.Controllers; + +namespace Nop.Plugin.Widgets.GoogleAnalytics.Controllers +{ + public class WidgetsGoogleAnalyticsController : BasePluginController + { + private const string ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME = "GoogleAnalytics.OrderAlreadyProcessed"; + private readonly IWorkContext _workContext; + private readonly IStoreContext _storeContext; + private readonly IStoreService _storeService; + private readonly ISettingService _settingService; + private readonly IOrderService _orderService; + private readonly ILogger _logger; + private readonly ICategoryService _categoryService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly ILocalizationService _localizationService; + private readonly IGenericAttributeService _genericAttributeService; + + public WidgetsGoogleAnalyticsController(IWorkContext workContext, + IStoreContext storeContext, + IStoreService storeService, + ISettingService settingService, + IOrderService orderService, + ILogger logger, + ICategoryService categoryService, + IProductAttributeParser productAttributeParser, + ILocalizationService localizationService, + IGenericAttributeService genericAttributeService) + { + this._workContext = workContext; + this._storeContext = storeContext; + this._storeService = storeService; + this._settingService = settingService; + this._orderService = orderService; + this._logger = logger; + this._categoryService = categoryService; + this._productAttributeParser = productAttributeParser; + this._localizationService = localizationService; + this._genericAttributeService = genericAttributeService; + } + + [AdminAuthorize] + [ChildActionOnly] + public ActionResult Configure() + { + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var googleAnalyticsSettings = _settingService.LoadSetting(storeScope); + var model = new ConfigurationModel(); + model.GoogleId = googleAnalyticsSettings.GoogleId; + model.TrackingScript = googleAnalyticsSettings.TrackingScript; + model.EcommerceScript = googleAnalyticsSettings.EcommerceScript; + model.EcommerceDetailScript = googleAnalyticsSettings.EcommerceDetailScript; + model.IncludingTax = googleAnalyticsSettings.IncludingTax; + model.ZoneId = googleAnalyticsSettings.WidgetZone; + model.AvailableZones.Add(new SelectListItem() { Text = "Before body end html tag", Value = "body_end_html_tag_before" }); + model.AvailableZones.Add(new SelectListItem() { Text = "Head html tag", Value = "head_html_tag" }); + + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.GoogleId_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.GoogleId, storeScope); + model.TrackingScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.TrackingScript, storeScope); + model.EcommerceScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.EcommerceScript, storeScope); + model.EcommerceDetailScript_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.EcommerceDetailScript, storeScope); + model.IncludingTax_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.IncludingTax, storeScope); + model.ZoneId_OverrideForStore = _settingService.SettingExists(googleAnalyticsSettings, x => x.WidgetZone, storeScope); + } + + return View("~/Plugins/Widgets.GoogleAnalytics/Views/Configure.cshtml", model); + } + + [HttpPost] + [AdminAuthorize] + [ChildActionOnly] + public ActionResult Configure(ConfigurationModel model) + { + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var googleAnalyticsSettings = _settingService.LoadSetting(storeScope); + googleAnalyticsSettings.GoogleId = model.GoogleId; + googleAnalyticsSettings.TrackingScript = model.TrackingScript; + googleAnalyticsSettings.EcommerceScript = model.EcommerceScript; + googleAnalyticsSettings.EcommerceDetailScript = model.EcommerceDetailScript; + googleAnalyticsSettings.IncludingTax = model.IncludingTax; + googleAnalyticsSettings.WidgetZone = model.ZoneId; + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.GoogleId, model.GoogleId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.TrackingScript, model.TrackingScript_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.EcommerceScript, model.EcommerceScript_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.EcommerceDetailScript, model.EcommerceDetailScript_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.IncludingTax, model.IncludingTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(googleAnalyticsSettings, x => x.WidgetZone, model.ZoneId_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); + + return Configure(); + } + + [ChildActionOnly] + public ActionResult PublicInfo(string widgetZone, object additionalData = null) + { + string globalScript = ""; + var routeData = ((System.Web.UI.Page)this.HttpContext.CurrentHandler).RouteData; + + try + { + var controller = routeData.Values["controller"]; + var action = routeData.Values["action"]; + + if (controller == null || action == null) + return Content(""); + + //Special case, if we are in last step of checkout, we can use order total for conversion value + if (controller.ToString().Equals("checkout", StringComparison.InvariantCultureIgnoreCase) && + action.ToString().Equals("completed", StringComparison.InvariantCultureIgnoreCase)) + { + var lastOrder = GetLastOrder(); + globalScript += GetEcommerceScript(lastOrder); + } + else + { + globalScript += GetEcommerceScript(null); + } + } + catch (Exception ex) + { + _logger.InsertLog(Core.Domain.Logging.LogLevel.Error, "Error creating scripts for google ecommerce tracking", ex.ToString()); + } + return Content(globalScript); + } + + private Order GetLastOrder() + { + var order = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, + customerId: _workContext.CurrentCustomer.Id, pageSize: 1).FirstOrDefault(); + return order; + } + + // + private string GetEcommerceScript(Order order) + { + var googleAnalyticsSettings = _settingService.LoadSetting(_storeContext.CurrentStore.Id); + var analyticsTrackingScript = googleAnalyticsSettings.TrackingScript + "\n"; + analyticsTrackingScript = analyticsTrackingScript.Replace("{GOOGLEID}", googleAnalyticsSettings.GoogleId); + + //ensure that ecommerce tracking code is renderred only once (avoid duplicated data in Google Analytics) + if (order != null && !order.GetAttribute(ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME)) + { + var usCulture = new CultureInfo("en-US"); + + var analyticsEcommerceScript = googleAnalyticsSettings.EcommerceScript + "\n"; + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{GOOGLEID}", googleAnalyticsSettings.GoogleId); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{ORDERID}", order.Id.ToString()); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{SITE}", _storeContext.CurrentStore.Url.Replace("http://", "").Replace("/", "")); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{TOTAL}", order.OrderTotal.ToString("0.00", usCulture)); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{TAX}", order.OrderTax.ToString("0.00", usCulture)); + var orderShipping = (googleAnalyticsSettings.IncludingTax ? order.OrderShippingInclTax : order.OrderShippingExclTax) + order.OrderShippingNonTaxable; + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{SHIP}", orderShipping.ToString("0.00", usCulture)); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{CITY}", order.BillingAddress == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.City)); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{STATEPROVINCE}", order.BillingAddress == null || order.BillingAddress.StateProvince == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.StateProvince.Name)); + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{COUNTRY}", order.BillingAddress == null || order.BillingAddress.Country == null ? "" : FixIllegalJavaScriptChars(order.BillingAddress.Country.Name)); + + var sb = new StringBuilder(); + foreach (var item in order.OrderItems) + { + string analyticsEcommerceDetailScript = googleAnalyticsSettings.EcommerceDetailScript; + //get category + string category = ""; + var defaultProductCategory = _categoryService.GetProductCategoriesByProductId(item.ProductId).FirstOrDefault(); + if (defaultProductCategory != null) + category = defaultProductCategory.Category.Name; + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{ORDERID}", item.OrderId.ToString()); + //The SKU code is a required parameter for every item that is added to the transaction + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{PRODUCTSKU}", FixIllegalJavaScriptChars(item.Product.FormatSku(item.AttributesXml, _productAttributeParser))); + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{PRODUCTNAME}", FixIllegalJavaScriptChars(item.Product.Name)); + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{CATEGORYNAME}", FixIllegalJavaScriptChars(category)); + var unitPrice = googleAnalyticsSettings.IncludingTax ? item.UnitPriceInclTax : item.UnitPriceExclTax; + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{UNITPRICE}", unitPrice.ToString("0.00", usCulture)); + analyticsEcommerceDetailScript = analyticsEcommerceDetailScript.Replace("{QUANTITY}", item.Quantity.ToString()); + sb.AppendLine(analyticsEcommerceDetailScript); + } + + analyticsEcommerceScript = analyticsEcommerceScript.Replace("{DETAILS}", sb.ToString()); + + analyticsTrackingScript = analyticsTrackingScript.Replace("{ECOMMERCE}", analyticsEcommerceScript); + + _genericAttributeService.SaveAttribute(order, ORDER_ALREADY_PROCESSED_ATTRIBUTE_NAME, true); + } + else + { + analyticsTrackingScript = analyticsTrackingScript.Replace("{ECOMMERCE}", ""); + } + + return analyticsTrackingScript; + } + + private string FixIllegalJavaScriptChars(string text) + { + if (String.IsNullOrEmpty(text)) + return text; + + //replace ' with \' (http://stackoverflow.com/questions/4292761/need-to-url-encode-labels-when-tracking-events-with-google-analytics) + text = text.Replace("'", "\\'"); + return text; + } + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Controllers/AffiliateController.cs b/src/Presentation/Nop.Web/Administration/Controllers/AffiliateController.cs index 8d5726c3ca8..b4077003dff 100644 --- a/src/Presentation/Nop.Web/Administration/Controllers/AffiliateController.cs +++ b/src/Presentation/Nop.Web/Administration/Controllers/AffiliateController.cs @@ -1,418 +1,420 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using Nop.Admin.Extensions; -using Nop.Admin.Models.Affiliates; -using Nop.Core; -using Nop.Core.Domain.Affiliates; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Services; -using Nop.Services.Affiliates; -using Nop.Services.Catalog; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Orders; -using Nop.Services.Security; -using Nop.Web.Framework.Controllers; -using Nop.Web.Framework.Kendoui; - -namespace Nop.Admin.Controllers -{ - public partial class AffiliateController : BaseAdminController - { - #region Fields - - private readonly ILocalizationService _localizationService; - private readonly IWorkContext _workContext; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly IWebHelper _webHelper; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly IPriceFormatter _priceFormatter; - private readonly IAffiliateService _affiliateService; - private readonly ICustomerService _customerService; - private readonly IOrderService _orderService; - private readonly IPermissionService _permissionService; - private readonly ICustomerActivityService _customerActivityService; - - #endregion - - #region Constructors - - public AffiliateController(ILocalizationService localizationService, - IWorkContext workContext, IDateTimeHelper dateTimeHelper, IWebHelper webHelper, - ICountryService countryService, IStateProvinceService stateProvinceService, - IPriceFormatter priceFormatter, IAffiliateService affiliateService, - ICustomerService customerService, IOrderService orderService, - IPermissionService permissionService, - ICustomerActivityService customerActivityService) - { - this._localizationService = localizationService; - this._workContext = workContext; - this._dateTimeHelper = dateTimeHelper; - this._webHelper = webHelper; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._priceFormatter = priceFormatter; - this._affiliateService = affiliateService; - this._customerService = customerService; - this._orderService = orderService; - this._permissionService = permissionService; - this._customerActivityService = customerActivityService; - } - - #endregion - - #region Utilities - - [NonAction] - protected virtual void PrepareAffiliateModel(AffiliateModel model, Affiliate affiliate, bool excludeProperties, - bool prepareEntireAddressModel = true) - { - if (model == null) - throw new ArgumentNullException("model"); - - if (affiliate != null) - { - model.Id = affiliate.Id; - model.Url = affiliate.GenerateUrl(_webHelper); - if (!excludeProperties) - { - model.AdminComment = affiliate.AdminComment; - model.FriendlyUrlName = affiliate.FriendlyUrlName; - model.Active = affiliate.Active; - model.Address = affiliate.Address.ToModel(); - } - } - - if (prepareEntireAddressModel) - { - model.Address.FirstNameEnabled = true; - model.Address.FirstNameRequired = true; - model.Address.LastNameEnabled = true; - model.Address.LastNameRequired = true; - model.Address.EmailEnabled = true; - model.Address.EmailRequired = true; - model.Address.CompanyEnabled = true; - model.Address.CountryEnabled = true; - model.Address.CountryRequired = true; - model.Address.StateProvinceEnabled = true; - model.Address.CityEnabled = true; - model.Address.CityRequired = true; - model.Address.StreetAddressEnabled = true; - model.Address.StreetAddressRequired = true; - model.Address.StreetAddress2Enabled = true; - model.Address.ZipPostalCodeEnabled = true; - model.Address.ZipPostalCodeRequired = true; - model.Address.PhoneEnabled = true; - model.Address.PhoneRequired = true; - model.Address.FaxEnabled = true; - - //address - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (affiliate != null && c.Id == affiliate.Address.CountryId) }); - - var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (affiliate != null && s.Id == affiliate.Address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - } - } - - #endregion - - #region Methods - - //list - public virtual ActionResult Index() - { - return RedirectToAction("List"); - } - - public virtual ActionResult List() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - var model = new AffiliateListModel(); - return View(model); - } - - [HttpPost] - public virtual ActionResult List(DataSourceRequest command, AffiliateListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedKendoGridJson(); - - var affiliates = _affiliateService.GetAllAffiliates(model.SearchFriendlyUrlName, - model.SearchFirstName, model.SearchLastName, - model.LoadOnlyWithOrders, model.OrdersCreatedFromUtc, model.OrdersCreatedToUtc, - command.Page - 1, command.PageSize, true); - - var gridModel = new DataSourceResult - { - Data = affiliates.Select(x => - { - var m = new AffiliateModel(); - PrepareAffiliateModel(m, x, false, false); - return m; - }), - Total = affiliates.TotalCount, - }; - return Json(gridModel); - } - - //create - public virtual ActionResult Create() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - var model = new AffiliateModel(); - PrepareAffiliateModel(model, null, false); - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - [FormValueRequired("save", "save-continue")] - public virtual ActionResult Create(AffiliateModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var affiliate = new Affiliate(); - - affiliate.Active = model.Active; - affiliate.AdminComment = model.AdminComment; - //validate friendly URL name - var friendlyUrlName = affiliate.ValidateFriendlyUrlName(model.FriendlyUrlName); - affiliate.FriendlyUrlName = friendlyUrlName; - affiliate.Address = model.Address.ToEntity(); - affiliate.Address.CreatedOnUtc = DateTime.UtcNow; - //some validation - if (affiliate.Address.CountryId == 0) - affiliate.Address.CountryId = null; - if (affiliate.Address.StateProvinceId == 0) - affiliate.Address.StateProvinceId = null; - _affiliateService.InsertAffiliate(affiliate); - - //activity log - _customerActivityService.InsertActivity("AddNewAffiliate", _localizationService.GetResource("ActivityLog.AddNewAffiliate"), affiliate.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Added")); - return continueEditing ? RedirectToAction("Edit", new { id = affiliate.Id }) : RedirectToAction("List"); - } - - //If we got this far, something failed, redisplay form - PrepareAffiliateModel(model, null, true); - return View(model); - - } - - - //edit - public virtual ActionResult Edit(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - var affiliate = _affiliateService.GetAffiliateById(id); - if (affiliate == null || affiliate.Deleted) - //No affiliate found with the specified id - return RedirectToAction("List"); - - var model = new AffiliateModel(); - PrepareAffiliateModel(model, affiliate, false); - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult Edit(AffiliateModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - var affiliate = _affiliateService.GetAffiliateById(model.Id); - if (affiliate == null || affiliate.Deleted) - //No affiliate found with the specified id - return RedirectToAction("List"); - - if (ModelState.IsValid) - { - affiliate.Active = model.Active; - affiliate.AdminComment = model.AdminComment; - //validate friendly URL name - var friendlyUrlName = affiliate.ValidateFriendlyUrlName(model.FriendlyUrlName); - affiliate.FriendlyUrlName = friendlyUrlName; - affiliate.Address = model.Address.ToEntity(affiliate.Address); - //some validation - if (affiliate.Address.CountryId == 0) - affiliate.Address.CountryId = null; - if (affiliate.Address.StateProvinceId == 0) - affiliate.Address.StateProvinceId = null; - _affiliateService.UpdateAffiliate(affiliate); - - //activity log - _customerActivityService.InsertActivity("EditAffiliate", _localizationService.GetResource("ActivityLog.EditAffiliate"), affiliate.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Updated")); - if (continueEditing) - { - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("Edit", new {id = affiliate.Id}); - } - return RedirectToAction("List"); - } - - //If we got this far, something failed, redisplay form - PrepareAffiliateModel(model, affiliate, true); - return View(model); - } - - //delete - [HttpPost] - public virtual ActionResult Delete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedView(); - - var affiliate = _affiliateService.GetAffiliateById(id); - if (affiliate == null) - //No affiliate found with the specified id - return RedirectToAction("List"); - - _affiliateService.DeleteAffiliate(affiliate); - - //activity log - _customerActivityService.InsertActivity("DeleteAffiliate", _localizationService.GetResource("ActivityLog.DeleteAffiliate"), affiliate.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Deleted")); - return RedirectToAction("List"); - } - - [ChildActionOnly] - public virtual ActionResult AffiliatedOrderList(int affiliateId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return Content(""); - - if (affiliateId == 0) - throw new Exception("Affliate ID cannot be 0"); - - var model = new AffiliatedOrderListModel(); - model.AffliateId = affiliateId; - - //order statuses - model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //payment statuses - model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //shipping statuses - model.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); - model.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - return PartialView(model); - } - [HttpPost] - public virtual ActionResult AffiliatedOrderListGrid(DataSourceRequest command, AffiliatedOrderListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedKendoGridJson(); - - var affiliate = _affiliateService.GetAffiliateById(model.AffliateId); - if (affiliate == null) - throw new ArgumentException("No affiliate found with the specified id"); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - var orderStatusIds = model.OrderStatusId > 0 ? new List() { model.OrderStatusId } : null; - var paymentStatusIds = model.PaymentStatusId > 0 ? new List() { model.PaymentStatusId } : null; - var shippingStatusIds = model.ShippingStatusId > 0 ? new List() { model.ShippingStatusId } : null; - - var orders = _orderService.SearchOrders( - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - affiliateId: affiliate.Id, - pageIndex: command.Page - 1, - pageSize: command.PageSize); - var gridModel = new DataSourceResult - { - Data = orders.Select(order => - { - var orderModel = new AffiliateModel.AffiliatedOrderModel(); - orderModel.Id = order.Id; - orderModel.OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext); - orderModel.OrderStatusId = order.OrderStatusId; - orderModel.PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext); - orderModel.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext); - orderModel.OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false); - orderModel.CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc); - orderModel.CustomOrderNumber = order.CustomOrderNumber; - - return orderModel; - }), - Total = orders.TotalCount - }; - - return Json(gridModel); - } - - - [HttpPost] - public virtual ActionResult AffiliatedCustomerList(int affiliateId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) - return AccessDeniedKendoGridJson(); - - var affiliate = _affiliateService.GetAffiliateById(affiliateId); - if (affiliate == null) - throw new ArgumentException("No affiliate found with the specified id"); - - var customers = _customerService.GetAllCustomers( - affiliateId: affiliate.Id, - pageIndex: command.Page - 1, - pageSize: command.PageSize); - var gridModel = new DataSourceResult - { - Data = customers.Select(customer => - { - var customerModel = new AffiliateModel.AffiliatedCustomerModel(); - customerModel.Id = customer.Id; - customerModel.Name = customer.Email; - return customerModel; - }), - Total = customers.TotalCount - }; - - return Json(gridModel); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using Nop.Admin.Extensions; +using Nop.Admin.Models.Affiliates; +using Nop.Core; +using Nop.Core.Domain.Affiliates; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Services; +using Nop.Services.Affiliates; +using Nop.Services.Catalog; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Orders; +using Nop.Services.Security; +using Nop.Web.Framework.Controllers; +using Nop.Web.Framework.Kendoui; + +namespace Nop.Admin.Controllers +{ + public partial class AffiliateController : BaseAdminController + { + #region Fields + + private readonly ILocalizationService _localizationService; + private readonly IWorkContext _workContext; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IWebHelper _webHelper; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly IPriceFormatter _priceFormatter; + private readonly IAffiliateService _affiliateService; + private readonly ICustomerService _customerService; + private readonly IOrderService _orderService; + private readonly IPermissionService _permissionService; + private readonly ICustomerActivityService _customerActivityService; + + #endregion + + #region Constructors + + public AffiliateController(ILocalizationService localizationService, + IWorkContext workContext, IDateTimeHelper dateTimeHelper, IWebHelper webHelper, + ICountryService countryService, IStateProvinceService stateProvinceService, + IPriceFormatter priceFormatter, IAffiliateService affiliateService, + ICustomerService customerService, IOrderService orderService, + IPermissionService permissionService, + ICustomerActivityService customerActivityService) + { + this._localizationService = localizationService; + this._workContext = workContext; + this._dateTimeHelper = dateTimeHelper; + this._webHelper = webHelper; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._priceFormatter = priceFormatter; + this._affiliateService = affiliateService; + this._customerService = customerService; + this._orderService = orderService; + this._permissionService = permissionService; + this._customerActivityService = customerActivityService; + } + + #endregion + + #region Utilities + + [NonAction] + protected virtual void PrepareAffiliateModel(AffiliateModel model, Affiliate affiliate, bool excludeProperties, + bool prepareEntireAddressModel = true) + { + if (model == null) + throw new ArgumentNullException("model"); + + if (affiliate != null) + { + model.Id = affiliate.Id; + model.Url = affiliate.GenerateUrl(_webHelper); + if (!excludeProperties) + { + model.AdminComment = affiliate.AdminComment; + model.FriendlyUrlName = affiliate.FriendlyUrlName; + model.Active = affiliate.Active; + model.Address = affiliate.Address.ToModel(); + } + } + + if (prepareEntireAddressModel) + { + model.Address.FirstNameEnabled = true; + model.Address.FirstNameRequired = true; + model.Address.LastNameEnabled = true; + model.Address.LastNameRequired = true; + model.Address.EmailEnabled = true; + model.Address.EmailRequired = true; + model.Address.CompanyEnabled = true; + model.Address.CountryEnabled = true; + model.Address.CountryRequired = true; + model.Address.StateProvinceEnabled = true; + model.Address.StateProvinceRequired = true; + model.Address.CityEnabled = true; + model.Address.CityRequired = true; + model.Address.StreetAddressEnabled = true; + model.Address.StreetAddressRequired = true; + model.Address.StreetAddress2Enabled = true; + model.Address.ZipPostalCodeEnabled = true; + model.Address.ZipPostalCodeRequired = true; + model.Address.PhoneEnabled = true; + model.Address.PhoneRequired = true; + model.Address.FaxEnabled = true; + + //address + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (affiliate != null && c.Id == affiliate.Address.CountryId) }); + + var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (affiliate != null && s.Id == affiliate.Address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + } + } + + #endregion + + #region Methods + + //list + public virtual ActionResult Index() + { + return RedirectToAction("List"); + } + + public virtual ActionResult List() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + var model = new AffiliateListModel(); + return View(model); + } + + [HttpPost] + public virtual ActionResult List(DataSourceRequest command, AffiliateListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedKendoGridJson(); + + var affiliates = _affiliateService.GetAllAffiliates(model.SearchFriendlyUrlName, + model.SearchFirstName, model.SearchLastName, + model.LoadOnlyWithOrders, model.OrdersCreatedFromUtc, model.OrdersCreatedToUtc, + command.Page - 1, command.PageSize, true); + + var gridModel = new DataSourceResult + { + Data = affiliates.Select(x => + { + var m = new AffiliateModel(); + PrepareAffiliateModel(m, x, false, false); + return m; + }), + Total = affiliates.TotalCount, + }; + return Json(gridModel); + } + + //create + public virtual ActionResult Create() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + var model = new AffiliateModel(); + PrepareAffiliateModel(model, null, false); + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + [FormValueRequired("save", "save-continue")] + public virtual ActionResult Create(AffiliateModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var affiliate = new Affiliate(); + + affiliate.Active = model.Active; + affiliate.AdminComment = model.AdminComment; + //validate friendly URL name + var friendlyUrlName = affiliate.ValidateFriendlyUrlName(model.FriendlyUrlName); + affiliate.FriendlyUrlName = friendlyUrlName; + affiliate.Address = model.Address.ToEntity(); + affiliate.Address.CreatedOnUtc = DateTime.UtcNow; + //some validation + if (affiliate.Address.CountryId == 0) + affiliate.Address.CountryId = null; + if (affiliate.Address.StateProvinceId == 0) + affiliate.Address.StateProvinceId = null; + _affiliateService.InsertAffiliate(affiliate); + + //activity log + _customerActivityService.InsertActivity("AddNewAffiliate", _localizationService.GetResource("ActivityLog.AddNewAffiliate"), affiliate.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Added")); + return continueEditing ? RedirectToAction("Edit", new { id = affiliate.Id }) : RedirectToAction("List"); + } + + //If we got this far, something failed, redisplay form + PrepareAffiliateModel(model, null, true); + return View(model); + + } + + + //edit + public virtual ActionResult Edit(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + var affiliate = _affiliateService.GetAffiliateById(id); + if (affiliate == null || affiliate.Deleted) + //No affiliate found with the specified id + return RedirectToAction("List"); + + var model = new AffiliateModel(); + PrepareAffiliateModel(model, affiliate, false); + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult Edit(AffiliateModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + var affiliate = _affiliateService.GetAffiliateById(model.Id); + if (affiliate == null || affiliate.Deleted) + //No affiliate found with the specified id + return RedirectToAction("List"); + + if (ModelState.IsValid) + { + affiliate.Active = model.Active; + affiliate.AdminComment = model.AdminComment; + //validate friendly URL name + var friendlyUrlName = affiliate.ValidateFriendlyUrlName(model.FriendlyUrlName); + affiliate.FriendlyUrlName = friendlyUrlName; + affiliate.Address = model.Address.ToEntity(affiliate.Address); + //some validation + if (affiliate.Address.CountryId == 0) + affiliate.Address.CountryId = null; + if (affiliate.Address.StateProvinceId == 0) + affiliate.Address.StateProvinceId = null; + _affiliateService.UpdateAffiliate(affiliate); + + //activity log + _customerActivityService.InsertActivity("EditAffiliate", _localizationService.GetResource("ActivityLog.EditAffiliate"), affiliate.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Updated")); + if (continueEditing) + { + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("Edit", new {id = affiliate.Id}); + } + return RedirectToAction("List"); + } + + //If we got this far, something failed, redisplay form + PrepareAffiliateModel(model, affiliate, true); + return View(model); + } + + //delete + [HttpPost] + public virtual ActionResult Delete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedView(); + + var affiliate = _affiliateService.GetAffiliateById(id); + if (affiliate == null) + //No affiliate found with the specified id + return RedirectToAction("List"); + + _affiliateService.DeleteAffiliate(affiliate); + + //activity log + _customerActivityService.InsertActivity("DeleteAffiliate", _localizationService.GetResource("ActivityLog.DeleteAffiliate"), affiliate.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Deleted")); + return RedirectToAction("List"); + } + + [ChildActionOnly] + public virtual ActionResult AffiliatedOrderList(int affiliateId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return Content(""); + + if (affiliateId == 0) + throw new Exception("Affliate ID cannot be 0"); + + var model = new AffiliatedOrderListModel(); + model.AffliateId = affiliateId; + + //order statuses + model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //payment statuses + model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //shipping statuses + model.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); + model.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + return PartialView(model); + } + [HttpPost] + public virtual ActionResult AffiliatedOrderListGrid(DataSourceRequest command, AffiliatedOrderListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedKendoGridJson(); + + var affiliate = _affiliateService.GetAffiliateById(model.AffliateId); + if (affiliate == null) + throw new ArgumentException("No affiliate found with the specified id"); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + var orderStatusIds = model.OrderStatusId > 0 ? new List() { model.OrderStatusId } : null; + var paymentStatusIds = model.PaymentStatusId > 0 ? new List() { model.PaymentStatusId } : null; + var shippingStatusIds = model.ShippingStatusId > 0 ? new List() { model.ShippingStatusId } : null; + + var orders = _orderService.SearchOrders( + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + affiliateId: affiliate.Id, + pageIndex: command.Page - 1, + pageSize: command.PageSize); + var gridModel = new DataSourceResult + { + Data = orders.Select(order => + { + var orderModel = new AffiliateModel.AffiliatedOrderModel(); + orderModel.Id = order.Id; + orderModel.OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext); + orderModel.OrderStatusId = order.OrderStatusId; + orderModel.PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext); + orderModel.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext); + orderModel.OrderTotalAmountIncl = _priceFormatter.FormatPrice(order.OrderTotalAmountIncl, true, false); + orderModel.OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false); + orderModel.CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc); + orderModel.CustomOrderNumber = order.CustomOrderNumber; + + return orderModel; + }), + Total = orders.TotalCount + }; + + return Json(gridModel); + } + + + [HttpPost] + public virtual ActionResult AffiliatedCustomerList(int affiliateId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates)) + return AccessDeniedKendoGridJson(); + + var affiliate = _affiliateService.GetAffiliateById(affiliateId); + if (affiliate == null) + throw new ArgumentException("No affiliate found with the specified id"); + + var customers = _customerService.GetAllCustomers( + affiliateId: affiliate.Id, + pageIndex: command.Page - 1, + pageSize: command.PageSize); + var gridModel = new DataSourceResult + { + Data = customers.Select(customer => + { + var customerModel = new AffiliateModel.AffiliatedCustomerModel(); + customerModel.Id = customer.Id; + customerModel.Name = customer.Email; + return customerModel; + }), + Total = customers.TotalCount + }; + + return Json(gridModel); + } + + #endregion + } +} diff --git a/src/Presentation/Nop.Web/Administration/Controllers/CustomerController.cs b/src/Presentation/Nop.Web/Administration/Controllers/CustomerController.cs index ff96579f9f9..025eb4e14a3 100644 --- a/src/Presentation/Nop.Web/Administration/Controllers/CustomerController.cs +++ b/src/Presentation/Nop.Web/Administration/Controllers/CustomerController.cs @@ -1,2396 +1,2435 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Web.Mvc; -using Nop.Admin.Extensions; -using Nop.Admin.Helpers; -using Nop.Admin.Models.Common; -using Nop.Admin.Models.Customers; -using Nop.Admin.Models.ShoppingCart; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Forums; -using Nop.Core.Domain.Messages; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Services; -using Nop.Services.Affiliates; -using Nop.Services.Authentication.External; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.ExportImport; -using Nop.Services.Forums; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Messages; -using Nop.Services.Orders; -using Nop.Services.Security; -using Nop.Services.Stores; -using Nop.Services.Tax; -using Nop.Services.Vendors; -using Nop.Web.Framework; -using Nop.Web.Framework.Controllers; -using Nop.Web.Framework.Kendoui; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Controllers -{ - public partial class CustomerController : BaseAdminController - { - #region Fields - - private readonly ICustomerService _customerService; - private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService; - private readonly IGenericAttributeService _genericAttributeService; - private readonly ICustomerRegistrationService _customerRegistrationService; - private readonly ICustomerReportService _customerReportService; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly ILocalizationService _localizationService; - private readonly DateTimeSettings _dateTimeSettings; - private readonly TaxSettings _taxSettings; - private readonly RewardPointsSettings _rewardPointsSettings; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly IAddressService _addressService; - private readonly CustomerSettings _customerSettings; - private readonly ITaxService _taxService; - private readonly IWorkContext _workContext; - private readonly IVendorService _vendorService; - private readonly IStoreContext _storeContext; - private readonly IPriceFormatter _priceFormatter; - private readonly IOrderService _orderService; - private readonly IExportManager _exportManager; - private readonly ICustomerActivityService _customerActivityService; - private readonly IBackInStockSubscriptionService _backInStockSubscriptionService; - private readonly IPriceCalculationService _priceCalculationService; - private readonly IProductAttributeFormatter _productAttributeFormatter; - private readonly IPermissionService _permissionService; - private readonly IQueuedEmailService _queuedEmailService; - private readonly EmailAccountSettings _emailAccountSettings; - private readonly IEmailAccountService _emailAccountService; - private readonly ForumSettings _forumSettings; - private readonly IForumService _forumService; - private readonly IOpenAuthenticationService _openAuthenticationService; - private readonly AddressSettings _addressSettings; - private readonly IStoreService _storeService; - private readonly ICustomerAttributeParser _customerAttributeParser; - private readonly ICustomerAttributeService _customerAttributeService; - private readonly IAddressAttributeParser _addressAttributeParser; - private readonly IAddressAttributeService _addressAttributeService; - private readonly IAddressAttributeFormatter _addressAttributeFormatter; - private readonly IAffiliateService _affiliateService; - private readonly IWorkflowMessageService _workflowMessageService; - private readonly IRewardPointService _rewardPointService; - private readonly ICacheManager _cacheManager; - - #endregion - - #region Constructors - - public CustomerController(ICustomerService customerService, - INewsLetterSubscriptionService newsLetterSubscriptionService, - IGenericAttributeService genericAttributeService, - ICustomerRegistrationService customerRegistrationService, - ICustomerReportService customerReportService, - IDateTimeHelper dateTimeHelper, - ILocalizationService localizationService, - DateTimeSettings dateTimeSettings, - TaxSettings taxSettings, - RewardPointsSettings rewardPointsSettings, - ICountryService countryService, - IStateProvinceService stateProvinceService, - IAddressService addressService, - CustomerSettings customerSettings, - ITaxService taxService, - IWorkContext workContext, - IVendorService vendorService, - IStoreContext storeContext, - IPriceFormatter priceFormatter, - IOrderService orderService, - IExportManager exportManager, - ICustomerActivityService customerActivityService, - IBackInStockSubscriptionService backInStockSubscriptionService, - IPriceCalculationService priceCalculationService, - IProductAttributeFormatter productAttributeFormatter, - IPermissionService permissionService, - IQueuedEmailService queuedEmailService, - EmailAccountSettings emailAccountSettings, - IEmailAccountService emailAccountService, - ForumSettings forumSettings, - IForumService forumService, - IOpenAuthenticationService openAuthenticationService, - AddressSettings addressSettings, - IStoreService storeService, - ICustomerAttributeParser customerAttributeParser, - ICustomerAttributeService customerAttributeService, - IAddressAttributeParser addressAttributeParser, - IAddressAttributeService addressAttributeService, - IAddressAttributeFormatter addressAttributeFormatter, - IAffiliateService affiliateService, - IWorkflowMessageService workflowMessageService, - IRewardPointService rewardPointService, - ICacheManager cacheManager) - { - this._customerService = customerService; - this._newsLetterSubscriptionService = newsLetterSubscriptionService; - this._genericAttributeService = genericAttributeService; - this._customerRegistrationService = customerRegistrationService; - this._customerReportService = customerReportService; - this._dateTimeHelper = dateTimeHelper; - this._localizationService = localizationService; - this._dateTimeSettings = dateTimeSettings; - this._taxSettings = taxSettings; - this._rewardPointsSettings = rewardPointsSettings; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._addressService = addressService; - this._customerSettings = customerSettings; - this._taxService = taxService; - this._workContext = workContext; - this._vendorService = vendorService; - this._storeContext = storeContext; - this._priceFormatter = priceFormatter; - this._orderService = orderService; - this._exportManager = exportManager; - this._customerActivityService = customerActivityService; - this._backInStockSubscriptionService = backInStockSubscriptionService; - this._priceCalculationService = priceCalculationService; - this._productAttributeFormatter = productAttributeFormatter; - this._permissionService = permissionService; - this._queuedEmailService = queuedEmailService; - this._emailAccountSettings = emailAccountSettings; - this._emailAccountService = emailAccountService; - this._forumSettings = forumSettings; - this._forumService = forumService; - this._openAuthenticationService = openAuthenticationService; - this._addressSettings = addressSettings; - this._storeService = storeService; - this._customerAttributeParser = customerAttributeParser; - this._customerAttributeService = customerAttributeService; - this._addressAttributeParser = addressAttributeParser; - this._addressAttributeService = addressAttributeService; - this._addressAttributeFormatter = addressAttributeFormatter; - this._affiliateService = affiliateService; - this._workflowMessageService = workflowMessageService; - this._rewardPointService = rewardPointService; - this._cacheManager = cacheManager; - } - - #endregion - - #region Utilities - - [NonAction] - protected virtual string GetCustomerRolesNames(IList customerRoles, string separator = ",") - { - var sb = new StringBuilder(); - for (int i = 0; i < customerRoles.Count; i++) - { - sb.Append(customerRoles[i].Name); - if (i != customerRoles.Count - 1) - { - sb.Append(separator); - sb.Append(" "); - } - } - return sb.ToString(); - } - - [NonAction] - protected virtual IList GetReportRegisteredCustomersModel() - { - var report = new List(); - report.Add(new RegisteredCustomerReportLineModel - { - Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.7days"), - Customers = _customerReportService.GetRegisteredCustomersReport(7) - }); - - report.Add(new RegisteredCustomerReportLineModel - { - Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.14days"), - Customers = _customerReportService.GetRegisteredCustomersReport(14) - }); - report.Add(new RegisteredCustomerReportLineModel - { - Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.month"), - Customers = _customerReportService.GetRegisteredCustomersReport(30) - }); - report.Add(new RegisteredCustomerReportLineModel - { - Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.year"), - Customers = _customerReportService.GetRegisteredCustomersReport(365) - }); - - return report; - } - - [NonAction] - protected virtual IList GetAssociatedExternalAuthRecords(Customer customer) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - var result = new List(); - foreach (var record in _openAuthenticationService.GetExternalIdentifiersFor(customer)) - { - var method = _openAuthenticationService.LoadExternalAuthenticationMethodBySystemName(record.ProviderSystemName); - if (method == null) - continue; - - result.Add(new CustomerModel.AssociatedExternalAuthModel - { - Id = record.Id, - Email = record.Email, - ExternalIdentifier = record.ExternalIdentifier, - AuthMethodName = method.PluginDescriptor.FriendlyName - }); - } - - return result; - } - - [NonAction] - protected virtual CustomerModel PrepareCustomerModelForList(Customer customer) - { - return new CustomerModel - { - Id = customer.Id, - Email = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"), - Username = customer.Username, - FullName = customer.GetFullName(), - Company = customer.GetAttribute(SystemCustomerAttributeNames.Company), - Phone = customer.GetAttribute(SystemCustomerAttributeNames.Phone), - ZipPostalCode = customer.GetAttribute(SystemCustomerAttributeNames.ZipPostalCode), - CustomerRoleNames = GetCustomerRolesNames(customer.CustomerRoles.ToList()), - Active = customer.Active, - CreatedOn = _dateTimeHelper.ConvertToUserTime(customer.CreatedOnUtc, DateTimeKind.Utc), - LastActivityDate = _dateTimeHelper.ConvertToUserTime(customer.LastActivityDateUtc, DateTimeKind.Utc), - }; - } - - [NonAction] - protected virtual string ValidateCustomerRoles(IList customerRoles) - { - if (customerRoles == null) - throw new ArgumentNullException("customerRoles"); - - //ensure a customer is not added to both 'Guests' and 'Registered' customer roles - //ensure that a customer is in at least one required role ('Guests' and 'Registered') - bool isInGuestsRole = customerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Guests) != null; - bool isInRegisteredRole = customerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Registered) != null; - if (isInGuestsRole && isInRegisteredRole) - return _localizationService.GetResource("Admin.Customers.Customers.GuestsAndRegisteredRolesError"); - if (!isInGuestsRole && !isInRegisteredRole) - return _localizationService.GetResource("Admin.Customers.Customers.AddCustomerToGuestsOrRegisteredRoleError"); - - //no errors - return ""; - } - - [NonAction] - protected virtual void PrepareVendorsModel(CustomerModel model) - { - if (model == null) - throw new ArgumentNullException("model"); - - model.AvailableVendors.Add(new SelectListItem - { - Text = _localizationService.GetResource("Admin.Customers.Customers.Fields.Vendor.None"), - Value = "0" - }); - var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); - foreach (var v in vendors) - model.AvailableVendors.Add(v); - } - - [NonAction] - protected virtual void PrepareCustomerAttributeModel(CustomerModel model, Customer customer) - { - var customerAttributes = _customerAttributeService.GetAllCustomerAttributes(); - foreach (var attribute in customerAttributes) - { - var attributeModel = new CustomerModel.CustomerAttributeModel - { - Id = attribute.Id, - Name = attribute.Name, - IsRequired = attribute.IsRequired, - AttributeControlType = attribute.AttributeControlType, - }; - - if (attribute.ShouldHaveValues()) - { - //values - var attributeValues = _customerAttributeService.GetCustomerAttributeValues(attribute.Id); - foreach (var attributeValue in attributeValues) - { - var attributeValueModel = new CustomerModel.CustomerAttributeValueModel - { - Id = attributeValue.Id, - Name = attributeValue.Name, - IsPreSelected = attributeValue.IsPreSelected - }; - attributeModel.Values.Add(attributeValueModel); - } - } - - - //set already selected attributes - if (customer != null) - { - var selectedCustomerAttributes = customer.GetAttribute(SystemCustomerAttributeNames.CustomCustomerAttributes, _genericAttributeService); - switch (attribute.AttributeControlType) - { - case AttributeControlType.DropdownList: - case AttributeControlType.RadioList: - case AttributeControlType.Checkboxes: - { - if (!String.IsNullOrEmpty(selectedCustomerAttributes)) - { - //clear default selection - foreach (var item in attributeModel.Values) - item.IsPreSelected = false; - - //select new values - var selectedValues = _customerAttributeParser.ParseCustomerAttributeValues(selectedCustomerAttributes); - foreach (var attributeValue in selectedValues) - foreach (var item in attributeModel.Values) - if (attributeValue.Id == item.Id) - item.IsPreSelected = true; - } - } - break; - case AttributeControlType.ReadonlyCheckboxes: - { - //do nothing - //values are already pre-set - } - break; - case AttributeControlType.TextBox: - case AttributeControlType.MultilineTextbox: - { - if (!String.IsNullOrEmpty(selectedCustomerAttributes)) - { - var enteredText = _customerAttributeParser.ParseValues(selectedCustomerAttributes, attribute.Id); - if (enteredText.Any()) - attributeModel.DefaultValue = enteredText[0]; - } - } - break; - case AttributeControlType.Datepicker: - case AttributeControlType.ColorSquares: - case AttributeControlType.ImageSquares: - case AttributeControlType.FileUpload: - default: - //not supported attribute control types - break; - } - } - - model.CustomerAttributes.Add(attributeModel); - } - } - - [NonAction] - protected virtual string ParseCustomCustomerAttributes( FormCollection form) - { - if (form == null) - throw new ArgumentNullException("form"); - - string attributesXml = ""; - var customerAttributes = _customerAttributeService.GetAllCustomerAttributes(); - foreach (var attribute in customerAttributes) - { - string controlId = string.Format("customer_attribute_{0}", attribute.Id); - switch (attribute.AttributeControlType) - { - case AttributeControlType.DropdownList: - case AttributeControlType.RadioList: - { - var ctrlAttributes = form[controlId]; - if (!String.IsNullOrEmpty(ctrlAttributes)) - { - int selectedAttributeId = int.Parse(ctrlAttributes); - if (selectedAttributeId > 0) - attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, - attribute, selectedAttributeId.ToString()); - } - } - break; - case AttributeControlType.Checkboxes: - { - var cblAttributes = form[controlId]; - if (!String.IsNullOrEmpty(cblAttributes)) - { - foreach (var item in cblAttributes.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)) - { - int selectedAttributeId = int.Parse(item); - if (selectedAttributeId > 0) - attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, - attribute, selectedAttributeId.ToString()); - } - } - } - break; - case AttributeControlType.ReadonlyCheckboxes: - { - //load read-only (already server-side selected) values - var attributeValues = _customerAttributeService.GetCustomerAttributeValues(attribute.Id); - foreach (var selectedAttributeId in attributeValues - .Where(v => v.IsPreSelected) - .Select(v => v.Id) - .ToList()) - { - attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, - attribute, selectedAttributeId.ToString()); - } - } - break; - case AttributeControlType.TextBox: - case AttributeControlType.MultilineTextbox: - { - var ctrlAttributes = form[controlId]; - if (!String.IsNullOrEmpty(ctrlAttributes)) - { - string enteredText = ctrlAttributes.Trim(); - attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, - attribute, enteredText); - } - } - break; - case AttributeControlType.Datepicker: - case AttributeControlType.ColorSquares: - case AttributeControlType.ImageSquares: - case AttributeControlType.FileUpload: - //not supported customer attributes - default: - break; - } - } - - return attributesXml; - } - - [NonAction] - protected virtual void PrepareCustomerModel(CustomerModel model, Customer customer, bool excludeProperties) - { - var allStores = _storeService.GetAllStores(); - if (customer != null) - { - model.Id = customer.Id; - if (!excludeProperties) - { - model.Email = customer.Email; - model.Username = customer.Username; - model.VendorId = customer.VendorId; - model.AdminComment = customer.AdminComment; - model.IsTaxExempt = customer.IsTaxExempt; - model.Active = customer.Active; - - if (customer.RegisteredInStoreId == 0 || allStores.All(s => s.Id != customer.RegisteredInStoreId)) - model.RegisteredInStore = string.Empty; - else - model.RegisteredInStore = allStores.First(s => s.Id == customer.RegisteredInStoreId).Name; - - var affiliate = _affiliateService.GetAffiliateById(customer.AffiliateId); - if (affiliate != null) - { - model.AffiliateId = affiliate.Id; - model.AffiliateName = affiliate.GetFullName(); - } - - model.TimeZoneId = customer.GetAttribute(SystemCustomerAttributeNames.TimeZoneId); - model.VatNumber = customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); - model.VatNumberStatusNote = ((VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId)) - .GetLocalizedEnum(_localizationService, _workContext); - model.CreatedOn = _dateTimeHelper.ConvertToUserTime(customer.CreatedOnUtc, DateTimeKind.Utc); - model.LastActivityDate = _dateTimeHelper.ConvertToUserTime(customer.LastActivityDateUtc, DateTimeKind.Utc); - model.LastIpAddress = customer.LastIpAddress; - model.LastVisitedPage = customer.GetAttribute(SystemCustomerAttributeNames.LastVisitedPage); - - model.SelectedCustomerRoleIds = customer.CustomerRoles.Select(cr => cr.Id).ToList(); - - //newsletter subscriptions - if (!String.IsNullOrEmpty(customer.Email)) - { - var newsletterSubscriptionStoreIds = new List(); - foreach (var store in allStores) - { - var newsletterSubscription = _newsLetterSubscriptionService - .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); - if (newsletterSubscription != null) - newsletterSubscriptionStoreIds.Add(store.Id); - model.SelectedNewsletterSubscriptionStoreIds = newsletterSubscriptionStoreIds.ToArray(); - } - } - - //form fields - model.FirstName = customer.GetAttribute(SystemCustomerAttributeNames.FirstName); - model.LastName = customer.GetAttribute(SystemCustomerAttributeNames.LastName); - model.Gender = customer.GetAttribute(SystemCustomerAttributeNames.Gender); - model.DateOfBirth = customer.GetAttribute(SystemCustomerAttributeNames.DateOfBirth); - model.Company = customer.GetAttribute(SystemCustomerAttributeNames.Company); - model.StreetAddress = customer.GetAttribute(SystemCustomerAttributeNames.StreetAddress); - model.StreetAddress2 = customer.GetAttribute(SystemCustomerAttributeNames.StreetAddress2); - model.ZipPostalCode = customer.GetAttribute(SystemCustomerAttributeNames.ZipPostalCode); - model.City = customer.GetAttribute(SystemCustomerAttributeNames.City); - model.CountryId = customer.GetAttribute(SystemCustomerAttributeNames.CountryId); - model.StateProvinceId = customer.GetAttribute(SystemCustomerAttributeNames.StateProvinceId); - model.Phone = customer.GetAttribute(SystemCustomerAttributeNames.Phone); - model.Fax = customer.GetAttribute(SystemCustomerAttributeNames.Fax); - } - } - - model.UsernamesEnabled = _customerSettings.UsernamesEnabled; - model.AllowCustomersToSetTimeZone = _dateTimeSettings.AllowCustomersToSetTimeZone; - foreach (var tzi in _dateTimeHelper.GetSystemTimeZones()) - model.AvailableTimeZones.Add(new SelectListItem { Text = tzi.DisplayName, Value = tzi.Id, Selected = (tzi.Id == model.TimeZoneId) }); - if (customer != null) - { - model.DisplayVatNumber = _taxSettings.EuVatEnabled; - } - else - { - model.DisplayVatNumber = false; - } - - //vendors - PrepareVendorsModel(model); - //customer attributes - PrepareCustomerAttributeModel(model, customer); - - model.GenderEnabled = _customerSettings.GenderEnabled; - model.DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled; - model.CompanyEnabled = _customerSettings.CompanyEnabled; - model.StreetAddressEnabled = _customerSettings.StreetAddressEnabled; - model.StreetAddress2Enabled = _customerSettings.StreetAddress2Enabled; - model.ZipPostalCodeEnabled = _customerSettings.ZipPostalCodeEnabled; - model.CityEnabled = _customerSettings.CityEnabled; - model.CountryEnabled = _customerSettings.CountryEnabled; - model.StateProvinceEnabled = _customerSettings.StateProvinceEnabled; - model.PhoneEnabled = _customerSettings.PhoneEnabled; - model.FaxEnabled = _customerSettings.FaxEnabled; - - //countries and states - if (_customerSettings.CountryEnabled) - { - model.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - { - model.AvailableCountries.Add(new SelectListItem - { - Text = c.Name, - Value = c.Id.ToString(), - Selected = c.Id == model.CountryId - }); - } - - if (_customerSettings.StateProvinceEnabled) - { - //states - var states = _stateProvinceService.GetStateProvincesByCountryId(model.CountryId).ToList(); - if (states.Any()) - { - model.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectState"), Value = "0" }); - - foreach (var s in states) - { - model.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.StateProvinceId) }); - } - } - else - { - bool anyCountrySelected = model.AvailableCountries.Any(x => x.Selected); - - model.AvailableStates.Add(new SelectListItem - { - Text = _localizationService.GetResource(anyCountrySelected ? "Admin.Address.OtherNonUS" : "Admin.Address.SelectState"), - Value = "0" - }); - } - } - } - - //newsletter subscriptions - model.AvailableNewsletterSubscriptionStores = allStores - .Select(s => new CustomerModel.StoreModel() {Id = s.Id, Name = s.Name }) - .ToList(); - - //customer roles - var allRoles = _customerService.GetAllCustomerRoles(true); - var adminRole = allRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered); - //precheck Registered Role as a default role while creating a new customer through admin - if (customer == null && adminRole != null) - { - model.SelectedCustomerRoleIds.Add(adminRole.Id); - } - foreach (var role in allRoles) - { - model.AvailableCustomerRoles.Add(new SelectListItem - { - Text = role.Name, - Value = role.Id.ToString(), - Selected = model.SelectedCustomerRoleIds.Contains(role.Id) - }); - } - - //reward points history - if (customer != null) - { - model.DisplayRewardPointsHistory = _rewardPointsSettings.Enabled; - model.AddRewardPointsValue = 0; - model.AddRewardPointsMessage = "Some comment here..."; - - //stores - foreach (var store in allStores) - { - model.RewardPointsAvailableStores.Add(new SelectListItem - { - Text = store.Name, - Value = store.Id.ToString(), - Selected = (store.Id == _storeContext.CurrentStore.Id) - }); - } - } - else - { - model.DisplayRewardPointsHistory = false; - } - //external authentication records - if (customer != null) - { - model.AssociatedExternalAuthRecords = GetAssociatedExternalAuthRecords(customer); - } - //sending of the welcome message: - //1. "admin approval" registration method - //2. already created customer - //3. registered - model.AllowSendingOfWelcomeMessage = _customerSettings.UserRegistrationType == UserRegistrationType.AdminApproval && - customer != null && - customer.IsRegistered(); - //sending of the activation message - //1. "email validation" registration method - //2. already created customer - //3. registered - //4. not active - model.AllowReSendingOfActivationMessage = _customerSettings.UserRegistrationType == UserRegistrationType.EmailValidation && - customer != null && - customer.IsRegistered() && - !customer.Active; - } - - [NonAction] - protected virtual void PrepareAddressModel(CustomerAddressModel model, Address address, Customer customer, bool excludeProperties) - { - if (customer == null) - throw new ArgumentNullException("customer"); - - model.CustomerId = customer.Id; - if (address != null) - { - if (!excludeProperties) - { - model.Address = address.ToModel(); - } - } - - if (model.Address == null) - model.Address = new AddressModel(); - - model.Address.FirstNameEnabled = true; - model.Address.FirstNameRequired = true; - model.Address.LastNameEnabled = true; - model.Address.LastNameRequired = true; - model.Address.EmailEnabled = true; - model.Address.EmailRequired = true; - model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; - model.Address.CompanyRequired = _addressSettings.CompanyRequired; - model.Address.CountryEnabled = _addressSettings.CountryEnabled; - model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled - model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; - model.Address.CityEnabled = _addressSettings.CityEnabled; - model.Address.CityRequired = _addressSettings.CityRequired; - model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; - model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; - model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; - model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; - model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; - model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; - model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; - model.Address.PhoneRequired = _addressSettings.PhoneRequired; - model.Address.FaxEnabled = _addressSettings.FaxEnabled; - model.Address.FaxRequired = _addressSettings.FaxRequired; - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); - //states - var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - //customer attribute services - model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); - } - - [NonAction] - private bool SecondAdminAccountExists(Customer customer) - { - var customers = _customerService.GetAllCustomers(customerRoleIds: new[] {_customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Administrators).Id}); - - return customers.Any(c => c.Active && c.Id != customer.Id); - } - #endregion - - #region Customers - - public virtual ActionResult Index() - { - return RedirectToAction("List"); - } - - public virtual ActionResult List() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - //load registered customers by default - var defaultRoleIds = new List {_customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered).Id}; - var model = new CustomerListModel - { - UsernamesEnabled = _customerSettings.UsernamesEnabled, - DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled, - CompanyEnabled = _customerSettings.CompanyEnabled, - PhoneEnabled = _customerSettings.PhoneEnabled, - ZipPostalCodeEnabled = _customerSettings.ZipPostalCodeEnabled, - SearchCustomerRoleIds = defaultRoleIds, - }; - var allRoles = _customerService.GetAllCustomerRoles(true); - foreach (var role in allRoles) - { - model.AvailableCustomerRoles.Add(new SelectListItem - { - Text = role.Name, - Value = role.Id.ToString(), - Selected = defaultRoleIds.Any(x => x == role.Id) - }); - } - - return View(model); - } - - [HttpPost] - public virtual ActionResult CustomerList(DataSourceRequest command, CustomerListModel model, - [ModelBinder(typeof(CommaSeparatedModelBinder))] int[] searchCustomerRoleIds) - { - //we use own own binder for searchCustomerRoleIds property - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var searchDayOfBirth = 0; - int searchMonthOfBirth = 0; - if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) - searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); - if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) - searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); - - var customers = _customerService.GetAllCustomers( - customerRoleIds: searchCustomerRoleIds, - email: model.SearchEmail, - username: model.SearchUsername, - firstName: model.SearchFirstName, - lastName: model.SearchLastName, - dayOfBirth: searchDayOfBirth, - monthOfBirth: searchMonthOfBirth, - company: model.SearchCompany, - phone: model.SearchPhone, - zipPostalCode: model.SearchZipPostalCode, - ipAddress: model.SearchIpAddress, - loadOnlyWithShoppingCart: false, - pageIndex: command.Page - 1, - pageSize: command.PageSize); - var gridModel = new DataSourceResult - { - Data = customers.Select(PrepareCustomerModelForList), - Total = customers.TotalCount - }; - - return Json(gridModel); - } - - public virtual ActionResult Create() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var model = new CustomerModel(); - PrepareCustomerModel(model, null, false); - //default value - model.Active = true; - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - [FormValueRequired("save", "save-continue")] - [ValidateInput(false)] - public virtual ActionResult Create(CustomerModel model, bool continueEditing, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - if (!String.IsNullOrWhiteSpace(model.Email)) - { - var cust2 = _customerService.GetCustomerByEmail(model.Email); - if (cust2 != null) - ModelState.AddModelError("", "Email is already registered"); - } - if (!String.IsNullOrWhiteSpace(model.Username) & _customerSettings.UsernamesEnabled) - { - var cust2 = _customerService.GetCustomerByUsername(model.Username); - if (cust2 != null) - ModelState.AddModelError("", "Username is already registered"); - } - - //validate customer roles - var allCustomerRoles = _customerService.GetAllCustomerRoles(true); - var newCustomerRoles = new List(); - foreach (var customerRole in allCustomerRoles) - if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) - newCustomerRoles.Add(customerRole); - var customerRolesError = ValidateCustomerRoles(newCustomerRoles); - if (!String.IsNullOrEmpty(customerRolesError)) - { - ModelState.AddModelError("", customerRolesError); - ErrorNotification(customerRolesError, false); - } - - // Ensure that valid email address is entered if Registered role is checked to avoid registered customers with empty email address - if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null && !CommonHelper.IsValidEmail(model.Email)) - { - ModelState.AddModelError("", _localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole")); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole"), false); - } - - //custom customer attributes - var customerAttributesXml = ParseCustomCustomerAttributes(form); - if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null) - { - var customerAttributeWarnings = _customerAttributeParser.GetAttributeWarnings(customerAttributesXml); - foreach (var error in customerAttributeWarnings) - { - ModelState.AddModelError("", error); - } - } - - if (ModelState.IsValid) - { - var customer = new Customer - { - CustomerGuid = Guid.NewGuid(), - Email = model.Email, - Username = model.Username, - VendorId = model.VendorId, - AdminComment = model.AdminComment, - IsTaxExempt = model.IsTaxExempt, - Active = model.Active, - CreatedOnUtc = DateTime.UtcNow, - LastActivityDateUtc = DateTime.UtcNow, - RegisteredInStoreId = _storeContext.CurrentStore.Id - }; - _customerService.InsertCustomer(customer); - - //form fields - if (_dateTimeSettings.AllowCustomersToSetTimeZone) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.TimeZoneId, model.TimeZoneId); - if (_customerSettings.GenderEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender); - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.FirstName, model.FirstName); - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.LastName, model.LastName); - if (_customerSettings.DateOfBirthEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.DateOfBirth, model.DateOfBirth); - if (_customerSettings.CompanyEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Company, model.Company); - if (_customerSettings.StreetAddressEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress, model.StreetAddress); - if (_customerSettings.StreetAddress2Enabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress2, model.StreetAddress2); - if (_customerSettings.ZipPostalCodeEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.ZipPostalCode, model.ZipPostalCode); - if (_customerSettings.CityEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.City, model.City); - if (_customerSettings.CountryEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CountryId, model.CountryId); - if (_customerSettings.CountryEnabled && _customerSettings.StateProvinceEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StateProvinceId, model.StateProvinceId); - if (_customerSettings.PhoneEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Phone, model.Phone); - if (_customerSettings.FaxEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Fax, model.Fax); - - //custom customer attributes - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CustomCustomerAttributes, customerAttributesXml); - - - //newsletter subscriptions - if (!String.IsNullOrEmpty(customer.Email)) - { - var allStores = _storeService.GetAllStores(); - foreach (var store in allStores) - { - var newsletterSubscription = _newsLetterSubscriptionService - .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); - if (model.SelectedNewsletterSubscriptionStoreIds != null && - model.SelectedNewsletterSubscriptionStoreIds.Contains(store.Id)) - { - //subscribed - if (newsletterSubscription == null) - { - _newsLetterSubscriptionService.InsertNewsLetterSubscription(new NewsLetterSubscription - { - NewsLetterSubscriptionGuid = Guid.NewGuid(), - Email = customer.Email, - Active = true, - StoreId = store.Id, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - else - { - //not subscribed - if (newsletterSubscription != null) - { - _newsLetterSubscriptionService.DeleteNewsLetterSubscription(newsletterSubscription); - } - } - } - } - - //password - if (!String.IsNullOrWhiteSpace(model.Password)) - { - var changePassRequest = new ChangePasswordRequest(model.Email, false, _customerSettings.DefaultPasswordFormat, model.Password); - var changePassResult = _customerRegistrationService.ChangePassword(changePassRequest); - if (!changePassResult.Success) - { - foreach (var changePassError in changePassResult.Errors) - ErrorNotification(changePassError); - } - } - - //customer roles - foreach (var customerRole in newCustomerRoles) - { - //ensure that the current customer cannot add to "Administrators" system role if he's not an admin himself - if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && - !_workContext.CurrentCustomer.IsAdmin()) - continue; - - customer.CustomerRoles.Add(customerRole); - } - _customerService.UpdateCustomer(customer); - - - //ensure that a customer with a vendor associated is not in "Administrators" role - //otherwise, he won't have access to other functionality in admin area - if (customer.IsAdmin() && customer.VendorId > 0) - { - customer.VendorId = 0; - _customerService.UpdateCustomer(customer); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminCouldNotbeVendor")); - } - - //ensure that a customer in the Vendors role has a vendor account associated. - //otherwise, he will have access to ALL products - if (customer.IsVendor() && customer.VendorId == 0) - { - var vendorRole = customer - .CustomerRoles - .FirstOrDefault(x => x.SystemName == SystemCustomerRoleNames.Vendors); - customer.CustomerRoles.Remove(vendorRole); - _customerService.UpdateCustomer(customer); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.CannotBeInVendoRoleWithoutVendorAssociated")); - } - - //activity log - _customerActivityService.InsertActivity("AddNewCustomer", _localizationService.GetResource("ActivityLog.AddNewCustomer"), customer.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Added")); - - if (continueEditing) - { - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("Edit", new {id = customer.Id}); - } - return RedirectToAction("List"); - } - - //If we got this far, something failed, redisplay form - PrepareCustomerModel(model, null, true); - return View(model); - } - - public virtual ActionResult Edit(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(id); - if (customer == null || customer.Deleted) - //No customer found with the specified id - return RedirectToAction("List"); - - var model = new CustomerModel(); - PrepareCustomerModel(model, customer, false); - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - [FormValueRequired("save", "save-continue")] - [ValidateInput(false)] - public virtual ActionResult Edit(CustomerModel model, bool continueEditing, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null || customer.Deleted) - //No customer found with the specified id - return RedirectToAction("List"); - - //validate customer roles - var allCustomerRoles = _customerService.GetAllCustomerRoles(true); - var newCustomerRoles = new List(); - foreach (var customerRole in allCustomerRoles) - if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) - newCustomerRoles.Add(customerRole); - var customerRolesError = ValidateCustomerRoles(newCustomerRoles); - if (!String.IsNullOrEmpty(customerRolesError)) - { - ModelState.AddModelError("", customerRolesError); - ErrorNotification(customerRolesError, false); - } - - // Ensure that valid email address is entered if Registered role is checked to avoid registered customers with empty email address - if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null && !CommonHelper.IsValidEmail(model.Email)) - { - ModelState.AddModelError("", _localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole")); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole"), false); - } - - //custom customer attributes - var customerAttributesXml = ParseCustomCustomerAttributes(form); - if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null) - { - var customerAttributeWarnings = _customerAttributeParser.GetAttributeWarnings(customerAttributesXml); - foreach (var error in customerAttributeWarnings) - { - ModelState.AddModelError("", error); - } - } - - if (ModelState.IsValid) - { - try - { - customer.AdminComment = model.AdminComment; - customer.IsTaxExempt = model.IsTaxExempt; - - //prevent deactivation of the last active administrator - if (!customer.IsAdmin() || model.Active || SecondAdminAccountExists(customer)) - customer.Active = model.Active; - else - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.Deactivate")); - - //email - if (!String.IsNullOrWhiteSpace(model.Email)) - { - _customerRegistrationService.SetEmail(customer, model.Email, false); - } - else - { - customer.Email = model.Email; - } - - //username - if (_customerSettings.UsernamesEnabled) - { - if (!String.IsNullOrWhiteSpace(model.Username)) - { - _customerRegistrationService.SetUsername(customer, model.Username); - } - else - { - customer.Username = model.Username; - } - } - - //VAT number - if (_taxSettings.EuVatEnabled) - { - var prevVatNumber = customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); - - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.VatNumber, model.VatNumber); - //set VAT number status - if (!String.IsNullOrEmpty(model.VatNumber)) - { - if (!model.VatNumber.Equals(prevVatNumber, StringComparison.InvariantCultureIgnoreCase)) - { - _genericAttributeService.SaveAttribute(customer, - SystemCustomerAttributeNames.VatNumberStatusId, - (int)_taxService.GetVatNumberStatus(model.VatNumber)); - } - } - else - { - _genericAttributeService.SaveAttribute(customer, - SystemCustomerAttributeNames.VatNumberStatusId, - (int)VatNumberStatus.Empty); - } - } - - //vendor - customer.VendorId = model.VendorId; - - //form fields - if (_dateTimeSettings.AllowCustomersToSetTimeZone) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.TimeZoneId, model.TimeZoneId); - if (_customerSettings.GenderEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender); - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.FirstName, model.FirstName); - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.LastName, model.LastName); - if (_customerSettings.DateOfBirthEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.DateOfBirth, model.DateOfBirth); - if (_customerSettings.CompanyEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Company, model.Company); - if (_customerSettings.StreetAddressEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress, model.StreetAddress); - if (_customerSettings.StreetAddress2Enabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress2, model.StreetAddress2); - if (_customerSettings.ZipPostalCodeEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.ZipPostalCode, model.ZipPostalCode); - if (_customerSettings.CityEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.City, model.City); - if (_customerSettings.CountryEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CountryId, model.CountryId); - if (_customerSettings.CountryEnabled && _customerSettings.StateProvinceEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StateProvinceId, model.StateProvinceId); - if (_customerSettings.PhoneEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Phone, model.Phone); - if (_customerSettings.FaxEnabled) - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Fax, model.Fax); - - //custom customer attributes - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CustomCustomerAttributes, customerAttributesXml); - - //newsletter subscriptions - if (!String.IsNullOrEmpty(customer.Email)) - { - var allStores = _storeService.GetAllStores(); - foreach (var store in allStores) - { - var newsletterSubscription = _newsLetterSubscriptionService - .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); - if (model.SelectedNewsletterSubscriptionStoreIds != null && - model.SelectedNewsletterSubscriptionStoreIds.Contains(store.Id)) - { - //subscribed - if (newsletterSubscription == null) - { - _newsLetterSubscriptionService.InsertNewsLetterSubscription(new NewsLetterSubscription - { - NewsLetterSubscriptionGuid = Guid.NewGuid(), - Email = customer.Email, - Active = true, - StoreId = store.Id, - CreatedOnUtc = DateTime.UtcNow - }); - } - } - else - { - //not subscribed - if (newsletterSubscription != null) - { - _newsLetterSubscriptionService.DeleteNewsLetterSubscription(newsletterSubscription); - } - } - } - } - - - //customer roles - foreach (var customerRole in allCustomerRoles) - { - //ensure that the current customer cannot add/remove to/from "Administrators" system role - //if he's not an admin himself - if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && - !_workContext.CurrentCustomer.IsAdmin()) - continue; - - if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) - { - //new role - if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) == 0) - customer.CustomerRoles.Add(customerRole); - } - else - { - //prevent attempts to delete the administrator role from the user, if the user is the last active administrator - if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && !SecondAdminAccountExists(customer)) - { - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.DeleteRole")); - continue; - } - - //remove role - if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) > 0) - customer.CustomerRoles.Remove(customerRole); - } - } - _customerService.UpdateCustomer(customer); - - - //ensure that a customer with a vendor associated is not in "Administrators" role - //otherwise, he won't have access to the other functionality in admin area - if (customer.IsAdmin() && customer.VendorId > 0) - { - customer.VendorId = 0; - _customerService.UpdateCustomer(customer); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminCouldNotbeVendor")); - } - - //ensure that a customer in the Vendors role has a vendor account associated. - //otherwise, he will have access to ALL products - if (customer.IsVendor() && customer.VendorId == 0) - { - var vendorRole = customer - .CustomerRoles - .FirstOrDefault(x => x.SystemName == SystemCustomerRoleNames.Vendors); - customer.CustomerRoles.Remove(vendorRole); - _customerService.UpdateCustomer(customer); - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.CannotBeInVendoRoleWithoutVendorAssociated")); - } - - - //activity log - _customerActivityService.InsertActivity("EditCustomer", _localizationService.GetResource("ActivityLog.EditCustomer"), customer.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Updated")); - if (continueEditing) - { - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("Edit", new {id = customer.Id}); - } - return RedirectToAction("List"); - } - catch (Exception exc) - { - ErrorNotification(exc.Message, false); - } - } - - - //If we got this far, something failed, redisplay form - PrepareCustomerModel(model, customer, true); - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("changepassword")] - public virtual ActionResult ChangePassword(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - //ensure that the current customer cannot change passwords of "Administrators" if he's not an admin himself - if (customer.IsAdmin() && !_workContext.CurrentCustomer.IsAdmin()) - { - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.OnlyAdminCanChangePassword")); - return RedirectToAction("Edit", new { id = customer.Id }); - } - - if (ModelState.IsValid) - { - var changePassRequest = new ChangePasswordRequest(model.Email, - false, _customerSettings.DefaultPasswordFormat, model.Password); - var changePassResult = _customerRegistrationService.ChangePassword(changePassRequest); - if (changePassResult.Success) - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.PasswordChanged")); - else - foreach (var error in changePassResult.Errors) - ErrorNotification(error); - } - - return RedirectToAction("Edit", new {id = customer.Id}); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("markVatNumberAsValid")] - public virtual ActionResult MarkVatNumberAsValid(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - _genericAttributeService.SaveAttribute(customer, - SystemCustomerAttributeNames.VatNumberStatusId, - (int)VatNumberStatus.Valid); - - return RedirectToAction("Edit", new {id = customer.Id}); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("markVatNumberAsInvalid")] - public virtual ActionResult MarkVatNumberAsInvalid(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - _genericAttributeService.SaveAttribute(customer, - SystemCustomerAttributeNames.VatNumberStatusId, - (int)VatNumberStatus.Invalid); - - return RedirectToAction("Edit", new {id = customer.Id}); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("remove-affiliate")] - public virtual ActionResult RemoveAffiliate(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - customer.AffiliateId = 0; - _customerService.UpdateCustomer(customer); - - return RedirectToAction("Edit", new { id = customer.Id }); - } - - [HttpPost] - public virtual ActionResult Delete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - try - { - //prevent attempts to delete the user, if it is the last active administrator - if (customer.IsAdmin() && !SecondAdminAccountExists(customer)) - { - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.DeleteAdministrator")); - return RedirectToAction("Edit", new { id = customer.Id }); - } - - //ensure that the current customer cannot delete "Administrators" if he's not an admin himself - if (customer.IsAdmin() && !_workContext.CurrentCustomer.IsAdmin()) - { - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.OnlyAdminCanDeleteAdmin")); - return RedirectToAction("Edit", new { id = customer.Id }); - } - - //delete - _customerService.DeleteCustomer(customer); - - //remove newsletter subscription (if exists) - foreach (var store in _storeService.GetAllStores()) - { - var subscription = _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); - if (subscription != null) - _newsLetterSubscriptionService.DeleteNewsLetterSubscription(subscription); - } - - //activity log - _customerActivityService.InsertActivity("DeleteCustomer", _localizationService.GetResource("ActivityLog.DeleteCustomer"), customer.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Deleted")); - return RedirectToAction("List"); - } - catch (Exception exc) - { - ErrorNotification(exc.Message); - return RedirectToAction("Edit", new { id = customer.Id }); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("impersonate")] - public virtual ActionResult Impersonate(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.AllowCustomerImpersonation)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - //ensure that a non-admin user cannot impersonate as an administrator - //otherwise, that user can simply impersonate as an administrator and gain additional administrative privileges - if (!_workContext.CurrentCustomer.IsAdmin() && customer.IsAdmin()) - { - ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.NonAdminNotImpersonateAsAdminError")); - return RedirectToAction("Edit", customer.Id); - } - - //activity log - _customerActivityService.InsertActivity("Impersonation.Started", _localizationService.GetResource("ActivityLog.Impersonation.Started.StoreOwner"), customer.Email, customer.Id); - _customerActivityService.InsertActivity(customer, "Impersonation.Started", _localizationService.GetResource("ActivityLog.Impersonation.Started.Customer"), _workContext.CurrentCustomer.Email, _workContext.CurrentCustomer.Id); - - //ensure login is not required - customer.RequireReLogin = false; - _customerService.UpdateCustomer(customer); - _genericAttributeService.SaveAttribute(_workContext.CurrentCustomer, SystemCustomerAttributeNames.ImpersonatedCustomerId, customer.Id); - - return RedirectToAction("Index", "Home", new { area = "" }); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("send-welcome-message")] - public virtual ActionResult SendWelcomeMessage(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - _workflowMessageService.SendCustomerWelcomeMessage(customer, _workContext.WorkingLanguage.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendWelcomeMessage.Success")); - - return RedirectToAction("Edit", new { id = customer.Id }); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("resend-activation-message")] - public virtual ActionResult ReSendActivationMessage(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - //email validation message - _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.AccountActivationToken, Guid.NewGuid().ToString()); - _workflowMessageService.SendCustomerEmailValidationMessage(customer, _workContext.WorkingLanguage.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.ReSendActivationMessage.Success")); - - return RedirectToAction("Edit", new { id = customer.Id }); - } - - public virtual ActionResult SendEmail(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - try - { - if (String.IsNullOrWhiteSpace(customer.Email)) - throw new NopException("Customer email is empty"); - if (!CommonHelper.IsValidEmail(customer.Email)) - throw new NopException("Customer email is not valid"); - if (String.IsNullOrWhiteSpace(model.SendEmail.Subject)) - throw new NopException("Email subject is empty"); - if (String.IsNullOrWhiteSpace(model.SendEmail.Body)) - throw new NopException("Email body is empty"); - - var emailAccount = _emailAccountService.GetEmailAccountById(_emailAccountSettings.DefaultEmailAccountId); - if (emailAccount == null) - emailAccount = _emailAccountService.GetAllEmailAccounts().FirstOrDefault(); - if (emailAccount == null) - throw new NopException("Email account can't be loaded"); - var email = new QueuedEmail - { - Priority = QueuedEmailPriority.High, - EmailAccountId = emailAccount.Id, - FromName = emailAccount.DisplayName, - From = emailAccount.Email, - ToName = customer.GetFullName(), - To = customer.Email, - Subject = model.SendEmail.Subject, - Body = model.SendEmail.Body, - CreatedOnUtc = DateTime.UtcNow, - DontSendBeforeDateUtc = (model.SendEmail.SendImmediately || !model.SendEmail.DontSendBeforeDate.HasValue) ? - null : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.SendEmail.DontSendBeforeDate.Value) - }; - _queuedEmailService.InsertQueuedEmail(email); - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendEmail.Queued")); - } - catch (Exception exc) - { - ErrorNotification(exc.Message); - } - - return RedirectToAction("Edit", new { id = customer.Id }); - } - - public virtual ActionResult SendPm(CustomerModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.Id); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - try - { - if (!_forumSettings.AllowPrivateMessages) - throw new NopException("Private messages are disabled"); - if (customer.IsGuest()) - throw new NopException("Customer should be registered"); - if (String.IsNullOrWhiteSpace(model.SendPm.Subject)) - throw new NopException("PM subject is empty"); - if (String.IsNullOrWhiteSpace(model.SendPm.Message)) - throw new NopException("PM message is empty"); - - - var privateMessage = new PrivateMessage - { - StoreId = _storeContext.CurrentStore.Id, - ToCustomerId = customer.Id, - FromCustomerId = _workContext.CurrentCustomer.Id, - Subject = model.SendPm.Subject, - Text = model.SendPm.Message, - IsDeletedByAuthor = false, - IsDeletedByRecipient = false, - IsRead = false, - CreatedOnUtc = DateTime.UtcNow - }; - - _forumService.InsertPrivateMessage(privateMessage); - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendPM.Sent")); - } - catch (Exception exc) - { - ErrorNotification(exc.Message); - } - - return RedirectToAction("Edit", new { id = customer.Id }); - } - - #endregion - - #region Reward points history - - [HttpPost] - public virtual ActionResult RewardPointsHistorySelect(DataSourceRequest command, int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - throw new ArgumentException("No customer found with the specified id"); - - var rewardPoints = _rewardPointService.GetRewardPointsHistory(customer.Id, true, true, command.Page - 1, command.PageSize); - var gridModel = new DataSourceResult - { - Data = rewardPoints.Select(rph => - { - var store = _storeService.GetStoreById(rph.StoreId); - var activatingDate = _dateTimeHelper.ConvertToUserTime(rph.CreatedOnUtc, DateTimeKind.Utc); - - return new CustomerModel.RewardPointsHistoryModel - { - StoreName = store != null ? store.Name : "Unknown", - Points = rph.Points, - PointsBalance = rph.PointsBalance.HasValue ? rph.PointsBalance.ToString() - : string.Format(_localizationService.GetResource("Admin.Customers.Customers.RewardPoints.ActivatedLater"), activatingDate), - Message = rph.Message, - CreatedOn = activatingDate - }; - }), - Total = rewardPoints.TotalCount - }; - - return Json(gridModel); - } - - [ValidateInput(false)] - public virtual ActionResult RewardPointsHistoryAdd(int customerId, int storeId, int addRewardPointsValue, string addRewardPointsMessage) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - return Json(new { Result = false }, JsonRequestBehavior.AllowGet); - - _rewardPointService.AddRewardPointsHistoryEntry(customer, - addRewardPointsValue, storeId, addRewardPointsMessage); - - return Json(new { Result = true }, JsonRequestBehavior.AllowGet); - } - - #endregion - - #region Addresses - - [HttpPost] - public virtual ActionResult AddressesSelect(int customerId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - throw new ArgumentException("No customer found with the specified id", "customerId"); - - var addresses = customer.Addresses.OrderByDescending(a => a.CreatedOnUtc).ThenByDescending(a => a.Id).ToList(); - var gridModel = new DataSourceResult - { - Data = addresses.Select(x => - { - var model = x.ToModel(); - var addressHtmlSb = new StringBuilder("
"); - if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(model.Company)) - addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Company)); - if (_addressSettings.StreetAddressEnabled && !String.IsNullOrEmpty(model.Address1)) - addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Address1)); - if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(model.Address2)) - addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Address2)); - if (_addressSettings.CityEnabled && !String.IsNullOrEmpty(model.City)) - addressHtmlSb.AppendFormat("{0},", Server.HtmlEncode(model.City)); - if (_addressSettings.StateProvinceEnabled && !String.IsNullOrEmpty(model.StateProvinceName)) - addressHtmlSb.AppendFormat("{0},", Server.HtmlEncode(model.StateProvinceName)); - if (_addressSettings.ZipPostalCodeEnabled && !String.IsNullOrEmpty(model.ZipPostalCode)) - addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.ZipPostalCode)); - if (_addressSettings.CountryEnabled && !String.IsNullOrEmpty(model.CountryName)) - addressHtmlSb.AppendFormat("{0}", Server.HtmlEncode(model.CountryName)); - var customAttributesFormatted = _addressAttributeFormatter.FormatAttributes(x.CustomAttributes); - if (!String.IsNullOrEmpty(customAttributesFormatted)) - { - //already encoded - addressHtmlSb.AppendFormat("
{0}", customAttributesFormatted); - } - addressHtmlSb.Append("
"); - model.AddressHtml = addressHtmlSb.ToString(); - return model; - }), - Total = addresses.Count - }; - - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult AddressDelete(int id, int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - throw new ArgumentException("No customer found with the specified id", "customerId"); - - var address = customer.Addresses.FirstOrDefault(a => a.Id == id); - if (address == null) - //No customer found with the specified id - return Content("No customer found with the specified id"); - customer.RemoveAddress(address); - _customerService.UpdateCustomer(customer); - //now delete the address record - _addressService.DeleteAddress(address); - - return new NullJsonResult(); - } - - public virtual ActionResult AddressCreate(int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - var model = new CustomerAddressModel(); - PrepareAddressModel(model, null, customer, false); - - return View(model); - } - - [HttpPost] - [ValidateInput(false)] - public virtual ActionResult AddressCreate(CustomerAddressModel model, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.CustomerId); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - //custom address attributes - var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); - var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); - foreach (var error in customAttributeWarnings) - { - ModelState.AddModelError("", error); - } - - if (ModelState.IsValid) - { - var address = model.Address.ToEntity(); - address.CustomAttributes = customAttributes; - address.CreatedOnUtc = DateTime.UtcNow; - //some validation - if (address.CountryId == 0) - address.CountryId = null; - if (address.StateProvinceId == 0) - address.StateProvinceId = null; - customer.Addresses.Add(address); - _customerService.UpdateCustomer(customer); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Addresses.Added")); - return RedirectToAction("AddressEdit", new { addressId = address.Id, customerId = model.CustomerId }); - } - - //If we got this far, something failed, redisplay form - PrepareAddressModel(model, null, customer, true); - return View(model); - } - - public virtual ActionResult AddressEdit(int addressId, int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(customerId); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - var address = _addressService.GetAddressById(addressId); - if (address == null) - //No address found with the specified id - return RedirectToAction("Edit", new { id = customer.Id }); - - var model = new CustomerAddressModel(); - PrepareAddressModel(model, address, customer, false); - return View(model); - } - - [HttpPost] - [ValidateInput(false)] - public virtual ActionResult AddressEdit(CustomerAddressModel model, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customer = _customerService.GetCustomerById(model.CustomerId); - if (customer == null) - //No customer found with the specified id - return RedirectToAction("List"); - - var address = _addressService.GetAddressById(model.Address.Id); - if (address == null) - //No address found with the specified id - return RedirectToAction("Edit", new { id = customer.Id }); - - //custom address attributes - var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); - var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); - foreach (var error in customAttributeWarnings) - { - ModelState.AddModelError("", error); - } - - if (ModelState.IsValid) - { - address = model.Address.ToEntity(address); - address.CustomAttributes = customAttributes; - _addressService.UpdateAddress(address); - - SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Addresses.Updated")); - return RedirectToAction("AddressEdit", new { addressId = model.Address.Id, customerId = model.CustomerId }); - } - - //If we got this far, something failed, redisplay form - PrepareAddressModel(model, address, customer, true); - - return View(model); - } - - #endregion - - #region Orders - - [HttpPost] - public virtual ActionResult OrderList(int customerId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var orders = _orderService.SearchOrders(customerId: customerId); - - var gridModel = new DataSourceResult - { - Data = orders.PagedForCommand(command) - .Select(order => - { - var store = _storeService.GetStoreById(order.StoreId); - var orderModel = new CustomerModel.OrderModel - { - Id = order.Id, - OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), - OrderStatusId = order.OrderStatusId, - PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), - ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), - OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false), - StoreName = store != null ? store.Name : "Unknown", - CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), - CustomOrderNumber = order.CustomOrderNumber - }; - return orderModel; - }), - Total = orders.Count - }; - - - return Json(gridModel); - } - - #endregion - - #region Reports - - public virtual ActionResult Reports() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var model = new CustomerReportsModel(); - //customers by number of orders - model.BestCustomersByNumberOfOrders = new BestCustomersReportModel(); - model.BestCustomersByNumberOfOrders.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.BestCustomersByNumberOfOrders.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - model.BestCustomersByNumberOfOrders.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.BestCustomersByNumberOfOrders.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - model.BestCustomersByNumberOfOrders.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); - model.BestCustomersByNumberOfOrders.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //customers by order total - model.BestCustomersByOrderTotal = new BestCustomersReportModel(); - model.BestCustomersByOrderTotal.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.BestCustomersByOrderTotal.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - model.BestCustomersByOrderTotal.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.BestCustomersByOrderTotal.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - model.BestCustomersByOrderTotal.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); - model.BestCustomersByOrderTotal.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - return View(model); - } - - [HttpPost] - public virtual ActionResult ReportBestCustomersByOrderTotalList(DataSourceRequest command, BestCustomersReportModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; - PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; - ShippingStatus? shippingStatus = model.ShippingStatusId > 0 ? (ShippingStatus?)(model.ShippingStatusId) : null; - - - var items = _customerReportService.GetBestCustomersReport(startDateValue, endDateValue, - orderStatus, paymentStatus, shippingStatus, 1, command.Page - 1, command.PageSize); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - { - var m = new BestCustomerReportLineModel - { - CustomerId = x.CustomerId, - OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), - OrderCount = x.OrderCount, - }; - var customer = _customerService.GetCustomerById(x.CustomerId); - if (customer != null) - { - m.CustomerName = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); - } - return m; - }), - Total = items.TotalCount - }; - - return Json(gridModel); - } - [HttpPost] - public virtual ActionResult ReportBestCustomersByNumberOfOrdersList(DataSourceRequest command, BestCustomersReportModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; - PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; - ShippingStatus? shippingStatus = model.ShippingStatusId > 0 ? (ShippingStatus?)(model.ShippingStatusId) : null; - - - var items = _customerReportService.GetBestCustomersReport(startDateValue, endDateValue, - orderStatus, paymentStatus, shippingStatus, 2, command.Page - 1, command.PageSize); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - { - var m = new BestCustomerReportLineModel - { - CustomerId = x.CustomerId, - OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), - OrderCount = x.OrderCount, - }; - var customer = _customerService.GetCustomerById(x.CustomerId); - if (customer != null) - { - m.CustomerName = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); - } - return m; - }), - Total = items.TotalCount - }; - - return Json(gridModel); - } - - [ChildActionOnly] - public virtual ActionResult ReportRegisteredCustomers() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return Content(""); - - return PartialView(); - } - - [HttpPost] - public virtual ActionResult ReportRegisteredCustomersList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var model = GetReportRegisteredCustomersModel(); - var gridModel = new DataSourceResult - { - Data = model, - Total = model.Count - }; - - return Json(gridModel); - } - - [ChildActionOnly] - public virtual ActionResult CustomerStatistics() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - //a vendor doesn't have access to this report - if (_workContext.CurrentVendor != null) - return Content(""); - - return PartialView(); - } - - [AcceptVerbs(HttpVerbs.Get)] - public virtual ActionResult LoadCustomerStatistics(string period) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return Content(""); - - var result = new List(); - - var nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); - var timeZone = _dateTimeHelper.CurrentTimeZone; - var searchCustomerRoleIds = new[] { _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered).Id }; - - var culture = new CultureInfo(_workContext.WorkingLanguage.LanguageCulture); - - switch (period) - { - case "year": - //year statistics - var yearAgoDt = nowDt.AddYears(-1).AddMonths(1); - var searchYearDateUser = new DateTime(yearAgoDt.Year, yearAgoDt.Month, 1); - if (!timeZone.IsInvalidTime(searchYearDateUser)) - { - for (int i = 0; i <= 12; i++) - { - result.Add(new - { - date = searchYearDateUser.Date.ToString("Y", culture), - value = _customerService.GetAllCustomers( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser.AddMonths(1), timeZone), - customerRoleIds: searchCustomerRoleIds, - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchYearDateUser = searchYearDateUser.AddMonths(1); - } - } - break; - - case "month": - //month statistics - var monthAgoDt = nowDt.AddDays(-30); - var searchMonthDateUser = new DateTime(monthAgoDt.Year, monthAgoDt.Month, monthAgoDt.Day); - if (!timeZone.IsInvalidTime(searchMonthDateUser)) - { - for (int i = 0; i <= 30; i++) - { - result.Add(new - { - date = searchMonthDateUser.Date.ToString("M", culture), - value = _customerService.GetAllCustomers( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser.AddDays(1), timeZone), - customerRoleIds: searchCustomerRoleIds, - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchMonthDateUser = searchMonthDateUser.AddDays(1); - } - } - break; - - case "week": - default: - //week statistics - var weekAgoDt = nowDt.AddDays(-7); - var searchWeekDateUser = new DateTime(weekAgoDt.Year, weekAgoDt.Month, weekAgoDt.Day); - if (!timeZone.IsInvalidTime(searchWeekDateUser)) - { - for (int i = 0; i <= 7; i++) - { - result.Add(new - { - date = searchWeekDateUser.Date.ToString("d dddd", culture), - value = _customerService.GetAllCustomers( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser.AddDays(1), timeZone), - customerRoleIds: searchCustomerRoleIds, - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchWeekDateUser = searchWeekDateUser.AddDays(1); - } - } - break; - } - - return Json(result, JsonRequestBehavior.AllowGet); - } - - #endregion - - #region Current shopping cart/ wishlist - - [HttpPost] - public virtual ActionResult GetCartList(int customerId, int cartTypeId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var customer = _customerService.GetCustomerById(customerId); - var cart = customer.ShoppingCartItems.Where(x => x.ShoppingCartTypeId == cartTypeId).ToList(); - - var gridModel = new DataSourceResult - { - Data = cart.Select(sci => - { - decimal taxRate; - var store = _storeService.GetStoreById(sci.StoreId); - var sciModel = new ShoppingCartItemModel - { - Id = sci.Id, - Store = store != null ? store.Name : "Unknown", - ProductId = sci.ProductId, - Quantity = sci.Quantity, - ProductName = sci.Product.Name, - AttributeInfo = _productAttributeFormatter.FormatAttributes(sci.Product, sci.AttributesXml), - UnitPrice = _priceFormatter.FormatPrice(_taxService.GetProductPrice(sci.Product, _priceCalculationService.GetUnitPrice(sci), out taxRate)), - Total = _priceFormatter.FormatPrice(_taxService.GetProductPrice(sci.Product, _priceCalculationService.GetSubTotal(sci), out taxRate)), - UpdatedOn = _dateTimeHelper.ConvertToUserTime(sci.UpdatedOnUtc, DateTimeKind.Utc) - }; - return sciModel; - }), - Total = cart.Count - }; - - return Json(gridModel); - } - - #endregion - - #region Activity log - - [HttpPost] - public virtual ActionResult ListActivityLog(DataSourceRequest command, int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var activityLog = _customerActivityService.GetAllActivities(null, null, customerId, 0, command.Page - 1, command.PageSize); - var gridModel = new DataSourceResult - { - Data = activityLog.Select(x => - { - var m = new CustomerModel.ActivityLogModel - { - Id = x.Id, - ActivityLogTypeName = x.ActivityLogType.Name, - Comment = x.Comment, - CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc), - IpAddress = x.IpAddress - }; - return m; - - }), - Total = activityLog.TotalCount - }; - - return Json(gridModel); - } - - #endregion - - #region Back in stock subscriptions - - [HttpPost] - public virtual ActionResult BackInStockSubscriptionList(DataSourceRequest command, int customerId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedKendoGridJson(); - - var subscriptions = _backInStockSubscriptionService.GetAllSubscriptionsByCustomerId(customerId, - 0, command.Page - 1, command.PageSize); - var gridModel = new DataSourceResult - { - Data = subscriptions.Select(x => - { - var store = _storeService.GetStoreById(x.StoreId); - var product = x.Product; - var m = new CustomerModel.BackInStockSubscriptionModel - { - Id = x.Id, - StoreName = store != null ? store.Name : "Unknown", - ProductId = x.ProductId, - ProductName = product != null ? product.Name : "Unknown", - CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc) - }; - return m; - - }), - Total = subscriptions.TotalCount - }; - - return Json(gridModel); - } - - #endregion - - #region Export / Import - - [HttpPost, ActionName("List")] - [FormValueRequired("exportexcel-all")] - public virtual ActionResult ExportExcelAll(CustomerListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var searchDayOfBirth = 0; - int searchMonthOfBirth = 0; - if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) - searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); - if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) - searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); - - var customers = _customerService.GetAllCustomers( - customerRoleIds: model.SearchCustomerRoleIds.ToArray(), - email: model.SearchEmail, - username: model.SearchUsername, - firstName: model.SearchFirstName, - lastName: model.SearchLastName, - dayOfBirth: searchDayOfBirth, - monthOfBirth: searchMonthOfBirth, - company: model.SearchCompany, - phone: model.SearchPhone, - zipPostalCode: model.SearchZipPostalCode, - loadOnlyWithShoppingCart: false); - - try - { - byte[] bytes = _exportManager.ExportCustomersToXlsx(customers); - return File(bytes, MimeTypes.TextXlsx, "customers.xlsx"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - [HttpPost] - public virtual ActionResult ExportExcelSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customers = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - customers.AddRange(_customerService.GetCustomersByIds(ids)); - } - - try - { - byte[] bytes = _exportManager.ExportCustomersToXlsx(customers); - return File(bytes, MimeTypes.TextXlsx, "customers.xlsx"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - [HttpPost, ActionName("List")] - [FormValueRequired("exportxml-all")] - public virtual ActionResult ExportXmlAll(CustomerListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var searchDayOfBirth = 0; - int searchMonthOfBirth = 0; - if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) - searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); - if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) - searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); - - var customers = _customerService.GetAllCustomers( - customerRoleIds: model.SearchCustomerRoleIds.ToArray(), - email: model.SearchEmail, - username: model.SearchUsername, - firstName: model.SearchFirstName, - lastName: model.SearchLastName, - dayOfBirth: searchDayOfBirth, - monthOfBirth: searchMonthOfBirth, - company: model.SearchCompany, - phone: model.SearchPhone, - zipPostalCode: model.SearchZipPostalCode, - loadOnlyWithShoppingCart: false); - - try - { - var xml = _exportManager.ExportCustomersToXml(customers); - return new XmlDownloadResult(xml, "customers.xml"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - [HttpPost] - public virtual ActionResult ExportXmlSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) - return AccessDeniedView(); - - var customers = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - customers.AddRange(_customerService.GetCustomersByIds(ids)); - } - - var xml = _exportManager.ExportCustomersToXml(customers); - return new XmlDownloadResult(xml, "customers.xml"); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Web.Mvc; +using Nop.Admin.Extensions; +using Nop.Admin.Helpers; +using Nop.Admin.Models.Common; +using Nop.Admin.Models.Customers; +using Nop.Admin.Models.ShoppingCart; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Forums; +using Nop.Core.Domain.Messages; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Services; +using Nop.Services.Affiliates; +using Nop.Services.Authentication.External; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.ExportImport; +using Nop.Services.Forums; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Messages; +using Nop.Services.Orders; +using Nop.Services.Security; +using Nop.Services.Stores; +using Nop.Services.Tax; +using Nop.Services.Vendors; +using Nop.Web.Framework; +using Nop.Web.Framework.Controllers; +using Nop.Web.Framework.Kendoui; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Controllers +{ + public partial class CustomerController : BaseAdminController + { + #region Fields + + private readonly ICustomerService _customerService; + private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService; + private readonly IGenericAttributeService _genericAttributeService; + private readonly ICustomerRegistrationService _customerRegistrationService; + private readonly ICustomerReportService _customerReportService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly ILocalizationService _localizationService; + private readonly DateTimeSettings _dateTimeSettings; + private readonly TaxSettings _taxSettings; + private readonly RewardPointsSettings _rewardPointsSettings; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly IAddressService _addressService; + private readonly CustomerSettings _customerSettings; + private readonly ITaxService _taxService; + private readonly IWorkContext _workContext; + private readonly IVendorService _vendorService; + private readonly IStoreContext _storeContext; + private readonly IPriceFormatter _priceFormatter; + private readonly IOrderService _orderService; + private readonly IExportManager _exportManager; + private readonly ICustomerActivityService _customerActivityService; + private readonly IBackInStockSubscriptionService _backInStockSubscriptionService; + private readonly IPriceCalculationService _priceCalculationService; + private readonly IProductAttributeFormatter _productAttributeFormatter; + private readonly IPermissionService _permissionService; + private readonly IQueuedEmailService _queuedEmailService; + private readonly EmailAccountSettings _emailAccountSettings; + private readonly IEmailAccountService _emailAccountService; + private readonly ForumSettings _forumSettings; + private readonly IForumService _forumService; + private readonly IOpenAuthenticationService _openAuthenticationService; + private readonly AddressSettings _addressSettings; + private readonly IStoreService _storeService; + private readonly ICustomerAttributeParser _customerAttributeParser; + private readonly ICustomerAttributeService _customerAttributeService; + private readonly IAddressAttributeParser _addressAttributeParser; + private readonly IAddressAttributeService _addressAttributeService; + private readonly IAddressAttributeFormatter _addressAttributeFormatter; + private readonly IAffiliateService _affiliateService; + private readonly IWorkflowMessageService _workflowMessageService; + private readonly IRewardPointService _rewardPointService; + private readonly ICacheManager _cacheManager; + + #endregion + + #region Constructors + + public CustomerController(ICustomerService customerService, + INewsLetterSubscriptionService newsLetterSubscriptionService, + IGenericAttributeService genericAttributeService, + ICustomerRegistrationService customerRegistrationService, + ICustomerReportService customerReportService, + IDateTimeHelper dateTimeHelper, + ILocalizationService localizationService, + DateTimeSettings dateTimeSettings, + TaxSettings taxSettings, + RewardPointsSettings rewardPointsSettings, + ICountryService countryService, + IStateProvinceService stateProvinceService, + IAddressService addressService, + CustomerSettings customerSettings, + ITaxService taxService, + IWorkContext workContext, + IVendorService vendorService, + IStoreContext storeContext, + IPriceFormatter priceFormatter, + IOrderService orderService, + IExportManager exportManager, + ICustomerActivityService customerActivityService, + IBackInStockSubscriptionService backInStockSubscriptionService, + IPriceCalculationService priceCalculationService, + IProductAttributeFormatter productAttributeFormatter, + IPermissionService permissionService, + IQueuedEmailService queuedEmailService, + EmailAccountSettings emailAccountSettings, + IEmailAccountService emailAccountService, + ForumSettings forumSettings, + IForumService forumService, + IOpenAuthenticationService openAuthenticationService, + AddressSettings addressSettings, + IStoreService storeService, + ICustomerAttributeParser customerAttributeParser, + ICustomerAttributeService customerAttributeService, + IAddressAttributeParser addressAttributeParser, + IAddressAttributeService addressAttributeService, + IAddressAttributeFormatter addressAttributeFormatter, + IAffiliateService affiliateService, + IWorkflowMessageService workflowMessageService, + IRewardPointService rewardPointService, + ICacheManager cacheManager) + { + this._customerService = customerService; + this._newsLetterSubscriptionService = newsLetterSubscriptionService; + this._genericAttributeService = genericAttributeService; + this._customerRegistrationService = customerRegistrationService; + this._customerReportService = customerReportService; + this._dateTimeHelper = dateTimeHelper; + this._localizationService = localizationService; + this._dateTimeSettings = dateTimeSettings; + this._taxSettings = taxSettings; + this._rewardPointsSettings = rewardPointsSettings; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._addressService = addressService; + this._customerSettings = customerSettings; + this._taxService = taxService; + this._workContext = workContext; + this._vendorService = vendorService; + this._storeContext = storeContext; + this._priceFormatter = priceFormatter; + this._orderService = orderService; + this._exportManager = exportManager; + this._customerActivityService = customerActivityService; + this._backInStockSubscriptionService = backInStockSubscriptionService; + this._priceCalculationService = priceCalculationService; + this._productAttributeFormatter = productAttributeFormatter; + this._permissionService = permissionService; + this._queuedEmailService = queuedEmailService; + this._emailAccountSettings = emailAccountSettings; + this._emailAccountService = emailAccountService; + this._forumSettings = forumSettings; + this._forumService = forumService; + this._openAuthenticationService = openAuthenticationService; + this._addressSettings = addressSettings; + this._storeService = storeService; + this._customerAttributeParser = customerAttributeParser; + this._customerAttributeService = customerAttributeService; + this._addressAttributeParser = addressAttributeParser; + this._addressAttributeService = addressAttributeService; + this._addressAttributeFormatter = addressAttributeFormatter; + this._affiliateService = affiliateService; + this._workflowMessageService = workflowMessageService; + this._rewardPointService = rewardPointService; + this._cacheManager = cacheManager; + } + + #endregion + + #region Utilities + + [NonAction] + protected virtual string GetCustomerRolesNames(IList customerRoles, string separator = ",") + { + var sb = new StringBuilder(); + for (int i = 0; i < customerRoles.Count; i++) + { + sb.Append(customerRoles[i].Name); + if (i != customerRoles.Count - 1) + { + sb.Append(separator); + sb.Append(" "); + } + } + return sb.ToString(); + } + + [NonAction] + protected virtual IList GetReportRegisteredCustomersModel() + { + var report = new List(); + report.Add(new RegisteredCustomerReportLineModel + { + Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.7days"), + Customers = _customerReportService.GetRegisteredCustomersReport(7) + }); + + report.Add(new RegisteredCustomerReportLineModel + { + Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.14days"), + Customers = _customerReportService.GetRegisteredCustomersReport(14) + }); + report.Add(new RegisteredCustomerReportLineModel + { + Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.month"), + Customers = _customerReportService.GetRegisteredCustomersReport(30) + }); + report.Add(new RegisteredCustomerReportLineModel + { + Period = _localizationService.GetResource("Admin.Customers.Reports.RegisteredCustomers.Fields.Period.year"), + Customers = _customerReportService.GetRegisteredCustomersReport(365) + }); + + return report; + } + + [NonAction] + protected virtual IList GetAssociatedExternalAuthRecords(Customer customer) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + var result = new List(); + foreach (var record in _openAuthenticationService.GetExternalIdentifiersFor(customer)) + { + var method = _openAuthenticationService.LoadExternalAuthenticationMethodBySystemName(record.ProviderSystemName); + if (method == null) + continue; + + result.Add(new CustomerModel.AssociatedExternalAuthModel + { + Id = record.Id, + Email = record.Email, + ExternalIdentifier = record.ExternalIdentifier, + AuthMethodName = method.PluginDescriptor.FriendlyName + }); + } + + return result; + } + + [NonAction] + protected virtual CustomerModel PrepareCustomerModelForList(Customer customer) + { + return new CustomerModel + { + Id = customer.Id, + Email = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"), + Username = customer.Username, + FullName = customer.GetFullName(), + Company = customer.GetAttribute(SystemCustomerAttributeNames.Company), + Phone = customer.GetAttribute(SystemCustomerAttributeNames.Phone), + ZipPostalCode = customer.GetAttribute(SystemCustomerAttributeNames.ZipPostalCode), + CustomerRoleNames = GetCustomerRolesNames(customer.CustomerRoles.ToList()), + Active = customer.Active, + CreatedOn = _dateTimeHelper.ConvertToUserTime(customer.CreatedOnUtc, DateTimeKind.Utc), + LastActivityDate = _dateTimeHelper.ConvertToUserTime(customer.LastActivityDateUtc, DateTimeKind.Utc), + }; + } + + [NonAction] + protected virtual string ValidateCustomerRoles(IList customerRoles) + { + if (customerRoles == null) + throw new ArgumentNullException("customerRoles"); + + //ensure a customer is not added to both 'Guests' and 'Registered' customer roles + //ensure that a customer is in at least one required role ('Guests' and 'Registered') + bool isInGuestsRole = customerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Guests) != null; + bool isInRegisteredRole = customerRoles.FirstOrDefault(cr => cr.SystemName == SystemCustomerRoleNames.Registered) != null; + if (isInGuestsRole && isInRegisteredRole) + return _localizationService.GetResource("Admin.Customers.Customers.GuestsAndRegisteredRolesError"); + if (!isInGuestsRole && !isInRegisteredRole) + return _localizationService.GetResource("Admin.Customers.Customers.AddCustomerToGuestsOrRegisteredRoleError"); + + //no errors + return ""; + } + + [NonAction] + protected virtual void PrepareVendorsModel(CustomerModel model) + { + if (model == null) + throw new ArgumentNullException("model"); + + model.AvailableVendors.Add(new SelectListItem + { + Text = _localizationService.GetResource("Admin.Customers.Customers.Fields.Vendor.None"), + Value = "0" + }); + var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); + foreach (var v in vendors) + model.AvailableVendors.Add(v); + } + + [NonAction] + protected virtual void PrepareCustomerAttributeModel(CustomerModel model, Customer customer) + { + var customerAttributes = _customerAttributeService.GetAllCustomerAttributes(); + foreach (var attribute in customerAttributes) + { + var attributeModel = new CustomerModel.CustomerAttributeModel + { + Id = attribute.Id, + Name = attribute.Name, + IsRequired = attribute.IsRequired, + AttributeControlType = attribute.AttributeControlType, + }; + + if (attribute.ShouldHaveValues()) + { + //values + var attributeValues = _customerAttributeService.GetCustomerAttributeValues(attribute.Id); + foreach (var attributeValue in attributeValues) + { + var attributeValueModel = new CustomerModel.CustomerAttributeValueModel + { + Id = attributeValue.Id, + Name = attributeValue.Name, + IsPreSelected = attributeValue.IsPreSelected + }; + attributeModel.Values.Add(attributeValueModel); + } + } + + + //set already selected attributes + if (customer != null) + { + var selectedCustomerAttributes = customer.GetAttribute(SystemCustomerAttributeNames.CustomCustomerAttributes, _genericAttributeService); + switch (attribute.AttributeControlType) + { + case AttributeControlType.DropdownList: + case AttributeControlType.RadioList: + case AttributeControlType.Checkboxes: + { + if (!String.IsNullOrEmpty(selectedCustomerAttributes)) + { + //clear default selection + foreach (var item in attributeModel.Values) + item.IsPreSelected = false; + + //select new values + var selectedValues = _customerAttributeParser.ParseCustomerAttributeValues(selectedCustomerAttributes); + foreach (var attributeValue in selectedValues) + foreach (var item in attributeModel.Values) + if (attributeValue.Id == item.Id) + item.IsPreSelected = true; + } + } + break; + case AttributeControlType.ReadonlyCheckboxes: + { + //do nothing + //values are already pre-set + } + break; + case AttributeControlType.TextBox: + case AttributeControlType.MultilineTextbox: + { + if (!String.IsNullOrEmpty(selectedCustomerAttributes)) + { + var enteredText = _customerAttributeParser.ParseValues(selectedCustomerAttributes, attribute.Id); + if (enteredText.Any()) + attributeModel.DefaultValue = enteredText[0]; + } + } + break; + case AttributeControlType.Datepicker: + case AttributeControlType.ColorSquares: + case AttributeControlType.ImageSquares: + case AttributeControlType.FileUpload: + default: + //not supported attribute control types + break; + } + } + + model.CustomerAttributes.Add(attributeModel); + } + } + + [NonAction] + protected virtual string ParseCustomCustomerAttributes( FormCollection form) + { + if (form == null) + throw new ArgumentNullException("form"); + + string attributesXml = ""; + var customerAttributes = _customerAttributeService.GetAllCustomerAttributes(); + foreach (var attribute in customerAttributes) + { + string controlId = string.Format("customer_attribute_{0}", attribute.Id); + switch (attribute.AttributeControlType) + { + case AttributeControlType.DropdownList: + case AttributeControlType.RadioList: + { + var ctrlAttributes = form[controlId]; + if (!String.IsNullOrEmpty(ctrlAttributes)) + { + int selectedAttributeId = int.Parse(ctrlAttributes); + if (selectedAttributeId > 0) + attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, + attribute, selectedAttributeId.ToString()); + } + } + break; + case AttributeControlType.Checkboxes: + { + var cblAttributes = form[controlId]; + if (!String.IsNullOrEmpty(cblAttributes)) + { + foreach (var item in cblAttributes.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)) + { + int selectedAttributeId = int.Parse(item); + if (selectedAttributeId > 0) + attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, + attribute, selectedAttributeId.ToString()); + } + } + } + break; + case AttributeControlType.ReadonlyCheckboxes: + { + //load read-only (already server-side selected) values + var attributeValues = _customerAttributeService.GetCustomerAttributeValues(attribute.Id); + foreach (var selectedAttributeId in attributeValues + .Where(v => v.IsPreSelected) + .Select(v => v.Id) + .ToList()) + { + attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, + attribute, selectedAttributeId.ToString()); + } + } + break; + case AttributeControlType.TextBox: + case AttributeControlType.MultilineTextbox: + { + var ctrlAttributes = form[controlId]; + if (!String.IsNullOrEmpty(ctrlAttributes)) + { + string enteredText = ctrlAttributes.Trim(); + attributesXml = _customerAttributeParser.AddCustomerAttribute(attributesXml, + attribute, enteredText); + } + } + break; + case AttributeControlType.Datepicker: + case AttributeControlType.ColorSquares: + case AttributeControlType.ImageSquares: + case AttributeControlType.FileUpload: + //not supported customer attributes + default: + break; + } + } + + return attributesXml; + } + + [NonAction] + protected virtual void PrepareCustomerModel(CustomerModel model, Customer customer, bool excludeProperties) + { + var allStores = _storeService.GetAllStores(); + if (customer != null) + { + model.Id = customer.Id; + if (!excludeProperties) + { + model.Email = customer.Email; + model.Username = customer.Username; + model.VendorId = customer.VendorId; + model.AdminComment = customer.AdminComment; + model.IsTaxExempt = customer.IsTaxExempt; + model.Active = customer.Active; + + if (customer.RegisteredInStoreId == 0 || allStores.All(s => s.Id != customer.RegisteredInStoreId)) + model.RegisteredInStore = string.Empty; + else + model.RegisteredInStore = allStores.First(s => s.Id == customer.RegisteredInStoreId).Name; + + var affiliate = _affiliateService.GetAffiliateById(customer.AffiliateId); + if (affiliate != null) + { + model.AffiliateId = affiliate.Id; + model.AffiliateName = affiliate.GetFullName(); + } + + model.TimeZoneId = customer.GetAttribute(SystemCustomerAttributeNames.TimeZoneId); + model.VatNumber = customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); + model.VatNumberStatusNote = ((VatNumberStatus)customer.GetAttribute(SystemCustomerAttributeNames.VatNumberStatusId)) + .GetLocalizedEnum(_localizationService, _workContext); + model.CreatedOn = _dateTimeHelper.ConvertToUserTime(customer.CreatedOnUtc, DateTimeKind.Utc); + model.LastActivityDate = _dateTimeHelper.ConvertToUserTime(customer.LastActivityDateUtc, DateTimeKind.Utc); + model.LastIpAddress = customer.LastIpAddress; + model.LastVisitedPage = customer.GetAttribute(SystemCustomerAttributeNames.LastVisitedPage); + + model.SelectedCustomerRoleIds = customer.CustomerRoles.Select(cr => cr.Id).ToList(); + + //newsletter subscriptions + if (!String.IsNullOrEmpty(customer.Email)) + { + var newsletterSubscriptionStoreIds = new List(); + foreach (var store in allStores) + { + var newsletterSubscription = _newsLetterSubscriptionService + .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); + if (newsletterSubscription != null) + newsletterSubscriptionStoreIds.Add(store.Id); + model.SelectedNewsletterSubscriptionStoreIds = newsletterSubscriptionStoreIds.ToArray(); + } + } + + //form fields + model.FirstName = customer.GetAttribute(SystemCustomerAttributeNames.FirstName); + model.LastName = customer.GetAttribute(SystemCustomerAttributeNames.LastName); + model.Gender = customer.GetAttribute(SystemCustomerAttributeNames.Gender); + model.DateOfBirth = customer.GetAttribute(SystemCustomerAttributeNames.DateOfBirth); + model.Company = customer.GetAttribute(SystemCustomerAttributeNames.Company); + model.StreetAddress = customer.GetAttribute(SystemCustomerAttributeNames.StreetAddress); + model.StreetAddress2 = customer.GetAttribute(SystemCustomerAttributeNames.StreetAddress2); + model.ZipPostalCode = customer.GetAttribute(SystemCustomerAttributeNames.ZipPostalCode); + model.City = customer.GetAttribute(SystemCustomerAttributeNames.City); + model.CountryId = customer.GetAttribute(SystemCustomerAttributeNames.CountryId); + model.StateProvinceId = customer.GetAttribute(SystemCustomerAttributeNames.StateProvinceId); + model.Phone = customer.GetAttribute(SystemCustomerAttributeNames.Phone); + model.Fax = customer.GetAttribute(SystemCustomerAttributeNames.Fax); + } + } + + model.UsernamesEnabled = _customerSettings.UsernamesEnabled; + model.AllowCustomersToSetTimeZone = _dateTimeSettings.AllowCustomersToSetTimeZone; + foreach (var tzi in _dateTimeHelper.GetSystemTimeZones()) + model.AvailableTimeZones.Add(new SelectListItem { Text = tzi.DisplayName, Value = tzi.Id, Selected = (tzi.Id == model.TimeZoneId) }); + if (customer != null) + { + model.DisplayVatNumber = _taxSettings.EuVatEnabled; + } + else + { + model.DisplayVatNumber = false; + } + + //vendors + PrepareVendorsModel(model); + //customer attributes + PrepareCustomerAttributeModel(model, customer); + + model.GenderEnabled = _customerSettings.GenderEnabled; + model.DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled; + model.CompanyEnabled = _customerSettings.CompanyEnabled; + model.StreetAddressEnabled = _customerSettings.StreetAddressEnabled; + model.StreetAddress2Enabled = _customerSettings.StreetAddress2Enabled; + model.ZipPostalCodeEnabled = _customerSettings.ZipPostalCodeEnabled; + model.CityEnabled = _customerSettings.CityEnabled; + model.CountryEnabled = _customerSettings.CountryEnabled; + model.StateProvinceEnabled = _customerSettings.StateProvinceEnabled; + model.PhoneEnabled = _customerSettings.PhoneEnabled; + model.FaxEnabled = _customerSettings.FaxEnabled; + + //countries and states + if (_customerSettings.CountryEnabled) + { + model.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + { + model.AvailableCountries.Add(new SelectListItem + { + Text = c.Name, + Value = c.Id.ToString(), + Selected = c.Id == model.CountryId + }); + } + + if (_customerSettings.StateProvinceEnabled) + { + //states + var states = _stateProvinceService.GetStateProvincesByCountryId(model.CountryId).ToList(); + if (states.Any()) + { + model.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectState"), Value = "0" }); + + foreach (var s in states) + { + model.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.StateProvinceId) }); + } + } + else + { + bool anyCountrySelected = model.AvailableCountries.Any(x => x.Selected); + + model.AvailableStates.Add(new SelectListItem + { + Text = _localizationService.GetResource(anyCountrySelected ? "Admin.Address.OtherNonUS" : "Admin.Address.SelectState"), + Value = "0" + }); + } + } + } + + //newsletter subscriptions + model.AvailableNewsletterSubscriptionStores = allStores + .Select(s => new CustomerModel.StoreModel() {Id = s.Id, Name = s.Name }) + .ToList(); + + //customer roles + var allRoles = _customerService.GetAllCustomerRoles(true); + var adminRole = allRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered); + //precheck Registered Role as a default role while creating a new customer through admin + if (customer == null && adminRole != null) + { + model.SelectedCustomerRoleIds.Add(adminRole.Id); + } + foreach (var role in allRoles) + { + model.AvailableCustomerRoles.Add(new SelectListItem + { + Text = role.Name, + Value = role.Id.ToString(), + Selected = model.SelectedCustomerRoleIds.Contains(role.Id) + }); + } + + //reward points history + if (customer != null) + { + model.DisplayRewardPointsHistory = _rewardPointsSettings.Enabled; + model.AddRewardPointsValue = 0; + model.AddRewardPointsValuePurchased = 0; + model.AddRewardPointsMessage = "Some comment here..."; + + //stores + foreach (var store in allStores) + { + model.RewardPointsAvailableStores.Add(new SelectListItem + { + Text = store.Name, + Value = store.Id.ToString(), + Selected = (store.Id == _storeContext.CurrentStore.Id) + }); + } + } + else + { + model.DisplayRewardPointsHistory = false; + } + //external authentication records + if (customer != null) + { + model.AssociatedExternalAuthRecords = GetAssociatedExternalAuthRecords(customer); + } + //sending of the welcome message: + //1. "admin approval" registration method + //2. already created customer + //3. registered + model.AllowSendingOfWelcomeMessage = _customerSettings.UserRegistrationType == UserRegistrationType.AdminApproval && + customer != null && + customer.IsRegistered(); + //sending of the activation message + //1. "email validation" registration method + //2. already created customer + //3. registered + //4. not active + model.AllowReSendingOfActivationMessage = _customerSettings.UserRegistrationType == UserRegistrationType.EmailValidation && + customer != null && + customer.IsRegistered() && + !customer.Active; + } + + [NonAction] + protected virtual void PrepareAddressModel(CustomerAddressModel model, Address address, Customer customer, bool excludeProperties) + { + if (customer == null) + throw new ArgumentNullException("customer"); + + model.CustomerId = customer.Id; + if (address != null) + { + if (!excludeProperties) + { + model.Address = address.ToModel(); + } + } + + if (model.Address == null) + model.Address = new AddressModel(); + + model.Address.FirstNameEnabled = true; + model.Address.FirstNameRequired = true; + model.Address.LastNameEnabled = true; + model.Address.LastNameRequired = true; + model.Address.EmailEnabled = true; + model.Address.EmailRequired = true; + model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; + model.Address.CompanyRequired = _addressSettings.CompanyRequired; + model.Address.CountryEnabled = _addressSettings.CountryEnabled; + model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled + model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; + model.Address.StateProvinceRequired = _addressSettings.StateProvinceEnabled; //province is required when enabled + model.Address.CityEnabled = _addressSettings.CityEnabled; + model.Address.CityRequired = _addressSettings.CityRequired; + model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; + model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; + model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; + model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; + model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; + model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; + model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; + model.Address.PhoneRequired = _addressSettings.PhoneRequired; + model.Address.FaxEnabled = _addressSettings.FaxEnabled; + model.Address.FaxRequired = _addressSettings.FaxRequired; + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); + //states + var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + //customer attribute services + model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); + } + + [NonAction] + private bool SecondAdminAccountExists(Customer customer) + { + var customers = _customerService.GetAllCustomers(customerRoleIds: new[] {_customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Administrators).Id}); + + return customers.Any(c => c.Active && c.Id != customer.Id); + } + #endregion + + #region Customers + + public virtual ActionResult Index() + { + return RedirectToAction("List"); + } + + public virtual ActionResult List() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + //load registered customers by default + var defaultRoleIds = new List {_customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered).Id}; + var model = new CustomerListModel + { + UsernamesEnabled = _customerSettings.UsernamesEnabled, + DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled, + CompanyEnabled = _customerSettings.CompanyEnabled, + PhoneEnabled = _customerSettings.PhoneEnabled, + ZipPostalCodeEnabled = _customerSettings.ZipPostalCodeEnabled, + SearchCustomerRoleIds = defaultRoleIds, + }; + var allRoles = _customerService.GetAllCustomerRoles(true); + foreach (var role in allRoles) + { + model.AvailableCustomerRoles.Add(new SelectListItem + { + Text = role.Name, + Value = role.Id.ToString(), + Selected = defaultRoleIds.Any(x => x == role.Id) + }); + } + + return View(model); + } + + [HttpPost] + public virtual ActionResult CustomerList(DataSourceRequest command, CustomerListModel model, + [ModelBinder(typeof(CommaSeparatedModelBinder))] int[] searchCustomerRoleIds) + { + //we use own own binder for searchCustomerRoleIds property + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var searchDayOfBirth = 0; + int searchMonthOfBirth = 0; + if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) + searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); + if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) + searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); + + var customers = _customerService.GetAllCustomers( + customerRoleIds: searchCustomerRoleIds, + email: model.SearchEmail, + username: model.SearchUsername, + firstName: model.SearchFirstName, + lastName: model.SearchLastName, + dayOfBirth: searchDayOfBirth, + monthOfBirth: searchMonthOfBirth, + company: model.SearchCompany, + phone: model.SearchPhone, + zipPostalCode: model.SearchZipPostalCode, + ipAddress: model.SearchIpAddress, + loadOnlyWithShoppingCart: false, + pageIndex: command.Page - 1, + pageSize: command.PageSize); + var gridModel = new DataSourceResult + { + Data = customers.Select(PrepareCustomerModelForList), + Total = customers.TotalCount + }; + + return Json(gridModel); + } + + public virtual ActionResult Create() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var model = new CustomerModel(); + PrepareCustomerModel(model, null, false); + //default value + model.Active = true; + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + [FormValueRequired("save", "save-continue")] + [ValidateInput(false)] + public virtual ActionResult Create(CustomerModel model, bool continueEditing, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + if (!String.IsNullOrWhiteSpace(model.Email)) + { + var cust2 = _customerService.GetCustomerByEmail(model.Email); + if (cust2 != null) + ModelState.AddModelError("", "Email is already registered"); + } + if (!String.IsNullOrWhiteSpace(model.Username) & _customerSettings.UsernamesEnabled) + { + var cust2 = _customerService.GetCustomerByUsername(model.Username); + if (cust2 != null) + ModelState.AddModelError("", "Username is already registered"); + } + + //validate customer roles + var allCustomerRoles = _customerService.GetAllCustomerRoles(true); + var newCustomerRoles = new List(); + foreach (var customerRole in allCustomerRoles) + if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) + newCustomerRoles.Add(customerRole); + var customerRolesError = ValidateCustomerRoles(newCustomerRoles); + if (!String.IsNullOrEmpty(customerRolesError)) + { + ModelState.AddModelError("", customerRolesError); + ErrorNotification(customerRolesError, false); + } + + // Ensure that valid email address is entered if Registered role is checked to avoid registered customers with empty email address + if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null && !CommonHelper.IsValidEmail(model.Email)) + { + ModelState.AddModelError("", _localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole")); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole"), false); + } + + //custom customer attributes + var customerAttributesXml = ParseCustomCustomerAttributes(form); + if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null) + { + var customerAttributeWarnings = _customerAttributeParser.GetAttributeWarnings(customerAttributesXml); + foreach (var error in customerAttributeWarnings) + { + ModelState.AddModelError("", error); + } + } + + if (ModelState.IsValid) + { + var customer = new Customer + { + CustomerGuid = Guid.NewGuid(), + Email = model.Email, + Username = model.Username, + VendorId = model.VendorId, + AdminComment = model.AdminComment, + IsTaxExempt = model.IsTaxExempt, + Active = model.Active, + CreatedOnUtc = DateTime.UtcNow, + LastActivityDateUtc = DateTime.UtcNow, + RegisteredInStoreId = _storeContext.CurrentStore.Id + }; + _customerService.InsertCustomer(customer); + + //form fields + if (_dateTimeSettings.AllowCustomersToSetTimeZone) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.TimeZoneId, model.TimeZoneId); + if (_customerSettings.GenderEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender); + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.FirstName, model.FirstName); + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.LastName, model.LastName); + if (_customerSettings.DateOfBirthEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.DateOfBirth, model.DateOfBirth); + if (_customerSettings.CompanyEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Company, model.Company); + if (_customerSettings.StreetAddressEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress, model.StreetAddress); + if (_customerSettings.StreetAddress2Enabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress2, model.StreetAddress2); + if (_customerSettings.ZipPostalCodeEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.ZipPostalCode, model.ZipPostalCode); + if (_customerSettings.CityEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.City, model.City); + if (_customerSettings.CountryEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CountryId, model.CountryId); + if (_customerSettings.CountryEnabled && _customerSettings.StateProvinceEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StateProvinceId, model.StateProvinceId); + if (_customerSettings.PhoneEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Phone, model.Phone); + if (_customerSettings.FaxEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Fax, model.Fax); + + //custom customer attributes + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CustomCustomerAttributes, customerAttributesXml); + + + //newsletter subscriptions + if (!String.IsNullOrEmpty(customer.Email)) + { + var allStores = _storeService.GetAllStores(); + foreach (var store in allStores) + { + var newsletterSubscription = _newsLetterSubscriptionService + .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); + if (model.SelectedNewsletterSubscriptionStoreIds != null && + model.SelectedNewsletterSubscriptionStoreIds.Contains(store.Id)) + { + //subscribed + if (newsletterSubscription == null) + { + _newsLetterSubscriptionService.InsertNewsLetterSubscription(new NewsLetterSubscription + { + NewsLetterSubscriptionGuid = Guid.NewGuid(), + Email = customer.Email, + Active = true, + StoreId = store.Id, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + else + { + //not subscribed + if (newsletterSubscription != null) + { + _newsLetterSubscriptionService.DeleteNewsLetterSubscription(newsletterSubscription); + } + } + } + } + + //password + if (!String.IsNullOrWhiteSpace(model.Password)) + { + var changePassRequest = new ChangePasswordRequest(model.Email, false, _customerSettings.DefaultPasswordFormat, model.Password); + var changePassResult = _customerRegistrationService.ChangePassword(changePassRequest); + if (!changePassResult.Success) + { + foreach (var changePassError in changePassResult.Errors) + ErrorNotification(changePassError); + } + } + + //customer roles + foreach (var customerRole in newCustomerRoles) + { + //ensure that the current customer cannot add to "Administrators" system role if he's not an admin himself + if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && + !_workContext.CurrentCustomer.IsAdmin()) + continue; + + customer.CustomerRoles.Add(customerRole); + } + _customerService.UpdateCustomer(customer); + + + //ensure that a customer with a vendor associated is not in "Administrators" role + //otherwise, he won't have access to other functionality in admin area + if (customer.IsAdmin() && customer.VendorId > 0) + { + customer.VendorId = 0; + _customerService.UpdateCustomer(customer); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminCouldNotbeVendor")); + } + + //ensure that a customer in the Vendors role has a vendor account associated. + //otherwise, he will have access to ALL products + if (customer.IsVendor() && customer.VendorId == 0) + { + var vendorRole = customer + .CustomerRoles + .FirstOrDefault(x => x.SystemName == SystemCustomerRoleNames.Vendors); + customer.CustomerRoles.Remove(vendorRole); + _customerService.UpdateCustomer(customer); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.CannotBeInVendoRoleWithoutVendorAssociated")); + } + + //activity log + _customerActivityService.InsertActivity("AddNewCustomer", _localizationService.GetResource("ActivityLog.AddNewCustomer"), customer.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Added")); + + if (continueEditing) + { + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("Edit", new {id = customer.Id}); + } + return RedirectToAction("List"); + } + + //If we got this far, something failed, redisplay form + PrepareCustomerModel(model, null, true); + return View(model); + } + + public virtual ActionResult Edit(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(id); + if (customer == null || customer.Deleted) + //No customer found with the specified id + return RedirectToAction("List"); + + var model = new CustomerModel(); + PrepareCustomerModel(model, customer, false); + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + [FormValueRequired("save", "save-continue")] + [ValidateInput(false)] + public virtual ActionResult Edit(CustomerModel model, bool continueEditing, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null || customer.Deleted) + //No customer found with the specified id + return RedirectToAction("List"); + + //validate customer roles + var allCustomerRoles = _customerService.GetAllCustomerRoles(true); + var newCustomerRoles = new List(); + foreach (var customerRole in allCustomerRoles) + if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) + newCustomerRoles.Add(customerRole); + var customerRolesError = ValidateCustomerRoles(newCustomerRoles); + if (!String.IsNullOrEmpty(customerRolesError)) + { + ModelState.AddModelError("", customerRolesError); + ErrorNotification(customerRolesError, false); + } + + // Ensure that valid email address is entered if Registered role is checked to avoid registered customers with empty email address + if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null && !CommonHelper.IsValidEmail(model.Email)) + { + ModelState.AddModelError("", _localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole")); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.ValidEmailRequiredRegisteredRole"), false); + } + + //custom customer attributes + var customerAttributesXml = ParseCustomCustomerAttributes(form); + if (newCustomerRoles.Any() && newCustomerRoles.FirstOrDefault(c => c.SystemName == SystemCustomerRoleNames.Registered) != null) + { + var customerAttributeWarnings = _customerAttributeParser.GetAttributeWarnings(customerAttributesXml); + foreach (var error in customerAttributeWarnings) + { + ModelState.AddModelError("", error); + } + } + + if (ModelState.IsValid) + { + try + { + customer.AdminComment = model.AdminComment; + customer.IsTaxExempt = model.IsTaxExempt; + + //prevent deactivation of the last active administrator + if (!customer.IsAdmin() || model.Active || SecondAdminAccountExists(customer)) + customer.Active = model.Active; + else + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.Deactivate")); + + //email + if (!String.IsNullOrWhiteSpace(model.Email)) + { + _customerRegistrationService.SetEmail(customer, model.Email, false); + } + else + { + customer.Email = model.Email; + } + + //username + if (_customerSettings.UsernamesEnabled) + { + if (!String.IsNullOrWhiteSpace(model.Username)) + { + _customerRegistrationService.SetUsername(customer, model.Username); + } + else + { + customer.Username = model.Username; + } + } + + //VAT number + if (_taxSettings.EuVatEnabled) + { + var prevVatNumber = customer.GetAttribute(SystemCustomerAttributeNames.VatNumber); + + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.VatNumber, model.VatNumber); + //set VAT number status + if (!String.IsNullOrEmpty(model.VatNumber)) + { + if (!model.VatNumber.Equals(prevVatNumber, StringComparison.InvariantCultureIgnoreCase)) + { + _genericAttributeService.SaveAttribute(customer, + SystemCustomerAttributeNames.VatNumberStatusId, + (int)_taxService.GetVatNumberStatus(model.VatNumber)); + } + } + else + { + _genericAttributeService.SaveAttribute(customer, + SystemCustomerAttributeNames.VatNumberStatusId, + (int)VatNumberStatus.Empty); + } + } + + //vendor + customer.VendorId = model.VendorId; + + //form fields + if (_dateTimeSettings.AllowCustomersToSetTimeZone) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.TimeZoneId, model.TimeZoneId); + if (_customerSettings.GenderEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender); + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.FirstName, model.FirstName); + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.LastName, model.LastName); + if (_customerSettings.DateOfBirthEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.DateOfBirth, model.DateOfBirth); + if (_customerSettings.CompanyEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Company, model.Company); + if (_customerSettings.StreetAddressEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress, model.StreetAddress); + if (_customerSettings.StreetAddress2Enabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StreetAddress2, model.StreetAddress2); + if (_customerSettings.ZipPostalCodeEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.ZipPostalCode, model.ZipPostalCode); + if (_customerSettings.CityEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.City, model.City); + if (_customerSettings.CountryEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CountryId, model.CountryId); + if (_customerSettings.CountryEnabled && _customerSettings.StateProvinceEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.StateProvinceId, model.StateProvinceId); + if (_customerSettings.PhoneEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Phone, model.Phone); + if (_customerSettings.FaxEnabled) + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Fax, model.Fax); + + //custom customer attributes + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.CustomCustomerAttributes, customerAttributesXml); + + //newsletter subscriptions + if (!String.IsNullOrEmpty(customer.Email)) + { + var allStores = _storeService.GetAllStores(); + foreach (var store in allStores) + { + var newsletterSubscription = _newsLetterSubscriptionService + .GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); + if (model.SelectedNewsletterSubscriptionStoreIds != null && + model.SelectedNewsletterSubscriptionStoreIds.Contains(store.Id)) + { + //subscribed + if (newsletterSubscription == null) + { + _newsLetterSubscriptionService.InsertNewsLetterSubscription(new NewsLetterSubscription + { + NewsLetterSubscriptionGuid = Guid.NewGuid(), + Email = customer.Email, + Active = true, + StoreId = store.Id, + CreatedOnUtc = DateTime.UtcNow + }); + } + } + else + { + //not subscribed + if (newsletterSubscription != null) + { + _newsLetterSubscriptionService.DeleteNewsLetterSubscription(newsletterSubscription); + } + } + } + } + + + //customer roles + foreach (var customerRole in allCustomerRoles) + { + //ensure that the current customer cannot add/remove to/from "Administrators" system role + //if he's not an admin himself + if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && + !_workContext.CurrentCustomer.IsAdmin()) + continue; + + if (model.SelectedCustomerRoleIds.Contains(customerRole.Id)) + { + //new role + if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) == 0) + customer.CustomerRoles.Add(customerRole); + } + else + { + //prevent attempts to delete the administrator role from the user, if the user is the last active administrator + if (customerRole.SystemName == SystemCustomerRoleNames.Administrators && !SecondAdminAccountExists(customer)) + { + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.DeleteRole")); + continue; + } + + //remove role + if (customer.CustomerRoles.Count(cr => cr.Id == customerRole.Id) > 0) + customer.CustomerRoles.Remove(customerRole); + } + } + _customerService.UpdateCustomer(customer); + + + //ensure that a customer with a vendor associated is not in "Administrators" role + //otherwise, he won't have access to the other functionality in admin area + if (customer.IsAdmin() && customer.VendorId > 0) + { + customer.VendorId = 0; + _customerService.UpdateCustomer(customer); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminCouldNotbeVendor")); + } + + //ensure that a customer in the Vendors role has a vendor account associated. + //otherwise, he will have access to ALL products + if (customer.IsVendor() && customer.VendorId == 0) + { + var vendorRole = customer + .CustomerRoles + .FirstOrDefault(x => x.SystemName == SystemCustomerRoleNames.Vendors); + customer.CustomerRoles.Remove(vendorRole); + _customerService.UpdateCustomer(customer); + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.CannotBeInVendoRoleWithoutVendorAssociated")); + } + + + //activity log + _customerActivityService.InsertActivity("EditCustomer", _localizationService.GetResource("ActivityLog.EditCustomer"), customer.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Updated")); + if (continueEditing) + { + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("Edit", new {id = customer.Id}); + } + return RedirectToAction("List"); + } + catch (Exception exc) + { + ErrorNotification(exc.Message, false); + } + } + + + //If we got this far, something failed, redisplay form + PrepareCustomerModel(model, customer, true); + return View(model); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("changepassword")] + public virtual ActionResult ChangePassword(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + //ensure that the current customer cannot change passwords of "Administrators" if he's not an admin himself + if (customer.IsAdmin() && !_workContext.CurrentCustomer.IsAdmin()) + { + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.OnlyAdminCanChangePassword")); + return RedirectToAction("Edit", new { id = customer.Id }); + } + + if (ModelState.IsValid) + { + var changePassRequest = new ChangePasswordRequest(model.Email, + false, _customerSettings.DefaultPasswordFormat, model.Password); + var changePassResult = _customerRegistrationService.ChangePassword(changePassRequest); + if (changePassResult.Success) + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.PasswordChanged")); + else + foreach (var error in changePassResult.Errors) + ErrorNotification(error); + } + + return RedirectToAction("Edit", new {id = customer.Id}); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("markVatNumberAsValid")] + public virtual ActionResult MarkVatNumberAsValid(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + _genericAttributeService.SaveAttribute(customer, + SystemCustomerAttributeNames.VatNumberStatusId, + (int)VatNumberStatus.Valid); + + return RedirectToAction("Edit", new {id = customer.Id}); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("markVatNumberAsInvalid")] + public virtual ActionResult MarkVatNumberAsInvalid(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + _genericAttributeService.SaveAttribute(customer, + SystemCustomerAttributeNames.VatNumberStatusId, + (int)VatNumberStatus.Invalid); + + return RedirectToAction("Edit", new {id = customer.Id}); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("remove-affiliate")] + public virtual ActionResult RemoveAffiliate(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + customer.AffiliateId = 0; + _customerService.UpdateCustomer(customer); + + return RedirectToAction("Edit", new { id = customer.Id }); + } + + [HttpPost] + public virtual ActionResult Delete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + try + { + //prevent attempts to delete the user, if it is the last active administrator + if (customer.IsAdmin() && !SecondAdminAccountExists(customer)) + { + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.AdminAccountShouldExists.DeleteAdministrator")); + return RedirectToAction("Edit", new { id = customer.Id }); + } + + //ensure that the current customer cannot delete "Administrators" if he's not an admin himself + if (customer.IsAdmin() && !_workContext.CurrentCustomer.IsAdmin()) + { + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.OnlyAdminCanDeleteAdmin")); + return RedirectToAction("Edit", new { id = customer.Id }); + } + + //delete + _customerService.DeleteCustomer(customer); + + //remove newsletter subscription (if exists) + foreach (var store in _storeService.GetAllStores()) + { + var subscription = _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreId(customer.Email, store.Id); + if (subscription != null) + _newsLetterSubscriptionService.DeleteNewsLetterSubscription(subscription); + } + + //activity log + _customerActivityService.InsertActivity("DeleteCustomer", _localizationService.GetResource("ActivityLog.DeleteCustomer"), customer.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Deleted")); + return RedirectToAction("List"); + } + catch (Exception exc) + { + ErrorNotification(exc.Message); + return RedirectToAction("Edit", new { id = customer.Id }); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("impersonate")] + public virtual ActionResult Impersonate(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.AllowCustomerImpersonation)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + //ensure that a non-admin user cannot impersonate as an administrator + //otherwise, that user can simply impersonate as an administrator and gain additional administrative privileges + if (!_workContext.CurrentCustomer.IsAdmin() && customer.IsAdmin()) + { + ErrorNotification(_localizationService.GetResource("Admin.Customers.Customers.NonAdminNotImpersonateAsAdminError")); + return RedirectToAction("Edit", customer.Id); + } + + //activity log + _customerActivityService.InsertActivity("Impersonation.Started", _localizationService.GetResource("ActivityLog.Impersonation.Started.StoreOwner"), customer.Email, customer.Id); + _customerActivityService.InsertActivity(customer, "Impersonation.Started", _localizationService.GetResource("ActivityLog.Impersonation.Started.Customer"), _workContext.CurrentCustomer.Email, _workContext.CurrentCustomer.Id); + + //ensure login is not required + customer.RequireReLogin = false; + _customerService.UpdateCustomer(customer); + _genericAttributeService.SaveAttribute(_workContext.CurrentCustomer, SystemCustomerAttributeNames.ImpersonatedCustomerId, customer.Id); + + return RedirectToAction("Index", "Home", new { area = "" }); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("send-welcome-message")] + public virtual ActionResult SendWelcomeMessage(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + _workflowMessageService.SendCustomerWelcomeMessage(customer, _workContext.WorkingLanguage.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendWelcomeMessage.Success")); + + return RedirectToAction("Edit", new { id = customer.Id }); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("resend-activation-message")] + public virtual ActionResult ReSendActivationMessage(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + //email validation message + _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.AccountActivationToken, Guid.NewGuid().ToString()); + _workflowMessageService.SendCustomerEmailValidationMessage(customer, _workContext.WorkingLanguage.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.ReSendActivationMessage.Success")); + + return RedirectToAction("Edit", new { id = customer.Id }); + } + + public virtual ActionResult SendEmail(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + try + { + if (String.IsNullOrWhiteSpace(customer.Email)) + throw new NopException("Customer email is empty"); + if (!CommonHelper.IsValidEmail(customer.Email)) + throw new NopException("Customer email is not valid"); + if (String.IsNullOrWhiteSpace(model.SendEmail.Subject)) + throw new NopException("Email subject is empty"); + if (String.IsNullOrWhiteSpace(model.SendEmail.Body)) + throw new NopException("Email body is empty"); + + var emailAccount = _emailAccountService.GetEmailAccountById(_emailAccountSettings.DefaultEmailAccountId); + if (emailAccount == null) + emailAccount = _emailAccountService.GetAllEmailAccounts().FirstOrDefault(); + if (emailAccount == null) + throw new NopException("Email account can't be loaded"); + var email = new QueuedEmail + { + Priority = QueuedEmailPriority.High, + EmailAccountId = emailAccount.Id, + FromName = emailAccount.DisplayName, + From = emailAccount.Email, + ToName = customer.GetFullName(), + To = customer.Email, + Subject = model.SendEmail.Subject, + Body = model.SendEmail.Body, + CreatedOnUtc = DateTime.UtcNow, + DontSendBeforeDateUtc = (model.SendEmail.SendImmediately || !model.SendEmail.DontSendBeforeDate.HasValue) ? + null : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.SendEmail.DontSendBeforeDate.Value) + }; + _queuedEmailService.InsertQueuedEmail(email); + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendEmail.Queued")); + } + catch (Exception exc) + { + ErrorNotification(exc.Message); + } + + return RedirectToAction("Edit", new { id = customer.Id }); + } + + public virtual ActionResult SendPm(CustomerModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.Id); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + try + { + if (!_forumSettings.AllowPrivateMessages) + throw new NopException("Private messages are disabled"); + if (customer.IsGuest()) + throw new NopException("Customer should be registered"); + if (String.IsNullOrWhiteSpace(model.SendPm.Subject)) + throw new NopException("PM subject is empty"); + if (String.IsNullOrWhiteSpace(model.SendPm.Message)) + throw new NopException("PM message is empty"); + + + var privateMessage = new PrivateMessage + { + StoreId = _storeContext.CurrentStore.Id, + ToCustomerId = customer.Id, + FromCustomerId = _workContext.CurrentCustomer.Id, + Subject = model.SendPm.Subject, + Text = model.SendPm.Message, + IsDeletedByAuthor = false, + IsDeletedByRecipient = false, + IsRead = false, + CreatedOnUtc = DateTime.UtcNow + }; + + _forumService.InsertPrivateMessage(privateMessage); + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendPM.Sent")); + } + catch (Exception exc) + { + ErrorNotification(exc.Message); + } + + return RedirectToAction("Edit", new { id = customer.Id }); + } + + #endregion + + #region Reward points history + + [HttpPost] + public virtual ActionResult RewardPointsHistorySelect(DataSourceRequest command, int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + throw new ArgumentException("No customer found with the specified id"); + + var rewardPoints = _rewardPointService.GetRewardPointsHistory(customer.Id, true, true, command.Page - 1, command.PageSize); + var gridModel = new DataSourceResult + { + Data = rewardPoints.Select(rph => + { + var store = _storeService.GetStoreById(rph.StoreId); + var activatingDate = _dateTimeHelper.ConvertToUserTime(rph.CreatedOnUtc, DateTimeKind.Utc); + + return new CustomerModel.RewardPointsHistoryModel + { + Id = rph.Id, + StoreName = store != null ? store.Name : "Unknown", + Points = rph.Points, + PointsPurchased = rph.PointsPurchased, + PointsBalance = rph.PointsBalance.HasValue ? rph.PointsBalance.ToString() + : string.Format(_localizationService.GetResource("Admin.Customers.Customers.RewardPoints.ActivatedLater"), activatingDate), + PointsBalancePurchased = rph.PointsBalancePurchased.HasValue ? rph.PointsBalancePurchased.ToString() + : string.Format(_localizationService.GetResource("Admin.Customers.Customers.RewardPoints.ActivatedLater"), activatingDate), + Message = rph.Message, + CreatedOn = activatingDate + }; + }), + Total = rewardPoints.TotalCount + }; + + return Json(gridModel); + } + + [ValidateInput(false)] + public virtual ActionResult RewardPointsHistoryAdd(int customerId, int storeId, int[] addRewardPointsValue, string addRewardPointsMessage) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + return Json(new { Result = false }, JsonRequestBehavior.AllowGet); + + var addRewardPoints = new RewardPoints(_rewardPointService) + { + Points = addRewardPointsValue[0], + PointsPurchased = addRewardPointsValue[1], + }; + + _rewardPointService.AddRewardPointsHistoryEntry(customer, + addRewardPoints, storeId, addRewardPointsMessage); + + //activity log + _customerActivityService.InsertActivity("AddCustomerRewardPoints", _localizationService.GetResource("ActivityLog.AddCustomerRewardPoints"), addRewardPointsValue[0], addRewardPointsValue[1]); + + return Json(new { Result = true }, JsonRequestBehavior.AllowGet); + } + + [HttpPost] + [ValidateInput(false)] + public virtual ActionResult RewardPointsHistoryUpdate(CustomerModel.RewardPointsHistoryModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + if (model.Message != null) + model.Message = model.Message.Trim(); + + var rph = _rewardPointService.GetRewardPointsHistoryEntryById(model.Id); + if (rph == null) + return Content("No reward points history entry could be loaded with the specified ID"); + + rph.Message = model.Message; + + _rewardPointService.UpdateRewardPointsHistoryEntry(rph); + + //activity log + _customerActivityService.InsertActivity("EditCustomerRewardPoints", _localizationService.GetResource("ActivityLog.EditCustomerRewardPoints"), rph.Id); + + return new NullJsonResult(); + } + #endregion + + #region Addresses + + [HttpPost] + public virtual ActionResult AddressesSelect(int customerId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + throw new ArgumentException("No customer found with the specified id", "customerId"); + + var addresses = customer.Addresses.OrderByDescending(a => a.CreatedOnUtc).ThenByDescending(a => a.Id).ToList(); + var gridModel = new DataSourceResult + { + Data = addresses.Select(x => + { + var model = x.ToModel(); + var addressHtmlSb = new StringBuilder("
"); + if (_addressSettings.CompanyEnabled && !String.IsNullOrEmpty(model.Company)) + addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Company)); + if (_addressSettings.StreetAddressEnabled && !String.IsNullOrEmpty(model.Address1)) + addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Address1)); + if (_addressSettings.StreetAddress2Enabled && !String.IsNullOrEmpty(model.Address2)) + addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.Address2)); + if (_addressSettings.CityEnabled && !String.IsNullOrEmpty(model.City)) + addressHtmlSb.AppendFormat("{0},", Server.HtmlEncode(model.City)); + if (_addressSettings.StateProvinceEnabled && !String.IsNullOrEmpty(model.StateProvinceName)) + addressHtmlSb.AppendFormat("{0},", Server.HtmlEncode(model.StateProvinceName)); + if (_addressSettings.ZipPostalCodeEnabled && !String.IsNullOrEmpty(model.ZipPostalCode)) + addressHtmlSb.AppendFormat("{0}
", Server.HtmlEncode(model.ZipPostalCode)); + if (_addressSettings.CountryEnabled && !String.IsNullOrEmpty(model.CountryName)) + addressHtmlSb.AppendFormat("{0}", Server.HtmlEncode(model.CountryName)); + var customAttributesFormatted = _addressAttributeFormatter.FormatAttributes(x.CustomAttributes); + if (!String.IsNullOrEmpty(customAttributesFormatted)) + { + //already encoded + addressHtmlSb.AppendFormat("
{0}", customAttributesFormatted); + } + addressHtmlSb.Append("
"); + model.AddressHtml = addressHtmlSb.ToString(); + return model; + }), + Total = addresses.Count + }; + + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult AddressDelete(int id, int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + throw new ArgumentException("No customer found with the specified id", "customerId"); + + var address = customer.Addresses.FirstOrDefault(a => a.Id == id); + if (address == null) + //No customer found with the specified id + return Content("No customer found with the specified id"); + customer.RemoveAddress(address); + _customerService.UpdateCustomer(customer); + //now delete the address record + _addressService.DeleteAddress(address); + + return new NullJsonResult(); + } + + public virtual ActionResult AddressCreate(int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + var model = new CustomerAddressModel(); + PrepareAddressModel(model, null, customer, false); + + return View(model); + } + + [HttpPost] + [ValidateInput(false)] + public virtual ActionResult AddressCreate(CustomerAddressModel model, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.CustomerId); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + //custom address attributes + var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); + var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); + foreach (var error in customAttributeWarnings) + { + ModelState.AddModelError("", error); + } + + if (ModelState.IsValid) + { + var address = model.Address.ToEntity(); + address.CustomAttributes = customAttributes; + address.CreatedOnUtc = DateTime.UtcNow; + //some validation + if (address.CountryId == 0) + address.CountryId = null; + if (address.StateProvinceId == 0) + address.StateProvinceId = null; + customer.Addresses.Add(address); + _customerService.UpdateCustomer(customer); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Addresses.Added")); + return RedirectToAction("AddressEdit", new { addressId = address.Id, customerId = model.CustomerId }); + } + + //If we got this far, something failed, redisplay form + PrepareAddressModel(model, null, customer, true); + return View(model); + } + + public virtual ActionResult AddressEdit(int addressId, int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(customerId); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + var address = _addressService.GetAddressById(addressId); + if (address == null) + //No address found with the specified id + return RedirectToAction("Edit", new { id = customer.Id }); + + var model = new CustomerAddressModel(); + PrepareAddressModel(model, address, customer, false); + return View(model); + } + + [HttpPost] + [ValidateInput(false)] + public virtual ActionResult AddressEdit(CustomerAddressModel model, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customer = _customerService.GetCustomerById(model.CustomerId); + if (customer == null) + //No customer found with the specified id + return RedirectToAction("List"); + + var address = _addressService.GetAddressById(model.Address.Id); + if (address == null) + //No address found with the specified id + return RedirectToAction("Edit", new { id = customer.Id }); + + //custom address attributes + var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); + var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); + foreach (var error in customAttributeWarnings) + { + ModelState.AddModelError("", error); + } + + if (ModelState.IsValid) + { + address = model.Address.ToEntity(address); + address.CustomAttributes = customAttributes; + _addressService.UpdateAddress(address); + + SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.Addresses.Updated")); + return RedirectToAction("AddressEdit", new { addressId = model.Address.Id, customerId = model.CustomerId }); + } + + //If we got this far, something failed, redisplay form + PrepareAddressModel(model, address, customer, true); + + return View(model); + } + + #endregion + + #region Orders + + [HttpPost] + public virtual ActionResult OrderList(int customerId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var orders = _orderService.SearchOrders(customerId: customerId); + + var gridModel = new DataSourceResult + { + Data = orders.PagedForCommand(command) + .Select(order => + { + var store = _storeService.GetStoreById(order.StoreId); + var orderModel = new CustomerModel.OrderModel + { + Id = order.Id, + OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), + OrderStatusId = order.OrderStatusId, + PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), + ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), + OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false), + OrderTotalAmountIncl = _priceFormatter.FormatPrice(order.OrderTotalAmountIncl, true, false), + StoreName = store != null ? store.Name : "Unknown", + CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), + CustomOrderNumber = order.CustomOrderNumber + }; + return orderModel; + }), + Total = orders.Count + }; + + + return Json(gridModel); + } + + #endregion + + #region Reports + + public virtual ActionResult Reports() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var model = new CustomerReportsModel(); + //customers by number of orders + model.BestCustomersByNumberOfOrders = new BestCustomersReportModel(); + model.BestCustomersByNumberOfOrders.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.BestCustomersByNumberOfOrders.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + model.BestCustomersByNumberOfOrders.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.BestCustomersByNumberOfOrders.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + model.BestCustomersByNumberOfOrders.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); + model.BestCustomersByNumberOfOrders.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //customers by order total + model.BestCustomersByOrderTotal = new BestCustomersReportModel(); + model.BestCustomersByOrderTotal.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.BestCustomersByOrderTotal.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + model.BestCustomersByOrderTotal.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.BestCustomersByOrderTotal.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + model.BestCustomersByOrderTotal.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); + model.BestCustomersByOrderTotal.AvailableShippingStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + return View(model); + } + + [HttpPost] + public virtual ActionResult ReportBestCustomersByOrderTotalList(DataSourceRequest command, BestCustomersReportModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; + PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; + ShippingStatus? shippingStatus = model.ShippingStatusId > 0 ? (ShippingStatus?)(model.ShippingStatusId) : null; + + + var items = _customerReportService.GetBestCustomersReport(startDateValue, endDateValue, + orderStatus, paymentStatus, shippingStatus, 1, command.Page - 1, command.PageSize); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + { + var m = new BestCustomerReportLineModel + { + CustomerId = x.CustomerId, + OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), + OrderCount = x.OrderCount, + }; + var customer = _customerService.GetCustomerById(x.CustomerId); + if (customer != null) + { + m.CustomerName = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); + } + return m; + }), + Total = items.TotalCount + }; + + return Json(gridModel); + } + [HttpPost] + public virtual ActionResult ReportBestCustomersByNumberOfOrdersList(DataSourceRequest command, BestCustomersReportModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; + PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; + ShippingStatus? shippingStatus = model.ShippingStatusId > 0 ? (ShippingStatus?)(model.ShippingStatusId) : null; + + + var items = _customerReportService.GetBestCustomersReport(startDateValue, endDateValue, + orderStatus, paymentStatus, shippingStatus, 2, command.Page - 1, command.PageSize); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + { + var m = new BestCustomerReportLineModel + { + CustomerId = x.CustomerId, + OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), + OrderCount = x.OrderCount, + }; + var customer = _customerService.GetCustomerById(x.CustomerId); + if (customer != null) + { + m.CustomerName = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); + } + return m; + }), + Total = items.TotalCount + }; + + return Json(gridModel); + } + + [ChildActionOnly] + public virtual ActionResult ReportRegisteredCustomers() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return Content(""); + + return PartialView(); + } + + [HttpPost] + public virtual ActionResult ReportRegisteredCustomersList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var model = GetReportRegisteredCustomersModel(); + var gridModel = new DataSourceResult + { + Data = model, + Total = model.Count + }; + + return Json(gridModel); + } + + [ChildActionOnly] + public virtual ActionResult CustomerStatistics() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + //a vendor doesn't have access to this report + if (_workContext.CurrentVendor != null) + return Content(""); + + return PartialView(); + } + + [AcceptVerbs(HttpVerbs.Get)] + public virtual ActionResult LoadCustomerStatistics(string period) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return Content(""); + + var result = new List(); + + var nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); + var timeZone = _dateTimeHelper.CurrentTimeZone; + var searchCustomerRoleIds = new[] { _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered).Id }; + + var culture = new CultureInfo(_workContext.WorkingLanguage.LanguageCulture); + + switch (period) + { + case "year": + //year statistics + var yearAgoDt = nowDt.AddYears(-1).AddMonths(1); + var searchYearDateUser = new DateTime(yearAgoDt.Year, yearAgoDt.Month, 1); + if (!timeZone.IsInvalidTime(searchYearDateUser)) + { + for (int i = 0; i <= 12; i++) + { + result.Add(new + { + date = searchYearDateUser.Date.ToString("Y", culture), + value = _customerService.GetAllCustomers( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser.AddMonths(1), timeZone), + customerRoleIds: searchCustomerRoleIds, + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchYearDateUser = searchYearDateUser.AddMonths(1); + } + } + break; + + case "month": + //month statistics + var monthAgoDt = nowDt.AddDays(-30); + var searchMonthDateUser = new DateTime(monthAgoDt.Year, monthAgoDt.Month, monthAgoDt.Day); + if (!timeZone.IsInvalidTime(searchMonthDateUser)) + { + for (int i = 0; i <= 30; i++) + { + result.Add(new + { + date = searchMonthDateUser.Date.ToString("M", culture), + value = _customerService.GetAllCustomers( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser.AddDays(1), timeZone), + customerRoleIds: searchCustomerRoleIds, + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchMonthDateUser = searchMonthDateUser.AddDays(1); + } + } + break; + + case "week": + default: + //week statistics + var weekAgoDt = nowDt.AddDays(-7); + var searchWeekDateUser = new DateTime(weekAgoDt.Year, weekAgoDt.Month, weekAgoDt.Day); + if (!timeZone.IsInvalidTime(searchWeekDateUser)) + { + for (int i = 0; i <= 7; i++) + { + result.Add(new + { + date = searchWeekDateUser.Date.ToString("d dddd", culture), + value = _customerService.GetAllCustomers( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser.AddDays(1), timeZone), + customerRoleIds: searchCustomerRoleIds, + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchWeekDateUser = searchWeekDateUser.AddDays(1); + } + } + break; + } + + return Json(result, JsonRequestBehavior.AllowGet); + } + + #endregion + + #region Current shopping cart/ wishlist + + [HttpPost] + public virtual ActionResult GetCartList(int customerId, int cartTypeId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var customer = _customerService.GetCustomerById(customerId); + var cart = customer.ShoppingCartItems.Where(x => x.ShoppingCartTypeId == cartTypeId).ToList(); + + var gridModel = new DataSourceResult + { + Data = cart.Select(sci => + { + decimal taxRate; + var store = _storeService.GetStoreById(sci.StoreId); + var sciModel = new ShoppingCartItemModel + { + Id = sci.Id, + Store = store != null ? store.Name : "Unknown", + ProductId = sci.ProductId, + Quantity = sci.Quantity, + ProductName = sci.Product.Name, + AttributeInfo = _productAttributeFormatter.FormatAttributes(sci.Product, sci.AttributesXml), + UnitPrice = _priceFormatter.FormatPrice(_taxService.GetProductPrice(sci.Product, _priceCalculationService.GetUnitPrice(sci), out taxRate)), + Total = _priceFormatter.FormatPrice(_taxService.GetProductPrice(sci.Product, _priceCalculationService.GetSubTotal(sci), out taxRate)), + UpdatedOn = _dateTimeHelper.ConvertToUserTime(sci.UpdatedOnUtc, DateTimeKind.Utc) + }; + return sciModel; + }), + Total = cart.Count + }; + + return Json(gridModel); + } + + #endregion + + #region Activity log + + [HttpPost] + public virtual ActionResult ListActivityLog(DataSourceRequest command, int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var activityLog = _customerActivityService.GetAllActivities(null, null, customerId, 0, command.Page - 1, command.PageSize); + var gridModel = new DataSourceResult + { + Data = activityLog.Select(x => + { + var m = new CustomerModel.ActivityLogModel + { + Id = x.Id, + ActivityLogTypeName = x.ActivityLogType.Name, + Comment = x.Comment, + CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc), + IpAddress = x.IpAddress + }; + return m; + + }), + Total = activityLog.TotalCount + }; + + return Json(gridModel); + } + + #endregion + + #region Back in stock subscriptions + + [HttpPost] + public virtual ActionResult BackInStockSubscriptionList(DataSourceRequest command, int customerId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedKendoGridJson(); + + var subscriptions = _backInStockSubscriptionService.GetAllSubscriptionsByCustomerId(customerId, + 0, command.Page - 1, command.PageSize); + var gridModel = new DataSourceResult + { + Data = subscriptions.Select(x => + { + var store = _storeService.GetStoreById(x.StoreId); + var product = x.Product; + var m = new CustomerModel.BackInStockSubscriptionModel + { + Id = x.Id, + StoreName = store != null ? store.Name : "Unknown", + ProductId = x.ProductId, + ProductName = product != null ? product.Name : "Unknown", + CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc) + }; + return m; + + }), + Total = subscriptions.TotalCount + }; + + return Json(gridModel); + } + + #endregion + + #region Export / Import + + [HttpPost, ActionName("List")] + [FormValueRequired("exportexcel-all")] + public virtual ActionResult ExportExcelAll(CustomerListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var searchDayOfBirth = 0; + int searchMonthOfBirth = 0; + if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) + searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); + if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) + searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); + + var customers = _customerService.GetAllCustomers( + customerRoleIds: model.SearchCustomerRoleIds.ToArray(), + email: model.SearchEmail, + username: model.SearchUsername, + firstName: model.SearchFirstName, + lastName: model.SearchLastName, + dayOfBirth: searchDayOfBirth, + monthOfBirth: searchMonthOfBirth, + company: model.SearchCompany, + phone: model.SearchPhone, + zipPostalCode: model.SearchZipPostalCode, + loadOnlyWithShoppingCart: false); + + try + { + byte[] bytes = _exportManager.ExportCustomersToXlsx(customers); + return File(bytes, MimeTypes.TextXlsx, "customers.xlsx"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + [HttpPost] + public virtual ActionResult ExportExcelSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customers = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + customers.AddRange(_customerService.GetCustomersByIds(ids)); + } + + try + { + byte[] bytes = _exportManager.ExportCustomersToXlsx(customers); + return File(bytes, MimeTypes.TextXlsx, "customers.xlsx"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + [HttpPost, ActionName("List")] + [FormValueRequired("exportxml-all")] + public virtual ActionResult ExportXmlAll(CustomerListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var searchDayOfBirth = 0; + int searchMonthOfBirth = 0; + if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) + searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); + if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) + searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); + + var customers = _customerService.GetAllCustomers( + customerRoleIds: model.SearchCustomerRoleIds.ToArray(), + email: model.SearchEmail, + username: model.SearchUsername, + firstName: model.SearchFirstName, + lastName: model.SearchLastName, + dayOfBirth: searchDayOfBirth, + monthOfBirth: searchMonthOfBirth, + company: model.SearchCompany, + phone: model.SearchPhone, + zipPostalCode: model.SearchZipPostalCode, + loadOnlyWithShoppingCart: false); + + try + { + var xml = _exportManager.ExportCustomersToXml(customers); + return new XmlDownloadResult(xml, "customers.xml"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + [HttpPost] + public virtual ActionResult ExportXmlSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) + return AccessDeniedView(); + + var customers = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + customers.AddRange(_customerService.GetCustomersByIds(ids)); + } + + var xml = _exportManager.ExportCustomersToXml(customers); + return new XmlDownloadResult(xml, "customers.xml"); + } + + #endregion + } +} diff --git a/src/Presentation/Nop.Web/Administration/Controllers/OrderController.cs b/src/Presentation/Nop.Web/Administration/Controllers/OrderController.cs index 474ba14d068..e675be92548 100644 --- a/src/Presentation/Nop.Web/Administration/Controllers/OrderController.cs +++ b/src/Presentation/Nop.Web/Administration/Controllers/OrderController.cs @@ -1,4379 +1,4545 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Web.Mvc; -using Nop.Admin.Extensions; -using Nop.Admin.Helpers; -using Nop.Admin.Models.Orders; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Services; -using Nop.Services.Affiliates; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Directory; -using Nop.Services.Discounts; -using Nop.Services.ExportImport; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Media; -using Nop.Services.Messages; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Security; -using Nop.Services.Shipping; -using Nop.Services.Shipping.Tracking; -using Nop.Services.Stores; -using Nop.Services.Tax; -using Nop.Services.Vendors; -using Nop.Web.Framework.Controllers; -using Nop.Web.Framework.Kendoui; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Controllers -{ - public partial class OrderController : BaseAdminController - { - #region Fields - - private readonly IOrderService _orderService; - private readonly IOrderReportService _orderReportService; - private readonly IOrderProcessingService _orderProcessingService; - private readonly IReturnRequestService _returnRequestService; - private readonly IPriceCalculationService _priceCalculationService; - private readonly ITaxService _taxService; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly IPriceFormatter _priceFormatter; - private readonly IDiscountService _discountService; - private readonly ILocalizationService _localizationService; - private readonly IWorkContext _workContext; - private readonly ICurrencyService _currencyService; - private readonly IEncryptionService _encryptionService; - private readonly IPaymentService _paymentService; - private readonly IMeasureService _measureService; - private readonly IPdfService _pdfService; - private readonly IAddressService _addressService; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly IProductService _productService; - private readonly IExportManager _exportManager; - private readonly IPermissionService _permissionService; - private readonly IWorkflowMessageService _workflowMessageService; - private readonly ICategoryService _categoryService; - private readonly IManufacturerService _manufacturerService; - private readonly IProductAttributeService _productAttributeService; - private readonly IProductAttributeParser _productAttributeParser; - private readonly IProductAttributeFormatter _productAttributeFormatter; - private readonly IShoppingCartService _shoppingCartService; - private readonly IGiftCardService _giftCardService; - private readonly IDownloadService _downloadService; - private readonly IShipmentService _shipmentService; - private readonly IShippingService _shippingService; - private readonly IStoreService _storeService; - private readonly IVendorService _vendorService; - private readonly IAddressAttributeParser _addressAttributeParser; - private readonly IAddressAttributeService _addressAttributeService; - private readonly IAddressAttributeFormatter _addressAttributeFormatter; - private readonly IAffiliateService _affiliateService; - private readonly IPictureService _pictureService; - private readonly ICustomerActivityService _customerActivityService; - private readonly ICacheManager _cacheManager; - - private readonly OrderSettings _orderSettings; - private readonly CurrencySettings _currencySettings; - private readonly TaxSettings _taxSettings; - private readonly MeasureSettings _measureSettings; - private readonly AddressSettings _addressSettings; - private readonly ShippingSettings _shippingSettings; - - #endregion - - #region Ctor - - public OrderController(IOrderService orderService, - IOrderReportService orderReportService, - IOrderProcessingService orderProcessingService, - IReturnRequestService returnRequestService, - IPriceCalculationService priceCalculationService, - ITaxService taxService, - IDateTimeHelper dateTimeHelper, - IPriceFormatter priceFormatter, - IDiscountService discountService, - ILocalizationService localizationService, - IWorkContext workContext, - ICurrencyService currencyService, - IEncryptionService encryptionService, - IPaymentService paymentService, - IMeasureService measureService, - IPdfService pdfService, - IAddressService addressService, - ICountryService countryService, - IStateProvinceService stateProvinceService, - IProductService productService, - IExportManager exportManager, - IPermissionService permissionService, - IWorkflowMessageService workflowMessageService, - ICategoryService categoryService, - IManufacturerService manufacturerService, - IProductAttributeService productAttributeService, - IProductAttributeParser productAttributeParser, - IProductAttributeFormatter productAttributeFormatter, - IShoppingCartService shoppingCartService, - IGiftCardService giftCardService, - IDownloadService downloadService, - IShipmentService shipmentService, - IShippingService shippingService, - IStoreService storeService, - IVendorService vendorService, - IAddressAttributeParser addressAttributeParser, - IAddressAttributeService addressAttributeService, - IAddressAttributeFormatter addressAttributeFormatter, - IAffiliateService affiliateService, - IPictureService pictureService, - ICustomerActivityService customerActivityService, - ICacheManager cacheManager, - OrderSettings orderSettings, - CurrencySettings currencySettings, - TaxSettings taxSettings, - MeasureSettings measureSettings, - AddressSettings addressSettings, - ShippingSettings shippingSettings) - { - this._orderService = orderService; - this._orderReportService = orderReportService; - this._orderProcessingService = orderProcessingService; - this._returnRequestService = returnRequestService; - this._priceCalculationService = priceCalculationService; - this._taxService = taxService; - this._dateTimeHelper = dateTimeHelper; - this._priceFormatter = priceFormatter; - this._discountService = discountService; - this._localizationService = localizationService; - this._workContext = workContext; - this._currencyService = currencyService; - this._encryptionService = encryptionService; - this._paymentService = paymentService; - this._measureService = measureService; - this._pdfService = pdfService; - this._addressService = addressService; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._productService = productService; - this._exportManager = exportManager; - this._permissionService = permissionService; - this._workflowMessageService = workflowMessageService; - this._categoryService = categoryService; - this._manufacturerService = manufacturerService; - this._productAttributeService = productAttributeService; - this._productAttributeParser = productAttributeParser; - this._productAttributeFormatter = productAttributeFormatter; - this._shoppingCartService = shoppingCartService; - this._giftCardService = giftCardService; - this._downloadService = downloadService; - this._shipmentService = shipmentService; - this._shippingService = shippingService; - this._storeService = storeService; - this._vendorService = vendorService; - this._addressAttributeParser = addressAttributeParser; - this._addressAttributeService = addressAttributeService; - this._addressAttributeFormatter = addressAttributeFormatter; - this._affiliateService = affiliateService; - this._pictureService = pictureService; - this._customerActivityService = customerActivityService; - this._cacheManager = cacheManager; - this._orderSettings = orderSettings; - this._currencySettings = currencySettings; - this._taxSettings = taxSettings; - this._measureSettings = measureSettings; - this._addressSettings = addressSettings; - this._shippingSettings = shippingSettings; - } - - #endregion - - #region Utilities - - [NonAction] - protected virtual bool HasAccessToOrder(Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (_workContext.CurrentVendor == null) - //not a vendor; has access - return true; - - var vendorId = _workContext.CurrentVendor.Id; - var hasVendorProducts = order.OrderItems.Any(orderItem => orderItem.Product.VendorId == vendorId); - return hasVendorProducts; - } - - [NonAction] - protected virtual bool HasAccessToOrderItem(OrderItem orderItem) - { - if (orderItem == null) - throw new ArgumentNullException("orderItem"); - - if (_workContext.CurrentVendor == null) - //not a vendor; has access - return true; - - var vendorId = _workContext.CurrentVendor.Id; - return orderItem.Product.VendorId == vendorId; - } - - [NonAction] - protected virtual bool HasAccessToProduct(Product product) - { - if (product == null) - throw new ArgumentNullException("product"); - - if (_workContext.CurrentVendor == null) - //not a vendor; has access - return true; - - var vendorId = _workContext.CurrentVendor.Id; - return product.VendorId == vendorId; - } - - [NonAction] - protected virtual bool HasAccessToShipment(Shipment shipment) - { - if (shipment == null) - throw new ArgumentNullException("shipment"); - - if (_workContext.CurrentVendor == null) - //not a vendor; has access - return true; - - var hasVendorProducts = false; - var vendorId = _workContext.CurrentVendor.Id; - foreach (var shipmentItem in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); - if (orderItem != null) - { - if (orderItem.Product.VendorId == vendorId) - { - hasVendorProducts = true; - break; - } - } - } - return hasVendorProducts; - } - - /// - /// Parse product attributes on the add product to order details page - /// - /// Product - /// Form - /// Errors - /// Parsed attributes - [NonAction] - protected virtual string ParseProductAttributes(Product product, FormCollection form, List errors) - { - var attributesXml = string.Empty; - - #region Product attributes - - var productAttributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); - foreach (var attribute in productAttributes) - { - var controlId = string.Format("product_attribute_{0}", attribute.Id); - switch (attribute.AttributeControlType) - { - case AttributeControlType.DropdownList: - case AttributeControlType.RadioList: - case AttributeControlType.ColorSquares: - case AttributeControlType.ImageSquares: - { - var ctrlAttributes = form[controlId]; - if (!String.IsNullOrEmpty(ctrlAttributes)) - { - int selectedAttributeId = int.Parse(ctrlAttributes); - if (selectedAttributeId > 0) - { - //get quantity entered by customer - var quantity = 1; - var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, selectedAttributeId)]; - if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) - errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); - - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); - } - } - } - break; - case AttributeControlType.Checkboxes: - { - var ctrlAttributes = form[controlId]; - if (!String.IsNullOrEmpty(ctrlAttributes)) - { - foreach (var item in ctrlAttributes.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) - { - int selectedAttributeId = int.Parse(item); - if (selectedAttributeId > 0) - { - //get quantity entered by customer - var quantity = 1; - var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, item)]; - if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) - errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); - - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); - } - } - } - } - break; - case AttributeControlType.ReadonlyCheckboxes: - { - //load read-only (already server-side selected) values - var attributeValues = _productAttributeService.GetProductAttributeValues(attribute.Id); - foreach (var selectedAttributeId in attributeValues - .Where(v => v.IsPreSelected) - .Select(v => v.Id) - .ToList()) - { - //get quantity entered by customer - var quantity = 1; - var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, selectedAttributeId)]; - if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) - errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); - - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); - } - } - break; - case AttributeControlType.TextBox: - case AttributeControlType.MultilineTextbox: - { - var ctrlAttributes = form[controlId]; - if (!String.IsNullOrEmpty(ctrlAttributes)) - { - string enteredText = ctrlAttributes.Trim(); - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, enteredText); - } - } - break; - case AttributeControlType.Datepicker: - { - var day = form[controlId + "_day"]; - var month = form[controlId + "_month"]; - var year = form[controlId + "_year"]; - DateTime? selectedDate = null; - try - { - selectedDate = new DateTime(Int32.Parse(year), Int32.Parse(month), Int32.Parse(day)); - } - catch { } - if (selectedDate.HasValue) - { - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, selectedDate.Value.ToString("D")); - } - } - break; - case AttributeControlType.FileUpload: - { - Guid downloadGuid; - Guid.TryParse(form[controlId], out downloadGuid); - var download = _downloadService.GetDownloadByGuid(downloadGuid); - if (download != null) - { - attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, - attribute, download.DownloadGuid.ToString()); - } - } - break; - default: - break; - } - } - //validate conditional attributes (if specified) - foreach (var attribute in productAttributes) - { - var conditionMet = _productAttributeParser.IsConditionMet(attribute, attributesXml); - if (conditionMet.HasValue && !conditionMet.Value) - { - attributesXml = _productAttributeParser.RemoveProductAttribute(attributesXml, attribute); - } - } - - #endregion - - return attributesXml; - } - - /// - /// Parse rental dates on the add product to order details page - /// - /// Form - /// Start date - /// End date - [NonAction] - protected virtual void ParseRentalDates(FormCollection form, - out DateTime? startDate, out DateTime? endDate) - { - startDate = null; - endDate = null; - - var ctrlStartDate = form["rental_start_date"]; - var ctrlEndDate = form["rental_end_date"]; - try - { - const string datePickerFormat = "MM/dd/yyyy"; - startDate = DateTime.ParseExact(ctrlStartDate, datePickerFormat, CultureInfo.InvariantCulture); - endDate = DateTime.ParseExact(ctrlEndDate, datePickerFormat, CultureInfo.InvariantCulture); - } - catch - { - } - } - - [NonAction] - protected virtual void PrepareOrderDetailsModel(OrderModel model, Order order) - { - if (order == null) - throw new ArgumentNullException("order"); - - if (model == null) - throw new ArgumentNullException("model"); - - model.Id = order.Id; - model.OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext); - model.OrderStatusId = order.OrderStatusId; - model.OrderGuid = order.OrderGuid; - model.CustomOrderNumber = order.CustomOrderNumber; - var store = _storeService.GetStoreById(order.StoreId); - model.StoreName = store != null ? store.Name : "Unknown"; - model.CustomerId = order.CustomerId; - var customer = order.Customer; - model.CustomerInfo = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); - model.CustomerIp = order.CustomerIp; - model.VatNumber = order.VatNumber; - model.CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc); - model.AllowCustomersToSelectTaxDisplayType = _taxSettings.AllowCustomersToSelectTaxDisplayType; - model.TaxDisplayType = _taxSettings.TaxDisplayType; - - var affiliate = _affiliateService.GetAffiliateById(order.AffiliateId); - if (affiliate != null) - { - model.AffiliateId = affiliate.Id; - model.AffiliateName = affiliate.GetFullName(); - } - - //a vendor should have access only to his products - model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; - //custom values - model.CustomValues = order.DeserializeCustomValues(); - - #region Order totals - - var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - if (primaryStoreCurrency == null) - throw new Exception("Cannot load primary store currency"); - - //subtotal - model.OrderSubtotalInclTax = _priceFormatter.FormatPrice(order.OrderSubtotalInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); - model.OrderSubtotalExclTax = _priceFormatter.FormatPrice(order.OrderSubtotalExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); - model.OrderSubtotalInclTaxValue = order.OrderSubtotalInclTax; - model.OrderSubtotalExclTaxValue = order.OrderSubtotalExclTax; - //discount (applied to order subtotal) - string orderSubtotalDiscountInclTaxStr = _priceFormatter.FormatPrice(order.OrderSubTotalDiscountInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); - string orderSubtotalDiscountExclTaxStr = _priceFormatter.FormatPrice(order.OrderSubTotalDiscountExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); - if (order.OrderSubTotalDiscountInclTax > decimal.Zero) - model.OrderSubTotalDiscountInclTax = orderSubtotalDiscountInclTaxStr; - if (order.OrderSubTotalDiscountExclTax > decimal.Zero) - model.OrderSubTotalDiscountExclTax = orderSubtotalDiscountExclTaxStr; - model.OrderSubTotalDiscountInclTaxValue = order.OrderSubTotalDiscountInclTax; - model.OrderSubTotalDiscountExclTaxValue = order.OrderSubTotalDiscountExclTax; - - //shipping - model.OrderShippingInclTax = _priceFormatter.FormatShippingPrice(order.OrderShippingInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); - model.OrderShippingExclTax = _priceFormatter.FormatShippingPrice(order.OrderShippingExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); - model.OrderShippingInclTaxValue = order.OrderShippingInclTax; - model.OrderShippingExclTaxValue = order.OrderShippingExclTax; - - //payment method additional fee - if (order.PaymentMethodAdditionalFeeInclTax > decimal.Zero) - { - model.PaymentMethodAdditionalFeeInclTax = _priceFormatter.FormatPaymentMethodAdditionalFee(order.PaymentMethodAdditionalFeeInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); - model.PaymentMethodAdditionalFeeExclTax = _priceFormatter.FormatPaymentMethodAdditionalFee(order.PaymentMethodAdditionalFeeExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); - } - model.PaymentMethodAdditionalFeeInclTaxValue = order.PaymentMethodAdditionalFeeInclTax; - model.PaymentMethodAdditionalFeeExclTaxValue = order.PaymentMethodAdditionalFeeExclTax; - - - //tax - model.Tax = _priceFormatter.FormatPrice(order.OrderTax, true, false); - SortedDictionary taxRates = order.TaxRatesDictionary; - bool displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); - bool displayTax = !displayTaxRates; - foreach (var tr in order.TaxRatesDictionary) - { - model.TaxRates.Add(new OrderModel.TaxRate - { - Rate = _priceFormatter.FormatTaxRate(tr.Key), - Value = _priceFormatter.FormatPrice(tr.Value, true, false), - }); - } - model.DisplayTaxRates = displayTaxRates; - model.DisplayTax = displayTax; - model.TaxValue = order.OrderTax; - model.TaxRatesValue = order.TaxRates; - - //discount - if (order.OrderDiscount > 0) - model.OrderTotalDiscount = _priceFormatter.FormatPrice(-order.OrderDiscount, true, false); - model.OrderTotalDiscountValue = order.OrderDiscount; - - //gift cards - foreach (var gcuh in order.GiftCardUsageHistory) - { - model.GiftCards.Add(new OrderModel.GiftCard - { - CouponCode = gcuh.GiftCard.GiftCardCouponCode, - Amount = _priceFormatter.FormatPrice(-gcuh.UsedValue, true, false), - }); - } - - //reward points - if (order.RedeemedRewardPointsEntry != null) - { - model.RedeemedRewardPoints = -order.RedeemedRewardPointsEntry.Points; - model.RedeemedRewardPointsAmount = _priceFormatter.FormatPrice(-order.RedeemedRewardPointsEntry.UsedAmount, true, false); - } - - //total - model.OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false); - model.OrderTotalValue = order.OrderTotal; - - //refunded amount - if (order.RefundedAmount > decimal.Zero) - model.RefundedAmount = _priceFormatter.FormatPrice(order.RefundedAmount, true, false); - - //used discounts - var duh = _discountService.GetAllDiscountUsageHistory(orderId: order.Id); - foreach (var d in duh) - { - model.UsedDiscounts.Add(new OrderModel.UsedDiscountModel - { - DiscountId = d.DiscountId, - DiscountName = d.Discount.Name - }); - } - - //profit (hide for vendors) - if (_workContext.CurrentVendor == null) - { - var profit = _orderReportService.ProfitReport(orderId: order.Id); - model.Profit = _priceFormatter.FormatPrice(profit, true, false); - } - - #endregion - - #region Payment info - - if (order.AllowStoringCreditCardNumber) - { - //card type - model.CardType = _encryptionService.DecryptText(order.CardType); - //cardholder name - model.CardName = _encryptionService.DecryptText(order.CardName); - //card number - model.CardNumber = _encryptionService.DecryptText(order.CardNumber); - //cvv - model.CardCvv2 = _encryptionService.DecryptText(order.CardCvv2); - //expiry date - string cardExpirationMonthDecrypted = _encryptionService.DecryptText(order.CardExpirationMonth); - if (!String.IsNullOrEmpty(cardExpirationMonthDecrypted) && cardExpirationMonthDecrypted != "0") - model.CardExpirationMonth = cardExpirationMonthDecrypted; - string cardExpirationYearDecrypted = _encryptionService.DecryptText(order.CardExpirationYear); - if (!String.IsNullOrEmpty(cardExpirationYearDecrypted) && cardExpirationYearDecrypted != "0") - model.CardExpirationYear = cardExpirationYearDecrypted; - - model.AllowStoringCreditCardNumber = true; - } - else - { - string maskedCreditCardNumberDecrypted = _encryptionService.DecryptText(order.MaskedCreditCardNumber); - if (!String.IsNullOrEmpty(maskedCreditCardNumberDecrypted)) - model.CardNumber = maskedCreditCardNumberDecrypted; - } - - - //payment transaction info - model.AuthorizationTransactionId = order.AuthorizationTransactionId; - model.CaptureTransactionId = order.CaptureTransactionId; - model.SubscriptionTransactionId = order.SubscriptionTransactionId; - - //payment method info - var pm = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); - model.PaymentMethod = pm != null ? pm.PluginDescriptor.FriendlyName : order.PaymentMethodSystemName; - model.PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext); - - //payment method buttons - model.CanCancelOrder = _orderProcessingService.CanCancelOrder(order); - model.CanCapture = _orderProcessingService.CanCapture(order); - model.CanMarkOrderAsPaid = _orderProcessingService.CanMarkOrderAsPaid(order); - model.CanRefund = _orderProcessingService.CanRefund(order); - model.CanRefundOffline = _orderProcessingService.CanRefundOffline(order); - model.CanPartiallyRefund = _orderProcessingService.CanPartiallyRefund(order, decimal.Zero); - model.CanPartiallyRefundOffline = _orderProcessingService.CanPartiallyRefundOffline(order, decimal.Zero); - model.CanVoid = _orderProcessingService.CanVoid(order); - model.CanVoidOffline = _orderProcessingService.CanVoidOffline(order); - - model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode; - model.MaxAmountToRefund = order.OrderTotal - order.RefundedAmount; - - //recurring payment record - var recurringPayment = _orderService.SearchRecurringPayments(initialOrderId: order.Id, showHidden: true).FirstOrDefault(); - if (recurringPayment != null) - { - model.RecurringPaymentId = recurringPayment.Id; - } - #endregion - - #region Billing & shipping info - - model.BillingAddress = order.BillingAddress.ToModel(); - model.BillingAddress.FormattedCustomAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.BillingAddress.CustomAttributes); - model.BillingAddress.FirstNameEnabled = true; - model.BillingAddress.FirstNameRequired = true; - model.BillingAddress.LastNameEnabled = true; - model.BillingAddress.LastNameRequired = true; - model.BillingAddress.EmailEnabled = true; - model.BillingAddress.EmailRequired = true; - model.BillingAddress.CompanyEnabled = _addressSettings.CompanyEnabled; - model.BillingAddress.CompanyRequired = _addressSettings.CompanyRequired; - model.BillingAddress.CountryEnabled = _addressSettings.CountryEnabled; - model.BillingAddress.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled - model.BillingAddress.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; - model.BillingAddress.CityEnabled = _addressSettings.CityEnabled; - model.BillingAddress.CityRequired = _addressSettings.CityRequired; - model.BillingAddress.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; - model.BillingAddress.StreetAddressRequired = _addressSettings.StreetAddressRequired; - model.BillingAddress.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; - model.BillingAddress.StreetAddress2Required = _addressSettings.StreetAddress2Required; - model.BillingAddress.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; - model.BillingAddress.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; - model.BillingAddress.PhoneEnabled = _addressSettings.PhoneEnabled; - model.BillingAddress.PhoneRequired = _addressSettings.PhoneRequired; - model.BillingAddress.FaxEnabled = _addressSettings.FaxEnabled; - model.BillingAddress.FaxRequired = _addressSettings.FaxRequired; - - model.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext); ; - if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) - { - model.IsShippable = true; - - model.PickUpInStore = order.PickUpInStore; - if (!order.PickUpInStore) - { - model.ShippingAddress = order.ShippingAddress.ToModel(); - model.ShippingAddress.FormattedCustomAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); - model.ShippingAddress.FirstNameEnabled = true; - model.ShippingAddress.FirstNameRequired = true; - model.ShippingAddress.LastNameEnabled = true; - model.ShippingAddress.LastNameRequired = true; - model.ShippingAddress.EmailEnabled = true; - model.ShippingAddress.EmailRequired = true; - model.ShippingAddress.CompanyEnabled = _addressSettings.CompanyEnabled; - model.ShippingAddress.CompanyRequired = _addressSettings.CompanyRequired; - model.ShippingAddress.CountryEnabled = _addressSettings.CountryEnabled; - model.ShippingAddress.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled - model.ShippingAddress.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; - model.ShippingAddress.CityEnabled = _addressSettings.CityEnabled; - model.ShippingAddress.CityRequired = _addressSettings.CityRequired; - model.ShippingAddress.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; - model.ShippingAddress.StreetAddressRequired = _addressSettings.StreetAddressRequired; - model.ShippingAddress.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; - model.ShippingAddress.StreetAddress2Required = _addressSettings.StreetAddress2Required; - model.ShippingAddress.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; - model.ShippingAddress.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; - model.ShippingAddress.PhoneEnabled = _addressSettings.PhoneEnabled; - model.ShippingAddress.PhoneRequired = _addressSettings.PhoneRequired; - model.ShippingAddress.FaxEnabled = _addressSettings.FaxEnabled; - model.ShippingAddress.FaxRequired = _addressSettings.FaxRequired; - - model.ShippingAddressGoogleMapsUrl = string.Format("http://maps.google.com/maps?f=q&hl=en&ie=UTF8&oe=UTF8&geocode=&q={0}", Server.UrlEncode(order.ShippingAddress.Address1 + " " + order.ShippingAddress.ZipPostalCode + " " + order.ShippingAddress.City + " " + (order.ShippingAddress.Country != null ? order.ShippingAddress.Country.Name : ""))); - } - else - { - if (order.PickupAddress != null) - { - model.PickupAddress = order.PickupAddress.ToModel(); - model.PickupAddressGoogleMapsUrl = string.Format("http://maps.google.com/maps?f=q&hl=en&ie=UTF8&oe=UTF8&geocode=&q={0}", - Server.UrlEncode(string.Format("{0} {1} {2} {3}", order.PickupAddress.Address1, order.PickupAddress.ZipPostalCode, order.PickupAddress.City, - order.PickupAddress.Country != null ? order.PickupAddress.Country.Name : string.Empty))); - } - } - model.ShippingMethod = order.ShippingMethod; - - model.CanAddNewShipments = order.HasItemsToAddToShipment(); - } - - #endregion - - #region Products - - model.CheckoutAttributeInfo = order.CheckoutAttributeDescription; - bool hasDownloadableItems = false; - var products = order.OrderItems; - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - products = products - .Where(orderItem => orderItem.Product.VendorId == _workContext.CurrentVendor.Id) - .ToList(); - } - foreach (var orderItem in products) - { - if (orderItem.Product.IsDownload) - hasDownloadableItems = true; - - var orderItemModel = new OrderModel.OrderItemModel - { - Id = orderItem.Id, - ProductId = orderItem.ProductId, - ProductName = orderItem.Product.Name, - Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), - Quantity = orderItem.Quantity, - IsDownload = orderItem.Product.IsDownload, - DownloadCount = orderItem.DownloadCount, - DownloadActivationType = orderItem.Product.DownloadActivationType, - IsDownloadActivated = orderItem.IsDownloadActivated - }; - //picture - var orderItemPicture = orderItem.Product.GetProductPicture(orderItem.AttributesXml, _pictureService, _productAttributeParser); - orderItemModel.PictureThumbnailUrl = _pictureService.GetPictureUrl(orderItemPicture, 75, true); - - //license file - if (orderItem.LicenseDownloadId.HasValue) - { - var licenseDownload = _downloadService.GetDownloadById(orderItem.LicenseDownloadId.Value); - if (licenseDownload != null) - { - orderItemModel.LicenseDownloadGuid = licenseDownload.DownloadGuid; - } - } - //vendor - var vendor = _vendorService.GetVendorById(orderItem.Product.VendorId); - orderItemModel.VendorName = vendor != null ? vendor.Name : ""; - - //unit price - orderItemModel.UnitPriceInclTaxValue = orderItem.UnitPriceInclTax; - orderItemModel.UnitPriceExclTaxValue = orderItem.UnitPriceExclTax; - orderItemModel.UnitPriceInclTax = _priceFormatter.FormatPrice(orderItem.UnitPriceInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); - orderItemModel.UnitPriceExclTax = _priceFormatter.FormatPrice(orderItem.UnitPriceExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); - //discounts - orderItemModel.DiscountInclTaxValue = orderItem.DiscountAmountInclTax; - orderItemModel.DiscountExclTaxValue = orderItem.DiscountAmountExclTax; - orderItemModel.DiscountInclTax = _priceFormatter.FormatPrice(orderItem.DiscountAmountInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); - orderItemModel.DiscountExclTax = _priceFormatter.FormatPrice(orderItem.DiscountAmountExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); - //subtotal - orderItemModel.SubTotalInclTaxValue = orderItem.PriceInclTax; - orderItemModel.SubTotalExclTaxValue = orderItem.PriceExclTax; - orderItemModel.SubTotalInclTax = _priceFormatter.FormatPrice(orderItem.PriceInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); - orderItemModel.SubTotalExclTax = _priceFormatter.FormatPrice(orderItem.PriceExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); - - orderItemModel.AttributeInfo = orderItem.AttributeDescription; - if (orderItem.Product.IsRecurring) - orderItemModel.RecurringInfo = string.Format(_localizationService.GetResource("Admin.Orders.Products.RecurringPeriod"), orderItem.Product.RecurringCycleLength, orderItem.Product.RecurringCyclePeriod.GetLocalizedEnum(_localizationService, _workContext)); - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; - orderItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - } - - //return requests - orderItemModel.ReturnRequests = _returnRequestService - .SearchReturnRequests(orderItemId: orderItem.Id) - .Select(item => new OrderModel.OrderItemModel.ReturnRequestBriefModel - { - CustomNumber = item.CustomNumber, - Id = item.Id - }).ToList(); - - //gift cards - orderItemModel.PurchasedGiftCardIds = _giftCardService.GetGiftCardsByPurchasedWithOrderItemId(orderItem.Id) - .Select(gc => gc.Id).ToList(); - - model.Items.Add(orderItemModel); - } - model.HasDownloadableProducts = hasDownloadableItems; - #endregion - } - - [NonAction] - protected virtual OrderModel.AddOrderProductModel.ProductDetailsModel PrepareAddProductToOrderModel(int orderId, int productId) - { - var product = _productService.GetProductById(productId); - if (product == null) - throw new ArgumentException("No product found with the specified id"); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - throw new ArgumentException("No order found with the specified id"); - - var presetQty = 1; - var presetPrice = _priceCalculationService.GetFinalPrice(product, order.Customer, decimal.Zero, true, presetQty); - decimal taxRate; - decimal presetPriceInclTax = _taxService.GetProductPrice(product, presetPrice, true, order.Customer, out taxRate); - decimal presetPriceExclTax = _taxService.GetProductPrice(product, presetPrice, false, order.Customer, out taxRate); - - var model = new OrderModel.AddOrderProductModel.ProductDetailsModel - { - ProductId = productId, - OrderId = orderId, - Name = product.Name, - ProductType = product.ProductType, - UnitPriceExclTax = presetPriceExclTax, - UnitPriceInclTax = presetPriceInclTax, - Quantity = presetQty, - SubTotalExclTax = presetPriceExclTax, - SubTotalInclTax = presetPriceInclTax, - AutoUpdateOrderTotals = _orderSettings.AutoUpdateOrderTotalsOnEditingOrder - }; - - //attributes - var attributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); - foreach (var attribute in attributes) - { - var attributeModel = new OrderModel.AddOrderProductModel.ProductAttributeModel - { - Id = attribute.Id, - ProductAttributeId = attribute.ProductAttributeId, - Name = attribute.ProductAttribute.Name, - TextPrompt = attribute.TextPrompt, - IsRequired = attribute.IsRequired, - AttributeControlType = attribute.AttributeControlType, - HasCondition = !String.IsNullOrEmpty(attribute.ConditionAttributeXml) - }; - if (!String.IsNullOrEmpty(attribute.ValidationFileAllowedExtensions)) - { - attributeModel.AllowedFileExtensions = attribute.ValidationFileAllowedExtensions - .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .ToList(); - } - - if (attribute.ShouldHaveValues()) - { - //values - var attributeValues = _productAttributeService.GetProductAttributeValues(attribute.Id); - foreach (var attributeValue in attributeValues) - { - //price adjustment - var priceAdjustment = _taxService.GetProductPrice(product, - _priceCalculationService.GetProductAttributeValuePriceAdjustment(attributeValue), out taxRate); - - attributeModel.Values.Add(new OrderModel.AddOrderProductModel.ProductAttributeValueModel - { - Id = attributeValue.Id, - Name = attributeValue.Name, - IsPreSelected = attributeValue.IsPreSelected, - CustomerEntersQty = attributeValue.CustomerEntersQty, - Quantity = attributeValue.Quantity, - PriceAdjustment = priceAdjustment == decimal.Zero ? string.Empty : priceAdjustment > decimal.Zero - ? string.Concat("+", _priceFormatter.FormatPrice(priceAdjustment, false, false)) - : string.Concat("-", _priceFormatter.FormatPrice(-priceAdjustment, false, false)), - PriceAdjustmentValue = priceAdjustment - }); - } - } - - model.ProductAttributes.Add(attributeModel); - } - model.HasCondition = model.ProductAttributes.Any(a => a.HasCondition); - //gift card - model.GiftCard.IsGiftCard = product.IsGiftCard; - if (model.GiftCard.IsGiftCard) - { - model.GiftCard.GiftCardType = product.GiftCardType; - } - //rental - model.IsRental = product.IsRental; - return model; - } - - [NonAction] - protected virtual ShipmentModel PrepareShipmentModel(Shipment shipment, bool prepareProducts, bool prepareShipmentEvent = false) - { - //measures - var baseWeight = _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId); - var baseWeightIn = baseWeight != null ? baseWeight.Name : ""; - var baseDimension = _measureService.GetMeasureDimensionById(_measureSettings.BaseDimensionId); - var baseDimensionIn = baseDimension != null ? baseDimension.Name : ""; - - var model = new ShipmentModel - { - Id = shipment.Id, - OrderId = shipment.OrderId, - TrackingNumber = shipment.TrackingNumber, - TotalWeight = shipment.TotalWeight.HasValue ? string.Format("{0:F2} [{1}]", shipment.TotalWeight, baseWeightIn) : "", - ShippedDate = shipment.ShippedDateUtc.HasValue ? _dateTimeHelper.ConvertToUserTime(shipment.ShippedDateUtc.Value, DateTimeKind.Utc).ToString() : _localizationService.GetResource("Admin.Orders.Shipments.ShippedDate.NotYet"), - ShippedDateUtc = shipment.ShippedDateUtc, - CanShip = !shipment.ShippedDateUtc.HasValue, - DeliveryDate = shipment.DeliveryDateUtc.HasValue ? _dateTimeHelper.ConvertToUserTime(shipment.DeliveryDateUtc.Value, DateTimeKind.Utc).ToString() : _localizationService.GetResource("Admin.Orders.Shipments.DeliveryDate.NotYet"), - DeliveryDateUtc = shipment.DeliveryDateUtc, - CanDeliver = shipment.ShippedDateUtc.HasValue && !shipment.DeliveryDateUtc.HasValue, - AdminComment = shipment.AdminComment, - CustomOrderNumber = shipment.Order.CustomOrderNumber - }; - - if (prepareProducts) - { - foreach (var shipmentItem in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); - if (orderItem == null) - continue; - - //quantities - var qtyInThisShipment = shipmentItem.Quantity; - var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); - var qtyOrdered = orderItem.Quantity; - var qtyInAllShipments = orderItem.GetTotalNumberOfItemsInAllShipment(); - - var warehouse = _shippingService.GetWarehouseById(shipmentItem.WarehouseId); - var shipmentItemModel = new ShipmentModel.ShipmentItemModel - { - Id = shipmentItem.Id, - OrderItemId = orderItem.Id, - ProductId = orderItem.ProductId, - ProductName = orderItem.Product.Name, - Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), - AttributeInfo = orderItem.AttributeDescription, - ShippedFromWarehouse = warehouse != null ? warehouse.Name : null, - ShipSeparately = orderItem.Product.ShipSeparately, - ItemWeight = orderItem.ItemWeight.HasValue ? string.Format("{0:F2} [{1}]", orderItem.ItemWeight, baseWeightIn) : "", - ItemDimensions = string.Format("{0:F2} x {1:F2} x {2:F2} [{3}]", orderItem.Product.Length, orderItem.Product.Width, orderItem.Product.Height, baseDimensionIn), - QuantityOrdered = qtyOrdered, - QuantityInThisShipment = qtyInThisShipment, - QuantityInAllShipments = qtyInAllShipments, - QuantityToAdd = maxQtyToAdd, - }; - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; - shipmentItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - } - - model.Items.Add(shipmentItemModel); - } - } - - if (prepareShipmentEvent && !String.IsNullOrEmpty(shipment.TrackingNumber)) - { - var shipmentTracker = shipment.GetShipmentTracker(_shippingService, _shippingSettings); - if (shipmentTracker != null) - { - model.TrackingNumberUrl = shipmentTracker.GetUrl(shipment.TrackingNumber); - if (_shippingSettings.DisplayShipmentEventsToStoreOwner) - { - var shipmentEvents = shipmentTracker.GetShipmentEvents(shipment.TrackingNumber); - if (shipmentEvents != null) - foreach (var shipmentEvent in shipmentEvents) - { - var shipmentStatusEventModel = new ShipmentModel.ShipmentStatusEventModel(); - var shipmentEventCountry = _countryService.GetCountryByTwoLetterIsoCode(shipmentEvent.CountryCode); - shipmentStatusEventModel.Country = shipmentEventCountry != null - ? shipmentEventCountry.GetLocalized(x => x.Name) - : shipmentEvent.CountryCode; - shipmentStatusEventModel.Date = shipmentEvent.Date; - shipmentStatusEventModel.EventName = shipmentEvent.EventName; - shipmentStatusEventModel.Location = shipmentEvent.Location; - model.ShipmentStatusEvents.Add(shipmentStatusEventModel); - } - } - } - } - - return model; - } - - #endregion - - #region Order list - - public virtual ActionResult Index() - { - return RedirectToAction("List"); - } - - public virtual ActionResult List( - [ModelBinder(typeof(CommaSeparatedModelBinder))] List orderStatusIds = null, - [ModelBinder(typeof(CommaSeparatedModelBinder))] List paymentStatusIds = null, - [ModelBinder(typeof(CommaSeparatedModelBinder))] List shippingStatusIds = null) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //order statuses - var model = new OrderListModel(); - model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.AvailableOrderStatuses.Insert(0, new SelectListItem - { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); - if (orderStatusIds != null && orderStatusIds.Any()) - { - foreach (var item in model.AvailableOrderStatuses.Where(os => orderStatusIds.Contains(os.Value))) - item.Selected = true; - model.AvailableOrderStatuses.First().Selected = false; - } - //payment statuses - model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.AvailablePaymentStatuses.Insert(0, new SelectListItem - { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); - if (paymentStatusIds != null && paymentStatusIds.Any()) - { - foreach (var item in model.AvailablePaymentStatuses.Where(ps => paymentStatusIds.Contains(ps.Value))) - item.Selected = true; - model.AvailablePaymentStatuses.First().Selected = false; - } - - //shipping statuses - model.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); - model.AvailableShippingStatuses.Insert(0, new SelectListItem - { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); - if (shippingStatusIds != null && shippingStatusIds.Any()) - { - foreach (var item in model.AvailableShippingStatuses.Where(ss => shippingStatusIds.Contains(ss.Value))) - item.Selected = true; - model.AvailableShippingStatuses.First().Selected = false; - } - - //stores - model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - foreach (var s in _storeService.GetAllStores()) - model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); - - //vendors - model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); - foreach (var v in vendors) - model.AvailableVendors.Add(v); - - //warehouses - model.AvailableWarehouses.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - foreach (var w in _shippingService.GetAllWarehouses()) - model.AvailableWarehouses.Add(new SelectListItem { Text = w.Name, Value = w.Id.ToString() }); - - //payment methods - model.AvailablePaymentMethods.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "" }); - foreach (var pm in _paymentService.LoadAllPaymentMethods()) - model.AvailablePaymentMethods.Add(new SelectListItem { Text = pm.PluginDescriptor.FriendlyName, Value = pm.PluginDescriptor.SystemName }); - - //billing countries - foreach (var c in _countryService.GetAllCountriesForBilling(showHidden: true)) - { - model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); - } - model.AvailableCountries.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //a vendor should have access only to orders with his products - model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; - - return View(model); - } - - [HttpPost] - public virtual ActionResult OrderList(DataSourceRequest command, OrderListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.VendorId = _workContext.CurrentVendor.Id; - } - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - :(DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; - var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; - var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; - - var filterByProductId = 0; - var product = _productService.GetProductById(model.ProductId); - if (product != null && HasAccessToProduct(product)) - filterByProductId = model.ProductId; - - //load orders - var orders = _orderService.SearchOrders(storeId: model.StoreId, - vendorId: model.VendorId, - productId: filterByProductId, - warehouseId: model.WarehouseId, - paymentMethodSystemName: model.PaymentMethodSystemName, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes, - pageIndex: command.Page - 1, - pageSize: command.PageSize); - var gridModel = new DataSourceResult - { - Data = orders.Select(x => - { - var store = _storeService.GetStoreById(x.StoreId); - return new OrderModel - { - Id = x.Id, - StoreName = store != null ? store.Name : "Unknown", - OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), - OrderStatus = x.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), - OrderStatusId = x.OrderStatusId, - PaymentStatus = x.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), - PaymentStatusId = x.PaymentStatusId, - ShippingStatus = x.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), - ShippingStatusId = x.ShippingStatusId, - CustomerEmail = x.BillingAddress.Email, - CustomerFullName = string.Format("{0} {1}", x.BillingAddress.FirstName, x.BillingAddress.LastName), - CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc), - CustomOrderNumber = x.CustomOrderNumber - }; - }), - Total = orders.TotalCount - }; - - //summary report - //currently we do not support productId and warehouseId parameters for this report - var reportSummary = _orderReportService.GetOrderAverageReportLine( - storeId: model.StoreId, - vendorId: model.VendorId, - orderId: 0, - paymentMethodSystemName: model.PaymentMethodSystemName, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - startTimeUtc: startDateValue, - endTimeUtc: endDateValue, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes); - - var profit = _orderReportService.ProfitReport( - storeId: model.StoreId, - vendorId: model.VendorId, - paymentMethodSystemName: model.PaymentMethodSystemName, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - startTimeUtc: startDateValue, - endTimeUtc: endDateValue, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes); - var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); - if (primaryStoreCurrency == null) - throw new Exception("Cannot load primary store currency"); - - gridModel.ExtraData = new OrderAggreratorModel - { - aggregatorprofit = _priceFormatter.FormatPrice(profit, true, false), - aggregatorshipping = _priceFormatter.FormatShippingPrice(reportSummary.SumShippingExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false), - aggregatortax = _priceFormatter.FormatPrice(reportSummary.SumTax, true, false), - aggregatortotal = _priceFormatter.FormatPrice(reportSummary.SumOrders, true, false) - }; - - return Json(gridModel); - } - - [HttpPost, ActionName("List")] - [FormValueRequired("go-to-order-by-number")] - public virtual ActionResult GoToOrderId(OrderListModel model) - { - var order = _orderService.GetOrderByCustomOrderNumber(model.GoDirectlyToCustomOrderNumber); - - if (order == null) - return List(); - - return RedirectToAction("Edit", "Order", new { id = order.Id }); - } - - public virtual ActionResult ProductSearchAutoComplete(string term) - { - const int searchTermMinimumLength = 3; - if (String.IsNullOrWhiteSpace(term) || term.Length < searchTermMinimumLength) - return Content(""); - - //a vendor should have access only to his products - var vendorId = 0; - if (_workContext.CurrentVendor != null) - { - vendorId = _workContext.CurrentVendor.Id; - } - - //products - const int productNumber = 15; - var products = _productService.SearchProducts( - vendorId: vendorId, - keywords: term, - pageSize: productNumber, - showHidden: true); - - var result = (from p in products - select new - { - label = p.Name, - productid = p.Id - }) - .ToList(); - return Json(result, JsonRequestBehavior.AllowGet); - } - - #endregion - - #region Export / Import - - [HttpPost, ActionName("List")] - [FormValueRequired("exportxml-all")] - public virtual ActionResult ExportXmlAll(OrderListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.VendorId = _workContext.CurrentVendor.Id; - } - - var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; - var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; - var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; - - var filterByProductId = 0; - var product = _productService.GetProductById(model.ProductId); - if (product != null && HasAccessToProduct(product)) - filterByProductId = model.ProductId; - - //load orders - var orders = _orderService.SearchOrders(storeId: model.StoreId, - vendorId: model.VendorId, - productId: filterByProductId, - warehouseId: model.WarehouseId, - paymentMethodSystemName: model.PaymentMethodSystemName, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes); - - try - { - var xml = _exportManager.ExportOrdersToXml(orders); - return new XmlDownloadResult(xml, "orders.xml"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - [HttpPost] - public virtual ActionResult ExportXmlSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var orders = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - orders.AddRange(_orderService.GetOrdersByIds(ids).Where(HasAccessToOrder)); - } - - var xml = _exportManager.ExportOrdersToXml(orders); - return new XmlDownloadResult(xml, "orders.xml"); - } - - [HttpPost, ActionName("List")] - [FormValueRequired("exportexcel-all")] - public virtual ActionResult ExportExcelAll(OrderListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.VendorId = _workContext.CurrentVendor.Id; - } - - var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; - var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; - var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; - - var filterByProductId = 0; - var product = _productService.GetProductById(model.ProductId); - if (product != null && HasAccessToProduct(product)) - filterByProductId = model.ProductId; - - //load orders - var orders = _orderService.SearchOrders(storeId: model.StoreId, - vendorId: model.VendorId, - productId: filterByProductId, - warehouseId: model.WarehouseId, - paymentMethodSystemName: model.PaymentMethodSystemName, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes); - - try - { - byte[] bytes = _exportManager.ExportOrdersToXlsx(orders); - return File(bytes, MimeTypes.TextXlsx, "orders.xlsx"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - [HttpPost] - public virtual ActionResult ExportExcelSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var orders = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - orders.AddRange(_orderService.GetOrdersByIds(ids).Where(HasAccessToOrder)); - } - - try - { - byte[] bytes = _exportManager.ExportOrdersToXlsx(orders); - return File(bytes, MimeTypes.TextXlsx, "orders.xlsx"); - } - catch (Exception exc) - { - ErrorNotification(exc); - return RedirectToAction("List"); - } - } - - #endregion - - #region Order details - - #region Payments and other order workflow - - [HttpPost, ActionName("Edit")] - [FormValueRequired("cancelorder")] - public virtual ActionResult CancelOrder(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - _orderProcessingService.CancelOrder(order, true); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("captureorder")] - public virtual ActionResult CaptureOrder(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - var errors = _orderProcessingService.Capture(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - foreach (var error in errors) - ErrorNotification(error, false); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("markorderaspaid")] - public virtual ActionResult MarkOrderAsPaid(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - _orderProcessingService.MarkOrderAsPaid(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("refundorder")] - public virtual ActionResult RefundOrder(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - var errors = _orderProcessingService.Refund(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - foreach (var error in errors) - ErrorNotification(error, false); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("refundorderoffline")] - public virtual ActionResult RefundOrderOffline(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - _orderProcessingService.RefundOffline(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("voidorder")] - public virtual ActionResult VoidOrder(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - var errors = _orderProcessingService.Void(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - foreach (var error in errors) - ErrorNotification(error, false); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("voidorderoffline")] - public virtual ActionResult VoidOrderOffline(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - _orderProcessingService.VoidOffline(order); - LogEditOrder(order.Id); - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - return View(model); - } - catch (Exception exc) - { - //error - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - public virtual ActionResult PartiallyRefundOrderPopup(int id, bool online) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - - return View(model); - } - - [HttpPost] - [FormValueRequired("partialrefundorder")] - public virtual ActionResult PartiallyRefundOrderPopup(string btnId, string formId, int id, bool online, OrderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - decimal amountToRefund = model.AmountToRefund; - if (amountToRefund <= decimal.Zero) - throw new NopException("Enter amount to refund"); - - decimal maxAmountToRefund = order.OrderTotal - order.RefundedAmount; - if (amountToRefund > maxAmountToRefund) - amountToRefund = maxAmountToRefund; - - var errors = new List(); - if (online) - errors = _orderProcessingService.PartiallyRefund(order, amountToRefund).ToList(); - else - _orderProcessingService.PartiallyRefundOffline(order, amountToRefund); - - LogEditOrder(order.Id); - - if (!errors.Any()) - { - //success - ViewBag.RefreshPage = true; - ViewBag.btnId = btnId; - ViewBag.formId = formId; - - PrepareOrderDetailsModel(model, order); - return View(model); - } - - //error - PrepareOrderDetailsModel(model, order); - foreach (var error in errors) - ErrorNotification(error, false); - return View(model); - } - catch (Exception exc) - { - //error - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("btnSaveOrderStatus")] - public virtual ActionResult ChangeOrderStatus(int id, OrderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - try - { - order.OrderStatusId = model.OrderStatusId; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = string.Format("Order status has been edited. New status: {0}", order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext)), - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - return View(model); - } - catch (Exception exc) - { - //error - model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - ErrorNotification(exc, false); - return View(model); - } - } - - #endregion - - #region Edit, delete - - public virtual ActionResult Edit(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null || order.Deleted) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) - return RedirectToAction("List"); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - - var warnings = TempData["nop.admin.order.warnings"] as List; - if (warnings != null) - model.Warnings = warnings; - - return View(model); - } - - [HttpPost] - public virtual ActionResult Delete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - _orderProcessingService.DeleteOrder(order); - - //activity log - _customerActivityService.InsertActivity("DeleteOrder", _localizationService.GetResource("ActivityLog.DeleteOrder"), order.Id); - - return RedirectToAction("List"); - } - - public virtual ActionResult PdfInvoice(int orderId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //a vendor should have access only to his products - var vendorId = 0; - if (_workContext.CurrentVendor != null) - { - vendorId = _workContext.CurrentVendor.Id; - } - - var order = _orderService.GetOrderById(orderId); - var orders = new List(); - orders.Add(order); - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, vendorId); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, string.Format("order_{0}.pdf", order.Id)); - } - - [HttpPost, ActionName("List")] - [FormValueRequired("pdf-invoice-all")] - public virtual ActionResult PdfInvoiceAll(OrderListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.VendorId = _workContext.CurrentVendor.Id; - } - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; - var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; - var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; - - var filterByProductId = 0; - var product = _productService.GetProductById(model.ProductId); - if (product != null && HasAccessToProduct(product)) - filterByProductId = model.ProductId; - - //load orders - var orders = _orderService.SearchOrders(storeId: model.StoreId, - vendorId: model.VendorId, - productId: filterByProductId, - warehouseId: model.WarehouseId, - paymentMethodSystemName: model.PaymentMethodSystemName, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - osIds: orderStatusIds, - psIds: paymentStatusIds, - ssIds: shippingStatusIds, - billingEmail: model.BillingEmail, - billingLastName: model.BillingLastName, - billingCountryId: model.BillingCountryId, - orderNotes: model.OrderNotes); - - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, model.VendorId); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, "orders.pdf"); - } - - [HttpPost] - public virtual ActionResult PdfInvoiceSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var orders = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - orders.AddRange(_orderService.GetOrdersByIds(ids)); - } - - //a vendor should have access only to his products - var vendorId = 0; - if (_workContext.CurrentVendor != null) - { - orders = orders.Where(HasAccessToOrder).ToList(); - vendorId = _workContext.CurrentVendor.Id; - } - - //ensure that we at least one order selected - if (!orders.Any()) - { - ErrorNotification(_localizationService.GetResource("Admin.Orders.PdfInvoice.NoOrders")); - return RedirectToAction("List"); - } - - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, vendorId); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, "orders.pdf"); - } - - //currently we use this method on the add product to order details pages - [HttpPost] - [ValidateInput(false)] - public virtual ActionResult ProductDetails_AttributeChange(int productId, bool validateAttributeConditions, - FormCollection form) - { - var product = _productService.GetProductById(productId); - if (product == null) - return new NullJsonResult(); - - var errors = new List(); - var attributeXml = ParseProductAttributes(product, form, errors); - - //conditional attributes - var enabledAttributeMappingIds = new List(); - var disabledAttributeMappingIds = new List(); - if (validateAttributeConditions) - { - var attributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); - foreach (var attribute in attributes) - { - var conditionMet = _productAttributeParser.IsConditionMet(attribute, attributeXml); - if (conditionMet.HasValue) - { - if (conditionMet.Value) - enabledAttributeMappingIds.Add(attribute.Id); - else - disabledAttributeMappingIds.Add(attribute.Id); - } - } - } - - return Json(new - { - enabledattributemappingids = enabledAttributeMappingIds.ToArray(), - disabledattributemappingids = disabledAttributeMappingIds.ToArray(), - message = errors.Any() ? errors.ToArray() : null - }); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("btnSaveCC")] - public virtual ActionResult EditCreditCardInfo(int id, OrderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - if (order.AllowStoringCreditCardNumber) - { - string cardType = model.CardType; - string cardName = model.CardName; - string cardNumber = model.CardNumber; - string cardCvv2 = model.CardCvv2; - string cardExpirationMonth = model.CardExpirationMonth; - string cardExpirationYear = model.CardExpirationYear; - - order.CardType = _encryptionService.EncryptText(cardType); - order.CardName = _encryptionService.EncryptText(cardName); - order.CardNumber = _encryptionService.EncryptText(cardNumber); - order.MaskedCreditCardNumber = _encryptionService.EncryptText(_paymentService.GetMaskedCreditCardNumber(cardNumber)); - order.CardCvv2 = _encryptionService.EncryptText(cardCvv2); - order.CardExpirationMonth = _encryptionService.EncryptText(cardExpirationMonth); - order.CardExpirationYear = _encryptionService.EncryptText(cardExpirationYear); - _orderService.UpdateOrder(order); - } - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Credit card info has been edited", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - PrepareOrderDetailsModel(model, order); - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("btnSaveOrderTotals")] - public virtual ActionResult EditOrderTotals(int id, OrderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - order.OrderSubtotalInclTax = model.OrderSubtotalInclTaxValue; - order.OrderSubtotalExclTax = model.OrderSubtotalExclTaxValue; - order.OrderSubTotalDiscountInclTax = model.OrderSubTotalDiscountInclTaxValue; - order.OrderSubTotalDiscountExclTax = model.OrderSubTotalDiscountExclTaxValue; - order.OrderShippingInclTax = model.OrderShippingInclTaxValue; - order.OrderShippingExclTax = model.OrderShippingExclTaxValue; - order.PaymentMethodAdditionalFeeInclTax = model.PaymentMethodAdditionalFeeInclTaxValue; - order.PaymentMethodAdditionalFeeExclTax = model.PaymentMethodAdditionalFeeExclTaxValue; - order.TaxRates = model.TaxRatesValue; - order.OrderTax = model.TaxValue; - order.OrderDiscount = model.OrderTotalDiscountValue; - order.OrderTotal = model.OrderTotalValue; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order totals have been edited", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - PrepareOrderDetailsModel(model, order); - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired("save-shipping-method")] - public virtual ActionResult EditShippingMethod(int id, OrderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - order.ShippingMethod = model.ShippingMethod; - _orderService.UpdateOrder(order); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Shipping method has been edited", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - PrepareOrderDetailsModel(model, order); - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired(FormValueRequirement.StartsWith, "btnSaveOrderItem")] - [ValidateInput(false)] - public virtual ActionResult EditOrderItem(int id, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - //get order item identifier - int orderItemId = 0; - foreach (var formValue in form.AllKeys) - if (formValue.StartsWith("btnSaveOrderItem", StringComparison.InvariantCultureIgnoreCase)) - orderItemId = Convert.ToInt32(formValue.Substring("btnSaveOrderItem".Length)); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - - decimal unitPriceInclTax, unitPriceExclTax, discountInclTax, discountExclTax,priceInclTax,priceExclTax; - int quantity; - if (!decimal.TryParse(form["pvUnitPriceInclTax" + orderItemId], out unitPriceInclTax)) - unitPriceInclTax = orderItem.UnitPriceInclTax; - if (!decimal.TryParse(form["pvUnitPriceExclTax" + orderItemId], out unitPriceExclTax)) - unitPriceExclTax = orderItem.UnitPriceExclTax; - if (!int.TryParse(form["pvQuantity" + orderItemId], out quantity)) - quantity = orderItem.Quantity; - if (!decimal.TryParse(form["pvDiscountInclTax" + orderItemId], out discountInclTax)) - discountInclTax = orderItem.DiscountAmountInclTax; - if (!decimal.TryParse(form["pvDiscountExclTax" + orderItemId], out discountExclTax)) - discountExclTax = orderItem.DiscountAmountExclTax; - if (!decimal.TryParse(form["pvPriceInclTax" + orderItemId], out priceInclTax)) - priceInclTax = orderItem.PriceInclTax; - if (!decimal.TryParse(form["pvPriceExclTax" + orderItemId], out priceExclTax)) - priceExclTax = orderItem.PriceExclTax; - - if (quantity > 0) - { - int qtyDifference = orderItem.Quantity - quantity; - - if (!_orderSettings.AutoUpdateOrderTotalsOnEditingOrder) - { - orderItem.UnitPriceInclTax = unitPriceInclTax; - orderItem.UnitPriceExclTax = unitPriceExclTax; - orderItem.Quantity = quantity; - orderItem.DiscountAmountInclTax = discountInclTax; - orderItem.DiscountAmountExclTax = discountExclTax; - orderItem.PriceInclTax = priceInclTax; - orderItem.PriceExclTax = priceExclTax; - _orderService.UpdateOrder(order); - } - - //adjust inventory - _productService.AdjustInventory(orderItem.Product, qtyDifference, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.EditOrder"), order.Id)); - - } - else - { - //adjust inventory - _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrderItem"), order.Id)); - - //delete item - _orderService.DeleteOrderItem(orderItem); - } - - //update order totals - var updateOrderParameters = new UpdateOrderParameters - { - UpdatedOrder = order, - UpdatedOrderItem = orderItem, - PriceInclTax = unitPriceInclTax, - PriceExclTax = unitPriceExclTax, - DiscountAmountInclTax = discountInclTax, - DiscountAmountExclTax = discountExclTax, - SubTotalInclTax = priceInclTax, - SubTotalExclTax = priceExclTax, - Quantity = quantity - }; - _orderProcessingService.UpdateOrderTotals(updateOrderParameters); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order item has been edited", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - model.Warnings = updateOrderParameters.Warnings; - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired(FormValueRequirement.StartsWith, "btnDeleteOrderItem")] - [ValidateInput(false)] - public virtual ActionResult DeleteOrderItem(int id, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = id }); - - //get order item identifier - int orderItemId = 0; - foreach (var formValue in form.AllKeys) - if (formValue.StartsWith("btnDeleteOrderItem", StringComparison.InvariantCultureIgnoreCase)) - orderItemId = Convert.ToInt32(formValue.Substring("btnDeleteOrderItem".Length)); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - if (_giftCardService.GetGiftCardsByPurchasedWithOrderItemId(orderItem.Id).Any()) - { - //we cannot delete an order item with associated gift cards - //a store owner should delete them first - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - - ErrorNotification(_localizationService.GetResource("Admin.Orders.OrderItem.DeleteAssociatedGiftCardRecordError"), false); - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - - } - else - { - //adjust inventory - _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrderItem"), order.Id)); - - //delete item - _orderService.DeleteOrderItem(orderItem); - - //update order totals - var updateOrderParameters = new UpdateOrderParameters - { - UpdatedOrder = order, - UpdatedOrderItem = orderItem - }; - _orderProcessingService.UpdateOrderTotals(updateOrderParameters); - - - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Order item has been deleted", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - model.Warnings = updateOrderParameters.Warnings; - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - } - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired(FormValueRequirement.StartsWith, "btnResetDownloadCount")] - [ValidateInput(false)] - public virtual ActionResult ResetDownloadCount(int id, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //get order item identifier - int orderItemId = 0; - foreach (var formValue in form.AllKeys) - if (formValue.StartsWith("btnResetDownloadCount", StringComparison.InvariantCultureIgnoreCase)) - orderItemId = Convert.ToInt32(formValue.Substring("btnResetDownloadCount".Length)); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - //ensure a vendor has access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) - return RedirectToAction("List"); - - orderItem.DownloadCount = 0; - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - } - - [HttpPost, ActionName("Edit")] - [FormValueRequired(FormValueRequirement.StartsWith, "btnPvActivateDownload")] - [ValidateInput(false)] - public virtual ActionResult ActivateDownloadItem(int id, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //get order item identifier - int orderItemId = 0; - foreach (var formValue in form.AllKeys) - if (formValue.StartsWith("btnPvActivateDownload", StringComparison.InvariantCultureIgnoreCase)) - orderItemId = Convert.ToInt32(formValue.Substring("btnPvActivateDownload".Length)); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - //ensure a vendor has access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) - return RedirectToAction("List"); - - orderItem.IsDownloadActivated = !orderItem.IsDownloadActivated; - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - var model = new OrderModel(); - PrepareOrderDetailsModel(model, order); - - //selected tab - SaveSelectedTabName(persistForTheNextRequest: false); - - return View(model); - } - - public virtual ActionResult UploadLicenseFilePopup(int id, int orderItemId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(id); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - if (!orderItem.Product.IsDownload) - throw new ArgumentException("Product is not downloadable"); - - //ensure a vendor has access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) - return RedirectToAction("List"); - - var model = new OrderModel.UploadLicenseModel - { - LicenseDownloadId = orderItem.LicenseDownloadId.HasValue ? orderItem.LicenseDownloadId.Value : 0, - OrderId = order.Id, - OrderItemId = orderItem.Id - }; - - return View(model); - } - - [HttpPost] - [FormValueRequired("uploadlicense")] - public virtual ActionResult UploadLicenseFilePopup(string btnId, string formId, OrderModel.UploadLicenseModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(model.OrderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - //ensure a vendor has access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) - return RedirectToAction("List"); - - //attach license - if (model.LicenseDownloadId > 0) - orderItem.LicenseDownloadId = model.LicenseDownloadId; - else - orderItem.LicenseDownloadId = null; - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - //success - ViewBag.RefreshPage = true; - ViewBag.btnId = btnId; - ViewBag.formId = formId; - - return View(model); - } - - [HttpPost, ActionName("UploadLicenseFilePopup")] - [FormValueRequired("deletelicense")] - public virtual ActionResult DeleteLicenseFilePopup(string btnId, string formId, OrderModel.UploadLicenseModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(model.OrderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId); - if (orderItem == null) - throw new ArgumentException("No order item found with the specified id"); - - //ensure a vendor has access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) - return RedirectToAction("List"); - - //attach license - orderItem.LicenseDownloadId = null; - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - //success - ViewBag.RefreshPage = true; - ViewBag.btnId = btnId; - ViewBag.formId = formId; - - return View(model); - } - - public virtual ActionResult AddProductToOrder(int orderId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = orderId }); - - var model = new OrderModel.AddOrderProductModel(); - model.OrderId = orderId; - //categories - model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); - foreach (var c in categories) - model.AvailableCategories.Add(c); - - //manufacturers - model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); - foreach (var m in manufacturers) - model.AvailableManufacturers.Add(m); - - //product types - model.AvailableProductTypes = ProductType.SimpleProduct.ToSelectList(false).ToList(); - model.AvailableProductTypes.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - return View(model); - } - - [HttpPost] - public virtual ActionResult AddProductToOrder(DataSourceRequest command, OrderModel.AddOrderProductModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return Content(""); - - var gridModel = new DataSourceResult(); - var products = _productService.SearchProducts(categoryIds: new List {model.SearchCategoryId}, - manufacturerId: model.SearchManufacturerId, - productType: model.SearchProductTypeId > 0 ? (ProductType?)model.SearchProductTypeId : null, - keywords: model.SearchProductName, - pageIndex: command.Page - 1, - pageSize: command.PageSize, - showHidden: true); - gridModel.Data = products.Select(x => - { - var productModel = new OrderModel.AddOrderProductModel.ProductModel - { - Id = x.Id, - Name = x.Name, - Sku = x.Sku, - }; - - return productModel; - }); - gridModel.Total = products.TotalCount; - - return Json(gridModel); - } - - public virtual ActionResult AddProductToOrderDetails(int orderId, int productId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = orderId }); - - var model = PrepareAddProductToOrderModel(orderId, productId); - return View(model); - } - - [HttpPost] - public virtual ActionResult AddProductToOrderDetails(int orderId, int productId, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = orderId }); - - var order = _orderService.GetOrderById(orderId); - var product = _productService.GetProductById(productId); - //save order item - - //basic properties - decimal unitPriceInclTax; - decimal.TryParse(form["UnitPriceInclTax"], out unitPriceInclTax); - decimal unitPriceExclTax; - decimal.TryParse(form["UnitPriceExclTax"], out unitPriceExclTax); - int quantity; - int.TryParse(form["Quantity"], out quantity); - decimal priceInclTax; - decimal.TryParse(form["SubTotalInclTax"], out priceInclTax); - decimal priceExclTax; - decimal.TryParse(form["SubTotalExclTax"], out priceExclTax); - - //warnings - var warnings = new List(); - - //attributes - var attributesXml = ParseProductAttributes(product, form, warnings); - - #region Gift cards - - string recipientName = ""; - string recipientEmail = ""; - string senderName = ""; - string senderEmail = ""; - string giftCardMessage = ""; - if (product.IsGiftCard) - { - foreach (string formKey in form.AllKeys) - { - if (formKey.Equals("giftcard.RecipientName", StringComparison.InvariantCultureIgnoreCase)) - { - recipientName = form[formKey]; - continue; - } - if (formKey.Equals("giftcard.RecipientEmail", StringComparison.InvariantCultureIgnoreCase)) - { - recipientEmail = form[formKey]; - continue; - } - if (formKey.Equals("giftcard.SenderName", StringComparison.InvariantCultureIgnoreCase)) - { - senderName = form[formKey]; - continue; - } - if (formKey.Equals("giftcard.SenderEmail", StringComparison.InvariantCultureIgnoreCase)) - { - senderEmail = form[formKey]; - continue; - } - if (formKey.Equals("giftcard.Message", StringComparison.InvariantCultureIgnoreCase)) - { - giftCardMessage = form[formKey]; - continue; - } - } - - attributesXml = _productAttributeParser.AddGiftCardAttribute(attributesXml, - recipientName, recipientEmail, senderName, senderEmail, giftCardMessage); - } - - #endregion - - #region Rental product - - DateTime? rentalStartDate = null; - DateTime? rentalEndDate = null; - if (product.IsRental) - { - ParseRentalDates(form, out rentalStartDate, out rentalEndDate); - } - - #endregion - - //warnings - warnings.AddRange(_shoppingCartService.GetShoppingCartItemAttributeWarnings(order.Customer, ShoppingCartType.ShoppingCart, product, quantity, attributesXml)); - warnings.AddRange(_shoppingCartService.GetShoppingCartItemGiftCardWarnings(ShoppingCartType.ShoppingCart, product, attributesXml)); - warnings.AddRange(_shoppingCartService.GetRentalProductWarnings(product, rentalStartDate, rentalEndDate)); - if (!warnings.Any()) - { - //no errors - - //attributes - var attributeDescription = _productAttributeFormatter.FormatAttributes(product, attributesXml, order.Customer); - - //save item - var orderItem = new OrderItem - { - OrderItemGuid = Guid.NewGuid(), - Order = order, - ProductId = product.Id, - UnitPriceInclTax = unitPriceInclTax, - UnitPriceExclTax = unitPriceExclTax, - PriceInclTax = priceInclTax, - PriceExclTax = priceExclTax, - OriginalProductCost = _priceCalculationService.GetProductCost(product, attributesXml), - AttributeDescription = attributeDescription, - AttributesXml = attributesXml, - Quantity = quantity, - DiscountAmountInclTax = decimal.Zero, - DiscountAmountExclTax = decimal.Zero, - DownloadCount = 0, - IsDownloadActivated = false, - LicenseDownloadId = 0, - RentalStartDateUtc = rentalStartDate, - RentalEndDateUtc = rentalEndDate - }; - order.OrderItems.Add(orderItem); - _orderService.UpdateOrder(order); - - //adjust inventory - _productService.AdjustInventory(orderItem.Product, -orderItem.Quantity, orderItem.AttributesXml, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.EditOrder"), order.Id)); - - //update order totals - var updateOrderParameters = new UpdateOrderParameters - { - UpdatedOrder = order, - UpdatedOrderItem = orderItem, - PriceInclTax = unitPriceInclTax, - PriceExclTax = unitPriceExclTax, - SubTotalInclTax = priceInclTax, - SubTotalExclTax = priceExclTax, - Quantity = quantity - }; - _orderProcessingService.UpdateOrderTotals(updateOrderParameters); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "A new order item has been added", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - //gift cards - if (product.IsGiftCard) - { - for (int i = 0; i < orderItem.Quantity; i++) - { - var gc = new GiftCard - { - GiftCardType = product.GiftCardType, - PurchasedWithOrderItem = orderItem, - Amount = unitPriceExclTax, - IsGiftCardActivated = false, - GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), - RecipientName = recipientName, - RecipientEmail = recipientEmail, - SenderName = senderName, - SenderEmail = senderEmail, - Message = giftCardMessage, - IsRecipientNotified = false, - CreatedOnUtc = DateTime.UtcNow - }; - _giftCardService.InsertGiftCard(gc); - } - } - - //redirect to order details page - TempData["nop.admin.order.warnings"] = updateOrderParameters.Warnings; - return RedirectToAction("Edit", "Order", new { id = order.Id }); - } - - //errors - var model = PrepareAddProductToOrderModel(order.Id, product.Id); - model.Warnings.AddRange(warnings); - return View(model); - } - - #endregion - - #endregion - - #region Addresses - - public virtual ActionResult AddressEdit(int addressId, int orderId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = orderId }); - - var address = _addressService.GetAddressById(addressId); - if (address == null) - throw new ArgumentException("No address found with the specified id", "addressId"); - - var model = new OrderAddressModel(); - model.OrderId = orderId; - model.Address = address.ToModel(); - model.Address.FirstNameEnabled = true; - model.Address.FirstNameRequired = true; - model.Address.LastNameEnabled = true; - model.Address.LastNameRequired = true; - model.Address.EmailEnabled = true; - model.Address.EmailRequired = true; - model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; - model.Address.CompanyRequired = _addressSettings.CompanyRequired; - model.Address.CountryEnabled = _addressSettings.CountryEnabled; - model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled - model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; - model.Address.CityEnabled = _addressSettings.CityEnabled; - model.Address.CityRequired = _addressSettings.CityRequired; - model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; - model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; - model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; - model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; - model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; - model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; - model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; - model.Address.PhoneRequired = _addressSettings.PhoneRequired; - model.Address.FaxEnabled = _addressSettings.FaxEnabled; - model.Address.FaxRequired = _addressSettings.FaxRequired; - - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == address.CountryId) }); - //states - var states = address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - //customer attribute services - model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); - - return View(model); - } - - [HttpPost] - [ValidateInput(false)] - public virtual ActionResult AddressEdit(OrderAddressModel model, FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(model.OrderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = order.Id }); - - var address = _addressService.GetAddressById(model.Address.Id); - if (address == null) - throw new ArgumentException("No address found with the specified id"); - - //custom address attributes - var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); - var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); - foreach (var error in customAttributeWarnings) - { - ModelState.AddModelError("", error); - } - - if (ModelState.IsValid) - { - address = model.Address.ToEntity(address); - address.CustomAttributes = customAttributes; - _addressService.UpdateAddress(address); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "Address has been edited", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - return RedirectToAction("AddressEdit", new { addressId = model.Address.Id, orderId = model.OrderId }); - } - - //If we got this far, something failed, redisplay form - model.OrderId = order.Id; - model.Address = address.ToModel(); - model.Address.FirstNameEnabled = true; - model.Address.FirstNameRequired = true; - model.Address.LastNameEnabled = true; - model.Address.LastNameRequired = true; - model.Address.EmailEnabled = true; - model.Address.EmailRequired = true; - model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; - model.Address.CompanyRequired = _addressSettings.CompanyRequired; - model.Address.CountryEnabled = _addressSettings.CountryEnabled; - model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled - model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; - model.Address.CityEnabled = _addressSettings.CityEnabled; - model.Address.CityRequired = _addressSettings.CityRequired; - model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; - model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; - model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; - model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; - model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; - model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; - model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; - model.Address.PhoneRequired = _addressSettings.PhoneRequired; - model.Address.FaxEnabled = _addressSettings.FaxEnabled; - model.Address.FaxRequired = _addressSettings.FaxRequired; - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == address.CountryId) }); - //states - var states = address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - //customer attribute services - model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); - - return View(model); - } - - #endregion - - #region Shipments - - public virtual ActionResult ShipmentList() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var model = new ShipmentListModel(); - //countries - model.AvailableCountries.Add(new SelectListItem { Text = "*", Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); - //states - model.AvailableStates.Add(new SelectListItem { Text = "*", Value = "0" }); - - //warehouses - model.AvailableWarehouses.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - foreach (var w in _shippingService.GetAllWarehouses()) - model.AvailableWarehouses.Add(new SelectListItem { Text = w.Name, Value = w.Id.ToString() }); - - return View(model); - } - - [HttpPost] - public virtual ActionResult ShipmentListSelect(DataSourceRequest command, ShipmentListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - :(DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - //a vendor should have access only to his products - int vendorId = 0; - if (_workContext.CurrentVendor != null) - vendorId = _workContext.CurrentVendor.Id; - - //load shipments - var shipments = _shipmentService.GetAllShipments(vendorId: vendorId, - warehouseId: model.WarehouseId, - shippingCountryId: model.CountryId, - shippingStateId: model.StateProvinceId, - shippingCity: model.City, - trackingNumber: model.TrackingNumber, - loadNotShipped: model.LoadNotShipped, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - pageIndex: command.Page - 1, - pageSize: command.PageSize); - var gridModel = new DataSourceResult - { - Data = shipments.Select(shipment => PrepareShipmentModel(shipment, false)), - Total = shipments.TotalCount - }; - - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult ShipmentsByOrder(int orderId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - throw new ArgumentException("No order found with the specified id"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) - return Content(""); - - //shipments - var shipmentModels = new List(); - var shipments = order.Shipments - //a vendor should have access only to his products - .Where(s => _workContext.CurrentVendor == null || HasAccessToShipment(s)) - .OrderBy(s => s.CreatedOnUtc) - .ToList(); - foreach (var shipment in shipments) - shipmentModels.Add(PrepareShipmentModel(shipment, false)); - - var gridModel = new DataSourceResult - { - Data = shipmentModels, - Total = shipmentModels.Count - }; - - - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult ShipmentsItemsByShipmentId(int shipmentId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - var shipment = _shipmentService.GetShipmentById(shipmentId); - if (shipment == null) - throw new ArgumentException("No shipment found with the specified id"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return Content(""); - - var order = _orderService.GetOrderById(shipment.OrderId); - if (order == null) - throw new ArgumentException("No order found with the specified id"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) - return Content(""); - - //shipments - var shipmentModel = PrepareShipmentModel(shipment, true); - var gridModel = new DataSourceResult - { - Data = shipmentModel.Items, - Total = shipmentModel.Items.Count - }; - - return Json(gridModel); - } - - public virtual ActionResult AddShipment(int orderId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) - return RedirectToAction("List"); - - var model = new ShipmentModel - { - OrderId = order.Id, - CustomOrderNumber = order.CustomOrderNumber - }; - - //measures - var baseWeight = _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId); - var baseWeightIn = baseWeight != null ? baseWeight.Name : ""; - var baseDimension = _measureService.GetMeasureDimensionById(_measureSettings.BaseDimensionId); - var baseDimensionIn = baseDimension != null ? baseDimension.Name : ""; - - var orderItems = order.OrderItems; - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - orderItems = orderItems.Where(HasAccessToOrderItem).ToList(); - } - - foreach (var orderItem in orderItems) - { - //we can ship only shippable products - if (!orderItem.Product.IsShipEnabled) - continue; - - //quantities - var qtyInThisShipment = 0; - var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); - var qtyOrdered = orderItem.Quantity; - var qtyInAllShipments = orderItem.GetTotalNumberOfItemsInAllShipment(); - - //ensure that this product can be added to a shipment - if (maxQtyToAdd <= 0) - continue; - - var shipmentItemModel = new ShipmentModel.ShipmentItemModel - { - OrderItemId = orderItem.Id, - ProductId = orderItem.ProductId, - ProductName = orderItem.Product.Name, - Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), - AttributeInfo = orderItem.AttributeDescription, - ShipSeparately = orderItem.Product.ShipSeparately, - ItemWeight = orderItem.ItemWeight.HasValue ? string.Format("{0:F2} [{1}]", orderItem.ItemWeight, baseWeightIn) : "", - ItemDimensions = string.Format("{0:F2} x {1:F2} x {2:F2} [{3}]", orderItem.Product.Length, orderItem.Product.Width, orderItem.Product.Height, baseDimensionIn), - QuantityOrdered = qtyOrdered, - QuantityInThisShipment = qtyInThisShipment, - QuantityInAllShipments = qtyInAllShipments, - QuantityToAdd = maxQtyToAdd, - }; - //rental info - if (orderItem.Product.IsRental) - { - var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; - var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; - shipmentItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), - rentalStartDate, rentalEndDate); - } - - if (orderItem.Product.ManageInventoryMethod == ManageInventoryMethod.ManageStock && - orderItem.Product.UseMultipleWarehouses) - { - //multiple warehouses supported - shipmentItemModel.AllowToChooseWarehouse = true; - foreach (var pwi in orderItem.Product.ProductWarehouseInventory - .OrderBy(w => w.WarehouseId).ToList()) - { - var warehouse = pwi.Warehouse; - if (warehouse != null) - { - shipmentItemModel.AvailableWarehouses.Add(new ShipmentModel.ShipmentItemModel.WarehouseInfo - { - WarehouseId = warehouse.Id, - WarehouseName = warehouse.Name, - StockQuantity = pwi.StockQuantity, - ReservedQuantity = pwi.ReservedQuantity, - PlannedQuantity = _shipmentService.GetQuantityInShipments(orderItem.Product, warehouse.Id, true, true) - }); - } - } - } - else - { - //multiple warehouses are not supported - var warehouse = _shippingService.GetWarehouseById(orderItem.Product.WarehouseId); - if (warehouse != null) - { - shipmentItemModel.AvailableWarehouses.Add(new ShipmentModel.ShipmentItemModel.WarehouseInfo - { - WarehouseId = warehouse.Id, - WarehouseName = warehouse.Name, - StockQuantity = orderItem.Product.StockQuantity - }); - } - } - - model.Items.Add(shipmentItemModel); - } - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - [FormValueRequired("save", "save-continue")] - public virtual ActionResult AddShipment(int orderId, FormCollection form, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - //No order found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) - return RedirectToAction("List"); - - var orderItems = order.OrderItems; - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - orderItems = orderItems.Where(HasAccessToOrderItem).ToList(); - } - - Shipment shipment = null; - decimal? totalWeight = null; - foreach (var orderItem in orderItems) - { - //is shippable - if (!orderItem.Product.IsShipEnabled) - continue; - - //ensure that this product can be shipped (have at least one item to ship) - var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); - if (maxQtyToAdd <= 0) - continue; - - int qtyToAdd = 0; //parse quantity - foreach (string formKey in form.AllKeys) - if (formKey.Equals(string.Format("qtyToAdd{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) - { - int.TryParse(form[formKey], out qtyToAdd); - break; - } - - int warehouseId = 0; - if (orderItem.Product.ManageInventoryMethod == ManageInventoryMethod.ManageStock && - orderItem.Product.UseMultipleWarehouses) - { - //multiple warehouses supported - //warehouse is chosen by a store owner - foreach (string formKey in form.AllKeys) - if (formKey.Equals(string.Format("warehouse_{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) - { - int.TryParse(form[formKey], out warehouseId); - break; - } - } - else - { - //multiple warehouses are not supported - warehouseId = orderItem.Product.WarehouseId; - } - - foreach (string formKey in form.AllKeys) - if (formKey.Equals(string.Format("qtyToAdd{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) - { - int.TryParse(form[formKey], out qtyToAdd); - break; - } - - //validate quantity - if (qtyToAdd <= 0) - continue; - if (qtyToAdd > maxQtyToAdd) - qtyToAdd = maxQtyToAdd; - - //ok. we have at least one item. let's create a shipment (if it does not exist) - - var orderItemTotalWeight = orderItem.ItemWeight.HasValue ? orderItem.ItemWeight * qtyToAdd : null; - if (orderItemTotalWeight.HasValue) - { - if (!totalWeight.HasValue) - totalWeight = 0; - totalWeight += orderItemTotalWeight.Value; - } - if (shipment == null) - { - var trackingNumber = form["TrackingNumber"]; - var adminComment = form["AdminComment"]; - shipment = new Shipment - { - OrderId = order.Id, - TrackingNumber = trackingNumber, - TotalWeight = null, - ShippedDateUtc = null, - DeliveryDateUtc = null, - AdminComment = adminComment, - CreatedOnUtc = DateTime.UtcNow, - }; - } - //create a shipment item - var shipmentItem = new ShipmentItem - { - OrderItemId = orderItem.Id, - Quantity = qtyToAdd, - WarehouseId = warehouseId - }; - shipment.ShipmentItems.Add(shipmentItem); - } - - //if we have at least one item in the shipment, then save it - if (shipment != null && shipment.ShipmentItems.Any()) - { - shipment.TotalWeight = totalWeight; - _shipmentService.InsertShipment(shipment); - - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "A shipment has been added", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Orders.Shipments.Added")); - return continueEditing - ? RedirectToAction("ShipmentDetails", new {id = shipment.Id}) - : RedirectToAction("Edit", new { id = orderId }); - } - - ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoProductsSelected")); - return RedirectToAction("AddShipment", new { orderId = orderId }); - } - - public virtual ActionResult ShipmentDetails(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - var model = PrepareShipmentModel(shipment, true, true); - return View(model); - } - - [HttpPost] - public virtual ActionResult DeleteShipment(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - foreach (var shipmentItem in shipment.ShipmentItems) - { - var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); - if (orderItem == null) - continue; - - _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, - string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteShipment"), shipment.OrderId)); - } - - var orderId = shipment.OrderId; - _shipmentService.DeleteShipment(shipment); - - var order =_orderService.GetOrderById(orderId); - //add a note - order.OrderNotes.Add(new OrderNote - { - Note = "A shipment has been deleted", - DisplayToCustomer = false, - CreatedOnUtc = DateTime.UtcNow - }); - _orderService.UpdateOrder(order); - LogEditOrder(order.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Orders.Shipments.Deleted")); - return RedirectToAction("Edit", new { id = orderId }); - } - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("settrackingnumber")] - public virtual ActionResult SetTrackingNumber(ShipmentModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(model.Id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - shipment.TrackingNumber = model.TrackingNumber; - _shipmentService.UpdateShipment(shipment); - - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("setadmincomment")] - public virtual ActionResult SetShipmentAdminComment(ShipmentModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(model.Id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - shipment.AdminComment = model.AdminComment; - _shipmentService.UpdateShipment(shipment); - - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("setasshipped")] - public virtual ActionResult SetAsShipped(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - try - { - _orderProcessingService.Ship(shipment, true); - LogEditOrder(shipment.OrderId); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - catch (Exception exc) - { - //error - ErrorNotification(exc, true); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - } - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("saveshippeddate")] - public virtual ActionResult EditShippedDate(ShipmentModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(model.Id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - try - { - if (!model.ShippedDateUtc.HasValue) - { - throw new Exception("Enter shipped date"); - } - shipment.ShippedDateUtc = model.ShippedDateUtc; - _shipmentService.UpdateShipment(shipment); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - catch (Exception exc) - { - //error - ErrorNotification(exc, true); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - } - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("setasdelivered")] - public virtual ActionResult SetAsDelivered(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - try - { - _orderProcessingService.Deliver(shipment, true); - LogEditOrder(shipment.OrderId); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - catch (Exception exc) - { - //error - ErrorNotification(exc, true); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - } - - - [HttpPost, ActionName("ShipmentDetails")] - [FormValueRequired("savedeliverydate")] - public virtual ActionResult EditDeliveryDate(ShipmentModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(model.Id); - if (shipment == null) - //No shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - try - { - if (!model.DeliveryDateUtc.HasValue) - { - throw new Exception("Enter delivery date"); - } - shipment.DeliveryDateUtc = model.DeliveryDateUtc; - _shipmentService.UpdateShipment(shipment); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - catch (Exception exc) - { - //error - ErrorNotification(exc, true); - return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); - } - } - - public virtual ActionResult PdfPackagingSlip(int shipmentId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipment = _shipmentService.GetShipmentById(shipmentId); - if (shipment == null) - //no shipment found with the specified id - return RedirectToAction("List"); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) - return RedirectToAction("List"); - - var shipments = new List(); - shipments.Add(shipment); - - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, string.Format("packagingslip_{0}.pdf", shipment.Id)); - } - - [HttpPost, ActionName("ShipmentList")] - [FormValueRequired("exportpackagingslips-all")] - public virtual ActionResult PdfPackagingSlipAll(ShipmentListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - //a vendor should have access only to his products - int vendorId = 0; - if (_workContext.CurrentVendor != null) - vendorId = _workContext.CurrentVendor.Id; - - //load shipments - var shipments = _shipmentService.GetAllShipments(vendorId: vendorId, - warehouseId: model.WarehouseId, - shippingCountryId: model.CountryId, - shippingStateId: model.StateProvinceId, - shippingCity: model.City, - trackingNumber: model.TrackingNumber, - loadNotShipped: model.LoadNotShipped, - createdFromUtc: startDateValue, - createdToUtc: endDateValue); - - //ensure that we at least one shipment selected - if (!shipments.Any()) - { - ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected")); - return RedirectToAction("ShipmentList"); - } - - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, "packagingslips.pdf"); - } - - [HttpPost] - public virtual ActionResult PdfPackagingSlipSelected(string selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipments = new List(); - if (selectedIds != null) - { - var ids = selectedIds - .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(x => Convert.ToInt32(x)) - .ToArray(); - shipments.AddRange(_shipmentService.GetShipmentsByIds(ids)); - } - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - shipments = shipments.Where(HasAccessToShipment).ToList(); - } - - //ensure that we at least one shipment selected - if (!shipments.Any()) - { - ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected")); - return RedirectToAction("ShipmentList"); - } - - byte[] bytes; - using (var stream = new MemoryStream()) - { - _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); - bytes = stream.ToArray(); - } - return File(bytes, MimeTypes.ApplicationPdf, "packagingslips.pdf"); - } - - [HttpPost] - public virtual ActionResult SetAsShippedSelected(ICollection selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipments = new List(); - if (selectedIds != null) - { - shipments.AddRange(_shipmentService.GetShipmentsByIds(selectedIds.ToArray())); - } - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - shipments = shipments.Where(HasAccessToShipment).ToList(); - } - - foreach (var shipment in shipments) - { - try - { - _orderProcessingService.Ship(shipment, true); - } - catch - { - //ignore any exception - } - } - - return Json(new { Result = true }); - } - - [HttpPost] - public virtual ActionResult SetAsDeliveredSelected(ICollection selectedIds) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var shipments = new List(); - if (selectedIds != null) - { - shipments.AddRange(_shipmentService.GetShipmentsByIds(selectedIds.ToArray())); - } - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - shipments = shipments.Where(HasAccessToShipment).ToList(); - } - - foreach (var shipment in shipments) - { - try - { - _orderProcessingService.Deliver(shipment, true); - } - catch - { - //ignore any exception - } - } - - return Json(new { Result = true }); - } - - #endregion - - #region Order notes - - [HttpPost] - public virtual ActionResult OrderNotesSelect(int orderId, DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - throw new ArgumentException("No order found with the specified id"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return Content(""); - - //order notes - var orderNoteModels = new List(); - foreach (var orderNote in order.OrderNotes - .OrderByDescending(on => on.CreatedOnUtc)) - { - var download = _downloadService.GetDownloadById(orderNote.DownloadId); - orderNoteModels.Add(new OrderModel.OrderNote - { - Id = orderNote.Id, - OrderId = orderNote.OrderId, - DownloadId = orderNote.DownloadId, - DownloadGuid = download != null ? download.DownloadGuid : Guid.Empty, - DisplayToCustomer = orderNote.DisplayToCustomer, - Note = orderNote.FormatOrderNoteText(), - CreatedOn = _dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc) - }); - } - - var gridModel = new DataSourceResult - { - Data = orderNoteModels, - Total = orderNoteModels.Count - }; - - return Json(gridModel); - } - - [ValidateInput(false)] - public virtual ActionResult OrderNoteAdd(int orderId, int downloadId, bool displayToCustomer, string message) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - return Json(new { Result = false }, JsonRequestBehavior.AllowGet); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return Json(new { Result = false }, JsonRequestBehavior.AllowGet); - - var orderNote = new OrderNote - { - DisplayToCustomer = displayToCustomer, - Note = message, - DownloadId = downloadId, - CreatedOnUtc = DateTime.UtcNow, - }; - order.OrderNotes.Add(orderNote); - _orderService.UpdateOrder(order); - - //new order notification - if (displayToCustomer) - { - //email - _workflowMessageService.SendNewOrderNoteAddedCustomerNotification( - orderNote, _workContext.WorkingLanguage.Id); - - } - - return Json(new { Result = true }, JsonRequestBehavior.AllowGet); - } - - [HttpPost] - public virtual ActionResult OrderNoteDelete(int id, int orderId) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var order = _orderService.GetOrderById(orderId); - if (order == null) - throw new ArgumentException("No order found with the specified id"); - - //a vendor does not have access to this functionality - if (_workContext.CurrentVendor != null) - return RedirectToAction("Edit", "Order", new { id = orderId }); - - var orderNote = order.OrderNotes.FirstOrDefault(on => on.Id == id); - if (orderNote == null) - throw new ArgumentException("No order note found with the specified id"); - _orderService.DeleteOrderNote(orderNote); - - return new NullJsonResult(); - } - - #endregion - - #region Reports - - [NonAction] - protected virtual DataSourceResult GetBestsellersBriefReportModel(int pageIndex, - int pageSize, int orderBy) - { - //a vendor should have access only to his products - int vendorId = 0; - if (_workContext.CurrentVendor != null) - vendorId = _workContext.CurrentVendor.Id; - - var items = _orderReportService.BestSellersReport( - vendorId : vendorId, - orderBy: orderBy, - pageIndex: pageIndex, - pageSize: pageSize, - showHidden: true); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - { - var m = new BestsellersReportLineModel - { - ProductId = x.ProductId, - TotalAmount = _priceFormatter.FormatPrice(x.TotalAmount, true, false), - TotalQuantity = x.TotalQuantity, - }; - var product = _productService.GetProductById(x.ProductId); - if (product != null) - m.ProductName = product.Name; - return m; - }), - Total = items.TotalCount - }; - return gridModel; - } - public virtual ActionResult BestsellersBriefReportByQuantity() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - return PartialView(); - } - [HttpPost] - public virtual ActionResult BestsellersBriefReportByQuantityList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - var gridModel = GetBestsellersBriefReportModel(command.Page - 1, - command.PageSize, 1); - - return Json(gridModel); - } - public virtual ActionResult BestsellersBriefReportByAmount() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - return PartialView(); - } - [HttpPost] - public virtual ActionResult BestsellersBriefReportByAmountList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - var gridModel = GetBestsellersBriefReportModel(command.Page - 1, - command.PageSize, 2); - - return Json(gridModel); - } - - - - public virtual ActionResult BestsellersReport() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var model = new BestsellersReportModel(); - //vendor - model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; - - //stores - model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - foreach (var s in _storeService.GetAllStores()) - model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); - - //order statuses - model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //payment statuses - model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //categories - model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); - foreach (var c in categories) - model.AvailableCategories.Add(c); - - //manufacturers - model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); - foreach (var m in manufacturers) - model.AvailableManufacturers.Add(m); - - //billing countries - foreach (var c in _countryService.GetAllCountriesForBilling(showHidden: true)) - model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); - model.AvailableCountries.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //vendors - model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); - foreach (var v in vendors) - model.AvailableVendors.Add(v); - - return View(model); - } - [HttpPost] - public virtual ActionResult BestsellersReportList(DataSourceRequest command, BestsellersReportModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.VendorId = _workContext.CurrentVendor.Id; - } - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; - PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; - - var items = _orderReportService.BestSellersReport( - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - os: orderStatus, - ps: paymentStatus, - billingCountryId: model.BillingCountryId, - orderBy: 2, - vendorId: model.VendorId, - categoryId: model.CategoryId, - manufacturerId: model.ManufacturerId, - storeId: model.StoreId, - pageIndex: command.Page - 1, - pageSize: command.PageSize, - showHidden: true); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - { - var m = new BestsellersReportLineModel - { - ProductId = x.ProductId, - TotalAmount = _priceFormatter.FormatPrice(x.TotalAmount, true, false), - TotalQuantity = x.TotalQuantity, - }; - var product = _productService.GetProductById(x.ProductId); - if (product!= null) - m.ProductName = product.Name; - return m; - }), - Total = items.TotalCount - }; - - return Json(gridModel); - } - - - - public virtual ActionResult NeverSoldReport() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedView(); - - var model = new NeverSoldReportModel(); - - //a vendor should have access only to his products - model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; - - //categories - model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); - foreach (var c in categories) - model.AvailableCategories.Add(c); - - //manufacturers - model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); - foreach (var m in manufacturers) - model.AvailableManufacturers.Add(m); - - //stores - model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - foreach (var s in _storeService.GetAllStores()) - model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); - - //vendors - model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); - foreach (var v in vendors) - model.AvailableVendors.Add(v); - - - return View(model); - } - [HttpPost] - public virtual ActionResult NeverSoldReportList(DataSourceRequest command, NeverSoldReportModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor should have access only to his products - if (_workContext.CurrentVendor != null) - { - model.SearchVendorId = _workContext.CurrentVendor.Id; - } - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - var items = _orderReportService.ProductsNeverSold(vendorId: model.SearchVendorId, - storeId: model.SearchStoreId, - categoryId: model.SearchCategoryId, - manufacturerId: model.SearchManufacturerId, - createdFromUtc: startDateValue, - createdToUtc: endDateValue, - pageIndex : command.Page - 1, - pageSize: command.PageSize, - showHidden: true); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - new NeverSoldReportLineModel - { - ProductId = x.Id, - ProductName = x.Name, - }), - Total = items.TotalCount - }; - - return Json(gridModel); - } - - - [ChildActionOnly] - public virtual ActionResult OrderAverageReport() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - return PartialView(); - } - [HttpPost] - public virtual ActionResult OrderAverageReportList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor doesn't have access to this report - if (_workContext.CurrentVendor != null) - return Content(""); - - var report = new List(); - report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Pending)); - report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Processing)); - report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Complete)); - report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Cancelled)); - var model = report.Select(x => new OrderAverageReportLineSummaryModel - { - OrderStatus = x.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), - SumTodayOrders = _priceFormatter.FormatPrice(x.SumTodayOrders, true, false), - SumThisWeekOrders = _priceFormatter.FormatPrice(x.SumThisWeekOrders, true, false), - SumThisMonthOrders = _priceFormatter.FormatPrice(x.SumThisMonthOrders, true, false), - SumThisYearOrders = _priceFormatter.FormatPrice(x.SumThisYearOrders, true, false), - SumAllTimeOrders = _priceFormatter.FormatPrice(x.SumAllTimeOrders, true, false), - }).ToList(); - - var gridModel = new DataSourceResult - { - Data = model, - Total = model.Count - }; - - return Json(gridModel); - } - - [ChildActionOnly] - public virtual ActionResult OrderIncompleteReport() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - return PartialView(); - } - - [HttpPost] - public virtual ActionResult OrderIncompleteReportList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return AccessDeniedKendoGridJson(); - - //a vendor doesn't have access to this report - if (_workContext.CurrentVendor != null) - return Content(""); - - var model = new List(); - //not paid - var orderStatuses = Enum.GetValues(typeof(OrderStatus)).Cast().Where(os => os != (int)OrderStatus.Cancelled).ToList(); - var paymentStatuses = new List() { (int)PaymentStatus.Pending }; - var psPending = _orderReportService.GetOrderAverageReportLine(psIds: paymentStatuses, osIds: orderStatuses); - model.Add(new OrderIncompleteReportLineModel - { - Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalUnpaidOrders"), - Count = psPending.CountOrders, - Total = _priceFormatter.FormatPrice(psPending.SumOrders, true, false), - ViewLink = Url.Action("List", "Order", new { - orderStatusIds = string.Join(",", orderStatuses), - paymentStatusIds = string.Join(",", paymentStatuses) }) - }); - //not shipped - var shippingStatuses = new List() { (int)ShippingStatus.NotYetShipped }; - var ssPending = _orderReportService.GetOrderAverageReportLine(osIds: orderStatuses, ssIds: shippingStatuses); - model.Add(new OrderIncompleteReportLineModel - { - Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalNotShippedOrders"), - Count = ssPending.CountOrders, - Total = _priceFormatter.FormatPrice(ssPending.SumOrders, true, false), - ViewLink = Url.Action("List", "Order", new { - orderStatusIds = string.Join(",", orderStatuses), - shippingStatusIds = string.Join(",", shippingStatuses) }) - }); - //pending - orderStatuses = new List() { (int)OrderStatus.Pending }; - var osPending = _orderReportService.GetOrderAverageReportLine(osIds: orderStatuses); - model.Add(new OrderIncompleteReportLineModel - { - Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalIncompleteOrders"), - Count = osPending.CountOrders, - Total = _priceFormatter.FormatPrice(osPending.SumOrders, true, false), - ViewLink = Url.Action("List", "Order", new { orderStatusIds = string.Join(",", orderStatuses) }) - }); - - var gridModel = new DataSourceResult - { - Data = model, - Total = model.Count - }; - - return Json(gridModel); - } - - public virtual ActionResult CountryReport() - { - if (!_permissionService.Authorize(StandardPermissionProvider.OrderCountryReport)) - return AccessDeniedView(); - - var model = new CountryReportModel(); - - //order statuses - model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); - model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - //payment statuses - model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); - model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); - - return View(model); - } - - [HttpPost] - public virtual ActionResult CountryReportList(DataSourceRequest command, CountryReportModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.OrderCountryReport)) - return AccessDeniedKendoGridJson(); - - DateTime? startDateValue = (model.StartDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); - - DateTime? endDateValue = (model.EndDate == null) ? null - : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); - - OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; - PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; - - var items = _orderReportService.GetCountryReport( - os: orderStatus, - ps: paymentStatus, - startTimeUtc: startDateValue, - endTimeUtc: endDateValue); - var gridModel = new DataSourceResult - { - Data = items.Select(x => - { - var country = _countryService.GetCountryById(x.CountryId.HasValue ? x.CountryId.Value : 0); - var m = new CountryReportLineModel - { - CountryName = country != null ? country.Name : "Unknown", - SumOrders = _priceFormatter.FormatPrice(x.SumOrders, true, false), - TotalOrders = x.TotalOrders, - }; - return m; - }), - Total = items.Count - }; - - return Json(gridModel); - } - - [ChildActionOnly] - public virtual ActionResult OrderStatistics() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - //a vendor doesn't have access to this report - if (_workContext.CurrentVendor != null) - return Content(""); - - return PartialView(); - } - - [AcceptVerbs(HttpVerbs.Get)] - public virtual ActionResult LoadOrderStatistics(string period) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - //a vendor doesn't have access to this report - if (_workContext.CurrentVendor != null) - return Content(""); - - var result = new List(); - - var nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); - var timeZone = _dateTimeHelper.CurrentTimeZone; - - var culture = new CultureInfo(_workContext.WorkingLanguage.LanguageCulture); - - switch (period) - { - case "year": - //year statistics - var yearAgoDt = nowDt.AddYears(-1).AddMonths(1); - var searchYearDateUser = new DateTime(yearAgoDt.Year, yearAgoDt.Month, 1); - if (!timeZone.IsInvalidTime(searchYearDateUser)) - { - for (int i = 0; i <= 12; i++) - { - result.Add(new - { - date = searchYearDateUser.Date.ToString("Y", culture), - value = _orderService.SearchOrders( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser.AddMonths(1), timeZone), - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchYearDateUser = searchYearDateUser.AddMonths(1); - } - } - break; - - case "month": - //month statistics - var monthAgoDt = nowDt.AddDays(-30); - var searchMonthDateUser = new DateTime(monthAgoDt.Year, monthAgoDt.Month, monthAgoDt.Day); - if (!timeZone.IsInvalidTime(searchMonthDateUser)) - { - for (int i = 0; i <= 30; i++) - { - result.Add(new - { - date = searchMonthDateUser.Date.ToString("M", culture), - value = _orderService.SearchOrders( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser.AddDays(1), timeZone), - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchMonthDateUser = searchMonthDateUser.AddDays(1); - } - } - break; - - case "week": - default: - //week statistics - var weekAgoDt = nowDt.AddDays(-7); - var searchWeekDateUser = new DateTime(weekAgoDt.Year, weekAgoDt.Month, weekAgoDt.Day); - if (!timeZone.IsInvalidTime(searchWeekDateUser)) - { - for (int i = 0; i <= 7; i++) - { - result.Add(new - { - date = searchWeekDateUser.Date.ToString("d dddd", culture), - value = _orderService.SearchOrders( - createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser, timeZone), - createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser.AddDays(1), timeZone), - pageIndex: 0, - pageSize: 1).TotalCount.ToString() - }); - - searchWeekDateUser = searchWeekDateUser.AddDays(1); - } - } - break; - } - - return Json(result, JsonRequestBehavior.AllowGet); - } - - [ChildActionOnly] - public virtual ActionResult LatestOrders() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) - return Content(""); - - return PartialView(); - } - - #endregion - - #region Activity log - - [NonAction] - protected virtual void LogEditOrder(int orderId) - { - var order = _orderService.GetOrderById(orderId); - - _customerActivityService.InsertActivity("EditOrder", _localizationService.GetResource("ActivityLog.EditOrder"), order.CustomOrderNumber); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Web.Mvc; +using Nop.Admin.Extensions; +using Nop.Admin.Helpers; +using Nop.Admin.Models.Orders; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Services; +using Nop.Services.Affiliates; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Directory; +using Nop.Services.Discounts; +using Nop.Services.ExportImport; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Media; +using Nop.Services.Messages; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Security; +using Nop.Services.Shipping; +using Nop.Services.Shipping.Tracking; +using Nop.Services.Stores; +using Nop.Services.Tax; +using Nop.Services.Vendors; +using Nop.Web.Framework.Controllers; +using Nop.Web.Framework.Kendoui; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Controllers +{ + public partial class OrderController : BaseAdminController + { + #region Fields + + private readonly IOrderService _orderService; + private readonly IOrderReportService _orderReportService; + private readonly IOrderProcessingService _orderProcessingService; + private readonly IReturnRequestService _returnRequestService; + private readonly IPriceCalculationService _priceCalculationService; + private readonly ITaxService _taxService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IPriceFormatter _priceFormatter; + private readonly IDiscountService _discountService; + private readonly ILocalizationService _localizationService; + private readonly IWorkContext _workContext; + private readonly ICurrencyService _currencyService; + private readonly IEncryptionService _encryptionService; + private readonly IPaymentService _paymentService; + private readonly IMeasureService _measureService; + private readonly IPdfService _pdfService; + private readonly IAddressService _addressService; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly IProductService _productService; + private readonly IExportManager _exportManager; + private readonly IPermissionService _permissionService; + private readonly IWorkflowMessageService _workflowMessageService; + private readonly ICategoryService _categoryService; + private readonly IManufacturerService _manufacturerService; + private readonly IProductAttributeService _productAttributeService; + private readonly IProductAttributeParser _productAttributeParser; + private readonly IProductAttributeFormatter _productAttributeFormatter; + private readonly IShoppingCartService _shoppingCartService; + private readonly IGiftCardService _giftCardService; + private readonly IDownloadService _downloadService; + private readonly IShipmentService _shipmentService; + private readonly IShippingService _shippingService; + private readonly IStoreService _storeService; + private readonly IVendorService _vendorService; + private readonly IAddressAttributeParser _addressAttributeParser; + private readonly IAddressAttributeService _addressAttributeService; + private readonly IAddressAttributeFormatter _addressAttributeFormatter; + private readonly IAffiliateService _affiliateService; + private readonly IPictureService _pictureService; + private readonly ICustomerActivityService _customerActivityService; + private readonly ICacheManager _cacheManager; + + private readonly OrderSettings _orderSettings; + private readonly CurrencySettings _currencySettings; + private readonly TaxSettings _taxSettings; + private readonly MeasureSettings _measureSettings; + private readonly AddressSettings _addressSettings; + private readonly ShippingSettings _shippingSettings; + + #endregion + + #region Ctor + + public OrderController(IOrderService orderService, + IOrderReportService orderReportService, + IOrderProcessingService orderProcessingService, + IReturnRequestService returnRequestService, + IPriceCalculationService priceCalculationService, + ITaxService taxService, + IDateTimeHelper dateTimeHelper, + IPriceFormatter priceFormatter, + IDiscountService discountService, + ILocalizationService localizationService, + IWorkContext workContext, + ICurrencyService currencyService, + IEncryptionService encryptionService, + IPaymentService paymentService, + IMeasureService measureService, + IPdfService pdfService, + IAddressService addressService, + ICountryService countryService, + IStateProvinceService stateProvinceService, + IProductService productService, + IExportManager exportManager, + IPermissionService permissionService, + IWorkflowMessageService workflowMessageService, + ICategoryService categoryService, + IManufacturerService manufacturerService, + IProductAttributeService productAttributeService, + IProductAttributeParser productAttributeParser, + IProductAttributeFormatter productAttributeFormatter, + IShoppingCartService shoppingCartService, + IGiftCardService giftCardService, + IDownloadService downloadService, + IShipmentService shipmentService, + IShippingService shippingService, + IStoreService storeService, + IVendorService vendorService, + IAddressAttributeParser addressAttributeParser, + IAddressAttributeService addressAttributeService, + IAddressAttributeFormatter addressAttributeFormatter, + IAffiliateService affiliateService, + IPictureService pictureService, + ICustomerActivityService customerActivityService, + ICacheManager cacheManager, + OrderSettings orderSettings, + CurrencySettings currencySettings, + TaxSettings taxSettings, + MeasureSettings measureSettings, + AddressSettings addressSettings, + ShippingSettings shippingSettings) + { + this._orderService = orderService; + this._orderReportService = orderReportService; + this._orderProcessingService = orderProcessingService; + this._returnRequestService = returnRequestService; + this._priceCalculationService = priceCalculationService; + this._taxService = taxService; + this._dateTimeHelper = dateTimeHelper; + this._priceFormatter = priceFormatter; + this._discountService = discountService; + this._localizationService = localizationService; + this._workContext = workContext; + this._currencyService = currencyService; + this._encryptionService = encryptionService; + this._paymentService = paymentService; + this._measureService = measureService; + this._pdfService = pdfService; + this._addressService = addressService; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._productService = productService; + this._exportManager = exportManager; + this._permissionService = permissionService; + this._workflowMessageService = workflowMessageService; + this._categoryService = categoryService; + this._manufacturerService = manufacturerService; + this._productAttributeService = productAttributeService; + this._productAttributeParser = productAttributeParser; + this._productAttributeFormatter = productAttributeFormatter; + this._shoppingCartService = shoppingCartService; + this._giftCardService = giftCardService; + this._downloadService = downloadService; + this._shipmentService = shipmentService; + this._shippingService = shippingService; + this._storeService = storeService; + this._vendorService = vendorService; + this._addressAttributeParser = addressAttributeParser; + this._addressAttributeService = addressAttributeService; + this._addressAttributeFormatter = addressAttributeFormatter; + this._affiliateService = affiliateService; + this._pictureService = pictureService; + this._customerActivityService = customerActivityService; + this._cacheManager = cacheManager; + this._orderSettings = orderSettings; + this._currencySettings = currencySettings; + this._taxSettings = taxSettings; + this._measureSettings = measureSettings; + this._addressSettings = addressSettings; + this._shippingSettings = shippingSettings; + } + + #endregion + + #region Utilities + + [NonAction] + protected virtual bool HasAccessToOrder(Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (_workContext.CurrentVendor == null) + //not a vendor; has access + return true; + + var vendorId = _workContext.CurrentVendor.Id; + var hasVendorProducts = order.OrderItems.Any(orderItem => orderItem.Product.VendorId == vendorId); + return hasVendorProducts; + } + + [NonAction] + protected virtual bool HasAccessToOrderItem(OrderItem orderItem) + { + if (orderItem == null) + throw new ArgumentNullException("orderItem"); + + if (_workContext.CurrentVendor == null) + //not a vendor; has access + return true; + + var vendorId = _workContext.CurrentVendor.Id; + return orderItem.Product.VendorId == vendorId; + } + + [NonAction] + protected virtual bool HasAccessToProduct(Product product) + { + if (product == null) + throw new ArgumentNullException("product"); + + if (_workContext.CurrentVendor == null) + //not a vendor; has access + return true; + + var vendorId = _workContext.CurrentVendor.Id; + return product.VendorId == vendorId; + } + + [NonAction] + protected virtual bool HasAccessToShipment(Shipment shipment) + { + if (shipment == null) + throw new ArgumentNullException("shipment"); + + if (_workContext.CurrentVendor == null) + //not a vendor; has access + return true; + + var hasVendorProducts = false; + var vendorId = _workContext.CurrentVendor.Id; + foreach (var shipmentItem in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); + if (orderItem != null) + { + if (orderItem.Product.VendorId == vendorId) + { + hasVendorProducts = true; + break; + } + } + } + return hasVendorProducts; + } + + /// + /// Parse product attributes on the add product to order details page + /// + /// Product + /// Form + /// Errors + /// Parsed attributes + [NonAction] + protected virtual string ParseProductAttributes(Product product, FormCollection form, List errors) + { + var attributesXml = string.Empty; + + #region Product attributes + + var productAttributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); + foreach (var attribute in productAttributes) + { + var controlId = string.Format("product_attribute_{0}", attribute.Id); + switch (attribute.AttributeControlType) + { + case AttributeControlType.DropdownList: + case AttributeControlType.RadioList: + case AttributeControlType.ColorSquares: + case AttributeControlType.ImageSquares: + { + var ctrlAttributes = form[controlId]; + if (!String.IsNullOrEmpty(ctrlAttributes)) + { + int selectedAttributeId = int.Parse(ctrlAttributes); + if (selectedAttributeId > 0) + { + //get quantity entered by customer + var quantity = 1; + var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, selectedAttributeId)]; + if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) + errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); + + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); + } + } + } + break; + case AttributeControlType.Checkboxes: + { + var ctrlAttributes = form[controlId]; + if (!String.IsNullOrEmpty(ctrlAttributes)) + { + foreach (var item in ctrlAttributes.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) + { + int selectedAttributeId = int.Parse(item); + if (selectedAttributeId > 0) + { + //get quantity entered by customer + var quantity = 1; + var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, item)]; + if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) + errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); + + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); + } + } + } + } + break; + case AttributeControlType.ReadonlyCheckboxes: + { + //load read-only (already server-side selected) values + var attributeValues = _productAttributeService.GetProductAttributeValues(attribute.Id); + foreach (var selectedAttributeId in attributeValues + .Where(v => v.IsPreSelected) + .Select(v => v.Id) + .ToList()) + { + //get quantity entered by customer + var quantity = 1; + var quantityStr = form[string.Format("product_attribute_{0}_{1}_qty", attribute.Id, selectedAttributeId)]; + if (quantityStr != null && (!int.TryParse(quantityStr, out quantity) || quantity < 1)) + errors.Add(_localizationService.GetResource("ShoppingCart.QuantityShouldPositive")); + + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, selectedAttributeId.ToString(), quantity > 1 ? (int?)quantity : null); + } + } + break; + case AttributeControlType.TextBox: + case AttributeControlType.MultilineTextbox: + { + var ctrlAttributes = form[controlId]; + if (!String.IsNullOrEmpty(ctrlAttributes)) + { + string enteredText = ctrlAttributes.Trim(); + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, enteredText); + } + } + break; + case AttributeControlType.Datepicker: + { + var day = form[controlId + "_day"]; + var month = form[controlId + "_month"]; + var year = form[controlId + "_year"]; + DateTime? selectedDate = null; + try + { + selectedDate = new DateTime(Int32.Parse(year), Int32.Parse(month), Int32.Parse(day)); + } + catch { } + if (selectedDate.HasValue) + { + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, selectedDate.Value.ToString("D")); + } + } + break; + case AttributeControlType.FileUpload: + { + Guid downloadGuid; + Guid.TryParse(form[controlId], out downloadGuid); + var download = _downloadService.GetDownloadByGuid(downloadGuid); + if (download != null) + { + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, download.DownloadGuid.ToString()); + } + } + break; + default: + break; + } + } + //validate conditional attributes (if specified) + foreach (var attribute in productAttributes) + { + var conditionMet = _productAttributeParser.IsConditionMet(attribute, attributesXml); + if (conditionMet.HasValue && !conditionMet.Value) + { + attributesXml = _productAttributeParser.RemoveProductAttribute(attributesXml, attribute); + } + } + + #endregion + + return attributesXml; + } + + /// + /// Parse rental dates on the add product to order details page + /// + /// Form + /// Start date + /// End date + [NonAction] + protected virtual void ParseRentalDates(FormCollection form, + out DateTime? startDate, out DateTime? endDate) + { + startDate = null; + endDate = null; + + var ctrlStartDate = form["rental_start_date"]; + var ctrlEndDate = form["rental_end_date"]; + try + { + const string datePickerFormat = "MM/dd/yyyy"; + startDate = DateTime.ParseExact(ctrlStartDate, datePickerFormat, CultureInfo.InvariantCulture); + endDate = DateTime.ParseExact(ctrlEndDate, datePickerFormat, CultureInfo.InvariantCulture); + } + catch + { + } + } + + [NonAction] + protected virtual void PrepareOrderDetailsModel(OrderModel model, Order order) + { + if (order == null) + throw new ArgumentNullException("order"); + + if (model == null) + throw new ArgumentNullException("model"); + + model.Id = order.Id; + model.InvoiceId = order.InvoiceId; + model.InvoiceDateUtc = order.InvoiceDateUtc; + model.OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext); + model.OrderStatusId = order.OrderStatusId; + model.OrderGuid = order.OrderGuid; + model.CustomOrderNumber = order.CustomOrderNumber; + var store = _storeService.GetStoreById(order.StoreId); + model.StoreName = store != null ? store.Name : "Unknown"; + model.CustomerId = order.CustomerId; + var customer = order.Customer; + model.CustomerInfo = customer.IsRegistered() ? customer.Email : _localizationService.GetResource("Admin.Customers.Guest"); + model.CustomerIp = order.CustomerIp; + model.VatNumber = order.VatNumber; + model.CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc); + model.AllowCustomersToSelectTaxDisplayType = _taxSettings.AllowCustomersToSelectTaxDisplayType; + model.TaxDisplayType = _taxSettings.TaxDisplayType; + + var affiliate = _affiliateService.GetAffiliateById(order.AffiliateId); + if (affiliate != null) + { + model.AffiliateId = affiliate.Id; + model.AffiliateName = affiliate.GetFullName(); + } + + //a vendor should have access only to his products + model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; + //custom values + model.CustomValues = order.DeserializeCustomValues(); + + #region Order totals + + var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + if (primaryStoreCurrency == null) + throw new Exception("Cannot load primary store currency"); + + //subtotal + model.OrderSubtotalInclTax = _priceFormatter.FormatPrice(order.OrderSubtotalInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); + model.OrderSubtotalExclTax = _priceFormatter.FormatPrice(order.OrderSubtotalExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + model.OrderSubtotalInclTaxValue = order.OrderSubtotalInclTax; + model.OrderSubtotalExclTaxValue = order.OrderSubtotalExclTax; + //discount (applied to order subtotal) + string orderSubtotalDiscountInclTaxStr = _priceFormatter.FormatPrice(order.OrderSubTotalDiscountInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); + string orderSubtotalDiscountExclTaxStr = _priceFormatter.FormatPrice(order.OrderSubTotalDiscountExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + if (order.OrderSubTotalDiscountInclTax > decimal.Zero) + model.OrderSubTotalDiscountInclTax = orderSubtotalDiscountInclTaxStr; + if (order.OrderSubTotalDiscountExclTax > decimal.Zero) + model.OrderSubTotalDiscountExclTax = orderSubtotalDiscountExclTaxStr; + model.OrderSubTotalDiscountInclTaxValue = order.OrderSubTotalDiscountInclTax; + model.OrderSubTotalDiscountExclTaxValue = order.OrderSubTotalDiscountExclTax; + + //shipping + model.OrderShippingInclTax = _priceFormatter.FormatShippingPrice(order.OrderShippingInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); + model.OrderShippingExclTax = _priceFormatter.FormatShippingPrice(order.OrderShippingExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + model.OrderShippingNonTaxable = _priceFormatter.FormatPrice(order.OrderShippingNonTaxable, true, false); + model.OrderShippingInclTaxValue = order.OrderShippingInclTax; + model.OrderShippingExclTaxValue = order.OrderShippingExclTax; + model.OrderShippingNonTaxableValue = order.OrderShippingNonTaxable; + + //payment method additional fee + if (order.PaymentMethodAdditionalFeeInclTax > decimal.Zero) + { + model.PaymentMethodAdditionalFeeInclTax = _priceFormatter.FormatPaymentMethodAdditionalFee(order.PaymentMethodAdditionalFeeInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); + model.PaymentMethodAdditionalFeeExclTax = _priceFormatter.FormatPaymentMethodAdditionalFee(order.PaymentMethodAdditionalFeeExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + model.PaymentMethodAdditionalFeeNonTaxable = _priceFormatter.FormatPaymentMethodAdditionalFee(order.PaymentMethodAdditionalFeeNonTaxable, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + } + model.PaymentMethodAdditionalFeeInclTaxValue = order.PaymentMethodAdditionalFeeInclTax; + model.PaymentMethodAdditionalFeeExclTaxValue = order.PaymentMethodAdditionalFeeExclTax; + model.PaymentMethodAdditionalFeeNonTaxableValue = order.PaymentMethodAdditionalFeeNonTaxable; + + + //tax + model.Tax = _priceFormatter.FormatPrice(order.OrderTax, true, false); + SortedDictionary taxRates = order.TaxRatesDictionary; + bool displayTaxRates = _taxSettings.DisplayTaxRates && taxRates.Any(); + bool displayTax = !displayTaxRates; + foreach (var tr in order.TaxRatesDictionary) + { + model.TaxRates.Add(new OrderModel.TaxRate + { + Rate = _priceFormatter.FormatTaxRate(tr.Key), + Amount = _priceFormatter.FormatPrice(tr.Value.Amount, true, false), + DiscountAmount = _priceFormatter.FormatPrice(tr.Value.DiscountAmount, true, false), + BaseAmount = _priceFormatter.FormatPrice(tr.Value.BaseAmount, true, false), + TaxAmount = _priceFormatter.FormatPrice(tr.Value.TaxAmount, true, false), + }); + } + model.DisplayTaxRates = displayTaxRates; + model.DisplayTax = displayTax; + model.TaxValue = order.OrderTax; + model.TaxRatesValue = order.TaxRates; + + //discount + if (order.OrderDiscount > 0) + { + model.OrderTotalDiscount = _priceFormatter.FormatPrice(-order.OrderDiscount, true, false); + model.OrderTotalDiscountIncl = _priceFormatter.FormatPrice(-order.OrderDiscountIncl, true, false); + } + model.OrderTotalDiscountValue = order.OrderDiscount; + model.OrderTotalDiscountInclValue = order.OrderDiscountIncl; + + //gift cards + foreach (var gcuh in order.GiftCardUsageHistory) + { + model.GiftCards.Add(new OrderModel.GiftCard + { + CouponCode = gcuh.GiftCard.GiftCardCouponCode, + Amount = _priceFormatter.FormatPrice(-gcuh.UsedValue, true, false), + }); + } + + //reward points + if (order.RedeemedRewardPointsEntry != null) + { + model.RedeemedRewardPoints = -order.RedeemedRewardPointsEntry.Points; + model.RedeemedRewardPointsAmount = _priceFormatter.FormatPrice(-order.RedeemedRewardPointsEntry.UsedAmount, true, false); + } + + //total + model.OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false); + model.OrderTotalValue = order.OrderTotal; + model.OrderTotalAmountIncl = _priceFormatter.FormatPrice(order.OrderTotalAmountIncl, true, false); + model.OrderAmount = _priceFormatter.FormatPrice(order.OrderAmount, true, false); + model.OrderAmountValue = order.OrderAmount; + model.OrderAmountIncl = _priceFormatter.FormatPrice(order.OrderAmountIncl, true, false); + model.OrderAmountInclValue = order.OrderAmountIncl; + model.EarnedRewardPointsBaseAmountExcl = _priceFormatter.FormatPrice(order.EarnedRewardPointsBaseAmountExcl, true, primaryStoreCurrency, _workContext.WorkingLanguage, false); + model.EarnedRewardPointsBaseAmountExclValue = order.EarnedRewardPointsBaseAmountExcl; + model.EarnedRewardPointsBaseAmountIncl = _priceFormatter.FormatPrice(order.EarnedRewardPointsBaseAmountIncl, true, primaryStoreCurrency, _workContext.WorkingLanguage, true); + model.EarnedRewardPointsBaseAmountInclValue = order.EarnedRewardPointsBaseAmountIncl; + + //refunded amount + if (order.RefundedAmount > decimal.Zero) + model.RefundedAmount = _priceFormatter.FormatPrice(order.RefundedAmount, true, false); + + //used discounts + var duh = _discountService.GetAllDiscountUsageHistory(orderId: order.Id); + foreach (var d in duh) + { + model.UsedDiscounts.Add(new OrderModel.UsedDiscountModel + { + DiscountId = d.DiscountId, + DiscountName = d.Discount.Name + }); + } + + //profit (hide for vendors) + if (_workContext.CurrentVendor == null) + { + var profit = _orderReportService.ProfitReport(orderId: order.Id); + model.Profit = _priceFormatter.FormatPrice(profit, true, false); + } + + #endregion + + #region Payment info + + if (order.AllowStoringCreditCardNumber) + { + //card type + model.CardType = _encryptionService.DecryptText(order.CardType); + //cardholder name + model.CardName = _encryptionService.DecryptText(order.CardName); + //card number + model.CardNumber = _encryptionService.DecryptText(order.CardNumber); + //cvv + model.CardCvv2 = _encryptionService.DecryptText(order.CardCvv2); + //expiry date + string cardExpirationMonthDecrypted = _encryptionService.DecryptText(order.CardExpirationMonth); + if (!String.IsNullOrEmpty(cardExpirationMonthDecrypted) && cardExpirationMonthDecrypted != "0") + model.CardExpirationMonth = cardExpirationMonthDecrypted; + string cardExpirationYearDecrypted = _encryptionService.DecryptText(order.CardExpirationYear); + if (!String.IsNullOrEmpty(cardExpirationYearDecrypted) && cardExpirationYearDecrypted != "0") + model.CardExpirationYear = cardExpirationYearDecrypted; + + model.AllowStoringCreditCardNumber = true; + } + else + { + string maskedCreditCardNumberDecrypted = _encryptionService.DecryptText(order.MaskedCreditCardNumber); + if (!String.IsNullOrEmpty(maskedCreditCardNumberDecrypted)) + model.CardNumber = maskedCreditCardNumberDecrypted; + } + + + //payment transaction info + model.AuthorizationTransactionId = order.AuthorizationTransactionId; + model.CaptureTransactionId = order.CaptureTransactionId; + model.SubscriptionTransactionId = order.SubscriptionTransactionId; + + //payment method info + var pm = _paymentService.LoadPaymentMethodBySystemName(order.PaymentMethodSystemName); + model.PaymentMethod = pm != null ? pm.PluginDescriptor.FriendlyName : order.PaymentMethodSystemName; + model.PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext); + + //payment method buttons + model.CanCancelOrder = _orderProcessingService.CanCancelOrder(order); + model.CanCapture = _orderProcessingService.CanCapture(order); + model.CanMarkOrderAsPaid = _orderProcessingService.CanMarkOrderAsPaid(order); + model.CanRefund = _orderProcessingService.CanRefund(order); + model.CanRefundOffline = _orderProcessingService.CanRefundOffline(order); + model.CanPartiallyRefund = _orderProcessingService.CanPartiallyRefund(order, decimal.Zero); + model.CanPartiallyRefundOffline = _orderProcessingService.CanPartiallyRefundOffline(order, decimal.Zero); + model.CanVoid = _orderProcessingService.CanVoid(order); + model.CanVoidOffline = _orderProcessingService.CanVoidOffline(order); + + model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode; + model.MaxAmountToRefund = order.OrderTotal - order.RefundedAmount; + + //recurring payment record + var recurringPayment = _orderService.SearchRecurringPayments(initialOrderId: order.Id, showHidden: true).FirstOrDefault(); + if (recurringPayment != null) + { + model.RecurringPaymentId = recurringPayment.Id; + } + #endregion + + #region Billing & shipping info + + model.BillingAddress = order.BillingAddress.ToModel(); + model.BillingAddress.FormattedCustomAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.BillingAddress.CustomAttributes); + model.BillingAddress.FirstNameEnabled = true; + model.BillingAddress.FirstNameRequired = true; + model.BillingAddress.LastNameEnabled = true; + model.BillingAddress.LastNameRequired = true; + model.BillingAddress.EmailEnabled = true; + model.BillingAddress.EmailRequired = true; + model.BillingAddress.CompanyEnabled = _addressSettings.CompanyEnabled; + model.BillingAddress.CompanyRequired = _addressSettings.CompanyRequired; + model.BillingAddress.CountryEnabled = _addressSettings.CountryEnabled; + model.BillingAddress.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled + model.BillingAddress.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; + model.BillingAddress.StateProvinceRequired = _addressSettings.StateProvinceEnabled; //province is required when enabled + model.BillingAddress.CityEnabled = _addressSettings.CityEnabled; + model.BillingAddress.CityRequired = _addressSettings.CityRequired; + model.BillingAddress.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; + model.BillingAddress.StreetAddressRequired = _addressSettings.StreetAddressRequired; + model.BillingAddress.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; + model.BillingAddress.StreetAddress2Required = _addressSettings.StreetAddress2Required; + model.BillingAddress.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; + model.BillingAddress.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; + model.BillingAddress.PhoneEnabled = _addressSettings.PhoneEnabled; + model.BillingAddress.PhoneRequired = _addressSettings.PhoneRequired; + model.BillingAddress.FaxEnabled = _addressSettings.FaxEnabled; + model.BillingAddress.FaxRequired = _addressSettings.FaxRequired; + + model.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext); ; + if (order.ShippingStatus != ShippingStatus.ShippingNotRequired) + { + model.IsShippable = true; + + model.PickUpInStore = order.PickUpInStore; + if (!order.PickUpInStore) + { + model.ShippingAddress = order.ShippingAddress.ToModel(); + model.ShippingAddress.FormattedCustomAddressAttributes = _addressAttributeFormatter.FormatAttributes(order.ShippingAddress.CustomAttributes); + model.ShippingAddress.FirstNameEnabled = true; + model.ShippingAddress.FirstNameRequired = true; + model.ShippingAddress.LastNameEnabled = true; + model.ShippingAddress.LastNameRequired = true; + model.ShippingAddress.EmailEnabled = true; + model.ShippingAddress.EmailRequired = true; + model.ShippingAddress.CompanyEnabled = _addressSettings.CompanyEnabled; + model.ShippingAddress.CompanyRequired = _addressSettings.CompanyRequired; + model.ShippingAddress.CountryEnabled = _addressSettings.CountryEnabled; + model.ShippingAddress.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled + model.ShippingAddress.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; + model.ShippingAddress.StateProvinceRequired = _addressSettings.StateProvinceEnabled;//province is required when enabled + model.ShippingAddress.CityEnabled = _addressSettings.CityEnabled; + model.ShippingAddress.CityRequired = _addressSettings.CityRequired; + model.ShippingAddress.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; + model.ShippingAddress.StreetAddressRequired = _addressSettings.StreetAddressRequired; + model.ShippingAddress.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; + model.ShippingAddress.StreetAddress2Required = _addressSettings.StreetAddress2Required; + model.ShippingAddress.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; + model.ShippingAddress.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; + model.ShippingAddress.PhoneEnabled = _addressSettings.PhoneEnabled; + model.ShippingAddress.PhoneRequired = _addressSettings.PhoneRequired; + model.ShippingAddress.FaxEnabled = _addressSettings.FaxEnabled; + model.ShippingAddress.FaxRequired = _addressSettings.FaxRequired; + + model.ShippingAddressGoogleMapsUrl = string.Format("http://maps.google.com/maps?f=q&hl=en&ie=UTF8&oe=UTF8&geocode=&q={0}", Server.UrlEncode(order.ShippingAddress.Address1 + " " + order.ShippingAddress.ZipPostalCode + " " + order.ShippingAddress.City + " " + (order.ShippingAddress.Country != null ? order.ShippingAddress.Country.Name : ""))); + } + else + { + if (order.PickupAddress != null) + { + model.PickupAddress = order.PickupAddress.ToModel(); + model.PickupAddressGoogleMapsUrl = string.Format("http://maps.google.com/maps?f=q&hl=en&ie=UTF8&oe=UTF8&geocode=&q={0}", + Server.UrlEncode(string.Format("{0} {1} {2} {3}", order.PickupAddress.Address1, order.PickupAddress.ZipPostalCode, order.PickupAddress.City, + order.PickupAddress.Country != null ? order.PickupAddress.Country.Name : string.Empty))); + } + } + model.ShippingMethod = order.ShippingMethod; + + model.CanAddNewShipments = order.HasItemsToAddToShipment(); + } + + #endregion + + #region Products + + model.CheckoutAttributeInfo = order.CheckoutAttributeDescription; + bool hasDownloadableItems = false; + var products = order.OrderItems; + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + products = products + .Where(orderItem => orderItem.Product.VendorId == _workContext.CurrentVendor.Id) + .ToList(); + } + foreach (var orderItem in products) + { + if (orderItem.Product.IsDownload) + hasDownloadableItems = true; + + var orderItemModel = new OrderModel.OrderItemModel + { + Id = orderItem.Id, + ProductId = orderItem.ProductId, + ProductName = orderItem.Product.Name, + Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), + Quantity = orderItem.Quantity, + IsDownload = orderItem.Product.IsDownload, + DownloadCount = orderItem.DownloadCount, + DownloadActivationType = orderItem.Product.DownloadActivationType, + IsDownloadActivated = orderItem.IsDownloadActivated, + TaxRate = orderItem.TaxRate + }; + //picture + var orderItemPicture = orderItem.Product.GetProductPicture(orderItem.AttributesXml, _pictureService, _productAttributeParser); + orderItemModel.PictureThumbnailUrl = _pictureService.GetPictureUrl(orderItemPicture, 75, true); + + //license file + if (orderItem.LicenseDownloadId.HasValue) + { + var licenseDownload = _downloadService.GetDownloadById(orderItem.LicenseDownloadId.Value); + if (licenseDownload != null) + { + orderItemModel.LicenseDownloadGuid = licenseDownload.DownloadGuid; + } + } + //vendor + var vendor = _vendorService.GetVendorById(orderItem.Product.VendorId); + orderItemModel.VendorName = vendor != null ? vendor.Name : ""; + + //unit price + orderItemModel.UnitPriceInclTaxValue = orderItem.UnitPriceInclTax; + orderItemModel.UnitPriceExclTaxValue = orderItem.UnitPriceExclTax; + orderItemModel.UnitPriceInclTax = _priceFormatter.FormatPrice(orderItem.UnitPriceInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); + orderItemModel.UnitPriceExclTax = _priceFormatter.FormatPrice(orderItem.UnitPriceExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); + //discounts + orderItemModel.DiscountInclTaxValue = orderItem.DiscountAmountInclTax; + orderItemModel.DiscountExclTaxValue = orderItem.DiscountAmountExclTax; + orderItemModel.DiscountInclTax = _priceFormatter.FormatPrice(orderItem.DiscountAmountInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); + orderItemModel.DiscountExclTax = _priceFormatter.FormatPrice(orderItem.DiscountAmountExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); + //subtotal + orderItemModel.SubTotalInclTaxValue = orderItem.PriceInclTax; + orderItemModel.SubTotalExclTaxValue = orderItem.PriceExclTax; + orderItemModel.SubTotalInclTax = _priceFormatter.FormatPrice(orderItem.PriceInclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, true, true); + orderItemModel.SubTotalExclTax = _priceFormatter.FormatPrice(orderItem.PriceExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, true); + + orderItemModel.AttributeInfo = orderItem.AttributeDescription; + if (orderItem.Product.IsRecurring) + orderItemModel.RecurringInfo = string.Format(_localizationService.GetResource("Admin.Orders.Products.RecurringPeriod"), orderItem.Product.RecurringCycleLength, orderItem.Product.RecurringCyclePeriod.GetLocalizedEnum(_localizationService, _workContext)); + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + orderItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + } + + //return requests + orderItemModel.ReturnRequests = _returnRequestService + .SearchReturnRequests(orderItemId: orderItem.Id) + .Select(item => new OrderModel.OrderItemModel.ReturnRequestBriefModel + { + CustomNumber = item.CustomNumber, + Id = item.Id + }).ToList(); + + //gift cards + orderItemModel.PurchasedGiftCardIds = _giftCardService.GetGiftCardsByPurchasedWithOrderItemId(orderItem.Id) + .Select(gc => gc.Id).ToList(); + + model.Items.Add(orderItemModel); + } + model.HasDownloadableProducts = hasDownloadableItems; + #endregion + } + + [NonAction] + protected virtual OrderModel.AddOrderProductModel.ProductDetailsModel PrepareAddProductToOrderModel(int orderId, int productId) + { + var product = _productService.GetProductById(productId); + if (product == null) + throw new ArgumentException("No product found with the specified id"); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + throw new ArgumentException("No order found with the specified id"); + + var presetQty = 1; + var presetPrice = _priceCalculationService.GetFinalPrice(product, order.Customer, decimal.Zero, true, presetQty); + decimal taxRate; + decimal presetPriceInclTax = _taxService.GetProductPrice(product, presetPrice, true, order.Customer, out taxRate); + decimal presetPriceExclTax = _taxService.GetProductPrice(product, presetPrice, false, order.Customer, out taxRate); + + var model = new OrderModel.AddOrderProductModel.ProductDetailsModel + { + ProductId = productId, + OrderId = orderId, + Name = product.Name, + ProductType = product.ProductType, + UnitPriceExclTax = presetPriceExclTax, + UnitPriceInclTax = presetPriceInclTax, + Quantity = presetQty, + SubTotalExclTax = presetPriceExclTax, + SubTotalInclTax = presetPriceInclTax, + AutoUpdateOrderTotals = _orderSettings.AutoUpdateOrderTotalsOnEditingOrder, + TaxRate = taxRate + }; + + //attributes + string attributesXml = ""; + var attributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); + foreach (var attribute in attributes) + { + var attributeModel = new OrderModel.AddOrderProductModel.ProductAttributeModel + { + Id = attribute.Id, + ProductAttributeId = attribute.ProductAttributeId, + Name = attribute.ProductAttribute.Name, + TextPrompt = attribute.TextPrompt, + IsRequired = attribute.IsRequired, + AttributeControlType = attribute.AttributeControlType, + HasCondition = !String.IsNullOrEmpty(attribute.ConditionAttributeXml) + }; + if (!String.IsNullOrEmpty(attribute.ValidationFileAllowedExtensions)) + { + attributeModel.AllowedFileExtensions = attribute.ValidationFileAllowedExtensions + .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .ToList(); + } + + if (attribute.ShouldHaveValues()) + { + //values + var attributeValues = _productAttributeService.GetProductAttributeValues(attribute.Id); + foreach (var attributeValue in attributeValues) + { + //price adjustment + var priceAdjustment = _taxService.GetProductPrice(product, + _priceCalculationService.GetProductAttributeValuePriceAdjustment(attributeValue), out taxRate); + + attributeModel.Values.Add(new OrderModel.AddOrderProductModel.ProductAttributeValueModel + { + Id = attributeValue.Id, + Name = attributeValue.Name, + IsPreSelected = attributeValue.IsPreSelected, + CustomerEntersQty = attributeValue.CustomerEntersQty, + Quantity = attributeValue.Quantity, + PriceAdjustment = priceAdjustment == decimal.Zero ? string.Empty : priceAdjustment > decimal.Zero + ? string.Concat("+", _priceFormatter.FormatPrice(priceAdjustment, false, false)) + : string.Concat("-", _priceFormatter.FormatPrice(-priceAdjustment, false, false)), + PriceAdjustmentValue = priceAdjustment + }); + } + + //creating XML for "read-only checkboxes" attributes + foreach (var selectedAttributeId in attributeValues + .Where(v => v.IsPreSelected) + .Select(v => v.Id) + .ToList()) + { + attributesXml = _productAttributeParser.AddProductAttribute(attributesXml, + attribute, selectedAttributeId.ToString()); + } + } + + model.ProductAttributes.Add(attributeModel); + } + + //Get final price using attributes + List scDiscounts; + decimal discountAmount; + decimal finalPrice = _priceCalculationService.GetUnitPrice(product, + order.Customer, + ShoppingCartType.ShoppingCart, + 1, ref attributesXml, 0, + null, null, + true, out discountAmount, out scDiscounts); + decimal finalPriceInclTax = RoundingHelper.RoundPrice(_taxService.GetProductPrice(product, finalPrice, true, order.Customer, out taxRate)); + decimal finalPriceExclTax = RoundingHelper.RoundPrice(_taxService.GetProductPrice(product, finalPrice, false, order.Customer, out taxRate)); + model.UnitPriceExclTax = finalPriceExclTax; + model.UnitPriceInclTax = finalPriceInclTax; + model.SubTotalExclTax = RoundingHelper.RoundAmount(finalPriceExclTax); + model.SubTotalInclTax = RoundingHelper.RoundAmount(finalPriceInclTax); + + model.HasCondition = model.ProductAttributes.Any(a => a.HasCondition); + //gift card + model.GiftCard.IsGiftCard = product.IsGiftCard; + if (model.GiftCard.IsGiftCard) + { + model.GiftCard.GiftCardType = product.GiftCardType; + } + //rental + model.IsRental = product.IsRental; + return model; + } + + [NonAction] + protected virtual ShipmentModel PrepareShipmentModel(Shipment shipment, bool prepareProducts, bool prepareShipmentEvent = false) + { + //measures + var baseWeight = _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId); + var baseWeightIn = baseWeight != null ? baseWeight.Name : ""; + var baseDimension = _measureService.GetMeasureDimensionById(_measureSettings.BaseDimensionId); + var baseDimensionIn = baseDimension != null ? baseDimension.Name : ""; + + var model = new ShipmentModel + { + Id = shipment.Id, + OrderId = shipment.OrderId, + TrackingNumber = shipment.TrackingNumber, + TotalWeight = shipment.TotalWeight.HasValue ? string.Format("{0:F2} [{1}]", shipment.TotalWeight, baseWeightIn) : "", + ShippedDate = shipment.ShippedDateUtc.HasValue ? _dateTimeHelper.ConvertToUserTime(shipment.ShippedDateUtc.Value, DateTimeKind.Utc).ToString() : _localizationService.GetResource("Admin.Orders.Shipments.ShippedDate.NotYet"), + ShippedDateUtc = shipment.ShippedDateUtc, + CanShip = !shipment.ShippedDateUtc.HasValue, + DeliveryDate = shipment.DeliveryDateUtc.HasValue ? _dateTimeHelper.ConvertToUserTime(shipment.DeliveryDateUtc.Value, DateTimeKind.Utc).ToString() : _localizationService.GetResource("Admin.Orders.Shipments.DeliveryDate.NotYet"), + DeliveryDateUtc = shipment.DeliveryDateUtc, + CanDeliver = shipment.ShippedDateUtc.HasValue && !shipment.DeliveryDateUtc.HasValue, + AdminComment = shipment.AdminComment, + CustomOrderNumber = shipment.Order.CustomOrderNumber + }; + + if (prepareProducts) + { + foreach (var shipmentItem in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); + if (orderItem == null) + continue; + + //quantities + var qtyInThisShipment = shipmentItem.Quantity; + var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); + var qtyOrdered = orderItem.Quantity; + var qtyInAllShipments = orderItem.GetTotalNumberOfItemsInAllShipment(); + + var warehouse = _shippingService.GetWarehouseById(shipmentItem.WarehouseId); + var shipmentItemModel = new ShipmentModel.ShipmentItemModel + { + Id = shipmentItem.Id, + OrderItemId = orderItem.Id, + ProductId = orderItem.ProductId, + ProductName = orderItem.Product.Name, + Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), + AttributeInfo = orderItem.AttributeDescription, + ShippedFromWarehouse = warehouse != null ? warehouse.Name : null, + ShipSeparately = orderItem.Product.ShipSeparately, + ItemWeight = orderItem.ItemWeight.HasValue ? string.Format("{0:F2} [{1}]", orderItem.ItemWeight, baseWeightIn) : "", + ItemDimensions = string.Format("{0:F2} x {1:F2} x {2:F2} [{3}]", orderItem.Product.Length, orderItem.Product.Width, orderItem.Product.Height, baseDimensionIn), + QuantityOrdered = qtyOrdered, + QuantityInThisShipment = qtyInThisShipment, + QuantityInAllShipments = qtyInAllShipments, + QuantityToAdd = maxQtyToAdd, + }; + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + shipmentItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + } + + model.Items.Add(shipmentItemModel); + } + } + + if (prepareShipmentEvent && !String.IsNullOrEmpty(shipment.TrackingNumber)) + { + var shipmentTracker = shipment.GetShipmentTracker(_shippingService, _shippingSettings); + if (shipmentTracker != null) + { + model.TrackingNumberUrl = shipmentTracker.GetUrl(shipment.TrackingNumber); + if (_shippingSettings.DisplayShipmentEventsToStoreOwner) + { + var shipmentEvents = shipmentTracker.GetShipmentEvents(shipment.TrackingNumber); + if (shipmentEvents != null) + foreach (var shipmentEvent in shipmentEvents) + { + var shipmentStatusEventModel = new ShipmentModel.ShipmentStatusEventModel(); + var shipmentEventCountry = _countryService.GetCountryByTwoLetterIsoCode(shipmentEvent.CountryCode); + shipmentStatusEventModel.Country = shipmentEventCountry != null + ? shipmentEventCountry.GetLocalized(x => x.Name) + : shipmentEvent.CountryCode; + shipmentStatusEventModel.Date = shipmentEvent.Date; + shipmentStatusEventModel.EventName = shipmentEvent.EventName; + shipmentStatusEventModel.Location = shipmentEvent.Location; + model.ShipmentStatusEvents.Add(shipmentStatusEventModel); + } + } + } + } + + return model; + } + + #endregion + + #region Order list + + public virtual ActionResult Index() + { + return RedirectToAction("List"); + } + + public virtual ActionResult List( + [ModelBinder(typeof(CommaSeparatedModelBinder))] List orderStatusIds = null, + [ModelBinder(typeof(CommaSeparatedModelBinder))] List paymentStatusIds = null, + [ModelBinder(typeof(CommaSeparatedModelBinder))] List shippingStatusIds = null) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //order statuses + var model = new OrderListModel(); + model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.AvailableOrderStatuses.Insert(0, new SelectListItem + { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); + if (orderStatusIds != null && orderStatusIds.Any()) + { + foreach (var item in model.AvailableOrderStatuses.Where(os => orderStatusIds.Contains(os.Value))) + item.Selected = true; + model.AvailableOrderStatuses.First().Selected = false; + } + //payment statuses + model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.AvailablePaymentStatuses.Insert(0, new SelectListItem + { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); + if (paymentStatusIds != null && paymentStatusIds.Any()) + { + foreach (var item in model.AvailablePaymentStatuses.Where(ps => paymentStatusIds.Contains(ps.Value))) + item.Selected = true; + model.AvailablePaymentStatuses.First().Selected = false; + } + + //shipping statuses + model.AvailableShippingStatuses = ShippingStatus.NotYetShipped.ToSelectList(false).ToList(); + model.AvailableShippingStatuses.Insert(0, new SelectListItem + { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0", Selected = true }); + if (shippingStatusIds != null && shippingStatusIds.Any()) + { + foreach (var item in model.AvailableShippingStatuses.Where(ss => shippingStatusIds.Contains(ss.Value))) + item.Selected = true; + model.AvailableShippingStatuses.First().Selected = false; + } + + //stores + model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + foreach (var s in _storeService.GetAllStores()) + model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); + + //vendors + model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); + foreach (var v in vendors) + model.AvailableVendors.Add(v); + + //warehouses + model.AvailableWarehouses.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + foreach (var w in _shippingService.GetAllWarehouses()) + model.AvailableWarehouses.Add(new SelectListItem { Text = w.Name, Value = w.Id.ToString() }); + + //payment methods + model.AvailablePaymentMethods.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "" }); + foreach (var pm in _paymentService.LoadAllPaymentMethods()) + model.AvailablePaymentMethods.Add(new SelectListItem { Text = pm.PluginDescriptor.FriendlyName, Value = pm.PluginDescriptor.SystemName }); + + //billing countries + foreach (var c in _countryService.GetAllCountriesForBilling(showHidden: true)) + { + model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); + } + model.AvailableCountries.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //a vendor should have access only to orders with his products + model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; + + return View(model); + } + + [HttpPost] + public virtual ActionResult OrderList(DataSourceRequest command, OrderListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.VendorId = _workContext.CurrentVendor.Id; + } + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + :(DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; + var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; + var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; + + var filterByProductId = 0; + var product = _productService.GetProductById(model.ProductId); + if (product != null && HasAccessToProduct(product)) + filterByProductId = model.ProductId; + + //load orders + var orders = _orderService.SearchOrders(storeId: model.StoreId, + vendorId: model.VendorId, + productId: filterByProductId, + warehouseId: model.WarehouseId, + paymentMethodSystemName: model.PaymentMethodSystemName, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes, + pageIndex: command.Page - 1, + pageSize: command.PageSize); + var gridModel = new DataSourceResult + { + Data = orders.Select(x => + { + var store = _storeService.GetStoreById(x.StoreId); + return new OrderModel + { + Id = x.Id, + StoreName = store != null ? store.Name : "Unknown", + OrderTotal = _priceFormatter.FormatPrice(x.OrderTotal, true, false), + OrderTotalAmountIncl = _priceFormatter.FormatPrice(x.OrderTotalAmountIncl, true, false), + OrderStatus = x.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), + OrderStatusId = x.OrderStatusId, + PaymentStatus = x.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), + PaymentStatusId = x.PaymentStatusId, + ShippingStatus = x.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), + ShippingStatusId = x.ShippingStatusId, + CustomerEmail = x.BillingAddress.Email, + CustomerFullName = string.Format("{0} {1}", x.BillingAddress.FirstName, x.BillingAddress.LastName), + CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc), + CustomOrderNumber = x.CustomOrderNumber + }; + }), + Total = orders.TotalCount + }; + + //summary report + //currently we do not support productId and warehouseId parameters for this report + var reportSummary = _orderReportService.GetOrderAverageReportLine( + storeId: model.StoreId, + vendorId: model.VendorId, + orderId: 0, + paymentMethodSystemName: model.PaymentMethodSystemName, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + startTimeUtc: startDateValue, + endTimeUtc: endDateValue, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes); + + var profit = _orderReportService.ProfitReport( + storeId: model.StoreId, + vendorId: model.VendorId, + paymentMethodSystemName: model.PaymentMethodSystemName, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + startTimeUtc: startDateValue, + endTimeUtc: endDateValue, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes); + var primaryStoreCurrency = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId); + if (primaryStoreCurrency == null) + throw new Exception("Cannot load primary store currency"); + + gridModel.ExtraData = new OrderAggreratorModel + { + aggregatorprofit = _priceFormatter.FormatPrice(profit, true, false), + aggregatorshipping = _priceFormatter.FormatShippingPrice(reportSummary.SumShippingExclTax, true, primaryStoreCurrency, _workContext.WorkingLanguage, false, false), + aggregatortax = _priceFormatter.FormatPrice(reportSummary.SumTax, true, false), + aggregatortotalamountincl = _priceFormatter.FormatPrice(reportSummary.SumOrdersTotalAmountIncl, true, false), + aggregatortotal = _priceFormatter.FormatPrice(reportSummary.SumOrders, true, false) + }; + + return Json(gridModel); + } + + [HttpPost, ActionName("List")] + [FormValueRequired("go-to-order-by-number")] + public virtual ActionResult GoToOrderId(OrderListModel model) + { + var order = _orderService.GetOrderByCustomOrderNumber(model.GoDirectlyToCustomOrderNumber); + + if (order == null) + return List(); + + return RedirectToAction("Edit", "Order", new { id = order.Id }); + } + + public virtual ActionResult ProductSearchAutoComplete(string term) + { + const int searchTermMinimumLength = 3; + if (String.IsNullOrWhiteSpace(term) || term.Length < searchTermMinimumLength) + return Content(""); + + //a vendor should have access only to his products + var vendorId = 0; + if (_workContext.CurrentVendor != null) + { + vendorId = _workContext.CurrentVendor.Id; + } + + //products + const int productNumber = 15; + var products = _productService.SearchProducts( + vendorId: vendorId, + keywords: term, + pageSize: productNumber, + showHidden: true); + + var result = (from p in products + select new + { + label = p.Name, + productid = p.Id + }) + .ToList(); + return Json(result, JsonRequestBehavior.AllowGet); + } + + #endregion + + #region Export / Import + + [HttpPost, ActionName("List")] + [FormValueRequired("exportxml-all")] + public virtual ActionResult ExportXmlAll(OrderListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.VendorId = _workContext.CurrentVendor.Id; + } + + var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; + var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; + var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; + + var filterByProductId = 0; + var product = _productService.GetProductById(model.ProductId); + if (product != null && HasAccessToProduct(product)) + filterByProductId = model.ProductId; + + //load orders + var orders = _orderService.SearchOrders(storeId: model.StoreId, + vendorId: model.VendorId, + productId: filterByProductId, + warehouseId: model.WarehouseId, + paymentMethodSystemName: model.PaymentMethodSystemName, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes); + + try + { + var xml = _exportManager.ExportOrdersToXml(orders); + return new XmlDownloadResult(xml, "orders.xml"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + [HttpPost] + public virtual ActionResult ExportXmlSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var orders = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + orders.AddRange(_orderService.GetOrdersByIds(ids).Where(HasAccessToOrder)); + } + + var xml = _exportManager.ExportOrdersToXml(orders); + return new XmlDownloadResult(xml, "orders.xml"); + } + + [HttpPost, ActionName("List")] + [FormValueRequired("exportexcel-all")] + public virtual ActionResult ExportExcelAll(OrderListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.VendorId = _workContext.CurrentVendor.Id; + } + + var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; + var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; + var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; + + var filterByProductId = 0; + var product = _productService.GetProductById(model.ProductId); + if (product != null && HasAccessToProduct(product)) + filterByProductId = model.ProductId; + + //load orders + var orders = _orderService.SearchOrders(storeId: model.StoreId, + vendorId: model.VendorId, + productId: filterByProductId, + warehouseId: model.WarehouseId, + paymentMethodSystemName: model.PaymentMethodSystemName, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes); + + try + { + byte[] bytes = _exportManager.ExportOrdersToXlsx(orders); + return File(bytes, MimeTypes.TextXlsx, "orders.xlsx"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + [HttpPost] + public virtual ActionResult ExportExcelSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var orders = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + orders.AddRange(_orderService.GetOrdersByIds(ids).Where(HasAccessToOrder)); + } + + try + { + byte[] bytes = _exportManager.ExportOrdersToXlsx(orders); + return File(bytes, MimeTypes.TextXlsx, "orders.xlsx"); + } + catch (Exception exc) + { + ErrorNotification(exc); + return RedirectToAction("List"); + } + } + + #endregion + + #region Order details + + #region Payments and other order workflow + + [HttpPost, ActionName("Edit")] + [FormValueRequired("cancelorder")] + public virtual ActionResult CancelOrder(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + _orderProcessingService.CancelOrder(order, true); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("captureorder")] + public virtual ActionResult CaptureOrder(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + var errors = _orderProcessingService.Capture(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + foreach (var error in errors) + ErrorNotification(error, false); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("markorderaspaid")] + public virtual ActionResult MarkOrderAsPaid(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + _orderProcessingService.MarkOrderAsPaid(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("refundorder")] + public virtual ActionResult RefundOrder(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + var errors = _orderProcessingService.Refund(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + foreach (var error in errors) + ErrorNotification(error, false); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("refundorderoffline")] + public virtual ActionResult RefundOrderOffline(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + _orderProcessingService.RefundOffline(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("voidorder")] + public virtual ActionResult VoidOrder(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + var errors = _orderProcessingService.Void(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + foreach (var error in errors) + ErrorNotification(error, false); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("voidorderoffline")] + public virtual ActionResult VoidOrderOffline(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + _orderProcessingService.VoidOffline(order); + LogEditOrder(order.Id); + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + return View(model); + } + catch (Exception exc) + { + //error + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + public virtual ActionResult PartiallyRefundOrderPopup(int id, bool online) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + + return View(model); + } + + [HttpPost] + [FormValueRequired("partialrefundorder")] + public virtual ActionResult PartiallyRefundOrderPopup(string btnId, string formId, int id, bool online, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + decimal amountToRefund = model.AmountToRefund; + if (amountToRefund <= decimal.Zero) + throw new NopException("Enter amount to refund"); + + decimal maxAmountToRefund = order.OrderTotal - order.RefundedAmount; + if (amountToRefund > maxAmountToRefund) + amountToRefund = maxAmountToRefund; + + var errors = new List(); + if (online) + errors = _orderProcessingService.PartiallyRefund(order, amountToRefund).ToList(); + else + _orderProcessingService.PartiallyRefundOffline(order, amountToRefund); + + LogEditOrder(order.Id); + + if (!errors.Any()) + { + //success + ViewBag.RefreshPage = true; + ViewBag.btnId = btnId; + ViewBag.formId = formId; + + PrepareOrderDetailsModel(model, order); + return View(model); + } + + //error + PrepareOrderDetailsModel(model, order); + foreach (var error in errors) + ErrorNotification(error, false); + return View(model); + } + catch (Exception exc) + { + //error + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("btnSaveOrderStatus")] + public virtual ActionResult ChangeOrderStatus(int id, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + try + { + order.OrderStatusId = model.OrderStatusId; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = string.Format("Order status has been edited. New status: {0}", order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext)), + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + return View(model); + } + catch (Exception exc) + { + //error + model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + ErrorNotification(exc, false); + return View(model); + } + } + + #endregion + + #region Edit, delete + + public virtual ActionResult Edit(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null || order.Deleted) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) + return RedirectToAction("List"); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + + var warnings = TempData["nop.admin.order.warnings"] as List; + if (warnings != null) + model.Warnings = warnings; + + return View(model); + } + + [HttpPost] + public virtual ActionResult Delete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + _orderProcessingService.DeleteOrder(order); + + //activity log + _customerActivityService.InsertActivity("DeleteOrder", _localizationService.GetResource("ActivityLog.DeleteOrder"), order.Id); + + return RedirectToAction("List"); + } + + public virtual ActionResult PdfInvoice(int orderId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //a vendor should have access only to his products + var vendorId = 0; + if (_workContext.CurrentVendor != null) + { + vendorId = _workContext.CurrentVendor.Id; + } + + var order = _orderService.GetOrderById(orderId); + var orders = new List(); + orders.Add(order); + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, vendorId); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, string.Format("order_{0}.pdf", order.Id)); + } + + [HttpPost, ActionName("List")] + [FormValueRequired("pdf-invoice-all")] + public virtual ActionResult PdfInvoiceAll(OrderListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.VendorId = _workContext.CurrentVendor.Id; + } + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + var orderStatusIds = !model.OrderStatusIds.Contains(0) ? model.OrderStatusIds : null; + var paymentStatusIds = !model.PaymentStatusIds.Contains(0) ? model.PaymentStatusIds : null; + var shippingStatusIds = !model.ShippingStatusIds.Contains(0) ? model.ShippingStatusIds : null; + + var filterByProductId = 0; + var product = _productService.GetProductById(model.ProductId); + if (product != null && HasAccessToProduct(product)) + filterByProductId = model.ProductId; + + //load orders + var orders = _orderService.SearchOrders(storeId: model.StoreId, + vendorId: model.VendorId, + productId: filterByProductId, + warehouseId: model.WarehouseId, + paymentMethodSystemName: model.PaymentMethodSystemName, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + osIds: orderStatusIds, + psIds: paymentStatusIds, + ssIds: shippingStatusIds, + billingEmail: model.BillingEmail, + billingLastName: model.BillingLastName, + billingCountryId: model.BillingCountryId, + orderNotes: model.OrderNotes); + + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, model.VendorId); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, "orders.pdf"); + } + + [HttpPost] + public virtual ActionResult PdfInvoiceSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var orders = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + orders.AddRange(_orderService.GetOrdersByIds(ids)); + } + + //a vendor should have access only to his products + var vendorId = 0; + if (_workContext.CurrentVendor != null) + { + orders = orders.Where(HasAccessToOrder).ToList(); + vendorId = _workContext.CurrentVendor.Id; + } + + //ensure that we at least one order selected + if (!orders.Any()) + { + ErrorNotification(_localizationService.GetResource("Admin.Orders.PdfInvoice.NoOrders")); + return RedirectToAction("List"); + } + + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintOrdersToPdf(stream, orders, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id, vendorId); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, "orders.pdf"); + } + + //currently we use this method on the add product to order details pages + [HttpPost] + [ValidateInput(false)] + public virtual ActionResult ProductDetails_AttributeChange(int productId, bool validateAttributeConditions, + FormCollection form) + { + var product = _productService.GetProductById(productId); + if (product == null) + return new NullJsonResult(); + + var errors = new List(); + var attributeXml = ParseProductAttributes(product, form, errors); + + //Get final price using attributes + decimal finalPriceInclTax = decimal.Zero; decimal finalPriceExclTax = decimal.Zero; + decimal finalSubInclTax = decimal.Zero; decimal finalSubExclTax = decimal.Zero; + + List scDiscounts; + decimal discountAmount; + decimal taxRate; + int quantity; + decimal finalPrice = _priceCalculationService.GetUnitPrice(product, + _workContext.CurrentCustomer, + ShoppingCartType.ShoppingCart, + 1, ref attributeXml, 0, + null, null, + true, out discountAmount, out scDiscounts); + finalPriceInclTax = RoundingHelper.RoundPrice(_taxService.GetProductPrice(product, finalPrice, true, _workContext.CurrentCustomer, out taxRate)); + finalPriceExclTax = RoundingHelper.RoundPrice(_taxService.GetProductPrice(product, finalPrice, false, _workContext.CurrentCustomer, out taxRate)); + finalSubInclTax = RoundingHelper.RoundAmount(finalPriceInclTax); + finalSubExclTax = RoundingHelper.RoundAmount(finalPriceExclTax); + if (int.TryParse(form["Quantity"], out quantity)) + { + finalSubInclTax = RoundingHelper.RoundAmount(_taxService.GetProductPrice(product, finalPriceInclTax * quantity, true, _workContext.CurrentCustomer, out taxRate)); + finalSubExclTax = RoundingHelper.RoundAmount(_taxService.GetProductPrice(product, finalPriceInclTax * quantity, false, _workContext.CurrentCustomer, out taxRate)); + } + + //conditional attributes + var enabledAttributeMappingIds = new List(); + var disabledAttributeMappingIds = new List(); + if (validateAttributeConditions) + { + var attributes = _productAttributeService.GetProductAttributeMappingsByProductId(product.Id); + foreach (var attribute in attributes) + { + var conditionMet = _productAttributeParser.IsConditionMet(attribute, attributeXml); + if (conditionMet.HasValue) + { + if (conditionMet.Value) + enabledAttributeMappingIds.Add(attribute.Id); + else + disabledAttributeMappingIds.Add(attribute.Id); + } + } + } + + return Json(new + { + enabledattributemappingids = enabledAttributeMappingIds.ToArray(), + disabledattributemappingids = disabledAttributeMappingIds.ToArray(), + finalPriceInclTax, + finalPriceExclTax, + finalSubInclTax, + finalSubExclTax, + message = errors.Any() ? errors.ToArray() : null + }); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("btnSaveCC")] + public virtual ActionResult EditCreditCardInfo(int id, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + if (order.AllowStoringCreditCardNumber) + { + string cardType = model.CardType; + string cardName = model.CardName; + string cardNumber = model.CardNumber; + string cardCvv2 = model.CardCvv2; + string cardExpirationMonth = model.CardExpirationMonth; + string cardExpirationYear = model.CardExpirationYear; + + order.CardType = _encryptionService.EncryptText(cardType); + order.CardName = _encryptionService.EncryptText(cardName); + order.CardNumber = _encryptionService.EncryptText(cardNumber); + order.MaskedCreditCardNumber = _encryptionService.EncryptText(_paymentService.GetMaskedCreditCardNumber(cardNumber)); + order.CardCvv2 = _encryptionService.EncryptText(cardCvv2); + order.CardExpirationMonth = _encryptionService.EncryptText(cardExpirationMonth); + order.CardExpirationYear = _encryptionService.EncryptText(cardExpirationYear); + _orderService.UpdateOrder(order); + } + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Credit card info has been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + PrepareOrderDetailsModel(model, order); + return View(model); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("btnSaveOrderTotals")] + public virtual ActionResult EditOrderTotals(int id, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + order.OrderSubtotalInclTax = model.OrderSubtotalInclTaxValue; + order.OrderSubtotalExclTax = model.OrderSubtotalExclTaxValue; + order.OrderSubTotalDiscountInclTax = model.OrderSubTotalDiscountInclTaxValue; + order.OrderSubTotalDiscountExclTax = model.OrderSubTotalDiscountExclTaxValue; + order.OrderShippingInclTax = model.OrderShippingInclTaxValue; + order.OrderShippingExclTax = model.OrderShippingExclTaxValue; + order.OrderShippingNonTaxable = model.OrderShippingNonTaxableValue; + order.PaymentMethodAdditionalFeeInclTax = model.PaymentMethodAdditionalFeeInclTaxValue; + order.PaymentMethodAdditionalFeeExclTax = model.PaymentMethodAdditionalFeeExclTaxValue; + order.PaymentMethodAdditionalFeeNonTaxable = model.PaymentMethodAdditionalFeeNonTaxableValue; + order.TaxRates = model.TaxRatesValue; + order.OrderTax = model.TaxValue; + order.OrderDiscount = model.OrderTotalDiscountValue; + order.OrderTotal = model.OrderTotalValue; + order.OrderAmount = model.OrderAmountValue; + order.OrderAmountIncl = model.OrderAmountInclValue; + order.OrderDiscountIncl = model.OrderTotalDiscountInclValue; + order.EarnedRewardPointsBaseAmountExcl = model.EarnedRewardPointsBaseAmountExclValue; + order.EarnedRewardPointsBaseAmountIncl = model.EarnedRewardPointsBaseAmountInclValue; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order totals have been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + PrepareOrderDetailsModel(model, order); + return View(model); + } + [HttpPost, ActionName("Edit")] + [FormValueRequired("btnSaveIV")] + public ActionResult EditInvoiceInfo(int id, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + //assign invoice id when null + if (model.InvoiceId == null) + { + order.InvoiceId = _orderProcessingService.GetInvoiceId(order.StoreId); + order.InvoiceDateUtc = DateTime.UtcNow; + //not needed, we use redirection now + //ModelState.SetModelValue("InvoiceId", new ValueProviderResult(order.InvoiceId, "", ModelState["InvoiceId"].Value.Culture)); + //ModelState.SetModelValue("InvoiceDateUtc", new ValueProviderResult(order.InvoiceId, "", ModelState["InvoiceDateUtc"].Value.Culture)); + } + else + { + order.InvoiceId = model.InvoiceId; + order.InvoiceDateUtc = model.InvoiceDateUtc; + } + + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Invoice data has been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + //use redirect instead of passing the new model to have correct browser refresh + //PrepareOrderDetailsModel(model, order); + //return View(model); + return RedirectToAction("Edit", "Order", new { id = id }); + } + + //something failed, redisplay form + return View(model); + } + [HttpPost, ActionName("Edit")] + [FormValueRequired("save-shipping-method")] + public virtual ActionResult EditShippingMethod(int id, OrderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + order.ShippingMethod = model.ShippingMethod; + _orderService.UpdateOrder(order); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Shipping method has been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + PrepareOrderDetailsModel(model, order); + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired(FormValueRequirement.StartsWith, "btnSaveOrderItem")] + [ValidateInput(false)] + public virtual ActionResult EditOrderItem(int id, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + //get order item identifier + int orderItemId = 0; + foreach (var formValue in form.AllKeys) + if (formValue.StartsWith("btnSaveOrderItem", StringComparison.InvariantCultureIgnoreCase)) + orderItemId = Convert.ToInt32(formValue.Substring("btnSaveOrderItem".Length)); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + + decimal unitPriceInclTax, unitPriceExclTax, discountInclTax, discountExclTax,priceInclTax,priceExclTax; + int quantity; decimal taxrate; + if (!decimal.TryParse(form["pvUnitPriceInclTax" + orderItemId], out unitPriceInclTax)) + unitPriceInclTax = orderItem.UnitPriceInclTax; + if (!decimal.TryParse(form["pvUnitPriceExclTax" + orderItemId], out unitPriceExclTax)) + unitPriceExclTax = orderItem.UnitPriceExclTax; + if (!int.TryParse(form["pvQuantity" + orderItemId], out quantity)) + quantity = orderItem.Quantity; + if (!decimal.TryParse(form["pvDiscountInclTax" + orderItemId], out discountInclTax)) + discountInclTax = orderItem.DiscountAmountInclTax; + if (!decimal.TryParse(form["pvDiscountExclTax" + orderItemId], out discountExclTax)) + discountExclTax = orderItem.DiscountAmountExclTax; + if (!decimal.TryParse(form["pvPriceInclTax" + orderItemId], out priceInclTax)) + priceInclTax = orderItem.PriceInclTax; + if (!decimal.TryParse(form["pvPriceExclTax" + orderItemId], out priceExclTax)) + priceExclTax = orderItem.PriceExclTax; + if (!decimal.TryParse(form["pvTaxRate" + orderItemId], out taxrate)) + taxrate = orderItem.TaxRate; + + if (quantity > 0) + { + int qtyDifference = orderItem.Quantity - quantity; + + if (!_orderSettings.AutoUpdateOrderTotalsOnEditingOrder) + { + orderItem.UnitPriceInclTax = unitPriceInclTax; + orderItem.UnitPriceExclTax = unitPriceExclTax; + orderItem.Quantity = quantity; + orderItem.DiscountAmountInclTax = discountInclTax; + orderItem.DiscountAmountExclTax = discountExclTax; + orderItem.PriceInclTax = priceInclTax; + orderItem.PriceExclTax = priceExclTax; + orderItem.TaxRate = taxrate; + _orderService.UpdateOrder(order); + } + + //adjust inventory + _productService.AdjustInventory(orderItem.Product, qtyDifference, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.EditOrder"), order.Id)); + + } + else + { + //adjust inventory + _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrderItem"), order.Id)); + + //delete item + _orderService.DeleteOrderItem(orderItem); + } + + //update order totals + var updateOrderParameters = new UpdateOrderParameters + { + UpdatedOrder = order, + UpdatedOrderItem = orderItem, + PriceInclTax = unitPriceInclTax, + PriceExclTax = unitPriceExclTax, + DiscountAmountInclTax = discountInclTax, + DiscountAmountExclTax = discountExclTax, + SubTotalInclTax = priceInclTax, + SubTotalExclTax = priceExclTax, + Quantity = quantity, + TaxRate = taxrate + }; + _orderProcessingService.UpdateOrderTotals(updateOrderParameters); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order item has been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + model.Warnings = updateOrderParameters.Warnings; + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired(FormValueRequirement.StartsWith, "btnDeleteOrderItem")] + [ValidateInput(false)] + public virtual ActionResult DeleteOrderItem(int id, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = id }); + + //get order item identifier + int orderItemId = 0; + foreach (var formValue in form.AllKeys) + if (formValue.StartsWith("btnDeleteOrderItem", StringComparison.InvariantCultureIgnoreCase)) + orderItemId = Convert.ToInt32(formValue.Substring("btnDeleteOrderItem".Length)); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + if (_giftCardService.GetGiftCardsByPurchasedWithOrderItemId(orderItem.Id).Any()) + { + //we cannot delete an order item with associated gift cards + //a store owner should delete them first + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + + ErrorNotification(_localizationService.GetResource("Admin.Orders.OrderItem.DeleteAssociatedGiftCardRecordError"), false); + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + + } + else + { + //adjust inventory + _productService.AdjustInventory(orderItem.Product, orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteOrderItem"), order.Id)); + + //delete item + _orderService.DeleteOrderItem(orderItem); + + //update order totals + var updateOrderParameters = new UpdateOrderParameters + { + UpdatedOrder = order, + UpdatedOrderItem = orderItem + }; + _orderProcessingService.UpdateOrderTotals(updateOrderParameters); + + + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Order item has been deleted", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + model.Warnings = updateOrderParameters.Warnings; + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired(FormValueRequirement.StartsWith, "btnResetDownloadCount")] + [ValidateInput(false)] + public virtual ActionResult ResetDownloadCount(int id, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //get order item identifier + int orderItemId = 0; + foreach (var formValue in form.AllKeys) + if (formValue.StartsWith("btnResetDownloadCount", StringComparison.InvariantCultureIgnoreCase)) + orderItemId = Convert.ToInt32(formValue.Substring("btnResetDownloadCount".Length)); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + //ensure a vendor has access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) + return RedirectToAction("List"); + + orderItem.DownloadCount = 0; + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired(FormValueRequirement.StartsWith, "btnPvActivateDownload")] + [ValidateInput(false)] + public virtual ActionResult ActivateDownloadItem(int id, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //get order item identifier + int orderItemId = 0; + foreach (var formValue in form.AllKeys) + if (formValue.StartsWith("btnPvActivateDownload", StringComparison.InvariantCultureIgnoreCase)) + orderItemId = Convert.ToInt32(formValue.Substring("btnPvActivateDownload".Length)); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + //ensure a vendor has access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) + return RedirectToAction("List"); + + orderItem.IsDownloadActivated = !orderItem.IsDownloadActivated; + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + var model = new OrderModel(); + PrepareOrderDetailsModel(model, order); + + //selected tab + SaveSelectedTabName(persistForTheNextRequest: false); + + return View(model); + } + + public virtual ActionResult UploadLicenseFilePopup(int id, int orderItemId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(id); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + if (!orderItem.Product.IsDownload) + throw new ArgumentException("Product is not downloadable"); + + //ensure a vendor has access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) + return RedirectToAction("List"); + + var model = new OrderModel.UploadLicenseModel + { + LicenseDownloadId = orderItem.LicenseDownloadId.HasValue ? orderItem.LicenseDownloadId.Value : 0, + OrderId = order.Id, + OrderItemId = orderItem.Id + }; + + return View(model); + } + + [HttpPost] + [FormValueRequired("uploadlicense")] + public virtual ActionResult UploadLicenseFilePopup(string btnId, string formId, OrderModel.UploadLicenseModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(model.OrderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + //ensure a vendor has access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) + return RedirectToAction("List"); + + //attach license + if (model.LicenseDownloadId > 0) + orderItem.LicenseDownloadId = model.LicenseDownloadId; + else + orderItem.LicenseDownloadId = null; + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + //success + ViewBag.RefreshPage = true; + ViewBag.btnId = btnId; + ViewBag.formId = formId; + + return View(model); + } + + [HttpPost, ActionName("UploadLicenseFilePopup")] + [FormValueRequired("deletelicense")] + public virtual ActionResult DeleteLicenseFilePopup(string btnId, string formId, OrderModel.UploadLicenseModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(model.OrderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId); + if (orderItem == null) + throw new ArgumentException("No order item found with the specified id"); + + //ensure a vendor has access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrderItem(orderItem)) + return RedirectToAction("List"); + + //attach license + orderItem.LicenseDownloadId = null; + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + //success + ViewBag.RefreshPage = true; + ViewBag.btnId = btnId; + ViewBag.formId = formId; + + return View(model); + } + + public virtual ActionResult AddProductToOrder(int orderId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = orderId }); + + var model = new OrderModel.AddOrderProductModel(); + model.OrderId = orderId; + //categories + model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); + foreach (var c in categories) + model.AvailableCategories.Add(c); + + //manufacturers + model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); + foreach (var m in manufacturers) + model.AvailableManufacturers.Add(m); + + //product types + model.AvailableProductTypes = ProductType.SimpleProduct.ToSelectList(false).ToList(); + model.AvailableProductTypes.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + return View(model); + } + + [HttpPost] + public virtual ActionResult AddProductToOrder(DataSourceRequest command, OrderModel.AddOrderProductModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return Content(""); + + var gridModel = new DataSourceResult(); + var products = _productService.SearchProducts(categoryIds: new List {model.SearchCategoryId}, + manufacturerId: model.SearchManufacturerId, + productType: model.SearchProductTypeId > 0 ? (ProductType?)model.SearchProductTypeId : null, + keywords: model.SearchProductName, + pageIndex: command.Page - 1, + pageSize: command.PageSize, + showHidden: true); + gridModel.Data = products.Select(x => + { + var productModel = new OrderModel.AddOrderProductModel.ProductModel + { + Id = x.Id, + Name = x.Name, + Sku = x.Sku, + }; + + return productModel; + }); + gridModel.Total = products.TotalCount; + + return Json(gridModel); + } + + public virtual ActionResult AddProductToOrderDetails(int orderId, int productId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = orderId }); + + var model = PrepareAddProductToOrderModel(orderId, productId); + return View(model); + } + + [HttpPost] + public virtual ActionResult AddProductToOrderDetails(int orderId, int productId, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = orderId }); + + var order = _orderService.GetOrderById(orderId); + var product = _productService.GetProductById(productId); + //save order item + + //basic properties + decimal unitPriceInclTax; + decimal.TryParse(form["UnitPriceInclTax"], out unitPriceInclTax); + decimal unitPriceExclTax; + decimal.TryParse(form["UnitPriceExclTax"], out unitPriceExclTax); + int quantity; + int.TryParse(form["Quantity"], out quantity); + decimal priceInclTax; + decimal.TryParse(form["SubTotalInclTax"], out priceInclTax); + decimal priceExclTax; + decimal.TryParse(form["SubTotalExclTax"], out priceExclTax); + decimal taxRate; + decimal.TryParse(form["TaxRate"], out taxRate); + + //warnings + var warnings = new List(); + + //attributes + var attributesXml = ParseProductAttributes(product, form, warnings); + + //attributes tax + List scDiscounts; + decimal discountAmount; + decimal finalPrice = _priceCalculationService.GetUnitPrice(product, + _workContext.CurrentCustomer, + ShoppingCartType.ShoppingCart, + 1, ref attributesXml, 0, + null, null, + true, out discountAmount, out scDiscounts); + + decimal price = _taxService.GetProductPrice(product, 0, finalPrice, _workContext.TaxDisplayType == TaxDisplayType.IncludingTax, _workContext.CurrentCustomer, _taxSettings.PricesIncludeTax, out taxRate, ref attributesXml); + + #region Gift cards + + string recipientName = ""; + string recipientEmail = ""; + string senderName = ""; + string senderEmail = ""; + string giftCardMessage = ""; + if (product.IsGiftCard) + { + foreach (string formKey in form.AllKeys) + { + if (formKey.Equals("giftcard.RecipientName", StringComparison.InvariantCultureIgnoreCase)) + { + recipientName = form[formKey]; + continue; + } + if (formKey.Equals("giftcard.RecipientEmail", StringComparison.InvariantCultureIgnoreCase)) + { + recipientEmail = form[formKey]; + continue; + } + if (formKey.Equals("giftcard.SenderName", StringComparison.InvariantCultureIgnoreCase)) + { + senderName = form[formKey]; + continue; + } + if (formKey.Equals("giftcard.SenderEmail", StringComparison.InvariantCultureIgnoreCase)) + { + senderEmail = form[formKey]; + continue; + } + if (formKey.Equals("giftcard.Message", StringComparison.InvariantCultureIgnoreCase)) + { + giftCardMessage = form[formKey]; + continue; + } + } + + attributesXml = _productAttributeParser.AddGiftCardAttribute(attributesXml, + recipientName, recipientEmail, senderName, senderEmail, giftCardMessage); + } + + #endregion + + #region Rental product + + DateTime? rentalStartDate = null; + DateTime? rentalEndDate = null; + if (product.IsRental) + { + ParseRentalDates(form, out rentalStartDate, out rentalEndDate); + } + + #endregion + + //warnings + warnings.AddRange(_shoppingCartService.GetShoppingCartItemAttributeWarnings(order.Customer, ShoppingCartType.ShoppingCart, product, quantity, attributesXml)); + warnings.AddRange(_shoppingCartService.GetShoppingCartItemGiftCardWarnings(ShoppingCartType.ShoppingCart, product, attributesXml)); + warnings.AddRange(_shoppingCartService.GetRentalProductWarnings(product, rentalStartDate, rentalEndDate)); + if (!warnings.Any()) + { + //no errors + + //attributes + var attributeDescription = _productAttributeFormatter.FormatAttributes(product, attributesXml, order.Customer, subTotal: order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax ? priceInclTax : priceExclTax); + + //save item + var orderItem = new OrderItem + { + OrderItemGuid = Guid.NewGuid(), + Order = order, + ProductId = product.Id, + UnitPriceInclTax = unitPriceInclTax, + UnitPriceExclTax = unitPriceExclTax, + PriceInclTax = priceInclTax, + PriceExclTax = priceExclTax, + OriginalProductCost = _priceCalculationService.GetProductCost(product, attributesXml), + AttributeDescription = attributeDescription, + AttributesXml = attributesXml, + Quantity = quantity, + DiscountAmountInclTax = decimal.Zero, + DiscountAmountExclTax = decimal.Zero, + DownloadCount = 0, + IsDownloadActivated = false, + LicenseDownloadId = 0, + RentalStartDateUtc = rentalStartDate, + RentalEndDateUtc = rentalEndDate, + TaxRate = taxRate + }; + order.OrderItems.Add(orderItem); + _orderService.UpdateOrder(order); + + //adjust inventory + _productService.AdjustInventory(orderItem.Product, -orderItem.Quantity, orderItem.AttributesXml, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.EditOrder"), order.Id)); + + //update order totals + var updateOrderParameters = new UpdateOrderParameters + { + UpdatedOrder = order, + UpdatedOrderItem = orderItem, + PriceInclTax = unitPriceInclTax, + PriceExclTax = unitPriceExclTax, + SubTotalInclTax = priceInclTax, + SubTotalExclTax = priceExclTax, + Quantity = quantity, + TaxRate = taxRate + }; + _orderProcessingService.UpdateOrderTotals(updateOrderParameters); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "A new order item has been added", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + //gift cards + if (product.IsGiftCard) + { + for (int i = 0; i < orderItem.Quantity; i++) + { + var gc = new GiftCard + { + GiftCardType = product.GiftCardType, + PurchasedWithOrderItem = orderItem, + Amount = unitPriceExclTax, + IsGiftCardActivated = false, + GiftCardCouponCode = _giftCardService.GenerateGiftCardCode(), + RecipientName = recipientName, + RecipientEmail = recipientEmail, + SenderName = senderName, + SenderEmail = senderEmail, + Message = giftCardMessage, + IsRecipientNotified = false, + CreatedOnUtc = DateTime.UtcNow + }; + _giftCardService.InsertGiftCard(gc); + } + } + + //redirect to order details page + TempData["nop.admin.order.warnings"] = updateOrderParameters.Warnings; + return RedirectToAction("Edit", "Order", new { id = order.Id }); + } + + //errors + var model = PrepareAddProductToOrderModel(order.Id, product.Id); + model.Warnings.AddRange(warnings); + return View(model); + } + + #endregion + + #endregion + + #region Addresses + + public virtual ActionResult AddressEdit(int addressId, int orderId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = orderId }); + + var address = _addressService.GetAddressById(addressId); + if (address == null) + throw new ArgumentException("No address found with the specified id", "addressId"); + + var model = new OrderAddressModel(); + model.OrderId = orderId; + model.Address = address.ToModel(); + model.Address.FirstNameEnabled = true; + model.Address.FirstNameRequired = true; + model.Address.LastNameEnabled = true; + model.Address.LastNameRequired = true; + model.Address.EmailEnabled = true; + model.Address.EmailRequired = true; + model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; + model.Address.CompanyRequired = _addressSettings.CompanyRequired; + model.Address.CountryEnabled = _addressSettings.CountryEnabled; + model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled + model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; + model.Address.StateProvinceRequired = _addressSettings.StateProvinceEnabled; //province is required when enabled + model.Address.CityEnabled = _addressSettings.CityEnabled; + model.Address.CityRequired = _addressSettings.CityRequired; + model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; + model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; + model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; + model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; + model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; + model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; + model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; + model.Address.PhoneRequired = _addressSettings.PhoneRequired; + model.Address.FaxEnabled = _addressSettings.FaxEnabled; + model.Address.FaxRequired = _addressSettings.FaxRequired; + + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == address.CountryId) }); + //states + var states = address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + //customer attribute services + model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); + + return View(model); + } + + [HttpPost] + [ValidateInput(false)] + public virtual ActionResult AddressEdit(OrderAddressModel model, FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(model.OrderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = order.Id }); + + var address = _addressService.GetAddressById(model.Address.Id); + if (address == null) + throw new ArgumentException("No address found with the specified id"); + + //custom address attributes + var customAttributes = form.ParseCustomAddressAttributes(_addressAttributeParser, _addressAttributeService); + var customAttributeWarnings = _addressAttributeParser.GetAttributeWarnings(customAttributes); + foreach (var error in customAttributeWarnings) + { + ModelState.AddModelError("", error); + } + + if (ModelState.IsValid) + { + address = model.Address.ToEntity(address); + address.CustomAttributes = customAttributes; + _addressService.UpdateAddress(address); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "Address has been edited", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + return RedirectToAction("AddressEdit", new { addressId = model.Address.Id, orderId = model.OrderId }); + } + + //If we got this far, something failed, redisplay form + model.OrderId = order.Id; + model.Address = address.ToModel(); + model.Address.FirstNameEnabled = true; + model.Address.FirstNameRequired = true; + model.Address.LastNameEnabled = true; + model.Address.LastNameRequired = true; + model.Address.EmailEnabled = true; + model.Address.EmailRequired = true; + model.Address.CompanyEnabled = _addressSettings.CompanyEnabled; + model.Address.CompanyRequired = _addressSettings.CompanyRequired; + model.Address.CountryEnabled = _addressSettings.CountryEnabled; + model.Address.CountryRequired = _addressSettings.CountryEnabled; //country is required when enabled + model.Address.StateProvinceEnabled = _addressSettings.StateProvinceEnabled; + model.Address.StateProvinceRequired = _addressSettings.StateProvinceEnabled; //province is required when enabled + model.Address.CityEnabled = _addressSettings.CityEnabled; + model.Address.CityRequired = _addressSettings.CityRequired; + model.Address.StreetAddressEnabled = _addressSettings.StreetAddressEnabled; + model.Address.StreetAddressRequired = _addressSettings.StreetAddressRequired; + model.Address.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled; + model.Address.StreetAddress2Required = _addressSettings.StreetAddress2Required; + model.Address.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled; + model.Address.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired; + model.Address.PhoneEnabled = _addressSettings.PhoneEnabled; + model.Address.PhoneRequired = _addressSettings.PhoneRequired; + model.Address.FaxEnabled = _addressSettings.FaxEnabled; + model.Address.FaxRequired = _addressSettings.FaxRequired; + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == address.CountryId) }); + //states + var states = address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + //customer attribute services + model.Address.PrepareCustomAddressAttributes(address, _addressAttributeService, _addressAttributeParser); + + return View(model); + } + + #endregion + + #region Shipments + + public virtual ActionResult ShipmentList() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var model = new ShipmentListModel(); + //countries + model.AvailableCountries.Add(new SelectListItem { Text = "*", Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); + //states + model.AvailableStates.Add(new SelectListItem { Text = "*", Value = "0" }); + + //warehouses + model.AvailableWarehouses.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + foreach (var w in _shippingService.GetAllWarehouses()) + model.AvailableWarehouses.Add(new SelectListItem { Text = w.Name, Value = w.Id.ToString() }); + + return View(model); + } + + [HttpPost] + public virtual ActionResult ShipmentListSelect(DataSourceRequest command, ShipmentListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + :(DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + //a vendor should have access only to his products + int vendorId = 0; + if (_workContext.CurrentVendor != null) + vendorId = _workContext.CurrentVendor.Id; + + //load shipments + var shipments = _shipmentService.GetAllShipments(vendorId: vendorId, + warehouseId: model.WarehouseId, + shippingCountryId: model.CountryId, + shippingStateId: model.StateProvinceId, + shippingCity: model.City, + trackingNumber: model.TrackingNumber, + loadNotShipped: model.LoadNotShipped, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + pageIndex: command.Page - 1, + pageSize: command.PageSize); + var gridModel = new DataSourceResult + { + Data = shipments.Select(shipment => PrepareShipmentModel(shipment, false)), + Total = shipments.TotalCount + }; + + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult ShipmentsByOrder(int orderId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + throw new ArgumentException("No order found with the specified id"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) + return Content(""); + + //shipments + var shipmentModels = new List(); + var shipments = order.Shipments + //a vendor should have access only to his products + .Where(s => _workContext.CurrentVendor == null || HasAccessToShipment(s)) + .OrderBy(s => s.CreatedOnUtc) + .ToList(); + foreach (var shipment in shipments) + shipmentModels.Add(PrepareShipmentModel(shipment, false)); + + var gridModel = new DataSourceResult + { + Data = shipmentModels, + Total = shipmentModels.Count + }; + + + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult ShipmentsItemsByShipmentId(int shipmentId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + var shipment = _shipmentService.GetShipmentById(shipmentId); + if (shipment == null) + throw new ArgumentException("No shipment found with the specified id"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return Content(""); + + var order = _orderService.GetOrderById(shipment.OrderId); + if (order == null) + throw new ArgumentException("No order found with the specified id"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) + return Content(""); + + //shipments + var shipmentModel = PrepareShipmentModel(shipment, true); + var gridModel = new DataSourceResult + { + Data = shipmentModel.Items, + Total = shipmentModel.Items.Count + }; + + return Json(gridModel); + } + + public virtual ActionResult AddShipment(int orderId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) + return RedirectToAction("List"); + + var model = new ShipmentModel + { + OrderId = order.Id, + CustomOrderNumber = order.CustomOrderNumber + }; + + //measures + var baseWeight = _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId); + var baseWeightIn = baseWeight != null ? baseWeight.Name : ""; + var baseDimension = _measureService.GetMeasureDimensionById(_measureSettings.BaseDimensionId); + var baseDimensionIn = baseDimension != null ? baseDimension.Name : ""; + + var orderItems = order.OrderItems; + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + orderItems = orderItems.Where(HasAccessToOrderItem).ToList(); + } + + foreach (var orderItem in orderItems) + { + //we can ship only shippable products + if (!orderItem.Product.IsShipEnabled) + continue; + + //quantities + var qtyInThisShipment = 0; + var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); + var qtyOrdered = orderItem.Quantity; + var qtyInAllShipments = orderItem.GetTotalNumberOfItemsInAllShipment(); + + //ensure that this product can be added to a shipment + if (maxQtyToAdd <= 0) + continue; + + var shipmentItemModel = new ShipmentModel.ShipmentItemModel + { + OrderItemId = orderItem.Id, + ProductId = orderItem.ProductId, + ProductName = orderItem.Product.Name, + Sku = orderItem.Product.FormatSku(orderItem.AttributesXml, _productAttributeParser), + AttributeInfo = orderItem.AttributeDescription, + ShipSeparately = orderItem.Product.ShipSeparately, + ItemWeight = orderItem.ItemWeight.HasValue ? string.Format("{0:F2} [{1}]", orderItem.ItemWeight, baseWeightIn) : "", + ItemDimensions = string.Format("{0:F2} x {1:F2} x {2:F2} [{3}]", orderItem.Product.Length, orderItem.Product.Width, orderItem.Product.Height, baseDimensionIn), + QuantityOrdered = qtyOrdered, + QuantityInThisShipment = qtyInThisShipment, + QuantityInAllShipments = qtyInAllShipments, + QuantityToAdd = maxQtyToAdd, + }; + //rental info + if (orderItem.Product.IsRental) + { + var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalStartDateUtc.Value) : ""; + var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? orderItem.Product.FormatRentalDate(orderItem.RentalEndDateUtc.Value) : ""; + shipmentItemModel.RentalInfo = string.Format(_localizationService.GetResource("Order.Rental.FormattedDate"), + rentalStartDate, rentalEndDate); + } + + if (orderItem.Product.ManageInventoryMethod == ManageInventoryMethod.ManageStock && + orderItem.Product.UseMultipleWarehouses) + { + //multiple warehouses supported + shipmentItemModel.AllowToChooseWarehouse = true; + foreach (var pwi in orderItem.Product.ProductWarehouseInventory + .OrderBy(w => w.WarehouseId).ToList()) + { + var warehouse = pwi.Warehouse; + if (warehouse != null) + { + shipmentItemModel.AvailableWarehouses.Add(new ShipmentModel.ShipmentItemModel.WarehouseInfo + { + WarehouseId = warehouse.Id, + WarehouseName = warehouse.Name, + StockQuantity = pwi.StockQuantity, + ReservedQuantity = pwi.ReservedQuantity, + PlannedQuantity = _shipmentService.GetQuantityInShipments(orderItem.Product, warehouse.Id, true, true) + }); + } + } + } + else + { + //multiple warehouses are not supported + var warehouse = _shippingService.GetWarehouseById(orderItem.Product.WarehouseId); + if (warehouse != null) + { + shipmentItemModel.AvailableWarehouses.Add(new ShipmentModel.ShipmentItemModel.WarehouseInfo + { + WarehouseId = warehouse.Id, + WarehouseName = warehouse.Name, + StockQuantity = orderItem.Product.StockQuantity + }); + } + } + + model.Items.Add(shipmentItemModel); + } + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + [FormValueRequired("save", "save-continue")] + public virtual ActionResult AddShipment(int orderId, FormCollection form, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + //No order found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToOrder(order)) + return RedirectToAction("List"); + + var orderItems = order.OrderItems; + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + orderItems = orderItems.Where(HasAccessToOrderItem).ToList(); + } + + Shipment shipment = null; + decimal? totalWeight = null; + foreach (var orderItem in orderItems) + { + //is shippable + if (!orderItem.Product.IsShipEnabled) + continue; + + //ensure that this product can be shipped (have at least one item to ship) + var maxQtyToAdd = orderItem.GetTotalNumberOfItemsCanBeAddedToShipment(); + if (maxQtyToAdd <= 0) + continue; + + int qtyToAdd = 0; //parse quantity + foreach (string formKey in form.AllKeys) + if (formKey.Equals(string.Format("qtyToAdd{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) + { + int.TryParse(form[formKey], out qtyToAdd); + break; + } + + int warehouseId = 0; + if (orderItem.Product.ManageInventoryMethod == ManageInventoryMethod.ManageStock && + orderItem.Product.UseMultipleWarehouses) + { + //multiple warehouses supported + //warehouse is chosen by a store owner + foreach (string formKey in form.AllKeys) + if (formKey.Equals(string.Format("warehouse_{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) + { + int.TryParse(form[formKey], out warehouseId); + break; + } + } + else + { + //multiple warehouses are not supported + warehouseId = orderItem.Product.WarehouseId; + } + + foreach (string formKey in form.AllKeys) + if (formKey.Equals(string.Format("qtyToAdd{0}", orderItem.Id), StringComparison.InvariantCultureIgnoreCase)) + { + int.TryParse(form[formKey], out qtyToAdd); + break; + } + + //validate quantity + if (qtyToAdd <= 0) + continue; + if (qtyToAdd > maxQtyToAdd) + qtyToAdd = maxQtyToAdd; + + //ok. we have at least one item. let's create a shipment (if it does not exist) + + var orderItemTotalWeight = orderItem.ItemWeight.HasValue ? orderItem.ItemWeight * qtyToAdd : null; + if (orderItemTotalWeight.HasValue) + { + if (!totalWeight.HasValue) + totalWeight = 0; + totalWeight += orderItemTotalWeight.Value; + } + if (shipment == null) + { + var trackingNumber = form["TrackingNumber"]; + var adminComment = form["AdminComment"]; + shipment = new Shipment + { + OrderId = order.Id, + TrackingNumber = trackingNumber, + TotalWeight = null, + ShippedDateUtc = null, + DeliveryDateUtc = null, + AdminComment = adminComment, + CreatedOnUtc = DateTime.UtcNow, + }; + } + //create a shipment item + var shipmentItem = new ShipmentItem + { + OrderItemId = orderItem.Id, + Quantity = qtyToAdd, + WarehouseId = warehouseId + }; + shipment.ShipmentItems.Add(shipmentItem); + } + + //if we have at least one item in the shipment, then save it + if (shipment != null && shipment.ShipmentItems.Any()) + { + shipment.TotalWeight = totalWeight; + _shipmentService.InsertShipment(shipment); + + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "A shipment has been added", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Orders.Shipments.Added")); + return continueEditing + ? RedirectToAction("ShipmentDetails", new {id = shipment.Id}) + : RedirectToAction("Edit", new { id = orderId }); + } + + ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoProductsSelected")); + return RedirectToAction("AddShipment", new { orderId = orderId }); + } + + public virtual ActionResult ShipmentDetails(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + var model = PrepareShipmentModel(shipment, true, true); + return View(model); + } + + [HttpPost] + public virtual ActionResult DeleteShipment(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + foreach (var shipmentItem in shipment.ShipmentItems) + { + var orderItem = _orderService.GetOrderItemById(shipmentItem.OrderItemId); + if (orderItem == null) + continue; + + _productService.ReverseBookedInventory(orderItem.Product, shipmentItem, + string.Format(_localizationService.GetResource("Admin.StockQuantityHistory.Messages.DeleteShipment"), shipment.OrderId)); + } + + var orderId = shipment.OrderId; + _shipmentService.DeleteShipment(shipment); + + var order =_orderService.GetOrderById(orderId); + //add a note + order.OrderNotes.Add(new OrderNote + { + Note = "A shipment has been deleted", + DisplayToCustomer = false, + CreatedOnUtc = DateTime.UtcNow + }); + _orderService.UpdateOrder(order); + LogEditOrder(order.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Orders.Shipments.Deleted")); + return RedirectToAction("Edit", new { id = orderId }); + } + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("settrackingnumber")] + public virtual ActionResult SetTrackingNumber(ShipmentModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(model.Id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + shipment.TrackingNumber = model.TrackingNumber; + _shipmentService.UpdateShipment(shipment); + + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("setadmincomment")] + public virtual ActionResult SetShipmentAdminComment(ShipmentModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(model.Id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + shipment.AdminComment = model.AdminComment; + _shipmentService.UpdateShipment(shipment); + + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("setasshipped")] + public virtual ActionResult SetAsShipped(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + try + { + _orderProcessingService.Ship(shipment, true); + LogEditOrder(shipment.OrderId); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + catch (Exception exc) + { + //error + ErrorNotification(exc, true); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + } + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("saveshippeddate")] + public virtual ActionResult EditShippedDate(ShipmentModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(model.Id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + try + { + if (!model.ShippedDateUtc.HasValue) + { + throw new Exception("Enter shipped date"); + } + shipment.ShippedDateUtc = model.ShippedDateUtc; + _shipmentService.UpdateShipment(shipment); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + catch (Exception exc) + { + //error + ErrorNotification(exc, true); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + } + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("setasdelivered")] + public virtual ActionResult SetAsDelivered(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + try + { + _orderProcessingService.Deliver(shipment, true); + LogEditOrder(shipment.OrderId); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + catch (Exception exc) + { + //error + ErrorNotification(exc, true); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + } + + + [HttpPost, ActionName("ShipmentDetails")] + [FormValueRequired("savedeliverydate")] + public virtual ActionResult EditDeliveryDate(ShipmentModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(model.Id); + if (shipment == null) + //No shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + try + { + if (!model.DeliveryDateUtc.HasValue) + { + throw new Exception("Enter delivery date"); + } + shipment.DeliveryDateUtc = model.DeliveryDateUtc; + _shipmentService.UpdateShipment(shipment); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + catch (Exception exc) + { + //error + ErrorNotification(exc, true); + return RedirectToAction("ShipmentDetails", new { id = shipment.Id }); + } + } + + public virtual ActionResult PdfPackagingSlip(int shipmentId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipment = _shipmentService.GetShipmentById(shipmentId); + if (shipment == null) + //no shipment found with the specified id + return RedirectToAction("List"); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null && !HasAccessToShipment(shipment)) + return RedirectToAction("List"); + + var shipments = new List(); + shipments.Add(shipment); + + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, string.Format("packagingslip_{0}.pdf", shipment.Id)); + } + + [HttpPost, ActionName("ShipmentList")] + [FormValueRequired("exportpackagingslips-all")] + public virtual ActionResult PdfPackagingSlipAll(ShipmentListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + //a vendor should have access only to his products + int vendorId = 0; + if (_workContext.CurrentVendor != null) + vendorId = _workContext.CurrentVendor.Id; + + //load shipments + var shipments = _shipmentService.GetAllShipments(vendorId: vendorId, + warehouseId: model.WarehouseId, + shippingCountryId: model.CountryId, + shippingStateId: model.StateProvinceId, + shippingCity: model.City, + trackingNumber: model.TrackingNumber, + loadNotShipped: model.LoadNotShipped, + createdFromUtc: startDateValue, + createdToUtc: endDateValue); + + //ensure that we at least one shipment selected + if (!shipments.Any()) + { + ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected")); + return RedirectToAction("ShipmentList"); + } + + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, "packagingslips.pdf"); + } + + [HttpPost] + public virtual ActionResult PdfPackagingSlipSelected(string selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipments = new List(); + if (selectedIds != null) + { + var ids = selectedIds + .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => Convert.ToInt32(x)) + .ToArray(); + shipments.AddRange(_shipmentService.GetShipmentsByIds(ids)); + } + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + shipments = shipments.Where(HasAccessToShipment).ToList(); + } + + //ensure that we at least one shipment selected + if (!shipments.Any()) + { + ErrorNotification(_localizationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected")); + return RedirectToAction("ShipmentList"); + } + + byte[] bytes; + using (var stream = new MemoryStream()) + { + _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _orderSettings.GeneratePdfInvoiceInCustomerLanguage ? 0 : _workContext.WorkingLanguage.Id); + bytes = stream.ToArray(); + } + return File(bytes, MimeTypes.ApplicationPdf, "packagingslips.pdf"); + } + + [HttpPost] + public virtual ActionResult SetAsShippedSelected(ICollection selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipments = new List(); + if (selectedIds != null) + { + shipments.AddRange(_shipmentService.GetShipmentsByIds(selectedIds.ToArray())); + } + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + shipments = shipments.Where(HasAccessToShipment).ToList(); + } + + foreach (var shipment in shipments) + { + try + { + _orderProcessingService.Ship(shipment, true); + } + catch + { + //ignore any exception + } + } + + return Json(new { Result = true }); + } + + [HttpPost] + public virtual ActionResult SetAsDeliveredSelected(ICollection selectedIds) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var shipments = new List(); + if (selectedIds != null) + { + shipments.AddRange(_shipmentService.GetShipmentsByIds(selectedIds.ToArray())); + } + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + shipments = shipments.Where(HasAccessToShipment).ToList(); + } + + foreach (var shipment in shipments) + { + try + { + _orderProcessingService.Deliver(shipment, true); + } + catch + { + //ignore any exception + } + } + + return Json(new { Result = true }); + } + + #endregion + + #region Order notes + + [HttpPost] + public virtual ActionResult OrderNotesSelect(int orderId, DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + throw new ArgumentException("No order found with the specified id"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return Content(""); + + //order notes + var orderNoteModels = new List(); + foreach (var orderNote in order.OrderNotes + .OrderByDescending(on => on.CreatedOnUtc)) + { + var download = _downloadService.GetDownloadById(orderNote.DownloadId); + orderNoteModels.Add(new OrderModel.OrderNote + { + Id = orderNote.Id, + OrderId = orderNote.OrderId, + DownloadId = orderNote.DownloadId, + DownloadGuid = download != null ? download.DownloadGuid : Guid.Empty, + DisplayToCustomer = orderNote.DisplayToCustomer, + Note = orderNote.FormatOrderNoteText(), + CreatedOn = _dateTimeHelper.ConvertToUserTime(orderNote.CreatedOnUtc, DateTimeKind.Utc) + }); + } + + var gridModel = new DataSourceResult + { + Data = orderNoteModels, + Total = orderNoteModels.Count + }; + + return Json(gridModel); + } + + [ValidateInput(false)] + public virtual ActionResult OrderNoteAdd(int orderId, int downloadId, bool displayToCustomer, string message) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + return Json(new { Result = false }, JsonRequestBehavior.AllowGet); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return Json(new { Result = false }, JsonRequestBehavior.AllowGet); + + var orderNote = new OrderNote + { + DisplayToCustomer = displayToCustomer, + Note = message, + DownloadId = downloadId, + CreatedOnUtc = DateTime.UtcNow, + }; + order.OrderNotes.Add(orderNote); + _orderService.UpdateOrder(order); + + //new order notification + if (displayToCustomer) + { + //email + _workflowMessageService.SendNewOrderNoteAddedCustomerNotification( + orderNote, _workContext.WorkingLanguage.Id); + + } + + return Json(new { Result = true }, JsonRequestBehavior.AllowGet); + } + + [HttpPost] + public virtual ActionResult OrderNoteDelete(int id, int orderId) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var order = _orderService.GetOrderById(orderId); + if (order == null) + throw new ArgumentException("No order found with the specified id"); + + //a vendor does not have access to this functionality + if (_workContext.CurrentVendor != null) + return RedirectToAction("Edit", "Order", new { id = orderId }); + + var orderNote = order.OrderNotes.FirstOrDefault(on => on.Id == id); + if (orderNote == null) + throw new ArgumentException("No order note found with the specified id"); + _orderService.DeleteOrderNote(orderNote); + + return new NullJsonResult(); + } + + #endregion + + #region Reports + + [NonAction] + protected virtual DataSourceResult GetBestsellersBriefReportModel(int pageIndex, + int pageSize, int orderBy) + { + //a vendor should have access only to his products + int vendorId = 0; + if (_workContext.CurrentVendor != null) + vendorId = _workContext.CurrentVendor.Id; + + var items = _orderReportService.BestSellersReport( + vendorId : vendorId, + orderBy: orderBy, + pageIndex: pageIndex, + pageSize: pageSize, + showHidden: true); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + { + var m = new BestsellersReportLineModel + { + ProductId = x.ProductId, + TotalAmount = _priceFormatter.FormatPrice(x.TotalAmount, true, false), + TotalQuantity = x.TotalQuantity, + }; + var product = _productService.GetProductById(x.ProductId); + if (product != null) + m.ProductName = product.Name; + return m; + }), + Total = items.TotalCount + }; + return gridModel; + } + public virtual ActionResult BestsellersBriefReportByQuantity() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + return PartialView(); + } + [HttpPost] + public virtual ActionResult BestsellersBriefReportByQuantityList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + var gridModel = GetBestsellersBriefReportModel(command.Page - 1, + command.PageSize, 1); + + return Json(gridModel); + } + public virtual ActionResult BestsellersBriefReportByAmount() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + return PartialView(); + } + [HttpPost] + public virtual ActionResult BestsellersBriefReportByAmountList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + var gridModel = GetBestsellersBriefReportModel(command.Page - 1, + command.PageSize, 2); + + return Json(gridModel); + } + + + + public virtual ActionResult BestsellersReport() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var model = new BestsellersReportModel(); + //vendor + model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; + + //stores + model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + foreach (var s in _storeService.GetAllStores()) + model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); + + //order statuses + model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //payment statuses + model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //categories + model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); + foreach (var c in categories) + model.AvailableCategories.Add(c); + + //manufacturers + model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); + foreach (var m in manufacturers) + model.AvailableManufacturers.Add(m); + + //billing countries + foreach (var c in _countryService.GetAllCountriesForBilling(showHidden: true)) + model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); + model.AvailableCountries.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //vendors + model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); + foreach (var v in vendors) + model.AvailableVendors.Add(v); + + return View(model); + } + [HttpPost] + public virtual ActionResult BestsellersReportList(DataSourceRequest command, BestsellersReportModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.VendorId = _workContext.CurrentVendor.Id; + } + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; + PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; + + var items = _orderReportService.BestSellersReport( + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + os: orderStatus, + ps: paymentStatus, + billingCountryId: model.BillingCountryId, + orderBy: 2, + vendorId: model.VendorId, + categoryId: model.CategoryId, + manufacturerId: model.ManufacturerId, + storeId: model.StoreId, + pageIndex: command.Page - 1, + pageSize: command.PageSize, + showHidden: true); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + { + var m = new BestsellersReportLineModel + { + ProductId = x.ProductId, + TotalAmount = _priceFormatter.FormatPrice(x.TotalAmount, true, false), + TotalQuantity = x.TotalQuantity, + }; + var product = _productService.GetProductById(x.ProductId); + if (product!= null) + m.ProductName = product.Name; + return m; + }), + Total = items.TotalCount + }; + + return Json(gridModel); + } + + + + public virtual ActionResult NeverSoldReport() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedView(); + + var model = new NeverSoldReportModel(); + + //a vendor should have access only to his products + model.IsLoggedInAsVendor = _workContext.CurrentVendor != null; + + //categories + model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var categories = SelectListHelper.GetCategoryList(_categoryService, _cacheManager, true); + foreach (var c in categories) + model.AvailableCategories.Add(c); + + //manufacturers + model.AvailableManufacturers.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var manufacturers = SelectListHelper.GetManufacturerList(_manufacturerService, _cacheManager, true); + foreach (var m in manufacturers) + model.AvailableManufacturers.Add(m); + + //stores + model.AvailableStores.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + foreach (var s in _storeService.GetAllStores()) + model.AvailableStores.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString() }); + + //vendors + model.AvailableVendors.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + var vendors = SelectListHelper.GetVendorList(_vendorService, _cacheManager, true); + foreach (var v in vendors) + model.AvailableVendors.Add(v); + + + return View(model); + } + [HttpPost] + public virtual ActionResult NeverSoldReportList(DataSourceRequest command, NeverSoldReportModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor should have access only to his products + if (_workContext.CurrentVendor != null) + { + model.SearchVendorId = _workContext.CurrentVendor.Id; + } + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + var items = _orderReportService.ProductsNeverSold(vendorId: model.SearchVendorId, + storeId: model.SearchStoreId, + categoryId: model.SearchCategoryId, + manufacturerId: model.SearchManufacturerId, + createdFromUtc: startDateValue, + createdToUtc: endDateValue, + pageIndex : command.Page - 1, + pageSize: command.PageSize, + showHidden: true); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + new NeverSoldReportLineModel + { + ProductId = x.Id, + ProductName = x.Name, + }), + Total = items.TotalCount + }; + + return Json(gridModel); + } + + + [ChildActionOnly] + public virtual ActionResult OrderAverageReport() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + return PartialView(); + } + [HttpPost] + public virtual ActionResult OrderAverageReportList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor doesn't have access to this report + if (_workContext.CurrentVendor != null) + return Content(""); + + var report = new List(); + report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Pending)); + report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Processing)); + report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Complete)); + report.Add(_orderReportService.OrderAverageReport(0, OrderStatus.Cancelled)); + var model = report.Select(x => new OrderAverageReportLineSummaryModel + { + OrderStatus = x.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), + SumTodayOrders = _priceFormatter.FormatPrice(x.SumTodayOrders, true, false), + SumThisWeekOrders = _priceFormatter.FormatPrice(x.SumThisWeekOrders, true, false), + SumThisMonthOrders = _priceFormatter.FormatPrice(x.SumThisMonthOrders, true, false), + SumThisYearOrders = _priceFormatter.FormatPrice(x.SumThisYearOrders, true, false), + SumAllTimeOrders = _priceFormatter.FormatPrice(x.SumAllTimeOrders, true, false), + }).ToList(); + + var gridModel = new DataSourceResult + { + Data = model, + Total = model.Count + }; + + return Json(gridModel); + } + + [ChildActionOnly] + public virtual ActionResult OrderIncompleteReport() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + return PartialView(); + } + + [HttpPost] + public virtual ActionResult OrderIncompleteReportList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return AccessDeniedKendoGridJson(); + + //a vendor doesn't have access to this report + if (_workContext.CurrentVendor != null) + return Content(""); + + var model = new List(); + //not paid + var orderStatuses = Enum.GetValues(typeof(OrderStatus)).Cast().Where(os => os != (int)OrderStatus.Cancelled).ToList(); + var paymentStatuses = new List() { (int)PaymentStatus.Pending }; + var psPending = _orderReportService.GetOrderAverageReportLine(psIds: paymentStatuses, osIds: orderStatuses); + model.Add(new OrderIncompleteReportLineModel + { + Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalUnpaidOrders"), + Count = psPending.CountOrders, + Total = _priceFormatter.FormatPrice(psPending.SumOrders, true, false), + ViewLink = Url.Action("List", "Order", new { + orderStatusIds = string.Join(",", orderStatuses), + paymentStatusIds = string.Join(",", paymentStatuses) }) + }); + //not shipped + var shippingStatuses = new List() { (int)ShippingStatus.NotYetShipped }; + var ssPending = _orderReportService.GetOrderAverageReportLine(osIds: orderStatuses, ssIds: shippingStatuses); + model.Add(new OrderIncompleteReportLineModel + { + Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalNotShippedOrders"), + Count = ssPending.CountOrders, + Total = _priceFormatter.FormatPrice(ssPending.SumOrders, true, false), + ViewLink = Url.Action("List", "Order", new { + orderStatusIds = string.Join(",", orderStatuses), + shippingStatusIds = string.Join(",", shippingStatuses) }) + }); + //pending + orderStatuses = new List() { (int)OrderStatus.Pending }; + var osPending = _orderReportService.GetOrderAverageReportLine(osIds: orderStatuses); + model.Add(new OrderIncompleteReportLineModel + { + Item = _localizationService.GetResource("Admin.SalesReport.Incomplete.TotalIncompleteOrders"), + Count = osPending.CountOrders, + Total = _priceFormatter.FormatPrice(osPending.SumOrders, true, false), + ViewLink = Url.Action("List", "Order", new { orderStatusIds = string.Join(",", orderStatuses) }) + }); + + var gridModel = new DataSourceResult + { + Data = model, + Total = model.Count + }; + + return Json(gridModel); + } + + public virtual ActionResult CountryReport() + { + if (!_permissionService.Authorize(StandardPermissionProvider.OrderCountryReport)) + return AccessDeniedView(); + + var model = new CountryReportModel(); + + //order statuses + model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList(); + model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + //payment statuses + model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList(); + model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); + + return View(model); + } + + [HttpPost] + public virtual ActionResult CountryReportList(DataSourceRequest command, CountryReportModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.OrderCountryReport)) + return AccessDeniedKendoGridJson(); + + DateTime? startDateValue = (model.StartDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone); + + DateTime? endDateValue = (model.EndDate == null) ? null + : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1); + + OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null; + PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null; + + var items = _orderReportService.GetCountryReport( + os: orderStatus, + ps: paymentStatus, + startTimeUtc: startDateValue, + endTimeUtc: endDateValue); + var gridModel = new DataSourceResult + { + Data = items.Select(x => + { + var country = _countryService.GetCountryById(x.CountryId.HasValue ? x.CountryId.Value : 0); + var m = new CountryReportLineModel + { + CountryName = country != null ? country.Name : "Unknown", + SumOrders = _priceFormatter.FormatPrice(x.SumOrders, true, false), + TotalOrders = x.TotalOrders, + }; + return m; + }), + Total = items.Count + }; + + return Json(gridModel); + } + + [ChildActionOnly] + public virtual ActionResult OrderStatistics() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + //a vendor doesn't have access to this report + if (_workContext.CurrentVendor != null) + return Content(""); + + return PartialView(); + } + + [AcceptVerbs(HttpVerbs.Get)] + public virtual ActionResult LoadOrderStatistics(string period) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + //a vendor doesn't have access to this report + if (_workContext.CurrentVendor != null) + return Content(""); + + var result = new List(); + + var nowDt = _dateTimeHelper.ConvertToUserTime(DateTime.Now); + var timeZone = _dateTimeHelper.CurrentTimeZone; + + var culture = new CultureInfo(_workContext.WorkingLanguage.LanguageCulture); + + switch (period) + { + case "year": + //year statistics + var yearAgoDt = nowDt.AddYears(-1).AddMonths(1); + var searchYearDateUser = new DateTime(yearAgoDt.Year, yearAgoDt.Month, 1); + if (!timeZone.IsInvalidTime(searchYearDateUser)) + { + for (int i = 0; i <= 12; i++) + { + result.Add(new + { + date = searchYearDateUser.Date.ToString("Y", culture), + value = _orderService.SearchOrders( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchYearDateUser.AddMonths(1), timeZone), + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchYearDateUser = searchYearDateUser.AddMonths(1); + } + } + break; + + case "month": + //month statistics + var monthAgoDt = nowDt.AddDays(-30); + var searchMonthDateUser = new DateTime(monthAgoDt.Year, monthAgoDt.Month, monthAgoDt.Day); + if (!timeZone.IsInvalidTime(searchMonthDateUser)) + { + for (int i = 0; i <= 30; i++) + { + result.Add(new + { + date = searchMonthDateUser.Date.ToString("M", culture), + value = _orderService.SearchOrders( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchMonthDateUser.AddDays(1), timeZone), + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchMonthDateUser = searchMonthDateUser.AddDays(1); + } + } + break; + + case "week": + default: + //week statistics + var weekAgoDt = nowDt.AddDays(-7); + var searchWeekDateUser = new DateTime(weekAgoDt.Year, weekAgoDt.Month, weekAgoDt.Day); + if (!timeZone.IsInvalidTime(searchWeekDateUser)) + { + for (int i = 0; i <= 7; i++) + { + result.Add(new + { + date = searchWeekDateUser.Date.ToString("d dddd", culture), + value = _orderService.SearchOrders( + createdFromUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser, timeZone), + createdToUtc: _dateTimeHelper.ConvertToUtcTime(searchWeekDateUser.AddDays(1), timeZone), + pageIndex: 0, + pageSize: 1).TotalCount.ToString() + }); + + searchWeekDateUser = searchWeekDateUser.AddDays(1); + } + } + break; + } + + return Json(result, JsonRequestBehavior.AllowGet); + } + + [ChildActionOnly] + public virtual ActionResult LatestOrders() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders)) + return Content(""); + + return PartialView(); + } + + #endregion + + #region Activity log + + [NonAction] + protected virtual void LogEditOrder(int orderId) + { + var order = _orderService.GetOrderById(orderId); + + _customerActivityService.InsertActivity("EditOrder", _localizationService.GetResource("ActivityLog.EditOrder"), order.CustomOrderNumber); + } + + #endregion + } +} diff --git a/src/Presentation/Nop.Web/Administration/Controllers/SettingController.cs b/src/Presentation/Nop.Web/Administration/Controllers/SettingController.cs index 4f48048c76a..084ffc1b1c3 100644 --- a/src/Presentation/Nop.Web/Administration/Controllers/SettingController.cs +++ b/src/Presentation/Nop.Web/Administration/Controllers/SettingController.cs @@ -1,2339 +1,2356 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using Nop.Admin.Extensions; -using Nop.Admin.Models.Common; -using Nop.Admin.Models.Settings; -using Nop.Admin.Models.Stores; -using Nop.Core; -using Nop.Core.Configuration; -using Nop.Core.Domain; -using Nop.Core.Domain.Blogs; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Forums; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Media; -using Nop.Core.Domain.News; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Security; -using Nop.Core.Domain.Seo; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Core.Domain.Vendors; -using Nop.Services; -using Nop.Services.Common; -using Nop.Services.Configuration; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Helpers; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Media; -using Nop.Services.Orders; -using Nop.Services.Security; -using Nop.Services.Stores; -using Nop.Services.Tax; -using Nop.Web.Framework; -using Nop.Web.Framework.Controllers; -using Nop.Web.Framework.Kendoui; -using Nop.Web.Framework.Localization; -using Nop.Web.Framework.Mvc; -using Nop.Web.Framework.Security; -using Nop.Web.Framework.Security.Captcha; -using Nop.Web.Framework.Themes; - -namespace Nop.Admin.Controllers -{ - public partial class SettingController : BaseAdminController - { - #region Fields - - private readonly ISettingService _settingService; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly IAddressService _addressService; - private readonly ITaxCategoryService _taxCategoryService; - private readonly ICurrencyService _currencyService; - private readonly IPictureService _pictureService; - private readonly ILocalizationService _localizationService; - private readonly IDateTimeHelper _dateTimeHelper; - private readonly IOrderService _orderService; - private readonly IEncryptionService _encryptionService; - private readonly IThemeProvider _themeProvider; - private readonly ICustomerService _customerService; - private readonly ICustomerActivityService _customerActivityService; - private readonly IPermissionService _permissionService; - private readonly IFulltextService _fulltextService; - private readonly IMaintenanceService _maintenanceService; - private readonly IStoreService _storeService; - private readonly IWorkContext _workContext; - private readonly IGenericAttributeService _genericAttributeService; - private readonly IReturnRequestService _returnRequestService; - private readonly ILanguageService _languageService; - private readonly ILocalizedEntityService _localizedEntityService; - private readonly NopConfig _config; - #endregion - - #region Ctor - - public SettingController(ISettingService settingService, - ICountryService countryService, - IStateProvinceService stateProvinceService, - IAddressService addressService, - ITaxCategoryService taxCategoryService, - ICurrencyService currencyService, - IPictureService pictureService, - ILocalizationService localizationService, - IDateTimeHelper dateTimeHelper, - IOrderService orderService, - IEncryptionService encryptionService, - IThemeProvider themeProvider, - ICustomerService customerService, - ICustomerActivityService customerActivityService, - IPermissionService permissionService, - IFulltextService fulltextService, - IMaintenanceService maintenanceService, - IStoreService storeService, - IWorkContext workContext, - IGenericAttributeService genericAttributeService, - IReturnRequestService returnRequestService, - ILanguageService languageService, - ILocalizedEntityService localizedEntityService, - NopConfig config) - { - this._settingService = settingService; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._addressService = addressService; - this._taxCategoryService = taxCategoryService; - this._currencyService = currencyService; - this._pictureService = pictureService; - this._localizationService = localizationService; - this._dateTimeHelper = dateTimeHelper; - this._orderService = orderService; - this._encryptionService = encryptionService; - this._themeProvider = themeProvider; - this._customerService = customerService; - this._customerActivityService = customerActivityService; - this._permissionService = permissionService; - this._fulltextService = fulltextService; - this._maintenanceService = maintenanceService; - this._storeService = storeService; - this._workContext = workContext; - this._genericAttributeService = genericAttributeService; - this._returnRequestService = returnRequestService; - this._languageService = languageService; - this._localizedEntityService = localizedEntityService; - this._config = config; - } - - #endregion - - #region Utilities - - [NonAction] - protected virtual void UpdateLocales(ReturnRequestReason rrr, ReturnRequestReasonModel model) - { - foreach (var localized in model.Locales) - { - _localizedEntityService.SaveLocalizedValue(rrr, - x => x.Name, - localized.Name, - localized.LanguageId); - } - } - - [NonAction] - protected virtual void UpdateLocales(ReturnRequestAction rra, ReturnRequestActionModel model) - { - foreach (var localized in model.Locales) - { - _localizedEntityService.SaveLocalizedValue(rra, - x => x.Name, - localized.Name, - localized.LanguageId); - } - } - - #endregion - - #region Methods - - [ChildActionOnly] - public virtual ActionResult Mode(string modeName = "settings-advanced-mode") - { - var model = new ModeModel() - { - ModeName = modeName, - Enabled = _workContext.CurrentCustomer.GetAttribute(modeName) - }; - return PartialView(model); - } - - [ChildActionOnly] - public virtual ActionResult StoreScopeConfiguration() - { - var allStores = _storeService.GetAllStores(); - if (allStores.Count < 2) - return Content(""); - - var model = new StoreScopeConfigurationModel(); - foreach (var s in allStores) - { - model.Stores.Add(new StoreModel - { - Id = s.Id, - Name = s.Name - }); - } - model.StoreId = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - - return PartialView(model); - } - public virtual ActionResult ChangeStoreScopeConfiguration(int storeid, string returnUrl = "") - { - var store = _storeService.GetStoreById(storeid); - if (store != null || storeid == 0) - { - _genericAttributeService.SaveAttribute(_workContext.CurrentCustomer, - SystemCustomerAttributeNames.AdminAreaStoreScopeConfiguration, storeid); - } - - //home page - if (String.IsNullOrEmpty(returnUrl)) - returnUrl = Url.Action("Index", "Home", new { area = "Admin" }); - //prevent open redirection attack - if (!Url.IsLocalUrl(returnUrl)) - return RedirectToAction("Index", "Home", new { area = "Admin" }); - return Redirect(returnUrl); - } - - public virtual ActionResult Blog() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var blogSettings = _settingService.LoadSetting(storeScope); - var model = blogSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.Enabled_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.Enabled, storeScope); - model.PostsPageSize_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.PostsPageSize, storeScope); - model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.AllowNotRegisteredUsersToLeaveComments, storeScope); - model.NotifyAboutNewBlogComments_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.NotifyAboutNewBlogComments, storeScope); - model.NumberOfTags_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.NumberOfTags, storeScope); - model.ShowHeaderRssUrl_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.ShowHeaderRssUrl, storeScope); - model.BlogCommentsMustBeApproved_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.BlogCommentsMustBeApproved, storeScope); - } - - return View(model); - } - [HttpPost] - public virtual ActionResult Blog(BlogSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var blogSettings = _settingService.LoadSetting(storeScope); - blogSettings = model.ToEntity(blogSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.PostsPageSize, model.PostsPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.AllowNotRegisteredUsersToLeaveComments, model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.NotifyAboutNewBlogComments, model.NotifyAboutNewBlogComments_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.NumberOfTags, model.NumberOfTags_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.ShowHeaderRssUrl, model.ShowHeaderRssUrl_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.BlogCommentsMustBeApproved, model.BlogCommentsMustBeApproved_OverrideForStore, storeScope, false); - _settingService.SaveSetting(blogSettings, x => x.ShowBlogCommentsPerStore, clearCache: false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Blog"); - } - - - - - public virtual ActionResult Vendor() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var vendorSettings = _settingService.LoadSetting(storeScope); - var model = vendorSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.VendorsBlockItemsToDisplay_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.VendorsBlockItemsToDisplay, storeScope); - model.ShowVendorOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.ShowVendorOnProductDetailsPage, storeScope); - model.AllowCustomersToContactVendors_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowCustomersToContactVendors, storeScope); - model.AllowCustomersToApplyForVendorAccount_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowCustomersToApplyForVendorAccount, storeScope); - model.AllowSearchByVendor_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowSearchByVendor, storeScope); - model.AllowVendorsToEditInfo_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowVendorsToEditInfo, storeScope); - model.NotifyStoreOwnerAboutVendorInformationChange_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.NotifyStoreOwnerAboutVendorInformationChange, storeScope); - model.MaximumProductNumber_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.MaximumProductNumber, storeScope); - model.AllowVendorsToImportProducts_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowVendorsToImportProducts, storeScope); - } - - return View(model); - } - [HttpPost] - public virtual ActionResult Vendor(VendorSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var vendorSettings = _settingService.LoadSetting(storeScope); - vendorSettings = model.ToEntity(vendorSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.VendorsBlockItemsToDisplay, model.VendorsBlockItemsToDisplay_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.ShowVendorOnProductDetailsPage, model.ShowVendorOnProductDetailsPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowCustomersToContactVendors, model.AllowCustomersToContactVendors_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowCustomersToApplyForVendorAccount, model.AllowCustomersToApplyForVendorAccount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowSearchByVendor, model.AllowSearchByVendor_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowVendorsToEditInfo, model.AllowVendorsToEditInfo_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.NotifyStoreOwnerAboutVendorInformationChange, model.NotifyStoreOwnerAboutVendorInformationChange_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.MaximumProductNumber, model.MaximumProductNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowVendorsToImportProducts, model.AllowVendorsToImportProducts_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Vendor"); - } - - - - - public virtual ActionResult Forum() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var forumSettings = _settingService.LoadSetting(storeScope); - var model = forumSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.ForumsEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumsEnabled, storeScope); - model.RelativeDateTimeFormattingEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.RelativeDateTimeFormattingEnabled, storeScope); - model.ShowCustomersPostCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ShowCustomersPostCount, storeScope); - model.AllowGuestsToCreatePosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowGuestsToCreatePosts, storeScope); - model.AllowGuestsToCreateTopics_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowGuestsToCreateTopics, storeScope); - model.AllowCustomersToEditPosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToEditPosts, storeScope); - model.AllowCustomersToDeletePosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToDeletePosts, storeScope); - model.AllowPostVoting_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowPostVoting, storeScope); - model.MaxVotesPerDay_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.MaxVotesPerDay, storeScope); - model.AllowCustomersToManageSubscriptions_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToManageSubscriptions, storeScope); - model.TopicsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.TopicsPageSize, storeScope); - model.PostsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.PostsPageSize, storeScope); - model.ForumEditor_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumEditor, storeScope); - model.SignaturesEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.SignaturesEnabled, storeScope); - model.AllowPrivateMessages_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowPrivateMessages, storeScope); - model.ShowAlertForPM_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ShowAlertForPM, storeScope); - model.NotifyAboutPrivateMessages_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.NotifyAboutPrivateMessages, storeScope); - model.ActiveDiscussionsFeedEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsFeedEnabled, storeScope); - model.ActiveDiscussionsFeedCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsFeedCount, storeScope); - model.ForumFeedsEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumFeedsEnabled, storeScope); - model.ForumFeedCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumFeedCount, storeScope); - model.SearchResultsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.SearchResultsPageSize, storeScope); - model.ActiveDiscussionsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsPageSize, storeScope); - } - model.ForumEditorValues = forumSettings.ForumEditor.ToSelectList(); - - return View(model); - } - [HttpPost] - public virtual ActionResult Forum(ForumSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var forumSettings = _settingService.LoadSetting(storeScope); - forumSettings = model.ToEntity(forumSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumsEnabled, model.ForumsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.RelativeDateTimeFormattingEnabled, model.RelativeDateTimeFormattingEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ShowCustomersPostCount, model.ShowCustomersPostCount_OverrideForStore , storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowGuestsToCreatePosts, model.AllowGuestsToCreatePosts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowGuestsToCreateTopics, model.AllowGuestsToCreateTopics_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToEditPosts, model.AllowCustomersToEditPosts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToDeletePosts, model.AllowCustomersToDeletePosts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowPostVoting, model.AllowPostVoting_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.MaxVotesPerDay, model.MaxVotesPerDay_OverrideForStore , storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToManageSubscriptions, model.AllowCustomersToManageSubscriptions_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.TopicsPageSize, model.TopicsPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.PostsPageSize, model.PostsPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumEditor, model.ForumEditor_OverrideForStore , storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.SignaturesEnabled, model.SignaturesEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowPrivateMessages, model.AllowPrivateMessages_OverrideForStore , storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ShowAlertForPM, model.ShowAlertForPM_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.NotifyAboutPrivateMessages, model.NotifyAboutPrivateMessages_OverrideForStore , storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsFeedEnabled, model.ActiveDiscussionsFeedEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsFeedCount, model.ActiveDiscussionsFeedCount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumFeedsEnabled, model.ForumFeedsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumFeedCount, model.ForumFeedCount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.SearchResultsPageSize, model.SearchResultsPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsPageSize, model.ActiveDiscussionsPageSize_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Forum"); - } - - - - - public virtual ActionResult News() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var newsSettings = _settingService.LoadSetting(storeScope); - var model = newsSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.Enabled_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.Enabled, storeScope); - model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.AllowNotRegisteredUsersToLeaveComments, storeScope); - model.NotifyAboutNewNewsComments_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NotifyAboutNewNewsComments, storeScope); - model.ShowNewsOnMainPage_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.ShowNewsOnMainPage, storeScope); - model.MainPageNewsCount_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.MainPageNewsCount, storeScope); - model.NewsArchivePageSize_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NewsArchivePageSize, storeScope); - model.ShowHeaderRssUrl_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.ShowHeaderRssUrl, storeScope); - model.NewsCommentsMustBeApproved_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NewsCommentsMustBeApproved, storeScope); - } - return View(model); - } - [HttpPost] - public virtual ActionResult News(NewsSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var newsSettings = _settingService.LoadSetting(storeScope); - newsSettings = model.ToEntity(newsSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.AllowNotRegisteredUsersToLeaveComments, model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NotifyAboutNewNewsComments, model.NotifyAboutNewNewsComments_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.ShowNewsOnMainPage, model.ShowNewsOnMainPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.MainPageNewsCount, model.MainPageNewsCount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NewsArchivePageSize, model.NewsArchivePageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.ShowHeaderRssUrl, model.ShowHeaderRssUrl_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NewsCommentsMustBeApproved, model.NewsCommentsMustBeApproved_OverrideForStore, storeScope, false); - _settingService.SaveSetting(newsSettings, x => x.ShowNewsCommentsPerStore, clearCache: false); - - //now clear settings cache - _settingService.ClearCache(); - - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("News"); - } - - - - - public virtual ActionResult Shipping() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var shippingSettings = _settingService.LoadSetting(storeScope); - var model = shippingSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.ShipToSameAddress_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ShipToSameAddress, storeScope); - model.AllowPickUpInStore_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.AllowPickUpInStore, storeScope); - model.DisplayPickupPointsOnMap_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayPickupPointsOnMap, storeScope); - model.GoogleMapsApiKey_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.GoogleMapsApiKey, storeScope); - model.UseWarehouseLocation_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.UseWarehouseLocation, storeScope); - model.NotifyCustomerAboutShippingFromMultipleLocations_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.NotifyCustomerAboutShippingFromMultipleLocations, storeScope); - model.FreeShippingOverXEnabled_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXEnabled, storeScope); - model.FreeShippingOverXValue_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXValue, storeScope); - model.FreeShippingOverXIncludingTax_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXIncludingTax, storeScope); - model.EstimateShippingEnabled_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.EstimateShippingEnabled, storeScope); - model.DisplayShipmentEventsToCustomers_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayShipmentEventsToCustomers, storeScope); - model.DisplayShipmentEventsToStoreOwner_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayShipmentEventsToStoreOwner, storeScope); - model.HideShippingTotal_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.HideShippingTotal, storeScope); - model.BypassShippingMethodSelectionIfOnlyOne_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.BypassShippingMethodSelectionIfOnlyOne, storeScope); - model.ConsiderAssociatedProductsDimensions_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ConsiderAssociatedProductsDimensions, storeScope); - model.ShippingOriginAddress_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ShippingOriginAddressId, storeScope); - } - //shipping origin - var originAddress = shippingSettings.ShippingOriginAddressId > 0 - ? _addressService.GetAddressById(shippingSettings.ShippingOriginAddressId) - : null; - if (originAddress != null) - model.ShippingOriginAddress = originAddress.ToModel(); - else - model.ShippingOriginAddress = new AddressModel(); - - model.ShippingOriginAddress.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.ShippingOriginAddress.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (originAddress != null && c.Id == originAddress.CountryId) }); - - var states = originAddress != null && originAddress.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(originAddress.Country.Id, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.ShippingOriginAddress.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == originAddress.StateProvinceId) }); - } - else - model.ShippingOriginAddress.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - model.ShippingOriginAddress.CountryEnabled = true; - model.ShippingOriginAddress.StateProvinceEnabled = true; - model.ShippingOriginAddress.CityEnabled = true; - model.ShippingOriginAddress.StreetAddressEnabled = true; - model.ShippingOriginAddress.ZipPostalCodeEnabled = true; - model.ShippingOriginAddress.ZipPostalCodeRequired = true; - - return View(model); - } - [HttpPost] - public virtual ActionResult Shipping(ShippingSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var shippingSettings = _settingService.LoadSetting(storeScope); - shippingSettings = model.ToEntity(shippingSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.ShipToSameAddress, model.ShipToSameAddress_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.AllowPickUpInStore, model.AllowPickUpInStore_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayPickupPointsOnMap, model.DisplayPickupPointsOnMap_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.GoogleMapsApiKey, model.GoogleMapsApiKey_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.UseWarehouseLocation, model.UseWarehouseLocation_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.NotifyCustomerAboutShippingFromMultipleLocations, model.NotifyCustomerAboutShippingFromMultipleLocations_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXEnabled, model.FreeShippingOverXEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXValue, model.FreeShippingOverXValue_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXIncludingTax, model.FreeShippingOverXIncludingTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.EstimateShippingEnabled, model.EstimateShippingEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayShipmentEventsToCustomers, model.DisplayShipmentEventsToCustomers_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayShipmentEventsToStoreOwner, model.DisplayShipmentEventsToStoreOwner_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.HideShippingTotal, model.HideShippingTotal_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.BypassShippingMethodSelectionIfOnlyOne, model.BypassShippingMethodSelectionIfOnlyOne_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.ConsiderAssociatedProductsDimensions, model.ConsiderAssociatedProductsDimensions_OverrideForStore, storeScope, false); - - if (model.ShippingOriginAddress_OverrideForStore || storeScope == 0) - { - //update address - var addressId = _settingService.SettingExists(shippingSettings, x => x.ShippingOriginAddressId, storeScope) ? - shippingSettings.ShippingOriginAddressId : 0; - var originAddress = _addressService.GetAddressById(addressId) ?? - new Address - { - CreatedOnUtc = DateTime.UtcNow, - }; - //update ID manually (in case we're in multi-store configuration mode it'll be set to the shared one) - model.ShippingOriginAddress.Id = addressId; - originAddress = model.ShippingOriginAddress.ToEntity(originAddress); - if (originAddress.Id > 0) - _addressService.UpdateAddress(originAddress); - else - _addressService.InsertAddress(originAddress); - shippingSettings.ShippingOriginAddressId = originAddress.Id; - - _settingService.SaveSetting(shippingSettings, x => x.ShippingOriginAddressId, storeScope, false); - } - else if (storeScope > 0) - _settingService.DeleteSetting(shippingSettings, x => x.ShippingOriginAddressId, storeScope); - - - //now clear settings cache - _settingService.ClearCache(); - - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Shipping"); - } - - - - - public virtual ActionResult Tax() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var taxSettings = _settingService.LoadSetting(storeScope); - var model = taxSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.PricesIncludeTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PricesIncludeTax, storeScope); - model.AllowCustomersToSelectTaxDisplayType_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.AllowCustomersToSelectTaxDisplayType, storeScope); - model.TaxDisplayType_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxDisplayType, storeScope); - model.DisplayTaxSuffix_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DisplayTaxSuffix, storeScope); - model.DisplayTaxRates_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DisplayTaxRates, storeScope); - model.HideZeroTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.HideZeroTax, storeScope); - model.HideTaxInOrderSummary_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.HideTaxInOrderSummary, storeScope); - model.ForceTaxExclusionFromOrderSubtotal_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ForceTaxExclusionFromOrderSubtotal, storeScope); - model.DefaultTaxCategoryId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DefaultTaxCategoryId, storeScope); - model.TaxBasedOn_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxBasedOn, storeScope); - model.TaxBasedOnPickupPointAddress_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxBasedOnPickupPointAddress, storeScope); - model.DefaultTaxAddress_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DefaultTaxAddressId, storeScope); - model.ShippingIsTaxable_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingIsTaxable, storeScope); - model.ShippingPriceIncludesTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingPriceIncludesTax, storeScope); - model.ShippingTaxClassId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingTaxClassId, storeScope); - model.PaymentMethodAdditionalFeeIsTaxable_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeIsTaxable, storeScope); - model.PaymentMethodAdditionalFeeIncludesTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeIncludesTax, storeScope); - model.PaymentMethodAdditionalFeeTaxClassId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeTaxClassId, storeScope); - model.EuVatEnabled_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatEnabled, storeScope); - model.EuVatShopCountryId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatShopCountryId, storeScope); - model.EuVatAllowVatExemption_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatAllowVatExemption, storeScope); - model.EuVatUseWebService_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatUseWebService, storeScope); - model.EuVatAssumeValid_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatAssumeValid, storeScope); - model.EuVatEmailAdminWhenNewVatSubmitted_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatEmailAdminWhenNewVatSubmitted, storeScope); - } - - model.TaxBasedOnValues = taxSettings.TaxBasedOn.ToSelectList(); - model.TaxDisplayTypeValues = taxSettings.TaxDisplayType.ToSelectList(); - - //tax categories - var taxCategories = _taxCategoryService.GetAllTaxCategories(); - model.TaxCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Configuration.Settings.Tax.TaxCategories.None"), Value = "0" }); - foreach (var tc in taxCategories) - model.TaxCategories.Add(new SelectListItem { Text = tc.Name, Value = tc.Id.ToString() }); - model.PaymentMethodAdditionalFeeTaxCategories.Add(new SelectListItem { Text = "---", Value = "0" }); - foreach (var tc in taxCategories) - model.PaymentMethodAdditionalFeeTaxCategories.Add(new SelectListItem { Text = tc.Name, Value = tc.Id.ToString(), Selected = tc.Id == taxSettings.PaymentMethodAdditionalFeeTaxClassId }); - - //EU VAT countries - model.EuVatShopCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.EuVatShopCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = c.Id == taxSettings.EuVatShopCountryId }); - - //default tax address - var defaultAddress = taxSettings.DefaultTaxAddressId > 0 - ? _addressService.GetAddressById(taxSettings.DefaultTaxAddressId) - : null; - if (defaultAddress != null) - model.DefaultTaxAddress = defaultAddress.ToModel(); - else - model.DefaultTaxAddress = new AddressModel(); - - model.DefaultTaxAddress.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.DefaultTaxAddress.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (defaultAddress != null && c.Id == defaultAddress.CountryId) }); - - var states = defaultAddress != null && defaultAddress.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(defaultAddress.Country.Id, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.DefaultTaxAddress.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == defaultAddress.StateProvinceId) }); - } - else - model.DefaultTaxAddress.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - model.DefaultTaxAddress.CountryEnabled = true; - model.DefaultTaxAddress.StateProvinceEnabled = true; - model.DefaultTaxAddress.ZipPostalCodeEnabled = true; - model.DefaultTaxAddress.ZipPostalCodeRequired = true; - - return View(model); - } - [HttpPost] - public virtual ActionResult Tax(TaxSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var taxSettings = _settingService.LoadSetting(storeScope); - taxSettings = model.ToEntity(taxSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PricesIncludeTax, model.PricesIncludeTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.AllowCustomersToSelectTaxDisplayType, model.AllowCustomersToSelectTaxDisplayType_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxDisplayType, model.TaxDisplayType_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DisplayTaxSuffix, model.DisplayTaxSuffix_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DisplayTaxRates, model.DisplayTaxRates_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.HideZeroTax, model.HideZeroTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.HideTaxInOrderSummary, model.HideTaxInOrderSummary_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ForceTaxExclusionFromOrderSubtotal, model.ForceTaxExclusionFromOrderSubtotal_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DefaultTaxCategoryId, model.DefaultTaxCategoryId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxBasedOn, model.TaxBasedOn_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxBasedOnPickupPointAddress, model.TaxBasedOnPickupPointAddress_OverrideForStore, storeScope, false); - - - if (model.DefaultTaxAddress_OverrideForStore || storeScope == 0) - { - //update address - var addressId = _settingService.SettingExists(taxSettings, x => x.DefaultTaxAddressId, storeScope) ? - taxSettings.DefaultTaxAddressId : 0; - var originAddress = _addressService.GetAddressById(addressId) ?? - new Address - { - CreatedOnUtc = DateTime.UtcNow, - }; - //update ID manually (in case we're in multi-store configuration mode it'll be set to the shared one) - model.DefaultTaxAddress.Id = addressId; - originAddress = model.DefaultTaxAddress.ToEntity(originAddress); - if (originAddress.Id > 0) - _addressService.UpdateAddress(originAddress); - else - _addressService.InsertAddress(originAddress); - taxSettings.DefaultTaxAddressId = originAddress.Id; - - _settingService.SaveSetting(taxSettings, x => x.DefaultTaxAddressId, storeScope, false); - } - else if (storeScope > 0) - _settingService.DeleteSetting(taxSettings, x => x.DefaultTaxAddressId, storeScope); - - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingIsTaxable, model.ShippingIsTaxable_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingPriceIncludesTax, model.ShippingPriceIncludesTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingTaxClassId, model.ShippingTaxClassId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeIsTaxable, model.PaymentMethodAdditionalFeeIsTaxable_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeIncludesTax, model.PaymentMethodAdditionalFeeIncludesTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeTaxClassId, model.PaymentMethodAdditionalFeeTaxClassId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatEnabled, model.EuVatEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatShopCountryId, model.EuVatShopCountryId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatAllowVatExemption, model.EuVatAllowVatExemption_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatUseWebService, model.EuVatUseWebService_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatAssumeValid, model.EuVatAssumeValid_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatEmailAdminWhenNewVatSubmitted, model.EuVatEmailAdminWhenNewVatSubmitted_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Tax"); - } - - - - - public virtual ActionResult Catalog() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var catalogSettings = _settingService.LoadSetting(storeScope); - var model = catalogSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.AllowViewUnpublishedProductPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowViewUnpublishedProductPage, storeScope); - model.DisplayDiscontinuedMessageForUnpublishedProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayDiscontinuedMessageForUnpublishedProducts, storeScope); - model.ShowSkuOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowSkuOnProductDetailsPage, storeScope); - model.ShowSkuOnCatalogPages_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowSkuOnCatalogPages, storeScope); - model.ShowManufacturerPartNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowManufacturerPartNumber, storeScope); - model.ShowGtin_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowGtin, storeScope); - model.ShowFreeShippingNotification_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowFreeShippingNotification, storeScope); - model.AllowProductSorting_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowProductSorting, storeScope); - model.AllowProductViewModeChanging_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowProductViewModeChanging, storeScope); - model.ShowProductsFromSubcategories_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductsFromSubcategories, storeScope); - model.ShowCategoryProductNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowCategoryProductNumber, storeScope); - model.ShowCategoryProductNumberIncludingSubcategories_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowCategoryProductNumberIncludingSubcategories, storeScope); - model.CategoryBreadcrumbEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.CategoryBreadcrumbEnabled, storeScope); - model.ShowShareButton_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowShareButton, storeScope); - model.PageShareCode_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.PageShareCode, storeScope); - model.ProductReviewsMustBeApproved_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductReviewsMustBeApproved, storeScope); - model.AllowAnonymousUsersToReviewProduct_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowAnonymousUsersToReviewProduct, storeScope); - model.ProductReviewPossibleOnlyAfterPurchasing_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductReviewPossibleOnlyAfterPurchasing, storeScope); - model.NotifyStoreOwnerAboutNewProductReviews_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NotifyStoreOwnerAboutNewProductReviews, storeScope); - model.EmailAFriendEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.EmailAFriendEnabled, storeScope); - model.AllowAnonymousUsersToEmailAFriend_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowAnonymousUsersToEmailAFriend, storeScope); - model.RecentlyViewedProductsNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.RecentlyViewedProductsNumber, storeScope); - model.RecentlyViewedProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.RecentlyViewedProductsEnabled, storeScope); - model.NewProductsNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NewProductsNumber, storeScope); - model.NewProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NewProductsEnabled, storeScope); - model.CompareProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.CompareProductsEnabled, storeScope); - model.ShowBestsellersOnHomepage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowBestsellersOnHomepage, storeScope); - model.NumberOfBestsellersOnHomepage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NumberOfBestsellersOnHomepage, storeScope); - model.SearchPageProductsPerPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPageProductsPerPage, storeScope); - model.SearchPageAllowCustomersToSelectPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPageAllowCustomersToSelectPageSize, storeScope); - model.SearchPagePageSizeOptions_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPagePageSizeOptions, storeScope); - model.ProductSearchAutoCompleteEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchAutoCompleteEnabled, storeScope); - model.ProductSearchAutoCompleteNumberOfProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchAutoCompleteNumberOfProducts, storeScope); - model.ShowProductImagesInSearchAutoComplete_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductImagesInSearchAutoComplete, storeScope); - model.ProductSearchTermMinimumLength_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchTermMinimumLength, storeScope); - model.ProductsAlsoPurchasedEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsAlsoPurchasedEnabled, storeScope); - model.ProductsAlsoPurchasedNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsAlsoPurchasedNumber, storeScope); - model.NumberOfProductTags_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NumberOfProductTags, storeScope); - model.ProductsByTagPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagPageSize, storeScope); - model.ProductsByTagAllowCustomersToSelectPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagAllowCustomersToSelectPageSize, storeScope); - model.ProductsByTagPageSizeOptions_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagPageSizeOptions, storeScope); - model.IncludeShortDescriptionInCompareProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.IncludeShortDescriptionInCompareProducts, storeScope); - model.IncludeFullDescriptionInCompareProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.IncludeFullDescriptionInCompareProducts, storeScope); - model.ManufacturersBlockItemsToDisplay_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ManufacturersBlockItemsToDisplay, storeScope); - model.DisplayTaxShippingInfoFooter_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoFooter, storeScope); - model.DisplayTaxShippingInfoProductDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoProductDetailsPage, storeScope); - model.DisplayTaxShippingInfoProductBoxes_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoProductBoxes, storeScope); - model.DisplayTaxShippingInfoShoppingCart_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoShoppingCart, storeScope); - model.DisplayTaxShippingInfoWishlist_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoWishlist, storeScope); - model.DisplayTaxShippingInfoOrderDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoOrderDetailsPage, storeScope); - model.ShowProductReviewsPerStore_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductReviewsPerStore, storeScope); - model.ShowProductReviewsOnAccountPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductReviewsTabOnAccountPage, storeScope); - model.ProductReviewsPageSizeOnAccountPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x=> x.ProductReviewsPageSizeOnAccountPage, storeScope); - model.ExportImportProductAttributes_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ExportImportProductAttributes, storeScope); - } - return View(model); - } - [HttpPost] - public virtual ActionResult Catalog(CatalogSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var catalogSettings = _settingService.LoadSetting(storeScope); - catalogSettings = model.ToEntity(catalogSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowViewUnpublishedProductPage, model.AllowViewUnpublishedProductPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayDiscontinuedMessageForUnpublishedProducts, model.DisplayDiscontinuedMessageForUnpublishedProducts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowSkuOnProductDetailsPage, model.ShowSkuOnProductDetailsPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowSkuOnCatalogPages, model.ShowSkuOnCatalogPages_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowManufacturerPartNumber, model.ShowManufacturerPartNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowGtin, model.ShowGtin_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowFreeShippingNotification, model.ShowFreeShippingNotification_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowProductSorting, model.AllowProductSorting_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowProductViewModeChanging, model.AllowProductViewModeChanging_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductsFromSubcategories, model.ShowProductsFromSubcategories_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowCategoryProductNumber, model.ShowCategoryProductNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowCategoryProductNumberIncludingSubcategories, model.ShowCategoryProductNumberIncludingSubcategories_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.CategoryBreadcrumbEnabled, model.CategoryBreadcrumbEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowShareButton, model.ShowShareButton_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.PageShareCode, model.PageShareCode_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewsMustBeApproved, model.ProductReviewsMustBeApproved_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowAnonymousUsersToReviewProduct, model.AllowAnonymousUsersToReviewProduct_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewPossibleOnlyAfterPurchasing, model.ProductReviewPossibleOnlyAfterPurchasing_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NotifyStoreOwnerAboutNewProductReviews, model.NotifyStoreOwnerAboutNewProductReviews_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.EmailAFriendEnabled, model.EmailAFriendEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowAnonymousUsersToEmailAFriend, model.AllowAnonymousUsersToEmailAFriend_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.RecentlyViewedProductsNumber, model.RecentlyViewedProductsNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.RecentlyViewedProductsEnabled, model.RecentlyViewedProductsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NewProductsNumber, model.NewProductsNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NewProductsEnabled, model.NewProductsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.CompareProductsEnabled, model.CompareProductsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowBestsellersOnHomepage, model.ShowBestsellersOnHomepage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NumberOfBestsellersOnHomepage, model.NumberOfBestsellersOnHomepage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPageProductsPerPage, model.SearchPageProductsPerPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPageAllowCustomersToSelectPageSize, model.SearchPageAllowCustomersToSelectPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPagePageSizeOptions, model.SearchPagePageSizeOptions_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchAutoCompleteEnabled, model.ProductSearchAutoCompleteEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchAutoCompleteNumberOfProducts, model.ProductSearchAutoCompleteNumberOfProducts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductImagesInSearchAutoComplete, model.ShowProductImagesInSearchAutoComplete_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchTermMinimumLength, model.ProductSearchTermMinimumLength_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsAlsoPurchasedEnabled, model.ProductsAlsoPurchasedEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsAlsoPurchasedNumber, model.ProductsAlsoPurchasedNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NumberOfProductTags, model.NumberOfProductTags_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagPageSize, model.ProductsByTagPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagAllowCustomersToSelectPageSize, model.ProductsByTagAllowCustomersToSelectPageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagPageSizeOptions, model.ProductsByTagPageSizeOptions_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.IncludeShortDescriptionInCompareProducts, model.IncludeShortDescriptionInCompareProducts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.IncludeFullDescriptionInCompareProducts, model.IncludeFullDescriptionInCompareProducts_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ManufacturersBlockItemsToDisplay, model.ManufacturersBlockItemsToDisplay_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoFooter, model.DisplayTaxShippingInfoFooter_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoProductDetailsPage, model.DisplayTaxShippingInfoProductDetailsPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoProductBoxes, model.DisplayTaxShippingInfoProductBoxes_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoShoppingCart, model.DisplayTaxShippingInfoShoppingCart_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoWishlist, model.DisplayTaxShippingInfoWishlist_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoOrderDetailsPage, model.DisplayTaxShippingInfoOrderDetailsPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductReviewsPerStore, model.ShowProductReviewsPerStore_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductReviewsTabOnAccountPage, model.ShowProductReviewsOnAccountPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewsPageSizeOnAccountPage, model.ProductReviewsPageSizeOnAccountPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ExportImportProductAttributes, model.ExportImportProductAttributes_OverrideForStore, storeScope, false); - - //now settings not overridable per store - _settingService.SaveSetting(catalogSettings, x => x.IgnoreDiscounts, 0, false); - _settingService.SaveSetting(catalogSettings, x => x.IgnoreFeaturedProducts, 0, false); - _settingService.SaveSetting(catalogSettings, x => x.IgnoreAcl, 0, false); - _settingService.SaveSetting(catalogSettings, x => x.IgnoreStoreLimitations, 0, false); - _settingService.SaveSetting(catalogSettings, x => x.CacheProductPrices, 0, false); - - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - - return RedirectToAction("Catalog"); - } - - #region Sort options - - [HttpPost] - public virtual ActionResult SortOptionsList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedKendoGridJson(); - - var catalogSettings = _settingService.LoadSetting(); - var model = new List(); - foreach (int option in Enum.GetValues(typeof(ProductSortingEnum))) - { - int value; - model.Add(new SortOptionModel() - { - Id = option, - Name = ((ProductSortingEnum)option).GetLocalizedEnum(_localizationService, _workContext), - IsActive = !catalogSettings.ProductSortingEnumDisabled.Contains(option), - DisplayOrder = catalogSettings.ProductSortingEnumDisplayOrder.TryGetValue(option, out value) ? value : option - }); - } - var gridModel = new DataSourceResult - { - Data = model.OrderBy(option => option.DisplayOrder), - Total = model.Count - }; - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult SortOptionUpdate(SortOptionModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var catalogSettings = _settingService.LoadSetting(storeScope); - - catalogSettings.ProductSortingEnumDisplayOrder[model.Id] = model.DisplayOrder; - if (model.IsActive && catalogSettings.ProductSortingEnumDisabled.Contains(model.Id)) - catalogSettings.ProductSortingEnumDisabled.Remove(model.Id); - if (!model.IsActive && !catalogSettings.ProductSortingEnumDisabled.Contains(model.Id)) - catalogSettings.ProductSortingEnumDisabled.Add(model.Id); - - - _settingService.SaveSetting(catalogSettings); - - return new NullJsonResult(); - } - - #endregion - - public virtual ActionResult RewardPoints() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var rewardPointsSettings = _settingService.LoadSetting(storeScope); - var model = rewardPointsSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.Enabled_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.Enabled, storeScope); - model.ExchangeRate_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.ExchangeRate, storeScope); - model.MinimumRewardPointsToUse_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.MinimumRewardPointsToUse, storeScope); - model.PointsForRegistration_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForRegistration, storeScope); - model.PointsForPurchases_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForPurchases_Amount, storeScope) || - _settingService.SettingExists(rewardPointsSettings, x => x.PointsForPurchases_Points, storeScope); - model.ActivationDelay_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.ActivationDelay, storeScope); - model.DisplayHowMuchWillBeEarned_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.DisplayHowMuchWillBeEarned, storeScope); - model.PointsForRegistration_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForRegistration, storeScope); - model.PageSize_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PageSize, storeScope); - } - var currencySettings = _settingService.LoadSetting(storeScope); - model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(currencySettings.PrimaryStoreCurrencyId).CurrencyCode; - - model.ActivatePointsImmediately = model.ActivationDelay <= 0; - - return View(model); - } - [HttpPost] - public virtual ActionResult RewardPoints(RewardPointsSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var rewardPointsSettings = _settingService.LoadSetting(storeScope); - rewardPointsSettings = model.ToEntity(rewardPointsSettings); - - if (model.ActivatePointsImmediately) - rewardPointsSettings.ActivationDelay = 0; - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ExchangeRate, model.ExchangeRate_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.MinimumRewardPointsToUse, model.MinimumRewardPointsToUse_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForRegistration, model.PointsForRegistration_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForPurchases_Amount, model.PointsForPurchases_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForPurchases_Points, model.PointsForPurchases_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ActivationDelay, model.ActivationDelay_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ActivationDelayPeriodId, model.ActivationDelay_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.DisplayHowMuchWillBeEarned, model.DisplayHowMuchWillBeEarned_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PageSize, model.PageSize_OverrideForStore, storeScope, false); - _settingService.SaveSetting(rewardPointsSettings, x => x.PointsAccumulatedForAllStores, 0, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - } - else - { - //If we got this far, something failed, redisplay form - foreach (var modelState in ModelState.Values) - foreach (var error in modelState.Errors) - ErrorNotification(error.ErrorMessage); - } - return RedirectToAction("RewardPoints"); - } - - - - - public virtual ActionResult Order() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var orderSettings = _settingService.LoadSetting(storeScope); - var model = orderSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.IsReOrderAllowed_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.IsReOrderAllowed, storeScope); - model.MinOrderSubtotalAmount_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderSubtotalAmount, storeScope); - model.MinOrderSubtotalAmountIncludingTax_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderSubtotalAmountIncludingTax, storeScope); - model.MinOrderTotalAmount_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderTotalAmount, storeScope); - model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AutoUpdateOrderTotalsOnEditingOrder, storeScope); - model.AnonymousCheckoutAllowed_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AnonymousCheckoutAllowed, storeScope); - model.TermsOfServiceOnShoppingCartPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.TermsOfServiceOnShoppingCartPage, storeScope); - model.TermsOfServiceOnOrderConfirmPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.TermsOfServiceOnOrderConfirmPage, storeScope); - model.OnePageCheckoutEnabled_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.OnePageCheckoutEnabled, storeScope); - model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, storeScope); - model.DisableBillingAddressCheckoutStep_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.DisableBillingAddressCheckoutStep, storeScope); - model.DisableOrderCompletedPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.DisableOrderCompletedPage, storeScope); - model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderPlacedEmail, storeScope); - model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderPaidEmail, storeScope); - model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderCompletedEmail, storeScope); - model.ReturnRequestsEnabled_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestsEnabled, storeScope); - model.ReturnRequestsAllowFiles_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestsAllowFiles, storeScope); - model.ReturnRequestNumberMask_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestNumberMask, storeScope); - model.NumberOfDaysReturnRequestAvailable_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.NumberOfDaysReturnRequestAvailable, storeScope); - model.CustomOrderNumberMask_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.CustomOrderNumberMask, storeScope); - model.ExportWithProducts_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ExportWithProducts, storeScope); - } - - var currencySettings = _settingService.LoadSetting(storeScope); - model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(currencySettings.PrimaryStoreCurrencyId).CurrencyCode; - - //order ident - model.OrderIdent = _maintenanceService.GetTableIdent(); - - return View(model); - } - [HttpPost] - public virtual ActionResult Order(OrderSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var orderSettings = _settingService.LoadSetting(storeScope); - orderSettings = model.ToEntity(orderSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.IsReOrderAllowed, model.IsReOrderAllowed_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderSubtotalAmount, model.MinOrderSubtotalAmount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderSubtotalAmountIncludingTax, model.MinOrderSubtotalAmountIncludingTax_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderTotalAmount, model.MinOrderTotalAmount_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AutoUpdateOrderTotalsOnEditingOrder, model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AnonymousCheckoutAllowed, model.AnonymousCheckoutAllowed_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.TermsOfServiceOnShoppingCartPage, model.TermsOfServiceOnShoppingCartPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.TermsOfServiceOnOrderConfirmPage, model.TermsOfServiceOnOrderConfirmPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.OnePageCheckoutEnabled, model.OnePageCheckoutEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.DisableBillingAddressCheckoutStep, model.DisableBillingAddressCheckoutStep_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.DisableOrderCompletedPage, model.DisableOrderCompletedPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderPlacedEmail, model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderPaidEmail, model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderCompletedEmail, model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestsEnabled, model.ReturnRequestsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestsAllowFiles, model.ReturnRequestsAllowFiles_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestNumberMask, model.ReturnRequestNumberMask_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.NumberOfDaysReturnRequestAvailable, model.NumberOfDaysReturnRequestAvailable_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.CustomOrderNumberMask, model.CustomOrderNumberMask_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ExportWithProducts, model.ExportWithProducts_OverrideForStore, storeScope, false); - _settingService.SaveSetting(orderSettings, x => x.ActivateGiftCardsAfterCompletingOrder, 0, false); - _settingService.SaveSetting(orderSettings, x => x.DeactivateGiftCardsAfterCancellingOrder, 0, false); - _settingService.SaveSetting(orderSettings, x => x.DeactivateGiftCardsAfterDeletingOrder, 0, false); - _settingService.SaveSetting(orderSettings, x => x.CompleteOrderWhenDelivered, 0, false); - - //now clear settings cache - _settingService.ClearCache(); - - //order ident - if (model.OrderIdent.HasValue) - { - try - { - _maintenanceService.SetTableIdent(model.OrderIdent.Value); - } - catch (Exception exc) - { - ErrorNotification(exc.Message); - } - } - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - } - else - { - //If we got this far, something failed, redisplay form - foreach (var modelState in ModelState.Values) - foreach (var error in modelState.Errors) - ErrorNotification(error.ErrorMessage); - } - - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("Order"); - } - - #region Return request reasons - - public virtual ActionResult ReturnRequestReasonList() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //we just redirect a user to the order settings page - - //select "return request" tab - SaveSelectedTabName("tab-returnrequest"); - return RedirectToAction("Order", "Setting"); - } - [HttpPost] - public virtual ActionResult ReturnRequestReasonList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedKendoGridJson(); - - var reasons = _returnRequestService.GetAllReturnRequestReasons(); - var gridModel = new DataSourceResult - { - Data = reasons.Select(x => x.ToModel()), - Total = reasons.Count - }; - return Json(gridModel); - } - //create - public virtual ActionResult ReturnRequestReasonCreate() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var model = new ReturnRequestReasonModel(); - //locales - AddLocales(_languageService, model.Locales); - return View(model); - } - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult ReturnRequestReasonCreate(ReturnRequestReasonModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var rrr = model.ToEntity(); - _returnRequestService.InsertReturnRequestReason(rrr); - //locales - UpdateLocales(rrr, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Added")); - return continueEditing ? RedirectToAction("ReturnRequestReasonEdit", new { id = rrr.Id }) : RedirectToAction("ReturnRequestReasonList"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - //edit - public virtual ActionResult ReturnRequestReasonEdit(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rrr = _returnRequestService.GetReturnRequestReasonById(id); - if (rrr == null) - //No reason found with the specified id - return RedirectToAction("ReturnRequestReasonList"); - - var model = rrr.ToModel(); - //locales - AddLocales(_languageService, model.Locales, (locale, languageId) => - { - locale.Name = rrr.GetLocalized(x => x.Name, languageId, false, false); - }); - return View(model); - } - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult ReturnRequestReasonEdit(ReturnRequestReasonModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rrr = _returnRequestService.GetReturnRequestReasonById(model.Id); - if (rrr == null) - //No reason found with the specified id - return RedirectToAction("ReturnRequestReasonList"); - - if (ModelState.IsValid) - { - rrr = model.ToEntity(rrr); - _returnRequestService.UpdateReturnRequestReason(rrr); - //locales - UpdateLocales(rrr, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Updated")); - if (continueEditing) - { - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("ReturnRequestReasonEdit", new { id = rrr.Id }); - } - return RedirectToAction("ReturnRequestReasonList"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - //delete - [HttpPost] - public virtual ActionResult ReturnRequestReasonDelete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rrr = _returnRequestService.GetReturnRequestReasonById(id); - _returnRequestService.DeleteReturnRequestReason(rrr); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Deleted")); - return RedirectToAction("ReturnRequestReasonList"); - } - - #endregion - - #region Return request actions - - public virtual ActionResult ReturnRequestActionList() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //we just redirect a user to the order settings page - - //select "return request" tab - SaveSelectedTabName("tab-returnrequest"); - return RedirectToAction("Order", "Setting"); - } - [HttpPost] - public virtual ActionResult ReturnRequestActionList(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedKendoGridJson(); - - var actions = _returnRequestService.GetAllReturnRequestActions(); - var gridModel = new DataSourceResult - { - Data = actions.Select(x => x.ToModel()), - Total = actions.Count - }; - return Json(gridModel); - } - //create - public virtual ActionResult ReturnRequestActionCreate() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var model = new ReturnRequestActionModel(); - //locales - AddLocales(_languageService, model.Locales); - return View(model); - } - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult ReturnRequestActionCreate(ReturnRequestActionModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var rra = model.ToEntity(); - _returnRequestService.InsertReturnRequestAction(rra); - //locales - UpdateLocales(rra, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Added")); - return continueEditing ? RedirectToAction("ReturnRequestActionEdit", new { id = rra.Id }) : RedirectToAction("ReturnRequestActionList"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - //edit - public virtual ActionResult ReturnRequestActionEdit(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rra = _returnRequestService.GetReturnRequestActionById(id); - if (rra == null) - //No action found with the specified id - return RedirectToAction("ReturnRequestActionList"); - - var model = rra.ToModel(); - //locales - AddLocales(_languageService, model.Locales, (locale, languageId) => - { - locale.Name = rra.GetLocalized(x => x.Name, languageId, false, false); - }); - return View(model); - } - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult ReturnRequestActionEdit(ReturnRequestActionModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rra = _returnRequestService.GetReturnRequestActionById(model.Id); - if (rra == null) - //No action found with the specified id - return RedirectToAction("ReturnRequestActionList"); - - if (ModelState.IsValid) - { - rra = model.ToEntity(rra); - _returnRequestService.UpdateReturnRequestAction(rra); - //locales - UpdateLocales(rra, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Updated")); - if (continueEditing) - { - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("ReturnRequestActionEdit", new { id = rra.Id }); - } - return RedirectToAction("ReturnRequestActionList"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - //delete - [HttpPost] - public virtual ActionResult ReturnRequestActionDelete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var rra = _returnRequestService.GetReturnRequestActionById(id); - _returnRequestService.DeleteReturnRequestAction(rra); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Deleted")); - return RedirectToAction("ReturnRequestActionList"); - } - - #endregion - - - - - - public virtual ActionResult ShoppingCart() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var shoppingCartSettings = _settingService.LoadSetting(storeScope); - var model = shoppingCartSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.DisplayCartAfterAddingProduct_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.DisplayCartAfterAddingProduct, storeScope); - model.DisplayWishlistAfterAddingProduct_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.DisplayWishlistAfterAddingProduct, storeScope); - model.MaximumShoppingCartItems_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MaximumShoppingCartItems, storeScope); - model.MaximumWishlistItems_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MaximumWishlistItems, storeScope); - model.AllowOutOfStockItemsToBeAddedToWishlist_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowOutOfStockItemsToBeAddedToWishlist, storeScope); - model.MoveItemsFromWishlistToCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MoveItemsFromWishlistToCart, storeScope); - model.CartsSharedBetweenStores_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.CartsSharedBetweenStores, storeScope); - model.ShowProductImagesOnShoppingCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesOnShoppingCart, storeScope); - model.ShowProductImagesOnWishList_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesOnWishList, storeScope); - model.ShowDiscountBox_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowDiscountBox, storeScope); - model.ShowGiftCardBox_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowGiftCardBox, storeScope); - model.CrossSellsNumber_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.CrossSellsNumber, storeScope); - model.EmailWishlistEnabled_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.EmailWishlistEnabled, storeScope); - model.AllowAnonymousUsersToEmailWishlist_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowAnonymousUsersToEmailWishlist, storeScope); - model.MiniShoppingCartEnabled_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MiniShoppingCartEnabled, storeScope); - model.ShowProductImagesInMiniShoppingCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesInMiniShoppingCart, storeScope); - model.MiniShoppingCartProductNumber_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MiniShoppingCartProductNumber, storeScope); - model.AllowCartItemEditing_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowCartItemEditing, storeScope); - } - return View(model); - } - [HttpPost] - public virtual ActionResult ShoppingCart(ShoppingCartSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var shoppingCartSettings = _settingService.LoadSetting(storeScope); - shoppingCartSettings = model.ToEntity(shoppingCartSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.DisplayCartAfterAddingProduct, model.DisplayCartAfterAddingProduct_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.DisplayWishlistAfterAddingProduct, model.DisplayWishlistAfterAddingProduct_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MaximumShoppingCartItems, model.MaximumShoppingCartItems_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MaximumWishlistItems, model.MaximumWishlistItems_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowOutOfStockItemsToBeAddedToWishlist, model.AllowOutOfStockItemsToBeAddedToWishlist_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MoveItemsFromWishlistToCart, model.MoveItemsFromWishlistToCart_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.CartsSharedBetweenStores, model.CartsSharedBetweenStores_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesOnShoppingCart, model.ShowProductImagesOnShoppingCart_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesOnWishList, model.ShowProductImagesOnWishList_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowDiscountBox, model.ShowDiscountBox_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowGiftCardBox, model.ShowGiftCardBox_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.CrossSellsNumber, model.CrossSellsNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.EmailWishlistEnabled, model.EmailWishlistEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowAnonymousUsersToEmailWishlist, model.AllowAnonymousUsersToEmailWishlist_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MiniShoppingCartEnabled, model.MiniShoppingCartEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesInMiniShoppingCart, model.ShowProductImagesInMiniShoppingCart_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MiniShoppingCartProductNumber, model.MiniShoppingCartProductNumber_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowCartItemEditing, model.AllowCartItemEditing_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("ShoppingCart"); - } - - - - - public virtual ActionResult Media() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var mediaSettings = _settingService.LoadSetting(storeScope); - var model = mediaSettings.ToModel(); - model.ActiveStoreScopeConfiguration = storeScope; - if (storeScope > 0) - { - model.AvatarPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.AvatarPictureSize, storeScope); - model.ProductThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductThumbPictureSize, storeScope); - model.ProductDetailsPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductDetailsPictureSize, storeScope); - model.ProductThumbPictureSizeOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductThumbPictureSizeOnProductDetailsPage, storeScope); - model.AssociatedProductPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.AssociatedProductPictureSize, storeScope); - model.CategoryThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.CategoryThumbPictureSize, storeScope); - model.ManufacturerThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ManufacturerThumbPictureSize, storeScope); - model.VendorThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.VendorThumbPictureSize, storeScope); - model.CartThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.CartThumbPictureSize, storeScope); - model.MiniCartThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MiniCartThumbPictureSize, storeScope); - model.MaximumImageSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MaximumImageSize, storeScope); - model.MultipleThumbDirectories_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MultipleThumbDirectories, storeScope); - model.DefaultImageQuality_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.DefaultImageQuality, storeScope); - model.ImportProductImagesUsingHash_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ImportProductImagesUsingHash, storeScope); - model.DefaultPictureZoomEnabled_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.DefaultPictureZoomEnabled, storeScope); - } - model.PicturesStoredIntoDatabase = _pictureService.StoreInDb; - return View(model); - } - [HttpPost] - [FormValueRequired("save")] - public virtual ActionResult Media(MediaSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var mediaSettings = _settingService.LoadSetting(storeScope); - mediaSettings = model.ToEntity(mediaSettings); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.AvatarPictureSize, model.AvatarPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductThumbPictureSize, model.ProductThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductDetailsPictureSize, model.ProductDetailsPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductThumbPictureSizeOnProductDetailsPage, model.ProductThumbPictureSizeOnProductDetailsPage_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.AssociatedProductPictureSize, model.AssociatedProductPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.CategoryThumbPictureSize, model.CategoryThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ManufacturerThumbPictureSize, model.ManufacturerThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.VendorThumbPictureSize, model.VendorThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.CartThumbPictureSize, model.CartThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MiniCartThumbPictureSize, model.MiniCartThumbPictureSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MaximumImageSize, model.MaximumImageSize_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MultipleThumbDirectories, model.MultipleThumbDirectories_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.DefaultImageQuality, model.DefaultImageQuality_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ImportProductImagesUsingHash, model.ImportProductImagesUsingHash_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.DefaultPictureZoomEnabled, model.DefaultPictureZoomEnabled_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Media"); - } - [HttpPost, ActionName("Media")] - [FormValueRequired("change-picture-storage")] - public virtual ActionResult ChangePictureStorage() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - _pictureService.StoreInDb = !_pictureService.StoreInDb; - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - return RedirectToAction("Media"); - } - - - - public virtual ActionResult CustomerUser() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var customerSettings = _settingService.LoadSetting(storeScope); - var addressSettings = _settingService.LoadSetting(storeScope); - var dateTimeSettings = _settingService.LoadSetting(storeScope); - var externalAuthenticationSettings = _settingService.LoadSetting(storeScope); - - //merge settings - var model = new CustomerUserSettingsModel(); - model.CustomerSettings = customerSettings.ToModel(); - model.AddressSettings = addressSettings.ToModel(); - - model.DateTimeSettings.AllowCustomersToSetTimeZone = dateTimeSettings.AllowCustomersToSetTimeZone; - model.DateTimeSettings.DefaultStoreTimeZoneId = _dateTimeHelper.DefaultStoreTimeZone.Id; - foreach (TimeZoneInfo timeZone in _dateTimeHelper.GetSystemTimeZones()) - { - model.DateTimeSettings.AvailableTimeZones.Add(new SelectListItem - { - Text = timeZone.DisplayName, - Value = timeZone.Id, - Selected = timeZone.Id.Equals(_dateTimeHelper.DefaultStoreTimeZone.Id, StringComparison.InvariantCultureIgnoreCase) - }); - } - - model.ExternalAuthenticationSettings.AutoRegisterEnabled = externalAuthenticationSettings.AutoRegisterEnabled; - - return View(model); - } - [HttpPost] - public virtual ActionResult CustomerUser(CustomerUserSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var customerSettings = _settingService.LoadSetting(storeScope); - var addressSettings = _settingService.LoadSetting(storeScope); - var dateTimeSettings = _settingService.LoadSetting(storeScope); - var externalAuthenticationSettings = _settingService.LoadSetting(storeScope); - - customerSettings = model.CustomerSettings.ToEntity(customerSettings); - _settingService.SaveSetting(customerSettings); - - addressSettings = model.AddressSettings.ToEntity(addressSettings); - _settingService.SaveSetting(addressSettings); - - dateTimeSettings.DefaultStoreTimeZoneId = model.DateTimeSettings.DefaultStoreTimeZoneId; - dateTimeSettings.AllowCustomersToSetTimeZone = model.DateTimeSettings.AllowCustomersToSetTimeZone; - _settingService.SaveSetting(dateTimeSettings); - - externalAuthenticationSettings.AutoRegisterEnabled = model.ExternalAuthenticationSettings.AutoRegisterEnabled; - _settingService.SaveSetting(externalAuthenticationSettings); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - - //selected tab - SaveSelectedTabName(); - - return RedirectToAction("CustomerUser"); - } - - - - - - - public virtual ActionResult GeneralCommon() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //set page timeout to 5 minutes - this.Server.ScriptTimeout = 300; - - var model = new GeneralCommonSettingsModel(); - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - model.ActiveStoreScopeConfiguration = storeScope; - //store information - var storeInformationSettings = _settingService.LoadSetting(storeScope); - var commonSettings = _settingService.LoadSetting(storeScope); - model.StoreInformationSettings.StoreClosed = storeInformationSettings.StoreClosed; - //themes - model.StoreInformationSettings.DefaultStoreTheme = storeInformationSettings.DefaultStoreTheme; - model.StoreInformationSettings.AvailableStoreThemes = _themeProvider - .GetThemeConfigurations() - .Select(x => new GeneralCommonSettingsModel.StoreInformationSettingsModel.ThemeConfigurationModel - { - ThemeTitle = x.ThemeTitle, - ThemeName = x.ThemeName, - PreviewImageUrl = x.PreviewImageUrl, - PreviewText = x.PreviewText, - SupportRtl = x.SupportRtl, - Selected = x.ThemeName.Equals(storeInformationSettings.DefaultStoreTheme, StringComparison.InvariantCultureIgnoreCase) - }) - .ToList(); - model.StoreInformationSettings.AllowCustomerToSelectTheme = storeInformationSettings.AllowCustomerToSelectTheme; - model.StoreInformationSettings.LogoPictureId = storeInformationSettings.LogoPictureId; - //EU Cookie law - model.StoreInformationSettings.DisplayEuCookieLawWarning = storeInformationSettings.DisplayEuCookieLawWarning; - //social pages - model.StoreInformationSettings.FacebookLink = storeInformationSettings.FacebookLink; - model.StoreInformationSettings.TwitterLink = storeInformationSettings.TwitterLink; - model.StoreInformationSettings.YoutubeLink = storeInformationSettings.YoutubeLink; - model.StoreInformationSettings.GooglePlusLink = storeInformationSettings.GooglePlusLink; - //contact us - model.StoreInformationSettings.SubjectFieldOnContactUsForm = commonSettings.SubjectFieldOnContactUsForm; - model.StoreInformationSettings.UseSystemEmailForContactUsForm = commonSettings.UseSystemEmailForContactUsForm; - //sitemap - model.StoreInformationSettings.SitemapEnabled = commonSettings.SitemapEnabled; - model.StoreInformationSettings.SitemapIncludeCategories = commonSettings.SitemapIncludeCategories; - model.StoreInformationSettings.SitemapIncludeManufacturers = commonSettings.SitemapIncludeManufacturers; - model.StoreInformationSettings.SitemapIncludeProducts = commonSettings.SitemapIncludeProducts; - - //override settings - if (storeScope > 0) - { - model.StoreInformationSettings.StoreClosed_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.StoreClosed, storeScope); - model.StoreInformationSettings.DefaultStoreTheme_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.DefaultStoreTheme, storeScope); - model.StoreInformationSettings.AllowCustomerToSelectTheme_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.AllowCustomerToSelectTheme, storeScope); - model.StoreInformationSettings.LogoPictureId_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.LogoPictureId, storeScope); - model.StoreInformationSettings.DisplayEuCookieLawWarning_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.DisplayEuCookieLawWarning, storeScope); - model.StoreInformationSettings.FacebookLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.FacebookLink, storeScope); - model.StoreInformationSettings.TwitterLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.TwitterLink, storeScope); - model.StoreInformationSettings.YoutubeLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.YoutubeLink, storeScope); - model.StoreInformationSettings.GooglePlusLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.GooglePlusLink, storeScope); - model.StoreInformationSettings.SubjectFieldOnContactUsForm_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SubjectFieldOnContactUsForm, storeScope); - model.StoreInformationSettings.UseSystemEmailForContactUsForm_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.UseSystemEmailForContactUsForm, storeScope); - model.StoreInformationSettings.SitemapEnabled_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapEnabled, storeScope); - model.StoreInformationSettings.SitemapIncludeCategories_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeCategories, storeScope); - model.StoreInformationSettings.SitemapIncludeManufacturers_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeManufacturers, storeScope); - model.StoreInformationSettings.SitemapIncludeProducts_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeProducts, storeScope); - } - - //seo settings - var seoSettings = _settingService.LoadSetting(storeScope); - model.SeoSettings.PageTitleSeparator = seoSettings.PageTitleSeparator; - model.SeoSettings.PageTitleSeoAdjustment = (int)seoSettings.PageTitleSeoAdjustment; - model.SeoSettings.PageTitleSeoAdjustmentValues = seoSettings.PageTitleSeoAdjustment.ToSelectList(); - model.SeoSettings.DefaultTitle = seoSettings.DefaultTitle; - model.SeoSettings.DefaultMetaKeywords = seoSettings.DefaultMetaKeywords; - model.SeoSettings.DefaultMetaDescription = seoSettings.DefaultMetaDescription; - model.SeoSettings.GenerateProductMetaDescription = seoSettings.GenerateProductMetaDescription; - model.SeoSettings.ConvertNonWesternChars = seoSettings.ConvertNonWesternChars; - model.SeoSettings.CanonicalUrlsEnabled = seoSettings.CanonicalUrlsEnabled; - model.SeoSettings.WwwRequirement = (int)seoSettings.WwwRequirement; - model.SeoSettings.WwwRequirementValues = seoSettings.WwwRequirement.ToSelectList(); - model.SeoSettings.EnableJsBundling = seoSettings.EnableJsBundling; - model.SeoSettings.EnableCssBundling = seoSettings.EnableCssBundling; - model.SeoSettings.TwitterMetaTags = seoSettings.TwitterMetaTags; - model.SeoSettings.OpenGraphMetaTags = seoSettings.OpenGraphMetaTags; - model.SeoSettings.CustomHeadTags = seoSettings.CustomHeadTags; - //override settings - if (storeScope > 0) - { - model.SeoSettings.PageTitleSeparator_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.PageTitleSeparator, storeScope); - model.SeoSettings.PageTitleSeoAdjustment_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.PageTitleSeoAdjustment, storeScope); - model.SeoSettings.DefaultTitle_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultTitle, storeScope); - model.SeoSettings.DefaultMetaKeywords_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultMetaKeywords, storeScope); - model.SeoSettings.DefaultMetaDescription_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultMetaDescription, storeScope); - model.SeoSettings.GenerateProductMetaDescription_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.GenerateProductMetaDescription, storeScope); - model.SeoSettings.ConvertNonWesternChars_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.ConvertNonWesternChars, storeScope); - model.SeoSettings.CanonicalUrlsEnabled_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.CanonicalUrlsEnabled, storeScope); - model.SeoSettings.WwwRequirement_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.WwwRequirement, storeScope); - model.SeoSettings.EnableJsBundling_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.EnableJsBundling, storeScope); - model.SeoSettings.EnableCssBundling_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.EnableCssBundling, storeScope); - model.SeoSettings.TwitterMetaTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.TwitterMetaTags, storeScope); - model.SeoSettings.OpenGraphMetaTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.OpenGraphMetaTags, storeScope); - model.SeoSettings.CustomHeadTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.CustomHeadTags, storeScope); - } - - //security settings - var securitySettings = _settingService.LoadSetting(storeScope); - model.SecuritySettings.EncryptionKey = securitySettings.EncryptionKey; - if (securitySettings.AdminAreaAllowedIpAddresses != null) - for (int i = 0; i < securitySettings.AdminAreaAllowedIpAddresses.Count; i++) - { - model.SecuritySettings.AdminAreaAllowedIpAddresses += securitySettings.AdminAreaAllowedIpAddresses[i]; - if (i != securitySettings.AdminAreaAllowedIpAddresses.Count - 1) - model.SecuritySettings.AdminAreaAllowedIpAddresses += ","; - } - model.SecuritySettings.ForceSslForAllPages = securitySettings.ForceSslForAllPages; - model.SecuritySettings.EnableXsrfProtectionForAdminArea = securitySettings.EnableXsrfProtectionForAdminArea; - model.SecuritySettings.EnableXsrfProtectionForPublicStore = securitySettings.EnableXsrfProtectionForPublicStore; - model.SecuritySettings.HoneypotEnabled = securitySettings.HoneypotEnabled; - - var captchaSettings = _settingService.LoadSetting(storeScope); - model.CaptchaSettings = captchaSettings.ToModel(); - model.CaptchaSettings.AvailableReCaptchaVersions = ReCaptchaVersion.Version1.ToSelectList(false).ToList(); - - //PDF settings - var pdfSettings = _settingService.LoadSetting(storeScope); - model.PdfSettings.LetterPageSizeEnabled = pdfSettings.LetterPageSizeEnabled; - model.PdfSettings.LogoPictureId = pdfSettings.LogoPictureId; - model.PdfSettings.DisablePdfInvoicesForPendingOrders = pdfSettings.DisablePdfInvoicesForPendingOrders; - model.PdfSettings.InvoiceFooterTextColumn1 = pdfSettings.InvoiceFooterTextColumn1; - model.PdfSettings.InvoiceFooterTextColumn2 = pdfSettings.InvoiceFooterTextColumn2; - //override settings - if (storeScope > 0) - { - model.PdfSettings.LetterPageSizeEnabled_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.LetterPageSizeEnabled, storeScope); - model.PdfSettings.LogoPictureId_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.LogoPictureId, storeScope); - model.PdfSettings.DisablePdfInvoicesForPendingOrders_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.DisablePdfInvoicesForPendingOrders, storeScope); - model.PdfSettings.InvoiceFooterTextColumn1_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.InvoiceFooterTextColumn1, storeScope); - model.PdfSettings.InvoiceFooterTextColumn2_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.InvoiceFooterTextColumn2, storeScope); - } - - //localization - var localizationSettings = _settingService.LoadSetting(storeScope); - model.LocalizationSettings.UseImagesForLanguageSelection = localizationSettings.UseImagesForLanguageSelection; - model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled = localizationSettings.SeoFriendlyUrlsForLanguagesEnabled; - model.LocalizationSettings.AutomaticallyDetectLanguage = localizationSettings.AutomaticallyDetectLanguage; - model.LocalizationSettings.LoadAllLocaleRecordsOnStartup = localizationSettings.LoadAllLocaleRecordsOnStartup; - model.LocalizationSettings.LoadAllLocalizedPropertiesOnStartup = localizationSettings.LoadAllLocalizedPropertiesOnStartup; - model.LocalizationSettings.LoadAllUrlRecordsOnStartup = localizationSettings.LoadAllUrlRecordsOnStartup; - - //full-text support - model.FullTextSettings.Supported = _fulltextService.IsFullTextSupported(); - model.FullTextSettings.Enabled = commonSettings.UseFullTextSearch; - model.FullTextSettings.SearchMode = (int)commonSettings.FullTextMode; - model.FullTextSettings.SearchModeValues = commonSettings.FullTextMode.ToSelectList(); - - //display default menu item - var displayDefaultMenuItemSettings = _settingService.LoadSetting(storeScope); - model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem = displayDefaultMenuItemSettings.DisplayHomePageMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem = displayDefaultMenuItemSettings.DisplayNewProductsMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem = displayDefaultMenuItemSettings.DisplayProductSearchMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem = displayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem = displayDefaultMenuItemSettings.DisplayBlogMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem = displayDefaultMenuItemSettings.DisplayForumsMenuItem; - model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem = displayDefaultMenuItemSettings.DisplayContactUsMenuItem; - - model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayHomePageMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayNewProductsMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayProductSearchMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayCustomerInfoMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayBlogMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayForumsMenuItem, storeScope); - model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayContactUsMenuItem, storeScope); - - - return View(model); - } - [HttpPost] - [FormValueRequired("save")] - public virtual ActionResult GeneralCommon(GeneralCommonSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - - //load settings for a chosen store scope - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - - //store information settings - var storeInformationSettings = _settingService.LoadSetting(storeScope); - var commonSettings = _settingService.LoadSetting(storeScope); - storeInformationSettings.StoreClosed = model.StoreInformationSettings.StoreClosed; - storeInformationSettings.DefaultStoreTheme = model.StoreInformationSettings.DefaultStoreTheme; - storeInformationSettings.AllowCustomerToSelectTheme = model.StoreInformationSettings.AllowCustomerToSelectTheme; - storeInformationSettings.LogoPictureId = model.StoreInformationSettings.LogoPictureId; - //EU Cookie law - storeInformationSettings.DisplayEuCookieLawWarning = model.StoreInformationSettings.DisplayEuCookieLawWarning; - //social pages - storeInformationSettings.FacebookLink = model.StoreInformationSettings.FacebookLink; - storeInformationSettings.TwitterLink = model.StoreInformationSettings.TwitterLink; - storeInformationSettings.YoutubeLink = model.StoreInformationSettings.YoutubeLink; - storeInformationSettings.GooglePlusLink = model.StoreInformationSettings.GooglePlusLink; - //contact us - commonSettings.SubjectFieldOnContactUsForm = model.StoreInformationSettings.SubjectFieldOnContactUsForm; - commonSettings.UseSystemEmailForContactUsForm = model.StoreInformationSettings.UseSystemEmailForContactUsForm; - //sitemap - commonSettings.SitemapEnabled = model.StoreInformationSettings.SitemapEnabled; - commonSettings.SitemapIncludeCategories = model.StoreInformationSettings.SitemapIncludeCategories; - commonSettings.SitemapIncludeManufacturers = model.StoreInformationSettings.SitemapIncludeManufacturers; - commonSettings.SitemapIncludeProducts = model.StoreInformationSettings.SitemapIncludeProducts; - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.StoreClosed, model.StoreInformationSettings.StoreClosed_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.DefaultStoreTheme, model.StoreInformationSettings.DefaultStoreTheme_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.AllowCustomerToSelectTheme, model.StoreInformationSettings.AllowCustomerToSelectTheme_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.LogoPictureId, model.StoreInformationSettings.LogoPictureId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.DisplayEuCookieLawWarning, model.StoreInformationSettings.DisplayEuCookieLawWarning_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.FacebookLink, model.StoreInformationSettings.FacebookLink_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.TwitterLink, model.StoreInformationSettings.TwitterLink_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.YoutubeLink, model.StoreInformationSettings.YoutubeLink_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.GooglePlusLink, model.StoreInformationSettings.GooglePlusLink_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SubjectFieldOnContactUsForm, model.StoreInformationSettings.SubjectFieldOnContactUsForm_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.UseSystemEmailForContactUsForm, model.StoreInformationSettings.UseSystemEmailForContactUsForm_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapEnabled, model.StoreInformationSettings.SitemapEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeCategories, model.StoreInformationSettings.SitemapIncludeCategories_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeManufacturers, model.StoreInformationSettings.SitemapIncludeManufacturers_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeProducts, model.StoreInformationSettings.SitemapIncludeProducts_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - - - //seo settings - var seoSettings = _settingService.LoadSetting(storeScope); - seoSettings.PageTitleSeparator = model.SeoSettings.PageTitleSeparator; - seoSettings.PageTitleSeoAdjustment = (PageTitleSeoAdjustment)model.SeoSettings.PageTitleSeoAdjustment; - seoSettings.DefaultTitle = model.SeoSettings.DefaultTitle; - seoSettings.DefaultMetaKeywords = model.SeoSettings.DefaultMetaKeywords; - seoSettings.DefaultMetaDescription = model.SeoSettings.DefaultMetaDescription; - seoSettings.GenerateProductMetaDescription = model.SeoSettings.GenerateProductMetaDescription; - seoSettings.ConvertNonWesternChars = model.SeoSettings.ConvertNonWesternChars; - seoSettings.CanonicalUrlsEnabled = model.SeoSettings.CanonicalUrlsEnabled; - seoSettings.WwwRequirement = (WwwRequirement)model.SeoSettings.WwwRequirement; - seoSettings.EnableJsBundling = model.SeoSettings.EnableJsBundling; - seoSettings.EnableCssBundling = model.SeoSettings.EnableCssBundling; - seoSettings.TwitterMetaTags = model.SeoSettings.TwitterMetaTags; - seoSettings.OpenGraphMetaTags = model.SeoSettings.OpenGraphMetaTags; - seoSettings.CustomHeadTags = model.SeoSettings.CustomHeadTags; - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.PageTitleSeparator, model.SeoSettings.PageTitleSeparator_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.PageTitleSeoAdjustment, model.SeoSettings.PageTitleSeoAdjustment_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultTitle, model.SeoSettings.DefaultTitle_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultMetaKeywords, model.SeoSettings.DefaultMetaKeywords_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultMetaDescription, model.SeoSettings.DefaultMetaDescription_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.GenerateProductMetaDescription, model.SeoSettings.GenerateProductMetaDescription_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.ConvertNonWesternChars, model.SeoSettings.ConvertNonWesternChars_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.CanonicalUrlsEnabled, model.SeoSettings.CanonicalUrlsEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.WwwRequirement, model.SeoSettings.WwwRequirement_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.EnableJsBundling, model.SeoSettings.EnableJsBundling_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.EnableCssBundling, model.SeoSettings.EnableCssBundling_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.TwitterMetaTags, model.SeoSettings.TwitterMetaTags_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.OpenGraphMetaTags, model.SeoSettings.OpenGraphMetaTags_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.CustomHeadTags, model.SeoSettings.CustomHeadTags_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - - - //security settings - var securitySettings = _settingService.LoadSetting(storeScope); - if (securitySettings.AdminAreaAllowedIpAddresses == null) - securitySettings.AdminAreaAllowedIpAddresses = new List(); - securitySettings.AdminAreaAllowedIpAddresses.Clear(); - if (!String.IsNullOrEmpty(model.SecuritySettings.AdminAreaAllowedIpAddresses)) - foreach (string s in model.SecuritySettings.AdminAreaAllowedIpAddresses.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)) - if (!String.IsNullOrWhiteSpace(s)) - securitySettings.AdminAreaAllowedIpAddresses.Add(s.Trim()); - securitySettings.ForceSslForAllPages = model.SecuritySettings.ForceSslForAllPages; - securitySettings.EnableXsrfProtectionForAdminArea = model.SecuritySettings.EnableXsrfProtectionForAdminArea; - securitySettings.EnableXsrfProtectionForPublicStore = model.SecuritySettings.EnableXsrfProtectionForPublicStore; - securitySettings.HoneypotEnabled = model.SecuritySettings.HoneypotEnabled; - _settingService.SaveSetting(securitySettings); - - //captcha settings - var captchaSettings = _settingService.LoadSetting(storeScope); - captchaSettings = model.CaptchaSettings.ToEntity(captchaSettings); - _settingService.SaveSetting(captchaSettings); - if (captchaSettings.Enabled && - (String.IsNullOrWhiteSpace(captchaSettings.ReCaptchaPublicKey) || String.IsNullOrWhiteSpace(captchaSettings.ReCaptchaPrivateKey))) - { - //captcha is enabled but the keys are not entered - ErrorNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.CaptchaAppropriateKeysNotEnteredError")); - } - - //PDF settings - var pdfSettings = _settingService.LoadSetting(storeScope); - pdfSettings.LetterPageSizeEnabled = model.PdfSettings.LetterPageSizeEnabled; - pdfSettings.LogoPictureId = model.PdfSettings.LogoPictureId; - pdfSettings.DisablePdfInvoicesForPendingOrders = model.PdfSettings.DisablePdfInvoicesForPendingOrders; - pdfSettings.InvoiceFooterTextColumn1 = model.PdfSettings.InvoiceFooterTextColumn1; - pdfSettings.InvoiceFooterTextColumn2 = model.PdfSettings.InvoiceFooterTextColumn2; - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - - _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.LetterPageSizeEnabled, model.PdfSettings.LetterPageSizeEnabled_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.LogoPictureId, model.PdfSettings.LogoPictureId_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.DisablePdfInvoicesForPendingOrders, model.PdfSettings.DisablePdfInvoicesForPendingOrders_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.InvoiceFooterTextColumn1, model.PdfSettings.InvoiceFooterTextColumn1_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.InvoiceFooterTextColumn2, model.PdfSettings.InvoiceFooterTextColumn2_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - - - - //localization settings - var localizationSettings = _settingService.LoadSetting(storeScope); - localizationSettings.UseImagesForLanguageSelection = model.LocalizationSettings.UseImagesForLanguageSelection; - if (localizationSettings.SeoFriendlyUrlsForLanguagesEnabled != model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled) - { - localizationSettings.SeoFriendlyUrlsForLanguagesEnabled = model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled; - //clear cached values of routes - System.Web.Routing.RouteTable.Routes.ClearSeoFriendlyUrlsCachedValueForRoutes(); - } - localizationSettings.AutomaticallyDetectLanguage = model.LocalizationSettings.AutomaticallyDetectLanguage; - localizationSettings.LoadAllLocaleRecordsOnStartup = model.LocalizationSettings.LoadAllLocaleRecordsOnStartup; - localizationSettings.LoadAllLocalizedPropertiesOnStartup = model.LocalizationSettings.LoadAllLocalizedPropertiesOnStartup; - localizationSettings.LoadAllUrlRecordsOnStartup = model.LocalizationSettings.LoadAllUrlRecordsOnStartup; - _settingService.SaveSetting(localizationSettings); - - //full-text - commonSettings.FullTextMode = (FulltextSearchMode)model.FullTextSettings.SearchMode; - _settingService.SaveSetting(commonSettings); - - //display default menu item - var displayDefaultMenuItemSettings = _settingService.LoadSetting(storeScope); - - /* We do not clear cache after each setting update. - * This behavior can increase performance because cached settings will not be cleared - * and loaded from database after each update */ - displayDefaultMenuItemSettings.DisplayHomePageMenuItem = model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem; - displayDefaultMenuItemSettings.DisplayNewProductsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem; - displayDefaultMenuItemSettings.DisplayProductSearchMenuItem = model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem; - displayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem = model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem; - displayDefaultMenuItemSettings.DisplayBlogMenuItem = model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem; - displayDefaultMenuItemSettings.DisplayForumsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem; - displayDefaultMenuItemSettings.DisplayContactUsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem; - - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayHomePageMenuItem, model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayNewProductsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayProductSearchMenuItem, model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayCustomerInfoMenuItem, model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayBlogMenuItem, model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayForumsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem_OverrideForStore, storeScope, false); - _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayContactUsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem_OverrideForStore, storeScope, false); - - //now clear settings cache - _settingService.ClearCache(); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); - - return RedirectToAction("GeneralCommon"); - } - [HttpPost, ActionName("GeneralCommon")] - [FormValueRequired("changeencryptionkey")] - public virtual ActionResult ChangeEncryptionKey(GeneralCommonSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - //set page timeout to 5 minutes - this.Server.ScriptTimeout = 300; - - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var securitySettings = _settingService.LoadSetting(storeScope); - - try - { - if (model.SecuritySettings.EncryptionKey == null) - model.SecuritySettings.EncryptionKey = ""; - - model.SecuritySettings.EncryptionKey = model.SecuritySettings.EncryptionKey.Trim(); - - var newEncryptionPrivateKey = model.SecuritySettings.EncryptionKey; - if (String.IsNullOrEmpty(newEncryptionPrivateKey) || newEncryptionPrivateKey.Length != 16) - throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.TooShort")); - - string oldEncryptionPrivateKey = securitySettings.EncryptionKey; - if (oldEncryptionPrivateKey == newEncryptionPrivateKey) - throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.TheSame")); - - //update encrypted order info - var orders = _orderService.SearchOrders(); - foreach (var order in orders) - { - string decryptedCardType = _encryptionService.DecryptText(order.CardType, oldEncryptionPrivateKey); - string decryptedCardName = _encryptionService.DecryptText(order.CardName, oldEncryptionPrivateKey); - string decryptedCardNumber = _encryptionService.DecryptText(order.CardNumber, oldEncryptionPrivateKey); - string decryptedMaskedCreditCardNumber = _encryptionService.DecryptText(order.MaskedCreditCardNumber, oldEncryptionPrivateKey); - string decryptedCardCvv2 = _encryptionService.DecryptText(order.CardCvv2, oldEncryptionPrivateKey); - string decryptedCardExpirationMonth = _encryptionService.DecryptText(order.CardExpirationMonth, oldEncryptionPrivateKey); - string decryptedCardExpirationYear = _encryptionService.DecryptText(order.CardExpirationYear, oldEncryptionPrivateKey); - - string encryptedCardType = _encryptionService.EncryptText(decryptedCardType, newEncryptionPrivateKey); - string encryptedCardName = _encryptionService.EncryptText(decryptedCardName, newEncryptionPrivateKey); - string encryptedCardNumber = _encryptionService.EncryptText(decryptedCardNumber, newEncryptionPrivateKey); - string encryptedMaskedCreditCardNumber = _encryptionService.EncryptText(decryptedMaskedCreditCardNumber, newEncryptionPrivateKey); - string encryptedCardCvv2 = _encryptionService.EncryptText(decryptedCardCvv2, newEncryptionPrivateKey); - string encryptedCardExpirationMonth = _encryptionService.EncryptText(decryptedCardExpirationMonth, newEncryptionPrivateKey); - string encryptedCardExpirationYear = _encryptionService.EncryptText(decryptedCardExpirationYear, newEncryptionPrivateKey); - - order.CardType = encryptedCardType; - order.CardName = encryptedCardName; - order.CardNumber = encryptedCardNumber; - order.MaskedCreditCardNumber = encryptedMaskedCreditCardNumber; - order.CardCvv2 = encryptedCardCvv2; - order.CardExpirationMonth = encryptedCardExpirationMonth; - order.CardExpirationYear = encryptedCardExpirationYear; - _orderService.UpdateOrder(order); - } - - //update password information - //optimization - load only passwords with PasswordFormat.Encrypted - var customerPasswords = _customerService.GetCustomerPasswords(passwordFormat: PasswordFormat.Encrypted); - foreach (var customerPassword in customerPasswords) - { - var decryptedPassword = _encryptionService.DecryptText(customerPassword.Password, oldEncryptionPrivateKey); - var encryptedPassword = _encryptionService.EncryptText(decryptedPassword, newEncryptionPrivateKey); - - customerPassword.Password = encryptedPassword; - _customerService.UpdateCustomerPassword(customerPassword); - } - - securitySettings.EncryptionKey = newEncryptionPrivateKey; - _settingService.SaveSetting(securitySettings); - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.Changed")); - } - catch (Exception exc) - { - ErrorNotification(exc); - } - return RedirectToAction("GeneralCommon"); - } - [HttpPost, ActionName("GeneralCommon")] - [FormValueRequired("togglefulltext")] - public virtual ActionResult ToggleFullText(GeneralCommonSettingsModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); - var commonSettings = _settingService.LoadSetting(storeScope); - try - { - if (! _fulltextService.IsFullTextSupported()) - throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.NotSupported")); - - if (commonSettings.UseFullTextSearch) - { - _fulltextService.DisableFullText(); - - commonSettings.UseFullTextSearch = false; - _settingService.SaveSetting(commonSettings); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Disabled")); - } - else - { - _fulltextService.EnableFullText(); - - commonSettings.UseFullTextSearch = true; - _settingService.SaveSetting(commonSettings); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Enabled")); - } - } - catch (Exception exc) - { - ErrorNotification(exc); - } - - return RedirectToAction("GeneralCommon"); - } - - - - - //all settings - public virtual ActionResult AllSettings() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - return View(); - } - [HttpPost] - //do not validate request token (XSRF) - //for some reasons it does not work with "filtering" support - [AdminAntiForgery(true)] - public virtual ActionResult AllSettings(DataSourceRequest command, AllSettingsListModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedKendoGridJson(); - - var query = _settingService.GetAllSettings().AsQueryable(); - - if (!string.IsNullOrEmpty(model.SearchSettingName)) - query = query.Where(s => s.Name.ToLowerInvariant().Contains(model.SearchSettingName.ToLowerInvariant())); - if (!string.IsNullOrEmpty(model.SearchSettingValue)) - query = query.Where(s => s.Value.ToLowerInvariant().Contains(model.SearchSettingValue.ToLowerInvariant())); - - var settings = query.ToList() - .Select(x => - { - string storeName; - if (x.StoreId == 0) - { - storeName = _localizationService.GetResource("Admin.Configuration.Settings.AllSettings.Fields.StoreName.AllStores"); - } - else - { - var store = _storeService.GetStoreById(x.StoreId); - storeName = store != null ? store.Name : "Unknown"; - } - var settingModel = new SettingModel - { - Id = x.Id, - Name = x.Name, - Value = x.Value, - Store = storeName, - StoreId = x.StoreId - }; - return settingModel; - }) - .AsQueryable(); - - var gridModel = new DataSourceResult - { - Data = settings.PagedForCommand(command).ToList(), - Total = settings.Count() - }; - - return Json(gridModel); - } - [HttpPost] - public virtual ActionResult SettingUpdate(SettingModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (model.Name != null) - model.Name = model.Name.Trim(); - if (model.Value != null) - model.Value = model.Value.Trim(); - - if (!ModelState.IsValid) - { - return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); - } - - var setting = _settingService.GetSettingById(model.Id); - if (setting == null) - return Content("No setting could be loaded with the specified ID"); - - var storeId = model.StoreId; - - if (!setting.Name.Equals(model.Name, StringComparison.InvariantCultureIgnoreCase) || - setting.StoreId != storeId) - { - //setting name or store has been changed - _settingService.DeleteSetting(setting); - } - - _settingService.SetSetting(model.Name, model.Value, storeId); - - //activity log - _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); - - return new NullJsonResult(); - } - [HttpPost] - public virtual ActionResult SettingAdd([Bind(Exclude = "Id")] SettingModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - if (model.Name != null) - model.Name = model.Name.Trim(); - if (model.Value != null) - model.Value = model.Value.Trim(); - - if (!ModelState.IsValid) - { - return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); - } - var storeId = model.StoreId; - _settingService.SetSetting(model.Name, model.Value, storeId); - - //activity log - _customerActivityService.InsertActivity("AddNewSetting", _localizationService.GetResource("ActivityLog.AddNewSetting"), model.Name); - - return new NullJsonResult(); - } - [HttpPost] - public virtual ActionResult SettingDelete(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) - return AccessDeniedView(); - - var setting = _settingService.GetSettingById(id); - if (setting == null) - throw new ArgumentException("No setting found with the specified id"); - _settingService.DeleteSetting(setting); - - //activity log - _customerActivityService.InsertActivity("DeleteSetting", _localizationService.GetResource("ActivityLog.DeleteSetting"), setting.Name); - - return new NullJsonResult(); - } - - //action displaying notification (warning) to a store owner about a lot of traffic - //between the Redis server and the application when LoadAllLocaleRecordsOnStartup seetting is set - [ValidateInput(false)] - public ActionResult RedisCacheHighTrafficWarning(bool loadAllLocaleRecordsOnStartup) - { - //LoadAllLocaleRecordsOnStartup is set and Redis cache is used, so display warning - if (_config.RedisCachingEnabled && loadAllLocaleRecordsOnStartup) - return Json(new { Result = _localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.LoadAllLocaleRecordsOnStartup.Warning") }, JsonRequestBehavior.AllowGet); - - return Json(new { Result = string.Empty }, JsonRequestBehavior.AllowGet); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using Nop.Admin.Extensions; +using Nop.Admin.Models.Common; +using Nop.Admin.Models.Settings; +using Nop.Admin.Models.Stores; +using Nop.Core; +using Nop.Core.Configuration; +using Nop.Core.Domain; +using Nop.Core.Domain.Blogs; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Forums; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Media; +using Nop.Core.Domain.News; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Security; +using Nop.Core.Domain.Seo; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Domain.Vendors; +using Nop.Services; +using Nop.Services.Common; +using Nop.Services.Configuration; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Helpers; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Media; +using Nop.Services.Orders; +using Nop.Services.Security; +using Nop.Services.Stores; +using Nop.Services.Tax; +using Nop.Web.Framework; +using Nop.Web.Framework.Controllers; +using Nop.Web.Framework.Kendoui; +using Nop.Web.Framework.Localization; +using Nop.Web.Framework.Mvc; +using Nop.Web.Framework.Security; +using Nop.Web.Framework.Security.Captcha; +using Nop.Web.Framework.Themes; + +namespace Nop.Admin.Controllers +{ + public partial class SettingController : BaseAdminController + { + #region Fields + + private readonly ISettingService _settingService; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly IAddressService _addressService; + private readonly ITaxCategoryService _taxCategoryService; + private readonly ICurrencyService _currencyService; + private readonly IPictureService _pictureService; + private readonly ILocalizationService _localizationService; + private readonly IDateTimeHelper _dateTimeHelper; + private readonly IOrderService _orderService; + private readonly IEncryptionService _encryptionService; + private readonly IThemeProvider _themeProvider; + private readonly ICustomerService _customerService; + private readonly ICustomerActivityService _customerActivityService; + private readonly IPermissionService _permissionService; + private readonly IFulltextService _fulltextService; + private readonly IMaintenanceService _maintenanceService; + private readonly IStoreService _storeService; + private readonly IWorkContext _workContext; + private readonly IGenericAttributeService _genericAttributeService; + private readonly IReturnRequestService _returnRequestService; + private readonly ILanguageService _languageService; + private readonly ILocalizedEntityService _localizedEntityService; + private readonly NopConfig _config; + #endregion + + #region Ctor + + public SettingController(ISettingService settingService, + ICountryService countryService, + IStateProvinceService stateProvinceService, + IAddressService addressService, + ITaxCategoryService taxCategoryService, + ICurrencyService currencyService, + IPictureService pictureService, + ILocalizationService localizationService, + IDateTimeHelper dateTimeHelper, + IOrderService orderService, + IEncryptionService encryptionService, + IThemeProvider themeProvider, + ICustomerService customerService, + ICustomerActivityService customerActivityService, + IPermissionService permissionService, + IFulltextService fulltextService, + IMaintenanceService maintenanceService, + IStoreService storeService, + IWorkContext workContext, + IGenericAttributeService genericAttributeService, + IReturnRequestService returnRequestService, + ILanguageService languageService, + ILocalizedEntityService localizedEntityService, + NopConfig config) + { + this._settingService = settingService; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._addressService = addressService; + this._taxCategoryService = taxCategoryService; + this._currencyService = currencyService; + this._pictureService = pictureService; + this._localizationService = localizationService; + this._dateTimeHelper = dateTimeHelper; + this._orderService = orderService; + this._encryptionService = encryptionService; + this._themeProvider = themeProvider; + this._customerService = customerService; + this._customerActivityService = customerActivityService; + this._permissionService = permissionService; + this._fulltextService = fulltextService; + this._maintenanceService = maintenanceService; + this._storeService = storeService; + this._workContext = workContext; + this._genericAttributeService = genericAttributeService; + this._returnRequestService = returnRequestService; + this._languageService = languageService; + this._localizedEntityService = localizedEntityService; + this._config = config; + } + + #endregion + + #region Utilities + + [NonAction] + protected virtual void UpdateLocales(ReturnRequestReason rrr, ReturnRequestReasonModel model) + { + foreach (var localized in model.Locales) + { + _localizedEntityService.SaveLocalizedValue(rrr, + x => x.Name, + localized.Name, + localized.LanguageId); + } + } + + [NonAction] + protected virtual void UpdateLocales(ReturnRequestAction rra, ReturnRequestActionModel model) + { + foreach (var localized in model.Locales) + { + _localizedEntityService.SaveLocalizedValue(rra, + x => x.Name, + localized.Name, + localized.LanguageId); + } + } + + #endregion + + #region Methods + + [ChildActionOnly] + public virtual ActionResult Mode(string modeName = "settings-advanced-mode") + { + var model = new ModeModel() + { + ModeName = modeName, + Enabled = _workContext.CurrentCustomer.GetAttribute(modeName) + }; + return PartialView(model); + } + + [ChildActionOnly] + public virtual ActionResult StoreScopeConfiguration() + { + var allStores = _storeService.GetAllStores(); + if (allStores.Count < 2) + return Content(""); + + var model = new StoreScopeConfigurationModel(); + foreach (var s in allStores) + { + model.Stores.Add(new StoreModel + { + Id = s.Id, + Name = s.Name + }); + } + model.StoreId = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + + return PartialView(model); + } + public virtual ActionResult ChangeStoreScopeConfiguration(int storeid, string returnUrl = "") + { + var store = _storeService.GetStoreById(storeid); + if (store != null || storeid == 0) + { + _genericAttributeService.SaveAttribute(_workContext.CurrentCustomer, + SystemCustomerAttributeNames.AdminAreaStoreScopeConfiguration, storeid); + } + + //home page + if (String.IsNullOrEmpty(returnUrl)) + returnUrl = Url.Action("Index", "Home", new { area = "Admin" }); + //prevent open redirection attack + if (!Url.IsLocalUrl(returnUrl)) + return RedirectToAction("Index", "Home", new { area = "Admin" }); + return Redirect(returnUrl); + } + + public virtual ActionResult Blog() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var blogSettings = _settingService.LoadSetting(storeScope); + var model = blogSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.Enabled_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.Enabled, storeScope); + model.PostsPageSize_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.PostsPageSize, storeScope); + model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.AllowNotRegisteredUsersToLeaveComments, storeScope); + model.NotifyAboutNewBlogComments_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.NotifyAboutNewBlogComments, storeScope); + model.NumberOfTags_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.NumberOfTags, storeScope); + model.ShowHeaderRssUrl_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.ShowHeaderRssUrl, storeScope); + model.BlogCommentsMustBeApproved_OverrideForStore = _settingService.SettingExists(blogSettings, x => x.BlogCommentsMustBeApproved, storeScope); + } + + return View(model); + } + [HttpPost] + public virtual ActionResult Blog(BlogSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var blogSettings = _settingService.LoadSetting(storeScope); + blogSettings = model.ToEntity(blogSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.PostsPageSize, model.PostsPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.AllowNotRegisteredUsersToLeaveComments, model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.NotifyAboutNewBlogComments, model.NotifyAboutNewBlogComments_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.NumberOfTags, model.NumberOfTags_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.ShowHeaderRssUrl, model.ShowHeaderRssUrl_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(blogSettings, x => x.BlogCommentsMustBeApproved, model.BlogCommentsMustBeApproved_OverrideForStore, storeScope, false); + _settingService.SaveSetting(blogSettings, x => x.ShowBlogCommentsPerStore, clearCache: false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Blog"); + } + + + + + public virtual ActionResult Vendor() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var vendorSettings = _settingService.LoadSetting(storeScope); + var model = vendorSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.VendorsBlockItemsToDisplay_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.VendorsBlockItemsToDisplay, storeScope); + model.ShowVendorOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.ShowVendorOnProductDetailsPage, storeScope); + model.AllowCustomersToContactVendors_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowCustomersToContactVendors, storeScope); + model.AllowCustomersToApplyForVendorAccount_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowCustomersToApplyForVendorAccount, storeScope); + model.AllowSearchByVendor_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowSearchByVendor, storeScope); + model.AllowVendorsToEditInfo_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowVendorsToEditInfo, storeScope); + model.NotifyStoreOwnerAboutVendorInformationChange_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.NotifyStoreOwnerAboutVendorInformationChange, storeScope); + model.MaximumProductNumber_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.MaximumProductNumber, storeScope); + model.AllowVendorsToImportProducts_OverrideForStore = _settingService.SettingExists(vendorSettings, x => x.AllowVendorsToImportProducts, storeScope); + } + + return View(model); + } + [HttpPost] + public virtual ActionResult Vendor(VendorSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var vendorSettings = _settingService.LoadSetting(storeScope); + vendorSettings = model.ToEntity(vendorSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.VendorsBlockItemsToDisplay, model.VendorsBlockItemsToDisplay_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.ShowVendorOnProductDetailsPage, model.ShowVendorOnProductDetailsPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowCustomersToContactVendors, model.AllowCustomersToContactVendors_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowCustomersToApplyForVendorAccount, model.AllowCustomersToApplyForVendorAccount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowSearchByVendor, model.AllowSearchByVendor_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowVendorsToEditInfo, model.AllowVendorsToEditInfo_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.NotifyStoreOwnerAboutVendorInformationChange, model.NotifyStoreOwnerAboutVendorInformationChange_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.MaximumProductNumber, model.MaximumProductNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(vendorSettings, x => x.AllowVendorsToImportProducts, model.AllowVendorsToImportProducts_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Vendor"); + } + + + + + public virtual ActionResult Forum() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var forumSettings = _settingService.LoadSetting(storeScope); + var model = forumSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.ForumsEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumsEnabled, storeScope); + model.RelativeDateTimeFormattingEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.RelativeDateTimeFormattingEnabled, storeScope); + model.ShowCustomersPostCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ShowCustomersPostCount, storeScope); + model.AllowGuestsToCreatePosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowGuestsToCreatePosts, storeScope); + model.AllowGuestsToCreateTopics_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowGuestsToCreateTopics, storeScope); + model.AllowCustomersToEditPosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToEditPosts, storeScope); + model.AllowCustomersToDeletePosts_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToDeletePosts, storeScope); + model.AllowPostVoting_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowPostVoting, storeScope); + model.MaxVotesPerDay_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.MaxVotesPerDay, storeScope); + model.AllowCustomersToManageSubscriptions_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowCustomersToManageSubscriptions, storeScope); + model.TopicsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.TopicsPageSize, storeScope); + model.PostsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.PostsPageSize, storeScope); + model.ForumEditor_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumEditor, storeScope); + model.SignaturesEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.SignaturesEnabled, storeScope); + model.AllowPrivateMessages_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.AllowPrivateMessages, storeScope); + model.ShowAlertForPM_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ShowAlertForPM, storeScope); + model.NotifyAboutPrivateMessages_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.NotifyAboutPrivateMessages, storeScope); + model.ActiveDiscussionsFeedEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsFeedEnabled, storeScope); + model.ActiveDiscussionsFeedCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsFeedCount, storeScope); + model.ForumFeedsEnabled_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumFeedsEnabled, storeScope); + model.ForumFeedCount_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ForumFeedCount, storeScope); + model.SearchResultsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.SearchResultsPageSize, storeScope); + model.ActiveDiscussionsPageSize_OverrideForStore = _settingService.SettingExists(forumSettings, x => x.ActiveDiscussionsPageSize, storeScope); + } + model.ForumEditorValues = forumSettings.ForumEditor.ToSelectList(); + + return View(model); + } + [HttpPost] + public virtual ActionResult Forum(ForumSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var forumSettings = _settingService.LoadSetting(storeScope); + forumSettings = model.ToEntity(forumSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumsEnabled, model.ForumsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.RelativeDateTimeFormattingEnabled, model.RelativeDateTimeFormattingEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ShowCustomersPostCount, model.ShowCustomersPostCount_OverrideForStore , storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowGuestsToCreatePosts, model.AllowGuestsToCreatePosts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowGuestsToCreateTopics, model.AllowGuestsToCreateTopics_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToEditPosts, model.AllowCustomersToEditPosts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToDeletePosts, model.AllowCustomersToDeletePosts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowPostVoting, model.AllowPostVoting_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.MaxVotesPerDay, model.MaxVotesPerDay_OverrideForStore , storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowCustomersToManageSubscriptions, model.AllowCustomersToManageSubscriptions_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.TopicsPageSize, model.TopicsPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.PostsPageSize, model.PostsPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumEditor, model.ForumEditor_OverrideForStore , storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.SignaturesEnabled, model.SignaturesEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.AllowPrivateMessages, model.AllowPrivateMessages_OverrideForStore , storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ShowAlertForPM, model.ShowAlertForPM_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.NotifyAboutPrivateMessages, model.NotifyAboutPrivateMessages_OverrideForStore , storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsFeedEnabled, model.ActiveDiscussionsFeedEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsFeedCount, model.ActiveDiscussionsFeedCount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumFeedsEnabled, model.ForumFeedsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ForumFeedCount, model.ForumFeedCount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.SearchResultsPageSize, model.SearchResultsPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(forumSettings, x => x.ActiveDiscussionsPageSize, model.ActiveDiscussionsPageSize_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Forum"); + } + + + + + public virtual ActionResult News() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var newsSettings = _settingService.LoadSetting(storeScope); + var model = newsSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.Enabled_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.Enabled, storeScope); + model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.AllowNotRegisteredUsersToLeaveComments, storeScope); + model.NotifyAboutNewNewsComments_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NotifyAboutNewNewsComments, storeScope); + model.ShowNewsOnMainPage_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.ShowNewsOnMainPage, storeScope); + model.MainPageNewsCount_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.MainPageNewsCount, storeScope); + model.NewsArchivePageSize_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NewsArchivePageSize, storeScope); + model.ShowHeaderRssUrl_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.ShowHeaderRssUrl, storeScope); + model.NewsCommentsMustBeApproved_OverrideForStore = _settingService.SettingExists(newsSettings, x => x.NewsCommentsMustBeApproved, storeScope); + } + return View(model); + } + [HttpPost] + public virtual ActionResult News(NewsSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var newsSettings = _settingService.LoadSetting(storeScope); + newsSettings = model.ToEntity(newsSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.AllowNotRegisteredUsersToLeaveComments, model.AllowNotRegisteredUsersToLeaveComments_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NotifyAboutNewNewsComments, model.NotifyAboutNewNewsComments_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.ShowNewsOnMainPage, model.ShowNewsOnMainPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.MainPageNewsCount, model.MainPageNewsCount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NewsArchivePageSize, model.NewsArchivePageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.ShowHeaderRssUrl, model.ShowHeaderRssUrl_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(newsSettings, x => x.NewsCommentsMustBeApproved, model.NewsCommentsMustBeApproved_OverrideForStore, storeScope, false); + _settingService.SaveSetting(newsSettings, x => x.ShowNewsCommentsPerStore, clearCache: false); + + //now clear settings cache + _settingService.ClearCache(); + + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("News"); + } + + + + + public virtual ActionResult Shipping() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var shippingSettings = _settingService.LoadSetting(storeScope); + var model = shippingSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.ShipToSameAddress_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ShipToSameAddress, storeScope); + model.AllowPickUpInStore_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.AllowPickUpInStore, storeScope); + model.DisplayPickupPointsOnMap_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayPickupPointsOnMap, storeScope); + model.GoogleMapsApiKey_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.GoogleMapsApiKey, storeScope); + model.UseWarehouseLocation_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.UseWarehouseLocation, storeScope); + model.NotifyCustomerAboutShippingFromMultipleLocations_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.NotifyCustomerAboutShippingFromMultipleLocations, storeScope); + model.FreeShippingOverXEnabled_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXEnabled, storeScope); + model.FreeShippingOverXValue_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXValue, storeScope); + model.FreeShippingOverXIncludingTax_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.FreeShippingOverXIncludingTax, storeScope); + model.EstimateShippingEnabled_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.EstimateShippingEnabled, storeScope); + model.DisplayShipmentEventsToCustomers_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayShipmentEventsToCustomers, storeScope); + model.DisplayShipmentEventsToStoreOwner_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.DisplayShipmentEventsToStoreOwner, storeScope); + model.HideShippingTotal_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.HideShippingTotal, storeScope); + model.BypassShippingMethodSelectionIfOnlyOne_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.BypassShippingMethodSelectionIfOnlyOne, storeScope); + model.ConsiderAssociatedProductsDimensions_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ConsiderAssociatedProductsDimensions, storeScope); + model.ShippingOriginAddress_OverrideForStore = _settingService.SettingExists(shippingSettings, x => x.ShippingOriginAddressId, storeScope); + } + //shipping origin + var originAddress = shippingSettings.ShippingOriginAddressId > 0 + ? _addressService.GetAddressById(shippingSettings.ShippingOriginAddressId) + : null; + if (originAddress != null) + model.ShippingOriginAddress = originAddress.ToModel(); + else + model.ShippingOriginAddress = new AddressModel(); + + model.ShippingOriginAddress.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.ShippingOriginAddress.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (originAddress != null && c.Id == originAddress.CountryId) }); + + var states = originAddress != null && originAddress.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(originAddress.Country.Id, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.ShippingOriginAddress.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == originAddress.StateProvinceId) }); + } + else + model.ShippingOriginAddress.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + model.ShippingOriginAddress.CountryEnabled = true; + model.ShippingOriginAddress.StateProvinceEnabled = true; + model.ShippingOriginAddress.CityEnabled = true; + model.ShippingOriginAddress.StreetAddressEnabled = true; + model.ShippingOriginAddress.ZipPostalCodeEnabled = true; + model.ShippingOriginAddress.ZipPostalCodeRequired = true; + + return View(model); + } + [HttpPost] + public virtual ActionResult Shipping(ShippingSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var shippingSettings = _settingService.LoadSetting(storeScope); + shippingSettings = model.ToEntity(shippingSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.ShipToSameAddress, model.ShipToSameAddress_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.AllowPickUpInStore, model.AllowPickUpInStore_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayPickupPointsOnMap, model.DisplayPickupPointsOnMap_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.GoogleMapsApiKey, model.GoogleMapsApiKey_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.UseWarehouseLocation, model.UseWarehouseLocation_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.NotifyCustomerAboutShippingFromMultipleLocations, model.NotifyCustomerAboutShippingFromMultipleLocations_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXEnabled, model.FreeShippingOverXEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXValue, model.FreeShippingOverXValue_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.FreeShippingOverXIncludingTax, model.FreeShippingOverXIncludingTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.EstimateShippingEnabled, model.EstimateShippingEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayShipmentEventsToCustomers, model.DisplayShipmentEventsToCustomers_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.DisplayShipmentEventsToStoreOwner, model.DisplayShipmentEventsToStoreOwner_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.HideShippingTotal, model.HideShippingTotal_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.BypassShippingMethodSelectionIfOnlyOne, model.BypassShippingMethodSelectionIfOnlyOne_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shippingSettings, x => x.ConsiderAssociatedProductsDimensions, model.ConsiderAssociatedProductsDimensions_OverrideForStore, storeScope, false); + + if (model.ShippingOriginAddress_OverrideForStore || storeScope == 0) + { + //update address + var addressId = _settingService.SettingExists(shippingSettings, x => x.ShippingOriginAddressId, storeScope) ? + shippingSettings.ShippingOriginAddressId : 0; + var originAddress = _addressService.GetAddressById(addressId) ?? + new Address + { + CreatedOnUtc = DateTime.UtcNow, + }; + //update ID manually (in case we're in multi-store configuration mode it'll be set to the shared one) + model.ShippingOriginAddress.Id = addressId; + originAddress = model.ShippingOriginAddress.ToEntity(originAddress); + if (originAddress.Id > 0) + _addressService.UpdateAddress(originAddress); + else + _addressService.InsertAddress(originAddress); + shippingSettings.ShippingOriginAddressId = originAddress.Id; + + _settingService.SaveSetting(shippingSettings, x => x.ShippingOriginAddressId, storeScope, false); + } + else if (storeScope > 0) + _settingService.DeleteSetting(shippingSettings, x => x.ShippingOriginAddressId, storeScope); + + + //now clear settings cache + _settingService.ClearCache(); + + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Shipping"); + } + + + + + public virtual ActionResult Tax() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var taxSettings = _settingService.LoadSetting(storeScope); + var model = taxSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.PricesIncludeTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PricesIncludeTax, storeScope); + model.AllowCustomersToSelectTaxDisplayType_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.AllowCustomersToSelectTaxDisplayType, storeScope); + model.TaxDisplayType_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxDisplayType, storeScope); + model.DisplayTaxSuffix_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DisplayTaxSuffix, storeScope); + model.DisplayTaxRates_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DisplayTaxRates, storeScope); + model.HideZeroTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.HideZeroTax, storeScope); + model.HideTaxInOrderSummary_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.HideTaxInOrderSummary, storeScope); + model.ForceTaxExclusionFromOrderSubtotal_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ForceTaxExclusionFromOrderSubtotal, storeScope); + model.DefaultTaxCategoryId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DefaultTaxCategoryId, storeScope); + model.TaxBasedOn_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxBasedOn, storeScope); + model.TaxBasedOnPickupPointAddress_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.TaxBasedOnPickupPointAddress, storeScope); + model.DefaultTaxAddress_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.DefaultTaxAddressId, storeScope); + model.ShippingIsTaxable_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingIsTaxable, storeScope); + model.ShippingPriceIncludesTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingPriceIncludesTax, storeScope); + model.ShippingTaxClassId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.ShippingTaxClassId, storeScope); + model.PaymentMethodAdditionalFeeIsTaxable_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeIsTaxable, storeScope); + model.PaymentMethodAdditionalFeeIncludesTax_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeIncludesTax, storeScope); + model.PaymentMethodAdditionalFeeTaxClassId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.PaymentMethodAdditionalFeeTaxClassId, storeScope); + model.EuVatEnabled_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatEnabled, storeScope); + model.EuVatShopCountryId_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatShopCountryId, storeScope); + model.EuVatAllowVatExemption_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatAllowVatExemption, storeScope); + model.EuVatUseWebService_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatUseWebService, storeScope); + model.EuVatAssumeValid_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatAssumeValid, storeScope); + model.EuVatEmailAdminWhenNewVatSubmitted_OverrideForStore = _settingService.SettingExists(taxSettings, x => x.EuVatEmailAdminWhenNewVatSubmitted, storeScope); + } + + model.TaxBasedOnValues = taxSettings.TaxBasedOn.ToSelectList(); + model.TaxDisplayTypeValues = taxSettings.TaxDisplayType.ToSelectList(); + + //tax categories + var taxCategories = _taxCategoryService.GetAllTaxCategories(); + model.TaxCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Configuration.Settings.Tax.TaxCategories.None"), Value = "0" }); + foreach (var tc in taxCategories) + model.TaxCategories.Add(new SelectListItem { Text = tc.Name, Value = tc.Id.ToString() }); + model.PaymentMethodAdditionalFeeTaxCategories.Add(new SelectListItem { Text = "---", Value = "0" }); + foreach (var tc in taxCategories) + model.PaymentMethodAdditionalFeeTaxCategories.Add(new SelectListItem { Text = tc.Name, Value = tc.Id.ToString(), Selected = tc.Id == taxSettings.PaymentMethodAdditionalFeeTaxClassId }); + + //EU VAT countries + model.EuVatShopCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.EuVatShopCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = c.Id == taxSettings.EuVatShopCountryId }); + + //default tax address + var defaultAddress = taxSettings.DefaultTaxAddressId > 0 + ? _addressService.GetAddressById(taxSettings.DefaultTaxAddressId) + : null; + if (defaultAddress != null) + model.DefaultTaxAddress = defaultAddress.ToModel(); + else + model.DefaultTaxAddress = new AddressModel(); + + model.DefaultTaxAddress.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.DefaultTaxAddress.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (defaultAddress != null && c.Id == defaultAddress.CountryId) }); + + var states = defaultAddress != null && defaultAddress.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(defaultAddress.Country.Id, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.DefaultTaxAddress.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == defaultAddress.StateProvinceId) }); + } + else + model.DefaultTaxAddress.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + model.DefaultTaxAddress.CountryEnabled = true; + model.DefaultTaxAddress.StateProvinceEnabled = true; + model.DefaultTaxAddress.ZipPostalCodeEnabled = true; + model.DefaultTaxAddress.ZipPostalCodeRequired = true; + + return View(model); + } + [HttpPost] + public virtual ActionResult Tax(TaxSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var taxSettings = _settingService.LoadSetting(storeScope); + taxSettings = model.ToEntity(taxSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PricesIncludeTax, model.PricesIncludeTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.AllowCustomersToSelectTaxDisplayType, model.AllowCustomersToSelectTaxDisplayType_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxDisplayType, model.TaxDisplayType_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DisplayTaxSuffix, model.DisplayTaxSuffix_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DisplayTaxRates, model.DisplayTaxRates_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.HideZeroTax, model.HideZeroTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.HideTaxInOrderSummary, model.HideTaxInOrderSummary_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ForceTaxExclusionFromOrderSubtotal, model.ForceTaxExclusionFromOrderSubtotal_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.DefaultTaxCategoryId, model.DefaultTaxCategoryId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxBasedOn, model.TaxBasedOn_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.TaxBasedOnPickupPointAddress, model.TaxBasedOnPickupPointAddress_OverrideForStore, storeScope, false); + + + if (model.DefaultTaxAddress_OverrideForStore || storeScope == 0) + { + //update address + var addressId = _settingService.SettingExists(taxSettings, x => x.DefaultTaxAddressId, storeScope) ? + taxSettings.DefaultTaxAddressId : 0; + var originAddress = _addressService.GetAddressById(addressId) ?? + new Address + { + CreatedOnUtc = DateTime.UtcNow, + }; + //update ID manually (in case we're in multi-store configuration mode it'll be set to the shared one) + model.DefaultTaxAddress.Id = addressId; + originAddress = model.DefaultTaxAddress.ToEntity(originAddress); + if (originAddress.Id > 0) + _addressService.UpdateAddress(originAddress); + else + _addressService.InsertAddress(originAddress); + taxSettings.DefaultTaxAddressId = originAddress.Id; + + _settingService.SaveSetting(taxSettings, x => x.DefaultTaxAddressId, storeScope, false); + } + else if (storeScope > 0) + _settingService.DeleteSetting(taxSettings, x => x.DefaultTaxAddressId, storeScope); + + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingIsTaxable, model.ShippingIsTaxable_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingPriceIncludesTax, model.ShippingPriceIncludesTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.ShippingTaxClassId, model.ShippingTaxClassId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeIsTaxable, model.PaymentMethodAdditionalFeeIsTaxable_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeIncludesTax, model.PaymentMethodAdditionalFeeIncludesTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.PaymentMethodAdditionalFeeTaxClassId, model.PaymentMethodAdditionalFeeTaxClassId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatEnabled, model.EuVatEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatShopCountryId, model.EuVatShopCountryId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatAllowVatExemption, model.EuVatAllowVatExemption_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatUseWebService, model.EuVatUseWebService_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatAssumeValid, model.EuVatAssumeValid_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(taxSettings, x => x.EuVatEmailAdminWhenNewVatSubmitted, model.EuVatEmailAdminWhenNewVatSubmitted_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Tax"); + } + + + + + public virtual ActionResult Catalog() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var catalogSettings = _settingService.LoadSetting(storeScope); + var model = catalogSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.AllowViewUnpublishedProductPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowViewUnpublishedProductPage, storeScope); + model.DisplayDiscontinuedMessageForUnpublishedProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayDiscontinuedMessageForUnpublishedProducts, storeScope); + model.ShowSkuOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowSkuOnProductDetailsPage, storeScope); + model.ShowSkuOnCatalogPages_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowSkuOnCatalogPages, storeScope); + model.ShowManufacturerPartNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowManufacturerPartNumber, storeScope); + model.ShowGtin_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowGtin, storeScope); + model.ShowFreeShippingNotification_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowFreeShippingNotification, storeScope); + model.AllowProductSorting_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowProductSorting, storeScope); + model.AllowProductViewModeChanging_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowProductViewModeChanging, storeScope); + model.ShowProductsFromSubcategories_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductsFromSubcategories, storeScope); + model.ShowCategoryProductNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowCategoryProductNumber, storeScope); + model.ShowCategoryProductNumberIncludingSubcategories_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowCategoryProductNumberIncludingSubcategories, storeScope); + model.CategoryBreadcrumbEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.CategoryBreadcrumbEnabled, storeScope); + model.ShowShareButton_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowShareButton, storeScope); + model.PageShareCode_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.PageShareCode, storeScope); + model.ProductReviewsMustBeApproved_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductReviewsMustBeApproved, storeScope); + model.AllowAnonymousUsersToReviewProduct_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowAnonymousUsersToReviewProduct, storeScope); + model.ProductReviewPossibleOnlyAfterPurchasing_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductReviewPossibleOnlyAfterPurchasing, storeScope); + model.NotifyStoreOwnerAboutNewProductReviews_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NotifyStoreOwnerAboutNewProductReviews, storeScope); + model.EmailAFriendEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.EmailAFriendEnabled, storeScope); + model.AllowAnonymousUsersToEmailAFriend_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.AllowAnonymousUsersToEmailAFriend, storeScope); + model.RecentlyViewedProductsNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.RecentlyViewedProductsNumber, storeScope); + model.RecentlyViewedProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.RecentlyViewedProductsEnabled, storeScope); + model.NewProductsNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NewProductsNumber, storeScope); + model.NewProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NewProductsEnabled, storeScope); + model.CompareProductsEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.CompareProductsEnabled, storeScope); + model.ShowBestsellersOnHomepage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowBestsellersOnHomepage, storeScope); + model.NumberOfBestsellersOnHomepage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NumberOfBestsellersOnHomepage, storeScope); + model.SearchPageProductsPerPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPageProductsPerPage, storeScope); + model.SearchPageAllowCustomersToSelectPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPageAllowCustomersToSelectPageSize, storeScope); + model.SearchPagePageSizeOptions_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.SearchPagePageSizeOptions, storeScope); + model.ProductSearchAutoCompleteEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchAutoCompleteEnabled, storeScope); + model.ProductSearchAutoCompleteNumberOfProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchAutoCompleteNumberOfProducts, storeScope); + model.ShowProductImagesInSearchAutoComplete_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductImagesInSearchAutoComplete, storeScope); + model.ProductSearchTermMinimumLength_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductSearchTermMinimumLength, storeScope); + model.ProductsAlsoPurchasedEnabled_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsAlsoPurchasedEnabled, storeScope); + model.ProductsAlsoPurchasedNumber_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsAlsoPurchasedNumber, storeScope); + model.NumberOfProductTags_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.NumberOfProductTags, storeScope); + model.ProductsByTagPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagPageSize, storeScope); + model.ProductsByTagAllowCustomersToSelectPageSize_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagAllowCustomersToSelectPageSize, storeScope); + model.ProductsByTagPageSizeOptions_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ProductsByTagPageSizeOptions, storeScope); + model.IncludeShortDescriptionInCompareProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.IncludeShortDescriptionInCompareProducts, storeScope); + model.IncludeFullDescriptionInCompareProducts_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.IncludeFullDescriptionInCompareProducts, storeScope); + model.ManufacturersBlockItemsToDisplay_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ManufacturersBlockItemsToDisplay, storeScope); + model.DisplayTaxShippingInfoFooter_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoFooter, storeScope); + model.DisplayTaxShippingInfoProductDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoProductDetailsPage, storeScope); + model.DisplayTaxShippingInfoProductBoxes_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoProductBoxes, storeScope); + model.DisplayTaxShippingInfoShoppingCart_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoShoppingCart, storeScope); + model.DisplayTaxShippingInfoWishlist_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoWishlist, storeScope); + model.DisplayTaxShippingInfoOrderDetailsPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.DisplayTaxShippingInfoOrderDetailsPage, storeScope); + model.ShowProductReviewsPerStore_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductReviewsPerStore, storeScope); + model.ShowProductReviewsOnAccountPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ShowProductReviewsTabOnAccountPage, storeScope); + model.ProductReviewsPageSizeOnAccountPage_OverrideForStore = _settingService.SettingExists(catalogSettings, x=> x.ProductReviewsPageSizeOnAccountPage, storeScope); + model.ExportImportProductAttributes_OverrideForStore = _settingService.SettingExists(catalogSettings, x => x.ExportImportProductAttributes, storeScope); + } + return View(model); + } + [HttpPost] + public virtual ActionResult Catalog(CatalogSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var catalogSettings = _settingService.LoadSetting(storeScope); + catalogSettings = model.ToEntity(catalogSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowViewUnpublishedProductPage, model.AllowViewUnpublishedProductPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayDiscontinuedMessageForUnpublishedProducts, model.DisplayDiscontinuedMessageForUnpublishedProducts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowSkuOnProductDetailsPage, model.ShowSkuOnProductDetailsPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowSkuOnCatalogPages, model.ShowSkuOnCatalogPages_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowManufacturerPartNumber, model.ShowManufacturerPartNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowGtin, model.ShowGtin_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowFreeShippingNotification, model.ShowFreeShippingNotification_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowProductSorting, model.AllowProductSorting_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowProductViewModeChanging, model.AllowProductViewModeChanging_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductsFromSubcategories, model.ShowProductsFromSubcategories_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowCategoryProductNumber, model.ShowCategoryProductNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowCategoryProductNumberIncludingSubcategories, model.ShowCategoryProductNumberIncludingSubcategories_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.CategoryBreadcrumbEnabled, model.CategoryBreadcrumbEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowShareButton, model.ShowShareButton_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.PageShareCode, model.PageShareCode_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewsMustBeApproved, model.ProductReviewsMustBeApproved_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowAnonymousUsersToReviewProduct, model.AllowAnonymousUsersToReviewProduct_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewPossibleOnlyAfterPurchasing, model.ProductReviewPossibleOnlyAfterPurchasing_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NotifyStoreOwnerAboutNewProductReviews, model.NotifyStoreOwnerAboutNewProductReviews_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.EmailAFriendEnabled, model.EmailAFriendEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.AllowAnonymousUsersToEmailAFriend, model.AllowAnonymousUsersToEmailAFriend_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.RecentlyViewedProductsNumber, model.RecentlyViewedProductsNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.RecentlyViewedProductsEnabled, model.RecentlyViewedProductsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NewProductsNumber, model.NewProductsNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NewProductsEnabled, model.NewProductsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.CompareProductsEnabled, model.CompareProductsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowBestsellersOnHomepage, model.ShowBestsellersOnHomepage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NumberOfBestsellersOnHomepage, model.NumberOfBestsellersOnHomepage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPageProductsPerPage, model.SearchPageProductsPerPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPageAllowCustomersToSelectPageSize, model.SearchPageAllowCustomersToSelectPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.SearchPagePageSizeOptions, model.SearchPagePageSizeOptions_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchAutoCompleteEnabled, model.ProductSearchAutoCompleteEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchAutoCompleteNumberOfProducts, model.ProductSearchAutoCompleteNumberOfProducts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductImagesInSearchAutoComplete, model.ShowProductImagesInSearchAutoComplete_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductSearchTermMinimumLength, model.ProductSearchTermMinimumLength_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsAlsoPurchasedEnabled, model.ProductsAlsoPurchasedEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsAlsoPurchasedNumber, model.ProductsAlsoPurchasedNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.NumberOfProductTags, model.NumberOfProductTags_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagPageSize, model.ProductsByTagPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagAllowCustomersToSelectPageSize, model.ProductsByTagAllowCustomersToSelectPageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductsByTagPageSizeOptions, model.ProductsByTagPageSizeOptions_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.IncludeShortDescriptionInCompareProducts, model.IncludeShortDescriptionInCompareProducts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.IncludeFullDescriptionInCompareProducts, model.IncludeFullDescriptionInCompareProducts_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ManufacturersBlockItemsToDisplay, model.ManufacturersBlockItemsToDisplay_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoFooter, model.DisplayTaxShippingInfoFooter_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoProductDetailsPage, model.DisplayTaxShippingInfoProductDetailsPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoProductBoxes, model.DisplayTaxShippingInfoProductBoxes_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoShoppingCart, model.DisplayTaxShippingInfoShoppingCart_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoWishlist, model.DisplayTaxShippingInfoWishlist_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.DisplayTaxShippingInfoOrderDetailsPage, model.DisplayTaxShippingInfoOrderDetailsPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductReviewsPerStore, model.ShowProductReviewsPerStore_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ShowProductReviewsTabOnAccountPage, model.ShowProductReviewsOnAccountPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ProductReviewsPageSizeOnAccountPage, model.ProductReviewsPageSizeOnAccountPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(catalogSettings, x => x.ExportImportProductAttributes, model.ExportImportProductAttributes_OverrideForStore, storeScope, false); + + //now settings not overridable per store + _settingService.SaveSetting(catalogSettings, x => x.IgnoreDiscounts, 0, false); + _settingService.SaveSetting(catalogSettings, x => x.IgnoreFeaturedProducts, 0, false); + _settingService.SaveSetting(catalogSettings, x => x.IgnoreAcl, 0, false); + _settingService.SaveSetting(catalogSettings, x => x.IgnoreStoreLimitations, 0, false); + _settingService.SaveSetting(catalogSettings, x => x.CacheProductPrices, 0, false); + + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + + return RedirectToAction("Catalog"); + } + + #region Sort options + + [HttpPost] + public virtual ActionResult SortOptionsList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedKendoGridJson(); + + var catalogSettings = _settingService.LoadSetting(); + var model = new List(); + foreach (int option in Enum.GetValues(typeof(ProductSortingEnum))) + { + int value; + model.Add(new SortOptionModel() + { + Id = option, + Name = ((ProductSortingEnum)option).GetLocalizedEnum(_localizationService, _workContext), + IsActive = !catalogSettings.ProductSortingEnumDisabled.Contains(option), + DisplayOrder = catalogSettings.ProductSortingEnumDisplayOrder.TryGetValue(option, out value) ? value : option + }); + } + var gridModel = new DataSourceResult + { + Data = model.OrderBy(option => option.DisplayOrder), + Total = model.Count + }; + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult SortOptionUpdate(SortOptionModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var catalogSettings = _settingService.LoadSetting(storeScope); + + catalogSettings.ProductSortingEnumDisplayOrder[model.Id] = model.DisplayOrder; + if (model.IsActive && catalogSettings.ProductSortingEnumDisabled.Contains(model.Id)) + catalogSettings.ProductSortingEnumDisabled.Remove(model.Id); + if (!model.IsActive && !catalogSettings.ProductSortingEnumDisabled.Contains(model.Id)) + catalogSettings.ProductSortingEnumDisabled.Add(model.Id); + + + _settingService.SaveSetting(catalogSettings); + + return new NullJsonResult(); + } + + #endregion + + public virtual ActionResult RewardPoints() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var rewardPointsSettings = _settingService.LoadSetting(storeScope); + var model = rewardPointsSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.Enabled_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.Enabled, storeScope); + model.ExchangeRate_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.ExchangeRate, storeScope); + model.MinimumRewardPointsToUse_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.MinimumRewardPointsToUse, storeScope); + model.PointsForRegistration_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForRegistration, storeScope); + model.PointsForPurchases_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForPurchases_Amount, storeScope) || + _settingService.SettingExists(rewardPointsSettings, x => x.PointsForPurchases_Points, storeScope); + model.ActivationDelay_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.ActivationDelay, storeScope); + model.DisplayHowMuchWillBeEarned_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.DisplayHowMuchWillBeEarned, storeScope); + model.PointsForRegistration_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PointsForRegistration, storeScope); + model.PageSize_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.PageSize, storeScope); + model.EarnedRewardPointsAreTaxable_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.EarnedRewardPointsAreTaxable, storeScope); + model.AwardPointsIncludeShipping_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.AwardPointsIncludeShipping, storeScope); + model.AwardPointsIncludePaymentMethodAdditionalFee_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.AwardPointsIncludePaymentMethodAdditionalFee, storeScope); + model.AwardPointsExcludeGiftCard_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.AwardPointsExcludeGiftCard, storeScope); + model.AwardPointsExcludePurchasedRewardPoints_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.AwardPointsExcludePurchasedRewardPoints, storeScope); + model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints_OverrideForStore = _settingService.SettingExists(rewardPointsSettings, x => x.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints, storeScope); + + } + var currencySettings = _settingService.LoadSetting(storeScope); + model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(currencySettings.PrimaryStoreCurrencyId).CurrencyCode; + + model.ActivatePointsImmediately = model.ActivationDelay <= 0; + + return View(model); + } + [HttpPost] + public virtual ActionResult RewardPoints(RewardPointsSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var rewardPointsSettings = _settingService.LoadSetting(storeScope); + rewardPointsSettings = model.ToEntity(rewardPointsSettings); + + if (model.ActivatePointsImmediately) + rewardPointsSettings.ActivationDelay = 0; + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.Enabled, model.Enabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ExchangeRate, model.ExchangeRate_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.MinimumRewardPointsToUse, model.MinimumRewardPointsToUse_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForRegistration, model.PointsForRegistration_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForPurchases_Amount, model.PointsForPurchases_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PointsForPurchases_Points, model.PointsForPurchases_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ActivationDelay, model.ActivationDelay_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.ActivationDelayPeriodId, model.ActivationDelay_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.DisplayHowMuchWillBeEarned, model.DisplayHowMuchWillBeEarned_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.PageSize, model.PageSize_OverrideForStore, storeScope, false); + _settingService.SaveSetting(rewardPointsSettings, x => x.PointsAccumulatedForAllStores, 0, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.EarnedRewardPointsAreTaxable, model.EarnedRewardPointsAreTaxable_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.AwardPointsIncludeShipping, model.AwardPointsIncludeShipping_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.AwardPointsIncludePaymentMethodAdditionalFee, model.AwardPointsIncludePaymentMethodAdditionalFee_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.AwardPointsExcludeGiftCard, model.AwardPointsExcludeGiftCard_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.AwardPointsExcludePurchasedRewardPoints, model.AwardPointsExcludePurchasedRewardPoints_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(rewardPointsSettings, x => x.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints, model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + } + else + { + //If we got this far, something failed, redisplay form + foreach (var modelState in ModelState.Values) + foreach (var error in modelState.Errors) + ErrorNotification(error.ErrorMessage); + } + return RedirectToAction("RewardPoints"); + } + + + + + public virtual ActionResult Order() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var orderSettings = _settingService.LoadSetting(storeScope); + var model = orderSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.IsReOrderAllowed_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.IsReOrderAllowed, storeScope); + model.MinOrderSubtotalAmount_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderSubtotalAmount, storeScope); + model.MinOrderSubtotalAmountIncludingTax_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderSubtotalAmountIncludingTax, storeScope); + model.MinOrderTotalAmount_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.MinOrderTotalAmount, storeScope); + model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AutoUpdateOrderTotalsOnEditingOrder, storeScope); + model.AnonymousCheckoutAllowed_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AnonymousCheckoutAllowed, storeScope); + model.TermsOfServiceOnShoppingCartPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.TermsOfServiceOnShoppingCartPage, storeScope); + model.TermsOfServiceOnOrderConfirmPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.TermsOfServiceOnOrderConfirmPage, storeScope); + model.OnePageCheckoutEnabled_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.OnePageCheckoutEnabled, storeScope); + model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, storeScope); + model.DisableBillingAddressCheckoutStep_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.DisableBillingAddressCheckoutStep, storeScope); + model.DisableOrderCompletedPage_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.DisableOrderCompletedPage, storeScope); + model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderPlacedEmail, storeScope); + model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderPaidEmail, storeScope); + model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.AttachPdfInvoiceToOrderCompletedEmail, storeScope); + model.ReturnRequestsEnabled_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestsEnabled, storeScope); + model.ReturnRequestsAllowFiles_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestsAllowFiles, storeScope); + model.ReturnRequestNumberMask_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ReturnRequestNumberMask, storeScope); + model.NumberOfDaysReturnRequestAvailable_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.NumberOfDaysReturnRequestAvailable, storeScope); + model.CustomOrderNumberMask_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.CustomOrderNumberMask, storeScope); + model.InvoiceIdent_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.InvoiceIdent, storeScope); //model.InvoiceYear_OverrideForStore set by model.InvoiceIdent_OverrideForStore + model.ExportWithProducts_OverrideForStore = _settingService.SettingExists(orderSettings, x => x.ExportWithProducts, storeScope); + } + + var currencySettings = _settingService.LoadSetting(storeScope); + model.PrimaryStoreCurrencyCode = _currencyService.GetCurrencyById(currencySettings.PrimaryStoreCurrencyId).CurrencyCode; + + //order ident + model.OrderIdent = _maintenanceService.GetTableIdent(); + + return View(model); + } + [HttpPost] + public virtual ActionResult Order(OrderSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var orderSettings = _settingService.LoadSetting(storeScope); + orderSettings = model.ToEntity(orderSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.IsReOrderAllowed, model.IsReOrderAllowed_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderSubtotalAmount, model.MinOrderSubtotalAmount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderSubtotalAmountIncludingTax, model.MinOrderSubtotalAmountIncludingTax_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.MinOrderTotalAmount, model.MinOrderTotalAmount_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AutoUpdateOrderTotalsOnEditingOrder, model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AnonymousCheckoutAllowed, model.AnonymousCheckoutAllowed_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.TermsOfServiceOnShoppingCartPage, model.TermsOfServiceOnShoppingCartPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.TermsOfServiceOnOrderConfirmPage, model.TermsOfServiceOnOrderConfirmPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.OnePageCheckoutEnabled, model.OnePageCheckoutEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.DisableBillingAddressCheckoutStep, model.DisableBillingAddressCheckoutStep_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.DisableOrderCompletedPage, model.DisableOrderCompletedPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderPlacedEmail, model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderPaidEmail, model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.AttachPdfInvoiceToOrderCompletedEmail, model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestsEnabled, model.ReturnRequestsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestsAllowFiles, model.ReturnRequestsAllowFiles_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ReturnRequestNumberMask, model.ReturnRequestNumberMask_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.NumberOfDaysReturnRequestAvailable, model.NumberOfDaysReturnRequestAvailable_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.CustomOrderNumberMask, model.CustomOrderNumberMask_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.InvoiceIdent, model.InvoiceIdent_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.InvoiceYear, model.InvoiceIdent_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(orderSettings, x => x.ExportWithProducts, model.ExportWithProducts_OverrideForStore, storeScope, false); + _settingService.SaveSetting(orderSettings, x => x.ActivateGiftCardsAfterCompletingOrder, 0, false); + _settingService.SaveSetting(orderSettings, x => x.DeactivateGiftCardsAfterCancellingOrder, 0, false); + _settingService.SaveSetting(orderSettings, x => x.DeactivateGiftCardsAfterDeletingOrder, 0, false); + _settingService.SaveSetting(orderSettings, x => x.CompleteOrderWhenDelivered, 0, false); + _settingService.SaveSetting(orderSettings, x => x.AssignInvoiceIdentFromTask, 0, false); + + //now clear settings cache + _settingService.ClearCache(); + + //order ident + if (model.OrderIdent.HasValue) + { + try + { + _maintenanceService.SetTableIdent(model.OrderIdent.Value); + } + catch (Exception exc) + { + ErrorNotification(exc.Message); + } + } + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + } + else + { + //If we got this far, something failed, redisplay form + foreach (var modelState in ModelState.Values) + foreach (var error in modelState.Errors) + ErrorNotification(error.ErrorMessage); + } + + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("Order"); + } + + #region Return request reasons + + public virtual ActionResult ReturnRequestReasonList() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //we just redirect a user to the order settings page + + //select "return request" tab + SaveSelectedTabName("tab-returnrequest"); + return RedirectToAction("Order", "Setting"); + } + [HttpPost] + public virtual ActionResult ReturnRequestReasonList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedKendoGridJson(); + + var reasons = _returnRequestService.GetAllReturnRequestReasons(); + var gridModel = new DataSourceResult + { + Data = reasons.Select(x => x.ToModel()), + Total = reasons.Count + }; + return Json(gridModel); + } + //create + public virtual ActionResult ReturnRequestReasonCreate() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var model = new ReturnRequestReasonModel(); + //locales + AddLocales(_languageService, model.Locales); + return View(model); + } + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult ReturnRequestReasonCreate(ReturnRequestReasonModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var rrr = model.ToEntity(); + _returnRequestService.InsertReturnRequestReason(rrr); + //locales + UpdateLocales(rrr, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Added")); + return continueEditing ? RedirectToAction("ReturnRequestReasonEdit", new { id = rrr.Id }) : RedirectToAction("ReturnRequestReasonList"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + //edit + public virtual ActionResult ReturnRequestReasonEdit(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rrr = _returnRequestService.GetReturnRequestReasonById(id); + if (rrr == null) + //No reason found with the specified id + return RedirectToAction("ReturnRequestReasonList"); + + var model = rrr.ToModel(); + //locales + AddLocales(_languageService, model.Locales, (locale, languageId) => + { + locale.Name = rrr.GetLocalized(x => x.Name, languageId, false, false); + }); + return View(model); + } + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult ReturnRequestReasonEdit(ReturnRequestReasonModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rrr = _returnRequestService.GetReturnRequestReasonById(model.Id); + if (rrr == null) + //No reason found with the specified id + return RedirectToAction("ReturnRequestReasonList"); + + if (ModelState.IsValid) + { + rrr = model.ToEntity(rrr); + _returnRequestService.UpdateReturnRequestReason(rrr); + //locales + UpdateLocales(rrr, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Updated")); + if (continueEditing) + { + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("ReturnRequestReasonEdit", new { id = rrr.Id }); + } + return RedirectToAction("ReturnRequestReasonList"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + //delete + [HttpPost] + public virtual ActionResult ReturnRequestReasonDelete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rrr = _returnRequestService.GetReturnRequestReasonById(id); + _returnRequestService.DeleteReturnRequestReason(rrr); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestReasons.Deleted")); + return RedirectToAction("ReturnRequestReasonList"); + } + + #endregion + + #region Return request actions + + public virtual ActionResult ReturnRequestActionList() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //we just redirect a user to the order settings page + + //select "return request" tab + SaveSelectedTabName("tab-returnrequest"); + return RedirectToAction("Order", "Setting"); + } + [HttpPost] + public virtual ActionResult ReturnRequestActionList(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedKendoGridJson(); + + var actions = _returnRequestService.GetAllReturnRequestActions(); + var gridModel = new DataSourceResult + { + Data = actions.Select(x => x.ToModel()), + Total = actions.Count + }; + return Json(gridModel); + } + //create + public virtual ActionResult ReturnRequestActionCreate() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var model = new ReturnRequestActionModel(); + //locales + AddLocales(_languageService, model.Locales); + return View(model); + } + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult ReturnRequestActionCreate(ReturnRequestActionModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var rra = model.ToEntity(); + _returnRequestService.InsertReturnRequestAction(rra); + //locales + UpdateLocales(rra, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Added")); + return continueEditing ? RedirectToAction("ReturnRequestActionEdit", new { id = rra.Id }) : RedirectToAction("ReturnRequestActionList"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + //edit + public virtual ActionResult ReturnRequestActionEdit(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rra = _returnRequestService.GetReturnRequestActionById(id); + if (rra == null) + //No action found with the specified id + return RedirectToAction("ReturnRequestActionList"); + + var model = rra.ToModel(); + //locales + AddLocales(_languageService, model.Locales, (locale, languageId) => + { + locale.Name = rra.GetLocalized(x => x.Name, languageId, false, false); + }); + return View(model); + } + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult ReturnRequestActionEdit(ReturnRequestActionModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rra = _returnRequestService.GetReturnRequestActionById(model.Id); + if (rra == null) + //No action found with the specified id + return RedirectToAction("ReturnRequestActionList"); + + if (ModelState.IsValid) + { + rra = model.ToEntity(rra); + _returnRequestService.UpdateReturnRequestAction(rra); + //locales + UpdateLocales(rra, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Updated")); + if (continueEditing) + { + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("ReturnRequestActionEdit", new { id = rra.Id }); + } + return RedirectToAction("ReturnRequestActionList"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + //delete + [HttpPost] + public virtual ActionResult ReturnRequestActionDelete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var rra = _returnRequestService.GetReturnRequestActionById(id); + _returnRequestService.DeleteReturnRequestAction(rra); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.Order.ReturnRequestActions.Deleted")); + return RedirectToAction("ReturnRequestActionList"); + } + + #endregion + + + + + + public virtual ActionResult ShoppingCart() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var shoppingCartSettings = _settingService.LoadSetting(storeScope); + var model = shoppingCartSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.DisplayCartAfterAddingProduct_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.DisplayCartAfterAddingProduct, storeScope); + model.DisplayWishlistAfterAddingProduct_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.DisplayWishlistAfterAddingProduct, storeScope); + model.MaximumShoppingCartItems_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MaximumShoppingCartItems, storeScope); + model.MaximumWishlistItems_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MaximumWishlistItems, storeScope); + model.AllowOutOfStockItemsToBeAddedToWishlist_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowOutOfStockItemsToBeAddedToWishlist, storeScope); + model.MoveItemsFromWishlistToCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MoveItemsFromWishlistToCart, storeScope); + model.CartsSharedBetweenStores_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.CartsSharedBetweenStores, storeScope); + model.ShowProductImagesOnShoppingCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesOnShoppingCart, storeScope); + model.ShowProductImagesOnWishList_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesOnWishList, storeScope); + model.ShowDiscountBox_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowDiscountBox, storeScope); + model.ShowGiftCardBox_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowGiftCardBox, storeScope); + model.CrossSellsNumber_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.CrossSellsNumber, storeScope); + model.EmailWishlistEnabled_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.EmailWishlistEnabled, storeScope); + model.AllowAnonymousUsersToEmailWishlist_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowAnonymousUsersToEmailWishlist, storeScope); + model.MiniShoppingCartEnabled_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MiniShoppingCartEnabled, storeScope); + model.ShowProductImagesInMiniShoppingCart_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.ShowProductImagesInMiniShoppingCart, storeScope); + model.MiniShoppingCartProductNumber_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.MiniShoppingCartProductNumber, storeScope); + model.AllowCartItemEditing_OverrideForStore = _settingService.SettingExists(shoppingCartSettings, x => x.AllowCartItemEditing, storeScope); + } + return View(model); + } + [HttpPost] + public virtual ActionResult ShoppingCart(ShoppingCartSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var shoppingCartSettings = _settingService.LoadSetting(storeScope); + shoppingCartSettings = model.ToEntity(shoppingCartSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.DisplayCartAfterAddingProduct, model.DisplayCartAfterAddingProduct_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.DisplayWishlistAfterAddingProduct, model.DisplayWishlistAfterAddingProduct_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MaximumShoppingCartItems, model.MaximumShoppingCartItems_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MaximumWishlistItems, model.MaximumWishlistItems_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowOutOfStockItemsToBeAddedToWishlist, model.AllowOutOfStockItemsToBeAddedToWishlist_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MoveItemsFromWishlistToCart, model.MoveItemsFromWishlistToCart_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.CartsSharedBetweenStores, model.CartsSharedBetweenStores_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesOnShoppingCart, model.ShowProductImagesOnShoppingCart_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesOnWishList, model.ShowProductImagesOnWishList_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowDiscountBox, model.ShowDiscountBox_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowGiftCardBox, model.ShowGiftCardBox_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.CrossSellsNumber, model.CrossSellsNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.EmailWishlistEnabled, model.EmailWishlistEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowAnonymousUsersToEmailWishlist, model.AllowAnonymousUsersToEmailWishlist_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MiniShoppingCartEnabled, model.MiniShoppingCartEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.ShowProductImagesInMiniShoppingCart, model.ShowProductImagesInMiniShoppingCart_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.MiniShoppingCartProductNumber, model.MiniShoppingCartProductNumber_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(shoppingCartSettings, x => x.AllowCartItemEditing, model.AllowCartItemEditing_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("ShoppingCart"); + } + + + + + public virtual ActionResult Media() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var mediaSettings = _settingService.LoadSetting(storeScope); + var model = mediaSettings.ToModel(); + model.ActiveStoreScopeConfiguration = storeScope; + if (storeScope > 0) + { + model.AvatarPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.AvatarPictureSize, storeScope); + model.ProductThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductThumbPictureSize, storeScope); + model.ProductDetailsPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductDetailsPictureSize, storeScope); + model.ProductThumbPictureSizeOnProductDetailsPage_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ProductThumbPictureSizeOnProductDetailsPage, storeScope); + model.AssociatedProductPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.AssociatedProductPictureSize, storeScope); + model.CategoryThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.CategoryThumbPictureSize, storeScope); + model.ManufacturerThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ManufacturerThumbPictureSize, storeScope); + model.VendorThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.VendorThumbPictureSize, storeScope); + model.CartThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.CartThumbPictureSize, storeScope); + model.MiniCartThumbPictureSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MiniCartThumbPictureSize, storeScope); + model.MaximumImageSize_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MaximumImageSize, storeScope); + model.MultipleThumbDirectories_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.MultipleThumbDirectories, storeScope); + model.DefaultImageQuality_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.DefaultImageQuality, storeScope); + model.ImportProductImagesUsingHash_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.ImportProductImagesUsingHash, storeScope); + model.DefaultPictureZoomEnabled_OverrideForStore = _settingService.SettingExists(mediaSettings, x => x.DefaultPictureZoomEnabled, storeScope); + } + model.PicturesStoredIntoDatabase = _pictureService.StoreInDb; + return View(model); + } + [HttpPost] + [FormValueRequired("save")] + public virtual ActionResult Media(MediaSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var mediaSettings = _settingService.LoadSetting(storeScope); + mediaSettings = model.ToEntity(mediaSettings); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.AvatarPictureSize, model.AvatarPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductThumbPictureSize, model.ProductThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductDetailsPictureSize, model.ProductDetailsPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ProductThumbPictureSizeOnProductDetailsPage, model.ProductThumbPictureSizeOnProductDetailsPage_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.AssociatedProductPictureSize, model.AssociatedProductPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.CategoryThumbPictureSize, model.CategoryThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ManufacturerThumbPictureSize, model.ManufacturerThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.VendorThumbPictureSize, model.VendorThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.CartThumbPictureSize, model.CartThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MiniCartThumbPictureSize, model.MiniCartThumbPictureSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MaximumImageSize, model.MaximumImageSize_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.MultipleThumbDirectories, model.MultipleThumbDirectories_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.DefaultImageQuality, model.DefaultImageQuality_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.ImportProductImagesUsingHash, model.ImportProductImagesUsingHash_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(mediaSettings, x => x.DefaultPictureZoomEnabled, model.DefaultPictureZoomEnabled_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Media"); + } + [HttpPost, ActionName("Media")] + [FormValueRequired("change-picture-storage")] + public virtual ActionResult ChangePictureStorage() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + _pictureService.StoreInDb = !_pictureService.StoreInDb; + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + return RedirectToAction("Media"); + } + + + + public virtual ActionResult CustomerUser() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var customerSettings = _settingService.LoadSetting(storeScope); + var addressSettings = _settingService.LoadSetting(storeScope); + var dateTimeSettings = _settingService.LoadSetting(storeScope); + var externalAuthenticationSettings = _settingService.LoadSetting(storeScope); + + //merge settings + var model = new CustomerUserSettingsModel(); + model.CustomerSettings = customerSettings.ToModel(); + model.AddressSettings = addressSettings.ToModel(); + + model.DateTimeSettings.AllowCustomersToSetTimeZone = dateTimeSettings.AllowCustomersToSetTimeZone; + model.DateTimeSettings.DefaultStoreTimeZoneId = _dateTimeHelper.DefaultStoreTimeZone.Id; + foreach (TimeZoneInfo timeZone in _dateTimeHelper.GetSystemTimeZones()) + { + model.DateTimeSettings.AvailableTimeZones.Add(new SelectListItem + { + Text = timeZone.DisplayName, + Value = timeZone.Id, + Selected = timeZone.Id.Equals(_dateTimeHelper.DefaultStoreTimeZone.Id, StringComparison.InvariantCultureIgnoreCase) + }); + } + + model.ExternalAuthenticationSettings.AutoRegisterEnabled = externalAuthenticationSettings.AutoRegisterEnabled; + + return View(model); + } + [HttpPost] + public virtual ActionResult CustomerUser(CustomerUserSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var customerSettings = _settingService.LoadSetting(storeScope); + var addressSettings = _settingService.LoadSetting(storeScope); + var dateTimeSettings = _settingService.LoadSetting(storeScope); + var externalAuthenticationSettings = _settingService.LoadSetting(storeScope); + + customerSettings = model.CustomerSettings.ToEntity(customerSettings); + _settingService.SaveSetting(customerSettings); + + addressSettings = model.AddressSettings.ToEntity(addressSettings); + _settingService.SaveSetting(addressSettings); + + dateTimeSettings.DefaultStoreTimeZoneId = model.DateTimeSettings.DefaultStoreTimeZoneId; + dateTimeSettings.AllowCustomersToSetTimeZone = model.DateTimeSettings.AllowCustomersToSetTimeZone; + _settingService.SaveSetting(dateTimeSettings); + + externalAuthenticationSettings.AutoRegisterEnabled = model.ExternalAuthenticationSettings.AutoRegisterEnabled; + _settingService.SaveSetting(externalAuthenticationSettings); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + + //selected tab + SaveSelectedTabName(); + + return RedirectToAction("CustomerUser"); + } + + + + + + + public virtual ActionResult GeneralCommon() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //set page timeout to 5 minutes + this.Server.ScriptTimeout = 300; + + var model = new GeneralCommonSettingsModel(); + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + model.ActiveStoreScopeConfiguration = storeScope; + //store information + var storeInformationSettings = _settingService.LoadSetting(storeScope); + var commonSettings = _settingService.LoadSetting(storeScope); + model.StoreInformationSettings.StoreClosed = storeInformationSettings.StoreClosed; + //themes + model.StoreInformationSettings.DefaultStoreTheme = storeInformationSettings.DefaultStoreTheme; + model.StoreInformationSettings.AvailableStoreThemes = _themeProvider + .GetThemeConfigurations() + .Select(x => new GeneralCommonSettingsModel.StoreInformationSettingsModel.ThemeConfigurationModel + { + ThemeTitle = x.ThemeTitle, + ThemeName = x.ThemeName, + PreviewImageUrl = x.PreviewImageUrl, + PreviewText = x.PreviewText, + SupportRtl = x.SupportRtl, + Selected = x.ThemeName.Equals(storeInformationSettings.DefaultStoreTheme, StringComparison.InvariantCultureIgnoreCase) + }) + .ToList(); + model.StoreInformationSettings.AllowCustomerToSelectTheme = storeInformationSettings.AllowCustomerToSelectTheme; + model.StoreInformationSettings.LogoPictureId = storeInformationSettings.LogoPictureId; + //EU Cookie law + model.StoreInformationSettings.DisplayEuCookieLawWarning = storeInformationSettings.DisplayEuCookieLawWarning; + //social pages + model.StoreInformationSettings.FacebookLink = storeInformationSettings.FacebookLink; + model.StoreInformationSettings.TwitterLink = storeInformationSettings.TwitterLink; + model.StoreInformationSettings.YoutubeLink = storeInformationSettings.YoutubeLink; + model.StoreInformationSettings.GooglePlusLink = storeInformationSettings.GooglePlusLink; + //contact us + model.StoreInformationSettings.SubjectFieldOnContactUsForm = commonSettings.SubjectFieldOnContactUsForm; + model.StoreInformationSettings.UseSystemEmailForContactUsForm = commonSettings.UseSystemEmailForContactUsForm; + //sitemap + model.StoreInformationSettings.SitemapEnabled = commonSettings.SitemapEnabled; + model.StoreInformationSettings.SitemapIncludeCategories = commonSettings.SitemapIncludeCategories; + model.StoreInformationSettings.SitemapIncludeManufacturers = commonSettings.SitemapIncludeManufacturers; + model.StoreInformationSettings.SitemapIncludeProducts = commonSettings.SitemapIncludeProducts; + + //override settings + if (storeScope > 0) + { + model.StoreInformationSettings.StoreClosed_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.StoreClosed, storeScope); + model.StoreInformationSettings.DefaultStoreTheme_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.DefaultStoreTheme, storeScope); + model.StoreInformationSettings.AllowCustomerToSelectTheme_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.AllowCustomerToSelectTheme, storeScope); + model.StoreInformationSettings.LogoPictureId_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.LogoPictureId, storeScope); + model.StoreInformationSettings.DisplayEuCookieLawWarning_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.DisplayEuCookieLawWarning, storeScope); + model.StoreInformationSettings.FacebookLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.FacebookLink, storeScope); + model.StoreInformationSettings.TwitterLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.TwitterLink, storeScope); + model.StoreInformationSettings.YoutubeLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.YoutubeLink, storeScope); + model.StoreInformationSettings.GooglePlusLink_OverrideForStore = _settingService.SettingExists(storeInformationSettings, x => x.GooglePlusLink, storeScope); + model.StoreInformationSettings.SubjectFieldOnContactUsForm_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SubjectFieldOnContactUsForm, storeScope); + model.StoreInformationSettings.UseSystemEmailForContactUsForm_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.UseSystemEmailForContactUsForm, storeScope); + model.StoreInformationSettings.SitemapEnabled_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapEnabled, storeScope); + model.StoreInformationSettings.SitemapIncludeCategories_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeCategories, storeScope); + model.StoreInformationSettings.SitemapIncludeManufacturers_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeManufacturers, storeScope); + model.StoreInformationSettings.SitemapIncludeProducts_OverrideForStore = _settingService.SettingExists(commonSettings, x => x.SitemapIncludeProducts, storeScope); + } + + //seo settings + var seoSettings = _settingService.LoadSetting(storeScope); + model.SeoSettings.PageTitleSeparator = seoSettings.PageTitleSeparator; + model.SeoSettings.PageTitleSeoAdjustment = (int)seoSettings.PageTitleSeoAdjustment; + model.SeoSettings.PageTitleSeoAdjustmentValues = seoSettings.PageTitleSeoAdjustment.ToSelectList(); + model.SeoSettings.DefaultTitle = seoSettings.DefaultTitle; + model.SeoSettings.DefaultMetaKeywords = seoSettings.DefaultMetaKeywords; + model.SeoSettings.DefaultMetaDescription = seoSettings.DefaultMetaDescription; + model.SeoSettings.GenerateProductMetaDescription = seoSettings.GenerateProductMetaDescription; + model.SeoSettings.ConvertNonWesternChars = seoSettings.ConvertNonWesternChars; + model.SeoSettings.CanonicalUrlsEnabled = seoSettings.CanonicalUrlsEnabled; + model.SeoSettings.WwwRequirement = (int)seoSettings.WwwRequirement; + model.SeoSettings.WwwRequirementValues = seoSettings.WwwRequirement.ToSelectList(); + model.SeoSettings.EnableJsBundling = seoSettings.EnableJsBundling; + model.SeoSettings.EnableCssBundling = seoSettings.EnableCssBundling; + model.SeoSettings.TwitterMetaTags = seoSettings.TwitterMetaTags; + model.SeoSettings.OpenGraphMetaTags = seoSettings.OpenGraphMetaTags; + model.SeoSettings.CustomHeadTags = seoSettings.CustomHeadTags; + //override settings + if (storeScope > 0) + { + model.SeoSettings.PageTitleSeparator_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.PageTitleSeparator, storeScope); + model.SeoSettings.PageTitleSeoAdjustment_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.PageTitleSeoAdjustment, storeScope); + model.SeoSettings.DefaultTitle_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultTitle, storeScope); + model.SeoSettings.DefaultMetaKeywords_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultMetaKeywords, storeScope); + model.SeoSettings.DefaultMetaDescription_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.DefaultMetaDescription, storeScope); + model.SeoSettings.GenerateProductMetaDescription_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.GenerateProductMetaDescription, storeScope); + model.SeoSettings.ConvertNonWesternChars_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.ConvertNonWesternChars, storeScope); + model.SeoSettings.CanonicalUrlsEnabled_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.CanonicalUrlsEnabled, storeScope); + model.SeoSettings.WwwRequirement_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.WwwRequirement, storeScope); + model.SeoSettings.EnableJsBundling_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.EnableJsBundling, storeScope); + model.SeoSettings.EnableCssBundling_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.EnableCssBundling, storeScope); + model.SeoSettings.TwitterMetaTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.TwitterMetaTags, storeScope); + model.SeoSettings.OpenGraphMetaTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.OpenGraphMetaTags, storeScope); + model.SeoSettings.CustomHeadTags_OverrideForStore = _settingService.SettingExists(seoSettings, x => x.CustomHeadTags, storeScope); + } + + //security settings + var securitySettings = _settingService.LoadSetting(storeScope); + model.SecuritySettings.EncryptionKey = securitySettings.EncryptionKey; + if (securitySettings.AdminAreaAllowedIpAddresses != null) + for (int i = 0; i < securitySettings.AdminAreaAllowedIpAddresses.Count; i++) + { + model.SecuritySettings.AdminAreaAllowedIpAddresses += securitySettings.AdminAreaAllowedIpAddresses[i]; + if (i != securitySettings.AdminAreaAllowedIpAddresses.Count - 1) + model.SecuritySettings.AdminAreaAllowedIpAddresses += ","; + } + model.SecuritySettings.ForceSslForAllPages = securitySettings.ForceSslForAllPages; + model.SecuritySettings.EnableXsrfProtectionForAdminArea = securitySettings.EnableXsrfProtectionForAdminArea; + model.SecuritySettings.EnableXsrfProtectionForPublicStore = securitySettings.EnableXsrfProtectionForPublicStore; + model.SecuritySettings.HoneypotEnabled = securitySettings.HoneypotEnabled; + + var captchaSettings = _settingService.LoadSetting(storeScope); + model.CaptchaSettings = captchaSettings.ToModel(); + model.CaptchaSettings.AvailableReCaptchaVersions = ReCaptchaVersion.Version1.ToSelectList(false).ToList(); + + //PDF settings + var pdfSettings = _settingService.LoadSetting(storeScope); + model.PdfSettings.LetterPageSizeEnabled = pdfSettings.LetterPageSizeEnabled; + model.PdfSettings.LogoPictureId = pdfSettings.LogoPictureId; + model.PdfSettings.DisablePdfInvoicesForPendingOrders = pdfSettings.DisablePdfInvoicesForPendingOrders; + model.PdfSettings.InvoiceFooterTextColumn1 = pdfSettings.InvoiceFooterTextColumn1; + model.PdfSettings.InvoiceFooterTextColumn2 = pdfSettings.InvoiceFooterTextColumn2; + //override settings + if (storeScope > 0) + { + model.PdfSettings.LetterPageSizeEnabled_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.LetterPageSizeEnabled, storeScope); + model.PdfSettings.LogoPictureId_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.LogoPictureId, storeScope); + model.PdfSettings.DisablePdfInvoicesForPendingOrders_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.DisablePdfInvoicesForPendingOrders, storeScope); + model.PdfSettings.InvoiceFooterTextColumn1_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.InvoiceFooterTextColumn1, storeScope); + model.PdfSettings.InvoiceFooterTextColumn2_OverrideForStore = _settingService.SettingExists(pdfSettings, x => x.InvoiceFooterTextColumn2, storeScope); + } + + //localization + var localizationSettings = _settingService.LoadSetting(storeScope); + model.LocalizationSettings.UseImagesForLanguageSelection = localizationSettings.UseImagesForLanguageSelection; + model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled = localizationSettings.SeoFriendlyUrlsForLanguagesEnabled; + model.LocalizationSettings.AutomaticallyDetectLanguage = localizationSettings.AutomaticallyDetectLanguage; + model.LocalizationSettings.LoadAllLocaleRecordsOnStartup = localizationSettings.LoadAllLocaleRecordsOnStartup; + model.LocalizationSettings.LoadAllLocalizedPropertiesOnStartup = localizationSettings.LoadAllLocalizedPropertiesOnStartup; + model.LocalizationSettings.LoadAllUrlRecordsOnStartup = localizationSettings.LoadAllUrlRecordsOnStartup; + + //full-text support + model.FullTextSettings.Supported = _fulltextService.IsFullTextSupported(); + model.FullTextSettings.Enabled = commonSettings.UseFullTextSearch; + model.FullTextSettings.SearchMode = (int)commonSettings.FullTextMode; + model.FullTextSettings.SearchModeValues = commonSettings.FullTextMode.ToSelectList(); + + //display default menu item + var displayDefaultMenuItemSettings = _settingService.LoadSetting(storeScope); + model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem = displayDefaultMenuItemSettings.DisplayHomePageMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem = displayDefaultMenuItemSettings.DisplayNewProductsMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem = displayDefaultMenuItemSettings.DisplayProductSearchMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem = displayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem = displayDefaultMenuItemSettings.DisplayBlogMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem = displayDefaultMenuItemSettings.DisplayForumsMenuItem; + model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem = displayDefaultMenuItemSettings.DisplayContactUsMenuItem; + + model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayHomePageMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayNewProductsMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayProductSearchMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayCustomerInfoMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayBlogMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayForumsMenuItem, storeScope); + model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem_OverrideForStore = _settingService.SettingExists(displayDefaultMenuItemSettings, x => x.DisplayContactUsMenuItem, storeScope); + + + return View(model); + } + [HttpPost] + [FormValueRequired("save")] + public virtual ActionResult GeneralCommon(GeneralCommonSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + + //load settings for a chosen store scope + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + + //store information settings + var storeInformationSettings = _settingService.LoadSetting(storeScope); + var commonSettings = _settingService.LoadSetting(storeScope); + storeInformationSettings.StoreClosed = model.StoreInformationSettings.StoreClosed; + storeInformationSettings.DefaultStoreTheme = model.StoreInformationSettings.DefaultStoreTheme; + storeInformationSettings.AllowCustomerToSelectTheme = model.StoreInformationSettings.AllowCustomerToSelectTheme; + storeInformationSettings.LogoPictureId = model.StoreInformationSettings.LogoPictureId; + //EU Cookie law + storeInformationSettings.DisplayEuCookieLawWarning = model.StoreInformationSettings.DisplayEuCookieLawWarning; + //social pages + storeInformationSettings.FacebookLink = model.StoreInformationSettings.FacebookLink; + storeInformationSettings.TwitterLink = model.StoreInformationSettings.TwitterLink; + storeInformationSettings.YoutubeLink = model.StoreInformationSettings.YoutubeLink; + storeInformationSettings.GooglePlusLink = model.StoreInformationSettings.GooglePlusLink; + //contact us + commonSettings.SubjectFieldOnContactUsForm = model.StoreInformationSettings.SubjectFieldOnContactUsForm; + commonSettings.UseSystemEmailForContactUsForm = model.StoreInformationSettings.UseSystemEmailForContactUsForm; + //sitemap + commonSettings.SitemapEnabled = model.StoreInformationSettings.SitemapEnabled; + commonSettings.SitemapIncludeCategories = model.StoreInformationSettings.SitemapIncludeCategories; + commonSettings.SitemapIncludeManufacturers = model.StoreInformationSettings.SitemapIncludeManufacturers; + commonSettings.SitemapIncludeProducts = model.StoreInformationSettings.SitemapIncludeProducts; + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.StoreClosed, model.StoreInformationSettings.StoreClosed_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.DefaultStoreTheme, model.StoreInformationSettings.DefaultStoreTheme_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.AllowCustomerToSelectTheme, model.StoreInformationSettings.AllowCustomerToSelectTheme_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.LogoPictureId, model.StoreInformationSettings.LogoPictureId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.DisplayEuCookieLawWarning, model.StoreInformationSettings.DisplayEuCookieLawWarning_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.FacebookLink, model.StoreInformationSettings.FacebookLink_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.TwitterLink, model.StoreInformationSettings.TwitterLink_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.YoutubeLink, model.StoreInformationSettings.YoutubeLink_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(storeInformationSettings, x => x.GooglePlusLink, model.StoreInformationSettings.GooglePlusLink_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SubjectFieldOnContactUsForm, model.StoreInformationSettings.SubjectFieldOnContactUsForm_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.UseSystemEmailForContactUsForm, model.StoreInformationSettings.UseSystemEmailForContactUsForm_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapEnabled, model.StoreInformationSettings.SitemapEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeCategories, model.StoreInformationSettings.SitemapIncludeCategories_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeManufacturers, model.StoreInformationSettings.SitemapIncludeManufacturers_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(commonSettings, x => x.SitemapIncludeProducts, model.StoreInformationSettings.SitemapIncludeProducts_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + + + //seo settings + var seoSettings = _settingService.LoadSetting(storeScope); + seoSettings.PageTitleSeparator = model.SeoSettings.PageTitleSeparator; + seoSettings.PageTitleSeoAdjustment = (PageTitleSeoAdjustment)model.SeoSettings.PageTitleSeoAdjustment; + seoSettings.DefaultTitle = model.SeoSettings.DefaultTitle; + seoSettings.DefaultMetaKeywords = model.SeoSettings.DefaultMetaKeywords; + seoSettings.DefaultMetaDescription = model.SeoSettings.DefaultMetaDescription; + seoSettings.GenerateProductMetaDescription = model.SeoSettings.GenerateProductMetaDescription; + seoSettings.ConvertNonWesternChars = model.SeoSettings.ConvertNonWesternChars; + seoSettings.CanonicalUrlsEnabled = model.SeoSettings.CanonicalUrlsEnabled; + seoSettings.WwwRequirement = (WwwRequirement)model.SeoSettings.WwwRequirement; + seoSettings.EnableJsBundling = model.SeoSettings.EnableJsBundling; + seoSettings.EnableCssBundling = model.SeoSettings.EnableCssBundling; + seoSettings.TwitterMetaTags = model.SeoSettings.TwitterMetaTags; + seoSettings.OpenGraphMetaTags = model.SeoSettings.OpenGraphMetaTags; + seoSettings.CustomHeadTags = model.SeoSettings.CustomHeadTags; + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.PageTitleSeparator, model.SeoSettings.PageTitleSeparator_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.PageTitleSeoAdjustment, model.SeoSettings.PageTitleSeoAdjustment_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultTitle, model.SeoSettings.DefaultTitle_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultMetaKeywords, model.SeoSettings.DefaultMetaKeywords_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.DefaultMetaDescription, model.SeoSettings.DefaultMetaDescription_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.GenerateProductMetaDescription, model.SeoSettings.GenerateProductMetaDescription_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.ConvertNonWesternChars, model.SeoSettings.ConvertNonWesternChars_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.CanonicalUrlsEnabled, model.SeoSettings.CanonicalUrlsEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.WwwRequirement, model.SeoSettings.WwwRequirement_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.EnableJsBundling, model.SeoSettings.EnableJsBundling_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.EnableCssBundling, model.SeoSettings.EnableCssBundling_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.TwitterMetaTags, model.SeoSettings.TwitterMetaTags_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.OpenGraphMetaTags, model.SeoSettings.OpenGraphMetaTags_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(seoSettings, x => x.CustomHeadTags, model.SeoSettings.CustomHeadTags_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + + + //security settings + var securitySettings = _settingService.LoadSetting(storeScope); + if (securitySettings.AdminAreaAllowedIpAddresses == null) + securitySettings.AdminAreaAllowedIpAddresses = new List(); + securitySettings.AdminAreaAllowedIpAddresses.Clear(); + if (!String.IsNullOrEmpty(model.SecuritySettings.AdminAreaAllowedIpAddresses)) + foreach (string s in model.SecuritySettings.AdminAreaAllowedIpAddresses.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)) + if (!String.IsNullOrWhiteSpace(s)) + securitySettings.AdminAreaAllowedIpAddresses.Add(s.Trim()); + securitySettings.ForceSslForAllPages = model.SecuritySettings.ForceSslForAllPages; + securitySettings.EnableXsrfProtectionForAdminArea = model.SecuritySettings.EnableXsrfProtectionForAdminArea; + securitySettings.EnableXsrfProtectionForPublicStore = model.SecuritySettings.EnableXsrfProtectionForPublicStore; + securitySettings.HoneypotEnabled = model.SecuritySettings.HoneypotEnabled; + _settingService.SaveSetting(securitySettings); + + //captcha settings + var captchaSettings = _settingService.LoadSetting(storeScope); + captchaSettings = model.CaptchaSettings.ToEntity(captchaSettings); + _settingService.SaveSetting(captchaSettings); + if (captchaSettings.Enabled && + (String.IsNullOrWhiteSpace(captchaSettings.ReCaptchaPublicKey) || String.IsNullOrWhiteSpace(captchaSettings.ReCaptchaPrivateKey))) + { + //captcha is enabled but the keys are not entered + ErrorNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.CaptchaAppropriateKeysNotEnteredError")); + } + + //PDF settings + var pdfSettings = _settingService.LoadSetting(storeScope); + pdfSettings.LetterPageSizeEnabled = model.PdfSettings.LetterPageSizeEnabled; + pdfSettings.LogoPictureId = model.PdfSettings.LogoPictureId; + pdfSettings.DisablePdfInvoicesForPendingOrders = model.PdfSettings.DisablePdfInvoicesForPendingOrders; + pdfSettings.InvoiceFooterTextColumn1 = model.PdfSettings.InvoiceFooterTextColumn1; + pdfSettings.InvoiceFooterTextColumn2 = model.PdfSettings.InvoiceFooterTextColumn2; + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + + _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.LetterPageSizeEnabled, model.PdfSettings.LetterPageSizeEnabled_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.LogoPictureId, model.PdfSettings.LogoPictureId_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.DisablePdfInvoicesForPendingOrders, model.PdfSettings.DisablePdfInvoicesForPendingOrders_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.InvoiceFooterTextColumn1, model.PdfSettings.InvoiceFooterTextColumn1_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(pdfSettings, x => x.InvoiceFooterTextColumn2, model.PdfSettings.InvoiceFooterTextColumn2_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + + + + //localization settings + var localizationSettings = _settingService.LoadSetting(storeScope); + localizationSettings.UseImagesForLanguageSelection = model.LocalizationSettings.UseImagesForLanguageSelection; + if (localizationSettings.SeoFriendlyUrlsForLanguagesEnabled != model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled) + { + localizationSettings.SeoFriendlyUrlsForLanguagesEnabled = model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled; + //clear cached values of routes + System.Web.Routing.RouteTable.Routes.ClearSeoFriendlyUrlsCachedValueForRoutes(); + } + localizationSettings.AutomaticallyDetectLanguage = model.LocalizationSettings.AutomaticallyDetectLanguage; + localizationSettings.LoadAllLocaleRecordsOnStartup = model.LocalizationSettings.LoadAllLocaleRecordsOnStartup; + localizationSettings.LoadAllLocalizedPropertiesOnStartup = model.LocalizationSettings.LoadAllLocalizedPropertiesOnStartup; + localizationSettings.LoadAllUrlRecordsOnStartup = model.LocalizationSettings.LoadAllUrlRecordsOnStartup; + _settingService.SaveSetting(localizationSettings); + + //full-text + commonSettings.FullTextMode = (FulltextSearchMode)model.FullTextSettings.SearchMode; + _settingService.SaveSetting(commonSettings); + + //display default menu item + var displayDefaultMenuItemSettings = _settingService.LoadSetting(storeScope); + + /* We do not clear cache after each setting update. + * This behavior can increase performance because cached settings will not be cleared + * and loaded from database after each update */ + displayDefaultMenuItemSettings.DisplayHomePageMenuItem = model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem; + displayDefaultMenuItemSettings.DisplayNewProductsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem; + displayDefaultMenuItemSettings.DisplayProductSearchMenuItem = model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem; + displayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem = model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem; + displayDefaultMenuItemSettings.DisplayBlogMenuItem = model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem; + displayDefaultMenuItemSettings.DisplayForumsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem; + displayDefaultMenuItemSettings.DisplayContactUsMenuItem = model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem; + + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayHomePageMenuItem, model.DisplayDefaultMenuItemSettings.DisplayHomePageMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayNewProductsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayNewProductsMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayProductSearchMenuItem, model.DisplayDefaultMenuItemSettings.DisplayProductSearchMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayCustomerInfoMenuItem, model.DisplayDefaultMenuItemSettings.DisplayCustomerInfoMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayBlogMenuItem, model.DisplayDefaultMenuItemSettings.DisplayBlogMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayForumsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayForumsMenuItem_OverrideForStore, storeScope, false); + _settingService.SaveSettingOverridablePerStore(displayDefaultMenuItemSettings, x => x.DisplayContactUsMenuItem, model.DisplayDefaultMenuItemSettings.DisplayContactUsMenuItem_OverrideForStore, storeScope, false); + + //now clear settings cache + _settingService.ClearCache(); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Updated")); + + return RedirectToAction("GeneralCommon"); + } + [HttpPost, ActionName("GeneralCommon")] + [FormValueRequired("changeencryptionkey")] + public virtual ActionResult ChangeEncryptionKey(GeneralCommonSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + //set page timeout to 5 minutes + this.Server.ScriptTimeout = 300; + + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var securitySettings = _settingService.LoadSetting(storeScope); + + try + { + if (model.SecuritySettings.EncryptionKey == null) + model.SecuritySettings.EncryptionKey = ""; + + model.SecuritySettings.EncryptionKey = model.SecuritySettings.EncryptionKey.Trim(); + + var newEncryptionPrivateKey = model.SecuritySettings.EncryptionKey; + if (String.IsNullOrEmpty(newEncryptionPrivateKey) || newEncryptionPrivateKey.Length != 16) + throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.TooShort")); + + string oldEncryptionPrivateKey = securitySettings.EncryptionKey; + if (oldEncryptionPrivateKey == newEncryptionPrivateKey) + throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.TheSame")); + + //update encrypted order info + var orders = _orderService.SearchOrders(); + foreach (var order in orders) + { + string decryptedCardType = _encryptionService.DecryptText(order.CardType, oldEncryptionPrivateKey); + string decryptedCardName = _encryptionService.DecryptText(order.CardName, oldEncryptionPrivateKey); + string decryptedCardNumber = _encryptionService.DecryptText(order.CardNumber, oldEncryptionPrivateKey); + string decryptedMaskedCreditCardNumber = _encryptionService.DecryptText(order.MaskedCreditCardNumber, oldEncryptionPrivateKey); + string decryptedCardCvv2 = _encryptionService.DecryptText(order.CardCvv2, oldEncryptionPrivateKey); + string decryptedCardExpirationMonth = _encryptionService.DecryptText(order.CardExpirationMonth, oldEncryptionPrivateKey); + string decryptedCardExpirationYear = _encryptionService.DecryptText(order.CardExpirationYear, oldEncryptionPrivateKey); + + string encryptedCardType = _encryptionService.EncryptText(decryptedCardType, newEncryptionPrivateKey); + string encryptedCardName = _encryptionService.EncryptText(decryptedCardName, newEncryptionPrivateKey); + string encryptedCardNumber = _encryptionService.EncryptText(decryptedCardNumber, newEncryptionPrivateKey); + string encryptedMaskedCreditCardNumber = _encryptionService.EncryptText(decryptedMaskedCreditCardNumber, newEncryptionPrivateKey); + string encryptedCardCvv2 = _encryptionService.EncryptText(decryptedCardCvv2, newEncryptionPrivateKey); + string encryptedCardExpirationMonth = _encryptionService.EncryptText(decryptedCardExpirationMonth, newEncryptionPrivateKey); + string encryptedCardExpirationYear = _encryptionService.EncryptText(decryptedCardExpirationYear, newEncryptionPrivateKey); + + order.CardType = encryptedCardType; + order.CardName = encryptedCardName; + order.CardNumber = encryptedCardNumber; + order.MaskedCreditCardNumber = encryptedMaskedCreditCardNumber; + order.CardCvv2 = encryptedCardCvv2; + order.CardExpirationMonth = encryptedCardExpirationMonth; + order.CardExpirationYear = encryptedCardExpirationYear; + _orderService.UpdateOrder(order); + } + + //update password information + //optimization - load only passwords with PasswordFormat.Encrypted + var customerPasswords = _customerService.GetCustomerPasswords(passwordFormat: PasswordFormat.Encrypted); + foreach (var customerPassword in customerPasswords) + { + var decryptedPassword = _encryptionService.DecryptText(customerPassword.Password, oldEncryptionPrivateKey); + var encryptedPassword = _encryptionService.EncryptText(decryptedPassword, newEncryptionPrivateKey); + + customerPassword.Password = encryptedPassword; + _customerService.UpdateCustomerPassword(customerPassword); + } + + securitySettings.EncryptionKey = newEncryptionPrivateKey; + _settingService.SaveSetting(securitySettings); + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.EncryptionKey.Changed")); + } + catch (Exception exc) + { + ErrorNotification(exc); + } + return RedirectToAction("GeneralCommon"); + } + [HttpPost, ActionName("GeneralCommon")] + [FormValueRequired("togglefulltext")] + public virtual ActionResult ToggleFullText(GeneralCommonSettingsModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); + var commonSettings = _settingService.LoadSetting(storeScope); + try + { + if (! _fulltextService.IsFullTextSupported()) + throw new NopException(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.NotSupported")); + + if (commonSettings.UseFullTextSearch) + { + _fulltextService.DisableFullText(); + + commonSettings.UseFullTextSearch = false; + _settingService.SaveSetting(commonSettings); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Disabled")); + } + else + { + _fulltextService.EnableFullText(); + + commonSettings.UseFullTextSearch = true; + _settingService.SaveSetting(commonSettings); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.FullTextSettings.Enabled")); + } + } + catch (Exception exc) + { + ErrorNotification(exc); + } + + return RedirectToAction("GeneralCommon"); + } + + + + + //all settings + public virtual ActionResult AllSettings() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + return View(); + } + [HttpPost] + //do not validate request token (XSRF) + //for some reasons it does not work with "filtering" support + [AdminAntiForgery(true)] + public virtual ActionResult AllSettings(DataSourceRequest command, AllSettingsListModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedKendoGridJson(); + + var query = _settingService.GetAllSettings().AsQueryable(); + + if (!string.IsNullOrEmpty(model.SearchSettingName)) + query = query.Where(s => s.Name.ToLowerInvariant().Contains(model.SearchSettingName.ToLowerInvariant())); + if (!string.IsNullOrEmpty(model.SearchSettingValue)) + query = query.Where(s => s.Value.ToLowerInvariant().Contains(model.SearchSettingValue.ToLowerInvariant())); + + var settings = query.ToList() + .Select(x => + { + string storeName; + if (x.StoreId == 0) + { + storeName = _localizationService.GetResource("Admin.Configuration.Settings.AllSettings.Fields.StoreName.AllStores"); + } + else + { + var store = _storeService.GetStoreById(x.StoreId); + storeName = store != null ? store.Name : "Unknown"; + } + var settingModel = new SettingModel + { + Id = x.Id, + Name = x.Name, + Value = x.Value, + Store = storeName, + StoreId = x.StoreId + }; + return settingModel; + }) + .AsQueryable(); + + var gridModel = new DataSourceResult + { + Data = settings.PagedForCommand(command).ToList(), + Total = settings.Count() + }; + + return Json(gridModel); + } + [HttpPost] + public virtual ActionResult SettingUpdate(SettingModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (model.Name != null) + model.Name = model.Name.Trim(); + if (model.Value != null) + model.Value = model.Value.Trim(); + + if (!ModelState.IsValid) + { + return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); + } + + var setting = _settingService.GetSettingById(model.Id); + if (setting == null) + return Content("No setting could be loaded with the specified ID"); + + var storeId = model.StoreId; + + if (!setting.Name.Equals(model.Name, StringComparison.InvariantCultureIgnoreCase) || + setting.StoreId != storeId) + { + //setting name or store has been changed + _settingService.DeleteSetting(setting); + } + + _settingService.SetSetting(model.Name, model.Value, storeId); + + //activity log + _customerActivityService.InsertActivity("EditSettings", _localizationService.GetResource("ActivityLog.EditSettings")); + + return new NullJsonResult(); + } + [HttpPost] + public virtual ActionResult SettingAdd([Bind(Exclude = "Id")] SettingModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + if (model.Name != null) + model.Name = model.Name.Trim(); + if (model.Value != null) + model.Value = model.Value.Trim(); + + if (!ModelState.IsValid) + { + return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); + } + var storeId = model.StoreId; + _settingService.SetSetting(model.Name, model.Value, storeId); + + //activity log + _customerActivityService.InsertActivity("AddNewSetting", _localizationService.GetResource("ActivityLog.AddNewSetting"), model.Name); + + return new NullJsonResult(); + } + [HttpPost] + public virtual ActionResult SettingDelete(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings)) + return AccessDeniedView(); + + var setting = _settingService.GetSettingById(id); + if (setting == null) + throw new ArgumentException("No setting found with the specified id"); + _settingService.DeleteSetting(setting); + + //activity log + _customerActivityService.InsertActivity("DeleteSetting", _localizationService.GetResource("ActivityLog.DeleteSetting"), setting.Name); + + return new NullJsonResult(); + } + + //action displaying notification (warning) to a store owner about a lot of traffic + //between the Redis server and the application when LoadAllLocaleRecordsOnStartup seetting is set + [ValidateInput(false)] + public ActionResult RedisCacheHighTrafficWarning(bool loadAllLocaleRecordsOnStartup) + { + //LoadAllLocaleRecordsOnStartup is set and Redis cache is used, so display warning + if (_config.RedisCachingEnabled && loadAllLocaleRecordsOnStartup) + return Json(new { Result = _localizationService.GetResource("Admin.Configuration.Settings.GeneralCommon.LoadAllLocaleRecordsOnStartup.Warning") }, JsonRequestBehavior.AllowGet); + + return Json(new { Result = string.Empty }, JsonRequestBehavior.AllowGet); + } + + #endregion + } +} diff --git a/src/Presentation/Nop.Web/Administration/Controllers/ShippingController.cs b/src/Presentation/Nop.Web/Administration/Controllers/ShippingController.cs index a5ba1ec10b6..97f9e2a6256 100644 --- a/src/Presentation/Nop.Web/Administration/Controllers/ShippingController.cs +++ b/src/Presentation/Nop.Web/Administration/Controllers/ShippingController.cs @@ -1,1001 +1,1003 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Nop.Admin.Extensions; -using Nop.Admin.Models.Directory; -using Nop.Admin.Models.Shipping; -using Nop.Core; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Shipping; -using Nop.Core.Plugins; -using Nop.Services.Common; -using Nop.Services.Configuration; -using Nop.Services.Directory; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Security; -using Nop.Services.Shipping; -using Nop.Services.Shipping.Date; -using Nop.Web.Framework.Controllers; -using Nop.Web.Framework.Kendoui; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Controllers -{ - public partial class ShippingController : BaseAdminController - { - #region Fields - - private readonly IShippingService _shippingService; - private readonly ShippingSettings _shippingSettings; - private readonly ISettingService _settingService; - private readonly IAddressService _addressService; - private readonly ICountryService _countryService; - private readonly IStateProvinceService _stateProvinceService; - private readonly ILocalizationService _localizationService; - private readonly IPermissionService _permissionService; - private readonly ILocalizedEntityService _localizedEntityService; - private readonly ILanguageService _languageService; - private readonly IDateRangeService _dateRangeService; - private readonly IPluginFinder _pluginFinder; - private readonly IWebHelper _webHelper; - private readonly ICustomerActivityService _customerActivityService; - - #endregion - - #region Ctor - - public ShippingController(IShippingService shippingService, - ShippingSettings shippingSettings, - ISettingService settingService, - IAddressService addressService, - ICountryService countryService, - IStateProvinceService stateProvinceService, - ILocalizationService localizationService, - IPermissionService permissionService, - ILocalizedEntityService localizedEntityService, - ILanguageService languageService, - IDateRangeService dateRangeService, - IPluginFinder pluginFinder, - IWebHelper webHelper, - ICustomerActivityService customerActivityService) - { - this._shippingService = shippingService; - this._shippingSettings = shippingSettings; - this._settingService = settingService; - this._addressService = addressService; - this._countryService = countryService; - this._stateProvinceService = stateProvinceService; - this._localizationService = localizationService; - this._permissionService = permissionService; - this._localizedEntityService = localizedEntityService; - this._languageService = languageService; - this._dateRangeService = dateRangeService; - this._pluginFinder = pluginFinder; - this._webHelper = webHelper; - this._customerActivityService = customerActivityService; - } - - #endregion  - - #region Utilities - - [NonAction] - protected virtual void UpdateLocales(ShippingMethod shippingMethod, ShippingMethodModel model) - { - foreach (var localized in model.Locales) - { - _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Name, localized.Name, localized.LanguageId); - _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Description, localized.Description, localized.LanguageId); - } - } - - [NonAction] - protected virtual void UpdateLocales(DeliveryDate deliveryDate, DeliveryDateModel model) - { - foreach (var localized in model.Locales) - { - _localizedEntityService.SaveLocalizedValue(deliveryDate, x => x.Name, localized.Name, localized.LanguageId); - } - } - - [NonAction] - protected virtual void UpdateLocales(ProductAvailabilityRange productAvailabilityRange, ProductAvailabilityRangeModel model) - { - foreach (var localized in model.Locales) - { - _localizedEntityService.SaveLocalizedValue(productAvailabilityRange, x => x.Name, localized.Name, localized.LanguageId); - } - } - - #endregion - - #region Shipping rate computation methods - - public virtual ActionResult Providers() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - return View(); - } - - [HttpPost] - public virtual ActionResult Providers(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var shippingProvidersModel = new List(); - var shippingProviders = _shippingService.LoadAllShippingRateComputationMethods(); - foreach (var shippingProvider in shippingProviders) - { - var tmp1 = shippingProvider.ToModel(); - tmp1.IsActive = shippingProvider.IsShippingRateComputationMethodActive(_shippingSettings); - tmp1.LogoUrl = shippingProvider.PluginDescriptor.GetLogoUrl(_webHelper); - shippingProvidersModel.Add(tmp1); - } - shippingProvidersModel = shippingProvidersModel.ToList(); - var gridModel = new DataSourceResult - { - Data = shippingProvidersModel, - Total = shippingProvidersModel.Count() - }; - - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult ProviderUpdate([Bind(Exclude = "ConfigurationRouteValues")] ShippingRateComputationMethodModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var srcm = _shippingService.LoadShippingRateComputationMethodBySystemName(model.SystemName); - if (srcm.IsShippingRateComputationMethodActive(_shippingSettings)) - { - if (!model.IsActive) - { - //mark as disabled - _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Remove(srcm.PluginDescriptor.SystemName); - _settingService.SaveSetting(_shippingSettings); - } - } - else - { - if (model.IsActive) - { - //mark as active - _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add(srcm.PluginDescriptor.SystemName); - _settingService.SaveSetting(_shippingSettings); - } - } - var pluginDescriptor = srcm.PluginDescriptor; - //display order - pluginDescriptor.DisplayOrder = model.DisplayOrder; - PluginFileParser.SavePluginDescriptionFile(pluginDescriptor); - //reset plugin cache - _pluginFinder.ReloadPlugins(); - - return new NullJsonResult(); - } - - public virtual ActionResult ConfigureProvider(string systemName) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var srcm = _shippingService.LoadShippingRateComputationMethodBySystemName(systemName); - if (srcm == null) - //No shipping rate computation method found with the specified id - return RedirectToAction("Providers"); - - var model = srcm.ToModel(); - string actionName, controllerName; - RouteValueDictionary routeValues; - srcm.GetConfigurationRoute(out actionName, out controllerName, out routeValues); - model.ConfigurationActionName = actionName; - model.ConfigurationControllerName = controllerName; - model.ConfigurationRouteValues = routeValues; - return View(model); - } - - #endregion - - #region Pickup point providers - - public virtual ActionResult PickupPointProviders() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - return View(); - } - - [HttpPost] - public virtual ActionResult PickupPointProviders(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var pickupPointProviderModel = new List(); - var allProviders = _shippingService.LoadAllPickupPointProviders(); - foreach (var provider in allProviders) - { - var model = provider.ToModel(); - model.IsActive = provider.IsPickupPointProviderActive(_shippingSettings); - model.LogoUrl = provider.PluginDescriptor.GetLogoUrl(_webHelper); - pickupPointProviderModel.Add(model); - } - - var gridModel = new DataSourceResult - { - Data = pickupPointProviderModel, - Total = pickupPointProviderModel.Count - }; - - return Json(gridModel); - } - - [HttpPost] - public virtual ActionResult PickupPointProviderUpdate([Bind(Exclude = "ConfigurationRouteValues")] PickupPointProviderModel model) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var pickupPointProvider = _shippingService.LoadPickupPointProviderBySystemName(model.SystemName); - if (pickupPointProvider.IsPickupPointProviderActive(_shippingSettings)) - { - if (!model.IsActive) - { - //mark as disabled - _shippingSettings.ActivePickupPointProviderSystemNames.Remove(pickupPointProvider.PluginDescriptor.SystemName); - _settingService.SaveSetting(_shippingSettings); - } - } - else - { - if (model.IsActive) - { - //mark as active - _shippingSettings.ActivePickupPointProviderSystemNames.Add(pickupPointProvider.PluginDescriptor.SystemName); - _settingService.SaveSetting(_shippingSettings); - } - } - var pluginDescriptor = pickupPointProvider.PluginDescriptor; - pluginDescriptor.DisplayOrder = model.DisplayOrder; - PluginFileParser.SavePluginDescriptionFile(pluginDescriptor); - //reset plugin cache - _pluginFinder.ReloadPlugins(); - - return new NullJsonResult(); - } - - public virtual ActionResult ConfigurePickupPointProvider(string systemName) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var pickupPointProvider = _shippingService.LoadPickupPointProviderBySystemName(systemName); - if (pickupPointProvider == null) - return RedirectToAction("PickupPointProviders"); - - var model = pickupPointProvider.ToModel(); - string actionName; - string controllerName; - RouteValueDictionary routeValues; - pickupPointProvider.GetConfigurationRoute(out actionName, out controllerName, out routeValues); - model.ConfigurationActionName = actionName; - model.ConfigurationControllerName = controllerName; - model.ConfigurationRouteValues = routeValues; - return View(model); - } - - #endregion - - #region Shipping methods - - public virtual ActionResult Methods() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - return View(); - } - - [HttpPost] - public virtual ActionResult Methods(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var shippingMethodsModel = _shippingService.GetAllShippingMethods() - .Select(x => x.ToModel()) - .ToList(); - var gridModel = new DataSourceResult - { - Data = shippingMethodsModel, - Total = shippingMethodsModel.Count - }; - - return Json(gridModel); - } - - - public virtual ActionResult CreateMethod() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var model = new ShippingMethodModel(); - //locales - AddLocales(_languageService, model.Locales); - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult CreateMethod(ShippingMethodModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var sm = model.ToEntity(); - _shippingService.InsertShippingMethod(sm); - //locales - UpdateLocales(sm, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Added")); - return continueEditing ? RedirectToAction("EditMethod", new { id = sm.Id }) : RedirectToAction("Methods"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - - public virtual ActionResult EditMethod(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var sm = _shippingService.GetShippingMethodById(id); - if (sm == null) - //No shipping method found with the specified id - return RedirectToAction("Methods"); - - var model = sm.ToModel(); - //locales - AddLocales(_languageService, model.Locales, (locale, languageId) => - { - locale.Name = sm.GetLocalized(x => x.Name, languageId, false, false); - locale.Description = sm.GetLocalized(x => x.Description, languageId, false, false); - }); - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult EditMethod(ShippingMethodModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var sm = _shippingService.GetShippingMethodById(model.Id); - if (sm == null) - //No shipping method found with the specified id - return RedirectToAction("Methods"); - - if (ModelState.IsValid) - { - sm = model.ToEntity(sm); - _shippingService.UpdateShippingMethod(sm); - //locales - UpdateLocales(sm, model); - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Updated")); - return continueEditing ? RedirectToAction("EditMethod", sm.Id) : RedirectToAction("Methods"); - } - - - //If we got this far, something failed, redisplay form - return View(model); - } - - [HttpPost] - public virtual ActionResult DeleteMethod(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var sm = _shippingService.GetShippingMethodById(id); - if (sm == null) - //No shipping method found with the specified id - return RedirectToAction("Methods"); - - _shippingService.DeleteShippingMethod(sm); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Deleted")); - return RedirectToAction("Methods"); - } - - #endregion - - #region Dates and ranges - - public virtual ActionResult DatesAndRanges() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - return View(); - } - - #region Delivery dates - - [HttpPost] - public virtual ActionResult DeliveryDates(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var deliveryDatesModel = _dateRangeService.GetAllDeliveryDates().Select(x => x.ToModel()).ToList(); - var gridModel = new DataSourceResult - { - Data = deliveryDatesModel, - Total = deliveryDatesModel.Count - }; - - return Json(gridModel); - } - - - public virtual ActionResult CreateDeliveryDate() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var model = new DeliveryDateModel(); - - //locales - AddLocales(_languageService, model.Locales); - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult CreateDeliveryDate(DeliveryDateModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var deliveryDate = model.ToEntity(); - _dateRangeService.InsertDeliveryDate(deliveryDate); - - //locales - UpdateLocales(deliveryDate, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Added")); - - return continueEditing ? RedirectToAction("EditDeliveryDate", new { id = deliveryDate.Id }) : RedirectToAction("DatesAndRanges"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - - public virtual ActionResult EditDeliveryDate(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var deliveryDate = _dateRangeService.GetDeliveryDateById(id); - if (deliveryDate == null) - //No delivery date found with the specified id - return RedirectToAction("DatesAndRanges"); - - var model = deliveryDate.ToModel(); - - //locales - AddLocales(_languageService, model.Locales, (locale, languageId) => - { - locale.Name = deliveryDate.GetLocalized(x => x.Name, languageId, false, false); - }); - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult EditDeliveryDate(DeliveryDateModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var deliveryDate = _dateRangeService.GetDeliveryDateById(model.Id); - if (deliveryDate == null) - //No delivery date found with the specified id - return RedirectToAction("DatesAndRanges"); - - if (ModelState.IsValid) - { - deliveryDate = model.ToEntity(deliveryDate); - _dateRangeService.UpdateDeliveryDate(deliveryDate); - - //locales - UpdateLocales(deliveryDate, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Updated")); - - return continueEditing ? RedirectToAction("EditDeliveryDate", deliveryDate.Id) : RedirectToAction("DatesAndRanges"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - - [HttpPost] - public virtual ActionResult DeleteDeliveryDate(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var deliveryDate = _dateRangeService.GetDeliveryDateById(id); - if (deliveryDate == null) - //No delivery date found with the specified id - return RedirectToAction("DatesAndRanges"); - - _dateRangeService.DeleteDeliveryDate(deliveryDate); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Deleted")); - - return RedirectToAction("DatesAndRanges"); - } - - #endregion - - #region Product availability ranges - - [HttpPost] - public virtual ActionResult ProductAvailabilityRanges(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var productAvailabilityRangesModel = _dateRangeService.GetAllProductAvailabilityRanges().Select(range => range.ToModel()).ToList(); - var gridModel = new DataSourceResult - { - Data = productAvailabilityRangesModel, - Total = productAvailabilityRangesModel.Count - }; - - return Json(gridModel); - } - - public virtual ActionResult CreateProductAvailabilityRange() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var model = new ProductAvailabilityRangeModel(); - - //locales - AddLocales(_languageService, model.Locales); - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult CreateProductAvailabilityRange(ProductAvailabilityRangeModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var productAvailabilityRange = model.ToEntity(); - _dateRangeService.InsertProductAvailabilityRange(productAvailabilityRange); - - //locales - UpdateLocales(productAvailabilityRange, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Added")); - - return continueEditing ? RedirectToAction("EditProductAvailabilityRange", new { id = productAvailabilityRange.Id }) : RedirectToAction("DatesAndRanges"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - - public virtual ActionResult EditProductAvailabilityRange(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(id); - if (productAvailabilityRange == null) - //No availability range found with the specified id - return RedirectToAction("DatesAndRanges"); - - var model = productAvailabilityRange.ToModel(); - - //locales - AddLocales(_languageService, model.Locales, (locale, languageId) => - { - locale.Name = productAvailabilityRange.GetLocalized(x => x.Name, languageId, false, false); - }); - - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult EditProductAvailabilityRange(ProductAvailabilityRangeModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(model.Id); - if (productAvailabilityRange == null) - //No availability range found with the specified id - return RedirectToAction("DatesAndRanges"); - - if (ModelState.IsValid) - { - productAvailabilityRange = model.ToEntity(productAvailabilityRange); - _dateRangeService.UpdateProductAvailabilityRange(productAvailabilityRange); - - //locales - UpdateLocales(productAvailabilityRange, model); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Updated")); - - return continueEditing ? RedirectToAction("EditProductAvailabilityRange", productAvailabilityRange.Id) : RedirectToAction("DatesAndRanges"); - } - - //If we got this far, something failed, redisplay form - return View(model); - } - - [HttpPost] - public virtual ActionResult DeleteProductAvailabilityRange(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(id); - if (productAvailabilityRange == null) - //No availability range found with the specified id - return RedirectToAction("DatesAndRanges"); - - _dateRangeService.DeleteProductAvailabilityRange(productAvailabilityRange); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Deleted")); - - return RedirectToAction("DatesAndRanges"); - } - - #endregion - - #endregion - - #region Warehouses - - public virtual ActionResult Warehouses() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - return View(); - } - - [HttpPost] - public virtual ActionResult Warehouses(DataSourceRequest command) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedKendoGridJson(); - - var warehousesModel = _shippingService.GetAllWarehouses() - .Select(x => - { - var warehouseModel = new WarehouseModel - { - Id = x.Id, - Name = x.Name - //ignore address for list view (performance optimization) - }; - return warehouseModel; - }) - .ToList(); - var gridModel = new DataSourceResult - { - Data = warehousesModel, - Total = warehousesModel.Count - }; - - return Json(gridModel); - } - - - public virtual ActionResult CreateWarehouse() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var model = new WarehouseModel(); - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - model.Address.CountryEnabled = true; - model.Address.CountryRequired = true; - model.Address.StateProvinceEnabled = true; - model.Address.CityEnabled = true; - model.Address.StreetAddressEnabled = true; - model.Address.ZipPostalCodeEnabled = true; - model.Address.ZipPostalCodeRequired = true; - model.Address.PhoneEnabled = true; - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult CreateWarehouse(WarehouseModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - if (ModelState.IsValid) - { - var address = model.Address.ToEntity(); - address.CreatedOnUtc = DateTime.UtcNow; - _addressService.InsertAddress(address); - var warehouse = new Warehouse - { - Name = model.Name, - AdminComment = model.AdminComment, - AddressId = address.Id - }; - - _shippingService.InsertWarehouse(warehouse); - - //activity log - _customerActivityService.InsertActivity("AddNewWarehouse", _localizationService.GetResource("ActivityLog.AddNewWarehouse"), warehouse.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Warehouses.Added")); - return continueEditing ? RedirectToAction("EditWarehouse", new { id = warehouse.Id }) : RedirectToAction("Warehouses"); - } - - //If we got this far, something failed, redisplay form - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); - //states - var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - - return View(model); - } - - public virtual ActionResult EditWarehouse(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var warehouse = _shippingService.GetWarehouseById(id); - if (warehouse == null) - //No warehouse found with the specified id - return RedirectToAction("Warehouses"); - - var address = _addressService.GetAddressById(warehouse.AddressId); - var model = new WarehouseModel - { - Id = warehouse.Id, - Name = warehouse.Name, - AdminComment = warehouse.AdminComment - }; - - if (address != null) - { - model.Address = address.ToModel(); - } - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (address != null && c.Id == address.CountryId) }); - //states - var states = address != null && address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - model.Address.CountryEnabled = true; - model.Address.CountryRequired = true; - model.Address.StateProvinceEnabled = true; - model.Address.CityEnabled = true; - model.Address.StreetAddressEnabled = true; - model.Address.ZipPostalCodeEnabled = true; - model.Address.ZipPostalCodeRequired = true; - model.Address.PhoneEnabled = true; - return View(model); - } - - [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] - public virtual ActionResult EditWarehouse(WarehouseModel model, bool continueEditing) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var warehouse = _shippingService.GetWarehouseById(model.Id); - if (warehouse == null) - //No warehouse found with the specified id - return RedirectToAction("Warehouses"); - - if (ModelState.IsValid) - { - var address = _addressService.GetAddressById(warehouse.AddressId) ?? - new Core.Domain.Common.Address - { - CreatedOnUtc = DateTime.UtcNow, - }; - address = model.Address.ToEntity(address); - if (address.Id > 0) - _addressService.UpdateAddress(address); - else - _addressService.InsertAddress(address); - - - warehouse.Name = model.Name; - warehouse.AdminComment = model.AdminComment; - warehouse.AddressId = address.Id; - - _shippingService.UpdateWarehouse(warehouse); - - //activity log - _customerActivityService.InsertActivity("EditWarehouse", _localizationService.GetResource("ActivityLog.EditWarehouse"), warehouse.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Warehouses.Updated")); - return continueEditing ? RedirectToAction("EditWarehouse", warehouse.Id) : RedirectToAction("Warehouses"); - } - - - //If we got this far, something failed, redisplay form - - //countries - model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); - foreach (var c in _countryService.GetAllCountries(showHidden: true)) - model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); - //states - var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); - if (states.Any()) - { - foreach (var s in states) - model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); - } - else - model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); - - return View(model); - } - - [HttpPost] - public virtual ActionResult DeleteWarehouse(int id) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var warehouse = _shippingService.GetWarehouseById(id); - if (warehouse == null) - //No warehouse found with the specified id - return RedirectToAction("Warehouses"); - - _shippingService.DeleteWarehouse(warehouse); - - //activity log - _customerActivityService.InsertActivity("DeleteWarehouse", _localizationService.GetResource("ActivityLog.DeleteWarehouse"), warehouse.Id); - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.warehouses.Deleted")); - return RedirectToAction("Warehouses"); - } - - #endregion - - #region Restrictions - - public virtual ActionResult Restrictions() - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var model = new ShippingMethodRestrictionModel(); - - var countries = _countryService.GetAllCountries(showHidden: true); - var shippingMethods = _shippingService.GetAllShippingMethods(); - foreach (var country in countries) - { - model.AvailableCountries.Add(new CountryModel - { - Id = country.Id, - Name = country.Name - }); - } - foreach (var sm in shippingMethods) - { - model.AvailableShippingMethods.Add(new ShippingMethodModel - { - Id = sm.Id, - Name = sm.Name - }); - } - foreach (var country in countries) - foreach (var shippingMethod in shippingMethods) - { - bool restricted = shippingMethod.CountryRestrictionExists(country.Id); - if (!model.Restricted.ContainsKey(country.Id)) - model.Restricted[country.Id] = new Dictionary(); - model.Restricted[country.Id][shippingMethod.Id] = restricted; - } - - return View(model); - } - - [HttpPost, ActionName("Restrictions")] - public virtual ActionResult RestrictionSave(FormCollection form) - { - if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) - return AccessDeniedView(); - - var countries = _countryService.GetAllCountries(showHidden: true); - var shippingMethods = _shippingService.GetAllShippingMethods(); - - - foreach (var shippingMethod in shippingMethods) - { - string formKey = "restrict_" + shippingMethod.Id; - var countryIdsToRestrict = form[formKey] != null - ? form[formKey].Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) - .Select(int.Parse) - .ToList() - : new List(); - - foreach (var country in countries) - { - - bool restrict = countryIdsToRestrict.Contains(country.Id); - if (restrict) - { - if (shippingMethod.RestrictedCountries.FirstOrDefault(c => c.Id == country.Id) == null) - { - shippingMethod.RestrictedCountries.Add(country); - _shippingService.UpdateShippingMethod(shippingMethod); - } - } - else - { - if (shippingMethod.RestrictedCountries.FirstOrDefault(c => c.Id == country.Id) != null) - { - shippingMethod.RestrictedCountries.Remove(country); - _shippingService.UpdateShippingMethod(shippingMethod); - } - } - } - } - - SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Restrictions.Updated")); - return RedirectToAction("Restrictions"); - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Nop.Admin.Extensions; +using Nop.Admin.Models.Directory; +using Nop.Admin.Models.Shipping; +using Nop.Core; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Shipping; +using Nop.Core.Plugins; +using Nop.Services.Common; +using Nop.Services.Configuration; +using Nop.Services.Directory; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Security; +using Nop.Services.Shipping; +using Nop.Services.Shipping.Date; +using Nop.Web.Framework.Controllers; +using Nop.Web.Framework.Kendoui; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Controllers +{ + public partial class ShippingController : BaseAdminController + { + #region Fields + + private readonly IShippingService _shippingService; + private readonly ShippingSettings _shippingSettings; + private readonly ISettingService _settingService; + private readonly IAddressService _addressService; + private readonly ICountryService _countryService; + private readonly IStateProvinceService _stateProvinceService; + private readonly ILocalizationService _localizationService; + private readonly IPermissionService _permissionService; + private readonly ILocalizedEntityService _localizedEntityService; + private readonly ILanguageService _languageService; + private readonly IDateRangeService _dateRangeService; + private readonly IPluginFinder _pluginFinder; + private readonly IWebHelper _webHelper; + private readonly ICustomerActivityService _customerActivityService; + + #endregion + + #region Ctor + + public ShippingController(IShippingService shippingService, + ShippingSettings shippingSettings, + ISettingService settingService, + IAddressService addressService, + ICountryService countryService, + IStateProvinceService stateProvinceService, + ILocalizationService localizationService, + IPermissionService permissionService, + ILocalizedEntityService localizedEntityService, + ILanguageService languageService, + IDateRangeService dateRangeService, + IPluginFinder pluginFinder, + IWebHelper webHelper, + ICustomerActivityService customerActivityService) + { + this._shippingService = shippingService; + this._shippingSettings = shippingSettings; + this._settingService = settingService; + this._addressService = addressService; + this._countryService = countryService; + this._stateProvinceService = stateProvinceService; + this._localizationService = localizationService; + this._permissionService = permissionService; + this._localizedEntityService = localizedEntityService; + this._languageService = languageService; + this._dateRangeService = dateRangeService; + this._pluginFinder = pluginFinder; + this._webHelper = webHelper; + this._customerActivityService = customerActivityService; + } + + #endregion  + + #region Utilities + + [NonAction] + protected virtual void UpdateLocales(ShippingMethod shippingMethod, ShippingMethodModel model) + { + foreach (var localized in model.Locales) + { + _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Name, localized.Name, localized.LanguageId); + _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Description, localized.Description, localized.LanguageId); + } + } + + [NonAction] + protected virtual void UpdateLocales(DeliveryDate deliveryDate, DeliveryDateModel model) + { + foreach (var localized in model.Locales) + { + _localizedEntityService.SaveLocalizedValue(deliveryDate, x => x.Name, localized.Name, localized.LanguageId); + } + } + + [NonAction] + protected virtual void UpdateLocales(ProductAvailabilityRange productAvailabilityRange, ProductAvailabilityRangeModel model) + { + foreach (var localized in model.Locales) + { + _localizedEntityService.SaveLocalizedValue(productAvailabilityRange, x => x.Name, localized.Name, localized.LanguageId); + } + } + + #endregion + + #region Shipping rate computation methods + + public virtual ActionResult Providers() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + return View(); + } + + [HttpPost] + public virtual ActionResult Providers(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var shippingProvidersModel = new List(); + var shippingProviders = _shippingService.LoadAllShippingRateComputationMethods(); + foreach (var shippingProvider in shippingProviders) + { + var tmp1 = shippingProvider.ToModel(); + tmp1.IsActive = shippingProvider.IsShippingRateComputationMethodActive(_shippingSettings); + tmp1.LogoUrl = shippingProvider.PluginDescriptor.GetLogoUrl(_webHelper); + shippingProvidersModel.Add(tmp1); + } + shippingProvidersModel = shippingProvidersModel.ToList(); + var gridModel = new DataSourceResult + { + Data = shippingProvidersModel, + Total = shippingProvidersModel.Count() + }; + + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult ProviderUpdate([Bind(Exclude = "ConfigurationRouteValues")] ShippingRateComputationMethodModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var srcm = _shippingService.LoadShippingRateComputationMethodBySystemName(model.SystemName); + if (srcm.IsShippingRateComputationMethodActive(_shippingSettings)) + { + if (!model.IsActive) + { + //mark as disabled + _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Remove(srcm.PluginDescriptor.SystemName); + _settingService.SaveSetting(_shippingSettings); + } + } + else + { + if (model.IsActive) + { + //mark as active + _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add(srcm.PluginDescriptor.SystemName); + _settingService.SaveSetting(_shippingSettings); + } + } + var pluginDescriptor = srcm.PluginDescriptor; + //display order + pluginDescriptor.DisplayOrder = model.DisplayOrder; + PluginFileParser.SavePluginDescriptionFile(pluginDescriptor); + //reset plugin cache + _pluginFinder.ReloadPlugins(); + + return new NullJsonResult(); + } + + public virtual ActionResult ConfigureProvider(string systemName) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var srcm = _shippingService.LoadShippingRateComputationMethodBySystemName(systemName); + if (srcm == null) + //No shipping rate computation method found with the specified id + return RedirectToAction("Providers"); + + var model = srcm.ToModel(); + string actionName, controllerName; + RouteValueDictionary routeValues; + srcm.GetConfigurationRoute(out actionName, out controllerName, out routeValues); + model.ConfigurationActionName = actionName; + model.ConfigurationControllerName = controllerName; + model.ConfigurationRouteValues = routeValues; + return View(model); + } + + #endregion + + #region Pickup point providers + + public virtual ActionResult PickupPointProviders() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + return View(); + } + + [HttpPost] + public virtual ActionResult PickupPointProviders(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var pickupPointProviderModel = new List(); + var allProviders = _shippingService.LoadAllPickupPointProviders(); + foreach (var provider in allProviders) + { + var model = provider.ToModel(); + model.IsActive = provider.IsPickupPointProviderActive(_shippingSettings); + model.LogoUrl = provider.PluginDescriptor.GetLogoUrl(_webHelper); + pickupPointProviderModel.Add(model); + } + + var gridModel = new DataSourceResult + { + Data = pickupPointProviderModel, + Total = pickupPointProviderModel.Count + }; + + return Json(gridModel); + } + + [HttpPost] + public virtual ActionResult PickupPointProviderUpdate([Bind(Exclude = "ConfigurationRouteValues")] PickupPointProviderModel model) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var pickupPointProvider = _shippingService.LoadPickupPointProviderBySystemName(model.SystemName); + if (pickupPointProvider.IsPickupPointProviderActive(_shippingSettings)) + { + if (!model.IsActive) + { + //mark as disabled + _shippingSettings.ActivePickupPointProviderSystemNames.Remove(pickupPointProvider.PluginDescriptor.SystemName); + _settingService.SaveSetting(_shippingSettings); + } + } + else + { + if (model.IsActive) + { + //mark as active + _shippingSettings.ActivePickupPointProviderSystemNames.Add(pickupPointProvider.PluginDescriptor.SystemName); + _settingService.SaveSetting(_shippingSettings); + } + } + var pluginDescriptor = pickupPointProvider.PluginDescriptor; + pluginDescriptor.DisplayOrder = model.DisplayOrder; + PluginFileParser.SavePluginDescriptionFile(pluginDescriptor); + //reset plugin cache + _pluginFinder.ReloadPlugins(); + + return new NullJsonResult(); + } + + public virtual ActionResult ConfigurePickupPointProvider(string systemName) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var pickupPointProvider = _shippingService.LoadPickupPointProviderBySystemName(systemName); + if (pickupPointProvider == null) + return RedirectToAction("PickupPointProviders"); + + var model = pickupPointProvider.ToModel(); + string actionName; + string controllerName; + RouteValueDictionary routeValues; + pickupPointProvider.GetConfigurationRoute(out actionName, out controllerName, out routeValues); + model.ConfigurationActionName = actionName; + model.ConfigurationControllerName = controllerName; + model.ConfigurationRouteValues = routeValues; + return View(model); + } + + #endregion + + #region Shipping methods + + public virtual ActionResult Methods() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + return View(); + } + + [HttpPost] + public virtual ActionResult Methods(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var shippingMethodsModel = _shippingService.GetAllShippingMethods() + .Select(x => x.ToModel()) + .ToList(); + var gridModel = new DataSourceResult + { + Data = shippingMethodsModel, + Total = shippingMethodsModel.Count + }; + + return Json(gridModel); + } + + + public virtual ActionResult CreateMethod() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var model = new ShippingMethodModel(); + //locales + AddLocales(_languageService, model.Locales); + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult CreateMethod(ShippingMethodModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var sm = model.ToEntity(); + _shippingService.InsertShippingMethod(sm); + //locales + UpdateLocales(sm, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Added")); + return continueEditing ? RedirectToAction("EditMethod", new { id = sm.Id }) : RedirectToAction("Methods"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + + public virtual ActionResult EditMethod(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var sm = _shippingService.GetShippingMethodById(id); + if (sm == null) + //No shipping method found with the specified id + return RedirectToAction("Methods"); + + var model = sm.ToModel(); + //locales + AddLocales(_languageService, model.Locales, (locale, languageId) => + { + locale.Name = sm.GetLocalized(x => x.Name, languageId, false, false); + locale.Description = sm.GetLocalized(x => x.Description, languageId, false, false); + }); + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult EditMethod(ShippingMethodModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var sm = _shippingService.GetShippingMethodById(model.Id); + if (sm == null) + //No shipping method found with the specified id + return RedirectToAction("Methods"); + + if (ModelState.IsValid) + { + sm = model.ToEntity(sm); + _shippingService.UpdateShippingMethod(sm); + //locales + UpdateLocales(sm, model); + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Updated")); + return continueEditing ? RedirectToAction("EditMethod", sm.Id) : RedirectToAction("Methods"); + } + + + //If we got this far, something failed, redisplay form + return View(model); + } + + [HttpPost] + public virtual ActionResult DeleteMethod(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var sm = _shippingService.GetShippingMethodById(id); + if (sm == null) + //No shipping method found with the specified id + return RedirectToAction("Methods"); + + _shippingService.DeleteShippingMethod(sm); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Methods.Deleted")); + return RedirectToAction("Methods"); + } + + #endregion + + #region Dates and ranges + + public virtual ActionResult DatesAndRanges() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + return View(); + } + + #region Delivery dates + + [HttpPost] + public virtual ActionResult DeliveryDates(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var deliveryDatesModel = _dateRangeService.GetAllDeliveryDates().Select(x => x.ToModel()).ToList(); + var gridModel = new DataSourceResult + { + Data = deliveryDatesModel, + Total = deliveryDatesModel.Count + }; + + return Json(gridModel); + } + + + public virtual ActionResult CreateDeliveryDate() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var model = new DeliveryDateModel(); + + //locales + AddLocales(_languageService, model.Locales); + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult CreateDeliveryDate(DeliveryDateModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var deliveryDate = model.ToEntity(); + _dateRangeService.InsertDeliveryDate(deliveryDate); + + //locales + UpdateLocales(deliveryDate, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Added")); + + return continueEditing ? RedirectToAction("EditDeliveryDate", new { id = deliveryDate.Id }) : RedirectToAction("DatesAndRanges"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + + public virtual ActionResult EditDeliveryDate(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var deliveryDate = _dateRangeService.GetDeliveryDateById(id); + if (deliveryDate == null) + //No delivery date found with the specified id + return RedirectToAction("DatesAndRanges"); + + var model = deliveryDate.ToModel(); + + //locales + AddLocales(_languageService, model.Locales, (locale, languageId) => + { + locale.Name = deliveryDate.GetLocalized(x => x.Name, languageId, false, false); + }); + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult EditDeliveryDate(DeliveryDateModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var deliveryDate = _dateRangeService.GetDeliveryDateById(model.Id); + if (deliveryDate == null) + //No delivery date found with the specified id + return RedirectToAction("DatesAndRanges"); + + if (ModelState.IsValid) + { + deliveryDate = model.ToEntity(deliveryDate); + _dateRangeService.UpdateDeliveryDate(deliveryDate); + + //locales + UpdateLocales(deliveryDate, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Updated")); + + return continueEditing ? RedirectToAction("EditDeliveryDate", deliveryDate.Id) : RedirectToAction("DatesAndRanges"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + + [HttpPost] + public virtual ActionResult DeleteDeliveryDate(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var deliveryDate = _dateRangeService.GetDeliveryDateById(id); + if (deliveryDate == null) + //No delivery date found with the specified id + return RedirectToAction("DatesAndRanges"); + + _dateRangeService.DeleteDeliveryDate(deliveryDate); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Deleted")); + + return RedirectToAction("DatesAndRanges"); + } + + #endregion + + #region Product availability ranges + + [HttpPost] + public virtual ActionResult ProductAvailabilityRanges(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var productAvailabilityRangesModel = _dateRangeService.GetAllProductAvailabilityRanges().Select(range => range.ToModel()).ToList(); + var gridModel = new DataSourceResult + { + Data = productAvailabilityRangesModel, + Total = productAvailabilityRangesModel.Count + }; + + return Json(gridModel); + } + + public virtual ActionResult CreateProductAvailabilityRange() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var model = new ProductAvailabilityRangeModel(); + + //locales + AddLocales(_languageService, model.Locales); + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult CreateProductAvailabilityRange(ProductAvailabilityRangeModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var productAvailabilityRange = model.ToEntity(); + _dateRangeService.InsertProductAvailabilityRange(productAvailabilityRange); + + //locales + UpdateLocales(productAvailabilityRange, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Added")); + + return continueEditing ? RedirectToAction("EditProductAvailabilityRange", new { id = productAvailabilityRange.Id }) : RedirectToAction("DatesAndRanges"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + + public virtual ActionResult EditProductAvailabilityRange(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(id); + if (productAvailabilityRange == null) + //No availability range found with the specified id + return RedirectToAction("DatesAndRanges"); + + var model = productAvailabilityRange.ToModel(); + + //locales + AddLocales(_languageService, model.Locales, (locale, languageId) => + { + locale.Name = productAvailabilityRange.GetLocalized(x => x.Name, languageId, false, false); + }); + + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult EditProductAvailabilityRange(ProductAvailabilityRangeModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(model.Id); + if (productAvailabilityRange == null) + //No availability range found with the specified id + return RedirectToAction("DatesAndRanges"); + + if (ModelState.IsValid) + { + productAvailabilityRange = model.ToEntity(productAvailabilityRange); + _dateRangeService.UpdateProductAvailabilityRange(productAvailabilityRange); + + //locales + UpdateLocales(productAvailabilityRange, model); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Updated")); + + return continueEditing ? RedirectToAction("EditProductAvailabilityRange", productAvailabilityRange.Id) : RedirectToAction("DatesAndRanges"); + } + + //If we got this far, something failed, redisplay form + return View(model); + } + + [HttpPost] + public virtual ActionResult DeleteProductAvailabilityRange(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var productAvailabilityRange = _dateRangeService.GetProductAvailabilityRangeById(id); + if (productAvailabilityRange == null) + //No availability range found with the specified id + return RedirectToAction("DatesAndRanges"); + + _dateRangeService.DeleteProductAvailabilityRange(productAvailabilityRange); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.ProductAvailabilityRanges.Deleted")); + + return RedirectToAction("DatesAndRanges"); + } + + #endregion + + #endregion + + #region Warehouses + + public virtual ActionResult Warehouses() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + return View(); + } + + [HttpPost] + public virtual ActionResult Warehouses(DataSourceRequest command) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedKendoGridJson(); + + var warehousesModel = _shippingService.GetAllWarehouses() + .Select(x => + { + var warehouseModel = new WarehouseModel + { + Id = x.Id, + Name = x.Name + //ignore address for list view (performance optimization) + }; + return warehouseModel; + }) + .ToList(); + var gridModel = new DataSourceResult + { + Data = warehousesModel, + Total = warehousesModel.Count + }; + + return Json(gridModel); + } + + + public virtual ActionResult CreateWarehouse() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var model = new WarehouseModel(); + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString() }); + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + model.Address.CountryEnabled = true; + model.Address.CountryRequired = true; + model.Address.StateProvinceEnabled = true; + model.Address.StateProvinceRequired = true; + model.Address.CityEnabled = true; + model.Address.StreetAddressEnabled = true; + model.Address.ZipPostalCodeEnabled = true; + model.Address.ZipPostalCodeRequired = true; + model.Address.PhoneEnabled = true; + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult CreateWarehouse(WarehouseModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + if (ModelState.IsValid) + { + var address = model.Address.ToEntity(); + address.CreatedOnUtc = DateTime.UtcNow; + _addressService.InsertAddress(address); + var warehouse = new Warehouse + { + Name = model.Name, + AdminComment = model.AdminComment, + AddressId = address.Id + }; + + _shippingService.InsertWarehouse(warehouse); + + //activity log + _customerActivityService.InsertActivity("AddNewWarehouse", _localizationService.GetResource("ActivityLog.AddNewWarehouse"), warehouse.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Warehouses.Added")); + return continueEditing ? RedirectToAction("EditWarehouse", new { id = warehouse.Id }) : RedirectToAction("Warehouses"); + } + + //If we got this far, something failed, redisplay form + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); + //states + var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + + return View(model); + } + + public virtual ActionResult EditWarehouse(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var warehouse = _shippingService.GetWarehouseById(id); + if (warehouse == null) + //No warehouse found with the specified id + return RedirectToAction("Warehouses"); + + var address = _addressService.GetAddressById(warehouse.AddressId); + var model = new WarehouseModel + { + Id = warehouse.Id, + Name = warehouse.Name, + AdminComment = warehouse.AdminComment + }; + + if (address != null) + { + model.Address = address.ToModel(); + } + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (address != null && c.Id == address.CountryId) }); + //states + var states = address != null && address.Country != null ? _stateProvinceService.GetStateProvincesByCountryId(address.Country.Id, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + model.Address.CountryEnabled = true; + model.Address.CountryRequired = true; + model.Address.StateProvinceEnabled = true; + model.Address.StateProvinceRequired = true; + model.Address.CityEnabled = true; + model.Address.StreetAddressEnabled = true; + model.Address.ZipPostalCodeEnabled = true; + model.Address.ZipPostalCodeRequired = true; + model.Address.PhoneEnabled = true; + return View(model); + } + + [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")] + public virtual ActionResult EditWarehouse(WarehouseModel model, bool continueEditing) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var warehouse = _shippingService.GetWarehouseById(model.Id); + if (warehouse == null) + //No warehouse found with the specified id + return RedirectToAction("Warehouses"); + + if (ModelState.IsValid) + { + var address = _addressService.GetAddressById(warehouse.AddressId) ?? + new Core.Domain.Common.Address + { + CreatedOnUtc = DateTime.UtcNow, + }; + address = model.Address.ToEntity(address); + if (address.Id > 0) + _addressService.UpdateAddress(address); + else + _addressService.InsertAddress(address); + + + warehouse.Name = model.Name; + warehouse.AdminComment = model.AdminComment; + warehouse.AddressId = address.Id; + + _shippingService.UpdateWarehouse(warehouse); + + //activity log + _customerActivityService.InsertActivity("EditWarehouse", _localizationService.GetResource("ActivityLog.EditWarehouse"), warehouse.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Warehouses.Updated")); + return continueEditing ? RedirectToAction("EditWarehouse", warehouse.Id) : RedirectToAction("Warehouses"); + } + + + //If we got this far, something failed, redisplay form + + //countries + model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" }); + foreach (var c in _countryService.GetAllCountries(showHidden: true)) + model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.Address.CountryId) }); + //states + var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, showHidden: true).ToList() : new List(); + if (states.Any()) + { + foreach (var s in states) + model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.Address.StateProvinceId) }); + } + else + model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" }); + + return View(model); + } + + [HttpPost] + public virtual ActionResult DeleteWarehouse(int id) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var warehouse = _shippingService.GetWarehouseById(id); + if (warehouse == null) + //No warehouse found with the specified id + return RedirectToAction("Warehouses"); + + _shippingService.DeleteWarehouse(warehouse); + + //activity log + _customerActivityService.InsertActivity("DeleteWarehouse", _localizationService.GetResource("ActivityLog.DeleteWarehouse"), warehouse.Id); + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.warehouses.Deleted")); + return RedirectToAction("Warehouses"); + } + + #endregion + + #region Restrictions + + public virtual ActionResult Restrictions() + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var model = new ShippingMethodRestrictionModel(); + + var countries = _countryService.GetAllCountries(showHidden: true); + var shippingMethods = _shippingService.GetAllShippingMethods(); + foreach (var country in countries) + { + model.AvailableCountries.Add(new CountryModel + { + Id = country.Id, + Name = country.Name + }); + } + foreach (var sm in shippingMethods) + { + model.AvailableShippingMethods.Add(new ShippingMethodModel + { + Id = sm.Id, + Name = sm.Name + }); + } + foreach (var country in countries) + foreach (var shippingMethod in shippingMethods) + { + bool restricted = shippingMethod.CountryRestrictionExists(country.Id); + if (!model.Restricted.ContainsKey(country.Id)) + model.Restricted[country.Id] = new Dictionary(); + model.Restricted[country.Id][shippingMethod.Id] = restricted; + } + + return View(model); + } + + [HttpPost, ActionName("Restrictions")] + public virtual ActionResult RestrictionSave(FormCollection form) + { + if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) + return AccessDeniedView(); + + var countries = _countryService.GetAllCountries(showHidden: true); + var shippingMethods = _shippingService.GetAllShippingMethods(); + + + foreach (var shippingMethod in shippingMethods) + { + string formKey = "restrict_" + shippingMethod.Id; + var countryIdsToRestrict = form[formKey] != null + ? form[formKey].Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(int.Parse) + .ToList() + : new List(); + + foreach (var country in countries) + { + + bool restrict = countryIdsToRestrict.Contains(country.Id); + if (restrict) + { + if (shippingMethod.RestrictedCountries.FirstOrDefault(c => c.Id == country.Id) == null) + { + shippingMethod.RestrictedCountries.Add(country); + _shippingService.UpdateShippingMethod(shippingMethod); + } + } + else + { + if (shippingMethod.RestrictedCountries.FirstOrDefault(c => c.Id == country.Id) != null) + { + shippingMethod.RestrictedCountries.Remove(country); + _shippingService.UpdateShippingMethod(shippingMethod); + } + } + } + } + + SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.Restrictions.Updated")); + return RedirectToAction("Restrictions"); + } + + #endregion + } +} diff --git a/src/Presentation/Nop.Web/Administration/Infrastructure/Mapper/AdminMapperConfiguration.cs b/src/Presentation/Nop.Web/Administration/Infrastructure/Mapper/AdminMapperConfiguration.cs index 353da6c47be..92b5533e78f 100644 --- a/src/Presentation/Nop.Web/Administration/Infrastructure/Mapper/AdminMapperConfiguration.cs +++ b/src/Presentation/Nop.Web/Administration/Infrastructure/Mapper/AdminMapperConfiguration.cs @@ -893,11 +893,13 @@ public Action GetConfiguration() .ForMember(dest => dest.ActivatePointsImmediately, mo => mo.Ignore()) .ForMember(dest => dest.DisplayHowMuchWillBeEarned_OverrideForStore, mo => mo.Ignore()) .ForMember(dest => dest.PageSize_OverrideForStore, mo => mo.Ignore()) - .ForMember(dest => dest.CustomProperties, mo => mo.Ignore()); + .ForMember(dest => dest.CustomProperties, mo => mo.Ignore()) + .ForMember(dest => dest.EarnedRewardPointsAreTaxable_OverrideForStore, mo => mo.Ignore()); cfg.CreateMap(); cfg.CreateMap() .ForMember(dest => dest.PrimaryStoreCurrencyCode, mo => mo.Ignore()) .ForMember(dest => dest.OrderIdent, mo => mo.Ignore()) + .ForMember(dest => dest.InvoiceIdent_OverrideForStore, mo => mo.Ignore()) .ForMember(dest => dest.ActiveStoreScopeConfiguration, mo => mo.Ignore()) .ForMember(dest => dest.IsReOrderAllowed_OverrideForStore, mo => mo.Ignore()) .ForMember(dest => dest.MinOrderSubtotalAmount_OverrideForStore, mo => mo.Ignore()) @@ -949,7 +951,8 @@ public Action GetConfiguration() cfg.CreateMap() .ForMember(dest => dest.RoundPricesDuringCalculation, mo => mo.Ignore()) .ForMember(dest => dest.GroupTierPricesForDistinctShoppingCartItems, mo => mo.Ignore()) - .ForMember(dest => dest.RenderAssociatedAttributeValueQuantity, mo => mo.Ignore()); + .ForMember(dest => dest.RenderAssociatedAttributeValueQuantity, mo => mo.Ignore()) + .ForMember(dest => dest.RenderProductAttributePrices, mo => mo.Ignore()); cfg.CreateMap() .ForMember(dest => dest.PicturesStoredIntoDatabase, mo => mo.Ignore()) .ForMember(dest => dest.ActiveStoreScopeConfiguration, mo => mo.Ignore()) diff --git a/src/Presentation/Nop.Web/Administration/Models/Affiliates/AffiliateModel.cs b/src/Presentation/Nop.Web/Administration/Models/Affiliates/AffiliateModel.cs index b0192b5817f..5f258cb76b5 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Affiliates/AffiliateModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Affiliates/AffiliateModel.cs @@ -1,66 +1,68 @@ -using System; -using System.Web.Mvc; -using Nop.Admin.Models.Common; -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Affiliates -{ - public partial class AffiliateModel : BaseNopEntityModel - { - public AffiliateModel() - { - Address = new AddressModel(); - } - - [NopResourceDisplayName("Admin.Affiliates.Fields.URL")] - public string Url { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Fields.AdminComment")] - [AllowHtml] - public string AdminComment { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Fields.FriendlyUrlName")] - [AllowHtml] - public string FriendlyUrlName { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Fields.Active")] - public bool Active { get; set; } - - public AddressModel Address { get; set; } - - #region Nested classes - - public partial class AffiliatedOrderModel : BaseNopEntityModel - { - public override int Id { get; set; } - [NopResourceDisplayName("Admin.Affiliates.Orders.CustomOrderNumber")] - public string CustomOrderNumber { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Orders.OrderStatus")] - public string OrderStatus { get; set; } - [NopResourceDisplayName("Admin.Affiliates.Orders.OrderStatus")] - public int OrderStatusId { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Orders.PaymentStatus")] - public string PaymentStatus { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Orders.ShippingStatus")] - public string ShippingStatus { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Orders.OrderTotal")] - public string OrderTotal { get; set; } - - [NopResourceDisplayName("Admin.Affiliates.Orders.CreatedOn")] - public DateTime CreatedOn { get; set; } - } - - public partial class AffiliatedCustomerModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Affiliates.Customers.Name")] - public string Name { get; set; } - } - - #endregion - } +using System; +using System.Web.Mvc; +using Nop.Admin.Models.Common; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Affiliates +{ + public partial class AffiliateModel : BaseNopEntityModel + { + public AffiliateModel() + { + Address = new AddressModel(); + } + + [NopResourceDisplayName("Admin.Affiliates.Fields.URL")] + public string Url { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Fields.AdminComment")] + [AllowHtml] + public string AdminComment { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Fields.FriendlyUrlName")] + [AllowHtml] + public string FriendlyUrlName { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Fields.Active")] + public bool Active { get; set; } + + public AddressModel Address { get; set; } + + #region Nested classes + + public partial class AffiliatedOrderModel : BaseNopEntityModel + { + public override int Id { get; set; } + [NopResourceDisplayName("Admin.Affiliates.Orders.CustomOrderNumber")] + public string CustomOrderNumber { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Orders.OrderStatus")] + public string OrderStatus { get; set; } + [NopResourceDisplayName("Admin.Affiliates.Orders.OrderStatus")] + public int OrderStatusId { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Orders.PaymentStatus")] + public string PaymentStatus { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Orders.ShippingStatus")] + public string ShippingStatus { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Orders.OrderTotal")] + public string OrderTotal { get; set; } + [NopResourceDisplayName("Admin.Affiliates.Orders.OrderTotalAmount")] + public string OrderTotalAmountIncl { get; set; } + + [NopResourceDisplayName("Admin.Affiliates.Orders.CreatedOn")] + public DateTime CreatedOn { get; set; } + } + + public partial class AffiliatedCustomerModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Affiliates.Customers.Name")] + public string Name { get; set; } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Catalog/ProductModel.cs b/src/Presentation/Nop.Web/Administration/Models/Catalog/ProductModel.cs index 142158122ce..bcb1d8453c4 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Catalog/ProductModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Catalog/ProductModel.cs @@ -1,1024 +1,1032 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Web.Mvc; -using FluentValidation.Attributes; -using Nop.Admin.Models.Settings; -using Nop.Admin.Validators.Catalog; -using Nop.Web.Framework; -using Nop.Web.Framework.Localization; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Catalog -{ - [Validator(typeof(ProductValidator))] - public partial class ProductModel : BaseNopEntityModel, ILocalizedModel - { - public ProductModel() - { - Locales = new List(); - ProductPictureModels = new List(); - CopyProductModel = new CopyProductModel(); - AddPictureModel = new ProductPictureModel(); - AddSpecificationAttributeModel = new AddProductSpecificationAttributeModel(); - ProductWarehouseInventoryModels = new List(); - ProductEditorSettingsModel = new ProductEditorSettingsModel(); - StockQuantityHistory = new StockQuantityHistoryModel(); - - AvailableBasepriceUnits = new List(); - AvailableBasepriceBaseUnits = new List(); - AvailableProductTemplates = new List(); - AvailableTaxCategories = new List(); - AvailableDeliveryDates = new List(); - AvailableProductAvailabilityRanges = new List(); - AvailableWarehouses = new List(); - AvailableProductAttributes = new List(); - ProductsTypesSupportedByProductTemplates = new Dictionary>(); - - AvailableVendors = new List(); - - SelectedStoreIds = new List(); - AvailableStores = new List(); - - SelectedManufacturerIds = new List(); - AvailableManufacturers = new List(); - - SelectedCategoryIds = new List(); - AvailableCategories = new List(); - - SelectedCustomerRoleIds = new List(); - AvailableCustomerRoles = new List(); - - SelectedDiscountIds = new List(); - AvailableDiscounts = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ID")] - public override int Id { get; set; } - - //picture thumbnail - [NopResourceDisplayName("Admin.Catalog.Products.Fields.PictureThumbnailUrl")] - public string PictureThumbnailUrl { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductType")] - public int ProductTypeId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductType")] - public string ProductTypeName { get; set; } - - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AssociatedToProductName")] - public int AssociatedToProductId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AssociatedToProductName")] - public string AssociatedToProductName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.VisibleIndividually")] - public bool VisibleIndividually { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductTemplate")] - public int ProductTemplateId { get; set; } - public IList AvailableProductTemplates { get; set; } - // - public Dictionary> ProductsTypesSupportedByProductTemplates { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Name")] - [AllowHtml] - public string Name { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShortDescription")] - [AllowHtml] - public string ShortDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.FullDescription")] - [AllowHtml] - public string FullDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AdminComment")] - [AllowHtml] - public string AdminComment { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShowOnHomePage")] - public bool ShowOnHomePage { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaKeywords")] - [AllowHtml] - public string MetaKeywords { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaDescription")] - [AllowHtml] - public string MetaDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaTitle")] - [AllowHtml] - public string MetaTitle { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.SeName")] - [AllowHtml] - public string SeName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowCustomerReviews")] - public bool AllowCustomerReviews { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductTags")] - public string ProductTags { get; set; } - - - - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Sku")] - [AllowHtml] - public string Sku { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ManufacturerPartNumber")] - [AllowHtml] - public string ManufacturerPartNumber { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.GTIN")] - [AllowHtml] - public virtual string Gtin { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsGiftCard")] - public bool IsGiftCard { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.GiftCardType")] - public int GiftCardTypeId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.OverriddenGiftCardAmount")] - [UIHint("DecimalNullable")] - public decimal? OverriddenGiftCardAmount { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RequireOtherProducts")] - public bool RequireOtherProducts { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RequiredProductIds")] - public string RequiredProductIds { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AutomaticallyAddRequiredProducts")] - public bool AutomaticallyAddRequiredProducts { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsDownload")] - public bool IsDownload { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Download")] - [UIHint("Download")] - public int DownloadId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.UnlimitedDownloads")] - public bool UnlimitedDownloads { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MaxNumberOfDownloads")] - public int MaxNumberOfDownloads { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DownloadExpirationDays")] - [UIHint("Int32Nullable")] - public int? DownloadExpirationDays { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DownloadActivationType")] - public int DownloadActivationTypeId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.HasSampleDownload")] - public bool HasSampleDownload { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.SampleDownload")] - [UIHint("Download")] - public int SampleDownloadId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.HasUserAgreement")] - public bool HasUserAgreement { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.UserAgreementText")] - [AllowHtml] - public string UserAgreementText { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsRecurring")] - public bool IsRecurring { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringCycleLength")] - public int RecurringCycleLength { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringCyclePeriod")] - public int RecurringCyclePeriodId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringTotalCycles")] - public int RecurringTotalCycles { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsRental")] - public bool IsRental { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RentalPriceLength")] - public int RentalPriceLength { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.RentalPricePeriod")] - public int RentalPricePeriodId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsShipEnabled")] - public bool IsShipEnabled { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsFreeShipping")] - public bool IsFreeShipping { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShipSeparately")] - public bool ShipSeparately { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AdditionalShippingCharge")] - public decimal AdditionalShippingCharge { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DeliveryDate")] - public int DeliveryDateId { get; set; } - public IList AvailableDeliveryDates { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsTaxExempt")] - public bool IsTaxExempt { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.TaxCategory")] - public int TaxCategoryId { get; set; } - public IList AvailableTaxCategories { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsTelecommunicationsOrBroadcastingOrElectronicServices")] - public bool IsTelecommunicationsOrBroadcastingOrElectronicServices { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ManageInventoryMethod")] - public int ManageInventoryMethodId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductAvailabilityRange")] - public int ProductAvailabilityRangeId { get; set; } - public IList AvailableProductAvailabilityRanges { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.UseMultipleWarehouses")] - public bool UseMultipleWarehouses { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Warehouse")] - public int WarehouseId { get; set; } - public IList AvailableWarehouses { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.StockQuantity")] - public int StockQuantity { get; set; } - public int LastStockQuantity { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.StockQuantity")] - public string StockQuantityStr { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayStockAvailability")] - public bool DisplayStockAvailability { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayStockQuantity")] - public bool DisplayStockQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MinStockQuantity")] - public int MinStockQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.LowStockActivity")] - public int LowStockActivityId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.NotifyAdminForQuantityBelow")] - public int NotifyAdminForQuantityBelow { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BackorderMode")] - public int BackorderModeId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowBackInStockSubscriptions")] - public bool AllowBackInStockSubscriptions { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.OrderMinimumQuantity")] - public int OrderMinimumQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.OrderMaximumQuantity")] - public int OrderMaximumQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowedQuantities")] - public string AllowedQuantities { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowAddingOnlyExistingAttributeCombinations")] - public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.NotReturnable")] - public bool NotReturnable { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisableBuyButton")] - public bool DisableBuyButton { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisableWishlistButton")] - public bool DisableWishlistButton { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableForPreOrder")] - public bool AvailableForPreOrder { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.PreOrderAvailabilityStartDateTimeUtc")] - [UIHint("DateTimeNullable")] - public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.CallForPrice")] - public bool CallForPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Price")] - public decimal Price { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.OldPrice")] - public decimal OldPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductCost")] - public decimal ProductCost { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.CustomerEntersPrice")] - public bool CustomerEntersPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MinimumCustomerEnteredPrice")] - public decimal MinimumCustomerEnteredPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MaximumCustomerEnteredPrice")] - public decimal MaximumCustomerEnteredPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceEnabled")] - public bool BasepriceEnabled { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceAmount")] - public decimal BasepriceAmount { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceUnit")] - public int BasepriceUnitId { get; set; } - public IList AvailableBasepriceUnits { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceBaseAmount")] - public decimal BasepriceBaseAmount { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceBaseUnit")] - public int BasepriceBaseUnitId { get; set; } - public IList AvailableBasepriceBaseUnits { get; set; } - - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNew")] - public bool MarkAsNew { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNewStartDateTimeUtc")] - [UIHint("DateTimeNullable")] - public DateTime? MarkAsNewStartDateTimeUtc { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNewEndDateTimeUtc")] - [UIHint("DateTimeNullable")] - public DateTime? MarkAsNewEndDateTimeUtc { get; set; } - - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Weight")] - public decimal Weight { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Length")] - public decimal Length { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Width")] - public decimal Width { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Height")] - public decimal Height { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableStartDateTime")] - [UIHint("DateTimeNullable")] - public DateTime? AvailableStartDateTimeUtc { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableEndDateTime")] - [UIHint("DateTimeNullable")] - public DateTime? AvailableEndDateTimeUtc { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Published")] - public bool Published { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.CreatedOn")] - public DateTime? CreatedOn { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.Fields.UpdatedOn")] - public DateTime? UpdatedOn { get; set; } - - - public string PrimaryStoreCurrencyCode { get; set; } - public string BaseDimensionIn { get; set; } - public string BaseWeightIn { get; set; } - - public IList Locales { get; set; } - - - - //ACL (customer roles) - [NopResourceDisplayName("Admin.Catalog.Products.Fields.AclCustomerRoles")] - [UIHint("MultiSelect")] - public IList SelectedCustomerRoleIds { get; set; } - public IList AvailableCustomerRoles { get; set; } - - //store mapping - [NopResourceDisplayName("Admin.Catalog.Products.Fields.LimitedToStores")] - [UIHint("MultiSelect")] - public IList SelectedStoreIds { get; set; } - public IList AvailableStores { get; set; } - - //categories - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Categories")] - [UIHint("MultiSelect")] - public IList SelectedCategoryIds { get; set; } - public IList AvailableCategories { get; set; } - - //manufacturers - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Manufacturers")] - [UIHint("MultiSelect")] - public IList SelectedManufacturerIds { get; set; } - public IList AvailableManufacturers { get; set; } - - //vendors - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Vendor")] - public int VendorId { get; set; } - public IList AvailableVendors { get; set; } - - //discounts - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Discounts")] - [UIHint("MultiSelect")] - public IList SelectedDiscountIds { get; set; } - public IList AvailableDiscounts { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - - //product attributes - public IList AvailableProductAttributes { get; set; } - - //pictures - public ProductPictureModel AddPictureModel { get; set; } - public IList ProductPictureModels { get; set; } - - //add specification attribute model - public AddProductSpecificationAttributeModel AddSpecificationAttributeModel { get; set; } - - //multiple warehouses - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory")] - public IList ProductWarehouseInventoryModels { get; set; } - - //copy product - public CopyProductModel CopyProductModel { get; set; } - - //editor settings - public ProductEditorSettingsModel ProductEditorSettingsModel { get; set; } - - //stock quantity history - public StockQuantityHistoryModel StockQuantityHistory { get; set; } - - #region Nested classes - - public partial class AddRequiredProductModel : BaseNopModel - { - public AddRequiredProductModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableStores = new List(); - AvailableVendors = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] - public int SearchStoreId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] - public int SearchVendorId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableStores { get; set; } - public IList AvailableVendors { get; set; } - public IList AvailableProductTypes { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - } - - public partial class AddProductSpecificationAttributeModel : BaseNopModel - { - public AddProductSpecificationAttributeModel() - { - AvailableAttributes = new List(); - AvailableOptions = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.SpecificationAttribute")] - public int SpecificationAttributeId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.AttributeType")] - public int AttributeTypeId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.SpecificationAttributeOption")] - public int SpecificationAttributeOptionId { get; set; } - - [AllowHtml] - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.CustomValue")] - public string CustomValue { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.AllowFiltering")] - public bool AllowFiltering { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.ShowOnProductPage")] - public bool ShowOnProductPage { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - - public IList AvailableAttributes { get; set; } - public IList AvailableOptions { get; set; } - } - - public partial class ProductPictureModel : BaseNopEntityModel - { - public int ProductId { get; set; } - - [UIHint("Picture")] - [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.Picture")] - public int PictureId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.Picture")] - public string PictureUrl { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.OverrideAltAttribute")] - [AllowHtml] - public string OverrideAltAttribute { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.OverrideTitleAttribute")] - [AllowHtml] - public string OverrideTitleAttribute { get; set; } - } - - public partial class RelatedProductModel : BaseNopEntityModel - { - public int ProductId2 { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.RelatedProducts.Fields.Product")] - public string Product2Name { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.RelatedProducts.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - } - public partial class AddRelatedProductModel : BaseNopModel - { - public AddRelatedProductModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableStores = new List(); - AvailableVendors = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] - public int SearchStoreId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] - public int SearchVendorId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableStores { get; set; } - public IList AvailableVendors { get; set; } - public IList AvailableProductTypes { get; set; } - - public int ProductId { get; set; } - - public int[] SelectedProductIds { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - } - - public partial class AssociatedProductModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Catalog.Products.AssociatedProducts.Fields.Product")] - public string ProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.AssociatedProducts.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - } - public partial class AddAssociatedProductModel : BaseNopModel - { - public AddAssociatedProductModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableStores = new List(); - AvailableVendors = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] - public int SearchStoreId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] - public int SearchVendorId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableStores { get; set; } - public IList AvailableVendors { get; set; } - public IList AvailableProductTypes { get; set; } - - public int ProductId { get; set; } - - public int[] SelectedProductIds { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - } - - public partial class CrossSellProductModel : BaseNopEntityModel - { - public int ProductId2 { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.CrossSells.Fields.Product")] - public string Product2Name { get; set; } - } - public partial class AddCrossSellProductModel : BaseNopModel - { - public AddCrossSellProductModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableStores = new List(); - AvailableVendors = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] - public int SearchStoreId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] - public int SearchVendorId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableStores { get; set; } - public IList AvailableVendors { get; set; } - public IList AvailableProductTypes { get; set; } - - public int ProductId { get; set; } - - public int[] SelectedProductIds { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - } - - public partial class TierPriceModel : BaseNopEntityModel - { - public TierPriceModel() - { - AvailableStores = new List(); - AvailableCustomerRoles = new List(); - } - - public int ProductId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.CustomerRole")] - public int CustomerRoleId { get; set; } - public IList AvailableCustomerRoles { get; set; } - public string CustomerRole { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Store")] - public int StoreId { get; set; } - public IList AvailableStores { get; set; } - public string Store { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Quantity")] - public int Quantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Price")] - public decimal Price { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.StartDateTimeUtc")] - [UIHint("DateTimeNullable")] - public DateTime? StartDateTimeUtc { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.EndDateTimeUtc")] - [UIHint("DateTimeNullable")] - public DateTime? EndDateTimeUtc { get; set; } - } - - public partial class ProductWarehouseInventoryModel : BaseNopModel - { - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse")] - public int WarehouseId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse")] - public string WarehouseName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.WarehouseUsed")] - public bool WarehouseUsed { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.StockQuantity")] - public int StockQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.ReservedQuantity")] - public int ReservedQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.PlannedQuantity")] - public int PlannedQuantity { get; set; } - } - - - public partial class ProductAttributeMappingModel : BaseNopEntityModel - { - public int ProductId { get; set; } - - public int ProductAttributeId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.Attribute")] - public string ProductAttribute { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.TextPrompt")] - [AllowHtml] - public string TextPrompt { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.IsRequired")] - public bool IsRequired { get; set; } - - public int AttributeControlTypeId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.AttributeControlType")] - public string AttributeControlType { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - - public bool ShouldHaveValues { get; set; } - public int TotalValues { get; set; } - - //validation fields - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules")] - public bool ValidationRulesAllowed { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.MinLength")] - [UIHint("Int32Nullable")] - public int? ValidationMinLength { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.MaxLength")] - [UIHint("Int32Nullable")] - public int? ValidationMaxLength { get; set; } - [AllowHtml] - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.FileAllowedExtensions")] - public string ValidationFileAllowedExtensions { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.FileMaximumSize")] - [UIHint("Int32Nullable")] - public int? ValidationFileMaximumSize { get; set; } - [AllowHtml] - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.DefaultValue")] - public string DefaultValue { get; set; } - public string ValidationRulesString { get; set; } - - //condition - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Condition")] - public bool ConditionAllowed { get; set; } - public string ConditionString { get; set; } - } - public partial class ProductAttributeValueListModel : BaseNopModel - { - public int ProductId { get; set; } - - public string ProductName { get; set; } - - public int ProductAttributeMappingId { get; set; } - - public string ProductAttributeName { get; set; } - } - [Validator(typeof(ProductAttributeValueModelValidator))] - public partial class ProductAttributeValueModel : BaseNopEntityModel, ILocalizedModel - { - public ProductAttributeValueModel() - { - ProductPictureModels = new List(); - Locales = new List(); - } - - public int ProductAttributeMappingId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AttributeValueType")] - public int AttributeValueTypeId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AttributeValueType")] - public string AttributeValueTypeName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct")] - public int AssociatedProductId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct")] - public string AssociatedProductName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name")] - [AllowHtml] - public string Name { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.ColorSquaresRgb")] - [AllowHtml] - public string ColorSquaresRgb { get; set; } - public bool DisplayColorSquaresRgb { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.ImageSquaresPicture")] - [UIHint("Picture")] - public int ImageSquaresPictureId { get; set; } - public bool DisplayImageSquaresPicture { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.PriceAdjustment")] - public decimal PriceAdjustment { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.PriceAdjustment")] - //used only on the values list page - public string PriceAdjustmentStr { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.WeightAdjustment")] - public decimal WeightAdjustment { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.WeightAdjustment")] - //used only on the values list page - public string WeightAdjustmentStr { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Cost")] - public decimal Cost { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.CustomerEntersQty")] - public bool CustomerEntersQty { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Quantity")] - public int Quantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.IsPreSelected")] - public bool IsPreSelected { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.DisplayOrder")] - public int DisplayOrder { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Picture")] - public int PictureId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Picture")] - public string PictureThumbnailUrl { get; set; } - - public IList ProductPictureModels { get; set; } - public IList Locales { get; set; } - - #region Nested classes - - public partial class AssociateProductToAttributeValueModel : BaseNopModel - { - public AssociateProductToAttributeValueModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableStores = new List(); - AvailableVendors = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] - public int SearchStoreId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] - public int SearchVendorId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableStores { get; set; } - public IList AvailableVendors { get; set; } - public IList AvailableProductTypes { get; set; } - - //vendor - public bool IsLoggedInAsVendor { get; set; } - - - public int AssociatedToProductId { get; set; } - } - #endregion - } - public partial class ProductAttributeValueLocalizedModel : ILocalizedModelLocal - { - public int LanguageId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name")] - [AllowHtml] - public string Name { get; set; } - } - public partial class ProductAttributeCombinationModel : BaseNopEntityModel - { - public int ProductId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Attributes")] - [AllowHtml] - public string AttributesXml { get; set; } - - [AllowHtml] - public string Warnings { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.StockQuantity")] - public int StockQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.AllowOutOfStockOrders")] - public bool AllowOutOfStockOrders { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Sku")] - public string Sku { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.ManufacturerPartNumber")] - public string ManufacturerPartNumber { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Gtin")] - public string Gtin { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.OverriddenPrice")] - [UIHint("DecimalNullable")] - public decimal? OverriddenPrice { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.NotifyAdminForQuantityBelow")] - public int NotifyAdminForQuantityBelow { get; set; } - - } - - #region Stock quantity history - - public partial class StockQuantityHistoryModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchWarehouse")] - public int SearchWarehouseId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Warehouse")] - [AllowHtml] - public string WarehouseName { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Combination")] - [AllowHtml] - public string AttributeCombination { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.QuantityAdjustment")] - public int QuantityAdjustment { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.StockQuantity")] - public int StockQuantity { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Message")] - [AllowHtml] - public string Message { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.CreatedOn")] - [UIHint("DecimalNullable")] - public DateTime CreatedOn { get; set; } - } - - #endregion - - #endregion - } - - public partial class ProductLocalizedModel : ILocalizedModelLocal - { - public int LanguageId { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.Name")] - [AllowHtml] - public string Name { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShortDescription")] - [AllowHtml] - public string ShortDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.FullDescription")] - [AllowHtml] - public string FullDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaKeywords")] - [AllowHtml] - public string MetaKeywords { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaDescription")] - [AllowHtml] - public string MetaDescription { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaTitle")] - [AllowHtml] - public string MetaTitle { get; set; } - - [NopResourceDisplayName("Admin.Catalog.Products.Fields.SeName")] - [AllowHtml] - public string SeName { get; set; } - } +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Web.Mvc; +using FluentValidation.Attributes; +using Nop.Admin.Models.Settings; +using Nop.Admin.Validators.Catalog; +using Nop.Web.Framework; +using Nop.Web.Framework.Localization; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Catalog +{ + [Validator(typeof(ProductValidator))] + public partial class ProductModel : BaseNopEntityModel, ILocalizedModel + { + public ProductModel() + { + Locales = new List(); + ProductPictureModels = new List(); + CopyProductModel = new CopyProductModel(); + AddPictureModel = new ProductPictureModel(); + AddSpecificationAttributeModel = new AddProductSpecificationAttributeModel(); + ProductWarehouseInventoryModels = new List(); + ProductEditorSettingsModel = new ProductEditorSettingsModel(); + StockQuantityHistory = new StockQuantityHistoryModel(); + + AvailableBasepriceUnits = new List(); + AvailableBasepriceBaseUnits = new List(); + AvailableProductTemplates = new List(); + AvailableTaxCategories = new List(); + AvailableDeliveryDates = new List(); + AvailableProductAvailabilityRanges = new List(); + AvailableWarehouses = new List(); + AvailableProductAttributes = new List(); + ProductsTypesSupportedByProductTemplates = new Dictionary>(); + + AvailableVendors = new List(); + + SelectedStoreIds = new List(); + AvailableStores = new List(); + + SelectedManufacturerIds = new List(); + AvailableManufacturers = new List(); + + SelectedCategoryIds = new List(); + AvailableCategories = new List(); + + SelectedCustomerRoleIds = new List(); + AvailableCustomerRoles = new List(); + + SelectedDiscountIds = new List(); + AvailableDiscounts = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ID")] + public override int Id { get; set; } + + //picture thumbnail + [NopResourceDisplayName("Admin.Catalog.Products.Fields.PictureThumbnailUrl")] + public string PictureThumbnailUrl { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductType")] + public int ProductTypeId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductType")] + public string ProductTypeName { get; set; } + + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AssociatedToProductName")] + public int AssociatedToProductId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AssociatedToProductName")] + public string AssociatedToProductName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.VisibleIndividually")] + public bool VisibleIndividually { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductTemplate")] + public int ProductTemplateId { get; set; } + public IList AvailableProductTemplates { get; set; } + // + public Dictionary> ProductsTypesSupportedByProductTemplates { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Name")] + [AllowHtml] + public string Name { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShortDescription")] + [AllowHtml] + public string ShortDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.FullDescription")] + [AllowHtml] + public string FullDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AdminComment")] + [AllowHtml] + public string AdminComment { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShowOnHomePage")] + public bool ShowOnHomePage { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaKeywords")] + [AllowHtml] + public string MetaKeywords { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaDescription")] + [AllowHtml] + public string MetaDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaTitle")] + [AllowHtml] + public string MetaTitle { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.SeName")] + [AllowHtml] + public string SeName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowCustomerReviews")] + public bool AllowCustomerReviews { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductTags")] + public string ProductTags { get; set; } + + + + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Sku")] + [AllowHtml] + public string Sku { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ManufacturerPartNumber")] + [AllowHtml] + public string ManufacturerPartNumber { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.GTIN")] + [AllowHtml] + public virtual string Gtin { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsGiftCard")] + public bool IsGiftCard { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.GiftCardType")] + public int GiftCardTypeId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.OverriddenGiftCardAmount")] + [UIHint("DecimalNullable")] + public decimal? OverriddenGiftCardAmount { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsRewardPoints")] + public bool IsRewardPoints { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.OverriddenRPExchangeRate")] + [UIHint("DecimalNullable")] + public decimal? OverriddenRPExchangeRate { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ExcludeFromRewardPoints")] + public bool ExcludeFromRewardPoints { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RequireOtherProducts")] + public bool RequireOtherProducts { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RequiredProductIds")] + public string RequiredProductIds { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AutomaticallyAddRequiredProducts")] + public bool AutomaticallyAddRequiredProducts { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsDownload")] + public bool IsDownload { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Download")] + [UIHint("Download")] + public int DownloadId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.UnlimitedDownloads")] + public bool UnlimitedDownloads { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MaxNumberOfDownloads")] + public int MaxNumberOfDownloads { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DownloadExpirationDays")] + [UIHint("Int32Nullable")] + public int? DownloadExpirationDays { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DownloadActivationType")] + public int DownloadActivationTypeId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.HasSampleDownload")] + public bool HasSampleDownload { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.SampleDownload")] + [UIHint("Download")] + public int SampleDownloadId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.HasUserAgreement")] + public bool HasUserAgreement { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.UserAgreementText")] + [AllowHtml] + public string UserAgreementText { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsRecurring")] + public bool IsRecurring { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringCycleLength")] + public int RecurringCycleLength { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringCyclePeriod")] + public int RecurringCyclePeriodId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RecurringTotalCycles")] + public int RecurringTotalCycles { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsRental")] + public bool IsRental { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RentalPriceLength")] + public int RentalPriceLength { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.RentalPricePeriod")] + public int RentalPricePeriodId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsShipEnabled")] + public bool IsShipEnabled { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsFreeShipping")] + public bool IsFreeShipping { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShipSeparately")] + public bool ShipSeparately { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AdditionalShippingCharge")] + public decimal AdditionalShippingCharge { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DeliveryDate")] + public int DeliveryDateId { get; set; } + public IList AvailableDeliveryDates { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsTaxExempt")] + public bool IsTaxExempt { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.TaxCategory")] + public int TaxCategoryId { get; set; } + public IList AvailableTaxCategories { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.IsTelecommunicationsOrBroadcastingOrElectronicServices")] + public bool IsTelecommunicationsOrBroadcastingOrElectronicServices { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ManageInventoryMethod")] + public int ManageInventoryMethodId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductAvailabilityRange")] + public int ProductAvailabilityRangeId { get; set; } + public IList AvailableProductAvailabilityRanges { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.UseMultipleWarehouses")] + public bool UseMultipleWarehouses { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Warehouse")] + public int WarehouseId { get; set; } + public IList AvailableWarehouses { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.StockQuantity")] + public int StockQuantity { get; set; } + public int LastStockQuantity { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.StockQuantity")] + public string StockQuantityStr { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayStockAvailability")] + public bool DisplayStockAvailability { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayStockQuantity")] + public bool DisplayStockQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MinStockQuantity")] + public int MinStockQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.LowStockActivity")] + public int LowStockActivityId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.NotifyAdminForQuantityBelow")] + public int NotifyAdminForQuantityBelow { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BackorderMode")] + public int BackorderModeId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowBackInStockSubscriptions")] + public bool AllowBackInStockSubscriptions { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.OrderMinimumQuantity")] + public int OrderMinimumQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.OrderMaximumQuantity")] + public int OrderMaximumQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowedQuantities")] + public string AllowedQuantities { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AllowAddingOnlyExistingAttributeCombinations")] + public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.NotReturnable")] + public bool NotReturnable { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisableBuyButton")] + public bool DisableBuyButton { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisableWishlistButton")] + public bool DisableWishlistButton { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableForPreOrder")] + public bool AvailableForPreOrder { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.PreOrderAvailabilityStartDateTimeUtc")] + [UIHint("DateTimeNullable")] + public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.CallForPrice")] + public bool CallForPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Price")] + public decimal Price { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.OldPrice")] + public decimal OldPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ProductCost")] + public decimal ProductCost { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.CustomerEntersPrice")] + public bool CustomerEntersPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MinimumCustomerEnteredPrice")] + public decimal MinimumCustomerEnteredPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MaximumCustomerEnteredPrice")] + public decimal MaximumCustomerEnteredPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceEnabled")] + public bool BasepriceEnabled { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceAmount")] + public decimal BasepriceAmount { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceUnit")] + public int BasepriceUnitId { get; set; } + public IList AvailableBasepriceUnits { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceBaseAmount")] + public decimal BasepriceBaseAmount { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.BasepriceBaseUnit")] + public int BasepriceBaseUnitId { get; set; } + public IList AvailableBasepriceBaseUnits { get; set; } + + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNew")] + public bool MarkAsNew { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNewStartDateTimeUtc")] + [UIHint("DateTimeNullable")] + public DateTime? MarkAsNewStartDateTimeUtc { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MarkAsNewEndDateTimeUtc")] + [UIHint("DateTimeNullable")] + public DateTime? MarkAsNewEndDateTimeUtc { get; set; } + + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Weight")] + public decimal Weight { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Length")] + public decimal Length { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Width")] + public decimal Width { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Height")] + public decimal Height { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableStartDateTime")] + [UIHint("DateTimeNullable")] + public DateTime? AvailableStartDateTimeUtc { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AvailableEndDateTime")] + [UIHint("DateTimeNullable")] + public DateTime? AvailableEndDateTimeUtc { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Published")] + public bool Published { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.CreatedOn")] + public DateTime? CreatedOn { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.Fields.UpdatedOn")] + public DateTime? UpdatedOn { get; set; } + + + public string PrimaryStoreCurrencyCode { get; set; } + public string BaseDimensionIn { get; set; } + public string BaseWeightIn { get; set; } + + public IList Locales { get; set; } + + + + //ACL (customer roles) + [NopResourceDisplayName("Admin.Catalog.Products.Fields.AclCustomerRoles")] + [UIHint("MultiSelect")] + public IList SelectedCustomerRoleIds { get; set; } + public IList AvailableCustomerRoles { get; set; } + + //store mapping + [NopResourceDisplayName("Admin.Catalog.Products.Fields.LimitedToStores")] + [UIHint("MultiSelect")] + public IList SelectedStoreIds { get; set; } + public IList AvailableStores { get; set; } + + //categories + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Categories")] + [UIHint("MultiSelect")] + public IList SelectedCategoryIds { get; set; } + public IList AvailableCategories { get; set; } + + //manufacturers + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Manufacturers")] + [UIHint("MultiSelect")] + public IList SelectedManufacturerIds { get; set; } + public IList AvailableManufacturers { get; set; } + + //vendors + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Vendor")] + public int VendorId { get; set; } + public IList AvailableVendors { get; set; } + + //discounts + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Discounts")] + [UIHint("MultiSelect")] + public IList SelectedDiscountIds { get; set; } + public IList AvailableDiscounts { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + + //product attributes + public IList AvailableProductAttributes { get; set; } + + //pictures + public ProductPictureModel AddPictureModel { get; set; } + public IList ProductPictureModels { get; set; } + + //add specification attribute model + public AddProductSpecificationAttributeModel AddSpecificationAttributeModel { get; set; } + + //multiple warehouses + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory")] + public IList ProductWarehouseInventoryModels { get; set; } + + //copy product + public CopyProductModel CopyProductModel { get; set; } + + //editor settings + public ProductEditorSettingsModel ProductEditorSettingsModel { get; set; } + + //stock quantity history + public StockQuantityHistoryModel StockQuantityHistory { get; set; } + + #region Nested classes + + public partial class AddRequiredProductModel : BaseNopModel + { + public AddRequiredProductModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableStores = new List(); + AvailableVendors = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] + public int SearchStoreId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] + public int SearchVendorId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableStores { get; set; } + public IList AvailableVendors { get; set; } + public IList AvailableProductTypes { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + } + + public partial class AddProductSpecificationAttributeModel : BaseNopModel + { + public AddProductSpecificationAttributeModel() + { + AvailableAttributes = new List(); + AvailableOptions = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.SpecificationAttribute")] + public int SpecificationAttributeId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.AttributeType")] + public int AttributeTypeId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.SpecificationAttributeOption")] + public int SpecificationAttributeOptionId { get; set; } + + [AllowHtml] + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.CustomValue")] + public string CustomValue { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.AllowFiltering")] + public bool AllowFiltering { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.ShowOnProductPage")] + public bool ShowOnProductPage { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.SpecificationAttributes.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + + public IList AvailableAttributes { get; set; } + public IList AvailableOptions { get; set; } + } + + public partial class ProductPictureModel : BaseNopEntityModel + { + public int ProductId { get; set; } + + [UIHint("Picture")] + [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.Picture")] + public int PictureId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.Picture")] + public string PictureUrl { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.OverrideAltAttribute")] + [AllowHtml] + public string OverrideAltAttribute { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Pictures.Fields.OverrideTitleAttribute")] + [AllowHtml] + public string OverrideTitleAttribute { get; set; } + } + + public partial class RelatedProductModel : BaseNopEntityModel + { + public int ProductId2 { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.RelatedProducts.Fields.Product")] + public string Product2Name { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.RelatedProducts.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + } + public partial class AddRelatedProductModel : BaseNopModel + { + public AddRelatedProductModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableStores = new List(); + AvailableVendors = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] + public int SearchStoreId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] + public int SearchVendorId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableStores { get; set; } + public IList AvailableVendors { get; set; } + public IList AvailableProductTypes { get; set; } + + public int ProductId { get; set; } + + public int[] SelectedProductIds { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + } + + public partial class AssociatedProductModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Catalog.Products.AssociatedProducts.Fields.Product")] + public string ProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.AssociatedProducts.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + } + public partial class AddAssociatedProductModel : BaseNopModel + { + public AddAssociatedProductModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableStores = new List(); + AvailableVendors = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] + public int SearchStoreId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] + public int SearchVendorId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableStores { get; set; } + public IList AvailableVendors { get; set; } + public IList AvailableProductTypes { get; set; } + + public int ProductId { get; set; } + + public int[] SelectedProductIds { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + } + + public partial class CrossSellProductModel : BaseNopEntityModel + { + public int ProductId2 { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.CrossSells.Fields.Product")] + public string Product2Name { get; set; } + } + public partial class AddCrossSellProductModel : BaseNopModel + { + public AddCrossSellProductModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableStores = new List(); + AvailableVendors = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] + public int SearchStoreId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] + public int SearchVendorId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableStores { get; set; } + public IList AvailableVendors { get; set; } + public IList AvailableProductTypes { get; set; } + + public int ProductId { get; set; } + + public int[] SelectedProductIds { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + } + + public partial class TierPriceModel : BaseNopEntityModel + { + public TierPriceModel() + { + AvailableStores = new List(); + AvailableCustomerRoles = new List(); + } + + public int ProductId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.CustomerRole")] + public int CustomerRoleId { get; set; } + public IList AvailableCustomerRoles { get; set; } + public string CustomerRole { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Store")] + public int StoreId { get; set; } + public IList AvailableStores { get; set; } + public string Store { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Quantity")] + public int Quantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.Price")] + public decimal Price { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.StartDateTimeUtc")] + [UIHint("DateTimeNullable")] + public DateTime? StartDateTimeUtc { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.TierPrices.Fields.EndDateTimeUtc")] + [UIHint("DateTimeNullable")] + public DateTime? EndDateTimeUtc { get; set; } + } + + public partial class ProductWarehouseInventoryModel : BaseNopModel + { + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse")] + public int WarehouseId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse")] + public string WarehouseName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.WarehouseUsed")] + public bool WarehouseUsed { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.StockQuantity")] + public int StockQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.ReservedQuantity")] + public int ReservedQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductWarehouseInventory.Fields.PlannedQuantity")] + public int PlannedQuantity { get; set; } + } + + + public partial class ProductAttributeMappingModel : BaseNopEntityModel + { + public int ProductId { get; set; } + + public int ProductAttributeId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.Attribute")] + public string ProductAttribute { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.TextPrompt")] + [AllowHtml] + public string TextPrompt { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.IsRequired")] + public bool IsRequired { get; set; } + + public int AttributeControlTypeId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.AttributeControlType")] + public string AttributeControlType { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + + public bool ShouldHaveValues { get; set; } + public int TotalValues { get; set; } + + //validation fields + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules")] + public bool ValidationRulesAllowed { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.MinLength")] + [UIHint("Int32Nullable")] + public int? ValidationMinLength { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.MaxLength")] + [UIHint("Int32Nullable")] + public int? ValidationMaxLength { get; set; } + [AllowHtml] + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.FileAllowedExtensions")] + public string ValidationFileAllowedExtensions { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.FileMaximumSize")] + [UIHint("Int32Nullable")] + public int? ValidationFileMaximumSize { get; set; } + [AllowHtml] + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.DefaultValue")] + public string DefaultValue { get; set; } + public string ValidationRulesString { get; set; } + + //condition + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Condition")] + public bool ConditionAllowed { get; set; } + public string ConditionString { get; set; } + } + public partial class ProductAttributeValueListModel : BaseNopModel + { + public int ProductId { get; set; } + + public string ProductName { get; set; } + + public int ProductAttributeMappingId { get; set; } + + public string ProductAttributeName { get; set; } + } + [Validator(typeof(ProductAttributeValueModelValidator))] + public partial class ProductAttributeValueModel : BaseNopEntityModel, ILocalizedModel + { + public ProductAttributeValueModel() + { + ProductPictureModels = new List(); + Locales = new List(); + } + + public int ProductAttributeMappingId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AttributeValueType")] + public int AttributeValueTypeId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AttributeValueType")] + public string AttributeValueTypeName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct")] + public int AssociatedProductId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct")] + public string AssociatedProductName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name")] + [AllowHtml] + public string Name { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.ColorSquaresRgb")] + [AllowHtml] + public string ColorSquaresRgb { get; set; } + public bool DisplayColorSquaresRgb { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.ImageSquaresPicture")] + [UIHint("Picture")] + public int ImageSquaresPictureId { get; set; } + public bool DisplayImageSquaresPicture { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.PriceAdjustment")] + public decimal PriceAdjustment { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.PriceAdjustment")] + //used only on the values list page + public string PriceAdjustmentStr { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.WeightAdjustment")] + public decimal WeightAdjustment { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.WeightAdjustment")] + //used only on the values list page + public string WeightAdjustmentStr { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Cost")] + public decimal Cost { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.CustomerEntersQty")] + public bool CustomerEntersQty { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Quantity")] + public int Quantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.IsPreSelected")] + public bool IsPreSelected { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.DisplayOrder")] + public int DisplayOrder { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Picture")] + public int PictureId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Picture")] + public string PictureThumbnailUrl { get; set; } + + public IList ProductPictureModels { get; set; } + public IList Locales { get; set; } + + #region Nested classes + + public partial class AssociateProductToAttributeValueModel : BaseNopModel + { + public AssociateProductToAttributeValueModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableStores = new List(); + AvailableVendors = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchStore")] + public int SearchStoreId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")] + public int SearchVendorId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableStores { get; set; } + public IList AvailableVendors { get; set; } + public IList AvailableProductTypes { get; set; } + + //vendor + public bool IsLoggedInAsVendor { get; set; } + + + public int AssociatedToProductId { get; set; } + } + #endregion + } + public partial class ProductAttributeValueLocalizedModel : ILocalizedModelLocal + { + public int LanguageId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name")] + [AllowHtml] + public string Name { get; set; } + } + public partial class ProductAttributeCombinationModel : BaseNopEntityModel + { + public int ProductId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Attributes")] + [AllowHtml] + public string AttributesXml { get; set; } + + [AllowHtml] + public string Warnings { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.StockQuantity")] + public int StockQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.AllowOutOfStockOrders")] + public bool AllowOutOfStockOrders { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Sku")] + public string Sku { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.ManufacturerPartNumber")] + public string ManufacturerPartNumber { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Gtin")] + public string Gtin { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.OverriddenPrice")] + [UIHint("DecimalNullable")] + public decimal? OverriddenPrice { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.NotifyAdminForQuantityBelow")] + public int NotifyAdminForQuantityBelow { get; set; } + + } + + #region Stock quantity history + + public partial class StockQuantityHistoryModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchWarehouse")] + public int SearchWarehouseId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Warehouse")] + [AllowHtml] + public string WarehouseName { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Combination")] + [AllowHtml] + public string AttributeCombination { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.QuantityAdjustment")] + public int QuantityAdjustment { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.StockQuantity")] + public int StockQuantity { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.Message")] + [AllowHtml] + public string Message { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.StockQuantityHistory.Fields.CreatedOn")] + [UIHint("DecimalNullable")] + public DateTime CreatedOn { get; set; } + } + + #endregion + + #endregion + } + + public partial class ProductLocalizedModel : ILocalizedModelLocal + { + public int LanguageId { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.Name")] + [AllowHtml] + public string Name { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.ShortDescription")] + [AllowHtml] + public string ShortDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.FullDescription")] + [AllowHtml] + public string FullDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaKeywords")] + [AllowHtml] + public string MetaKeywords { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaDescription")] + [AllowHtml] + public string MetaDescription { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.MetaTitle")] + [AllowHtml] + public string MetaTitle { get; set; } + + [NopResourceDisplayName("Admin.Catalog.Products.Fields.SeName")] + [AllowHtml] + public string SeName { get; set; } + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Common/AddressModel.cs b/src/Presentation/Nop.Web/Administration/Models/Common/AddressModel.cs index 01e0af73f3c..d9eac9e4626 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Common/AddressModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Common/AddressModel.cs @@ -1,146 +1,147 @@ -using System.Collections.Generic; -using System.Web.Mvc; -using FluentValidation.Attributes; -using Nop.Admin.Validators.Common; -using Nop.Core.Domain.Catalog; -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Common -{ - [Validator(typeof(AddressValidator))] - public partial class AddressModel : BaseNopEntityModel - { - public AddressModel() - { - AvailableCountries = new List(); - AvailableStates = new List(); - CustomAddressAttributes = new List(); - } - - [NopResourceDisplayName("Admin.Address.Fields.FirstName")] - [AllowHtml] - public string FirstName { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.LastName")] - [AllowHtml] - public string LastName { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Email")] - [AllowHtml] - public string Email { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Company")] - [AllowHtml] - public string Company { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Country")] - public int? CountryId { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Country")] - [AllowHtml] - public string CountryName { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.StateProvince")] - public int? StateProvinceId { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.StateProvince")] - [AllowHtml] - public string StateProvinceName { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.City")] - [AllowHtml] - public string City { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Address1")] - [AllowHtml] - public string Address1 { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.Address2")] - [AllowHtml] - public string Address2 { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.ZipPostalCode")] - [AllowHtml] - public string ZipPostalCode { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.PhoneNumber")] - [AllowHtml] - public string PhoneNumber { get; set; } - - [NopResourceDisplayName("Admin.Address.Fields.FaxNumber")] - [AllowHtml] - public string FaxNumber { get; set; } - - //address in HTML format (usually used in grids) - [NopResourceDisplayName("Admin.Address")] - public string AddressHtml { get; set; } - - //formatted custom address attributes - public string FormattedCustomAddressAttributes { get; set; } - public IList CustomAddressAttributes { get; set; } - - - public IList AvailableCountries { get; set; } - public IList AvailableStates { get; set; } - - - - public bool FirstNameEnabled { get; set; } - public bool FirstNameRequired { get; set; } - public bool LastNameEnabled { get; set; } - public bool LastNameRequired { get; set; } - public bool EmailEnabled { get; set; } - public bool EmailRequired { get; set; } - public bool CompanyEnabled { get; set; } - public bool CompanyRequired { get; set; } - public bool CountryEnabled { get; set; } - public bool CountryRequired { get; set; } - public bool StateProvinceEnabled { get; set; } - public bool CityEnabled { get; set; } - public bool CityRequired { get; set; } - public bool StreetAddressEnabled { get; set; } - public bool StreetAddressRequired { get; set; } - public bool StreetAddress2Enabled { get; set; } - public bool StreetAddress2Required { get; set; } - public bool ZipPostalCodeEnabled { get; set; } - public bool ZipPostalCodeRequired { get; set; } - public bool PhoneEnabled { get; set; } - public bool PhoneRequired { get; set; } - public bool FaxEnabled { get; set; } - public bool FaxRequired { get; set; } - - - #region Nested classes - - public partial class AddressAttributeModel : BaseNopEntityModel - { - public AddressAttributeModel() - { - Values = new List(); - } - - public string Name { get; set; } - - public bool IsRequired { get; set; } - - /// - /// Selected value for textboxes - /// - public string DefaultValue { get; set; } - - public AttributeControlType AttributeControlType { get; set; } - - public IList Values { get; set; } - } - - public partial class AddressAttributeValueModel : BaseNopEntityModel - { - public string Name { get; set; } - - public bool IsPreSelected { get; set; } - } - - #endregion - } +using System.Collections.Generic; +using System.Web.Mvc; +using FluentValidation.Attributes; +using Nop.Admin.Validators.Common; +using Nop.Core.Domain.Catalog; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Common +{ + [Validator(typeof(AddressValidator))] + public partial class AddressModel : BaseNopEntityModel + { + public AddressModel() + { + AvailableCountries = new List(); + AvailableStates = new List(); + CustomAddressAttributes = new List(); + } + + [NopResourceDisplayName("Admin.Address.Fields.FirstName")] + [AllowHtml] + public string FirstName { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.LastName")] + [AllowHtml] + public string LastName { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Email")] + [AllowHtml] + public string Email { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Company")] + [AllowHtml] + public string Company { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Country")] + public int? CountryId { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Country")] + [AllowHtml] + public string CountryName { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.StateProvince")] + public int? StateProvinceId { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.StateProvince")] + [AllowHtml] + public string StateProvinceName { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.City")] + [AllowHtml] + public string City { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Address1")] + [AllowHtml] + public string Address1 { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.Address2")] + [AllowHtml] + public string Address2 { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.ZipPostalCode")] + [AllowHtml] + public string ZipPostalCode { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.PhoneNumber")] + [AllowHtml] + public string PhoneNumber { get; set; } + + [NopResourceDisplayName("Admin.Address.Fields.FaxNumber")] + [AllowHtml] + public string FaxNumber { get; set; } + + //address in HTML format (usually used in grids) + [NopResourceDisplayName("Admin.Address")] + public string AddressHtml { get; set; } + + //formatted custom address attributes + public string FormattedCustomAddressAttributes { get; set; } + public IList CustomAddressAttributes { get; set; } + + + public IList AvailableCountries { get; set; } + public IList AvailableStates { get; set; } + + + + public bool FirstNameEnabled { get; set; } + public bool FirstNameRequired { get; set; } + public bool LastNameEnabled { get; set; } + public bool LastNameRequired { get; set; } + public bool EmailEnabled { get; set; } + public bool EmailRequired { get; set; } + public bool CompanyEnabled { get; set; } + public bool CompanyRequired { get; set; } + public bool CountryEnabled { get; set; } + public bool CountryRequired { get; set; } + public bool StateProvinceEnabled { get; set; } + public bool StateProvinceRequired { get; set; } + public bool CityEnabled { get; set; } + public bool CityRequired { get; set; } + public bool StreetAddressEnabled { get; set; } + public bool StreetAddressRequired { get; set; } + public bool StreetAddress2Enabled { get; set; } + public bool StreetAddress2Required { get; set; } + public bool ZipPostalCodeEnabled { get; set; } + public bool ZipPostalCodeRequired { get; set; } + public bool PhoneEnabled { get; set; } + public bool PhoneRequired { get; set; } + public bool FaxEnabled { get; set; } + public bool FaxRequired { get; set; } + + + #region Nested classes + + public partial class AddressAttributeModel : BaseNopEntityModel + { + public AddressAttributeModel() + { + Values = new List(); + } + + public string Name { get; set; } + + public bool IsRequired { get; set; } + + /// + /// Selected value for textboxes + /// + public string DefaultValue { get; set; } + + public AttributeControlType AttributeControlType { get; set; } + + public IList Values { get; set; } + } + + public partial class AddressAttributeValueModel : BaseNopEntityModel + { + public string Name { get; set; } + + public bool IsPreSelected { get; set; } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Customers/CustomerModel.cs b/src/Presentation/Nop.Web/Administration/Models/Customers/CustomerModel.cs index b3da5f13c64..0e2aded94c1 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Customers/CustomerModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Customers/CustomerModel.cs @@ -1,375 +1,384 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Web.Mvc; -using FluentValidation.Attributes; -using Nop.Admin.Validators.Customers; -using Nop.Core.Domain.Catalog; -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Customers -{ - [Validator(typeof(CustomerValidator))] - public partial class CustomerModel : BaseNopEntityModel - { - public CustomerModel() - { - this.AvailableTimeZones = new List(); - this.SendEmail = new SendEmailModel() { SendImmediately = true }; - this.SendPm = new SendPmModel(); - - this.SelectedCustomerRoleIds= new List(); - this.AvailableCustomerRoles = new List(); - - this.AssociatedExternalAuthRecords = new List(); - this.AvailableCountries = new List(); - this.AvailableStates = new List(); - this.AvailableVendors = new List(); - this.CustomerAttributes = new List(); - this.AvailableNewsletterSubscriptionStores = new List(); - this.RewardPointsAvailableStores = new List(); - } - - public bool UsernamesEnabled { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Username")] - [AllowHtml] - public string Username { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Email")] - [AllowHtml] - public string Email { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Password")] - [AllowHtml] - [DataType(DataType.Password)] - [NoTrim] - public string Password { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Vendor")] - public int VendorId { get; set; } - public IList AvailableVendors { get; set; } - - //form fields & properties - public bool GenderEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Gender")] - public string Gender { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.FirstName")] - [AllowHtml] - public string FirstName { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastName")] - [AllowHtml] - public string LastName { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.FullName")] - public string FullName { get; set; } - - public bool DateOfBirthEnabled { get; set; } - [UIHint("DateNullable")] - [NopResourceDisplayName("Admin.Customers.Customers.Fields.DateOfBirth")] - public DateTime? DateOfBirth { get; set; } - - public bool CompanyEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Company")] - [AllowHtml] - public string Company { get; set; } - - public bool StreetAddressEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.StreetAddress")] - [AllowHtml] - public string StreetAddress { get; set; } - - public bool StreetAddress2Enabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.StreetAddress2")] - [AllowHtml] - public string StreetAddress2 { get; set; } - - public bool ZipPostalCodeEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.ZipPostalCode")] - [AllowHtml] - public string ZipPostalCode { get; set; } - - public bool CityEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.City")] - [AllowHtml] - public string City { get; set; } - - public bool CountryEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Country")] - public int CountryId { get; set; } - public IList AvailableCountries { get; set; } - - public bool StateProvinceEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.StateProvince")] - public int StateProvinceId { get; set; } - public IList AvailableStates { get; set; } - - public bool PhoneEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Phone")] - [AllowHtml] - public string Phone { get; set; } - - public bool FaxEnabled { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Fax")] - [AllowHtml] - public string Fax { get; set; } - - public List CustomerAttributes { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.RegisteredInStore")] - public string RegisteredInStore { get; set; } - - - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.AdminComment")] - [AllowHtml] - public string AdminComment { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.IsTaxExempt")] - public bool IsTaxExempt { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Active")] - public bool Active { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Affiliate")] - public int AffiliateId { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Affiliate")] - public string AffiliateName { get; set; } - - - - - //time zone - [NopResourceDisplayName("Admin.Customers.Customers.Fields.TimeZoneId")] - [AllowHtml] - public string TimeZoneId { get; set; } - - public bool AllowCustomersToSetTimeZone { get; set; } - - public IList AvailableTimeZones { get; set; } - - - - - - //EU VAT - [NopResourceDisplayName("Admin.Customers.Customers.Fields.VatNumber")] - [AllowHtml] - public string VatNumber { get; set; } - - public string VatNumberStatusNote { get; set; } - - public bool DisplayVatNumber { get; set; } - - - - - - //registration date - [NopResourceDisplayName("Admin.Customers.Customers.Fields.CreatedOn")] - public DateTime CreatedOn { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastActivityDate")] - public DateTime LastActivityDate { get; set; } - - //IP adderss - [NopResourceDisplayName("Admin.Customers.Customers.Fields.IPAddress")] - public string LastIpAddress { get; set; } - - - [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastVisitedPage")] - public string LastVisitedPage { get; set; } - - - //customer roles - [NopResourceDisplayName("Admin.Customers.Customers.Fields.CustomerRoles")] - public string CustomerRoleNames { get; set; } - public List AvailableCustomerRoles { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.CustomerRoles")] - [UIHint("MultiSelect")] - public IList SelectedCustomerRoleIds { get; set; } - - - //newsletter subscriptions (per store) - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Newsletter")] - public List AvailableNewsletterSubscriptionStores { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Fields.Newsletter")] - public int[] SelectedNewsletterSubscriptionStoreIds { get; set; } - - - - //reward points history - public bool DisplayRewardPointsHistory { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsValue")] - public int AddRewardPointsValue { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsMessage")] - [AllowHtml] - public string AddRewardPointsMessage { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsStore")] - public int AddRewardPointsStoreId { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsStore")] - public IList RewardPointsAvailableStores { get; set; } - - - - //send email model - public SendEmailModel SendEmail { get; set; } - //send PM model - public SendPmModel SendPm { get; set; } - //send the welcome message - public bool AllowSendingOfWelcomeMessage { get; set; } - //re-send the activation message - public bool AllowReSendingOfActivationMessage { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth")] - public IList AssociatedExternalAuthRecords { get; set; } - - - #region Nested classes - - public partial class StoreModel : BaseNopEntityModel - { - public string Name { get; set; } - } - - public partial class AssociatedExternalAuthModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.Email")] - public string Email { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.ExternalIdentifier")] - public string ExternalIdentifier { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.AuthMethodName")] - public string AuthMethodName { get; set; } - } - - public partial class RewardPointsHistoryModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Store")] - public string StoreName { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Points")] - public int Points { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.PointsBalance")] - public string PointsBalance { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Message")] - [AllowHtml] - public string Message { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Date")] - public DateTime CreatedOn { get; set; } - } - - public partial class SendEmailModel : BaseNopModel - { - [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.Subject")] - [AllowHtml] - public string Subject { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.Body")] - [AllowHtml] - public string Body { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.SendImmediately")] - public bool SendImmediately { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.DontSendBeforeDate")] - [UIHint("DateTimeNullable")] - public DateTime? DontSendBeforeDate { get; set; } - } - - public partial class SendPmModel : BaseNopModel - { - [NopResourceDisplayName("Admin.Customers.Customers.SendPM.Subject")] - public string Subject { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.SendPM.Message")] - public string Message { get; set; } - } - - public partial class OrderModel : BaseNopEntityModel - { - public override int Id { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Orders.CustomOrderNumber")] - public string CustomOrderNumber { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderStatus")] - public string OrderStatus { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderStatus")] - public int OrderStatusId { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.PaymentStatus")] - public string PaymentStatus { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.ShippingStatus")] - public string ShippingStatus { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderTotal")] - public string OrderTotal { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.Store")] - public string StoreName { get; set; } - - [NopResourceDisplayName("Admin.Customers.Customers.Orders.CreatedOn")] - public DateTime CreatedOn { get; set; } - } - - public partial class ActivityLogModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.ActivityLogType")] - public string ActivityLogTypeName { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.Comment")] - public string Comment { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.CreatedOn")] - public DateTime CreatedOn { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.IpAddress")] - public string IpAddress { get; set; } - } - - public partial class BackInStockSubscriptionModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Store")] - public string StoreName { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Product")] - public int ProductId { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Product")] - public string ProductName { get; set; } - [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.CreatedOn")] - public DateTime CreatedOn { get; set; } - } - - public partial class CustomerAttributeModel : BaseNopEntityModel - { - public CustomerAttributeModel() - { - Values = new List(); - } - - public string Name { get; set; } - - public bool IsRequired { get; set; } - - /// - /// Default value for textboxes - /// - public string DefaultValue { get; set; } - - public AttributeControlType AttributeControlType { get; set; } - - public IList Values { get; set; } - - } - - public partial class CustomerAttributeValueModel : BaseNopEntityModel - { - public string Name { get; set; } - - public bool IsPreSelected { get; set; } - } - - #endregion - } +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Web.Mvc; +using FluentValidation.Attributes; +using Nop.Admin.Validators.Customers; +using Nop.Core.Domain.Catalog; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Customers +{ + [Validator(typeof(CustomerValidator))] + public partial class CustomerModel : BaseNopEntityModel + { + public CustomerModel() + { + this.AvailableTimeZones = new List(); + this.SendEmail = new SendEmailModel() { SendImmediately = true }; + this.SendPm = new SendPmModel(); + + this.SelectedCustomerRoleIds= new List(); + this.AvailableCustomerRoles = new List(); + + this.AssociatedExternalAuthRecords = new List(); + this.AvailableCountries = new List(); + this.AvailableStates = new List(); + this.AvailableVendors = new List(); + this.CustomerAttributes = new List(); + this.AvailableNewsletterSubscriptionStores = new List(); + this.RewardPointsAvailableStores = new List(); + } + + public bool UsernamesEnabled { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Username")] + [AllowHtml] + public string Username { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Email")] + [AllowHtml] + public string Email { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Password")] + [AllowHtml] + [DataType(DataType.Password)] + [NoTrim] + public string Password { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Vendor")] + public int VendorId { get; set; } + public IList AvailableVendors { get; set; } + + //form fields & properties + public bool GenderEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Gender")] + public string Gender { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.FirstName")] + [AllowHtml] + public string FirstName { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastName")] + [AllowHtml] + public string LastName { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.FullName")] + public string FullName { get; set; } + + public bool DateOfBirthEnabled { get; set; } + [UIHint("DateNullable")] + [NopResourceDisplayName("Admin.Customers.Customers.Fields.DateOfBirth")] + public DateTime? DateOfBirth { get; set; } + + public bool CompanyEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Company")] + [AllowHtml] + public string Company { get; set; } + + public bool StreetAddressEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.StreetAddress")] + [AllowHtml] + public string StreetAddress { get; set; } + + public bool StreetAddress2Enabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.StreetAddress2")] + [AllowHtml] + public string StreetAddress2 { get; set; } + + public bool ZipPostalCodeEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.ZipPostalCode")] + [AllowHtml] + public string ZipPostalCode { get; set; } + + public bool CityEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.City")] + [AllowHtml] + public string City { get; set; } + + public bool CountryEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Country")] + public int CountryId { get; set; } + public IList AvailableCountries { get; set; } + + public bool StateProvinceEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.StateProvince")] + public int StateProvinceId { get; set; } + public IList AvailableStates { get; set; } + + public bool PhoneEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Phone")] + [AllowHtml] + public string Phone { get; set; } + + public bool FaxEnabled { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Fax")] + [AllowHtml] + public string Fax { get; set; } + + public List CustomerAttributes { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.RegisteredInStore")] + public string RegisteredInStore { get; set; } + + + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.AdminComment")] + [AllowHtml] + public string AdminComment { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.IsTaxExempt")] + public bool IsTaxExempt { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Active")] + public bool Active { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Affiliate")] + public int AffiliateId { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Affiliate")] + public string AffiliateName { get; set; } + + + + + //time zone + [NopResourceDisplayName("Admin.Customers.Customers.Fields.TimeZoneId")] + [AllowHtml] + public string TimeZoneId { get; set; } + + public bool AllowCustomersToSetTimeZone { get; set; } + + public IList AvailableTimeZones { get; set; } + + + + + + //EU VAT + [NopResourceDisplayName("Admin.Customers.Customers.Fields.VatNumber")] + [AllowHtml] + public string VatNumber { get; set; } + + public string VatNumberStatusNote { get; set; } + + public bool DisplayVatNumber { get; set; } + + + + + + //registration date + [NopResourceDisplayName("Admin.Customers.Customers.Fields.CreatedOn")] + public DateTime CreatedOn { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastActivityDate")] + public DateTime LastActivityDate { get; set; } + + //IP adderss + [NopResourceDisplayName("Admin.Customers.Customers.Fields.IPAddress")] + public string LastIpAddress { get; set; } + + + [NopResourceDisplayName("Admin.Customers.Customers.Fields.LastVisitedPage")] + public string LastVisitedPage { get; set; } + + + //customer roles + [NopResourceDisplayName("Admin.Customers.Customers.Fields.CustomerRoles")] + public string CustomerRoleNames { get; set; } + public List AvailableCustomerRoles { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.CustomerRoles")] + [UIHint("MultiSelect")] + public IList SelectedCustomerRoleIds { get; set; } + + + //newsletter subscriptions (per store) + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Newsletter")] + public List AvailableNewsletterSubscriptionStores { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Fields.Newsletter")] + public int[] SelectedNewsletterSubscriptionStoreIds { get; set; } + + + + //reward points history + public bool DisplayRewardPointsHistory { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsValue")] + public int AddRewardPointsValue { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsValuePurchased")] + public int AddRewardPointsValuePurchased { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsMessage")] + [AllowHtml] + public string AddRewardPointsMessage { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsStore")] + public int AddRewardPointsStoreId { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.AddRewardPointsStore")] + public IList RewardPointsAvailableStores { get; set; } + + + + + //send email model + public SendEmailModel SendEmail { get; set; } + //send PM model + public SendPmModel SendPm { get; set; } + //send the welcome message + public bool AllowSendingOfWelcomeMessage { get; set; } + //re-send the activation message + public bool AllowReSendingOfActivationMessage { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth")] + public IList AssociatedExternalAuthRecords { get; set; } + + + #region Nested classes + + public partial class StoreModel : BaseNopEntityModel + { + public string Name { get; set; } + } + + public partial class AssociatedExternalAuthModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.Email")] + public string Email { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.ExternalIdentifier")] + public string ExternalIdentifier { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.AssociatedExternalAuth.Fields.AuthMethodName")] + public string AuthMethodName { get; set; } + } + + public partial class RewardPointsHistoryModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Store")] + public string StoreName { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Points")] + public int Points { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.PointsBalance")] + public string PointsBalance { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.PointsPurchased")] + public int PointsPurchased { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.PointsBalancePurchased")] + public string PointsBalancePurchased { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Message")] + [AllowHtml] + public string Message { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.RewardPoints.Fields.Date")] + public DateTime CreatedOn { get; set; } + } + + public partial class SendEmailModel : BaseNopModel + { + [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.Subject")] + [AllowHtml] + public string Subject { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.Body")] + [AllowHtml] + public string Body { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.SendImmediately")] + public bool SendImmediately { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.SendEmail.DontSendBeforeDate")] + [UIHint("DateTimeNullable")] + public DateTime? DontSendBeforeDate { get; set; } + } + + public partial class SendPmModel : BaseNopModel + { + [NopResourceDisplayName("Admin.Customers.Customers.SendPM.Subject")] + public string Subject { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.SendPM.Message")] + public string Message { get; set; } + } + + public partial class OrderModel : BaseNopEntityModel + { + public override int Id { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Orders.CustomOrderNumber")] + public string CustomOrderNumber { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderStatus")] + public string OrderStatus { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderStatus")] + public int OrderStatusId { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.PaymentStatus")] + public string PaymentStatus { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.ShippingStatus")] + public string ShippingStatus { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderTotal")] + public string OrderTotal { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.Orders.OrderTotalAmountIncl")] + public string OrderTotalAmountIncl { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.Store")] + public string StoreName { get; set; } + + [NopResourceDisplayName("Admin.Customers.Customers.Orders.CreatedOn")] + public DateTime CreatedOn { get; set; } + } + + public partial class ActivityLogModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.ActivityLogType")] + public string ActivityLogTypeName { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.Comment")] + public string Comment { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.CreatedOn")] + public DateTime CreatedOn { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.ActivityLog.IpAddress")] + public string IpAddress { get; set; } + } + + public partial class BackInStockSubscriptionModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Store")] + public string StoreName { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Product")] + public int ProductId { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.Product")] + public string ProductName { get; set; } + [NopResourceDisplayName("Admin.Customers.Customers.BackInStockSubscriptions.CreatedOn")] + public DateTime CreatedOn { get; set; } + } + + public partial class CustomerAttributeModel : BaseNopEntityModel + { + public CustomerAttributeModel() + { + Values = new List(); + } + + public string Name { get; set; } + + public bool IsRequired { get; set; } + + /// + /// Default value for textboxes + /// + public string DefaultValue { get; set; } + + public AttributeControlType AttributeControlType { get; set; } + + public IList Values { get; set; } + + } + + public partial class CustomerAttributeValueModel : BaseNopEntityModel + { + public string Name { get; set; } + + public bool IsPreSelected { get; set; } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Orders/OrderModel.cs b/src/Presentation/Nop.Web/Administration/Models/Orders/OrderModel.cs index 4dbf33fa43f..210ec1823e9 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Orders/OrderModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Orders/OrderModel.cs @@ -1,505 +1,556 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Web.Mvc; -using Nop.Admin.Models.Common; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Tax; -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Orders -{ - public partial class OrderModel : BaseNopEntityModel - { - public OrderModel() - { - CustomValues = new Dictionary(); - TaxRates = new List(); - GiftCards = new List(); - Items = new List(); - UsedDiscounts = new List(); - Warnings = new List(); - } - - public bool IsLoggedInAsVendor { get; set; } - - //identifiers - public override int Id { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderGuid")] - public Guid OrderGuid { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CustomOrderNumber")] - public string CustomOrderNumber { get; set; } - - //store - [NopResourceDisplayName("Admin.Orders.Fields.Store")] - public string StoreName { get; set; } - - //customer info - [NopResourceDisplayName("Admin.Orders.Fields.Customer")] - public int CustomerId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Customer")] - public string CustomerInfo { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CustomerEmail")] - public string CustomerEmail { get; set; } - public string CustomerFullName { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CustomerIP")] - public string CustomerIp { get; set; } - - [NopResourceDisplayName("Admin.Orders.Fields.CustomValues")] - public Dictionary CustomValues { get; set; } - - [NopResourceDisplayName("Admin.Orders.Fields.Affiliate")] - public int AffiliateId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Affiliate")] - public string AffiliateName { get; set; } - - //Used discounts - [NopResourceDisplayName("Admin.Orders.Fields.UsedDiscounts")] - public IList UsedDiscounts { get; set; } - - //totals - public bool AllowCustomersToSelectTaxDisplayType { get; set; } - public TaxDisplayType TaxDisplayType { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderSubtotalInclTax")] - public string OrderSubtotalInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderSubtotalExclTax")] - public string OrderSubtotalExclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderSubTotalDiscountInclTax")] - public string OrderSubTotalDiscountInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderSubTotalDiscountExclTax")] - public string OrderSubTotalDiscountExclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderShippingInclTax")] - public string OrderShippingInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderShippingExclTax")] - public string OrderShippingExclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethodAdditionalFeeInclTax")] - public string PaymentMethodAdditionalFeeInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethodAdditionalFeeExclTax")] - public string PaymentMethodAdditionalFeeExclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Tax")] - public string Tax { get; set; } - public IList TaxRates { get; set; } - public bool DisplayTax { get; set; } - public bool DisplayTaxRates { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderTotalDiscount")] - public string OrderTotalDiscount { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPoints")] - public int RedeemedRewardPoints { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPoints")] - public string RedeemedRewardPointsAmount { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderTotal")] - public string OrderTotal { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.RefundedAmount")] - public string RefundedAmount { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Profit")] - public string Profit { get; set; } - - //edit totals - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubtotal")] - public decimal OrderSubtotalInclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubtotal")] - public decimal OrderSubtotalExclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubTotalDiscount")] - public decimal OrderSubTotalDiscountInclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubTotalDiscount")] - public decimal OrderSubTotalDiscountExclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderShipping")] - public decimal OrderShippingInclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderShipping")] - public decimal OrderShippingExclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.PaymentMethodAdditionalFee")] - public decimal PaymentMethodAdditionalFeeInclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.PaymentMethodAdditionalFee")] - public decimal PaymentMethodAdditionalFeeExclTaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.Tax")] - public decimal TaxValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.TaxRates")] - public string TaxRatesValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderTotalDiscount")] - public decimal OrderTotalDiscountValue { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderTotal")] - public decimal OrderTotalValue { get; set; } - - //associated recurring payment id - [NopResourceDisplayName("Admin.Orders.Fields.RecurringPayment")] - public int RecurringPaymentId { get; set; } - - //order status - [NopResourceDisplayName("Admin.Orders.Fields.OrderStatus")] - public string OrderStatus { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.OrderStatus")] - public int OrderStatusId { get; set; } - - //payment info - [NopResourceDisplayName("Admin.Orders.Fields.PaymentStatus")] - public string PaymentStatus { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.PaymentStatus")] - public int PaymentStatusId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethod")] - public string PaymentMethod { get; set; } - - //credit card info - public bool AllowStoringCreditCardNumber { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardType")] - [AllowHtml] - public string CardType { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardName")] - [AllowHtml] - public string CardName { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardNumber")] - [AllowHtml] - public string CardNumber { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardCVV2")] - [AllowHtml] - public string CardCvv2 { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardExpirationMonth")] - [AllowHtml] - public string CardExpirationMonth { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CardExpirationYear")] - [AllowHtml] - public string CardExpirationYear { get; set; } - - //misc payment info - [NopResourceDisplayName("Admin.Orders.Fields.AuthorizationTransactionID")] - public string AuthorizationTransactionId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.CaptureTransactionID")] - public string CaptureTransactionId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.SubscriptionTransactionID")] - public string SubscriptionTransactionId { get; set; } - - //shipping info - public bool IsShippable { get; set; } - public bool PickUpInStore { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.PickupAddress")] - public AddressModel PickupAddress { get; set; } - public string PickupAddressGoogleMapsUrl { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.ShippingStatus")] - public string ShippingStatus { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.ShippingStatus")] - public int ShippingStatusId { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.ShippingAddress")] - public AddressModel ShippingAddress { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.ShippingMethod")] - public string ShippingMethod { get; set; } - public string ShippingAddressGoogleMapsUrl { get; set; } - public bool CanAddNewShipments { get; set; } - - //billing info - [NopResourceDisplayName("Admin.Orders.Fields.BillingAddress")] - public AddressModel BillingAddress { get; set; } - [NopResourceDisplayName("Admin.Orders.Fields.VatNumber")] - public string VatNumber { get; set; } - - //gift cards - public IList GiftCards { get; set; } - - //items - public bool HasDownloadableProducts { get; set; } - public IList Items { get; set; } - - //creation date - [NopResourceDisplayName("Admin.Orders.Fields.CreatedOn")] - public DateTime CreatedOn { get; set; } - - //checkout attributes - public string CheckoutAttributeInfo { get; set; } - - - //order notes - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.DisplayToCustomer")] - public bool AddOrderNoteDisplayToCustomer { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Note")] - [AllowHtml] - public string AddOrderNoteMessage { get; set; } - public bool AddOrderNoteHasDownload { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] - [UIHint("Download")] - public int AddOrderNoteDownloadId { get; set; } - - //refund info - [NopResourceDisplayName("Admin.Orders.Fields.PartialRefund.AmountToRefund")] - public decimal AmountToRefund { get; set; } - public decimal MaxAmountToRefund { get; set; } - public string PrimaryStoreCurrencyCode { get; set; } - - //workflow info - public bool CanCancelOrder { get; set; } - public bool CanCapture { get; set; } - public bool CanMarkOrderAsPaid { get; set; } - public bool CanRefund { get; set; } - public bool CanRefundOffline { get; set; } - public bool CanPartiallyRefund { get; set; } - public bool CanPartiallyRefundOffline { get; set; } - public bool CanVoid { get; set; } - public bool CanVoidOffline { get; set; } - - //warnings - public List Warnings { get; set; } - - #region Nested Classes - - public partial class OrderItemModel : BaseNopEntityModel - { - public OrderItemModel() - { - PurchasedGiftCardIds = new List(); - ReturnRequests = new List(); - } - public int ProductId { get; set; } - public string ProductName { get; set; } - public string VendorName { get; set; } - public string Sku { get; set; } - - public string PictureThumbnailUrl { get; set; } - - public string UnitPriceInclTax { get; set; } - public string UnitPriceExclTax { get; set; } - public decimal UnitPriceInclTaxValue { get; set; } - public decimal UnitPriceExclTaxValue { get; set; } - - public int Quantity { get; set; } - - public string DiscountInclTax { get; set; } - public string DiscountExclTax { get; set; } - public decimal DiscountInclTaxValue { get; set; } - public decimal DiscountExclTaxValue { get; set; } - - public string SubTotalInclTax { get; set; } - public string SubTotalExclTax { get; set; } - public decimal SubTotalInclTaxValue { get; set; } - public decimal SubTotalExclTaxValue { get; set; } - - public string AttributeInfo { get; set; } - public string RecurringInfo { get; set; } - public string RentalInfo { get; set; } - public IList ReturnRequests { get; set; } - public IList PurchasedGiftCardIds { get; set; } - - public bool IsDownload { get; set; } - public int DownloadCount { get; set; } - public DownloadActivationType DownloadActivationType { get; set; } - public bool IsDownloadActivated { get; set; } - public Guid LicenseDownloadGuid { get; set; } - - #region Nested Classes - - public partial class ReturnRequestBriefModel : BaseNopEntityModel - { - public string CustomNumber { get; set; } - } - - #endregion - } - - public partial class TaxRate : BaseNopModel - { - public string Rate { get; set; } - public string Value { get; set; } - } - - public partial class GiftCard : BaseNopModel - { - [NopResourceDisplayName("Admin.Orders.Fields.GiftCardInfo")] - public string CouponCode { get; set; } - public string Amount { get; set; } - } - - public partial class OrderNote : BaseNopEntityModel - { - public int OrderId { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.DisplayToCustomer")] - public bool DisplayToCustomer { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Note")] - public string Note { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] - public int DownloadId { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] - public Guid DownloadGuid { get; set; } - [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.CreatedOn")] - public DateTime CreatedOn { get; set; } - } - - public partial class UploadLicenseModel : BaseNopModel - { - public int OrderId { get; set; } - - public int OrderItemId { get; set; } - - [UIHint("Download")] - public int LicenseDownloadId { get; set; } - - } - - public partial class AddOrderProductModel : BaseNopModel - { - public AddOrderProductModel() - { - AvailableCategories = new List(); - AvailableManufacturers = new List(); - AvailableProductTypes = new List(); - } - - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] - [AllowHtml] - public string SearchProductName { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] - public int SearchCategoryId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] - public int SearchManufacturerId { get; set; } - [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] - public int SearchProductTypeId { get; set; } - - public IList AvailableCategories { get; set; } - public IList AvailableManufacturers { get; set; } - public IList AvailableProductTypes { get; set; } - - public int OrderId { get; set; } - - #region Nested classes - - public partial class ProductModel : BaseNopEntityModel - { - [NopResourceDisplayName("Admin.Orders.Products.AddNew.Name")] - [AllowHtml] - public string Name { get; set; } - - [NopResourceDisplayName("Admin.Orders.Products.AddNew.SKU")] - [AllowHtml] - public string Sku { get; set; } - } - - public partial class ProductDetailsModel : BaseNopModel - { - public ProductDetailsModel() - { - ProductAttributes = new List(); - GiftCard = new GiftCardModel(); - Warnings = new List(); - } - - public int ProductId { get; set; } - - public int OrderId { get; set; } - - public ProductType ProductType { get; set; } - - public string Name { get; set; } - - [NopResourceDisplayName("Admin.Orders.Products.AddNew.UnitPriceInclTax")] - public decimal UnitPriceInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Products.AddNew.UnitPriceExclTax")] - public decimal UnitPriceExclTax { get; set; } - - [NopResourceDisplayName("Admin.Orders.Products.AddNew.Quantity")] - public int Quantity { get; set; } - - [NopResourceDisplayName("Admin.Orders.Products.AddNew.SubTotalInclTax")] - public decimal SubTotalInclTax { get; set; } - [NopResourceDisplayName("Admin.Orders.Products.AddNew.SubTotalExclTax")] - public decimal SubTotalExclTax { get; set; } - - //product attributes - public IList ProductAttributes { get; set; } - //gift card info - public GiftCardModel GiftCard { get; set; } - //rental - public bool IsRental { get; set; } - - public List Warnings { get; set; } - - /// - /// A value indicating whether this attribute depends on some other attribute - /// - public bool HasCondition { get; set; } - - public bool AutoUpdateOrderTotals { get; set; } - } - - public partial class ProductAttributeModel : BaseNopEntityModel - { - public ProductAttributeModel() - { - Values = new List(); - } - - public int ProductAttributeId { get; set; } - - public string Name { get; set; } - - public string TextPrompt { get; set; } - - public bool IsRequired { get; set; } - - public bool HasCondition { get; set; } - - /// - /// Allowed file extensions for customer uploaded files - /// - public IList AllowedFileExtensions { get; set; } - - public AttributeControlType AttributeControlType { get; set; } - - public IList Values { get; set; } - } - - public partial class ProductAttributeValueModel : BaseNopEntityModel - { - public string Name { get; set; } - - public bool IsPreSelected { get; set; } - - public string PriceAdjustment { get; set; } - - public decimal PriceAdjustmentValue { get; set; } - - public bool CustomerEntersQty { get; set; } - - public int Quantity { get; set; } - } - - - public partial class GiftCardModel : BaseNopModel - { - public bool IsGiftCard { get; set; } - - [NopResourceDisplayName("Admin.GiftCards.Fields.RecipientName")] - [AllowHtml] - public string RecipientName { get; set; } - [NopResourceDisplayName("Admin.GiftCards.Fields.RecipientEmail")] - [AllowHtml] - public string RecipientEmail { get; set; } - [NopResourceDisplayName("Admin.GiftCards.Fields.SenderName")] - [AllowHtml] - public string SenderName { get; set; } - [NopResourceDisplayName("Admin.GiftCards.Fields.SenderEmail")] - [AllowHtml] - public string SenderEmail { get; set; } - [NopResourceDisplayName("Admin.GiftCards.Fields.Message")] - [AllowHtml] - public string Message { get; set; } - - public GiftCardType GiftCardType { get; set; } - } - #endregion - } - - public partial class UsedDiscountModel:BaseNopModel - { - public int DiscountId { get; set; } - public string DiscountName { get; set; } - } - - #endregion - } - - - public partial class OrderAggreratorModel : BaseNopModel - { - //aggergator properties - public string aggregatorprofit { get; set; } - public string aggregatorshipping { get; set; } - public string aggregatortax { get; set; } - public string aggregatortotal { get; set; } - } +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Web.Mvc; +using Nop.Admin.Models.Common; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Tax; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Orders +{ + public partial class OrderModel : BaseNopEntityModel + { + public OrderModel() + { + CustomValues = new Dictionary(); + TaxRates = new List(); + GiftCards = new List(); + Items = new List(); + UsedDiscounts = new List(); + Warnings = new List(); + } + + public bool IsLoggedInAsVendor { get; set; } + + //identifiers + public override int Id { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderGuid")] + public Guid OrderGuid { get; set; } + + [NopResourceDisplayName("Admin.Orders.Fields.InvoiceId")] + public string InvoiceId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.InvoiceDateUtc")] + [UIHint("DateTimeNullable")] + public DateTime? InvoiceDateUtc { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CustomOrderNumber")] + public string CustomOrderNumber { get; set; } + + //store + [NopResourceDisplayName("Admin.Orders.Fields.Store")] + public string StoreName { get; set; } + + //customer info + [NopResourceDisplayName("Admin.Orders.Fields.Customer")] + public int CustomerId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Customer")] + public string CustomerInfo { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CustomerEmail")] + public string CustomerEmail { get; set; } + public string CustomerFullName { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CustomerIP")] + public string CustomerIp { get; set; } + + [NopResourceDisplayName("Admin.Orders.Fields.CustomValues")] + public Dictionary CustomValues { get; set; } + + [NopResourceDisplayName("Admin.Orders.Fields.Affiliate")] + public int AffiliateId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Affiliate")] + public string AffiliateName { get; set; } + + //Used discounts + [NopResourceDisplayName("Admin.Orders.Fields.UsedDiscounts")] + public IList UsedDiscounts { get; set; } + + //totals + public bool AllowCustomersToSelectTaxDisplayType { get; set; } + public TaxDisplayType TaxDisplayType { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderSubtotalInclTax")] + public string OrderSubtotalInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderSubtotalExclTax")] + public string OrderSubtotalExclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderSubTotalDiscountInclTax")] + public string OrderSubTotalDiscountInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderSubTotalDiscountExclTax")] + public string OrderSubTotalDiscountExclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderShippingInclTax")] + public string OrderShippingInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderShippingExclTax")] + public string OrderShippingExclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderShippingNonTaxable")] + public string OrderShippingNonTaxable { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethodAdditionalFeeInclTax")] + public string PaymentMethodAdditionalFeeInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethodAdditionalFeeExclTax")] + public string PaymentMethodAdditionalFeeExclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethodAdditionalFeeNonTaxable")] + public string PaymentMethodAdditionalFeeNonTaxable { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Tax")] + public string Tax { get; set; } + public IList TaxRates { get; set; } + public bool DisplayTax { get; set; } + public bool DisplayTaxRates { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderTotalDiscount")] + public string OrderTotalDiscount { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPoints")] + public int RedeemedRewardPoints { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPointsAmount")] + public string RedeemedRewardPointsAmount { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPointsPurchased")] + public int RedeemedRewardPointsPurchased { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.RedeemedRewardPointsAmountPurchased")] + public string RedeemedRewardPointsAmountPurchased { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderTotal")] + public string OrderTotal { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.RefundedAmount")] + public string RefundedAmount { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Profit")] + public string Profit { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderAmount")] + public string OrderAmount { get; set; } //MF 09.12.16 + [NopResourceDisplayName("Admin.Orders.Fields.OrderAmountIncl")] + public string OrderAmountIncl { get; set; } //MF 09.12.16 + [NopResourceDisplayName("Admin.Orders.Fields.OrderTotalDiscountIncl")] + public string OrderTotalDiscountIncl { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderTotalAmountIncl")] + public string OrderTotalAmountIncl { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.EarnedRewardPointsBaseAmountIncl")] + public string EarnedRewardPointsBaseAmountIncl { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.EarnedRewardPointsBaseAmountExcl")] + public string EarnedRewardPointsBaseAmountExcl { get; set; } + + //edit totals + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubtotal")] + public decimal OrderSubtotalInclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubtotal")] + public decimal OrderSubtotalExclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubTotalDiscount")] + public decimal OrderSubTotalDiscountInclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderSubTotalDiscount")] + public decimal OrderSubTotalDiscountExclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderShipping")] + public decimal OrderShippingInclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderShipping")] + public decimal OrderShippingExclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderShipping")] + public decimal OrderShippingNonTaxableValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.PaymentMethodAdditionalFee")] + public decimal PaymentMethodAdditionalFeeInclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.PaymentMethodAdditionalFee")] + public decimal PaymentMethodAdditionalFeeExclTaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.PaymentMethodAdditionalFee")] + public decimal PaymentMethodAdditionalFeeNonTaxableValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.Tax")] + public decimal TaxValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.TaxRates")] + public string TaxRatesValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderTotalDiscount")] + public decimal OrderTotalDiscountValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderTotal")] + public decimal OrderTotalValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderAmount")] + public decimal OrderAmountValue { get; set; } //MF 09.12.16 + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderAmountIncl")] + public decimal OrderAmountInclValue { get; set; } //MF 09.12.16 + [NopResourceDisplayName("Admin.Orders.Fields.Edit.OrderDiscountIncl")] + public decimal OrderTotalDiscountInclValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.EarnedRewardPointsBaseAmountIncl")] + public decimal EarnedRewardPointsBaseAmountInclValue { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.Edit.EarnedRewardPointsBaseAmountExcl")] + public decimal EarnedRewardPointsBaseAmountExclValue { get; set; } + //associated recurring payment id + [NopResourceDisplayName("Admin.Orders.Fields.RecurringPayment")] + public int RecurringPaymentId { get; set; } + + //order status + [NopResourceDisplayName("Admin.Orders.Fields.OrderStatus")] + public string OrderStatus { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.OrderStatus")] + public int OrderStatusId { get; set; } + + //payment info + [NopResourceDisplayName("Admin.Orders.Fields.PaymentStatus")] + public string PaymentStatus { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PaymentStatus")] + public int PaymentStatusId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PaymentMethod")] + public string PaymentMethod { get; set; } + + //credit card info + public bool AllowStoringCreditCardNumber { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardType")] + [AllowHtml] + public string CardType { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardName")] + [AllowHtml] + public string CardName { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardNumber")] + [AllowHtml] + public string CardNumber { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardCVV2")] + [AllowHtml] + public string CardCvv2 { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardExpirationMonth")] + [AllowHtml] + public string CardExpirationMonth { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CardExpirationYear")] + [AllowHtml] + public string CardExpirationYear { get; set; } + + //misc payment info + [NopResourceDisplayName("Admin.Orders.Fields.AuthorizationTransactionID")] + public string AuthorizationTransactionId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.CaptureTransactionID")] + public string CaptureTransactionId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.SubscriptionTransactionID")] + public string SubscriptionTransactionId { get; set; } + + //shipping info + public bool IsShippable { get; set; } + public bool PickUpInStore { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.PickupAddress")] + public AddressModel PickupAddress { get; set; } + public string PickupAddressGoogleMapsUrl { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.ShippingStatus")] + public string ShippingStatus { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.ShippingStatus")] + public int ShippingStatusId { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.ShippingAddress")] + public AddressModel ShippingAddress { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.ShippingMethod")] + public string ShippingMethod { get; set; } + public string ShippingAddressGoogleMapsUrl { get; set; } + public bool CanAddNewShipments { get; set; } + + //billing info + [NopResourceDisplayName("Admin.Orders.Fields.BillingAddress")] + public AddressModel BillingAddress { get; set; } + [NopResourceDisplayName("Admin.Orders.Fields.VatNumber")] + public string VatNumber { get; set; } + + //gift cards + public IList GiftCards { get; set; } + + //items + public bool HasDownloadableProducts { get; set; } + public IList Items { get; set; } + + //creation date + [NopResourceDisplayName("Admin.Orders.Fields.CreatedOn")] + public DateTime CreatedOn { get; set; } + + //checkout attributes + public string CheckoutAttributeInfo { get; set; } + + + //order notes + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.DisplayToCustomer")] + public bool AddOrderNoteDisplayToCustomer { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Note")] + [AllowHtml] + public string AddOrderNoteMessage { get; set; } + public bool AddOrderNoteHasDownload { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] + [UIHint("Download")] + public int AddOrderNoteDownloadId { get; set; } + + //refund info + [NopResourceDisplayName("Admin.Orders.Fields.PartialRefund.AmountToRefund")] + public decimal AmountToRefund { get; set; } + public decimal MaxAmountToRefund { get; set; } + public string PrimaryStoreCurrencyCode { get; set; } + + //workflow info + public bool CanCancelOrder { get; set; } + public bool CanCapture { get; set; } + public bool CanMarkOrderAsPaid { get; set; } + public bool CanRefund { get; set; } + public bool CanRefundOffline { get; set; } + public bool CanPartiallyRefund { get; set; } + public bool CanPartiallyRefundOffline { get; set; } + public bool CanVoid { get; set; } + public bool CanVoidOffline { get; set; } + + //warnings + public List Warnings { get; set; } + + #region Nested Classes + + public partial class OrderItemModel : BaseNopEntityModel + { + public OrderItemModel() + { + PurchasedGiftCardIds = new List(); + ReturnRequests = new List(); + } + public int ProductId { get; set; } + public string ProductName { get; set; } + public string VendorName { get; set; } + public string Sku { get; set; } + + public string PictureThumbnailUrl { get; set; } + + public string UnitPriceInclTax { get; set; } + public string UnitPriceExclTax { get; set; } + public decimal UnitPriceInclTaxValue { get; set; } + public decimal UnitPriceExclTaxValue { get; set; } + + public int Quantity { get; set; } + + public string DiscountInclTax { get; set; } + public string DiscountExclTax { get; set; } + public decimal DiscountInclTaxValue { get; set; } + public decimal DiscountExclTaxValue { get; set; } + + public string SubTotalInclTax { get; set; } + public string SubTotalExclTax { get; set; } + public decimal SubTotalInclTaxValue { get; set; } + public decimal SubTotalExclTaxValue { get; set; } + + public string AttributeInfo { get; set; } + public string RecurringInfo { get; set; } + public string RentalInfo { get; set; } + public IList ReturnRequests { get; set; } + public IList PurchasedGiftCardIds { get; set; } + + public bool IsDownload { get; set; } + public int DownloadCount { get; set; } + public DownloadActivationType DownloadActivationType { get; set; } + public bool IsDownloadActivated { get; set; } + public Guid LicenseDownloadGuid { get; set; } + public decimal TaxRate { get; set; } + + #region Nested Classes + + public partial class ReturnRequestBriefModel : BaseNopEntityModel + { + public string CustomNumber { get; set; } + } + + #endregion + } + + public partial class TaxRate : BaseNopModel + { + [NopResourceDisplayName("Order.TaxRateLine.TaxRate")] + public string Rate { get; set; } + [NopResourceDisplayName("Order.TaxRateLine.Amount")] + public string Amount { get; set; } // includes subtotal, shipping and payment fee + [NopResourceDisplayName("Order.TaxRateLine.DiscountAmount")] + public string DiscountAmount { get; set; } + [NopResourceDisplayName("Order.TaxRateLine.BaseAmount")] + public string BaseAmount { get; set; } + [NopResourceDisplayName("Order.TaxRateLine.TaxAmount")] + public string TaxAmount { get; set; } + } + + public partial class GiftCard : BaseNopModel + { + [NopResourceDisplayName("Admin.Orders.Fields.GiftCardInfo")] + public string CouponCode { get; set; } + public string Amount { get; set; } + } + + public partial class OrderNote : BaseNopEntityModel + { + public int OrderId { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.DisplayToCustomer")] + public bool DisplayToCustomer { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Note")] + public string Note { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] + public int DownloadId { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.Download")] + public Guid DownloadGuid { get; set; } + [NopResourceDisplayName("Admin.Orders.OrderNotes.Fields.CreatedOn")] + public DateTime CreatedOn { get; set; } + } + + public partial class UploadLicenseModel : BaseNopModel + { + public int OrderId { get; set; } + + public int OrderItemId { get; set; } + + [UIHint("Download")] + public int LicenseDownloadId { get; set; } + + } + + public partial class AddOrderProductModel : BaseNopModel + { + public AddOrderProductModel() + { + AvailableCategories = new List(); + AvailableManufacturers = new List(); + AvailableProductTypes = new List(); + } + + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")] + [AllowHtml] + public string SearchProductName { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")] + public int SearchCategoryId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchManufacturer")] + public int SearchManufacturerId { get; set; } + [NopResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")] + public int SearchProductTypeId { get; set; } + + public IList AvailableCategories { get; set; } + public IList AvailableManufacturers { get; set; } + public IList AvailableProductTypes { get; set; } + + public int OrderId { get; set; } + + #region Nested classes + + public partial class ProductModel : BaseNopEntityModel + { + [NopResourceDisplayName("Admin.Orders.Products.AddNew.Name")] + [AllowHtml] + public string Name { get; set; } + + [NopResourceDisplayName("Admin.Orders.Products.AddNew.SKU")] + [AllowHtml] + public string Sku { get; set; } + } + + public partial class ProductDetailsModel : BaseNopModel + { + public ProductDetailsModel() + { + ProductAttributes = new List(); + GiftCard = new GiftCardModel(); + Warnings = new List(); + } + + public int ProductId { get; set; } + + public int OrderId { get; set; } + + public ProductType ProductType { get; set; } + + public string Name { get; set; } + + [NopResourceDisplayName("Admin.Orders.Products.AddNew.UnitPriceInclTax")] + public decimal UnitPriceInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Products.AddNew.UnitPriceExclTax")] + public decimal UnitPriceExclTax { get; set; } + + [NopResourceDisplayName("Admin.Orders.Products.AddNew.Quantity")] + public int Quantity { get; set; } + + [NopResourceDisplayName("Admin.Orders.Products.AddNew.SubTotalInclTax")] + public decimal SubTotalInclTax { get; set; } + [NopResourceDisplayName("Admin.Orders.Products.AddNew.SubTotalExclTax")] + public decimal SubTotalExclTax { get; set; } + [NopResourceDisplayName("ShoppingCart.TaxRate")] + public decimal TaxRate { get; set; } + + //product attributes + public IList ProductAttributes { get; set; } + //gift card info + public GiftCardModel GiftCard { get; set; } + //rental + public bool IsRental { get; set; } + + public List Warnings { get; set; } + + /// + /// A value indicating whether this attribute depends on some other attribute + /// + public bool HasCondition { get; set; } + + public bool AutoUpdateOrderTotals { get; set; } + } + + public partial class ProductAttributeModel : BaseNopEntityModel + { + public ProductAttributeModel() + { + Values = new List(); + } + + public int ProductAttributeId { get; set; } + + public string Name { get; set; } + + public string TextPrompt { get; set; } + + public bool IsRequired { get; set; } + + public bool HasCondition { get; set; } + + /// + /// Allowed file extensions for customer uploaded files + /// + public IList AllowedFileExtensions { get; set; } + + public AttributeControlType AttributeControlType { get; set; } + + public IList Values { get; set; } + } + + public partial class ProductAttributeValueModel : BaseNopEntityModel + { + public string Name { get; set; } + + public bool IsPreSelected { get; set; } + + public string PriceAdjustment { get; set; } + + public decimal PriceAdjustmentValue { get; set; } + + public bool CustomerEntersQty { get; set; } + + public int Quantity { get; set; } + } + + + public partial class GiftCardModel : BaseNopModel + { + public bool IsGiftCard { get; set; } + + [NopResourceDisplayName("Admin.GiftCards.Fields.RecipientName")] + [AllowHtml] + public string RecipientName { get; set; } + [NopResourceDisplayName("Admin.GiftCards.Fields.RecipientEmail")] + [AllowHtml] + public string RecipientEmail { get; set; } + [NopResourceDisplayName("Admin.GiftCards.Fields.SenderName")] + [AllowHtml] + public string SenderName { get; set; } + [NopResourceDisplayName("Admin.GiftCards.Fields.SenderEmail")] + [AllowHtml] + public string SenderEmail { get; set; } + [NopResourceDisplayName("Admin.GiftCards.Fields.Message")] + [AllowHtml] + public string Message { get; set; } + + public GiftCardType GiftCardType { get; set; } + } + #endregion + } + + public partial class UsedDiscountModel:BaseNopModel + { + public int DiscountId { get; set; } + public string DiscountName { get; set; } + } + + #endregion + } + + + public partial class OrderAggreratorModel : BaseNopModel + { + //aggergator properties + public string aggregatorprofit { get; set; } + public string aggregatorshipping { get; set; } + public string aggregatortax { get; set; } + public string aggregatortotal { get; set; } + public string aggregatortotalamountincl { get; set; } + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Settings/OrderSettingsModel.cs b/src/Presentation/Nop.Web/Administration/Models/Settings/OrderSettingsModel.cs index bc3c8f4b536..4b5536a3de1 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Settings/OrderSettingsModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Settings/OrderSettingsModel.cs @@ -1,110 +1,118 @@ -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Settings -{ - public partial class OrderSettingsModel : BaseNopModel - { - public int ActiveStoreScopeConfiguration { get; set; } - - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.IsReOrderAllowed")] - public bool IsReOrderAllowed { get; set; } - public bool IsReOrderAllowed_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderSubtotalAmount")] - public decimal MinOrderSubtotalAmount { get; set; } - public bool MinOrderSubtotalAmount_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderSubtotalAmountIncludingTax")] - public bool MinOrderSubtotalAmountIncludingTax { get; set; } - public bool MinOrderSubtotalAmountIncludingTax_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderTotalAmount")] - public decimal MinOrderTotalAmount { get; set; } - public bool MinOrderTotalAmount_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.AutoUpdateOrderTotalsOnEditingOrder")] - public bool AutoUpdateOrderTotalsOnEditingOrder { get; set; } - public bool AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.AnonymousCheckoutAllowed")] - public bool AnonymousCheckoutAllowed { get; set; } - public bool AnonymousCheckoutAllowed_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.TermsOfServiceOnShoppingCartPage")] - public bool TermsOfServiceOnShoppingCartPage { get; set; } - public bool TermsOfServiceOnShoppingCartPage_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.TermsOfServiceOnOrderConfirmPage")] - public bool TermsOfServiceOnOrderConfirmPage { get; set; } - public bool TermsOfServiceOnOrderConfirmPage_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.OnePageCheckoutEnabled")] - public bool OnePageCheckoutEnabled { get; set; } - public bool OnePageCheckoutEnabled_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab")] - public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab { get; set; } - public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.DisableBillingAddressCheckoutStep")] - public bool DisableBillingAddressCheckoutStep { get; set; } - public bool DisableBillingAddressCheckoutStep_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.DisableOrderCompletedPage")] - public bool DisableOrderCompletedPage { get; set; } - public bool DisableOrderCompletedPage_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderPlacedEmail")] - public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; } - public bool AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderPaidEmail")] - public bool AttachPdfInvoiceToOrderPaidEmail { get; set; } - public bool AttachPdfInvoiceToOrderPaidEmail_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderCompletedEmail")] - public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; } - public bool AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestsEnabled")] - public bool ReturnRequestsEnabled { get; set; } - public bool ReturnRequestsEnabled_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestsAllowFiles")] - public bool ReturnRequestsAllowFiles { get; set; } - public bool ReturnRequestsAllowFiles_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestNumberMask")] - public string ReturnRequestNumberMask { get; set; } - public bool ReturnRequestNumberMask_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.NumberOfDaysReturnRequestAvailable")] - public int NumberOfDaysReturnRequestAvailable { get; set; } - public bool NumberOfDaysReturnRequestAvailable_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.ActivateGiftCardsAfterCompletingOrder")] - public bool ActivateGiftCardsAfterCompletingOrder { get; set; } - [NopResourceDisplayName("Admin.Configuration.Settings.Order.DeactivateGiftCardsAfterCancellingOrder")] - public bool DeactivateGiftCardsAfterCancellingOrder { get; set; } - [NopResourceDisplayName("Admin.Configuration.Settings.Order.DeactivateGiftCardsAfterDeletingOrder")] - public bool DeactivateGiftCardsAfterDeletingOrder { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.CompleteOrderWhenDelivered")] - public bool CompleteOrderWhenDelivered { get; set; } - - public string PrimaryStoreCurrencyCode { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.OrderIdent")] - public int? OrderIdent { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.CustomOrderNumberMask")] - public string CustomOrderNumberMask { get; set; } - public bool CustomOrderNumberMask_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.Order.ExportWithProducts")] - public bool ExportWithProducts { get; set; } - public bool ExportWithProducts_OverrideForStore { get; set; } - } +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Settings +{ + public partial class OrderSettingsModel : BaseNopModel + { + public int ActiveStoreScopeConfiguration { get; set; } + + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.IsReOrderAllowed")] + public bool IsReOrderAllowed { get; set; } + public bool IsReOrderAllowed_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderSubtotalAmount")] + public decimal MinOrderSubtotalAmount { get; set; } + public bool MinOrderSubtotalAmount_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderSubtotalAmountIncludingTax")] + public bool MinOrderSubtotalAmountIncludingTax { get; set; } + public bool MinOrderSubtotalAmountIncludingTax_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.MinOrderTotalAmount")] + public decimal MinOrderTotalAmount { get; set; } + public bool MinOrderTotalAmount_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AutoUpdateOrderTotalsOnEditingOrder")] + public bool AutoUpdateOrderTotalsOnEditingOrder { get; set; } + public bool AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AnonymousCheckoutAllowed")] + public bool AnonymousCheckoutAllowed { get; set; } + public bool AnonymousCheckoutAllowed_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.TermsOfServiceOnShoppingCartPage")] + public bool TermsOfServiceOnShoppingCartPage { get; set; } + public bool TermsOfServiceOnShoppingCartPage_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.TermsOfServiceOnOrderConfirmPage")] + public bool TermsOfServiceOnOrderConfirmPage { get; set; } + public bool TermsOfServiceOnOrderConfirmPage_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.OnePageCheckoutEnabled")] + public bool OnePageCheckoutEnabled { get; set; } + public bool OnePageCheckoutEnabled_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab")] + public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab { get; set; } + public bool OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.DisableBillingAddressCheckoutStep")] + public bool DisableBillingAddressCheckoutStep { get; set; } + public bool DisableBillingAddressCheckoutStep_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.DisableOrderCompletedPage")] + public bool DisableOrderCompletedPage { get; set; } + public bool DisableOrderCompletedPage_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderPlacedEmail")] + public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; } + public bool AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderPaidEmail")] + public bool AttachPdfInvoiceToOrderPaidEmail { get; set; } + public bool AttachPdfInvoiceToOrderPaidEmail_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AttachPdfInvoiceToOrderCompletedEmail")] + public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; } + public bool AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestsEnabled")] + public bool ReturnRequestsEnabled { get; set; } + public bool ReturnRequestsEnabled_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestsAllowFiles")] + public bool ReturnRequestsAllowFiles { get; set; } + public bool ReturnRequestsAllowFiles_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.ReturnRequestNumberMask")] + public string ReturnRequestNumberMask { get; set; } + public bool ReturnRequestNumberMask_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.NumberOfDaysReturnRequestAvailable")] + public int NumberOfDaysReturnRequestAvailable { get; set; } + public bool NumberOfDaysReturnRequestAvailable_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.ActivateGiftCardsAfterCompletingOrder")] + public bool ActivateGiftCardsAfterCompletingOrder { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.Order.DeactivateGiftCardsAfterCancellingOrder")] + public bool DeactivateGiftCardsAfterCancellingOrder { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.Order.DeactivateGiftCardsAfterDeletingOrder")] + public bool DeactivateGiftCardsAfterDeletingOrder { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.CompleteOrderWhenDelivered")] + public bool CompleteOrderWhenDelivered { get; set; } + + public string PrimaryStoreCurrencyCode { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.OrderIdent")] + public int? OrderIdent { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.Order.InvoiceIdent")] + public int InvoiceIdent { get; set; } + public bool InvoiceIdent_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.Order.InvoiceYear")] + public int InvoiceYear { get; set; } //InvoiceYear_OverrideForStore = InvoiceIdent_OverrideForStore + public bool InvoiceYear_OverrideForStore { get { return InvoiceIdent_OverrideForStore; } set { InvoiceIdent_OverrideForStore = value; } } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.CustomOrderNumberMask")] + public string CustomOrderNumberMask { get; set; } + public bool CustomOrderNumberMask_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.Order.ExportWithProducts")] + public bool ExportWithProducts { get; set; } + public bool ExportWithProducts_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.Order.AssignInvoiceIdentFromTask")] + public bool AssignInvoiceIdentFromTask { get; set; } + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Models/Settings/ProductEditorSettingsModel.cs b/src/Presentation/Nop.Web/Administration/Models/Settings/ProductEditorSettingsModel.cs index 5130fc45a12..64bffbac077 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Settings/ProductEditorSettingsModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Settings/ProductEditorSettingsModel.cs @@ -82,6 +82,8 @@ public partial class ProductEditorSettingsModel : BaseNopModel [NopResourceDisplayName("Admin.Configuration.Settings.ProductEditor.IsGiftCard")] public bool IsGiftCard { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.ProductEditor.IsRewardPoints")] + public bool IsRewardPoints { get; set; } [NopResourceDisplayName("Admin.Configuration.Settings.ProductEditor.DownloadableProduct")] public bool DownloadableProduct { get; set; } diff --git a/src/Presentation/Nop.Web/Administration/Models/Settings/RewardPointsSettingsModel.cs b/src/Presentation/Nop.Web/Administration/Models/Settings/RewardPointsSettingsModel.cs index a7ffc576f75..72060d66acd 100644 --- a/src/Presentation/Nop.Web/Administration/Models/Settings/RewardPointsSettingsModel.cs +++ b/src/Presentation/Nop.Web/Administration/Models/Settings/RewardPointsSettingsModel.cs @@ -1,53 +1,73 @@ -using Nop.Web.Framework; -using Nop.Web.Framework.Mvc; - -namespace Nop.Admin.Models.Settings -{ - public partial class RewardPointsSettingsModel : BaseNopModel - { - public int ActiveStoreScopeConfiguration { get; set; } - - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.Enabled")] - public bool Enabled { get; set; } - public bool Enabled_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ExchangeRate")] - public decimal ExchangeRate { get; set; } - public bool ExchangeRate_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.MinimumRewardPointsToUse")] - public int MinimumRewardPointsToUse { get; set; } - public bool MinimumRewardPointsToUse_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsForRegistration")] - public int PointsForRegistration { get; set; } - public bool PointsForRegistration_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsForPurchases_Amount")] - public decimal PointsForPurchases_Amount { get; set; } - public int PointsForPurchases_Points { get; set; } - public bool PointsForPurchases_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ActivatePointsImmediately")] - public bool ActivatePointsImmediately { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ActivationDelay")] - public int ActivationDelay { get; set; } - public bool ActivationDelay_OverrideForStore { get; set; } - public int ActivationDelayPeriodId { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.DisplayHowMuchWillBeEarned")] - public bool DisplayHowMuchWillBeEarned { get; set; } - public bool DisplayHowMuchWillBeEarned_OverrideForStore { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsAccumulatedForAllStores")] - public bool PointsAccumulatedForAllStores { get; set; } - - [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PageSize")] - public int PageSize { get; set; } - public bool PageSize_OverrideForStore { get; set; } - - public string PrimaryStoreCurrencyCode { get; set; } - } +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Admin.Models.Settings +{ + public partial class RewardPointsSettingsModel : BaseNopModel + { + public int ActiveStoreScopeConfiguration { get; set; } + + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.Enabled")] + public bool Enabled { get; set; } + public bool Enabled_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ExchangeRate")] + public decimal ExchangeRate { get; set; } + public bool ExchangeRate_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.MinimumRewardPointsToUse")] + public int MinimumRewardPointsToUse { get; set; } + public bool MinimumRewardPointsToUse_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsForRegistration")] + public int PointsForRegistration { get; set; } + public bool PointsForRegistration_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsForPurchases_Amount")] + public decimal PointsForPurchases_Amount { get; set; } + public int PointsForPurchases_Points { get; set; } + public bool PointsForPurchases_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ActivatePointsImmediately")] + public bool ActivatePointsImmediately { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.ActivationDelay")] + public int ActivationDelay { get; set; } + public bool ActivationDelay_OverrideForStore { get; set; } + public int ActivationDelayPeriodId { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.DisplayHowMuchWillBeEarned")] + public bool DisplayHowMuchWillBeEarned { get; set; } + public bool DisplayHowMuchWillBeEarned_OverrideForStore { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PointsAccumulatedForAllStores")] + public bool PointsAccumulatedForAllStores { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.PageSize")] + public int PageSize { get; set; } + public bool PageSize_OverrideForStore { get; set; } + + public string PrimaryStoreCurrencyCode { get; set; } + + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.EarnedRewardPointsAreTaxable")] + public bool EarnedRewardPointsAreTaxable { get; set; } + public bool EarnedRewardPointsAreTaxable_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.AwardPointsIncludeShipping")] + public bool AwardPointsIncludeShipping { get; set; } + public bool AwardPointsIncludeShipping_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.AwardPointsIncludePaymentMethodAdditionalFee")] + public bool AwardPointsIncludePaymentMethodAdditionalFee { get; set; } + public bool AwardPointsIncludePaymentMethodAdditionalFee_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.AwardPointsExcludeGiftCard")] + public bool AwardPointsExcludeGiftCard { get; set; } + public bool AwardPointsExcludeGiftCard_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.AwardPointsExcludePurchasedRewardPoints")] + public bool AwardPointsExcludePurchasedRewardPoints { get; set; } + public bool AwardPointsExcludePurchasedRewardPoints_OverrideForStore { get; set; } + [NopResourceDisplayName("Admin.Configuration.Settings.RewardPoints.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints")] + public bool EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints { get; set; } + public bool EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints_OverrideForStore { get; set; } + + } } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Views/Customer/_CreateOrUpdate.cshtml b/src/Presentation/Nop.Web/Administration/Views/Customer/_CreateOrUpdate.cshtml index 0b01572124c..423a1f204bf 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Customer/_CreateOrUpdate.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Customer/_CreateOrUpdate.cshtml @@ -25,7 +25,7 @@ @Html.RenderBootstrapTabHeader("tab-activitylog", @T("Admin.Customers.Customers.ActivityLog")) @Html.RenderBootstrapTabHeader("tab-impersonate", @T("Admin.Customers.Customers.Impersonate")) @Html.RenderBootstrapTabHeader("tab-backinstock", @T("Admin.Customers.Customers.BackInStockSubscriptions")) - } + } @if (Model.DisplayRewardPointsHistory) { @Html.RenderBootstrapTabHeader("tab-rewardpoints", @T("Admin.Customers.Customers.RewardPoints")) @@ -42,7 +42,7 @@ @Html.RenderBootstrapTabContent("tab-activitylog", @TabActivityLog()) @Html.RenderBootstrapTabContent("tab-impersonate", @TabImpersonate()) @Html.RenderBootstrapTabContent("tab-backinstock", @TabBackInStockSubscriptions()) - } + } @if (Model.DisplayRewardPointsHistory) { @Html.RenderBootstrapTabContent("tab-rewardpoints", @TabRewardPoints()) @@ -1153,12 +1153,36 @@ var stores = EngineContext.Current.Resolve().GetAllStores(); type: "POST", dataType: "json", data: addAntiForgeryToken + }, + update: { + url: "@Html.Raw(Url.Action("RewardPointsHistoryUpdate", "Customer"))", + type: "POST", + dataType: "json", + data: addAntiForgeryToken } }, schema: { data: "Data", total: "Total", - errors: "Errors" + errors: "Errors", + model: { + id: "Id", + fields: { + StoreName: { editable: false, type: "string" }, + Points: { editable: false, type: "number" }, + PointsBalance: { editable: false, type: "string" }, + PointsPurchased: { editable: false, type: "string" }, + PointsBalancePurchased: { editable: false, type: "string" }, + Message: { editable: true, type: "string" }, + CreatedOn: { editable: false, type: "date" }, + Id: { editable: false, type: "number" } + } + } + }, + requestEnd: function(e) { + if (e.type == "update") { + this.read(); + } }, error: function(e) { display_kendoui_grid_error(e); @@ -1191,6 +1215,12 @@ var stores = EngineContext.Current.Resolve().GetAllStores(); }, { field: "PointsBalance", title: "@T("Admin.Customers.Customers.RewardPoints.Fields.PointsBalance")" + }, { + field: "PointsPurchased", + title: "@T("Admin.Customers.Customers.RewardPoints.Fields.PointsPurchased")" + }, { + field: "PointsBalancePurchased", + title: "@T("Admin.Customers.Customers.RewardPoints.Fields.PointsBalancePurchased")" }, { field: "Message", title: "@T("Admin.Customers.Customers.RewardPoints.Fields.Message")" @@ -1198,8 +1228,19 @@ var stores = EngineContext.Current.Resolve().GetAllStores(); field: "CreatedOn", title: "@T("Admin.Promotions.Campaigns.Fields.CreatedOn")", width: 200, - type: "date", - format: "{0:G}" + format: "{0:G}"" + }, { + command: [ + { + name: "edit", + text: { + edit: "@T("Admin.Common.Edit")", + update: "@T("Admin.Common.Update")", + cancel: "@T("Admin.Common.Cancel")" + } + } + ], + width: 200 } ] }); @@ -1222,6 +1263,15 @@ var stores = EngineContext.Current.Resolve().GetAllStores(); @Html.ValidationMessageFor(model => model.AddRewardPointsValue) +
+
+ @Html.NopLabelFor(model => model.AddRewardPointsValuePurchased) +
+
+ @Html.NopEditorFor(model => model.AddRewardPointsValuePurchased) + @Html.ValidationMessageFor(model => model.AddRewardPointsValuePurchased) +
+
@Html.NopLabelFor(model => model.AddRewardPointsMessage) @@ -1253,12 +1303,13 @@ var stores = EngineContext.Current.Resolve().GetAllStores(); $(document).ready(function () { $('#addRewardPoints').click(function () { var rewardPointsValue = $("#@Html.FieldIdFor(model => model.AddRewardPointsValue)").val(); + var rewardPointsValuePurchased = $("#@Html.FieldIdFor(model => model.AddRewardPointsValuePurchased)").val(); var rewardPointsMessage = $("#@Html.FieldIdFor(model => model.AddRewardPointsMessage)").val(); var rewardPointsStoreId = $("#@Html.FieldIdFor(model => model.AddRewardPointsStoreId)").val(); $('#addRewardPoints').attr('disabled', true); var postData = { - addRewardPointsValue: rewardPointsValue, + addRewardPointsValue: [rewardPointsValue, rewardPointsValuePurchased], addRewardPointsMessage: rewardPointsMessage, storeId: rewardPointsStoreId, customerId: @Model.Id diff --git a/src/Presentation/Nop.Web/Administration/Views/Order/AddProductToOrderDetails.cshtml b/src/Presentation/Nop.Web/Administration/Views/Order/AddProductToOrderDetails.cshtml index 17ef294bc0f..1ac98399b52 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Order/AddProductToOrderDetails.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Order/AddProductToOrderDetails.cshtml @@ -1,142 +1,150 @@ -@model OrderModel.AddOrderProductModel.ProductDetailsModel - -@using Nop.Core.Domain.Catalog - -@{ - //page title - ViewBag.Title = string.Format(T("Admin.Orders.Products.AddNew.Title2").Text, Model.Name, Model.OrderId); - //active menu item (system name) - Html.SetActiveMenuItemSystemName("Orders"); -} - -@*we add enctype = "multipart/form-data" because "File upload" attribute control type requires it*@ -@using (Html.BeginForm("AddProductToOrderDetails", "Order", - new RouteValueDictionary(new { orderId = Model.OrderId, productId = Model.ProductId }), - FormMethod.Post, - new Dictionary { { "enctype", "multipart/form-data" }, {"id", "product-details-form" } })) -{ - @Html.AntiForgeryToken() - @Html.ValidationSummary(false) -
-

- @string.Format(T("Admin.Orders.Products.AddNew.Title2").Text, Model.Name, Model.OrderId) - @Html.ActionLink(T("Admin.Orders.Products.AddNew.BackToList").Text, "AddProductToOrder", new { orderId = Model.OrderId }) -

-
-   -
-
- -
- @if (Model.Warnings.Count > 0) - { -
-
    - @foreach (var warning in Model.Warnings) - { -
  • @warning
  • - } -
-
- } - -
-
- @if (Model.ProductType == ProductType.SimpleProduct) - { -
-
-
-
- @Html.NopLabelFor(model => model.UnitPriceInclTax) -
-
- @Html.NopEditorFor(model => model.UnitPriceInclTax) -
-
-
-
- @Html.NopLabelFor(model => model.UnitPriceExclTax) -
-
- @Html.NopEditorFor(model => model.UnitPriceExclTax) -
-
-
-
- @Html.NopLabelFor(model => model.Quantity) -
-
- @Html.NopEditorFor(model => model.Quantity) -
-
-
-
- @Html.NopLabelFor(model => model.SubTotalInclTax) -
-
- @Html.NopEditorFor(model => model.SubTotalInclTax) -
-
-
-
- @Html.NopLabelFor(model => model.SubTotalExclTax) -
-
- @Html.NopEditorFor(model => model.SubTotalExclTax) -
-
-
-
- - @Html.Partial("_ProductAddAttributes", Model.ProductAttributes, new ViewDataDictionary() {new KeyValuePair("productId", Model.ProductId)}) - - var dataDictGiftCard = new ViewDataDictionary(); - dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = "giftcard"; - @Html.Partial("_ProductAddGiftCardInfo", Model.GiftCard, dataDictGiftCard) - - @Html.Partial("_ProductAddRentalInfo", Model) - -
-
- @if (!Model.AutoUpdateOrderTotals) - { -
-
-

- @T("Admin.Orders.Products.AddNew.UpdateTotals") -

-
-
- } -
-
- -
-
-
-
- } - else if (Model.ProductType == ProductType.GroupedProduct) - { -
-
- @*TODO add support for grouped products to be added to an existing order*@ - Grouped products are not currently supported for adding to an existing order -
-
- } - else - { -
-
- This product type (unknown) is not currently supported for adding to an existing order -
-
- } -
-
-
+@model OrderModel.AddOrderProductModel.ProductDetailsModel + +@using Nop.Core.Domain.Catalog + +@{ + //page title + ViewBag.Title = string.Format(T("Admin.Orders.Products.AddNew.Title2").Text, Model.Name, Model.OrderId); + //active menu item (system name) + Html.SetActiveMenuItemSystemName("Orders"); +} + +@*we add enctype = "multipart/form-data" because "File upload" attribute control type requires it*@ +@using (Html.BeginForm("AddProductToOrderDetails", "Order", + new RouteValueDictionary(new { orderId = Model.OrderId, productId = Model.ProductId }), + FormMethod.Post, + new Dictionary { { "enctype", "multipart/form-data" }, {"id", "product-details-form" } })) +{ + @Html.AntiForgeryToken() + @Html.ValidationSummary(false) +
+

+ @string.Format(T("Admin.Orders.Products.AddNew.Title2").Text, Model.Name, Model.OrderId) + @Html.ActionLink(T("Admin.Orders.Products.AddNew.BackToList").Text, "AddProductToOrder", new { orderId = Model.OrderId }) +

+
+   +
+
+ +
+ @if (Model.Warnings.Count > 0) + { +
+
    + @foreach (var warning in Model.Warnings) + { +
  • @warning
  • + } +
+
+ } + +
+
+ @if (Model.ProductType == ProductType.SimpleProduct) + { +
+
+
+
+ @Html.NopLabelFor(model => model.UnitPriceInclTax) +
+
+ @Html.NopEditorFor(model => model.UnitPriceInclTax) +
+
+
+
+ @Html.NopLabelFor(model => model.UnitPriceExclTax) +
+
+ @Html.NopEditorFor(model => model.UnitPriceExclTax) +
+
+
+
+ @Html.NopLabelFor(model => model.Quantity) +
+
+ @Html.NopEditorFor(model => model.Quantity) +
+
+
+
+ @Html.NopLabelFor(model => model.SubTotalInclTax) +
+
+ @Html.NopEditorFor(model => model.SubTotalInclTax) +
+
+
+
+ @Html.NopLabelFor(model => model.SubTotalExclTax) +
+
+ @Html.NopEditorFor(model => model.SubTotalExclTax) +
+
+
+
+ @Html.NopLabelFor(model => model.TaxRate) +
+
+ @Html.NopEditorFor(model => model.TaxRate) +
+
+
+
+ + @Html.Partial("_ProductAddAttributes", Model.ProductAttributes, new ViewDataDictionary() {new KeyValuePair("productId", Model.ProductId)}) + + var dataDictGiftCard = new ViewDataDictionary(); + dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = "giftcard"; + @Html.Partial("_ProductAddGiftCardInfo", Model.GiftCard, dataDictGiftCard) + + @Html.Partial("_ProductAddRentalInfo", Model) + +
+
+ @if (!Model.AutoUpdateOrderTotals) + { +
+
+

+ @T("Admin.Orders.Products.AddNew.UpdateTotals") +

+
+
+ } +
+
+ +
+
+
+
+ } + else if (Model.ProductType == ProductType.GroupedProduct) + { +
+
+ @*TODO add support for grouped products to be added to an existing order*@ + Grouped products are not currently supported for adding to an existing order +
+
+ } + else + { +
+
+ This product type (unknown) is not currently supported for adding to an existing order +
+
+ } +
+
+
} \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Views/Order/List.cshtml b/src/Presentation/Nop.Web/Administration/Views/Order/List.cshtml index 5fc1aa6bf12..663cb6c1fdc 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Order/List.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Order/List.cshtml @@ -1,571 +1,588 @@ -@using Nop.Services.Stores -@model OrderListModel - -@{ - var defaultGridPageSize = EngineContext.Current.Resolve().DefaultGridPageSize; - var gridPageSizes = EngineContext.Current.Resolve().GridPageSizes; - var stores = EngineContext.Current.Resolve().GetAllStores(); - - //page title - ViewBag.Title = T("Admin.Orders").Text; - //active menu item (system name) - Html.SetActiveMenuItemSystemName("Orders"); -} - -@using (Html.BeginForm()) -{ - @Html.AntiForgeryToken() -
-

- @T("Admin.Orders") -

-
-
- - - -
-
- - - -
-
-
- -
-
-
- - -
-
-
- - - - -
-
-
-
-
-} - -@*export selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ -@using (Html.BeginForm("ExportXmlSelected", "Order", FormMethod.Post, new { id = "export-xml-selected-form" })) -{ - @Html.AntiForgeryToken() - -} - - - -@*export selected (Excel). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ -@using (Html.BeginForm("ExportExcelSelected", "Order", FormMethod.Post, new { id = "export-excel-selected-form" })) -{ - @Html.AntiForgeryToken() - -} - - - -@*Print packaging slips selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ -@using (Html.BeginForm("PdfInvoiceSelected", "Order", FormMethod.Post, new { id = "pdf-invoice-selected-form" })) -{ - @Html.AntiForgeryToken() - -} - - +
+
+
+
+ @Html.NopLabelFor(model => model.OrderStatusIds) +
+
+ @Html.EditorFor(model => model.OrderStatusIds, new { SelectList = Model.AvailableOrderStatuses }) +
+
+
+
+ @Html.NopLabelFor(model => model.PaymentStatusIds) +
+
+ @Html.EditorFor(model => model.PaymentStatusIds, new { SelectList = Model.AvailablePaymentStatuses }) +
+
+
+
+ @Html.NopLabelFor(model => model.ShippingStatusIds) +
+
+ @Html.EditorFor(model => model.ShippingStatusIds, new { SelectList = Model.AvailableShippingStatuses }) +
+
+ +
+
+
+ @Html.NopLabelFor(model => model.StoreId) +
+
+ @Html.NopDropDownList("StoreId", Model.AvailableStores) +
+
+
+
+ @Html.NopLabelFor(model => model.VendorId) +
+
+ @Html.NopDropDownList("VendorId", Model.AvailableVendors) +
+
+
+
+ @Html.NopLabelFor(model => model.BillingEmail) +
+
+ @Html.NopEditorFor(model => model.BillingEmail) +
+
+
+
+ @Html.NopLabelFor(model => model.BillingLastName) +
+
+ @Html.NopEditorFor(model => model.BillingLastName) +
+
+
+
+ @Html.NopLabelFor(model => model.BillingCountryId) +
+
+ @Html.NopDropDownList("BillingCountryId", Model.AvailableCountries) +
+
+
+
+ @Html.NopLabelFor(model => model.PaymentMethodSystemName) +
+
+ @Html.NopDropDownList("PaymentMethodSystemName", Model.AvailablePaymentMethods) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderNotes) +
+
+ @Html.NopEditorFor(model => model.OrderNotes) +
+
+
+
+ @Html.NopLabelFor(model => model.GoDirectlyToCustomOrderNumber) +
+
+
+ @Html.NopEditorFor(model => model.GoDirectlyToCustomOrderNumber) + + + +
+
+
+
+ +
+
+ +
+
+ + + +
+
+
+ + + + +
+
+ + + +} + +@*export selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ +@using (Html.BeginForm("ExportXmlSelected", "Order", FormMethod.Post, new { id = "export-xml-selected-form" })) +{ + @Html.AntiForgeryToken() + +} + + + +@*export selected (Excel). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ +@using (Html.BeginForm("ExportExcelSelected", "Order", FormMethod.Post, new { id = "export-excel-selected-form" })) +{ + @Html.AntiForgeryToken() + +} + + + +@*Print packaging slips selected (XML). We don't use GET approach because it's limited to 2K-4K chars and won't work for large number of entities*@ +@using (Html.BeginForm("PdfInvoiceSelected", "Order", FormMethod.Post, new { id = "pdf-invoice-selected-form" })) +{ + @Html.AntiForgeryToken() + +} + + \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Info.cshtml b/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Info.cshtml index 71e69d98983..88d1f2e5a7a 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Info.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Info.cshtml @@ -1,824 +1,1038 @@ -@model OrderModel - -@using Nop.Core.Domain.Tax; -@using Nop.Core.Domain.Orders; -@using Nop.Services -@if (!Model.IsLoggedInAsVendor) -{ - -} -
-
-
- @if (!Model.IsLoggedInAsVendor) - { -
-
- @Html.NopLabelFor(model => model.OrderStatus) -
-
-
-
- - @Html.NopDisplayFor(model => model.OrderStatus) - -
-
- @if (Model.CanCancelOrder) - { - - @Html.ActionConfirmation("cancelorder") - } - -
- @Html.NopDropDownListFor(model => model.OrderStatusId, ((OrderStatus) Model.OrderStatusId).ToSelectList()) - - @Html.ActionConfirmation("btnSaveOrderStatus") - -
- @T("Admin.Orders.Fields.OrderStatus.Change.ForAdvancedUsers") -
-
-
-
-
-
- } - else - { - //vendors should see whether or order is cancelled - if (Model.OrderStatusId == (int)OrderStatus.Cancelled) - { -
-
-   -
-
- - @T("Admin.Orders.Fields.OrderStatus.CancelledNotification") - -
-
- } - } -
-
- @Html.NopLabelFor(model => model.CustomOrderNumber) -
-
- @Html.NopDisplayFor(model => model.CustomOrderNumber) -
-
- @if (!Model.IsLoggedInAsVendor) - { -
-
- @Html.NopLabelFor(model => model.OrderGuid) -
-
- @Html.NopDisplayFor(model => model.OrderGuid) -
-
- } -
-
- @Html.NopLabelFor(model => model.StoreName) -
-
- @Html.NopDisplayFor(model => model.StoreName) -
-
-
-
- - @if (!Model.IsLoggedInAsVendor) - { -
-
-
-
- @Html.NopLabelFor(model => model.CustomerId) -
-
- @Html.ActionLink(Model.CustomerInfo, "Edit", "Customer", new { id = Model.CustomerId }, new { }) -
-
-
-
- @Html.NopLabelFor(model => model.CustomerIp) -
-
- @Html.NopDisplayFor(model => model.CustomerIp) -
-
- @if (Model.RecurringPaymentId > 0) - { -
-
- @Html.NopLabelFor(model => model.RecurringPaymentId) -
- -
- } - @if (!String.IsNullOrEmpty(Model.VatNumber)) - { -
-
- @Html.NopLabelFor(model => model.VatNumber) -
-
- @Html.NopDisplayFor(model => model.VatNumber) -
-
- } - @if (Model.AffiliateId > 0) - { -
-
- @Html.NopLabelFor(model => model.AffiliateId) -
- -
- } -
-
-
- -
- -
-
-
-
-
- @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) - { -
-
- @Html.DisplayFor(model => model.OrderSubtotalInclTax) @T("Admin.Orders.Fields.OrderSubtotalInclTax") -
-
- } - @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) - { -
-
- @Html.DisplayFor(model => model.OrderSubtotalExclTax) @T("Admin.Orders.Fields.OrderSubtotalExclTax") -
-
- } -
-
-
- @if (((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountInclTax)) || - ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountExclTax))) - { -
-
-
- -
- -
-
-
-
-
- @if ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountInclTax)) - { -
-
- @Html.DisplayFor(model => model.OrderSubTotalDiscountInclTax) @T("Admin.Orders.Fields.OrderSubTotalDiscountInclTax") -
-
- } - @if ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountExclTax)) - { -
-
- @Html.DisplayFor(model => model.OrderSubTotalDiscountExclTax) @T("Admin.Orders.Fields.OrderSubTotalDiscountExclTax") -
-
- } -
-
-
- } -
-
-
- -
- -
-
-
-
-
- @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) - { -
-
- @Html.DisplayFor(model => model.OrderShippingInclTax) @T("Admin.Orders.Fields.OrderShippingInclTax") -
-
- } - @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) - { -
-
- @Html.DisplayFor(model => model.OrderShippingExclTax) @T("Admin.Orders.Fields.OrderShippingExclTax") -
-
- } -
-
-
- @if (((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeInclTax)) || - ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeExclTax))) - { -
-
-
- -
- -
-
-
-
-
- @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) - { -
-
- @Html.DisplayFor(model => model.PaymentMethodAdditionalFeeInclTax) @T("Admin.Orders.Fields.PaymentMethodAdditionalFeeInclTax") -
-
- } - @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) - { -
-
- @Html.DisplayFor(model => model.PaymentMethodAdditionalFeeExclTax) @T("Admin.Orders.Fields.PaymentMethodAdditionalFeeExclTax") -
-
- } -
-
-
- } - @if (Model.DisplayTaxRates) - { - foreach (var tr in Model.TaxRates) - { -
-
- @Html.NopLabelFor(model => model.Tax) @tr.Rate% -
-
- @tr.Value -
-
- } - } - @if (Model.DisplayTax) - { -
-
- @Html.NopLabelFor(model => model.Tax) -
-
- @Html.NopDisplayFor(model => model.Tax) -
-
- } - @if (!String.IsNullOrEmpty(Model.OrderTotalDiscount)) - { -
-
- @Html.NopLabelFor(model => model.OrderTotalDiscount) -
-
- @Html.NopDisplayFor(model => model.OrderTotalDiscount) -
-
- } - @foreach (var gc in Model.GiftCards) - { -
-
- @Html.NopLabelFor(model => model.GiftCards[0].CouponCode) - (@(gc.CouponCode)) -
-
- @Html.NopDisplay(gc.Amount) -
-
- } - @if (Model.RedeemedRewardPoints > 0) - { -
-
- @Html.NopLabelFor(model => model.RedeemedRewardPoints) -
-
- @Html.NopDisplay(Model.RedeemedRewardPoints + @T("Admin.Orders.Fields.RedeemedRewardPoints.Points").Text + "/" + Model.RedeemedRewardPointsAmount) -
-
- } -
-
- @Html.NopLabelFor(model => model.OrderTotal) -
-
- @Html.NopDisplayFor(model => model.OrderTotal) -
-
- @if (!String.IsNullOrEmpty(Model.RefundedAmount)) - { -
-
- @Html.NopLabelFor(model => model.RefundedAmount) -
-
- @Html.NopDisplayFor(model => model.RefundedAmount) -
-
- } - @if (Model.UsedDiscounts.Count > 0) - { -
-
- @Html.NopLabelFor(model => model.UsedDiscounts) -
-
- @for (int i = 0; i < Model.UsedDiscounts.Count; i++) - { - var discount = Model.UsedDiscounts[i]; - @discount.DiscountName - if (i != Model.UsedDiscounts.Count - 1) - { - , - } - } -
-
- } -
-
- @Html.NopLabelFor(model => model.Profit) -
-
- @Html.NopDisplayFor(model => model.Profit) -
-
-
-
-
- @Html.NopLabelFor(model => model.OrderSubtotalInclTaxValue) -
-
-
- @T("Admin.Orders.Fields.Edit.InclTax") - @Html.NopEditorFor(model => model.OrderSubtotalInclTaxValue) -
-
- @T("Admin.Orders.Fields.Edit.ExclTax") - @Html.NopEditorFor(model => model.OrderSubtotalExclTaxValue) -
-
-
-
-
- @Html.NopLabelFor(model => model.OrderSubTotalDiscountInclTaxValue) -
-
-
- @T("Admin.Orders.Fields.Edit.InclTax") - @Html.NopEditorFor(model => model.OrderSubTotalDiscountInclTaxValue) -
-
- @T("Admin.Orders.Fields.Edit.ExclTax") - @Html.NopEditorFor(model => model.OrderSubTotalDiscountExclTaxValue) -
-
-
-
-
- @Html.NopLabelFor(model => model.OrderShippingInclTaxValue) -
-
-
- @T("Admin.Orders.Fields.Edit.InclTax") - @Html.NopEditorFor(model => model.OrderShippingInclTaxValue) -
-
- @T("Admin.Orders.Fields.Edit.ExclTax") - @Html.NopEditorFor(model => model.OrderShippingExclTaxValue) -
-
-
-
-
- @Html.NopLabelFor(model => model.PaymentMethodAdditionalFeeInclTaxValue) -
-
-
- @T("Admin.Orders.Fields.Edit.InclTax") - @Html.NopEditorFor(model => model.PaymentMethodAdditionalFeeInclTaxValue) -
-
- @T("Admin.Orders.Fields.Edit.ExclTax") - @Html.NopEditorFor(model => model.PaymentMethodAdditionalFeeExclTaxValue) -
-
-
-
-
- @Html.NopLabelFor(model => model.TaxRatesValue) -
-
- @Html.NopEditorFor(model => model.TaxRatesValue) -
-
-
-
- @Html.NopLabelFor(model => model.TaxValue) -
-
- @Html.NopEditorFor(model => model.TaxValue) -
-
-
-
- @Html.NopLabelFor(model => model.OrderTotalDiscountValue) -
-
- @Html.NopEditorFor(model => model.OrderTotalDiscountValue) -
-
-
-
- @Html.NopLabelFor(model => model.OrderTotalValue) -
-
- @Html.NopEditorFor(model => model.OrderTotalValue) -
-
-
-
-
- - - - @Html.ActionConfirmation("btnSaveOrderTotals") - - -
-
- @if (Model.AllowStoringCreditCardNumber) - { -
-
- @Html.NopLabelFor(model => model.CardType) -
-
-
- @Html.NopDisplayFor(model => model.CardType) -
- @Html.NopEditorFor(model => model.CardType) -
-
- } - @if (Model.AllowStoringCreditCardNumber) - { -
-
- @Html.NopLabelFor(model => model.CardName) -
-
-
- @Html.NopDisplayFor(model => model.CardName) -
- @Html.NopEditorFor(model => model.CardName) -
-
- } - @if (Model.AllowStoringCreditCardNumber || !String.IsNullOrEmpty(Model.CardNumber)) - { -
-
- @Html.NopLabelFor(model => model.CardNumber) -
-
-
- @Html.NopDisplayFor(model => model.CardNumber) -
- @Html.NopEditorFor(model => model.CardNumber) -
-
- } - @if (Model.AllowStoringCreditCardNumber) - { -
-
- @Html.NopLabelFor(model => model.CardCvv2) -
-
-
- @Html.NopDisplayFor(model => model.CardCvv2) -
- @Html.NopEditorFor(model => model.CardCvv2) -
-
- } - @if (Model.AllowStoringCreditCardNumber) - { -
-
- @Html.NopLabelFor(model => model.CardExpirationMonth) -
-
-
- @Html.NopDisplayFor(model => model.CardExpirationMonth) -
- @Html.NopEditorFor(model => model.CardExpirationMonth) -
-
- } - @if (Model.AllowStoringCreditCardNumber) - { -
-
- @Html.NopLabelFor(model => model.CardExpirationYear) -
-
-
- @Html.NopDisplayFor(model => model.CardExpirationYear) -
- @Html.NopEditorFor(model => model.CardExpirationYear) -
-
- } - @if (Model.AllowStoringCreditCardNumber) - { -
-
- - - - @Html.ActionConfirmation("btnSaveCC") - - -
-
- } - @if (!String.IsNullOrEmpty(Model.AuthorizationTransactionId)) - { -
-
- @Html.NopLabelFor(model => model.AuthorizationTransactionId) -
-
- @Html.NopDisplayFor(model => model.AuthorizationTransactionId) -
-
- } - @if (!String.IsNullOrEmpty(Model.CaptureTransactionId)) - { -
-
- @Html.NopLabelFor(model => model.CaptureTransactionId) -
-
- @Html.NopDisplayFor(model => model.CaptureTransactionId) -
-
- } - @if (!String.IsNullOrEmpty(Model.SubscriptionTransactionId)) - { -
-
- @Html.NopLabelFor(model => model.SubscriptionTransactionId) -
-
- @Html.NopDisplayFor(model => model.SubscriptionTransactionId) -
-
- } -
-
- @Html.NopLabelFor(model => model.PaymentMethod) -
-
- @Html.NopDisplayFor(model => model.PaymentMethod) -
-
-
-
- } -
-
-
-
- @Html.NopLabelFor(model => model.PaymentStatus) -
-
- @Html.NopDisplayFor(model => model.PaymentStatus) -
-
- @if (Model.CanCapture || Model.CanMarkOrderAsPaid || Model.CanRefund || Model.CanRefundOffline || - Model.CanPartiallyRefund || Model.CanPartiallyRefundOffline || Model.CanVoid || Model.CanVoidOffline) - { -
-
- @if (!Model.IsLoggedInAsVendor) - { - if (Model.CanCapture) - { - -   - @Html.ActionConfirmation("captureorder") - } - if (Model.CanMarkOrderAsPaid) - { - -   - @Html.ActionConfirmation("markorderaspaid") - } - if (Model.CanRefund) - { - -   - @Html.ActionConfirmation("refundorder") - } - if (Model.CanRefundOffline) - { - -   - @Html.ActionConfirmation("refundorderoffline") - } - if (Model.CanPartiallyRefund) - { - -   - } - if (Model.CanPartiallyRefundOffline) - { - -   - } - if (Model.CanVoid) - { - -   - @Html.ActionConfirmation("voidorder") - } - if (Model.CanVoidOffline) - { - -   - @Html.ActionConfirmation("voidorderoffline") - } - } -
-
- } - @if (Model.CustomValues != null && Model.CustomValues.Count > 0) - { -
-
- @Html.NopLabelFor(model => model.CustomValues) -
-
-
- @foreach (var item in Model.CustomValues) - { -
    -
  • - @item.Key: @(item.Value != null ? item.Value.ToString() : "") -
  • -
- } -
-
-
- } -
-
- @Html.NopLabelFor(model => model.CreatedOn) -
-
- @Html.NopDisplayFor(model => model.CreatedOn) -
-
-
-
+@model OrderModel + +@using Nop.Core.Domain.Tax; +@using Nop.Core.Domain.Orders; +@using Nop.Services +@if (!Model.IsLoggedInAsVendor) +{ + +} +
+
+
+ @if (!Model.IsLoggedInAsVendor) + { +
+
+ @Html.NopLabelFor(model => model.OrderStatus) +
+
+
+
+ + @Html.NopDisplayFor(model => model.OrderStatus) + +
+
+ @if (Model.CanCancelOrder) + { + + @Html.ActionConfirmation("cancelorder") + } + +
+ @Html.NopDropDownListFor(model => model.OrderStatusId, ((OrderStatus)Model.OrderStatusId).ToSelectList()) + + @Html.ActionConfirmation("btnSaveOrderStatus") + +
+ @T("Admin.Orders.Fields.OrderStatus.Change.ForAdvancedUsers") +
+
+
+
+
+
+ } + else + { + //vendors should see whether or order is cancelled + if (Model.OrderStatusId == (int)OrderStatus.Cancelled) + { +
+
+   +
+
+ + @T("Admin.Orders.Fields.OrderStatus.CancelledNotification") + +
+
+ } + } +
+
+ @Html.NopLabelFor(model => model.CustomOrderNumber) +
+
+ @Html.NopDisplayFor(model => model.CustomOrderNumber) +
+
+ @if (!Model.IsLoggedInAsVendor) + { +
+
+ @Html.NopLabelFor(model => model.OrderGuid) +
+
+ @Html.NopDisplayFor(model => model.OrderGuid) +
+
+ } + @if (!Model.IsLoggedInAsVendor) + { +
+
+ @Html.NopLabelFor(model => model.InvoiceId) +
+
+
+ @Html.NopDisplayFor(model => model.InvoiceId) +
+
+ @Html.NopEditorFor(model => model.InvoiceId) +
+
+
+ } + @if (!Model.IsLoggedInAsVendor) + { +
+
+ @Html.NopLabelFor(model => model.InvoiceDateUtc) +
+
+
+ @Html.NopDisplayFor(model => model.InvoiceDateUtc) +
+
+ @Html.NopEditorFor(model => model.InvoiceDateUtc) +
+
+
+ } + @if (!Model.IsLoggedInAsVendor) + { +
+
+ + + + @Html.ActionConfirmation("btnSaveIV") + + +
+
+ } +
+
+ @Html.NopLabelFor(model => model.StoreName) +
+
+ @Html.NopDisplayFor(model => model.StoreName) +
+
+
+
+ + @if (!Model.IsLoggedInAsVendor) + { +
+
+
+
+ @Html.NopLabelFor(model => model.CustomerId) +
+
+ @Html.ActionLink(Model.CustomerInfo, "Edit", "Customer", new { id = Model.CustomerId }, new { }) +
+
+
+
+ @Html.NopLabelFor(model => model.CustomerIp) +
+
+ @Html.NopDisplayFor(model => model.CustomerIp) +
+
+ @if (Model.RecurringPaymentId > 0) + { +
+
+ @Html.NopLabelFor(model => model.RecurringPaymentId) +
+ +
+ } + @if (!String.IsNullOrEmpty(Model.VatNumber)) + { +
+
+ @Html.NopLabelFor(model => model.VatNumber) +
+
+ @Html.NopDisplayFor(model => model.VatNumber) +
+
+ } + @if (Model.AffiliateId > 0) + { +
+
+ @Html.NopLabelFor(model => model.AffiliateId) +
+ +
+ } +
+
+
+ +
+ +
+
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) + { +
+
+ @Html.DisplayFor(model => model.OrderSubtotalInclTax) @*@T("Admin.Orders.Fields.OrderSubtotalInclTax")*@ +
+
+ } + @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) + { +
+
+ @Html.DisplayFor(model => model.OrderSubtotalExclTax) @*@T("Admin.Orders.Fields.OrderSubtotalExclTax")*@ +
+
+ } +
+
+
+ @if (((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountInclTax)) || + ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountExclTax))) + { +
+
+
+ +
+ +
+
+
+
+
+ @if ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountInclTax)) + { +
+
+ @Html.DisplayFor(model => model.OrderSubTotalDiscountInclTax) @*@T("Admin.Orders.Fields.OrderSubTotalDiscountInclTax")*@ +
+
+ } + @if ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.OrderSubTotalDiscountExclTax)) + { +
+
+ @Html.DisplayFor(model => model.OrderSubTotalDiscountExclTax) @*@T("Admin.Orders.Fields.OrderSubTotalDiscountExclTax")*@ +
+
+ } +
+
+
+ } +
+
+
+ +
+ +
+
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) + { +
+
+ @Html.DisplayFor(model => model.OrderShippingInclTax) @*@T("Admin.Orders.Fields.OrderShippingInclTax")*@ +
+
+ } + @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) + { +
+
+ @Html.DisplayFor(model => model.OrderShippingExclTax) @*@T("Admin.Orders.Fields.OrderShippingExclTax")*@ +
+
+ } + @if (!string.IsNullOrEmpty(Model.OrderShippingNonTaxable)) + { +
+
+ @Html.DisplayFor(model => model.OrderShippingNonTaxable) @*@T("Admin.Orders.Fields.OrderShippingNonTaxable")*@ +
+
+ } +
+
+
+ @if (((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) && !String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeInclTax)) || + ((Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) && !String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeExclTax)) || + (!String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeNonTaxable))) + { +
+
+
+ +
+ +
+
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) + { +
+
+ @Html.DisplayFor(model => model.PaymentMethodAdditionalFeeInclTax) @*@T("Admin.Orders.Fields.PaymentMethodAdditionalFeeInclTax")*@ +
+
+ } + @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) + { +
+
+ @Html.DisplayFor(model => model.PaymentMethodAdditionalFeeExclTax) @*@T("Admin.Orders.Fields.PaymentMethodAdditionalFeeExclTax")*@ +
+
+ } + @if (!String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeNonTaxable)) + { +
+
+ @Html.DisplayFor(model => model.PaymentMethodAdditionalFeeNonTaxable) @*@T("Admin.Orders.Fields.PaymentMethodAdditionalFeeNonTaxable")*@ +
+
+ } +
+
+
+ } + @if (Model.DisplayTaxRates) + { + foreach (var tr in Model.TaxRates) + { +
+
+ @Html.NopLabelFor(model => model.Tax) @tr.Rate% +
+
+ @Html.NopDisplayFor(model => tr.TaxAmount) +
+
+ } + } + @if (Model.DisplayTax) + { +
+
+ @Html.NopLabelFor(model => model.Tax) +
+
+ @Html.NopDisplayFor(model => model.Tax) +
+
+ } + @if (!String.IsNullOrEmpty(Model.OrderTotalDiscount)) + { +
+ @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) + { +
+ @Html.NopLabelFor(model => model.OrderTotalDiscount) +
+
+ @Html.NopDisplayFor(model => model.OrderTotalDiscount) +
+ } + @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) + { +
+ @Html.NopLabelFor(model => model.OrderTotalDiscountIncl) +
+
+ @Html.NopDisplayFor(model => model.OrderTotalDiscountIncl) +
+ } +
+ } + @if (!String.IsNullOrEmpty(Model.EarnedRewardPointsBaseAmountExcl)) + { +
+
+
+ +
+ +
+
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.IncludingTax) + { +
+
+ @Html.DisplayFor(model => model.EarnedRewardPointsBaseAmountIncl) @*@T("Admin.Orders.Fields.EarnedRewardPointsBaseAmountIncl")*@ +
+
+ } + @if (Model.AllowCustomersToSelectTaxDisplayType || Model.TaxDisplayType == TaxDisplayType.ExcludingTax) + { +
+
+ @Html.DisplayFor(model => model.EarnedRewardPointsBaseAmountExcl) @*@T("Admin.Orders.Fields.EarnedRewardPointsBaseAmountExcl")*@ +
+
+ } +
+
+
+ } +
+
+ @Html.NopLabelFor(model => model.OrderAmount) +
+
+ @Html.NopDisplayFor(model => model.OrderAmount) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderAmountIncl) +
+
+ @Html.NopDisplayFor(model => model.OrderAmountIncl) +
+
+ @foreach (var gc in Model.GiftCards) + { +
+
+ @Html.NopLabelFor(model => model.GiftCards[0].CouponCode) + (@(gc.CouponCode)) +
+
+ @Html.NopDisplay(gc.Amount) +
+
+ } + @if (Model.RedeemedRewardPoints > 0) + { +
+
+ @Html.NopLabelFor(model => model.RedeemedRewardPoints) +
+
+ @Html.NopDisplay(Model.RedeemedRewardPoints + " " + @T("Admin.Orders.Fields.RedeemedRewardPoints.Points").Text + "/" + Model.RedeemedRewardPointsAmount) +
+
+ } + @if (Model.RedeemedRewardPointsPurchased > 0) + { +
+
+ @Html.NopLabelFor(model => model.RedeemedRewardPointsPurchased) +
+
+ @Html.NopDisplay(Model.RedeemedRewardPointsPurchased + " " + @T("Admin.Orders.Fields.RedeemedRewardPoints.Points").Text + "/" + Model.RedeemedRewardPointsAmountPurchased) +
+
+ } +
+
+ @Html.NopLabelFor(model => model.OrderTotalAmountIncl) +
+
+ @Html.NopDisplayFor(model => model.OrderTotalAmountIncl) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderTotal) +
+
+ @Html.NopDisplayFor(model => model.OrderTotal) +
+
+ @if (!String.IsNullOrEmpty(Model.RefundedAmount)) + { +
+
+ @Html.NopLabelFor(model => model.RefundedAmount) +
+
+ @Html.NopDisplayFor(model => model.RefundedAmount) +
+
+ } + @if (Model.UsedDiscounts.Count > 0) + { +
+
+ @Html.NopLabelFor(model => model.UsedDiscounts) +
+
+ @for (int i = 0; i < Model.UsedDiscounts.Count; i++) + { + var discount = Model.UsedDiscounts[i]; + @discount.DiscountName + if (i != Model.UsedDiscounts.Count - 1) + { + , + } + } +
+
+ } +
+
+ @Html.NopLabelFor(model => model.Profit) +
+
+ @Html.NopDisplayFor(model => model.Profit) +
+
+
+
+
+ @Html.NopLabelFor(model => model.OrderSubtotalInclTaxValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.OrderSubtotalInclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.OrderSubtotalExclTaxValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.OrderSubTotalDiscountInclTaxValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.OrderSubTotalDiscountInclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.OrderSubTotalDiscountExclTaxValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.OrderShippingInclTaxValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.OrderShippingInclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.OrderShippingExclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.NonTaxable") + @Html.NopEditorFor(model => model.OrderShippingNonTaxableValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.PaymentMethodAdditionalFeeInclTaxValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.PaymentMethodAdditionalFeeInclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.PaymentMethodAdditionalFeeExclTaxValue) +
+
+ @T("Admin.Orders.Fields.Edit.NonTaxable") + @Html.NopEditorFor(model => model.PaymentMethodAdditionalFeeNonTaxableValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.TaxRatesValue) +
+
+ @Html.NopEditorFor(model => model.TaxRatesValue) +
+
+
+
+ @Html.NopLabelFor(model => model.TaxValue) +
+
+ @Html.NopEditorFor(model => model.TaxValue) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderTotalDiscountValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.OrderTotalDiscountInclValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.OrderTotalDiscountValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.EarnedRewardPointsBaseAmountExclValue) +
+
+
+ @T("Admin.Orders.Fields.Edit.InclTax") + @Html.NopEditorFor(model => model.EarnedRewardPointsBaseAmountInclValue) +
+
+ @T("Admin.Orders.Fields.Edit.ExclTax") + @Html.NopEditorFor(model => model.EarnedRewardPointsBaseAmountExclValue) +
+
+
+
+
+ @Html.NopLabelFor(model => model.OrderAmountValue) +
+
+ @Html.NopEditorFor(model => model.OrderAmountValue) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderAmountInclValue) +
+
+ @Html.NopEditorFor(model => model.OrderAmountInclValue) +
+
+
+
+ @Html.NopLabelFor(model => model.OrderTotalValue) +
+
+ @Html.NopEditorFor(model => model.OrderTotalValue) +
+
+
+
+
+ + + + @Html.ActionConfirmation("btnSaveOrderTotals") + + +
+
+ @if (Model.AllowStoringCreditCardNumber) + { +
+
+ @Html.NopLabelFor(model => model.CardType) +
+
+
+ @Html.NopDisplayFor(model => model.CardType) +
+ @Html.NopEditorFor(model => model.CardType) +
+
+ } + @if (Model.AllowStoringCreditCardNumber) + { +
+
+ @Html.NopLabelFor(model => model.CardName) +
+
+
+ @Html.NopDisplayFor(model => model.CardName) +
+ @Html.NopEditorFor(model => model.CardName) +
+
+ } + @if (Model.AllowStoringCreditCardNumber || !String.IsNullOrEmpty(Model.CardNumber)) + { +
+
+ @Html.NopLabelFor(model => model.CardNumber) +
+
+
+ @Html.NopDisplayFor(model => model.CardNumber) +
+ @Html.NopEditorFor(model => model.CardNumber) +
+
+ } + @if (Model.AllowStoringCreditCardNumber) + { +
+
+ @Html.NopLabelFor(model => model.CardCvv2) +
+
+
+ @Html.NopDisplayFor(model => model.CardCvv2) +
+ @Html.NopEditorFor(model => model.CardCvv2) +
+
+ } + @if (Model.AllowStoringCreditCardNumber) + { +
+
+ @Html.NopLabelFor(model => model.CardExpirationMonth) +
+
+
+ @Html.NopDisplayFor(model => model.CardExpirationMonth) +
+ @Html.NopEditorFor(model => model.CardExpirationMonth) +
+
+ } + @if (Model.AllowStoringCreditCardNumber) + { +
+
+ @Html.NopLabelFor(model => model.CardExpirationYear) +
+
+
+ @Html.NopDisplayFor(model => model.CardExpirationYear) +
+ @Html.NopEditorFor(model => model.CardExpirationYear) +
+
+ } + @if (Model.AllowStoringCreditCardNumber) + { +
+
+ + + + @Html.ActionConfirmation("btnSaveCC") + + +
+
+ } + @if (!String.IsNullOrEmpty(Model.AuthorizationTransactionId)) + { +
+
+ @Html.NopLabelFor(model => model.AuthorizationTransactionId) +
+
+ @Html.NopDisplayFor(model => model.AuthorizationTransactionId) +
+
+ } + @if (!String.IsNullOrEmpty(Model.CaptureTransactionId)) + { +
+
+ @Html.NopLabelFor(model => model.CaptureTransactionId) +
+
+ @Html.NopDisplayFor(model => model.CaptureTransactionId) +
+
+ } + @if (!String.IsNullOrEmpty(Model.SubscriptionTransactionId)) + { +
+
+ @Html.NopLabelFor(model => model.SubscriptionTransactionId) +
+
+ @Html.NopDisplayFor(model => model.SubscriptionTransactionId) +
+
+ } +
+
+ @Html.NopLabelFor(model => model.PaymentMethod) +
+
+ @Html.NopDisplayFor(model => model.PaymentMethod) +
+
+
+
+ } +
+
+
+
+ @Html.NopLabelFor(model => model.PaymentStatus) +
+
+ @Html.NopDisplayFor(model => model.PaymentStatus) +
+
+ @if (Model.CanCapture || Model.CanMarkOrderAsPaid || Model.CanRefund || Model.CanRefundOffline || + Model.CanPartiallyRefund || Model.CanPartiallyRefundOffline || Model.CanVoid || Model.CanVoidOffline) + { +
+
+ @if (!Model.IsLoggedInAsVendor) + { + if (Model.CanCapture) + { + +   + @Html.ActionConfirmation("captureorder") + } + if (Model.CanMarkOrderAsPaid) + { + +   + @Html.ActionConfirmation("markorderaspaid") + } + if (Model.CanRefund) + { + +   + @Html.ActionConfirmation("refundorder") + } + if (Model.CanRefundOffline) + { + +   + @Html.ActionConfirmation("refundorderoffline") + } + if (Model.CanPartiallyRefund) + { + +   + } + if (Model.CanPartiallyRefundOffline) + { + +   + } + if (Model.CanVoid) + { + +   + @Html.ActionConfirmation("voidorder") + } + if (Model.CanVoidOffline) + { + +   + @Html.ActionConfirmation("voidorderoffline") + } + } +
+
+ } + @if (Model.CustomValues != null && Model.CustomValues.Count > 0) + { +
+
+ @Html.NopLabelFor(model => model.CustomValues) +
+
+
+ @foreach (var item in Model.CustomValues) + { +
    +
  • + @item.Key: @(item.Value != null ? item.Value.ToString() : "") +
  • +
+ } +
+
+
+ } +
+
+ @Html.NopLabelFor(model => model.CreatedOn) +
+
+ @Html.NopDisplayFor(model => model.CreatedOn) +
+
+
+
\ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Products.cshtml b/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Products.cshtml index ccedc9379bb..dd0de1a5e97 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Products.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Order/_OrderDetails.Products.cshtml @@ -1,394 +1,409 @@ -@model OrderModel -@using Nop.Core.Domain.Tax; -@using Nop.Core.Domain.Catalog; - -
-
-
-
-
- @foreach (var item in Model.Items) - { - - - - } - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - @if (!Model.IsLoggedInAsVendor) - { - - } - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - @if (!Model.IsLoggedInAsVendor) - { - - } - - - - @foreach (var item in Model.Items) - { - - - - - @if (Model.HasDownloadableProducts) - { - - } - - - - - @if (!Model.IsLoggedInAsVendor) - { - - } - - } - -
- @T("Admin.Orders.Products.Picture") - - @T("Admin.Orders.Products.ProductName") - - @T("Admin.Orders.Products.Download") - - @T("Admin.Orders.Products.Price") - - @T("Admin.Orders.Products.Quantity") - - @T("Admin.Orders.Products.Discount") - - @T("Admin.Orders.Products.Total") - - @T("Admin.Common.Edit") -
- - - @item.ProductName - @if (!String.IsNullOrEmpty(item.AttributeInfo)) - { -

- @Html.Raw(item.AttributeInfo) -

- } - @if (!String.IsNullOrEmpty(item.RecurringInfo)) - { -

- @Html.Raw(item.RecurringInfo) -

- } - @if (!String.IsNullOrEmpty(item.RentalInfo)) - { -

- @Html.Raw(item.RentalInfo) -

- } - @if (!String.IsNullOrEmpty(item.Sku)) - { -

- @T("Admin.Orders.Products.SKU"): - @item.Sku -

- } - @if (!String.IsNullOrEmpty(item.VendorName)) - { -

- @T("Admin.Orders.Products.Vendor"): - @item.VendorName -

- } - @if (item.ReturnRequests.Count > 0) - { -

- @T("Admin.Orders.Products.ReturnRequests"): - @for (int i = 0; i < item.ReturnRequests.Count; i++) - { - @item.ReturnRequests[i].CustomNumber - if (i != item.ReturnRequests.Count - 1) - { - , - } - } -

- } - @if (item.PurchasedGiftCardIds.Count > 0) - { -

- @T("Admin.Orders.Products.GiftCards"): - @for (int i = 0; i < item.PurchasedGiftCardIds.Count; i++) - { - @item.PurchasedGiftCardIds[i] - if (i != item.PurchasedGiftCardIds.Count - 1) - { - , - } - } -

- } -
- @if (item.IsDownload) - { -
- @string.Format(T("Admin.Orders.Products.Download.DownloadCount").Text, item.DownloadCount) - -
-
- if (item.DownloadActivationType == DownloadActivationType.Manually) - { -
- -
-
- } -
-
- - @T("Admin.Orders.Products.License") - -
- @if (item.LicenseDownloadGuid != Guid.Empty) - { - - } - -
- } -
- @if (Model.AllowCustomersToSelectTaxDisplayType) - { -
@item.UnitPriceInclTax
-
@item.UnitPriceExclTax
- } - else - { - switch (Model.TaxDisplayType) - { - case TaxDisplayType.ExcludingTax: - { - @item.UnitPriceExclTax - } - break; - case TaxDisplayType.IncludingTax: - { - @item.UnitPriceInclTax - } - break; - default: - break; - } - } -
-
-
- @T("Admin.Orders.Products.Edit.InclTax") -
-
- -
-
-
-
- @T("Admin.Orders.Products.Edit.ExclTax") -
-
- -
-
-
-
-
@item.Quantity
-
-
-
- -
-
-
-
- @if (Model.AllowCustomersToSelectTaxDisplayType) - { -
@item.DiscountInclTax
-
@item.DiscountExclTax
- } - else - { - switch (Model.TaxDisplayType) - { - case TaxDisplayType.ExcludingTax: - { - @item.DiscountExclTax - } - break; - case TaxDisplayType.IncludingTax: - { - @item.DiscountInclTax - } - break; - default: - break; - } - } -
-
-
- @T("Admin.Orders.Products.Edit.InclTax") -
-
- -
-
-
-
- @T("Admin.Orders.Products.Edit.ExclTax") -
-
- -
-
-
-
- @if (Model.AllowCustomersToSelectTaxDisplayType) - { -
@item.SubTotalInclTax
-
@item.SubTotalExclTax
- } - else - { - switch (Model.TaxDisplayType) - { - case TaxDisplayType.ExcludingTax: - { - @item.SubTotalExclTax - } - break; - case TaxDisplayType.IncludingTax: - { - @item.SubTotalInclTax - } - break; - default: - break; - } - } -
-
-
- @T("Admin.Orders.Products.Edit.InclTax") -
-
- -
-
-
-
- @T("Admin.Orders.Products.Edit.ExclTax") -
-
- -
-
-
-
- - - - @Html.ActionConfirmation("btnDeleteOrderItem" + item.Id) - - - @Html.ActionConfirmation("btnSaveOrderItem" + item.Id) - - -
-
-
- @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo) && !Model.IsLoggedInAsVendor) - { -
-
- @Html.Raw(Model.CheckoutAttributeInfo) -
-
- } - @if (!Model.IsLoggedInAsVendor) - { -
-
- -
-
- } -
-
-
+@model OrderModel +@using Nop.Core.Domain.Tax; +@using Nop.Core.Domain.Catalog; + +
+
+
+
+
+ @foreach (var item in Model.Items) + { + + + + } + + + + + @if (Model.HasDownloadableProducts) + { + + } + + + + + @if (!Model.IsLoggedInAsVendor) + { + + } + + + + + @if (Model.HasDownloadableProducts) + { + + } + + + + + + @if (!Model.IsLoggedInAsVendor) + { + + } + + + + @foreach (var item in Model.Items) + { + + + + + @if (Model.HasDownloadableProducts) + { + + } + + + + + + @if (!Model.IsLoggedInAsVendor) + { + + } + + } + +
+ @T("Admin.Orders.Products.Picture") + + @T("Admin.Orders.Products.ProductName") + + @T("Admin.Orders.Products.Download") + + @T("Admin.Orders.Products.Price") + + @T("Admin.Orders.Products.Quantity") + + @T("Admin.Orders.Products.Discount") + + @T("Admin.Orders.Products.Total") + + @T("Order.TaxRateLine.TaxRate") + + @T("Admin.Common.Edit") +
+ + + @item.ProductName + @if (!String.IsNullOrEmpty(item.AttributeInfo)) + { +

+ @Html.Raw(item.AttributeInfo) +

+ } + @if (!String.IsNullOrEmpty(item.RecurringInfo)) + { +

+ @Html.Raw(item.RecurringInfo) +

+ } + @if (!String.IsNullOrEmpty(item.RentalInfo)) + { +

+ @Html.Raw(item.RentalInfo) +

+ } + @if (!String.IsNullOrEmpty(item.Sku)) + { +

+ @T("Admin.Orders.Products.SKU"): + @item.Sku +

+ } + @if (!String.IsNullOrEmpty(item.VendorName)) + { +

+ @T("Admin.Orders.Products.Vendor"): + @item.VendorName +

+ } + @if (item.ReturnRequests.Count > 0) + { +

+ @T("Admin.Orders.Products.ReturnRequests"): + @for (int i = 0; i < item.ReturnRequests.Count; i++) + { + @item.ReturnRequests[i].CustomNumber + if (i != item.ReturnRequests.Count - 1) + { + , + } + } +

+ } + @if (item.PurchasedGiftCardIds.Count > 0) + { +

+ @T("Admin.Orders.Products.GiftCards"): + @for (int i = 0; i < item.PurchasedGiftCardIds.Count; i++) + { + @item.PurchasedGiftCardIds[i] + if (i != item.PurchasedGiftCardIds.Count - 1) + { + , + } + } +

+ } +
+ @if (item.IsDownload) + { +
+ @string.Format(T("Admin.Orders.Products.Download.DownloadCount").Text, item.DownloadCount) + +
+
+ if (item.DownloadActivationType == DownloadActivationType.Manually) + { +
+ +
+
+ } +
+
+ + @T("Admin.Orders.Products.License") + +
+ @if (item.LicenseDownloadGuid != Guid.Empty) + { + + } + +
+ } +
+ @if (Model.AllowCustomersToSelectTaxDisplayType) + { +
@item.UnitPriceInclTax
+
@item.UnitPriceExclTax
+ } + else + { + switch (Model.TaxDisplayType) + { + case TaxDisplayType.ExcludingTax: + { + @item.UnitPriceExclTax + } + break; + case TaxDisplayType.IncludingTax: + { + @item.UnitPriceInclTax + } + break; + default: + break; + } + } +
+
+
+ @T("Admin.Orders.Products.Edit.InclTax") +
+
+ +
+
+
+
+ @T("Admin.Orders.Products.Edit.ExclTax") +
+
+ +
+
+
+
+
@item.Quantity
+
+
+
+ +
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType) + { +
@item.DiscountInclTax
+
@item.DiscountExclTax
+ } + else + { + switch (Model.TaxDisplayType) + { + case TaxDisplayType.ExcludingTax: + { + @item.DiscountExclTax + } + break; + case TaxDisplayType.IncludingTax: + { + @item.DiscountInclTax + } + break; + default: + break; + } + } +
+
+
+ @T("Admin.Orders.Products.Edit.InclTax") +
+
+ +
+
+
+
+ @T("Admin.Orders.Products.Edit.ExclTax") +
+
+ +
+
+
+
+ @if (Model.AllowCustomersToSelectTaxDisplayType) + { +
@item.SubTotalInclTax
+
@item.SubTotalExclTax
+ } + else + { + switch (Model.TaxDisplayType) + { + case TaxDisplayType.ExcludingTax: + { + @item.SubTotalExclTax + } + break; + case TaxDisplayType.IncludingTax: + { + @item.SubTotalInclTax + } + break; + default: + break; + } + } +
+
+
+ @T("Admin.Orders.Products.Edit.InclTax") +
+
+ +
+
+
+
+ @T("Admin.Orders.Products.Edit.ExclTax") +
+
+ +
+
+
+
+
@item.TaxRate.ToString("G29")
+
+
+
+ +
+
+
+
+ + + + @Html.ActionConfirmation("btnDeleteOrderItem" + item.Id) + + + @Html.ActionConfirmation("btnSaveOrderItem" + item.Id) + + +
+
+
+ @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo) && !Model.IsLoggedInAsVendor) + { +
+
+ @Html.Raw(Model.CheckoutAttributeInfo) +
+
+ } + @if (!Model.IsLoggedInAsVendor) + { +
+
+ +
+
+ } +
+
+
diff --git a/src/Presentation/Nop.Web/Administration/Views/Order/_ProductAddAttributes.cshtml b/src/Presentation/Nop.Web/Administration/Views/Order/_ProductAddAttributes.cshtml index b8e1cc75a0a..5815b9ad357 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Order/_ProductAddAttributes.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Order/_ProductAddAttributes.cshtml @@ -299,6 +299,18 @@ if (data.message) { alert(data.message); } + if (data.finalPriceInclTax) { + setAttribValue('#UnitPriceInclTax', data.finalPriceInclTax); + } + if (data.finalPriceInclTax) { + setAttribValue('#UnitPriceExclTax', data.finalPriceExclTax); + } + if (data.finalPriceInclTax) { + setAttribValue('#SubTotalInclTax', data.finalSubInclTax); + } + if (data.finalPriceInclTax) { + setAttribValue('#SubTotalExclTax', data.finalSubExclTax); + } } }); } @@ -307,6 +319,12 @@ @(attributeChangeHandlerFuncName)(); @Html.Raw(attributeChangeScriptsBuilder.ToString()) }); + + function setAttribValue(attrib, value) + { + $(attrib).val(value).parent().children(':first-child').val(value); + return; + }
- -
-
- @Html.Action("StoreScopeConfiguration", "Setting") - @Html.Action("Mode", "Setting") - @Html.ValidationSummary(false) - - -
-
- - { - //custom tabs - var eventMessage = new AdminTabStripCreated(this.Html, "ordersettings-edit"); - EngineContext.Current.Resolve().Publish(eventMessage); - foreach (var eventBlock in eventMessage.BlocksToRender) - { - @eventBlock - } - } - - @*save selected tab name*@ - -} - -@helper TabOrderSettings() -{ - - -
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.Checkout") -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.AnonymousCheckoutAllowed_OverrideForStore, model => model.AnonymousCheckoutAllowed, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.AnonymousCheckoutAllowed) -
-
- @Html.NopEditorFor(model => model.AnonymousCheckoutAllowed) - @Html.ValidationMessageFor(model => model.AnonymousCheckoutAllowed) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.OnePageCheckoutEnabled_OverrideForStore, model => model.OnePageCheckoutEnabled, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.OnePageCheckoutEnabled) -
-
- @Html.NopEditorFor(model => model.OnePageCheckoutEnabled) - @Html.ValidationMessageFor(model => model.OnePageCheckoutEnabled) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore, model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) -
-
- @Html.NopEditorFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) - @Html.ValidationMessageFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.TermsOfServiceOnShoppingCartPage_OverrideForStore, model => model.TermsOfServiceOnShoppingCartPage, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.TermsOfServiceOnShoppingCartPage) -
-
- @Html.NopEditorFor(model => model.TermsOfServiceOnShoppingCartPage) - @Html.ValidationMessageFor(model => model.TermsOfServiceOnShoppingCartPage) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.TermsOfServiceOnOrderConfirmPage_OverrideForStore, model => model.TermsOfServiceOnOrderConfirmPage, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.TermsOfServiceOnOrderConfirmPage) -
-
- @Html.NopEditorFor(model => model.TermsOfServiceOnOrderConfirmPage) - @Html.ValidationMessageFor(model => model.TermsOfServiceOnOrderConfirmPage) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.DisableBillingAddressCheckoutStep_OverrideForStore, model => model.DisableBillingAddressCheckoutStep, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.DisableBillingAddressCheckoutStep) -
-
- @Html.NopEditorFor(model => model.DisableBillingAddressCheckoutStep) - @Html.ValidationMessageFor(model => model.DisableBillingAddressCheckoutStep) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.DisableOrderCompletedPage_OverrideForStore, model => model.DisableOrderCompletedPage, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.DisableOrderCompletedPage) -
-
- @Html.NopEditorFor(model => model.DisableOrderCompletedPage) - @Html.ValidationMessageFor(model => model.DisableOrderCompletedPage) -
-
-
-
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.OrderTotals") -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.MinOrderSubtotalAmount_OverrideForStore, model => model.MinOrderSubtotalAmount, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.MinOrderSubtotalAmount) -
-
- @Html.NopEditorFor(model => model.MinOrderSubtotalAmount, Model.PrimaryStoreCurrencyCode) - @Html.ValidationMessageFor(model => model.MinOrderSubtotalAmount) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.MinOrderSubtotalAmountIncludingTax_OverrideForStore, model => model.MinOrderSubtotalAmountIncludingTax, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.MinOrderSubtotalAmountIncludingTax) -
-
- @Html.NopEditorFor(model => model.MinOrderSubtotalAmountIncludingTax) - @Html.ValidationMessageFor(model => model.MinOrderSubtotalAmountIncludingTax) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.MinOrderTotalAmount_OverrideForStore, model => model.MinOrderTotalAmount, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.MinOrderTotalAmount) -
-
- @Html.NopEditorFor(model => model.MinOrderTotalAmount, Model.PrimaryStoreCurrencyCode) - @Html.ValidationMessageFor(model => model.MinOrderTotalAmount) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore, model => model.AutoUpdateOrderTotalsOnEditingOrder, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) -
-
- @Html.NopEditorFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) - @Html.ValidationMessageFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) -
-
-
-
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.Common") -
-
- @if (Model.OrderIdent.HasValue) - { -
-
- @Html.NopLabelFor(model => model.OrderIdent) -
-
- @Html.NopEditorFor(model => model.OrderIdent) -
-
- } -
-
- @Html.OverrideStoreCheckboxFor(model => model.CustomOrderNumberMask_OverrideForStore, model => model.CustomOrderNumberMask, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.CustomOrderNumberMask) -
-
- @Html.NopEditorFor(model => model.CustomOrderNumberMask) - @Html.ValidationMessageFor(model => model.CustomOrderNumberMask) -
    -
  • - @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.YYYY") -
  • -
  • - @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.YY") -
  • -
  • - @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.MM") -
  • -
  • - @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.DD") -
  • -
  • - @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.ID") -
  • -
-
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.IsReOrderAllowed_OverrideForStore, model => model.IsReOrderAllowed, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.IsReOrderAllowed) -
-
- @Html.NopEditorFor(model => model.IsReOrderAllowed) - @Html.ValidationMessageFor(model => model.IsReOrderAllowed) -
-
-
-
- @Html.NopLabelFor(model => model.CompleteOrderWhenDelivered) -
-
- @Html.NopEditorFor(model => model.CompleteOrderWhenDelivered) - @Html.ValidationMessageFor(model => model.CompleteOrderWhenDelivered) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.ExportWithProducts_OverrideForStore, model => model.ExportWithProducts, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.ExportWithProducts) -
-
- @Html.NopEditorFor(model => model.ExportWithProducts) - @Html.ValidationMessageFor(model => model.ExportWithProducts) -
-
-
-
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.PdfInvoice") -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderPlacedEmail, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) -
-
- @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) - @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderPaidEmail, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderPaidEmail) -
-
- @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderPaidEmail) - @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderPaidEmail) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderCompletedEmail, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) -
-
- @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) - @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) -
-
-
-
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.GiftCards") -
-
-
-
- @Html.NopLabelFor(model => model.ActivateGiftCardsAfterCompletingOrder) -
-
- @Html.NopEditorFor(model => model.ActivateGiftCardsAfterCompletingOrder) - @Html.ValidationMessageFor(model => model.ActivateGiftCardsAfterCompletingOrder) -
-
-
-
- @Html.NopLabelFor(model => model.DeactivateGiftCardsAfterCancellingOrder) -
-
- @Html.NopEditorFor(model => model.DeactivateGiftCardsAfterCancellingOrder) - @Html.ValidationMessageFor(model => model.DeactivateGiftCardsAfterCancellingOrder) -
-
-
-
- @Html.NopLabelFor(model => model.DeactivateGiftCardsAfterDeletingOrder) -
-
- @Html.NopEditorFor(model => model.DeactivateGiftCardsAfterDeletingOrder) - @Html.ValidationMessageFor(model => model.DeactivateGiftCardsAfterDeletingOrder) -
-
-
-
-
-} - -@helper TabReturnRequestSettings() -{ -
-
-
- @T("Admin.Configuration.Settings.Order.BlockTitle.Common") -
-
-
    -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestsDescription1") -
  • -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestsDescription2") -
  • -
-
-
- @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestsEnabled_OverrideForStore, model => model.ReturnRequestsEnabled, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.ReturnRequestsEnabled) -
-
- @Html.NopEditorFor(model => model.ReturnRequestsEnabled) - @Html.ValidationMessageFor(model => model.ReturnRequestsEnabled) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestNumberMask_OverrideForStore, model => model.ReturnRequestNumberMask, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.ReturnRequestNumberMask) -
-
- @Html.NopEditorFor(model => model.ReturnRequestNumberMask) - @Html.ValidationMessageFor(model => model.ReturnRequestNumberMask) -
    -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.ID") -
  • -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.YYYY") -
  • -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.YY") -
  • -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.MM") -
  • -
  • - @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.DD") -
  • -
-
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.NumberOfDaysReturnRequestAvailable_OverrideForStore, model => model.NumberOfDaysReturnRequestAvailable, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.NumberOfDaysReturnRequestAvailable) -
-
- @Html.NopEditorFor(model => model.NumberOfDaysReturnRequestAvailable) - @Html.ValidationMessageFor(model => model.NumberOfDaysReturnRequestAvailable) -
-
-
-
- @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestsAllowFiles_OverrideForStore, model => model.ReturnRequestsAllowFiles, Model.ActiveStoreScopeConfiguration) - @Html.NopLabelFor(model => model.ReturnRequestsAllowFiles) -
-
- @Html.NopEditorFor(model => model.ReturnRequestsAllowFiles) - @Html.ValidationMessageFor(model => model.ReturnRequestsAllowFiles) -
-
-
-
- @Html.Partial("_ReturnRequestReasons") - @Html.Partial("_ReturnRequestActions") -
+@model OrderSettingsModel + +@{ + //page title + ViewBag.Title = T("Admin.Configuration.Settings.Order").Text; + //active menu item (system name) + Html.SetActiveMenuItemSystemName("Order settings"); +} + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() +
+

+ @T("Admin.Configuration.Settings.Order") +

+
+ +
+
+ + + +
+
+ @Html.Action("StoreScopeConfiguration", "Setting") + @Html.Action("Mode", "Setting") + @Html.ValidationSummary(false) + + +
+
+ + { + //custom tabs + var eventMessage = new AdminTabStripCreated(this.Html, "ordersettings-edit"); + EngineContext.Current.Resolve().Publish(eventMessage); + foreach (var eventBlock in eventMessage.BlocksToRender) + { + @eventBlock + } + } + + @*save selected tab name*@ + +} + +@helper TabOrderSettings() +{ + + +
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.Checkout") +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AnonymousCheckoutAllowed_OverrideForStore, model => model.AnonymousCheckoutAllowed, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AnonymousCheckoutAllowed) +
+
+ @Html.NopEditorFor(model => model.AnonymousCheckoutAllowed) + @Html.ValidationMessageFor(model => model.AnonymousCheckoutAllowed) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.OnePageCheckoutEnabled_OverrideForStore, model => model.OnePageCheckoutEnabled, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.OnePageCheckoutEnabled) +
+
+ @Html.NopEditorFor(model => model.OnePageCheckoutEnabled) + @Html.ValidationMessageFor(model => model.OnePageCheckoutEnabled) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab_OverrideForStore, model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) +
+
+ @Html.NopEditorFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) + @Html.ValidationMessageFor(model => model.OnePageCheckoutDisplayOrderTotalsOnPaymentInfoTab) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.TermsOfServiceOnShoppingCartPage_OverrideForStore, model => model.TermsOfServiceOnShoppingCartPage, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.TermsOfServiceOnShoppingCartPage) +
+
+ @Html.NopEditorFor(model => model.TermsOfServiceOnShoppingCartPage) + @Html.ValidationMessageFor(model => model.TermsOfServiceOnShoppingCartPage) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.TermsOfServiceOnOrderConfirmPage_OverrideForStore, model => model.TermsOfServiceOnOrderConfirmPage, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.TermsOfServiceOnOrderConfirmPage) +
+
+ @Html.NopEditorFor(model => model.TermsOfServiceOnOrderConfirmPage) + @Html.ValidationMessageFor(model => model.TermsOfServiceOnOrderConfirmPage) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.DisableBillingAddressCheckoutStep_OverrideForStore, model => model.DisableBillingAddressCheckoutStep, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.DisableBillingAddressCheckoutStep) +
+
+ @Html.NopEditorFor(model => model.DisableBillingAddressCheckoutStep) + @Html.ValidationMessageFor(model => model.DisableBillingAddressCheckoutStep) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.DisableOrderCompletedPage_OverrideForStore, model => model.DisableOrderCompletedPage, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.DisableOrderCompletedPage) +
+
+ @Html.NopEditorFor(model => model.DisableOrderCompletedPage) + @Html.ValidationMessageFor(model => model.DisableOrderCompletedPage) +
+
+
+
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.OrderTotals") +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.MinOrderSubtotalAmount_OverrideForStore, model => model.MinOrderSubtotalAmount, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.MinOrderSubtotalAmount) +
+
+ @Html.NopEditorFor(model => model.MinOrderSubtotalAmount, Model.PrimaryStoreCurrencyCode) + @Html.ValidationMessageFor(model => model.MinOrderSubtotalAmount) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.MinOrderSubtotalAmountIncludingTax_OverrideForStore, model => model.MinOrderSubtotalAmountIncludingTax, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.MinOrderSubtotalAmountIncludingTax) +
+
+ @Html.NopEditorFor(model => model.MinOrderSubtotalAmountIncludingTax) + @Html.ValidationMessageFor(model => model.MinOrderSubtotalAmountIncludingTax) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.MinOrderTotalAmount_OverrideForStore, model => model.MinOrderTotalAmount, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.MinOrderTotalAmount) +
+
+ @Html.NopEditorFor(model => model.MinOrderTotalAmount, Model.PrimaryStoreCurrencyCode) + @Html.ValidationMessageFor(model => model.MinOrderTotalAmount) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AutoUpdateOrderTotalsOnEditingOrder_OverrideForStore, model => model.AutoUpdateOrderTotalsOnEditingOrder, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) +
+
+ @Html.NopEditorFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) + @Html.ValidationMessageFor(model => model.AutoUpdateOrderTotalsOnEditingOrder) +
+
+
+
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.Common") +
+
+ @if (Model.OrderIdent.HasValue) + { +
+
+ @Html.NopLabelFor(model => model.OrderIdent) +
+
+ @Html.NopEditorFor(model => model.OrderIdent) +
+
+ } +
+
+ @Html.OverrideStoreCheckboxFor(model => model.CustomOrderNumberMask_OverrideForStore, model => model.CustomOrderNumberMask, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.CustomOrderNumberMask) +
+
+ @Html.NopEditorFor(model => model.CustomOrderNumberMask) + @Html.ValidationMessageFor(model => model.CustomOrderNumberMask) +
    +
  • + @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.YYYY") +
  • +
  • + @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.YY") +
  • +
  • + @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.MM") +
  • +
  • + @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.DD") +
  • +
  • + @T("Admin.Configuration.Settings.Order.CustomOrderNumberMask.Description.ID") +
  • +
+
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.InvoiceIdent_OverrideForStore, model => model.InvoiceIdent, model => model.InvoiceYear, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.InvoiceIdent) +
+
+ @Html.NopEditorFor(model => model.InvoiceIdent) + @Html.ValidationMessageFor(model => model.InvoiceIdent) +
+
+
+
+ @Html.NopLabelFor(model => model.InvoiceYear) +
+
+ @Html.NopEditorFor(model => model.InvoiceYear) + @Html.ValidationMessageFor(model => model.InvoiceYear) +
+
+
+
+ @Html.NopLabelFor(model => model.AssignInvoiceIdentFromTask) +
+
+ @Html.NopEditorFor(model => model.AssignInvoiceIdentFromTask) + @Html.ValidationMessageFor(model => model.AssignInvoiceIdentFromTask) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.IsReOrderAllowed_OverrideForStore, model => model.IsReOrderAllowed, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.IsReOrderAllowed) +
+
+ @Html.NopEditorFor(model => model.IsReOrderAllowed) + @Html.ValidationMessageFor(model => model.IsReOrderAllowed) +
+
+
+
+ @Html.NopLabelFor(model => model.CompleteOrderWhenDelivered) +
+
+ @Html.NopEditorFor(model => model.CompleteOrderWhenDelivered) + @Html.ValidationMessageFor(model => model.CompleteOrderWhenDelivered) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.ExportWithProducts_OverrideForStore, model => model.ExportWithProducts, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.ExportWithProducts) +
+
+ @Html.NopEditorFor(model => model.ExportWithProducts) + @Html.ValidationMessageFor(model => model.ExportWithProducts) +
+
+
+
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.PdfInvoice") +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderPlacedEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderPlacedEmail, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) +
+
+ @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) + @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderPlacedEmail) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderPaidEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderPaidEmail, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderPaidEmail) +
+
+ @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderPaidEmail) + @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderPaidEmail) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AttachPdfInvoiceToOrderCompletedEmail_OverrideForStore, model => model.AttachPdfInvoiceToOrderCompletedEmail, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) +
+
+ @Html.NopEditorFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) + @Html.ValidationMessageFor(model => model.AttachPdfInvoiceToOrderCompletedEmail) +
+
+
+
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.GiftCards") +
+
+
+
+ @Html.NopLabelFor(model => model.ActivateGiftCardsAfterCompletingOrder) +
+
+ @Html.NopEditorFor(model => model.ActivateGiftCardsAfterCompletingOrder) + @Html.ValidationMessageFor(model => model.ActivateGiftCardsAfterCompletingOrder) +
+
+
+
+ @Html.NopLabelFor(model => model.DeactivateGiftCardsAfterCancellingOrder) +
+
+ @Html.NopEditorFor(model => model.DeactivateGiftCardsAfterCancellingOrder) + @Html.ValidationMessageFor(model => model.DeactivateGiftCardsAfterCancellingOrder) +
+
+
+
+ @Html.NopLabelFor(model => model.DeactivateGiftCardsAfterDeletingOrder) +
+
+ @Html.NopEditorFor(model => model.DeactivateGiftCardsAfterDeletingOrder) + @Html.ValidationMessageFor(model => model.DeactivateGiftCardsAfterDeletingOrder) +
+
+
+
+
+} + +@helper TabReturnRequestSettings() +{ +
+
+
+ @T("Admin.Configuration.Settings.Order.BlockTitle.Common") +
+
+
    +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestsDescription1") +
  • +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestsDescription2") +
  • +
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestsEnabled_OverrideForStore, model => model.ReturnRequestsEnabled, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.ReturnRequestsEnabled) +
+
+ @Html.NopEditorFor(model => model.ReturnRequestsEnabled) + @Html.ValidationMessageFor(model => model.ReturnRequestsEnabled) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestNumberMask_OverrideForStore, model => model.ReturnRequestNumberMask, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.ReturnRequestNumberMask) +
+
+ @Html.NopEditorFor(model => model.ReturnRequestNumberMask) + @Html.ValidationMessageFor(model => model.ReturnRequestNumberMask) +
    +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.ID") +
  • +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.YYYY") +
  • +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.YY") +
  • +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.MM") +
  • +
  • + @T("Admin.Configuration.Settings.Order.ReturnRequestNumberMask.Description.DD") +
  • +
+
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.NumberOfDaysReturnRequestAvailable_OverrideForStore, model => model.NumberOfDaysReturnRequestAvailable, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.NumberOfDaysReturnRequestAvailable) +
+
+ @Html.NopEditorFor(model => model.NumberOfDaysReturnRequestAvailable) + @Html.ValidationMessageFor(model => model.NumberOfDaysReturnRequestAvailable) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.ReturnRequestsAllowFiles_OverrideForStore, model => model.ReturnRequestsAllowFiles, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.ReturnRequestsAllowFiles) +
+
+ @Html.NopEditorFor(model => model.ReturnRequestsAllowFiles) + @Html.ValidationMessageFor(model => model.ReturnRequestsAllowFiles) +
+
+
+
+ @Html.Partial("_ReturnRequestReasons") + @Html.Partial("_ReturnRequestActions") +
} \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Administration/Views/Setting/RewardPoints.cshtml b/src/Presentation/Nop.Web/Administration/Views/Setting/RewardPoints.cshtml index fb8699755fb..cf8115cc8f8 100644 --- a/src/Presentation/Nop.Web/Administration/Views/Setting/RewardPoints.cshtml +++ b/src/Presentation/Nop.Web/Administration/Views/Setting/RewardPoints.cshtml @@ -162,6 +162,66 @@ @Html.ValidationMessageFor(model => model.PageSize) +
+
+ @Html.OverrideStoreCheckboxFor(model => model.EarnedRewardPointsAreTaxable_OverrideForStore, model => model.EarnedRewardPointsAreTaxable, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.EarnedRewardPointsAreTaxable) +
+
+ @Html.NopEditorFor(model => model.EarnedRewardPointsAreTaxable) + @Html.ValidationMessageFor(model => model.EarnedRewardPointsAreTaxable) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AwardPointsIncludeShipping_OverrideForStore, model => model.AwardPointsIncludeShipping, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AwardPointsIncludeShipping) +
+
+ @Html.NopEditorFor(model => model.AwardPointsIncludeShipping) + @Html.ValidationMessageFor(model => model.AwardPointsIncludeShipping) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AwardPointsIncludePaymentMethodAdditionalFee_OverrideForStore, model => model.AwardPointsIncludePaymentMethodAdditionalFee, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AwardPointsIncludePaymentMethodAdditionalFee) +
+
+ @Html.NopEditorFor(model => model.AwardPointsIncludePaymentMethodAdditionalFee) + @Html.ValidationMessageFor(model => model.AwardPointsIncludePaymentMethodAdditionalFee) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AwardPointsExcludeGiftCard_OverrideForStore, model => model.AwardPointsExcludeGiftCard, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AwardPointsExcludeGiftCard) +
+
+ @Html.NopEditorFor(model => model.AwardPointsExcludeGiftCard) + @Html.ValidationMessageFor(model => model.AwardPointsExcludeGiftCard) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.AwardPointsExcludePurchasedRewardPoints_OverrideForStore, model => model.AwardPointsExcludePurchasedRewardPoints, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.AwardPointsExcludePurchasedRewardPoints) +
+
+ @Html.NopEditorFor(model => model.AwardPointsExcludePurchasedRewardPoints) + @Html.ValidationMessageFor(model => model.AwardPointsExcludePurchasedRewardPoints) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints_OverrideForStore, model => model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints) +
+
+ @Html.NopEditorFor(model => model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints) + @Html.ValidationMessageFor(model => model.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints) +
+
-} -
- @if (!Model.PrintMode) - { -
-

@T("Order.OrderInformation")

- @T("Order.Print") - @if (!Model.PdfInvoiceDisabled) - { - @T("Order.GetPDFInvoice") - } -
- } -
- @Html.Widget("orderdetails_page_top", Model.Id) -
-
- @T("Order.Order#")@Model.CustomOrderNumber -
-
    -
  • - @T("Order.OrderDate"): @Model.CreatedOn.ToString("D") -
  • -
  • - @T("Order.OrderStatus"): @Model.OrderStatus -
  • -
  • - @T("Order.OrderTotal"): @Model.OrderTotal -
  • -
- @Html.Widget("orderdetails_page_overview", Model.Id) -
-
-
-
-
- @T("Order.BillingAddress") -
-
    -
  • - @Model.BillingAddress.FirstName @Model.BillingAddress.LastName -
  • - - @if (Model.BillingAddress.PhoneEnabled) - { -
  • - @T("Order.Phone"): @Model.BillingAddress.PhoneNumber -
  • - } - @if (Model.BillingAddress.FaxEnabled) - { -
  • - @T("Order.Fax"): @Model.BillingAddress.FaxNumber -
  • - } - @if (Model.BillingAddress.CompanyEnabled && !String.IsNullOrEmpty(Model.BillingAddress.Company)) - { -
  • - @Model.BillingAddress.Company -
  • - } - @if (Model.BillingAddress.StreetAddressEnabled) - { -
  • - @Model.BillingAddress.Address1 -
  • - } - @if (Model.BillingAddress.StreetAddress2Enabled && !String.IsNullOrEmpty(Model.BillingAddress.Address2)) - { -
  • - @Model.BillingAddress.Address2 -
  • - } - @if (Model.BillingAddress.CityEnabled || - Model.BillingAddress.StateProvinceEnabled || - Model.BillingAddress.ZipPostalCodeEnabled) - { -
  • - @if (Model.BillingAddress.CityEnabled) - { - @Model.BillingAddress.City - } - @if (Model.BillingAddress.CityEnabled && (Model.BillingAddress.StateProvinceEnabled || Model.BillingAddress.ZipPostalCodeEnabled)) - { - , - } - @if (Model.BillingAddress.StateProvinceEnabled) - { - @Model.BillingAddress.StateProvinceName - } - @if (Model.BillingAddress.ZipPostalCodeEnabled) - { - @Model.BillingAddress.ZipPostalCode - } -
  • - } - @if (Model.BillingAddress.CountryEnabled && !String.IsNullOrEmpty(Model.BillingAddress.CountryName)) - { -
  • - @Model.BillingAddress.CountryName -
  • - } - @if (!String.IsNullOrEmpty(Model.VatNumber)) - { -
  • - - @T("Order.VATNumber") - - - @Model.VatNumber - -
  • - } - @if (!String.IsNullOrEmpty(Model.BillingAddress.FormattedCustomAddressAttributes)) - { -
  • - @Html.Raw(Model.BillingAddress.FormattedCustomAddressAttributes) -
  • - } - @if (Model.CustomValues != null) - { - foreach (var item in Model.CustomValues) - { -
  • - - @item.Key: - - - @(item.Value != null ? item.Value.ToString() : "") - -
  • - } - } -
-
- @if (!String.IsNullOrEmpty(Model.PaymentMethod)) - { -
-
- @T("Order.Payment") -
-
    -
  • - - @T("Order.Payment.Method"): - - - @Model.PaymentMethod - -
  • - @if (!Model.PrintMode) - { -
  • - - @T("Order.Payment.Status"): - - - @Model.PaymentMethodStatus - -
  • - } - @if (!Model.PrintMode && Model.CanRePostProcessPayment) - { - @*Complete payment (for redirection payment methods)*@ -
  • - @using (Html.BeginRouteForm("OrderDetails", FormMethod.Post)) - { - @Html.AntiForgeryToken() - -

    - @T("Order.RetryPayment.Hint") -

    - } -
  • - } -
-
- } -
- @if (Model.IsShippable) - { -
-
-
- @(Model.PickUpInStore ? T("Order.PickupAddress") : T("Order.ShippingAddress")) -
-
    - @if (!Model.PickUpInStore) - { -
  • - @Model.ShippingAddress.FirstName @Model.ShippingAddress.LastName -
  • - - if (Model.ShippingAddress.PhoneEnabled) - { -
  • - @T("Order.Phone"): @Model.ShippingAddress.PhoneNumber -
  • - } - if (Model.ShippingAddress.FaxEnabled) - { -
  • - @T("Order.Fax"): @Model.ShippingAddress.FaxNumber -
  • - } - if (Model.ShippingAddress.CompanyEnabled && !String.IsNullOrEmpty(Model.ShippingAddress.Company)) - { -
  • - @Model.ShippingAddress.Company -
  • - } - if (Model.ShippingAddress.StreetAddressEnabled) - { -
  • - @Model.ShippingAddress.Address1 -
  • - } - if (Model.ShippingAddress.StreetAddress2Enabled && !String.IsNullOrEmpty(Model.ShippingAddress.Address2)) - { -
  • - @Model.ShippingAddress.Address2 -
  • - } - if (Model.ShippingAddress.CityEnabled || - Model.ShippingAddress.StateProvinceEnabled || - Model.ShippingAddress.ZipPostalCodeEnabled) - { -
  • - @if (Model.ShippingAddress.CityEnabled) - { - @Model.ShippingAddress.City - } - @if (Model.ShippingAddress.CityEnabled && (Model.ShippingAddress.StateProvinceEnabled || Model.ShippingAddress.ZipPostalCodeEnabled)) - { - , - } - @if (Model.ShippingAddress.StateProvinceEnabled) - { - @Model.ShippingAddress.StateProvinceName - } - @if (Model.ShippingAddress.ZipPostalCodeEnabled) - { - @Model.ShippingAddress.ZipPostalCode - } -
  • - } - if (Model.ShippingAddress.CountryEnabled && !String.IsNullOrEmpty(Model.ShippingAddress.CountryName)) - { -
  • - @Model.ShippingAddress.CountryName -
  • - } - if (!String.IsNullOrEmpty(Model.ShippingAddress.FormattedCustomAddressAttributes)) - { -
  • - @Html.Raw(Model.ShippingAddress.FormattedCustomAddressAttributes) -
  • - } - } - else - { - if (!string.IsNullOrEmpty(Model.PickupAddress.Address1)) - { -
  • - @Model.PickupAddress.Address1 -
  • - } - if (!string.IsNullOrEmpty(Model.PickupAddress.City) || !string.IsNullOrEmpty(Model.PickupAddress.ZipPostalCode)) - { -
  • - @if (!string.IsNullOrEmpty(Model.PickupAddress.City)) - { - @Model.PickupAddress.City - } - @if (!string.IsNullOrEmpty(Model.PickupAddress.ZipPostalCode)) - { - , - @Model.PickupAddress.ZipPostalCode - } -
  • - } - if (!string.IsNullOrEmpty(Model.PickupAddress.CountryName)) - { -
  • - @Model.PickupAddress.CountryName -
  • - } - } -
-
-
-
- @T("Order.Shipping") -
-
    -
  • - - @T("Order.Shipping.Name"): - - - @Model.ShippingMethod - -
  • - @if (!Model.PrintMode) - { -
  • - - @T("Order.Shipping.Status"): - - - @Model.ShippingStatus - -
  • - } -
-
-
- } -
- @if (!Model.PrintMode && Model.Shipments.Count > 0) - { -
-
- @T("Order.Shipments") -
-
- - - - - - - - - - - - - - - - - - - @foreach (var item in Model.Shipments) - { - - - - - - - - } - -
- @T("Order.Shipments.ID") - - @T("Order.Shipments.TrackingNumber") - - @T("Order.Shipments.ShippedDate") - - @T("Order.Shipments.DeliveryDate") - - @T("Order.Shipments.ViewDetails") -
- - @item.Id.ToString() - - - @item.TrackingNumber - - - @if (item.ShippedDate.HasValue) - { - @item.ShippedDate.Value.ToString("D") - } - else - { - @T("Order.Shipments.ShippedDate.NotYet") - } - - - @if (item.DeliveryDate.HasValue) - { - @item.DeliveryDate.Value.ToString("D") - } - else - { - @T("Order.Shipments.DeliveryDate.NotYet") - } - - @T("Order.Shipments.ViewDetails") -
-
-
- } - @if (Model.Items.Count > 0) - { - if (!Model.PrintMode && Model.OrderNotes.Count > 0) - { -
-
- @T("Order.Notes") -
-
- - - - - - - - - - - - - @foreach (var item in Model.OrderNotes) - { - - - - - } - -
- @T("Order.Notes.CreatedOn") - - @T("Order.Notes.Note") -
- @item.CreatedOn.ToString() - - @Html.Raw(item.Note) - @if (item.HasDownload) - { -

- @T("Order.Notes.Download") -

- } -
-
-
- } - @Html.Widget("orderdetails_page_beforeproducts", Model.Id) -
-
- @T("Order.Product(s)") -
-
- - - @if (Model.ShowSku) - { - - } - - - - - - - - @if (Model.ShowSku) - { - - } - - - - - - - - @foreach (var item in Model.Items) - { - - @if (Model.ShowSku) - { - - } - - - - - - } - -
- @T("Order.Product(s).SKU") - - @T("Order.Product(s).Name") - - @T("Order.Product(s).Price") - - @T("Order.Product(s).Quantity") - - @T("Order.Product(s).Total") -
- - @item.Sku - - @if (!Model.PrintMode) - { - @item.ProductName - } - else - { - @item.ProductName - } - @if (!String.IsNullOrEmpty(item.AttributeInfo)) - { -
- @Html.Raw(item.AttributeInfo) -
- } - @if (!String.IsNullOrEmpty(item.RentalInfo)) - { -
- @Html.Raw(item.RentalInfo) -
- } - @if (item.DownloadId > 0) - { - - } - @if (item.LicenseId > 0) - { - - } - @Html.Widget("orderdetails_product_line", item.Id) -
- - @item.UnitPrice - - - @item.Quantity - - - @item.SubTotal -
-
- @if (Model.Items.Count > 0 && Model.DisplayTaxShippingInfo) - { - var inclTax = Model.PricesIncludeTax; - //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here - //of course, you can modify appropriate locales to include VAT info there -
- @T(inclTax ? "Order.TaxShipping.InclTax" : "Order.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") })) -
- } -
- @Html.Widget("orderdetails_page_afterproducts", Model.Id) -
- @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo)) - { -
- @Html.Raw(Model.CheckoutAttributeInfo) -
- } -
-
-
- - - - - - - @if (!string.IsNullOrEmpty(Model.OrderSubTotalDiscount)) - { - - - - - } - @if (Model.IsShippable) - { - - - - - } - @if (!string.IsNullOrEmpty(Model.PaymentMethodAdditionalFee)) - { - - - - - } - @if (Model.DisplayTaxRates && Model.TaxRates.Count > 0) - { - foreach (var taxRate in Model.TaxRates) - { - - - - - } - } - @if (Model.DisplayTax) - { - - - - - } - @if (!string.IsNullOrEmpty(Model.OrderTotalDiscount)) - { - - - - - } - @if (Model.GiftCards.Count > 0) - { - foreach (var gc in Model.GiftCards) - { - - - - - } - } - @if (Model.RedeemedRewardPoints > 0) - { - - - - - } - - - - - -
- - - @Model.OrderSubtotal -
- - - @Model.OrderSubTotalDiscount -
- - - @Model.OrderShipping -
- - - @Model.PaymentMethodAdditionalFee -
- - - @taxRate.Value -
- - - @Model.Tax -
- - - @Model.OrderTotalDiscount -
- - - @gc.Amount -
- - - @Model.RedeemedRewardPointsAmount -
- - - @Model.OrderTotal -
-
- @if (!Model.PrintMode) - { -
- @if (Model.IsReOrderAllowed) - { - - } - @if (Model.IsReturnRequestAllowed) - { - - } -
- } -
- } - @Html.Widget("orderdetails_page_bottom", Model.Id) -
-
+@model OrderDetailsModel +@using Nop.Web.Models.Order +@{ + if (!Model.PrintMode) + { + Layout = "~/Views/Shared/_ColumnsOne.cshtml"; + } + else + { + Layout = "~/Views/Shared/_Print.cshtml"; + } + //title + Html.AddTitleParts(T("PageTitle.OrderDetails").Text); + //page class + Html.AppendPageCssClassParts("html-order-details-page"); +} +@if (Model.PrintMode) +{ + +} +
+ @if (!Model.PrintMode) + { +
+

@T("Order.OrderInformation")

+ @T("Order.Print") + @if (!Model.PdfInvoiceDisabled) + { + @T("Order.GetPDFInvoice") + } +
+ } +
+ @Html.Widget("orderdetails_page_top", Model.Id) +
+
+ @T("Order.Order#")@Model.CustomOrderNumber +
+
    +
  • + @T("Order.OrderDate"): @Model.CreatedOn.ToString("D") +
  • +
  • + @T("Order.OrderStatus"): @Model.OrderStatus +
  • +
  • + @T("Order.OrderTotalAmountIncl"): @Model.OrderTotalAmountIncl +
  • +
  • + @T("Order.OrderTotal"): @Model.OrderTotal +
  • +
+ @Html.Widget("orderdetails_page_overview", Model.Id) +
+
+
+
+
+ @T("Order.BillingAddress") +
+
    +
  • + @Model.BillingAddress.FirstName @Model.BillingAddress.LastName +
  • + + @if (Model.BillingAddress.PhoneEnabled) + { +
  • + @T("Order.Phone"): @Model.BillingAddress.PhoneNumber +
  • + } + @if (Model.BillingAddress.FaxEnabled) + { +
  • + @T("Order.Fax"): @Model.BillingAddress.FaxNumber +
  • + } + @if (Model.BillingAddress.CompanyEnabled && !String.IsNullOrEmpty(Model.BillingAddress.Company)) + { +
  • + @Model.BillingAddress.Company +
  • + } + @if (Model.BillingAddress.StreetAddressEnabled) + { +
  • + @Model.BillingAddress.Address1 +
  • + } + @if (Model.BillingAddress.StreetAddress2Enabled && !String.IsNullOrEmpty(Model.BillingAddress.Address2)) + { +
  • + @Model.BillingAddress.Address2 +
  • + } + @if (Model.BillingAddress.CityEnabled || + Model.BillingAddress.StateProvinceEnabled || + Model.BillingAddress.ZipPostalCodeEnabled) + { +
  • + @if (Model.BillingAddress.CityEnabled) + { + @Model.BillingAddress.City + } + @if (Model.BillingAddress.CityEnabled && (Model.BillingAddress.StateProvinceEnabled || Model.BillingAddress.ZipPostalCodeEnabled)) + { + , + } + @if (Model.BillingAddress.StateProvinceEnabled) + { + @Model.BillingAddress.StateProvinceName + } + @if (Model.BillingAddress.ZipPostalCodeEnabled) + { + @Model.BillingAddress.ZipPostalCode + } +
  • + } + @if (Model.BillingAddress.CountryEnabled && !String.IsNullOrEmpty(Model.BillingAddress.CountryName)) + { +
  • + @Model.BillingAddress.CountryName +
  • + } + @if (!String.IsNullOrEmpty(Model.VatNumber)) + { +
  • + + @T("Order.VATNumber") + + + @Model.VatNumber + +
  • + } + @if (!String.IsNullOrEmpty(Model.BillingAddress.FormattedCustomAddressAttributes)) + { +
  • + @Html.Raw(Model.BillingAddress.FormattedCustomAddressAttributes) +
  • + } + @if (Model.CustomValues != null) + { + foreach (var item in Model.CustomValues) + { +
  • + + @item.Key: + + + @(item.Value != null ? item.Value.ToString() : "") + +
  • + } + } +
+
+ @if (!String.IsNullOrEmpty(Model.PaymentMethod)) + { +
+
+ @T("Order.Payment") +
+
    +
  • + + @T("Order.Payment.Method"): + + + @Model.PaymentMethod + +
  • + @if (!Model.PrintMode) + { +
  • + + @T("Order.Payment.Status"): + + + @Model.PaymentMethodStatus + +
  • + } + @if (!Model.PrintMode && Model.CanRePostProcessPayment) + { + @*Complete payment (for redirection payment methods)*@ +
  • + @using (Html.BeginRouteForm("OrderDetails", FormMethod.Post)) + { + @Html.AntiForgeryToken() + +

    + @T("Order.RetryPayment.Hint") +

    + } +
  • + } +
+
+ } +
+ @if (Model.IsShippable) + { +
+
+
+ @(Model.PickUpInStore ? T("Order.PickupAddress") : T("Order.ShippingAddress")) +
+
    + @if (!Model.PickUpInStore) + { +
  • + @Model.ShippingAddress.FirstName @Model.ShippingAddress.LastName +
  • + + if (Model.ShippingAddress.PhoneEnabled) + { +
  • + @T("Order.Phone"): @Model.ShippingAddress.PhoneNumber +
  • + } + if (Model.ShippingAddress.FaxEnabled) + { +
  • + @T("Order.Fax"): @Model.ShippingAddress.FaxNumber +
  • + } + if (Model.ShippingAddress.CompanyEnabled && !String.IsNullOrEmpty(Model.ShippingAddress.Company)) + { +
  • + @Model.ShippingAddress.Company +
  • + } + if (Model.ShippingAddress.StreetAddressEnabled) + { +
  • + @Model.ShippingAddress.Address1 +
  • + } + if (Model.ShippingAddress.StreetAddress2Enabled && !String.IsNullOrEmpty(Model.ShippingAddress.Address2)) + { +
  • + @Model.ShippingAddress.Address2 +
  • + } + if (Model.ShippingAddress.CityEnabled || + Model.ShippingAddress.StateProvinceEnabled || + Model.ShippingAddress.ZipPostalCodeEnabled) + { +
  • + @if (Model.ShippingAddress.CityEnabled) + { + @Model.ShippingAddress.City + } + @if (Model.ShippingAddress.CityEnabled && (Model.ShippingAddress.StateProvinceEnabled || Model.ShippingAddress.ZipPostalCodeEnabled)) + { + , + } + @if (Model.ShippingAddress.StateProvinceEnabled) + { + @Model.ShippingAddress.StateProvinceName + } + @if (Model.ShippingAddress.ZipPostalCodeEnabled) + { + @Model.ShippingAddress.ZipPostalCode + } +
  • + } + if (Model.ShippingAddress.CountryEnabled && !String.IsNullOrEmpty(Model.ShippingAddress.CountryName)) + { +
  • + @Model.ShippingAddress.CountryName +
  • + } + if (!String.IsNullOrEmpty(Model.ShippingAddress.FormattedCustomAddressAttributes)) + { +
  • + @Html.Raw(Model.ShippingAddress.FormattedCustomAddressAttributes) +
  • + } + } + else + { + if (!string.IsNullOrEmpty(Model.PickupAddress.Address1)) + { +
  • + @Model.PickupAddress.Address1 +
  • + } + if (!string.IsNullOrEmpty(Model.PickupAddress.City) || !string.IsNullOrEmpty(Model.PickupAddress.ZipPostalCode)) + { +
  • + @if (!string.IsNullOrEmpty(Model.PickupAddress.City)) + { + @Model.PickupAddress.City + } + @if (!string.IsNullOrEmpty(Model.PickupAddress.ZipPostalCode)) + { + , + @Model.PickupAddress.ZipPostalCode + } +
  • + } + if (!string.IsNullOrEmpty(Model.PickupAddress.CountryName)) + { +
  • + @Model.PickupAddress.CountryName +
  • + } + } +
+
+
+
+ @T("Order.Shipping") +
+
    +
  • + + @T("Order.Shipping.Name"): + + + @Model.ShippingMethod + +
  • + @if (!Model.PrintMode) + { +
  • + + @T("Order.Shipping.Status"): + + + @Model.ShippingStatus + +
  • + } +
+
+
+ } +
+ @if (!Model.PrintMode && Model.Shipments.Count > 0) + { +
+
+ @T("Order.Shipments") +
+
+ + + + + + + + + + + + + + + + + + + @foreach (var item in Model.Shipments) + { + + + + + + + + } + +
+ @T("Order.Shipments.ID") + + @T("Order.Shipments.TrackingNumber") + + @T("Order.Shipments.ShippedDate") + + @T("Order.Shipments.DeliveryDate") + + @T("Order.Shipments.ViewDetails") +
+ + @item.Id.ToString() + + + @item.TrackingNumber + + + @if (item.ShippedDate.HasValue) + { + @item.ShippedDate.Value.ToString("D") + } + else + { + @T("Order.Shipments.ShippedDate.NotYet") + } + + + @if (item.DeliveryDate.HasValue) + { + @item.DeliveryDate.Value.ToString("D") + } + else + { + @T("Order.Shipments.DeliveryDate.NotYet") + } + + @T("Order.Shipments.ViewDetails") +
+
+
+ } + @if (Model.Items.Count > 0) + { + if (!Model.PrintMode && Model.OrderNotes.Count > 0) + { +
+
+ @T("Order.Notes") +
+
+ + + + + + + + + + + + + @foreach (var item in Model.OrderNotes) + { + + + + + } + +
+ @T("Order.Notes.CreatedOn") + + @T("Order.Notes.Note") +
+ @item.CreatedOn.ToString() + + @Html.Raw(item.Note) + @if (item.HasDownload) + { +

+ @T("Order.Notes.Download") +

+ } +
+
+
+ } + @Html.Widget("orderdetails_page_beforeproducts", Model.Id) +
+
+ @T("Order.Product(s)") +
+
+ + + @if (Model.ShowSku) + { + + } + + + + + + + + + @if (Model.ShowSku) + { + + } + + + + + + + + + @foreach (var item in Model.Items) + { + + @if (Model.ShowSku) + { + + } + + + + + + + } + +
+ @T("Order.Product(s).SKU") + + @T("Order.Product(s).Name") + + @T("Order.Product(s).Price") + + @T("Order.Product(s).Quantity") + + @T("Order.TaxRateLine.TaxRate") + + @T("Order.Product(s).Total") +
+ + @item.Sku + + @if (!Model.PrintMode) + { + @item.ProductName + } + else + { + @item.ProductName + } + @if (item.ExcludeFromRewardPoints) + { +
+ @T("Products.ExcludeFromRewardPoints") +
+ } + @if (!String.IsNullOrEmpty(item.AttributeInfo)) + { +
+ @Html.Raw(item.AttributeInfo) +
+ } + @if (!String.IsNullOrEmpty(item.RentalInfo)) + { +
+ @Html.Raw(item.RentalInfo) +
+ } + @if (item.DownloadId > 0) + { + + } + @if (item.LicenseId > 0) + { + + } + @Html.Widget("orderdetails_product_line", item.Id) +
+ + @item.UnitPrice + + + @item.Quantity + + + @item.TaxRate + + + @item.SubTotal +
+
+ @if (Model.Items.Count > 0 && Model.DisplayTaxShippingInfo) + { + var inclTax = Model.PricesIncludeTax; + //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here + //of course, you can modify appropriate locales to include VAT info there +
+ @T(inclTax ? "Order.TaxShipping.InclTax" : "Order.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") })) +
+ } +
+ @Html.Widget("orderdetails_page_afterproducts", Model.Id) +
+ @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo)) + { +
+ @Html.Raw(Model.CheckoutAttributeInfo) +
+ } +
+
+
+ + + + + + + @if (!string.IsNullOrEmpty(Model.OrderSubTotalDiscount)) + { + + + + + } + @if (Model.IsShippable && string.IsNullOrEmpty(Model.OrderShippingNonTaxable)) + { + + + + + } + @if (!string.IsNullOrEmpty(Model.OrderTotalDiscount)) + { + + + + + } + @if (Model.EarnedRewardPointsAreTaxable && Model.RedeemedRewardPoints > 0) + { + + + + + } + @if (!string.IsNullOrEmpty(Model.PaymentMethodAdditionalFee)) + { + + + + + } + @if (!String.IsNullOrEmpty(Model.OrderAmount)) + { + + + + + } + @if (Model.DisplayTax) + { + + + + + } + @if (Model.DisplayTaxRates && Model.TaxRates.Count > 0) + { + + + + } + @if (Model.IsShippable && !string.IsNullOrEmpty(Model.OrderShippingNonTaxable)) + { + + + + + } + @if (!string.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeNonTaxable)) + { + + + + + } + @if (Model.GiftCards.Count > 0) + { + foreach (var gc in Model.GiftCards) + { + + + + + } + } + @if (!Model.EarnedRewardPointsAreTaxable && Model.RedeemedRewardPoints > 0) + { + + + + + } + @if (Model.RedeemedRewardPointsPurchased > 0) + { + + + + + } + + + + + + + + + +
+ + + @Model.OrderSubtotal +
+ + + @Model.OrderSubTotalDiscount +
+ + + @Model.OrderShipping +
+ + + @Model.OrderTotalDiscount +
+ + + @Model.RedeemedRewardPointsAmount +
+ + + @Model.PaymentMethodAdditionalFee +
+ + + @(Model.includingTax ? Model.OrderAmountIncl : Model.OrderAmount) +
+ + + @Model.Tax +
+
    +
  • + @T("Order.TaxRateLine.TaxRate") + @if (Model.includingTax) + { + @T("Order.TaxRateLine.AmountIncl") + } + else + { + @T("Order.TaxRateLine.Amount") + } + @if (Model.includingTax) + { + @T("Order.TaxRateLine.DiscountAmountIncl") + } + else + { + @T("Order.TaxRateLine.DiscountAmount") + } + @T("Order.TaxRateLine.BaseAmount") + @T("Order.TaxRateLine.TaxAmount") +
  • + @foreach (var taxRate in Model.TaxRates) + { +
  • + @taxRate.Rate + @taxRate.Amount + @taxRate.DiscountAmount + @taxRate.BaseAmount + @taxRate.TaxAmount +
  • + } +
+
+ + + @Model.OrderShippingNonTaxable +
+ + + @Model.PaymentMethodAdditionalFeeNonTaxable +
+ + + @gc.Amount +
+ + + @Model.RedeemedRewardPointsAmount +
+ + + @Model.RedeemedRewardPointsAmountPurchased +
+ + + @Model.OrderTotalAmountIncl +
+ + + @Model.OrderTotal +
+
+ @if (!Model.PrintMode) + { +
+ @if (Model.IsReOrderAllowed) + { + + } + @if (Model.IsReturnRequestAllowed) + { + + } +
+ } +
+ } + @Html.Widget("orderdetails_page_bottom", Model.Id) +
+
diff --git a/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Grouped.cshtml b/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Grouped.cshtml index ca061940278..ac6e8fce9a1 100644 --- a/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Grouped.cshtml +++ b/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Grouped.cshtml @@ -74,6 +74,12 @@ @Html.Raw(Model.ShortDescription) } + @if (Model.ExcludeFromRewardPoints) + { +
+ @T("Products.ExcludeFromRewardPoints") +
+ } @Html.Widget("productdetails_overview_top", Model.Id) @Html.Partial("_ProductReviewOverview", Model.ProductReviewOverview) diff --git a/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Simple.cshtml b/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Simple.cshtml index e9a6ebf54be..8e3c8025369 100644 --- a/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Simple.cshtml +++ b/src/Presentation/Nop.Web/Views/Product/ProductTemplate.Simple.cshtml @@ -74,6 +74,12 @@ @Html.Raw(Model.ShortDescription) } + @if (Model.ExcludeFromRewardPoints) + { +
+ @T("Products.ExcludeFromRewardPoints") +
+ } @Html.Widget("productdetails_overview_top", Model.Id) @Html.Partial("_ProductReviewOverview", Model.ProductReviewOverview) diff --git a/src/Presentation/Nop.Web/Views/ShoppingCart/OrderSummary.cshtml b/src/Presentation/Nop.Web/Views/ShoppingCart/OrderSummary.cshtml index 4d8649ac8da..bcab8ab50ed 100644 --- a/src/Presentation/Nop.Web/Views/ShoppingCart/OrderSummary.cshtml +++ b/src/Presentation/Nop.Web/Views/ShoppingCart/OrderSummary.cshtml @@ -1,322 +1,336 @@ -@model ShoppingCartModel -@using Nop.Core -@using Nop.Core.Domain.Tax -@using Nop.Core.Infrastructure -@using Nop.Web.Models.ShoppingCart; -@{ - var webHelper = EngineContext.Current.Resolve(); -} -
- @Html.Widget("order_summary_content_before") - @Html.Partial("_OrderReviewData", Model.OrderReviewData) - @if (Model.Items.Count > 0) - { - if (Model.Warnings.Count > 0) - { -
-
    - @foreach (var warning in Model.Warnings) - { -
  • @warning
  • - } -
-
- } - @*we add enctype = "multipart/form-data" because "File upload" attribute control type requires it*@ - using (Html.BeginRouteForm("ShoppingCart", FormMethod.Post, new { enctype = "multipart/form-data", id = "shopping-cart-form" })) - { - @Html.AntiForgeryToken() -
- - - @if (Model.IsEditable) - { - - } - @if (Model.ShowSku) - { - - } - @if (Model.ShowProductImages) - { - - } - - - - - - - - @if (Model.IsEditable) - { - - } - @if (Model.ShowSku) - { - - } - @if (Model.ShowProductImages) - { - - } - - - - - - - - @foreach (var item in Model.Items) - { - - @if (Model.IsEditable) - { - - } - @if (Model.ShowSku) - { - - } - @if (Model.ShowProductImages) - { - - } - - - - - - } - -
- @T("ShoppingCart.Remove") - - @T("ShoppingCart.SKU") - - @T("ShoppingCart.Image") - - @T("ShoppingCart.Product(s)") - - @T("ShoppingCart.UnitPrice") - - @T("ShoppingCart.Quantity") - - @T("ShoppingCart.ItemTotal") -
- @if (item.DisableRemoval) - { -   - } - else - { - - - } - - - @item.Sku - - @item.Picture.AlternateText - - @item.ProductName - @if (!String.IsNullOrEmpty(item.AttributeInfo)) - { -
- @Html.Raw(item.AttributeInfo) -
- } - @if (!String.IsNullOrEmpty(item.RecurringInfo)) - { -
- @Html.Raw(item.RecurringInfo) -
- } - @if (!String.IsNullOrEmpty(item.RentalInfo)) - { -
- @Html.Raw(item.RentalInfo) -
- } - @if (Model.IsEditable && item.AllowItemEditing) - { - var editCartItemUrl = Url.RouteUrl("Product", new {SeName = item.ProductSeName}); - editCartItemUrl = webHelper.ModifyQueryString(editCartItemUrl, "updatecartitemid=" + item.Id, null); - - } - @if (item.Warnings.Count > 0) - { -
-
    - @foreach (var warning in item.Warnings) - { -
  • @warning
  • - } -
-
- } -
- - @item.UnitPrice - - - @if (Model.IsEditable) - { - if (item.AllowedQuantities.Count > 0) - { - - } - else - { - - } - - } - else - { - @item.Quantity - } - - - @item.SubTotal - @if (!String.IsNullOrEmpty(item.Discount)) - { -
- @T("ShoppingCart.ItemYouSave", item.Discount) -
- if (item.MaximumDiscountedQty.HasValue) - { -
- @T("ShoppingCart.MaximumDiscountedQty", item.MaximumDiscountedQty.Value) -
- } - } -
-
- if (Model.IsEditable && Model.Items.Count > 0 && Model.DisplayTaxShippingInfo) - { - var inclTax = EngineContext.Current.Resolve().TaxDisplayType == TaxDisplayType.IncludingTax; - //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here - //of course, you can modify appropriate locales to include VAT info there -
- @T(inclTax ? "ShoppingCart.TaxShipping.InclTax" : "ShoppingCart.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") })) -
- } -
- @if (Model.IsEditable) - { -
- - -
- } - @if (Model.IsEditable) - { - @Html.Partial("_CheckoutAttributes", Model.CheckoutAttributes, new ViewDataDictionary()) - } - @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo)) - { -
- @Html.Raw(Model.CheckoutAttributeInfo) -
- } -
- - if (Model.IsEditable) - { - @Html.Action("CrossSellProducts", "Product") - } - } - } - else - { -
- @T("ShoppingCart.CartIsEmpty") -
- } - @Html.Widget("order_summary_content_after") +@model ShoppingCartModel +@using Nop.Core +@using Nop.Core.Domain.Tax +@using Nop.Core.Infrastructure +@using Nop.Web.Models.ShoppingCart; +@{ + var webHelper = EngineContext.Current.Resolve(); +} +
+ @Html.Widget("order_summary_content_before") + @Html.Partial("_OrderReviewData", Model.OrderReviewData) + @if (Model.Items.Count > 0) + { + if (Model.Warnings.Count > 0) + { +
+
    + @foreach (var warning in Model.Warnings) + { +
  • @warning
  • + } +
+
+ } + @*we add enctype = "multipart/form-data" because "File upload" attribute control type requires it*@ + using (Html.BeginRouteForm("ShoppingCart", FormMethod.Post, new { enctype = "multipart/form-data", id = "shopping-cart-form" })) + { + @Html.AntiForgeryToken() +
+ + + @if (Model.IsEditable) + { + + } + @if (Model.ShowSku) + { + + } + @if (Model.ShowProductImages) + { + + } + + + + + + + + + @if (Model.IsEditable) + { + + } + @if (Model.ShowSku) + { + + } + @if (Model.ShowProductImages) + { + + } + + + + + + + + + @foreach (var item in Model.Items) + { + + @if (Model.IsEditable) + { + + } + @if (Model.ShowSku) + { + + } + @if (Model.ShowProductImages) + { + + } + + + + + + + } + +
+ @T("ShoppingCart.Remove") + + @T("ShoppingCart.SKU") + + @T("ShoppingCart.Image") + + @T("ShoppingCart.Product(s)") + + @T("ShoppingCart.UnitPrice") + + @T("ShoppingCart.Quantity") + + @T("ShoppingCart.TaxRate") + + @T("ShoppingCart.ItemTotal") +
+ @if (item.DisableRemoval) + { +   + } + else + { + + + } + + + @item.Sku + + @item.Picture.AlternateText + + @item.ProductName + @if (!String.IsNullOrEmpty(item.AttributeInfo)) + { +
+ @Html.Raw(item.AttributeInfo) +
+ } + @if (!String.IsNullOrEmpty(item.RecurringInfo)) + { +
+ @Html.Raw(item.RecurringInfo) +
+ } + @if (!String.IsNullOrEmpty(item.RentalInfo)) + { +
+ @Html.Raw(item.RentalInfo) +
+ } + @if (item.ExcludeFromRewardPoints) + { +
+ @T("Products.ExcludeFromRewardPoints") +
+ } + @if (Model.IsEditable && item.AllowItemEditing) + { + var editCartItemUrl = Url.RouteUrl("Product", new {SeName = item.ProductSeName}); + editCartItemUrl = webHelper.ModifyQueryString(editCartItemUrl, "updatecartitemid=" + item.Id, null); + + } + @if (item.Warnings.Count > 0) + { +
+
    + @foreach (var warning in item.Warnings) + { +
  • @warning
  • + } +
+
+ } +
+ + @item.UnitPrice + + + @if (Model.IsEditable) + { + if (item.AllowedQuantities.Count > 0) + { + + } + else + { + + } + + } + else + { + @item.Quantity + } + + + @item.TaxRate + + + @item.SubTotal + @if (!String.IsNullOrEmpty(item.Discount)) + { +
+ @T("ShoppingCart.ItemYouSave", item.Discount) +
+ if (item.MaximumDiscountedQty.HasValue) + { +
+ @T("ShoppingCart.MaximumDiscountedQty", item.MaximumDiscountedQty.Value) +
+ } + } +
+
+ if (Model.IsEditable && Model.Items.Count > 0 && Model.DisplayTaxShippingInfo) + { + var inclTax = EngineContext.Current.Resolve().TaxDisplayType == TaxDisplayType.IncludingTax; + //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here + //of course, you can modify appropriate locales to include VAT info there +
+ @T(inclTax ? "ShoppingCart.TaxShipping.InclTax" : "ShoppingCart.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") })) +
+ } +
+ @if (Model.IsEditable) + { +
+ + +
+ } + @if (Model.IsEditable) + { + @Html.Partial("_CheckoutAttributes", Model.CheckoutAttributes, new ViewDataDictionary()) + } + @if (!String.IsNullOrEmpty(Model.CheckoutAttributeInfo)) + { +
+ @Html.Raw(Model.CheckoutAttributeInfo) +
+ } +
+ + if (Model.IsEditable) + { + @Html.Action("CrossSellProducts", "Product") + } + } + } + else + { +
+ @T("ShoppingCart.CartIsEmpty") +
+ } + @Html.Widget("order_summary_content_after")
\ No newline at end of file diff --git a/src/Presentation/Nop.Web/Views/ShoppingCart/OrderTotals.cshtml b/src/Presentation/Nop.Web/Views/ShoppingCart/OrderTotals.cshtml index bdcf5b024be..30367d7543f 100644 --- a/src/Presentation/Nop.Web/Views/ShoppingCart/OrderTotals.cshtml +++ b/src/Presentation/Nop.Web/Views/ShoppingCart/OrderTotals.cshtml @@ -1,161 +1,276 @@ -@model OrderTotalsModel -@using Nop.Web.Models.ShoppingCart; -
- - - - - - - @if (!String.IsNullOrEmpty(Model.SubTotalDiscount)) - { - - - - - } - @if (!Model.HideShippingTotal) - { - - - - - } - @if (!String.IsNullOrEmpty(Model.PaymentMethodAdditionalFee)) - { - - - - - } - @if (Model.DisplayTaxRates && Model.TaxRates.Count > 0) - { - foreach (var taxRate in Model.TaxRates) - { - - - - - } - } - @if (Model.DisplayTax) - { - - - - - } - @if (!String.IsNullOrEmpty(Model.OrderTotalDiscount)) - { - - - - - } - @if (Model.GiftCards.Count > 0) - { - foreach (var gc in Model.GiftCards) - { - - - - - } - } - @if (Model.RedeemedRewardPoints > 0) - { - - - - - } - - - - - @if (Model.WillEarnRewardPoints > 0) - { - - - - - } - -
- - - @Model.SubTotal -
- - - @Model.SubTotalDiscount -
- - @if (Model.RequiresShipping && !String.IsNullOrEmpty(Model.SelectedShippingMethod)) - { - @T("ShoppingCart.Totals.Shipping.Method", Model.SelectedShippingMethod) - } - - @if (Model.RequiresShipping) - { - if (!String.IsNullOrEmpty(Model.Shipping)) - { - @Model.Shipping - } - else - { - @T("ShoppingCart.Totals.CalculatedDuringCheckout") - } - } - else - { - @T("ShoppingCart.Totals.Shipping.NotRequired") - } -
- - - @Model.PaymentMethodAdditionalFee -
- - - @taxRate.Value -
- - - @Model.Tax -
- - - @Model.OrderTotalDiscount -
- - @T("ShoppingCart.Totals.GiftCardInfo.Code", gc.CouponCode) - @if (Model.IsEditable) - { - //little hack here with empty "value" element - - } - @string.Format(T("ShoppingCart.Totals.GiftCardInfo.Remaining").Text, gc.Remaining) - - @gc.Amount -
- - - @Model.RedeemedRewardPointsAmount -
- - - @if (!String.IsNullOrEmpty(Model.OrderTotal)) - { - @Model.OrderTotal - } - else - { - @T("ShoppingCart.Totals.CalculatedDuringCheckout") - } -
- - - @string.Format(T("ShoppingCart.Totals.RewardPoints.WillEarn.Point").Text, Model.WillEarnRewardPoints) -
-
+@model OrderTotalsModel +@using Nop.Web.Models.ShoppingCart; +
+ + + + + + + @if (!String.IsNullOrEmpty(Model.SubTotalDiscount)) + { + + + + + } + @if (!Model.HideShippingTotal && String.IsNullOrEmpty(Model.ShippingNonTaxable)) + { + + + + + } + @if (!String.IsNullOrEmpty(Model.PaymentMethodAdditionalFee)) + { + + + + + } + @if (!String.IsNullOrEmpty(Model.OrderTotalDiscount)) + { + + + + + } + @if (Model.EarnedRewardPointsAreTaxable && Model.RedeemedRewardPoints > 0) + { + + + + + } + @if (!String.IsNullOrEmpty(Model.OrderAmount)) + { + + + + + } + @if (Model.DisplayTax) + { + + + + + } + @if (Model.DisplayTaxRates && Model.TaxRates.Count > 0) + { + + + + } + @if (!String.IsNullOrEmpty(Model.OrderAmount) && !Model.includingTax) + { + + + + + } + @if (!Model.HideShippingTotal && !String.IsNullOrEmpty(Model.ShippingNonTaxable)) + { + + + + + } + @if (!String.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeNonTaxable)) + { + + + + + } + @if (Model.GiftCards.Count > 0) + { + foreach (var gc in Model.GiftCards) + { + + + + + } + } + @if (!Model.EarnedRewardPointsAreTaxable && Model.RedeemedRewardPoints > 0) + { + + + + + } + @if (Model.RedeemedRewardPointsPurchased > 0) + { + + + + + } + + + + + @if (Model.WillEarnRewardPoints > 0) + { + + + + + + } + +
+ + + @Model.SubTotal +
+ + + @Model.SubTotalDiscount +
+ + @if (Model.RequiresShipping && !String.IsNullOrEmpty(Model.SelectedShippingMethod)) + { + @T("ShoppingCart.Totals.Shipping.Method", Model.SelectedShippingMethod) + } + + @if (Model.RequiresShipping) + { + if (!String.IsNullOrEmpty(Model.Shipping)) + { + @Model.Shipping + } + else + { + @T("ShoppingCart.Totals.CalculatedDuringCheckout") + } + } + else + { + @T("ShoppingCart.Totals.Shipping.NotRequired") + } +
+ + + @Model.PaymentMethodAdditionalFee +
+ + + @Model.OrderTotalDiscount +
+ + + @Model.RedeemedRewardPointsAmount +
+ + + @(Model.includingTax ? Model.OrderAmountIncl : Model.OrderAmount) +
+ + + @Model.Tax +
+
    +
  • + @T("Order.TaxRateLine.TaxRate") + @if (Model.includingTax) + { + @T("Order.TaxRateLine.AmountIncl") + } + else + { + @T("Order.TaxRateLine.Amount") + } + @if (Model.includingTax) + { + @T("Order.TaxRateLine.DiscountAmountIncl") + } + else + { + @T("Order.TaxRateLine.DiscountAmount") + } + @T("Order.TaxRateLine.BaseAmount") + @T("Order.TaxRateLine.TaxAmount") +
  • + @foreach (var taxRate in Model.TaxRates) + { +
  • + @taxRate.Rate + @taxRate.Amount + @taxRate.DiscountAmount + @taxRate.BaseAmount + @taxRate.TaxAmount +
  • + } +
+
+ + + @Model.OrderAmountIncl +
+ + @if (Model.RequiresShipping && !String.IsNullOrEmpty(Model.SelectedShippingMethod)) + { + @T("ShoppingCart.Totals.Shipping.Method", Model.SelectedShippingMethod) + } + + @if (Model.RequiresShipping) + { + if (!String.IsNullOrEmpty(Model.ShippingNonTaxable)) + { + @Model.ShippingNonTaxable + } + else + { + @T("ShoppingCart.Totals.CalculatedDuringCheckout") + } + } + else + { + @T("ShoppingCart.Totals.Shipping.NotRequired") + } +
+ + + @Model.PaymentMethodAdditionalFeeNonTaxable +
+ + @T("ShoppingCart.Totals.GiftCardInfo.Code", gc.CouponCode) + @if (Model.IsEditable) + { + //little hack here with empty "value" element + + } + @string.Format(T("ShoppingCart.Totals.GiftCardInfo.Remaining").Text, gc.Remaining) + + @gc.Amount +
+ + + @Model.RedeemedRewardPointsAmount +
+ + + @Model.RedeemedRewardPointsAmountPurchased +
+ + + @if (!String.IsNullOrEmpty(Model.OrderTotal)) + { + @Model.OrderTotal + } + else + { + @T("ShoppingCart.Totals.CalculatedDuringCheckout") + } +
+ + @if (!Model.WillEarn) + { +
@T("ShoppingCart.Totals.RewardPoints.WillEarnHint")
+ } +
+ @string.Format(T("ShoppingCart.Totals.RewardPoints.WillEarn.Point").Text, Model.WillEarnRewardPoints) +
+
diff --git a/src/Tests/Nop.Data.Tests/Orders/OrderPersistenceTests.cs b/src/Tests/Nop.Data.Tests/Orders/OrderPersistenceTests.cs index 11a69ec8cf8..08c74a7c7b7 100644 --- a/src/Tests/Nop.Data.Tests/Orders/OrderPersistenceTests.cs +++ b/src/Tests/Nop.Data.Tests/Orders/OrderPersistenceTests.cs @@ -1,130 +1,130 @@ -using System.Linq; -using Nop.Tests; -using NUnit.Framework; - -namespace Nop.Data.Tests.Orders -{ - [TestFixture] - public class OrderPersistenceTests : PersistenceTest - { - [Test] - public void Can_save_and_load_order() - { - var order = this.GetTestOrder(); - - order.Customer = this.GetTestCustomer(); - order.PickupAddress = this.GetTestAddress(); - - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - fromDb.PropertiesShouldEqual(this.GetTestOrder()); - fromDb.Customer.PropertiesShouldEqual(this.GetTestCustomer()); - fromDb.PickupAddress.PropertiesShouldEqual(this.GetTestAddress()); - fromDb.BillingAddress.PropertiesShouldEqual(this.GetTestAddress()); - } - - [Test] - public void Can_save_and_load_order_with_shipping_address() - { - var order = this.GetTestOrder(); - - order.Customer = this.GetTestCustomer(); - order.PickupAddress = this.GetTestAddress(); - order.ShippingAddress = this.GetTestAddress(); - - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - fromDb.ShippingAddress.ShouldNotBeNull(); - fromDb.ShippingAddress.PropertiesShouldEqual(this.GetTestAddress()); - } - - [Test] - public void Can_save_and_load_order_with_usedRewardPoints() - { - var order = this.GetTestOrder(); - order.RedeemedRewardPointsEntry = this.GetTestRewardPointsHistory(); - order.RedeemedRewardPointsEntry.UsedWithOrder = order; - - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - fromDb.PropertiesShouldEqual(this.GetTestOrder()); - - fromDb.RedeemedRewardPointsEntry.ShouldNotBeNull(); - fromDb.RedeemedRewardPointsEntry.PropertiesShouldEqual(this.GetTestRewardPointsHistory()); - } - - [Test] - public void Can_save_and_load_order_with_discountUsageHistory() - { - var order = this.GetTestOrder(); - var discountUsageHistory = this.GetTestDiscountUsageHistory(); - order.Customer = this.GetTestCustomer(); - discountUsageHistory.Order = order; - order.DiscountUsageHistory.Add(discountUsageHistory); - - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - fromDb.PropertiesShouldEqual(this.GetTestOrder()); - - fromDb.DiscountUsageHistory.ShouldNotBeNull(); - fromDb.DiscountUsageHistory.First().PropertiesShouldEqual(this.GetTestDiscountUsageHistory()); - } - - [Test] - public void Can_save_and_load_order_with_giftCardUsageHistory() - { - var order = this.GetTestOrder(); - order.GiftCardUsageHistory.Add(this.GetTestGiftCardUsageHistory()); - order.Customer = this.GetTestCustomer(); - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - - fromDb.GiftCardUsageHistory.ShouldNotBeNull(); - fromDb.GiftCardUsageHistory.Count.ShouldEqual(1); - fromDb.GiftCardUsageHistory.First().PropertiesShouldEqual(this.GetTestGiftCardUsageHistory()); - } - - [Test] - public void Can_save_and_load_order_with_orderNotes() - { - var order = this.GetTestOrder(); - order.OrderNotes.Add(this.GetTestOrderNote()); - order.Customer = this.GetTestCustomer(); - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - - fromDb.OrderNotes.ShouldNotBeNull(); - fromDb.OrderNotes.Count.ShouldEqual(1); - fromDb.OrderNotes.First().PropertiesShouldEqual(this.GetTestOrderNote()); - } - - [Test] - public void Can_save_and_load_order_with_orderItems() - { - var order = this.GetTestOrder(); - order.OrderItems.Add(this.GetTestOrderItem()); - order.Customer = this.GetTestCustomer(); - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - - fromDb.OrderItems.ShouldNotBeNull(); - fromDb.OrderItems.Count.ShouldEqual(1); - fromDb.OrderItems.First().PropertiesShouldEqual(this.GetTestOrderItem()); - } - - [Test] - public void Can_save_and_load_order_with_shipments() - { - var order = this.GetTestOrder(); - order.Shipments.Add(this.GetTestShipment()); - order.Shipments.First().Order = order; - order.Customer = this.GetTestCustomer(); - var fromDb = SaveAndLoadEntity(order); - fromDb.ShouldNotBeNull(); - - fromDb.Shipments.ShouldNotBeNull(); - fromDb.Shipments.Count.ShouldEqual(1); - fromDb.Shipments.First().PropertiesShouldEqual(this.GetTestShipment()); - } - } -} +using System.Linq; +using Nop.Tests; +using NUnit.Framework; + +namespace Nop.Data.Tests.Orders +{ + [TestFixture] + public class OrderPersistenceTests : PersistenceTest + { + [Test] + public void Can_save_and_load_order() + { + var order = this.GetTestOrder(); + + order.Customer = this.GetTestCustomer(); + order.PickupAddress = this.GetTestAddress(); + + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + fromDb.PropertiesShouldEqual(this.GetTestOrder()); + fromDb.Customer.PropertiesShouldEqual(this.GetTestCustomer()); + fromDb.PickupAddress.PropertiesShouldEqual(this.GetTestAddress()); + fromDb.BillingAddress.PropertiesShouldEqual(this.GetTestAddress()); + } + + [Test] + public void Can_save_and_load_order_with_shipping_address() + { + var order = this.GetTestOrder(); + + order.Customer = this.GetTestCustomer(); + order.PickupAddress = this.GetTestAddress(); + order.ShippingAddress = this.GetTestAddress(); + + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + fromDb.ShippingAddress.ShouldNotBeNull(); + fromDb.ShippingAddress.PropertiesShouldEqual(this.GetTestAddress()); + } + + [Test] + public void Can_save_and_load_order_with_usedRewardPoints() + { + var order = this.GetTestOrder(); + order.RedeemedRewardPointsEntry = this.GetTestRewardPointsHistory(); + order.RedeemedRewardPointsEntry.UsedWithOrder = order; + + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + fromDb.PropertiesShouldEqual(this.GetTestOrder()); + + fromDb.RedeemedRewardPointsEntry.ShouldNotBeNull(); + fromDb.RedeemedRewardPointsEntry.PropertiesShouldEqual(this.GetTestRewardPointsHistory()); + } + + [Test] + public void Can_save_and_load_order_with_discountUsageHistory() + { + var order = this.GetTestOrder(); + var discountUsageHistory = this.GetTestDiscountUsageHistory(); + order.Customer = this.GetTestCustomer(); + discountUsageHistory.Order = order; + order.DiscountUsageHistory.Add(discountUsageHistory); + + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + fromDb.PropertiesShouldEqual(this.GetTestOrder()); + + fromDb.DiscountUsageHistory.ShouldNotBeNull(); + fromDb.DiscountUsageHistory.First().PropertiesShouldEqual(this.GetTestDiscountUsageHistory()); + } + + [Test] + public void Can_save_and_load_order_with_giftCardUsageHistory() + { + var order = this.GetTestOrder(); + order.GiftCardUsageHistory.Add(this.GetTestGiftCardUsageHistory()); + order.Customer = this.GetTestCustomer(); + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + + fromDb.GiftCardUsageHistory.ShouldNotBeNull(); + fromDb.GiftCardUsageHistory.Count.ShouldEqual(1); + fromDb.GiftCardUsageHistory.First().PropertiesShouldEqual(this.GetTestGiftCardUsageHistory()); + } + + [Test] + public void Can_save_and_load_order_with_orderNotes() + { + var order = this.GetTestOrder(); + order.OrderNotes.Add(this.GetTestOrderNote()); + order.Customer = this.GetTestCustomer(); + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + + fromDb.OrderNotes.ShouldNotBeNull(); + fromDb.OrderNotes.Count.ShouldEqual(1); + fromDb.OrderNotes.First().PropertiesShouldEqual(this.GetTestOrderNote()); + } + + [Test] + public void Can_save_and_load_order_with_orderItems() + { + var order = this.GetTestOrder(); + order.OrderItems.Add(this.GetTestOrderItem()); + order.Customer = this.GetTestCustomer(); + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + + fromDb.OrderItems.ShouldNotBeNull(); + fromDb.OrderItems.Count.ShouldEqual(1); + fromDb.OrderItems.First().PropertiesShouldEqual(this.GetTestOrderItem()); + } + + [Test] + public void Can_save_and_load_order_with_shipments() + { + var order = this.GetTestOrder(); + order.Shipments.Add(this.GetTestShipment()); + order.Shipments.First().Order = order; + order.Customer = this.GetTestCustomer(); + var fromDb = SaveAndLoadEntity(order); + fromDb.ShouldNotBeNull(); + + fromDb.Shipments.ShouldNotBeNull(); + fromDb.Shipments.Count.ShouldEqual(1); + fromDb.Shipments.First().PropertiesShouldEqual(this.GetTestShipment()); + } + } +} diff --git a/src/Tests/Nop.Services.Tests/Catalog/PriceCalculationServiceTests.cs b/src/Tests/Nop.Services.Tests/Catalog/PriceCalculationServiceTests.cs index 2cdde076c3a..17b7872bfd3 100644 --- a/src/Tests/Nop.Services.Tests/Catalog/PriceCalculationServiceTests.cs +++ b/src/Tests/Nop.Services.Tests/Catalog/PriceCalculationServiceTests.cs @@ -16,6 +16,7 @@ using Nop.Tests; using NUnit.Framework; using Rhino.Mocks; +using Nop.Services.Tax; namespace Nop.Services.Tests.Catalog { @@ -33,7 +34,7 @@ public class PriceCalculationServiceTests : ServiceTest private ShoppingCartSettings _shoppingCartSettings; private CatalogSettings _catalogSettings; private ICacheManager _cacheManager; - + private ITaxService _taxService; private Store _store; [SetUp] @@ -57,6 +58,7 @@ public class PriceCalculationServiceTests : ServiceTest _catalogSettings = new CatalogSettings(); _cacheManager = new NopNullCache(); + _taxService = MockRepository.GenerateMock(); _priceCalcService = new PriceCalculationService(_workContext, _storeContext, @@ -66,7 +68,8 @@ public class PriceCalculationServiceTests : ServiceTest _productAttributeParser, _productService, _cacheManager, - _shoppingCartSettings, + _shoppingCartSettings, + _taxService, _catalogSettings); var nopEngine = MockRepository.GenerateMock(); diff --git a/src/Tests/Nop.Services.Tests/ExportImport/ExportManagerTests.cs b/src/Tests/Nop.Services.Tests/ExportImport/ExportManagerTests.cs index 7b5ae5bf140..dab0d1f0d34 100644 --- a/src/Tests/Nop.Services.Tests/ExportImport/ExportManagerTests.cs +++ b/src/Tests/Nop.Services.Tests/ExportImport/ExportManagerTests.cs @@ -1,259 +1,266 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.ExportImport; -using Nop.Services.Media; -using Nop.Services.Messages; -using Nop.Services.Shipping.Date; -using Nop.Services.Stores; -using Nop.Services.Tax; -using Nop.Services.Vendors; -using NUnit.Framework; -using Rhino.Mocks; - -namespace Nop.Services.Tests.ExportImport -{ - [TestFixture] - public class ExportManagerTests : ServiceTest - { - private ICategoryService _categoryService; - private IManufacturerService _manufacturerService; - private ICustomerService _customerService; - private IProductAttributeService _productAttributeService; - private IPictureService _pictureService; - private INewsLetterSubscriptionService _newsLetterSubscriptionService; - private IExportManager _exportManager; - private IStoreService _storeService; - private ProductEditorSettings _productEditorSettings; - private IWorkContext _workContext; - private IVendorService _vendorService; - private IProductTemplateService _productTemplateService; - private IDateRangeService _dateRangeService; - private ITaxCategoryService _taxCategoryService; - private IMeasureService _measureService; - private CatalogSettings _catalogSettings; - private IGenericAttributeService _genericAttributeService; - private ICustomerAttributeFormatter _customerAttributeFormatter; - private OrderSettings _orderSettings; - - [SetUp] - public new void SetUp() - { - _storeService = MockRepository.GenerateMock(); - _categoryService = MockRepository.GenerateMock(); - _manufacturerService = MockRepository.GenerateMock(); - _customerService = MockRepository.GenerateMock(); - _productAttributeService = MockRepository.GenerateMock(); - _pictureService = MockRepository.GenerateMock(); - _newsLetterSubscriptionService = MockRepository.GenerateMock(); - _productEditorSettings = new ProductEditorSettings(); - _workContext = MockRepository.GenerateMock(); - _vendorService = MockRepository.GenerateMock(); - _productTemplateService = MockRepository.GenerateMock(); - _dateRangeService = MockRepository.GenerateMock(); - _taxCategoryService = MockRepository.GenerateMock(); - _measureService = MockRepository.GenerateMock(); - _catalogSettings=new CatalogSettings(); - _genericAttributeService = MockRepository.GenerateMock(); - _customerAttributeFormatter = MockRepository.GenerateMock(); - _orderSettings = new OrderSettings(); - - - _exportManager = new ExportManager(_categoryService, - _manufacturerService, _customerService, _productAttributeService, - _pictureService, _newsLetterSubscriptionService, - _storeService, _workContext, _productEditorSettings, - _vendorService, _productTemplateService, _dateRangeService, - _taxCategoryService, _measureService, _catalogSettings, - _genericAttributeService, _customerAttributeFormatter, _orderSettings); - } - - //[Test] - //public void Can_export_manufacturers_to_xml() - //{ - // var manufacturers = new List() - // { - // new Manufacturer() - // { - // Id = 1, - // Name = "Name", - // Description = "Description 1", - // MetaKeywords = "Meta keywords", - // MetaDescription = "Meta description", - // MetaTitle = "Meta title", - // PictureId = 0, - // PageSize = 4, - // PriceRanges = "1-3;", - // Published = true, - // Deleted = false, - // DisplayOrder = 5, - // CreatedOnUtc = new DateTime(2010, 01, 01), - // UpdatedOnUtc = new DateTime(2010, 01, 02), - // }, - // new Manufacturer() - // { - // Id = 2, - // Name = "Name 2", - // Description = "Description 2", - // MetaKeywords = "Meta keywords", - // MetaDescription = "Meta description", - // MetaTitle = "Meta title", - // PictureId = 0, - // PageSize = 4, - // PriceRanges = "1-3;", - // Published = true, - // Deleted = false, - // DisplayOrder = 5, - // CreatedOnUtc = new DateTime(2010, 01, 01), - // UpdatedOnUtc = new DateTime(2010, 01, 02), - // } - // }; - - // string result = _exportManager.ExportManufacturersToXml(manufacturers); - // //TODO test it - // String.IsNullOrEmpty(result).ShouldBeFalse(); - //} - - [Test] - public void Can_export_orders_xlsx() - { - var orders = new List - { - new Order - { - OrderGuid = Guid.NewGuid(), - Customer = GetTestCustomer(), - OrderStatus = OrderStatus.Complete, - ShippingStatus = ShippingStatus.Shipped, - PaymentStatus = PaymentStatus.Paid, - PaymentMethodSystemName = "PaymentMethodSystemName1", - CustomerCurrencyCode = "RUR", - CurrencyRate = 1.1M, - CustomerTaxDisplayType = TaxDisplayType.ExcludingTax, - VatNumber = "123456789", - OrderSubtotalInclTax = 2.1M, - OrderSubtotalExclTax = 3.1M, - OrderSubTotalDiscountInclTax = 4.1M, - OrderSubTotalDiscountExclTax = 5.1M, - OrderShippingInclTax = 6.1M, - OrderShippingExclTax = 7.1M, - PaymentMethodAdditionalFeeInclTax = 8.1M, - PaymentMethodAdditionalFeeExclTax = 9.1M, - TaxRates = "1,3,5,7", - OrderTax = 10.1M, - OrderDiscount = 11.1M, - OrderTotal = 12.1M, - RefundedAmount = 13.1M, - CheckoutAttributeDescription = "CheckoutAttributeDescription1", - CheckoutAttributesXml = "CheckoutAttributesXml1", - CustomerLanguageId = 14, - AffiliateId= 15, - CustomerIp="CustomerIp1", - AllowStoringCreditCardNumber= true, - CardType= "Visa", - CardName = "John Smith", - CardNumber = "4111111111111111", - MaskedCreditCardNumber= "************1111", - CardCvv2= "123", - CardExpirationMonth= "12", - CardExpirationYear = "2010", - AuthorizationTransactionId = "AuthorizationTransactionId1", - AuthorizationTransactionCode="AuthorizationTransactionCode1", - AuthorizationTransactionResult="AuthorizationTransactionResult1", - CaptureTransactionId= "CaptureTransactionId1", - CaptureTransactionResult = "CaptureTransactionResult1", - SubscriptionTransactionId = "SubscriptionTransactionId1", - PaidDateUtc= new DateTime(2010, 01, 01), - BillingAddress = GetTestBillingAddress(), - ShippingAddress = GetTestShippingAddress(), - ShippingMethod = "ShippingMethod1", - ShippingRateComputationMethodSystemName="ShippingRateComputationMethodSystemName1", - Deleted = false, - CreatedOnUtc = new DateTime(2010, 01, 04) - } - }; - string fileName = Path.GetTempFileName(); - //TODO uncomment - //_exportManager.ExportOrdersToXlsx(fileName, orders); - } - - protected Address GetTestBillingAddress() - { - return new Address - { - FirstName = "FirstName 1", - LastName = "LastName 1", - Email = "Email 1", - Company = "Company 1", - City = "City 1", - Address1 = "Address1a", - Address2 = "Address1a", - ZipPostalCode = "ZipPostalCode 1", - PhoneNumber = "PhoneNumber 1", - FaxNumber = "FaxNumber 1", - CreatedOnUtc = new DateTime(2010, 01, 01), - Country = GetTestCountry() - }; - } - - protected Address GetTestShippingAddress() - { - return new Address - { - FirstName = "FirstName 2", - LastName = "LastName 2", - Email = "Email 2", - Company = "Company 2", - City = "City 2", - Address1 = "Address2a", - Address2 = "Address2b", - ZipPostalCode = "ZipPostalCode 2", - PhoneNumber = "PhoneNumber 2", - FaxNumber = "FaxNumber 2", - CreatedOnUtc = new DateTime(2010, 01, 01), - Country = GetTestCountry() - }; - } - - protected Country GetTestCountry() - { - return new Country - { - Name = "United States", - AllowsBilling = true, - AllowsShipping = true, - TwoLetterIsoCode = "US", - ThreeLetterIsoCode = "USA", - NumericIsoCode = 1, - SubjectToVat = true, - Published = true, - DisplayOrder = 1 - }; - } - - protected Customer GetTestCustomer() - { - return new Customer - { - CustomerGuid = Guid.NewGuid(), - AdminComment = "some comment here", - Active = true, - Deleted = false, - CreatedOnUtc = new DateTime(2010, 01, 01) - }; - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.ExportImport; +using Nop.Services.Media; +using Nop.Services.Messages; +using Nop.Services.Shipping.Date; +using Nop.Services.Stores; +using Nop.Services.Tax; +using Nop.Services.Vendors; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Nop.Services.Tests.ExportImport +{ + [TestFixture] + public class ExportManagerTests : ServiceTest + { + private ICategoryService _categoryService; + private IManufacturerService _manufacturerService; + private ICustomerService _customerService; + private IProductAttributeService _productAttributeService; + private IPictureService _pictureService; + private INewsLetterSubscriptionService _newsLetterSubscriptionService; + private IExportManager _exportManager; + private IStoreService _storeService; + private ProductEditorSettings _productEditorSettings; + private IWorkContext _workContext; + private IVendorService _vendorService; + private IProductTemplateService _productTemplateService; + private IDateRangeService _dateRangeService; + private ITaxCategoryService _taxCategoryService; + private IMeasureService _measureService; + private CatalogSettings _catalogSettings; + private IGenericAttributeService _genericAttributeService; + private ICustomerAttributeFormatter _customerAttributeFormatter; + private OrderSettings _orderSettings; + + [SetUp] + public new void SetUp() + { + _storeService = MockRepository.GenerateMock(); + _categoryService = MockRepository.GenerateMock(); + _manufacturerService = MockRepository.GenerateMock(); + _customerService = MockRepository.GenerateMock(); + _productAttributeService = MockRepository.GenerateMock(); + _pictureService = MockRepository.GenerateMock(); + _newsLetterSubscriptionService = MockRepository.GenerateMock(); + _productEditorSettings = new ProductEditorSettings(); + _workContext = MockRepository.GenerateMock(); + _vendorService = MockRepository.GenerateMock(); + _productTemplateService = MockRepository.GenerateMock(); + _dateRangeService = MockRepository.GenerateMock(); + _taxCategoryService = MockRepository.GenerateMock(); + _measureService = MockRepository.GenerateMock(); + _catalogSettings=new CatalogSettings(); + _genericAttributeService = MockRepository.GenerateMock(); + _customerAttributeFormatter = MockRepository.GenerateMock(); + _orderSettings = new OrderSettings(); + + + _exportManager = new ExportManager(_categoryService, + _manufacturerService, _customerService, _productAttributeService, + _pictureService, _newsLetterSubscriptionService, + _storeService, _workContext, _productEditorSettings, + _vendorService, _productTemplateService, _dateRangeService, + _taxCategoryService, _measureService, _catalogSettings, + _genericAttributeService, _customerAttributeFormatter, _orderSettings); + } + + //[Test] + //public void Can_export_manufacturers_to_xml() + //{ + // var manufacturers = new List() + // { + // new Manufacturer() + // { + // Id = 1, + // Name = "Name", + // Description = "Description 1", + // MetaKeywords = "Meta keywords", + // MetaDescription = "Meta description", + // MetaTitle = "Meta title", + // PictureId = 0, + // PageSize = 4, + // PriceRanges = "1-3;", + // Published = true, + // Deleted = false, + // DisplayOrder = 5, + // CreatedOnUtc = new DateTime(2010, 01, 01), + // UpdatedOnUtc = new DateTime(2010, 01, 02), + // }, + // new Manufacturer() + // { + // Id = 2, + // Name = "Name 2", + // Description = "Description 2", + // MetaKeywords = "Meta keywords", + // MetaDescription = "Meta description", + // MetaTitle = "Meta title", + // PictureId = 0, + // PageSize = 4, + // PriceRanges = "1-3;", + // Published = true, + // Deleted = false, + // DisplayOrder = 5, + // CreatedOnUtc = new DateTime(2010, 01, 01), + // UpdatedOnUtc = new DateTime(2010, 01, 02), + // } + // }; + + // string result = _exportManager.ExportManufacturersToXml(manufacturers); + // //TODO test it + // String.IsNullOrEmpty(result).ShouldBeFalse(); + //} + + [Test] + public void Can_export_orders_xlsx() + { + var orders = new List + { + new Order + { + OrderGuid = Guid.NewGuid(), + Customer = GetTestCustomer(), + OrderStatus = OrderStatus.Complete, + ShippingStatus = ShippingStatus.Shipped, + PaymentStatus = PaymentStatus.Paid, + PaymentMethodSystemName = "PaymentMethodSystemName1", + CustomerCurrencyCode = "RUR", + CurrencyRate = 1.1M, + CustomerTaxDisplayType = TaxDisplayType.ExcludingTax, + VatNumber = "123456789", + OrderSubtotalInclTax = 2.1M, + OrderSubtotalExclTax = 3.1M, + OrderSubTotalDiscountInclTax = 4.1M, + OrderSubTotalDiscountExclTax = 5.1M, + OrderShippingInclTax = 6.1M, + OrderShippingExclTax = 7.1M, + OrderShippingNonTaxable = 7.1M, + PaymentMethodAdditionalFeeInclTax = 8.1M, + PaymentMethodAdditionalFeeExclTax = 9.1M, + PaymentMethodAdditionalFeeNonTaxable = 9.1M, + TaxRates = "1,3,5,7", + OrderTax = 10.1M, + OrderDiscount = 11.1M, + OrderDiscountIncl = 11.1M, + OrderTotal = 12.1M, + OrderAmount = 12.1M, + OrderAmountIncl = 13.1M, + EarnedRewardPointsBaseAmountExcl = 13.1M, + EarnedRewardPointsBaseAmountIncl = 13.1M, + RefundedAmount = 13.1M, + CheckoutAttributeDescription = "CheckoutAttributeDescription1", + CheckoutAttributesXml = "CheckoutAttributesXml1", + CustomerLanguageId = 14, + AffiliateId= 15, + CustomerIp="CustomerIp1", + AllowStoringCreditCardNumber= true, + CardType= "Visa", + CardName = "John Smith", + CardNumber = "4111111111111111", + MaskedCreditCardNumber= "************1111", + CardCvv2= "123", + CardExpirationMonth= "12", + CardExpirationYear = "2010", + AuthorizationTransactionId = "AuthorizationTransactionId1", + AuthorizationTransactionCode="AuthorizationTransactionCode1", + AuthorizationTransactionResult="AuthorizationTransactionResult1", + CaptureTransactionId= "CaptureTransactionId1", + CaptureTransactionResult = "CaptureTransactionResult1", + SubscriptionTransactionId = "SubscriptionTransactionId1", + PaidDateUtc= new DateTime(2010, 01, 01), + BillingAddress = GetTestBillingAddress(), + ShippingAddress = GetTestShippingAddress(), + ShippingMethod = "ShippingMethod1", + ShippingRateComputationMethodSystemName="ShippingRateComputationMethodSystemName1", + Deleted = false, + CreatedOnUtc = new DateTime(2010, 01, 04) + } + }; + string fileName = Path.GetTempFileName(); + //TODO uncomment + //_exportManager.ExportOrdersToXlsx(fileName, orders); + } + + protected Address GetTestBillingAddress() + { + return new Address + { + FirstName = "FirstName 1", + LastName = "LastName 1", + Email = "Email 1", + Company = "Company 1", + City = "City 1", + Address1 = "Address1a", + Address2 = "Address1a", + ZipPostalCode = "ZipPostalCode 1", + PhoneNumber = "PhoneNumber 1", + FaxNumber = "FaxNumber 1", + CreatedOnUtc = new DateTime(2010, 01, 01), + Country = GetTestCountry() + }; + } + + protected Address GetTestShippingAddress() + { + return new Address + { + FirstName = "FirstName 2", + LastName = "LastName 2", + Email = "Email 2", + Company = "Company 2", + City = "City 2", + Address1 = "Address2a", + Address2 = "Address2b", + ZipPostalCode = "ZipPostalCode 2", + PhoneNumber = "PhoneNumber 2", + FaxNumber = "FaxNumber 2", + CreatedOnUtc = new DateTime(2010, 01, 01), + Country = GetTestCountry() + }; + } + + protected Country GetTestCountry() + { + return new Country + { + Name = "United States", + AllowsBilling = true, + AllowsShipping = true, + TwoLetterIsoCode = "US", + ThreeLetterIsoCode = "USA", + NumericIsoCode = 1, + SubjectToVat = true, + Published = true, + DisplayOrder = 1 + }; + } + + protected Customer GetTestCustomer() + { + return new Customer + { + CustomerGuid = Guid.NewGuid(), + AdminComment = "some comment here", + Active = true, + Deleted = false, + CreatedOnUtc = new DateTime(2010, 01, 01) + }; + } + } +} diff --git a/src/Tests/Nop.Services.Tests/Orders/OrderProcessingServiceTests.cs b/src/Tests/Nop.Services.Tests/Orders/OrderProcessingServiceTests.cs index 1c6a646b54f..0baf6c96e3a 100644 --- a/src/Tests/Nop.Services.Tests/Orders/OrderProcessingServiceTests.cs +++ b/src/Tests/Nop.Services.Tests/Orders/OrderProcessingServiceTests.cs @@ -1,641 +1,646 @@ -using System; -using System.Collections.Generic; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Data; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Directory; -using Nop.Core.Domain.Localization; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Payments; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Stores; -using Nop.Core.Domain.Tax; -using Nop.Core.Plugins; -using Nop.Services.Affiliates; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Customers; -using Nop.Services.Directory; -using Nop.Services.Discounts; -using Nop.Services.Events; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Messages; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Security; -using Nop.Services.Shipping; -using Nop.Services.Tax; -using Nop.Services.Vendors; -using Nop.Tests; -using NUnit.Framework; -using Rhino.Mocks; - -namespace Nop.Services.Tests.Orders -{ - [TestFixture] - public class OrderProcessingServiceTests : ServiceTest - { - private IWorkContext _workContext; - private IStoreContext _storeContext; - private ITaxService _taxService; - private IShippingService _shippingService; - private IShipmentService _shipmentService; - private IPaymentService _paymentService; - private ICheckoutAttributeParser _checkoutAttributeParser; - private IDiscountService _discountService; - private IGiftCardService _giftCardService; - private IGenericAttributeService _genericAttributeService; - private TaxSettings _taxSettings; - private RewardPointsSettings _rewardPointsSettings; - private ICategoryService _categoryService; - private IManufacturerService _manufacturerService; - private IProductAttributeParser _productAttributeParser; - private IPriceCalculationService _priceCalcService; - private IOrderTotalCalculationService _orderTotalCalcService; - private IAddressService _addressService; - private ShippingSettings _shippingSettings; - private ILogger _logger; - private IRepository _shippingMethodRepository; - private IRepository _warehouseRepository; - private IOrderService _orderService; - private IWebHelper _webHelper; - private ILocalizationService _localizationService; - private ILanguageService _languageService; - private IProductService _productService; - private IPriceFormatter _priceFormatter; - private IProductAttributeFormatter _productAttributeFormatter; - private IShoppingCartService _shoppingCartService; - private ICheckoutAttributeFormatter _checkoutAttributeFormatter; - private ICustomerService _customerService; - private IEncryptionService _encryptionService; - private IWorkflowMessageService _workflowMessageService; - private ICustomerActivityService _customerActivityService; - private ICurrencyService _currencyService; - private PaymentSettings _paymentSettings; - private OrderSettings _orderSettings; - private LocalizationSettings _localizationSettings; - private ShoppingCartSettings _shoppingCartSettings; - private CatalogSettings _catalogSettings; - private IOrderProcessingService _orderProcessingService; - private IEventPublisher _eventPublisher; - private CurrencySettings _currencySettings; - private IAffiliateService _affiliateService; - private IVendorService _vendorService; - private IPdfService _pdfService; - private IRewardPointService _rewardPointService; - - private IGeoLookupService _geoLookupService; - private ICountryService _countryService; - private IStateProvinceService _stateProvinceService; - private CustomerSettings _customerSettings; - private AddressSettings _addressSettings; - private ICustomNumberFormatter _customNumberFormatter; - - private Store _store; - - [SetUp] - public new void SetUp() - { - _workContext = null; - - _store = new Store { Id = 1 }; - _storeContext = MockRepository.GenerateMock(); - _storeContext.Expect(x => x.CurrentStore).Return(_store); - - var pluginFinder = new PluginFinder(); - - _shoppingCartSettings = new ShoppingCartSettings(); - _catalogSettings = new CatalogSettings(); - - var cacheManager = new NopNullCache(); - - _productService = MockRepository.GenerateMock(); - - //price calculation service - _discountService = MockRepository.GenerateMock(); - _categoryService = MockRepository.GenerateMock(); - _manufacturerService = MockRepository.GenerateMock(); - - _productAttributeParser = MockRepository.GenerateMock(); - _priceCalcService = new PriceCalculationService(_workContext, _storeContext, - _discountService, _categoryService, _manufacturerService, - _productAttributeParser, _productService, - cacheManager, _shoppingCartSettings, _catalogSettings); - - _eventPublisher = MockRepository.GenerateMock(); - _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); - - _localizationService = MockRepository.GenerateMock(); - - //shipping - _shippingSettings = new ShippingSettings(); - _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List(); - _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); - _shippingMethodRepository = MockRepository.GenerateMock>(); - _warehouseRepository = MockRepository.GenerateMock>(); - _logger = new NullLogger(); - _shippingService = new ShippingService(_shippingMethodRepository, - _warehouseRepository, - _logger, - _productService, - _productAttributeParser, - _checkoutAttributeParser, - _genericAttributeService, - _localizationService, - _addressService, - _shippingSettings, - pluginFinder, - _storeContext, - _eventPublisher, - _shoppingCartSettings, - cacheManager); - _shipmentService = MockRepository.GenerateMock(); - - - _paymentService = MockRepository.GenerateMock(); - _checkoutAttributeParser = MockRepository.GenerateMock(); - _giftCardService = MockRepository.GenerateMock(); - _genericAttributeService = MockRepository.GenerateMock(); - - _geoLookupService = MockRepository.GenerateMock(); - _countryService = MockRepository.GenerateMock(); - _stateProvinceService = MockRepository.GenerateMock(); - _customerSettings = new CustomerSettings(); - _addressSettings = new AddressSettings(); - - //tax - _taxSettings = new TaxSettings(); - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - _taxSettings.DefaultTaxAddressId = 10; - _addressService = MockRepository.GenerateMock(); - _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); - _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, - pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, - _customerSettings, _shippingSettings, _addressSettings); - - _rewardPointService = MockRepository.GenerateMock(); - _rewardPointsSettings = new RewardPointsSettings(); - - _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, - _priceCalcService, _taxService, _shippingService, _paymentService, - _checkoutAttributeParser, _discountService, _giftCardService, - _genericAttributeService, _rewardPointService, - _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings); - - _orderService = MockRepository.GenerateMock(); - _webHelper = MockRepository.GenerateMock(); - _languageService = MockRepository.GenerateMock(); - _priceFormatter= MockRepository.GenerateMock(); - _productAttributeFormatter= MockRepository.GenerateMock(); - _shoppingCartService= MockRepository.GenerateMock(); - _checkoutAttributeFormatter= MockRepository.GenerateMock(); - _customerService= MockRepository.GenerateMock(); - _encryptionService = MockRepository.GenerateMock(); - _workflowMessageService = MockRepository.GenerateMock(); - _customerActivityService = MockRepository.GenerateMock(); - _currencyService = MockRepository.GenerateMock(); - _affiliateService = MockRepository.GenerateMock(); - _vendorService = MockRepository.GenerateMock(); - _pdfService = MockRepository.GenerateMock(); - _customNumberFormatter = MockRepository.GenerateMock(); - - _paymentSettings = new PaymentSettings - { - ActivePaymentMethodSystemNames = new List - { - "Payments.TestMethod" - } - }; - _orderSettings = new OrderSettings(); - - _localizationSettings = new LocalizationSettings(); - - _eventPublisher = MockRepository.GenerateMock(); - _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); - - _rewardPointService = MockRepository.GenerateMock(); - _currencySettings = new CurrencySettings(); - - _orderProcessingService = new OrderProcessingService(_orderService, _webHelper, - _localizationService, _languageService, - _productService, _paymentService, _logger, - _orderTotalCalcService, _priceCalcService, _priceFormatter, - _productAttributeParser, _productAttributeFormatter, - _giftCardService, _shoppingCartService, _checkoutAttributeFormatter, - _shippingService, _shipmentService, _taxService, - _customerService, _discountService, - _encryptionService, _workContext, - _workflowMessageService, _vendorService, - _customerActivityService, _currencyService, _affiliateService, - _eventPublisher,_pdfService, _rewardPointService, - _genericAttributeService, - _countryService, _stateProvinceService, - _shippingSettings, _paymentSettings, _rewardPointsSettings, - _orderSettings, _taxSettings, _localizationSettings, - _currencySettings, _customNumberFormatter); - } - - [Test] - public void Ensure_order_can_only_be_cancelled_when_orderStatus_is_not_cancelled_yet() - { - var order = new Order(); - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - if (os != OrderStatus.Cancelled) - _orderProcessingService.CanCancelOrder(order).ShouldBeTrue(); - else - _orderProcessingService.CanCancelOrder(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_marked_as_authorized_when_orderStatus_is_not_cancelled_and_paymentStatus_is_pending() - { - var order = new Order(); - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - if (os != OrderStatus.Cancelled && ps == PaymentStatus.Pending) - _orderProcessingService.CanMarkOrderAsAuthorized(order).ShouldBeTrue(); - else - _orderProcessingService.CanMarkOrderAsAuthorized(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_captured_when_orderStatus_is_not_cancelled_or_pending_and_paymentstatus_is_authorized_and_paymentModule_supports_capture() - { - _paymentService.Expect(ps => ps.SupportCapture("paymentMethodSystemName_that_supports_capture")).Return(true); - _paymentService.Expect(ps => ps.SupportCapture("paymentMethodSystemName_that_doesn't_support_capture")).Return(false); - var order = new Order(); - - - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_capture"; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if ((os != OrderStatus.Cancelled && os != OrderStatus.Pending) - && (ps == PaymentStatus.Authorized)) - _orderProcessingService.CanCapture(order).ShouldBeTrue(); - else - _orderProcessingService.CanCapture(order).ShouldBeFalse(); - } - - - order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_capture"; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanCapture(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_marked_as_paid_when_orderStatus_is_cancelled_or_paymentStatus_is_paid_or_refunded_or_voided() - { - var order = new Order(); - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - if (os == OrderStatus.Cancelled - || (ps == PaymentStatus.Paid || ps == PaymentStatus.Refunded || ps == PaymentStatus.Voided)) - _orderProcessingService.CanMarkOrderAsPaid(order).ShouldBeFalse(); - else - _orderProcessingService.CanMarkOrderAsPaid(order).ShouldBeTrue(); - } - } - - [Test] - public void Ensure_order_can_only_be_refunded_when_paymentstatus_is_paid_and_paymentModule_supports_refund() - { - _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_supports_refund")).Return(true); - _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_doesn't_support_refund")).Return(false); - var order = new Order(); - order.OrderTotal = 1; - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_refund"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Paid) - _orderProcessingService.CanRefund(order).ShouldBeTrue(); - else - _orderProcessingService.CanRefund(order).ShouldBeFalse(); - } - - - - order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_refund"; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanRefund(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_refunded_when_orderTotal_is_zero() - { - _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_supports_refund")).Return(true); - var order = new Order(); - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_refund"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanRefund(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_refunded_offline_when_paymentstatus_is_paid() - { - var order = new Order - { - OrderTotal = 1, - }; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Paid) - _orderProcessingService.CanRefundOffline(order).ShouldBeTrue(); - else - _orderProcessingService.CanRefundOffline(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_refunded_offline_when_orderTotal_is_zero() - { - var order = new Order(); - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanRefundOffline(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_voided_when_paymentstatus_is_authorized_and_paymentModule_supports_void() - { - _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Return(true); - _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_doesn't_support_void")).Return(false); - var order = new Order(); - order.OrderTotal = 1; - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Authorized) - _orderProcessingService.CanVoid(order).ShouldBeTrue(); - else - _orderProcessingService.CanVoid(order).ShouldBeFalse(); - } - - - - order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_void"; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanVoid(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_voided_when_orderTotal_is_zero() - { - _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Return(true); - var order = new Order(); - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanVoid(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_voided_offline_when_paymentstatus_is_authorized() - { - var order = new Order - { - OrderTotal = 1, - }; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Authorized) - _orderProcessingService.CanVoidOffline(order).ShouldBeTrue(); - else - _orderProcessingService.CanVoidOffline(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_voided_offline_when_orderTotal_is_zero() - { - var order = new Order(); - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanVoidOffline(order).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_partially_refunded_when_paymentstatus_is_paid_or_partiallyRefunded_and_paymentModule_supports_partialRefund() - { - _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_supports_partialrefund")).Return(true); - _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_doesn't_support_partialrefund")).Return(false); - var order = new Order(); - order.OrderTotal = 100; - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_partialrefund"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) - _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeTrue(); - else - _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeFalse(); - } - - - - order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_partialrefund"; - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_cannot_be_partially_refunded_when_amountToRefund_is_greater_than_amount_that_can_be_refunded() - { - _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_supports_partialrefund")).Return(true); - var order = new Order - { - OrderTotal = 100, - RefundedAmount = 30, //100-30=70 can be refunded - }; - order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_partialrefund"; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanPartiallyRefund(order, 80).ShouldBeFalse(); - } - } - - [Test] - public void Ensure_order_can_only_be_partially_refunded_offline_when_paymentstatus_is_paid_or_partiallyRefunded() - { - var order = new Order(); - order.OrderTotal = 100; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) - _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeTrue(); - else - _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeFalse(); - } - } - } - - [Test] - public void Ensure_order_cannot_be_partially_refunded_offline_when_amountToRefund_is_greater_than_amount_that_can_be_refunded() - { - var order = new Order - { - OrderTotal = 100, - RefundedAmount = 30, //100-30=70 can be refunded - }; - - foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) - foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) - foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) - { - order.OrderStatus = os; - order.PaymentStatus = ps; - order.ShippingStatus = ss; - - _orderProcessingService.CanPartiallyRefundOffline(order, 80).ShouldBeFalse(); - } - } - - //TODO write unit tests for the following methods: - //PlaceOrder - //CanCancelRecurringPayment, ProcessNextRecurringPayment, CancelRecurringPayment - } -} +using System; +using System.Collections.Generic; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Data; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Directory; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Payments; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Stores; +using Nop.Core.Domain.Tax; +using Nop.Core.Plugins; +using Nop.Services.Affiliates; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Customers; +using Nop.Services.Directory; +using Nop.Services.Discounts; +using Nop.Services.Events; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Messages; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Security; +using Nop.Services.Shipping; +using Nop.Services.Tax; +using Nop.Services.Vendors; +using Nop.Tests; +using NUnit.Framework; +using Rhino.Mocks; +using Nop.Services.Configuration; + +namespace Nop.Services.Tests.Orders +{ + [TestFixture] + public class OrderProcessingServiceTests : ServiceTest + { + private IWorkContext _workContext; + private IStoreContext _storeContext; + private ITaxService _taxService; + private IShippingService _shippingService; + private IShipmentService _shipmentService; + private IPaymentService _paymentService; + private ICheckoutAttributeParser _checkoutAttributeParser; + private IDiscountService _discountService; + private IGiftCardService _giftCardService; + private IGenericAttributeService _genericAttributeService; + private TaxSettings _taxSettings; + private RewardPointsSettings _rewardPointsSettings; + private ICategoryService _categoryService; + private IManufacturerService _manufacturerService; + private IProductAttributeParser _productAttributeParser; + private IPriceCalculationService _priceCalcService; + private IOrderTotalCalculationService _orderTotalCalcService; + private IAddressService _addressService; + private ShippingSettings _shippingSettings; + private ILogger _logger; + private IRepository _shippingMethodRepository; + private IRepository _warehouseRepository; + private IOrderService _orderService; + private IWebHelper _webHelper; + private ILocalizationService _localizationService; + private ILanguageService _languageService; + private IProductService _productService; + private IPriceFormatter _priceFormatter; + private IProductAttributeFormatter _productAttributeFormatter; + private IShoppingCartService _shoppingCartService; + private ICheckoutAttributeFormatter _checkoutAttributeFormatter; + private ICustomerService _customerService; + private IEncryptionService _encryptionService; + private IWorkflowMessageService _workflowMessageService; + private ICustomerActivityService _customerActivityService; + private ICurrencyService _currencyService; + private PaymentSettings _paymentSettings; + private OrderSettings _orderSettings; + private LocalizationSettings _localizationSettings; + private ShoppingCartSettings _shoppingCartSettings; + private CatalogSettings _catalogSettings; + private IOrderProcessingService _orderProcessingService; + private IEventPublisher _eventPublisher; + private CurrencySettings _currencySettings; + private IAffiliateService _affiliateService; + private IVendorService _vendorService; + private IPdfService _pdfService; + private IRewardPointService _rewardPointService; + + private IGeoLookupService _geoLookupService; + private ICountryService _countryService; + private IStateProvinceService _stateProvinceService; + private CustomerSettings _customerSettings; + private AddressSettings _addressSettings; + private ICustomNumberFormatter _customNumberFormatter; + + private ISettingService _settingService; + + private Store _store; + + [SetUp] + public new void SetUp() + { + _workContext = null; + + _store = new Store { Id = 1 }; + _storeContext = MockRepository.GenerateMock(); + _storeContext.Expect(x => x.CurrentStore).Return(_store); + + var pluginFinder = new PluginFinder(); + + _shoppingCartSettings = new ShoppingCartSettings(); + _catalogSettings = new CatalogSettings(); + + var cacheManager = new NopNullCache(); + + _productService = MockRepository.GenerateMock(); + + //price calculation service + _discountService = MockRepository.GenerateMock(); + _categoryService = MockRepository.GenerateMock(); + _manufacturerService = MockRepository.GenerateMock(); + + _productAttributeParser = MockRepository.GenerateMock(); + _priceCalcService = new PriceCalculationService(_workContext, _storeContext, + _discountService, _categoryService, _manufacturerService, + _productAttributeParser, _productService, + cacheManager, _shoppingCartSettings, _catalogSettings, _taxService); + + _eventPublisher = MockRepository.GenerateMock(); + _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); + + _localizationService = MockRepository.GenerateMock(); + + //shipping + _shippingSettings = new ShippingSettings(); + _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List(); + _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); + _shippingMethodRepository = MockRepository.GenerateMock>(); + _warehouseRepository = MockRepository.GenerateMock>(); + _logger = new NullLogger(); + _shippingService = new ShippingService(_shippingMethodRepository, + _warehouseRepository, + _logger, + _productService, + _productAttributeParser, + _checkoutAttributeParser, + _genericAttributeService, + _localizationService, + _addressService, + _shippingSettings, + pluginFinder, + _storeContext, + _eventPublisher, + _shoppingCartSettings, + cacheManager); + _shipmentService = MockRepository.GenerateMock(); + + + _paymentService = MockRepository.GenerateMock(); + _checkoutAttributeParser = MockRepository.GenerateMock(); + _giftCardService = MockRepository.GenerateMock(); + _genericAttributeService = MockRepository.GenerateMock(); + + _geoLookupService = MockRepository.GenerateMock(); + _countryService = MockRepository.GenerateMock(); + _stateProvinceService = MockRepository.GenerateMock(); + _customerSettings = new CustomerSettings(); + _addressSettings = new AddressSettings(); + + //tax + _taxSettings = new TaxSettings(); + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + _taxSettings.DefaultTaxAddressId = 10; + _addressService = MockRepository.GenerateMock(); + _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); + _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, + pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, + _customerSettings, _shippingSettings, _addressSettings, _productAttributeParser); + + _rewardPointService = MockRepository.GenerateMock(); + _rewardPointsSettings = new RewardPointsSettings(); + + _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, + _priceCalcService, _taxService, _shippingService, _paymentService, + _checkoutAttributeParser, _discountService, _giftCardService, + _genericAttributeService, _rewardPointService, + _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings, _productAttributeParser); + + _orderService = MockRepository.GenerateMock(); + _webHelper = MockRepository.GenerateMock(); + _languageService = MockRepository.GenerateMock(); + _priceFormatter= MockRepository.GenerateMock(); + _productAttributeFormatter= MockRepository.GenerateMock(); + _shoppingCartService= MockRepository.GenerateMock(); + _checkoutAttributeFormatter= MockRepository.GenerateMock(); + _customerService= MockRepository.GenerateMock(); + _encryptionService = MockRepository.GenerateMock(); + _workflowMessageService = MockRepository.GenerateMock(); + _customerActivityService = MockRepository.GenerateMock(); + _currencyService = MockRepository.GenerateMock(); + _affiliateService = MockRepository.GenerateMock(); + _vendorService = MockRepository.GenerateMock(); + _pdfService = MockRepository.GenerateMock(); + _customNumberFormatter = MockRepository.GenerateMock(); + + _paymentSettings = new PaymentSettings + { + ActivePaymentMethodSystemNames = new List + { + "Payments.TestMethod" + } + }; + _orderSettings = new OrderSettings(); + + _localizationSettings = new LocalizationSettings(); + + _eventPublisher = MockRepository.GenerateMock(); + _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); + + _rewardPointService = MockRepository.GenerateMock(); + _currencySettings = new CurrencySettings(); + _settingService = MockRepository.GenerateMock(); + + _orderProcessingService = new OrderProcessingService(_orderService, _webHelper, + _localizationService, _languageService, + _productService, _paymentService, _logger, + _orderTotalCalcService, _priceCalcService, _priceFormatter, + _productAttributeParser, _productAttributeFormatter, + _giftCardService, _shoppingCartService, _checkoutAttributeFormatter, + _shippingService, _shipmentService, _taxService, + _customerService, _discountService, + _encryptionService, _workContext, + _workflowMessageService, _vendorService, + _customerActivityService, _currencyService, _affiliateService, + _eventPublisher,_pdfService, _rewardPointService, + _genericAttributeService, + _countryService, _stateProvinceService, + _shippingSettings, _paymentSettings, _rewardPointsSettings, + _orderSettings, _taxSettings, _localizationSettings, + _currencySettings, + _settingService, _customNumberFormatter); + } + + [Test] + public void Ensure_order_can_only_be_cancelled_when_orderStatus_is_not_cancelled_yet() + { + var order = new Order(); + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + if (os != OrderStatus.Cancelled) + _orderProcessingService.CanCancelOrder(order).ShouldBeTrue(); + else + _orderProcessingService.CanCancelOrder(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_marked_as_authorized_when_orderStatus_is_not_cancelled_and_paymentStatus_is_pending() + { + var order = new Order(); + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + if (os != OrderStatus.Cancelled && ps == PaymentStatus.Pending) + _orderProcessingService.CanMarkOrderAsAuthorized(order).ShouldBeTrue(); + else + _orderProcessingService.CanMarkOrderAsAuthorized(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_captured_when_orderStatus_is_not_cancelled_or_pending_and_paymentstatus_is_authorized_and_paymentModule_supports_capture() + { + _paymentService.Expect(ps => ps.SupportCapture("paymentMethodSystemName_that_supports_capture")).Return(true); + _paymentService.Expect(ps => ps.SupportCapture("paymentMethodSystemName_that_doesn't_support_capture")).Return(false); + var order = new Order(); + + + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_capture"; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if ((os != OrderStatus.Cancelled && os != OrderStatus.Pending) + && (ps == PaymentStatus.Authorized)) + _orderProcessingService.CanCapture(order).ShouldBeTrue(); + else + _orderProcessingService.CanCapture(order).ShouldBeFalse(); + } + + + order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_capture"; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanCapture(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_marked_as_paid_when_orderStatus_is_cancelled_or_paymentStatus_is_paid_or_refunded_or_voided() + { + var order = new Order(); + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + if (os == OrderStatus.Cancelled + || (ps == PaymentStatus.Paid || ps == PaymentStatus.Refunded || ps == PaymentStatus.Voided)) + _orderProcessingService.CanMarkOrderAsPaid(order).ShouldBeFalse(); + else + _orderProcessingService.CanMarkOrderAsPaid(order).ShouldBeTrue(); + } + } + + [Test] + public void Ensure_order_can_only_be_refunded_when_paymentstatus_is_paid_and_paymentModule_supports_refund() + { + _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_supports_refund")).Return(true); + _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_doesn't_support_refund")).Return(false); + var order = new Order(); + order.OrderTotal = 1; + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_refund"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Paid) + _orderProcessingService.CanRefund(order).ShouldBeTrue(); + else + _orderProcessingService.CanRefund(order).ShouldBeFalse(); + } + + + + order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_refund"; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanRefund(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_refunded_when_orderTotal_is_zero() + { + _paymentService.Expect(ps => ps.SupportRefund("paymentMethodSystemName_that_supports_refund")).Return(true); + var order = new Order(); + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_refund"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanRefund(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_refunded_offline_when_paymentstatus_is_paid() + { + var order = new Order + { + OrderTotal = 1, + }; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Paid) + _orderProcessingService.CanRefundOffline(order).ShouldBeTrue(); + else + _orderProcessingService.CanRefundOffline(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_refunded_offline_when_orderTotal_is_zero() + { + var order = new Order(); + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanRefundOffline(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_voided_when_paymentstatus_is_authorized_and_paymentModule_supports_void() + { + _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Return(true); + _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_doesn't_support_void")).Return(false); + var order = new Order(); + order.OrderTotal = 1; + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Authorized) + _orderProcessingService.CanVoid(order).ShouldBeTrue(); + else + _orderProcessingService.CanVoid(order).ShouldBeFalse(); + } + + + + order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_void"; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanVoid(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_voided_when_orderTotal_is_zero() + { + _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Return(true); + var order = new Order(); + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanVoid(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_voided_offline_when_paymentstatus_is_authorized() + { + var order = new Order + { + OrderTotal = 1, + }; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Authorized) + _orderProcessingService.CanVoidOffline(order).ShouldBeTrue(); + else + _orderProcessingService.CanVoidOffline(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_voided_offline_when_orderTotal_is_zero() + { + var order = new Order(); + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanVoidOffline(order).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_partially_refunded_when_paymentstatus_is_paid_or_partiallyRefunded_and_paymentModule_supports_partialRefund() + { + _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_supports_partialrefund")).Return(true); + _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_doesn't_support_partialrefund")).Return(false); + var order = new Order(); + order.OrderTotal = 100; + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_partialrefund"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) + _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeTrue(); + else + _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeFalse(); + } + + + + order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_partialrefund"; + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanPartiallyRefund(order, 10).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_cannot_be_partially_refunded_when_amountToRefund_is_greater_than_amount_that_can_be_refunded() + { + _paymentService.Expect(ps => ps.SupportPartiallyRefund("paymentMethodSystemName_that_supports_partialrefund")).Return(true); + var order = new Order + { + OrderTotal = 100, + RefundedAmount = 30, //100-30=70 can be refunded + }; + order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_partialrefund"; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanPartiallyRefund(order, 80).ShouldBeFalse(); + } + } + + [Test] + public void Ensure_order_can_only_be_partially_refunded_offline_when_paymentstatus_is_paid_or_partiallyRefunded() + { + var order = new Order(); + order.OrderTotal = 100; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) + _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeTrue(); + else + _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeFalse(); + } + } + } + + [Test] + public void Ensure_order_cannot_be_partially_refunded_offline_when_amountToRefund_is_greater_than_amount_that_can_be_refunded() + { + var order = new Order + { + OrderTotal = 100, + RefundedAmount = 30, //100-30=70 can be refunded + }; + + foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus))) + foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus))) + foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus))) + { + order.OrderStatus = os; + order.PaymentStatus = ps; + order.ShippingStatus = ss; + + _orderProcessingService.CanPartiallyRefundOffline(order, 80).ShouldBeFalse(); + } + } + + //TODO write unit tests for the following methods: + //PlaceOrder + //CanCancelRecurringPayment, ProcessNextRecurringPayment, CancelRecurringPayment + } +} diff --git a/src/Tests/Nop.Services.Tests/Orders/OrderTotalCalculationServiceTests.cs b/src/Tests/Nop.Services.Tests/Orders/OrderTotalCalculationServiceTests.cs index 958e4417822..c3ae153868a 100644 --- a/src/Tests/Nop.Services.Tests/Orders/OrderTotalCalculationServiceTests.cs +++ b/src/Tests/Nop.Services.Tests/Orders/OrderTotalCalculationServiceTests.cs @@ -1,1391 +1,1423 @@ -using System.Collections.Generic; -using System.Linq; -using Nop.Core; -using Nop.Core.Caching; -using Nop.Core.Data; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Discounts; -using Nop.Core.Domain.Orders; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Stores; -using Nop.Core.Domain.Tax; -using Nop.Core.Plugins; -using Nop.Services.Catalog; -using Nop.Services.Common; -using Nop.Services.Directory; -using Nop.Services.Discounts; -using Nop.Services.Events; -using Nop.Services.Localization; -using Nop.Services.Logging; -using Nop.Services.Orders; -using Nop.Services.Payments; -using Nop.Services.Shipping; -using Nop.Services.Tax; -using Nop.Tests; -using NUnit.Framework; -using Rhino.Mocks; - -namespace Nop.Services.Tests.Orders -{ - [TestFixture] - public class OrderTotalCalculationServiceTests : ServiceTest - { - private IWorkContext _workContext; - private IStoreContext _storeContext; - private ITaxService _taxService; - private IShippingService _shippingService; - private IPaymentService _paymentService; - private ICheckoutAttributeParser _checkoutAttributeParser; - private IDiscountService _discountService; - private IGiftCardService _giftCardService; - private IGenericAttributeService _genericAttributeService; - private TaxSettings _taxSettings; - private RewardPointsSettings _rewardPointsSettings; - private ICategoryService _categoryService; - private IManufacturerService _manufacturerService; - private IProductAttributeParser _productAttributeParser; - private IPriceCalculationService _priceCalcService; - private IOrderTotalCalculationService _orderTotalCalcService; - private IAddressService _addressService; - private ShippingSettings _shippingSettings; - private ILocalizationService _localizationService; - private ILogger _logger; - private IRepository _shippingMethodRepository; - private IRepository _warehouseRepository; - private ShoppingCartSettings _shoppingCartSettings; - private CatalogSettings _catalogSettings; - private IEventPublisher _eventPublisher; - private Store _store; - private IProductService _productService; - private IGeoLookupService _geoLookupService; - private ICountryService _countryService; - private IStateProvinceService _stateProvinceService; - private CustomerSettings _customerSettings; - private AddressSettings _addressSettings; - private IRewardPointService _rewardPointService; - - [SetUp] - public new void SetUp() - { - _workContext = MockRepository.GenerateMock(); - - _store = new Store { Id = 1 }; - _storeContext = MockRepository.GenerateMock(); - _storeContext.Expect(x => x.CurrentStore).Return(_store); - - _productService = MockRepository.GenerateMock(); - - var pluginFinder = new PluginFinder(); - var cacheManager = new NopNullCache(); - - _discountService = MockRepository.GenerateMock(); - _categoryService = MockRepository.GenerateMock(); - _manufacturerService = MockRepository.GenerateMock(); - _productAttributeParser = MockRepository.GenerateMock(); - - _shoppingCartSettings = new ShoppingCartSettings(); - _catalogSettings = new CatalogSettings(); - - _priceCalcService = new PriceCalculationService(_workContext, _storeContext, - _discountService, _categoryService, - _manufacturerService, _productAttributeParser, - _productService, cacheManager, - _shoppingCartSettings, _catalogSettings); - - _eventPublisher = MockRepository.GenerateMock(); - _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); - - _localizationService = MockRepository.GenerateMock(); - - //shipping - _shippingSettings = new ShippingSettings(); - _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List(); - _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); - _shippingMethodRepository = MockRepository.GenerateMock>(); - _warehouseRepository = MockRepository.GenerateMock>(); - _logger = new NullLogger(); - _shippingService = new ShippingService(_shippingMethodRepository, - _warehouseRepository, - _logger, - _productService, - _productAttributeParser, - _checkoutAttributeParser, - _genericAttributeService, - _localizationService, - _addressService, - _shippingSettings, - pluginFinder, - _storeContext, - _eventPublisher, - _shoppingCartSettings, - cacheManager); - - - _paymentService = MockRepository.GenerateMock(); - _checkoutAttributeParser = MockRepository.GenerateMock(); - _giftCardService = MockRepository.GenerateMock(); - _genericAttributeService = MockRepository.GenerateMock(); - - _eventPublisher = MockRepository.GenerateMock(); - _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); - - _geoLookupService = MockRepository.GenerateMock(); - _countryService = MockRepository.GenerateMock(); - _stateProvinceService = MockRepository.GenerateMock(); - _customerSettings = new CustomerSettings(); - _addressSettings = new AddressSettings(); - - //tax - _taxSettings = new TaxSettings(); - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - _taxSettings.DefaultTaxAddressId = 10; - _addressService = MockRepository.GenerateMock(); - _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); - _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, - pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, - _customerSettings, _shippingSettings, _addressSettings); - _rewardPointService = MockRepository.GenerateMock(); - - _rewardPointsSettings = new RewardPointsSettings(); - - _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, - _priceCalcService, _taxService, _shippingService, _paymentService, - _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, - _rewardPointService, _taxSettings, _rewardPointsSettings, - _shippingSettings, _shoppingCartSettings, _catalogSettings); - } - - [Test] - public void Can_get_shopping_cart_subTotal_excluding_tax() - { - //customer - var customer = new Customer(); - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 12.34M, - CustomerEntersPrice = false, - Published = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 21.57M, - CustomerEntersPrice = false, - Published = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - decimal subTotalWithoutDiscount; - decimal subTotalWithDiscount; - SortedDictionary taxRates; - //10% - default tax rate - _orderTotalCalcService.GetShoppingCartSubTotal(cart, false, - out discountAmount, out appliedDiscounts, - out subTotalWithoutDiscount, out subTotalWithDiscount, out taxRates); - discountAmount.ShouldEqual(0); - appliedDiscounts.Count.ShouldEqual(0); - subTotalWithoutDiscount.ShouldEqual(89.39); - subTotalWithDiscount.ShouldEqual(89.39); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(8.939); - } - - [Test] - public void Can_get_shopping_cart_subTotal_including_tax() - { - //customer - var customer = new Customer(); - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 12.34M, - CustomerEntersPrice = false, - Published = true, - }; - var sci1 = new ShoppingCartItem - { - Product= product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 21.57M, - CustomerEntersPrice = false, - Published = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - decimal subTotalWithoutDiscount; - decimal subTotalWithDiscount; - SortedDictionary taxRates; - - _orderTotalCalcService.GetShoppingCartSubTotal(cart, true, - out discountAmount, out appliedDiscounts, - out subTotalWithoutDiscount, out subTotalWithDiscount, out taxRates); - discountAmount.ShouldEqual(0); - appliedDiscounts.Count.ShouldEqual(0); - subTotalWithoutDiscount.ShouldEqual(98.329); - subTotalWithDiscount.ShouldEqual(98.329); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(8.939); - } - - [Test] - public void Can_get_shopping_cart_subTotal_discount_excluding_tax() - { - //customer - var customer = new Customer(); - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 12.34M, - CustomerEntersPrice = false, - Published = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 21.57M, - CustomerEntersPrice = false, - Published = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - //discounts - var discount1 = new DiscountForCaching - { - Id = 1, - Name = "Discount 1", - DiscountType = DiscountType.AssignedToOrderSubTotal, - DiscountAmount = 3, - DiscountLimitation = DiscountLimitationType.Unlimited, - }; - _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal)).Return(new List { discount1 }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - decimal subTotalWithoutDiscount; - decimal subTotalWithDiscount; - SortedDictionary taxRates; - //10% - default tax rate - _orderTotalCalcService.GetShoppingCartSubTotal(cart, false, - out discountAmount, out appliedDiscounts, - out subTotalWithoutDiscount, out subTotalWithDiscount, out taxRates); - discountAmount.ShouldEqual(3); - appliedDiscounts.Count.ShouldEqual(1); - appliedDiscounts.First().Name.ShouldEqual("Discount 1"); - subTotalWithoutDiscount.ShouldEqual(89.39); - subTotalWithDiscount.ShouldEqual(86.39); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(8.639); - } - - [Test] - public void Can_get_shopping_cart_subTotal_discount_including_tax() - { - //customer - var customer = new Customer(); - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 12.34M, - CustomerEntersPrice = false, - Published = true, - }; - var sci1 = new ShoppingCartItem - { - Product= product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 21.57M, - CustomerEntersPrice = false, - Published = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - //discounts - var discount1 = new DiscountForCaching - { - Id = 1, - Name = "Discount 1", - DiscountType = DiscountType.AssignedToOrderSubTotal, - DiscountAmount = 3, - DiscountLimitation = DiscountLimitationType.Unlimited, - }; - _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal)).Return(new List { discount1 }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - decimal subTotalWithoutDiscount; - decimal subTotalWithDiscount; - SortedDictionary taxRates; - _orderTotalCalcService.GetShoppingCartSubTotal(cart, true, - out discountAmount, out appliedDiscounts, - out subTotalWithoutDiscount, out subTotalWithDiscount, out taxRates); - - //The comparison test failed before, because of a very tiny number difference. - //discountAmount.ShouldEqual(3.3); - (System.Math.Round(discountAmount, 10) == 3.3M).ShouldBeTrue(); - appliedDiscounts.Count.ShouldEqual(1); - appliedDiscounts.First().Name.ShouldEqual("Discount 1"); - subTotalWithoutDiscount.ShouldEqual(98.329); - subTotalWithDiscount.ShouldEqual(95.029); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(8.639); - } - - - - [Test] - public void Can_get_shoppingCartItem_additional_shippingCharge() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product= new Product - { - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - AdditionalShippingCharge = 5.5M, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 6.5M, - IsShipEnabled = true, - } - }; - - //sci3 is not shippable - var sci3 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 5, - Product = new Product - { - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 7.5M, - IsShipEnabled = false, - } - }; - - var cart = new List { sci1, sci2, sci3 }; - _orderTotalCalcService.GetShoppingCartAdditionalShippingCharge(cart).ShouldEqual(42.5M); - } - - [Test] - public void Shipping_should_be_free_when_all_shoppingCartItems_are_marked_as_freeShipping() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - IsFreeShipping = true, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - IsFreeShipping = true, - IsShipEnabled = true, - } - }; - var cart = new List { sci1, sci2 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(true); - } - - [Test] - public void Shipping_should_not_be_free_when_some_of_shoppingCartItems_are_not_marked_as_freeShipping() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - IsFreeShipping = true, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - IsFreeShipping = false, - IsShipEnabled = true, - } - }; - var cart = new List { sci1, sci2 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(false); - } - - [Test] - public void Shipping_should_be_free_when_customer_is_in_role_with_free_shipping() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - IsFreeShipping = false, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - IsFreeShipping = false, - IsShipEnabled = true, - } - }; - var cart = new List { sci1, sci2 }; - var customer = new Customer(); - var customerRole1 = new CustomerRole - { - Active = true, - FreeShipping = true, - }; - var customerRole2 = new CustomerRole - { - Active = true, - FreeShipping = false, - }; - customer.CustomerRoles.Add(customerRole1); - customer.CustomerRoles.Add(customerRole2); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(true); - } - - [Test] - public void Can_get_shipping_total_with_fixed_shipping_rate_excluding_tax() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Id = 1, - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - AdditionalShippingCharge = 5.5M, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Id = 2, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 6.5M, - IsShipEnabled = true, - } - }; - - //sci3 is not shippable - var sci3 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 5, - Product = new Product - { - Id = 3, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 7.5M, - IsShipEnabled = false, - } - }; - - var cart = new List { sci1, sci2, sci3 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - decimal taxRate; - List appliedDiscounts; - var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, false, out taxRate, out appliedDiscounts); - shipping.ShouldNotBeNull(); - //10 - default fixed shipping rate, 42.5 - additional shipping change - shipping.ShouldEqual(52.5); - appliedDiscounts.Count.ShouldEqual(0); - //10 - default fixed tax rate - taxRate.ShouldEqual(10); - } - - [Test] - public void Can_get_shipping_total_with_fixed_shipping_rate_including_tax() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Id = 1, - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - AdditionalShippingCharge = 5.5M, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Id = 2, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 6.5M, - IsShipEnabled = true, - } - }; - - //sci3 is not shippable - var sci3 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 5, - Product = new Product - { - Id = 3, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 7.5M, - IsShipEnabled = false, - } - }; - - var cart = new List { sci1, sci2, sci3 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - decimal taxRate; - List appliedDiscounts; - var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, true, out taxRate, out appliedDiscounts); - shipping.ShouldNotBeNull(); - //10 - default fixed shipping rate, 42.5 - additional shipping change - shipping.ShouldEqual(57.75); - appliedDiscounts.Count.ShouldEqual(0); - //10 - default fixed tax rate - taxRate.ShouldEqual(10); - } - - [Test] - public void Can_get_shipping_total_discount_excluding_tax() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Id = 1, - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - AdditionalShippingCharge = 5.5M, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Id = 2, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 6.5M, - IsShipEnabled = true, - } - }; - - //sci3 is not shippable - var sci3 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 5, - Product = new Product - { - Id = 3, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 7.5M, - IsShipEnabled = false, - } - }; - - var cart = new List { sci1, sci2, sci3 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - //discounts - var discount1 = new DiscountForCaching - { - Id = 1, - Name = "Discount 1", - DiscountType = DiscountType.AssignedToShipping, - DiscountAmount = 3, - DiscountLimitation = DiscountLimitationType.Unlimited, - }; - _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToShipping)).Return(new List { discount1 }); - - - decimal taxRate; - List appliedDiscounts; - var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, false, out taxRate, out appliedDiscounts); - appliedDiscounts.Count.ShouldEqual(1); - appliedDiscounts.First().Name.ShouldEqual("Discount 1"); - shipping.ShouldNotBeNull(); - //10 - default fixed shipping rate, 42.5 - additional shipping change, -3 - discount - shipping.ShouldEqual(49.5); - //10 - default fixed tax rate - taxRate.ShouldEqual(10); - } - - [Test] - public void Can_get_shipping_total_discount_including_tax() - { - var sci1 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 3, - Product = new Product - { - Id = 1, - Weight = 1.5M, - Height = 2.5M, - Length = 3.5M, - Width = 4.5M, - AdditionalShippingCharge = 5.5M, - IsShipEnabled = true, - } - }; - var sci2 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 4, - Product = new Product - { - Id = 2, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 6.5M, - IsShipEnabled = true, - } - }; - - //sci3 is not shippable - var sci3 = new ShoppingCartItem - { - AttributesXml = "", - Quantity = 5, - Product = new Product - { - Id = 3, - Weight = 11.5M, - Height = 12.5M, - Length = 13.5M, - Width = 14.5M, - AdditionalShippingCharge = 7.5M, - IsShipEnabled = false, - } - }; - - var cart = new List { sci1, sci2, sci3 }; - var customer = new Customer(); - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - //discounts - var discount1 = new DiscountForCaching - { - Id = 1, - Name = "Discount 1", - DiscountType = DiscountType.AssignedToShipping, - DiscountAmount = 3, - DiscountLimitation = DiscountLimitationType.Unlimited, - }; - _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToShipping)).Return(new List { discount1 }); - - - decimal taxRate; - List appliedDiscounts; - var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, true, out taxRate, out appliedDiscounts); - appliedDiscounts.Count.ShouldEqual(1); - appliedDiscounts.First().Name.ShouldEqual("Discount 1"); - shipping.ShouldNotBeNull(); - //10 - default fixed shipping rate, 42.5 - additional shipping change, -3 - discount - shipping.ShouldEqual(54.45); - //10 - default fixed tax rate - taxRate.ShouldEqual(10); - } - - [Test] - public void Can_get_tax_total() - { - //customer - var customer = new Customer - { - Id = 10, - }; - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 10M, - Published = true, - IsShipEnabled = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 12M, - Published = true, - IsShipEnabled = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - - - _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) - .Return(new List - { - new GenericAttribute - { - StoreId = _store.Id, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.SelectedPaymentMethod, - KeyGroup = "Customer", - Value = "test1" - } - }); - _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - //56 - items, 10 - shipping (fixed), 20 - payment fee - - //1. shipping is taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - SortedDictionary taxRates; - _orderTotalCalcService.GetTaxTotal(cart, out taxRates).ShouldEqual(8.6); - taxRates.ShouldNotBeNull(); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(8.6); - - //2. shipping is taxable, payment fee is not taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = false; - _orderTotalCalcService.GetTaxTotal(cart, out taxRates).ShouldEqual(6.6); - taxRates.ShouldNotBeNull(); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(6.6); - - //3. shipping is not taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = false; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - _orderTotalCalcService.GetTaxTotal(cart, out taxRates).ShouldEqual(7.6); - taxRates.ShouldNotBeNull(); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(7.6); - - //3. shipping is not taxable, payment fee is not taxable - _taxSettings.ShippingIsTaxable = false; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = false; - _orderTotalCalcService.GetTaxTotal(cart, out taxRates).ShouldEqual(5.6); - taxRates.ShouldNotBeNull(); - taxRates.Count.ShouldEqual(1); - taxRates.ContainsKey(10).ShouldBeTrue(); - taxRates[10].ShouldEqual(5.6); - } - - [Test] - public void Can_get_shopping_cart_total_without_shipping_required() - { - //customer - var customer = new Customer - { - Id = 10, - }; - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 10M, - Published = true, - IsShipEnabled = false, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 12M, - Published = true, - IsShipEnabled = false, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - - - _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) - .Return(new List - { - new GenericAttribute - { - StoreId = _store.Id, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.SelectedPaymentMethod, - KeyGroup = "Customer", - Value = "test1" - } - }); - _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); - - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - List appliedGiftCards; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - - - //shipping is taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - - //56 - items, 20 - payment fee, 7.6 - tax - _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, - out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount) - .ShouldEqual(83.6M); - } - - [Test] - public void Can_get_shopping_cart_total_with_shipping_required() - { - //customer - var customer = new Customer - { - Id = 10, - }; - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 10M, - Published = true, - IsShipEnabled = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 12M, - Published = true, - IsShipEnabled = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) - .Return(new List - { - new GenericAttribute - { - StoreId = _store.Id, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.SelectedPaymentMethod, - KeyGroup = "Customer", - Value = "test1" - } - }); - _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); - - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - List appliedDiscounts; - List appliedGiftCards; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - - - //shipping is taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - - //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax - _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, - out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount) - .ShouldEqual(94.6M); - } - - /*TODO temporary disabled - [Test] - public void Can_get_shopping_cart_total_with_applied_reward_points() - { - //customer - var customer = new Customer - { - Id = 10, - }; - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 10M, - Published = true, - IsShipEnabled = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 12M, - Published = true, - IsShipEnabled = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - - - _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) - .Return(new List - { - new GenericAttribute - { - StoreId = _store.Id, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.SelectedPaymentMethod, - KeyGroup = "Customer", - Value = "test1" - }, - new GenericAttribute - { - StoreId = 1, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, - KeyGroup = "Customer", - Value = true.ToString() - } - }); - _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); - - - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - decimal discountAmount; - Discount appliedDiscount; - List appliedGiftCards; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - - - //shipping is taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - - //reward points - _rewardPointsSettings.Enabled = true; - _rewardPointsSettings.ExchangeRate = 2; //1 reward point = 2 - - customer.AddRewardPointsHistoryEntry(15, 0); //15*2=30 - - //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax, -30 (reward points) - _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscount, - out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount) - .ShouldEqual(64.6M); - }*/ - - [Test] - public void Can_get_shopping_cart_total_discount() - { - //customer - var customer = new Customer - { - Id = 10, - }; - - //shopping cart - var product1 = new Product - { - Id = 1, - Name = "Product name 1", - Price = 10M, - Published = true, - IsShipEnabled = true, - }; - var sci1 = new ShoppingCartItem - { - Product = product1, - ProductId = product1.Id, - Quantity = 2, - }; - var product2 = new Product - { - Id = 2, - Name = "Product name 2", - Price = 12M, - Published = true, - IsShipEnabled = true, - }; - var sci2 = new ShoppingCartItem - { - Product = product2, - ProductId = product2.Id, - Quantity = 3 - }; - - var cart = new List { sci1, sci2 }; - cart.ForEach(sci => sci.Customer = customer); - cart.ForEach(sci => sci.CustomerId = customer.Id); - - //discounts - var discount1 = new DiscountForCaching - { - Id = 1, - Name = "Discount 1", - DiscountType = DiscountType.AssignedToOrderTotal, - DiscountAmount = 3, - DiscountLimitation = DiscountLimitationType.Unlimited, - }; - _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderTotal)).Return(new List { discount1 }); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); - _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); - - - _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) - .Return(new List - { - new GenericAttribute - { - StoreId = _store.Id, - EntityId = customer.Id, - Key = SystemCustomerAttributeNames.SelectedPaymentMethod, - KeyGroup = "Customer", - Value = "test1" - } - }); - _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); - - - decimal discountAmount; - List appliedDiscounts; - List appliedGiftCards; - int redeemedRewardPoints; - decimal redeemedRewardPointsAmount; - - //shipping is taxable, payment fee is taxable - _taxSettings.ShippingIsTaxable = true; - _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; - - //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax, [-3] - discount - _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, - out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount) - .ShouldEqual(91.6M); - discountAmount.ShouldEqual(3); - appliedDiscounts.Count.ShouldEqual(1); - appliedDiscounts.First().Name.ShouldEqual("Discount 1"); - } - - [Test] - public void Can_convert_reward_points_to_amount() - { - _rewardPointsSettings.Enabled = true; - _rewardPointsSettings.ExchangeRate = 15M; - - _orderTotalCalcService.ConvertRewardPointsToAmount(100).ShouldEqual(1500); - } - - [Test] - public void Can_convert_amount_to_reward_points() - { - _rewardPointsSettings.Enabled = true; - _rewardPointsSettings.ExchangeRate = 15M; - - //we calculate ceiling for reward points - _orderTotalCalcService.ConvertAmountToRewardPoints(100).ShouldEqual(7); - } - - [Test] - public void Can_check_minimum_reward_points_to_use_requirement() - { - _rewardPointsSettings.Enabled = true; - _rewardPointsSettings.MinimumRewardPointsToUse = 0; - - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(0).ShouldEqual(true); - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(1).ShouldEqual(true); - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(10).ShouldEqual(true); - - - _rewardPointsSettings.MinimumRewardPointsToUse = 2; - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(0).ShouldEqual(false); - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(1).ShouldEqual(false); - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(2).ShouldEqual(true); - _orderTotalCalcService.CheckMinimumRewardPointsToUseRequirement(10).ShouldEqual(true); - } - } -} +using System.Collections.Generic; +using System.Linq; +using Nop.Core; +using Nop.Core.Caching; +using Nop.Core.Data; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Orders; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Stores; +using Nop.Core.Domain.Tax; +using Nop.Core.Plugins; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Directory; +using Nop.Services.Discounts; +using Nop.Services.Events; +using Nop.Services.Localization; +using Nop.Services.Logging; +using Nop.Services.Orders; +using Nop.Services.Payments; +using Nop.Services.Shipping; +using Nop.Services.Tax; +using Nop.Tests; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Nop.Services.Tests.Orders +{ + [TestFixture] + public class OrderTotalCalculationServiceTests : ServiceTest + { + private IWorkContext _workContext; + private IStoreContext _storeContext; + private ITaxService _taxService; + private IShippingService _shippingService; + private IPaymentService _paymentService; + private ICheckoutAttributeParser _checkoutAttributeParser; + private IDiscountService _discountService; + private IGiftCardService _giftCardService; + private IGenericAttributeService _genericAttributeService; + private TaxSettings _taxSettings; + private RewardPointsSettings _rewardPointsSettings; + private ICategoryService _categoryService; + private IManufacturerService _manufacturerService; + private IProductAttributeParser _productAttributeParser; + private IPriceCalculationService _priceCalcService; + private IOrderTotalCalculationService _orderTotalCalcService; + private IAddressService _addressService; + private ShippingSettings _shippingSettings; + private ILocalizationService _localizationService; + private ILogger _logger; + private IRepository _shippingMethodRepository; + private IRepository _warehouseRepository; + private ShoppingCartSettings _shoppingCartSettings; + private CatalogSettings _catalogSettings; + private IEventPublisher _eventPublisher; + private Store _store; + private IProductService _productService; + private IGeoLookupService _geoLookupService; + private ICountryService _countryService; + private IStateProvinceService _stateProvinceService; + private CustomerSettings _customerSettings; + private AddressSettings _addressSettings; + private IRewardPointService _rewardPointService; + + [SetUp] + public new void SetUp() + { + _workContext = MockRepository.GenerateMock(); + + _store = new Store { Id = 1 }; + _storeContext = MockRepository.GenerateMock(); + _storeContext.Expect(x => x.CurrentStore).Return(_store); + + _productService = MockRepository.GenerateMock(); + + var pluginFinder = new PluginFinder(); + var cacheManager = new NopNullCache(); + + _discountService = MockRepository.GenerateMock(); + _categoryService = MockRepository.GenerateMock(); + _manufacturerService = MockRepository.GenerateMock(); + _productAttributeParser = MockRepository.GenerateMock(); + + _shoppingCartSettings = new ShoppingCartSettings(); + _catalogSettings = new CatalogSettings(); + + _priceCalcService = new PriceCalculationService(_workContext, _storeContext, + _discountService, _categoryService, + _manufacturerService, _productAttributeParser, + _productService, cacheManager, + _shoppingCartSettings, _catalogSettings, _taxService); + + _eventPublisher = MockRepository.GenerateMock(); + _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); + + _localizationService = MockRepository.GenerateMock(); + + //shipping + _shippingSettings = new ShippingSettings(); + _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List(); + _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); + _shippingMethodRepository = MockRepository.GenerateMock>(); + _warehouseRepository = MockRepository.GenerateMock>(); + _logger = new NullLogger(); + _shippingService = new ShippingService(_shippingMethodRepository, + _warehouseRepository, + _logger, + _productService, + _productAttributeParser, + _checkoutAttributeParser, + _genericAttributeService, + _localizationService, + _addressService, + _shippingSettings, + pluginFinder, + _storeContext, + _eventPublisher, + _shoppingCartSettings, + cacheManager); + + + _paymentService = MockRepository.GenerateMock(); + _checkoutAttributeParser = MockRepository.GenerateMock(); + _giftCardService = MockRepository.GenerateMock(); + _genericAttributeService = MockRepository.GenerateMock(); + + _eventPublisher = MockRepository.GenerateMock(); + _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); + + _geoLookupService = MockRepository.GenerateMock(); + _countryService = MockRepository.GenerateMock(); + _stateProvinceService = MockRepository.GenerateMock(); + _customerSettings = new CustomerSettings(); + _addressSettings = new AddressSettings(); + + //tax + _taxSettings = new TaxSettings(); + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + _taxSettings.DefaultTaxAddressId = 10; + _addressService = MockRepository.GenerateMock(); + _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); + _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, + pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, + _customerSettings, _shippingSettings, _addressSettings, _productAttributeParser); + _rewardPointService = MockRepository.GenerateMock(); + + _rewardPointsSettings = new RewardPointsSettings(); + + _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, + _priceCalcService, _taxService, _shippingService, _paymentService, + _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, + _rewardPointService, _taxSettings, _rewardPointsSettings, + _shippingSettings, _shoppingCartSettings, _catalogSettings, _productAttributeParser); + } + + [Test] + public void Can_get_shopping_cart_subTotal_excluding_tax() + { + //customer + var customer = new Customer(); + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 12.34M, + CustomerEntersPrice = false, + Published = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 21.57M, + CustomerEntersPrice = false, + Published = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + decimal subTotalWithoutDiscount; + decimal subTotalWithDiscount; + + TaxSummary taxSummary; //MF 22.11.16 + decimal earnedRewardPointsBaseAmount; + + //10% - default tax rate + _orderTotalCalcService.GetShoppingCartSubTotal(cart, false, + out discountAmount, out appliedDiscounts, + out subTotalWithoutDiscount, out subTotalWithDiscount, out taxSummary, + out earnedRewardPointsBaseAmount); + var taxRates = taxSummary.GenerateOldTaxrateDict(); //MF 22.11.16 + discountAmount.ShouldEqual(0); + appliedDiscounts.Count.ShouldEqual(0); + subTotalWithoutDiscount.ShouldEqual(89.39); + subTotalWithDiscount.ShouldEqual(89.39); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(8.939); + } + + [Test] + public void Can_get_shopping_cart_subTotal_including_tax() + { + //customer + var customer = new Customer(); + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 12.34M, + CustomerEntersPrice = false, + Published = true, + }; + var sci1 = new ShoppingCartItem + { + Product= product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 21.57M, + CustomerEntersPrice = false, + Published = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + decimal subTotalWithoutDiscount; + decimal subTotalWithDiscount; + + TaxSummary taxSummary; //MF 22.11.16 + decimal earnedRewardPointsBaseAmount; + + _orderTotalCalcService.GetShoppingCartSubTotal(cart, true, + out discountAmount, out appliedDiscounts, + out subTotalWithoutDiscount, out subTotalWithDiscount, out taxSummary, + out earnedRewardPointsBaseAmount); + var taxRates = taxSummary.GenerateOldTaxrateDict(); //MF 22.11.16 + + discountAmount.ShouldEqual(0); + appliedDiscounts.Count.ShouldEqual(0); + subTotalWithoutDiscount.ShouldEqual(98.329); + subTotalWithDiscount.ShouldEqual(98.329); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(8.939); + } + + [Test] + public void Can_get_shopping_cart_subTotal_discount_excluding_tax() + { + //customer + var customer = new Customer(); + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 12.34M, + CustomerEntersPrice = false, + Published = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 21.57M, + CustomerEntersPrice = false, + Published = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + //discounts + var discount1 = new DiscountForCaching + { + Id = 1, + Name = "Discount 1", + DiscountType = DiscountType.AssignedToOrderSubTotal, + DiscountAmount = 3, + DiscountLimitation = DiscountLimitationType.Unlimited, + }; + _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal)).Return(new List { discount1 }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + decimal subTotalWithoutDiscount; + decimal subTotalWithDiscount; + TaxSummary taxSummary; //MF 22.11.16 + decimal earnedRewardPointsBaseAmount; + + //10% - default tax rate + _orderTotalCalcService.GetShoppingCartSubTotal(cart, false, + out discountAmount, out appliedDiscounts, + out subTotalWithoutDiscount, out subTotalWithDiscount, out taxSummary, + out earnedRewardPointsBaseAmount); + var taxRates = taxSummary.GenerateOldTaxrateDict(); //MF 22.11.16 + discountAmount.ShouldEqual(3); + appliedDiscounts.Count.ShouldEqual(1); + appliedDiscounts.First().Name.ShouldEqual("Discount 1"); + subTotalWithoutDiscount.ShouldEqual(89.39); + subTotalWithDiscount.ShouldEqual(86.39); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(8.639); + } + + [Test] + public void Can_get_shopping_cart_subTotal_discount_including_tax() + { + //customer + var customer = new Customer(); + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 12.34M, + CustomerEntersPrice = false, + Published = true, + }; + var sci1 = new ShoppingCartItem + { + Product= product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 21.57M, + CustomerEntersPrice = false, + Published = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + //discounts + var discount1 = new DiscountForCaching + { + Id = 1, + Name = "Discount 1", + DiscountType = DiscountType.AssignedToOrderSubTotal, + DiscountAmount = 3, + DiscountLimitation = DiscountLimitationType.Unlimited, + }; + _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderSubTotal)).Return(new List { discount1 }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + decimal subTotalWithoutDiscount; + decimal subTotalWithDiscount; + TaxSummary taxSummary;//MF 22.11.16 + decimal earnedRewardPointsBaseAmount; + + _orderTotalCalcService.GetShoppingCartSubTotal(cart, true, + out discountAmount, out appliedDiscounts, + out subTotalWithoutDiscount, out subTotalWithDiscount, out taxSummary, + out earnedRewardPointsBaseAmount); + var taxRates = taxSummary.GenerateOldTaxrateDict(); //MF 22.11.16 + + //The comparison test failed before, because of a very tiny number difference. + //discountAmount.ShouldEqual(3.3); + (System.Math.Round(discountAmount, 10) == 3.3M).ShouldBeTrue(); + appliedDiscounts.Count.ShouldEqual(1); + appliedDiscounts.First().Name.ShouldEqual("Discount 1"); + subTotalWithoutDiscount.ShouldEqual(98.329); + subTotalWithDiscount.ShouldEqual(95.029); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(8.639); + } + + + + [Test] + public void Can_get_shoppingCartItem_additional_shippingCharge() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product= new Product + { + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + AdditionalShippingCharge = 5.5M, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 6.5M, + IsShipEnabled = true, + } + }; + + //sci3 is not shippable + var sci3 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 5, + Product = new Product + { + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 7.5M, + IsShipEnabled = false, + } + }; + + var cart = new List { sci1, sci2, sci3 }; + _orderTotalCalcService.GetShoppingCartAdditionalShippingCharge(cart).ShouldEqual(42.5M); + } + + [Test] + public void Shipping_should_be_free_when_all_shoppingCartItems_are_marked_as_freeShipping() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + IsFreeShipping = true, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + IsFreeShipping = true, + IsShipEnabled = true, + } + }; + var cart = new List { sci1, sci2 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(true); + } + + [Test] + public void Shipping_should_not_be_free_when_some_of_shoppingCartItems_are_not_marked_as_freeShipping() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + IsFreeShipping = true, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + IsFreeShipping = false, + IsShipEnabled = true, + } + }; + var cart = new List { sci1, sci2 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(false); + } + + [Test] + public void Shipping_should_be_free_when_customer_is_in_role_with_free_shipping() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + IsFreeShipping = false, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + IsFreeShipping = false, + IsShipEnabled = true, + } + }; + var cart = new List { sci1, sci2 }; + var customer = new Customer(); + var customerRole1 = new CustomerRole + { + Active = true, + FreeShipping = true, + }; + var customerRole2 = new CustomerRole + { + Active = true, + FreeShipping = false, + }; + customer.CustomerRoles.Add(customerRole1); + customer.CustomerRoles.Add(customerRole2); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _orderTotalCalcService.IsFreeShipping(cart).ShouldEqual(true); + } + + [Test] + public void Can_get_shipping_total_with_fixed_shipping_rate_excluding_tax() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Id = 1, + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + AdditionalShippingCharge = 5.5M, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Id = 2, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 6.5M, + IsShipEnabled = true, + } + }; + + //sci3 is not shippable + var sci3 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 5, + Product = new Product + { + Id = 3, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 7.5M, + IsShipEnabled = false, + } + }; + + var cart = new List { sci1, sci2, sci3 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + decimal taxRate; + List appliedDiscounts; + var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, false, out taxRate, out appliedDiscounts); + shipping.ShouldNotBeNull(); + //10 - default fixed shipping rate, 42.5 - additional shipping change + shipping.ShouldEqual(52.5); + appliedDiscounts.Count.ShouldEqual(0); + //10 - default fixed tax rate + taxRate.ShouldEqual(10); + } + + [Test] + public void Can_get_shipping_total_with_fixed_shipping_rate_including_tax() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Id = 1, + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + AdditionalShippingCharge = 5.5M, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Id = 2, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 6.5M, + IsShipEnabled = true, + } + }; + + //sci3 is not shippable + var sci3 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 5, + Product = new Product + { + Id = 3, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 7.5M, + IsShipEnabled = false, + } + }; + + var cart = new List { sci1, sci2, sci3 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + decimal taxRate; + List appliedDiscounts; + var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, true, out taxRate, out appliedDiscounts); + shipping.ShouldNotBeNull(); + //10 - default fixed shipping rate, 42.5 - additional shipping change + shipping.ShouldEqual(57.75); + appliedDiscounts.Count.ShouldEqual(0); + //10 - default fixed tax rate + taxRate.ShouldEqual(10); + } + + [Test] + public void Can_get_shipping_total_discount_excluding_tax() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Id = 1, + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + AdditionalShippingCharge = 5.5M, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Id = 2, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 6.5M, + IsShipEnabled = true, + } + }; + + //sci3 is not shippable + var sci3 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 5, + Product = new Product + { + Id = 3, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 7.5M, + IsShipEnabled = false, + } + }; + + var cart = new List { sci1, sci2, sci3 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + //discounts + var discount1 = new DiscountForCaching + { + Id = 1, + Name = "Discount 1", + DiscountType = DiscountType.AssignedToShipping, + DiscountAmount = 3, + DiscountLimitation = DiscountLimitationType.Unlimited, + }; + _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToShipping)).Return(new List { discount1 }); + + + decimal taxRate; + List appliedDiscounts; + var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, false, out taxRate, out appliedDiscounts); + appliedDiscounts.Count.ShouldEqual(1); + appliedDiscounts.First().Name.ShouldEqual("Discount 1"); + shipping.ShouldNotBeNull(); + //10 - default fixed shipping rate, 42.5 - additional shipping change, -3 - discount + shipping.ShouldEqual(49.5); + //10 - default fixed tax rate + taxRate.ShouldEqual(10); + } + + [Test] + public void Can_get_shipping_total_discount_including_tax() + { + var sci1 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 3, + Product = new Product + { + Id = 1, + Weight = 1.5M, + Height = 2.5M, + Length = 3.5M, + Width = 4.5M, + AdditionalShippingCharge = 5.5M, + IsShipEnabled = true, + } + }; + var sci2 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 4, + Product = new Product + { + Id = 2, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 6.5M, + IsShipEnabled = true, + } + }; + + //sci3 is not shippable + var sci3 = new ShoppingCartItem + { + AttributesXml = "", + Quantity = 5, + Product = new Product + { + Id = 3, + Weight = 11.5M, + Height = 12.5M, + Length = 13.5M, + Width = 14.5M, + AdditionalShippingCharge = 7.5M, + IsShipEnabled = false, + } + }; + + var cart = new List { sci1, sci2, sci3 }; + var customer = new Customer(); + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + //discounts + var discount1 = new DiscountForCaching + { + Id = 1, + Name = "Discount 1", + DiscountType = DiscountType.AssignedToShipping, + DiscountAmount = 3, + DiscountLimitation = DiscountLimitationType.Unlimited, + }; + _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToShipping)).Return(new List { discount1 }); + + + decimal taxRate; + List appliedDiscounts; + var shipping = _orderTotalCalcService.GetShoppingCartShippingTotal(cart, true, out taxRate, out appliedDiscounts); + appliedDiscounts.Count.ShouldEqual(1); + appliedDiscounts.First().Name.ShouldEqual("Discount 1"); + shipping.ShouldNotBeNull(); + //10 - default fixed shipping rate, 42.5 - additional shipping change, -3 - discount + shipping.ShouldEqual(54.45); + //10 - default fixed tax rate + taxRate.ShouldEqual(10); + } + + [Test] + public void Can_get_tax_total() + { + //customer + var customer = new Customer + { + Id = 10, + }; + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 10M, + Published = true, + IsShipEnabled = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 12M, + Published = true, + IsShipEnabled = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + + + _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) + .Return(new List + { + new GenericAttribute + { + StoreId = _store.Id, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.SelectedPaymentMethod, + KeyGroup = "Customer", + Value = "test1" + } + }); + _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + //56 - items, 10 - shipping (fixed), 20 - payment fee + + //1. shipping is taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + TaxSummary taxSummary; //22.11.16 + _orderTotalCalcService.GetTaxTotal(cart, out taxSummary).ShouldEqual(8.6); + var taxRates = taxSummary.GenerateOldTaxrateDict(); + taxRates.ShouldNotBeNull(); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(8.6); + + //2. shipping is taxable, payment fee is not taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = false; + _orderTotalCalcService.GetTaxTotal(cart, out taxSummary).ShouldEqual(6.6); + taxRates = taxSummary.GenerateOldTaxrateDict(); + taxRates.ShouldNotBeNull(); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(6.6); + + //3. shipping is not taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = false; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + _orderTotalCalcService.GetTaxTotal(cart, out taxSummary).ShouldEqual(7.6); + taxRates = taxSummary.GenerateOldTaxrateDict(); + taxRates.ShouldNotBeNull(); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(7.6); + + //3. shipping is not taxable, payment fee is not taxable + _taxSettings.ShippingIsTaxable = false; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = false; + _orderTotalCalcService.GetTaxTotal(cart, out taxSummary).ShouldEqual(5.6); + taxRates = taxSummary.GenerateOldTaxrateDict(); + taxRates.ShouldNotBeNull(); + taxRates.Count.ShouldEqual(1); + taxRates.ContainsKey(10).ShouldBeTrue(); + taxRates[10].ShouldEqual(5.6); + } + + [Test] + public void Can_get_shopping_cart_total_without_shipping_required() + { + //customer + var customer = new Customer + { + Id = 10, + }; + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 10M, + Published = true, + IsShipEnabled = false, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 12M, + Published = true, + IsShipEnabled = false, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + + + _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) + .Return(new List + { + new GenericAttribute + { + StoreId = _store.Id, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.SelectedPaymentMethod, + KeyGroup = "Customer", + Value = "test1" + } + }); + _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); + + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + List appliedGiftCards; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + TaxSummary taxSummary; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + RewardPoints redeemedRewardPoints; + decimal earnedRewardPointsBaseAmount; + + //shipping is taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + + //56 - items, 20 - payment fee, 7.6 - tax + _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, out subTotalAppliedDiscounts, + out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out taxSummary, out earnedRewardPointsBaseAmount, includingTax) + .ShouldEqual(83.6M); + } + + [Test] + public void Can_get_shopping_cart_total_with_shipping_required() + { + //customer + var customer = new Customer + { + Id = 10, + }; + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 10M, + Published = true, + IsShipEnabled = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 12M, + Published = true, + IsShipEnabled = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) + .Return(new List + { + new GenericAttribute + { + StoreId = _store.Id, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.SelectedPaymentMethod, + KeyGroup = "Customer", + Value = "test1" + } + }); + _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); + + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + List appliedDiscounts; + List appliedGiftCards; + RewardPoints redeemedRewardPoints; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + TaxSummary taxSummary; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + decimal earnedRewardPointsBaseAmount; + + //shipping is taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + + //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax + _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, out subTotalAppliedDiscounts, + out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out taxSummary, out earnedRewardPointsBaseAmount, includingTax) + .ShouldEqual(94.6M); + } + + /*TODO temporary disabled + [Test] + public void Can_get_shopping_cart_total_with_applied_reward_points() + { + //customer + var customer = new Customer + { + Id = 10, + }; + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 10M, + Published = true, + IsShipEnabled = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 12M, + Published = true, + IsShipEnabled = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + + + _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) + .Return(new List + { + new GenericAttribute + { + StoreId = _store.Id, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.SelectedPaymentMethod, + KeyGroup = "Customer", + Value = "test1" + }, + new GenericAttribute + { + StoreId = 1, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, + KeyGroup = "Customer", + Value = true.ToString() + } + }); + _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); + + + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + decimal discountAmount; + Discount appliedDiscount; + List appliedGiftCards; + int redeemedRewardPoints; + decimal redeemedRewardPointsAmount; + + + //shipping is taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + + //reward points + _rewardPointsSettings.Enabled = true; + _rewardPointsSettings.ExchangeRate = 2; //1 reward point = 2 + + customer.AddRewardPointsHistoryEntry(15, 0); //15*2=30 + + //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax, -30 (reward points) + _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscount, + out appliedGiftCards, out redeemedRewardPoints, out redeemedRewardPointsAmount) + .ShouldEqual(64.6M); + }*/ + + [Test] + public void Can_get_shopping_cart_total_discount() + { + //customer + var customer = new Customer + { + Id = 10, + }; + + //shopping cart + var product1 = new Product + { + Id = 1, + Name = "Product name 1", + Price = 10M, + Published = true, + IsShipEnabled = true, + }; + var sci1 = new ShoppingCartItem + { + Product = product1, + ProductId = product1.Id, + Quantity = 2, + }; + var product2 = new Product + { + Id = 2, + Name = "Product name 2", + Price = 12M, + Published = true, + IsShipEnabled = true, + }; + var sci2 = new ShoppingCartItem + { + Product = product2, + ProductId = product2.Id, + Quantity = 3 + }; + + var cart = new List { sci1, sci2 }; + cart.ForEach(sci => sci.Customer = customer); + cart.ForEach(sci => sci.CustomerId = customer.Id); + + //discounts + var discount1 = new DiscountForCaching + { + Id = 1, + Name = "Discount 1", + DiscountType = DiscountType.AssignedToOrderTotal, + DiscountAmount = 3, + DiscountLimitation = DiscountLimitationType.Unlimited, + }; + _discountService.Expect(ds => ds.ValidateDiscount(discount1, customer)).Return(new DiscountValidationResult() { IsValid = true }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToOrderTotal)).Return(new List { discount1 }); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToCategories)).Return(new List()); + _discountService.Expect(ds => ds.GetAllDiscountsForCaching(DiscountType.AssignedToManufacturers)).Return(new List()); + + + _genericAttributeService.Expect(x => x.GetAttributesForEntity(customer.Id, "Customer")) + .Return(new List + { + new GenericAttribute + { + StoreId = _store.Id, + EntityId = customer.Id, + Key = SystemCustomerAttributeNames.SelectedPaymentMethod, + KeyGroup = "Customer", + Value = "test1" + } + }); + _paymentService.Expect(ps => ps.GetAdditionalHandlingFee(cart, "test1")).Return(20); + + + decimal discountAmount; + List appliedDiscounts; + List appliedGiftCards; + RewardPoints redeemedRewardPoints; + List subTotalAppliedDiscounts; + List shippingAppliedDiscounts; + TaxSummary taxSummary; + bool includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; + decimal earnedRewardPointsBaseAmount; + + //shipping is taxable, payment fee is taxable + _taxSettings.ShippingIsTaxable = true; + _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; + + //56 - items, 10 - shipping (fixed), 20 - payment fee, 8.6 - tax, [-3] - discount + _orderTotalCalcService.GetShoppingCartTotal(cart, out discountAmount, out appliedDiscounts, out subTotalAppliedDiscounts, + out shippingAppliedDiscounts, out appliedGiftCards, out redeemedRewardPoints, out taxSummary, out earnedRewardPointsBaseAmount, includingTax) + .ShouldEqual(91.6M); + discountAmount.ShouldEqual(3); + appliedDiscounts.Count.ShouldEqual(1); + appliedDiscounts.First().Name.ShouldEqual("Discount 1"); + } + + [Test] + public void Can_convert_reward_points_to_amount() + { + _rewardPointsSettings.Enabled = true; + _rewardPointsSettings.ExchangeRate = 15M; + + _rewardPointService.ConvertRewardPointsToAmount(100).ShouldEqual(1500); + } + + [Test] + public void Can_convert_amount_to_reward_points() + { + _rewardPointsSettings.Enabled = true; + _rewardPointsSettings.ExchangeRate = 15M; + + //we calculate ceiling for reward points + _rewardPointService.ConvertAmountToRewardPoints(100).ShouldEqual(7); + } + + [Test] + public void Can_check_minimum_reward_points_to_use_requirement() + { + _rewardPointsSettings.Enabled = true; + _rewardPointsSettings.MinimumRewardPointsToUse = 0; + + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(0).ShouldEqual(true); + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(1).ShouldEqual(true); + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(10).ShouldEqual(true); + + + _rewardPointsSettings.MinimumRewardPointsToUse = 2; + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(0).ShouldEqual(false); + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(1).ShouldEqual(false); + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(2).ShouldEqual(true); + _rewardPointService.CheckMinimumRewardPointsToUseRequirement(10).ShouldEqual(true); + } + } +} diff --git a/src/Tests/Nop.Services.Tests/Tax/TaxServiceTests.cs b/src/Tests/Nop.Services.Tests/Tax/TaxServiceTests.cs index 1a2ba3ce312..ddcdaa0ce49 100644 --- a/src/Tests/Nop.Services.Tests/Tax/TaxServiceTests.cs +++ b/src/Tests/Nop.Services.Tests/Tax/TaxServiceTests.cs @@ -1,198 +1,204 @@ -using System; -using System.Linq; -using Nop.Core; -using Nop.Core.Domain.Catalog; -using Nop.Core.Domain.Common; -using Nop.Core.Domain.Customers; -using Nop.Core.Domain.Shipping; -using Nop.Core.Domain.Tax; -using Nop.Core.Plugins; -using Nop.Services.Common; -using Nop.Services.Directory; -using Nop.Services.Events; -using Nop.Services.Logging; -using Nop.Services.Tax; -using Nop.Tests; -using NUnit.Framework; -using Rhino.Mocks; - -namespace Nop.Services.Tests.Tax -{ - [TestFixture] - public class TaxServiceTests : ServiceTest - { - private IAddressService _addressService; - private IWorkContext _workContext; - private IStoreContext _storeContext; - private TaxSettings _taxSettings; - private IEventPublisher _eventPublisher; - private ITaxService _taxService; - private IGeoLookupService _geoLookupService; - private ICountryService _countryService; - private IStateProvinceService _stateProvinceService; - private ILogger _logger; - private CustomerSettings _customerSettings; - private ShippingSettings _shippingSettings; - private AddressSettings _addressSettings; - - [SetUp] - public new void SetUp() - { - _taxSettings = new TaxSettings(); - _taxSettings.DefaultTaxAddressId = 10; - - _workContext = null; - _storeContext = null; - - _addressService = MockRepository.GenerateMock(); - //default tax address - _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); - - var pluginFinder = new PluginFinder(); - - _eventPublisher = MockRepository.GenerateMock(); - _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); - - _geoLookupService = MockRepository.GenerateMock(); - _countryService = MockRepository.GenerateMock(); - _stateProvinceService = MockRepository.GenerateMock(); - _logger = MockRepository.GenerateMock(); - _customerSettings = new CustomerSettings(); - _shippingSettings = new ShippingSettings(); - _addressSettings = new AddressSettings(); - - _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, - pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, - _customerSettings, _shippingSettings, _addressSettings); - } - - [Test] - public void Can_load_taxProviders() - { - var providers = _taxService.LoadAllTaxProviders(); - providers.ShouldNotBeNull(); - (providers.Any()).ShouldBeTrue(); - } - - [Test] - public void Can_load_taxProvider_by_systemKeyword() - { - var provider = _taxService.LoadTaxProviderBySystemName("FixedTaxRateTest"); - provider.ShouldNotBeNull(); - } - - [Test] - public void Can_load_active_taxProvider() - { - var provider = _taxService.LoadActiveTaxProvider(); - provider.ShouldNotBeNull(); - } - - [Test] - public void Can_check_taxExempt_product() - { - var product = new Product(); - product.IsTaxExempt = true; - _taxService.IsTaxExempt(product, null).ShouldEqual(true); - product.IsTaxExempt = false; - _taxService.IsTaxExempt(product, null).ShouldEqual(false); - } - - [Test] - public void Can_check_taxExempt_customer() - { - var customer = new Customer(); - customer.IsTaxExempt = true; - _taxService.IsTaxExempt(null, customer).ShouldEqual(true); - customer.IsTaxExempt = false; - _taxService.IsTaxExempt(null, customer).ShouldEqual(false); - } - - [Test] - public void Can_check_taxExempt_customer_in_taxExemptCustomerRole() - { - var customer = new Customer(); - customer.IsTaxExempt = false; - _taxService.IsTaxExempt(null, customer).ShouldEqual(false); - - var customerRole = new CustomerRole - { - TaxExempt = true, - Active = true - }; - customer.CustomerRoles.Add(customerRole); - _taxService.IsTaxExempt(null, customer).ShouldEqual(true); - customerRole.TaxExempt = false; - _taxService.IsTaxExempt(null, customer).ShouldEqual(false); - - //if role is not active, weshould ignore 'TaxExempt' property - customerRole.Active = false; - _taxService.IsTaxExempt(null, customer).ShouldEqual(false); - } - - protected decimal GetFixedTestTaxRate() - { - //10 is a fixed tax rate returned from FixedRateTestTaxProvider. Perhaps, it should be configured some other way - return 10; - } - - [Test] - public void Can_get_productPrice_priceIncludesTax_includingTax_taxable() - { - var customer = new Customer(); - var product = new Product(); - - decimal taxRate; - _taxService.GetProductPrice(product, 0, 1000M, true, customer, true, out taxRate).ShouldEqual(1000); - _taxService.GetProductPrice(product, 0, 1000M, true, customer, false, out taxRate).ShouldEqual(1100); - _taxService.GetProductPrice(product, 0, 1000M, false, customer, true, out taxRate).ShouldEqual(909.0909090909090909090909091M); - _taxService.GetProductPrice(product, 0, 1000M, false, customer, false, out taxRate).ShouldEqual(1000); - } - - [Test] - public void Can_get_productPrice_priceIncludesTax_includingTax_non_taxable() - { - var customer = new Customer(); - var product = new Product(); - - //not taxable - customer.IsTaxExempt = true; - - decimal taxRate; - _taxService.GetProductPrice(product, 0, 1000M, true, customer, true, out taxRate).ShouldEqual(909.0909090909090909090909091M); - _taxService.GetProductPrice(product, 0, 1000M, true, customer, false, out taxRate).ShouldEqual(1000); - _taxService.GetProductPrice(product, 0, 1000M, false, customer, true, out taxRate).ShouldEqual(909.0909090909090909090909091M); - _taxService.GetProductPrice(product, 0, 1000M, false, customer, false, out taxRate).ShouldEqual(1000); - } - - [Test] - public void Can_do_VAT_check() - { - //remove? this method requires Internet access - - string name, address; - Exception exception; - - VatNumberStatus vatNumberStatus1 = _taxService.DoVatCheck("GB", "523 2392 69", - out name, out address, out exception); - vatNumberStatus1.ShouldEqual(VatNumberStatus.Valid); - exception.ShouldBeNull(); - - VatNumberStatus vatNumberStatus2 = _taxService.DoVatCheck("GB", "000 0000 00", - out name, out address, out exception); - vatNumberStatus2.ShouldEqual(VatNumberStatus.Invalid); - exception.ShouldBeNull(); - } - - [Test] - public void Should_assume_valid_VAT_number_if_EuVatAssumeValid_setting_is_true() - { - _taxSettings.EuVatAssumeValid = true; - string name, address; - - VatNumberStatus vatNumberStatus = _taxService.GetVatNumberStatus("GB", "000 0000 00", - out name, out address); - vatNumberStatus.ShouldEqual(VatNumberStatus.Valid); - } - } -} +using System; +using System.Linq; +using Nop.Core; +using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Customers; +using Nop.Core.Domain.Shipping; +using Nop.Core.Domain.Tax; +using Nop.Core.Plugins; +using Nop.Services.Catalog; +using Nop.Services.Common; +using Nop.Services.Directory; +using Nop.Services.Events; +using Nop.Services.Logging; +using Nop.Services.Tax; +using Nop.Tests; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Nop.Services.Tests.Tax +{ + [TestFixture] + public class TaxServiceTests : ServiceTest + { + private IAddressService _addressService; + private IWorkContext _workContext; + private IStoreContext _storeContext; + private TaxSettings _taxSettings; + private IEventPublisher _eventPublisher; + private ITaxService _taxService; + private IGeoLookupService _geoLookupService; + private ICountryService _countryService; + private IStateProvinceService _stateProvinceService; + private ILogger _logger; + private CustomerSettings _customerSettings; + private ShippingSettings _shippingSettings; + private AddressSettings _addressSettings; + private IProductAttributeParser _productAttributeParser; + + [SetUp] + public new void SetUp() + { + _taxSettings = new TaxSettings(); + _taxSettings.DefaultTaxAddressId = 10; + + _workContext = null; + _storeContext = null; + + _addressService = MockRepository.GenerateMock(); + //default tax address + _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); + + var pluginFinder = new PluginFinder(); + + _eventPublisher = MockRepository.GenerateMock(); + _eventPublisher.Expect(x => x.Publish(Arg.Is.Anything)); + + _geoLookupService = MockRepository.GenerateMock(); + _countryService = MockRepository.GenerateMock(); + _stateProvinceService = MockRepository.GenerateMock(); + _logger = MockRepository.GenerateMock(); + _customerSettings = new CustomerSettings(); + _shippingSettings = new ShippingSettings(); + _addressSettings = new AddressSettings(); + _productAttributeParser = MockRepository.GenerateMock(); + + + _taxService = new TaxService(_addressService, _workContext, _storeContext, _taxSettings, + pluginFinder, _geoLookupService, _countryService, _stateProvinceService, _logger, + _customerSettings, _shippingSettings, _addressSettings, _productAttributeParser); + } + + [Test] + public void Can_load_taxProviders() + { + var providers = _taxService.LoadAllTaxProviders(); + providers.ShouldNotBeNull(); + (providers.Any()).ShouldBeTrue(); + } + + [Test] + public void Can_load_taxProvider_by_systemKeyword() + { + var provider = _taxService.LoadTaxProviderBySystemName("FixedTaxRateTest"); + provider.ShouldNotBeNull(); + } + + [Test] + public void Can_load_active_taxProvider() + { + var provider = _taxService.LoadActiveTaxProvider(); + provider.ShouldNotBeNull(); + } + + [Test] + public void Can_check_taxExempt_product() + { + var product = new Product(); + product.IsTaxExempt = true; + _taxService.IsTaxExempt(product, null).ShouldEqual(true); + product.IsTaxExempt = false; + _taxService.IsTaxExempt(product, null).ShouldEqual(false); + } + + [Test] + public void Can_check_taxExempt_customer() + { + var customer = new Customer(); + customer.IsTaxExempt = true; + _taxService.IsTaxExempt(null, customer).ShouldEqual(true); + customer.IsTaxExempt = false; + _taxService.IsTaxExempt(null, customer).ShouldEqual(false); + } + + [Test] + public void Can_check_taxExempt_customer_in_taxExemptCustomerRole() + { + var customer = new Customer(); + customer.IsTaxExempt = false; + _taxService.IsTaxExempt(null, customer).ShouldEqual(false); + + var customerRole = new CustomerRole + { + TaxExempt = true, + Active = true + }; + customer.CustomerRoles.Add(customerRole); + _taxService.IsTaxExempt(null, customer).ShouldEqual(true); + customerRole.TaxExempt = false; + _taxService.IsTaxExempt(null, customer).ShouldEqual(false); + + //if role is not active, weshould ignore 'TaxExempt' property + customerRole.Active = false; + _taxService.IsTaxExempt(null, customer).ShouldEqual(false); + } + + protected decimal GetFixedTestTaxRate() + { + //10 is a fixed tax rate returned from FixedRateTestTaxProvider. Perhaps, it should be configured some other way + return 10; + } + + [Test] + public void Can_get_productPrice_priceIncludesTax_includingTax_taxable() + { + var customer = new Customer(); + var product = new Product(); + + decimal taxRate; + string attributesXml = ""; + _taxService.GetProductPrice(product, 0, 1000M, true, customer, true, out taxRate, ref attributesXml).ShouldEqual(1000); + _taxService.GetProductPrice(product, 0, 1000M, true, customer, false, out taxRate, ref attributesXml).ShouldEqual(1100); + _taxService.GetProductPrice(product, 0, 1000M, false, customer, true, out taxRate, ref attributesXml).ShouldEqual(909.0909090909090909090909091M); + _taxService.GetProductPrice(product, 0, 1000M, false, customer, false, out taxRate, ref attributesXml).ShouldEqual(1000); + } + + [Test] + public void Can_get_productPrice_priceIncludesTax_includingTax_non_taxable() + { + var customer = new Customer(); + var product = new Product(); + + //not taxable + customer.IsTaxExempt = true; + + decimal taxRate; + string attributesXml = ""; + _taxService.GetProductPrice(product, 0, 1000M, true, customer, true, out taxRate, ref attributesXml).ShouldEqual(909.0909090909090909090909091M); + _taxService.GetProductPrice(product, 0, 1000M, true, customer, false, out taxRate, ref attributesXml).ShouldEqual(1000); + _taxService.GetProductPrice(product, 0, 1000M, false, customer, true, out taxRate, ref attributesXml).ShouldEqual(909.0909090909090909090909091M); + _taxService.GetProductPrice(product, 0, 1000M, false, customer, false, out taxRate, ref attributesXml).ShouldEqual(1000); + } + + [Test] + public void Can_do_VAT_check() + { + //remove? this method requires Internet access + + string name, address; + Exception exception; + + VatNumberStatus vatNumberStatus1 = _taxService.DoVatCheck("GB", "523 2392 69", + out name, out address, out exception); + vatNumberStatus1.ShouldEqual(VatNumberStatus.Valid); + exception.ShouldBeNull(); + + VatNumberStatus vatNumberStatus2 = _taxService.DoVatCheck("GB", "000 0000 00", + out name, out address, out exception); + vatNumberStatus2.ShouldEqual(VatNumberStatus.Invalid); + exception.ShouldBeNull(); + } + + [Test] + public void Should_assume_valid_VAT_number_if_EuVatAssumeValid_setting_is_true() + { + _taxSettings.EuVatAssumeValid = true; + string name, address; + + VatNumberStatus vatNumberStatus = _taxService.GetVatNumberStatus("GB", "000 0000 00", + out name, out address); + vatNumberStatus.ShouldEqual(VatNumberStatus.Valid); + } + } +} diff --git a/src/packages/System.Net.Http.4.3.1/a b/src/packages/System.Net.Http.4.3.1/a new file mode 100644 index 00000000000..92b6c443d35 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/a @@ -0,0 +1,128 @@ + +MICROSOFT SOFTWARE LICENSE TERMS + + +MICROSOFT .NET LIBRARY + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft + +· updates, + +· supplements, + +· Internet-based services, and + +· support services + +for this software, unless other terms accompany those items. If so, those terms apply. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW. + +1. INSTALLATION AND USE RIGHTS. + +a. Installation and Use. You may install and use any number of copies of the software to design, develop and test your programs. + +b. Third Party Programs. The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only. + +2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS. + +a. DISTRIBUTABLE CODE. The software is comprised of Distributable Code. “Distributable Code” is code that you are permitted to distribute in programs you develop if you comply with the terms below. + +i. Right to Use and Distribute. + +· You may copy and distribute the object code form of the software. + +· Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs. + +ii. Distribution Requirements. For any Distributable Code you distribute, you must + +· add significant primary functionality to it in your programs; + +· require distributors and external end users to agree to terms that protect it at least as much as this agreement; + +· display your valid copyright notice on your programs; and + +· indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs. + +iii. Distribution Restrictions. You may not + +· alter any copyright, trademark or patent notice in the Distributable Code; + +· use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft; + +· include Distributable Code in malicious, deceptive or unlawful programs; or + +· modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that + +· the code be disclosed or distributed in source code form; or + +· others have the right to modify it. + +3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not + +· work around any technical limitations in the software; + +· reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation; + +· publish the software for others to copy; + +· rent, lease or lend the software; + +· transfer the software or this agreement to any third party; or + +· use the software for commercial software hosting services. + +4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software. + +5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes. + +6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting. + +7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. + +8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services. + +9. APPLICABLE LAW. + +a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort. + +b. Outside the United States. If you acquired the software in any other country, the laws of that country apply. + +10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so. + +11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + +FOR AUSTRALIA – YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS. + +12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. + +This limitation applies to + +· anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and + +· claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. + +It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages. + +Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French. + +Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français. + +EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues. + +LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices. + +Cette limitation concerne : + +· tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et + +· les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur. + +Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard. + +EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas. + + diff --git a/src/packages/System.Net.Http.4.3.1/lib/Xamarinmac20/a b/src/packages/System.Net.Http.4.3.1/lib/Xamarinmac20/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/monoandroid10/a b/src/packages/System.Net.Http.4.3.1/lib/monoandroid10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/monotouch10/a b/src/packages/System.Net.Http.4.3.1/lib/monotouch10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/net45/a b/src/packages/System.Net.Http.4.3.1/lib/net45/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/portable-net45+win8+wpa81/a b/src/packages/System.Net.Http.4.3.1/lib/portable-net45+win8+wpa81/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/win8/a b/src/packages/System.Net.Http.4.3.1/lib/win8/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/wpa81/a b/src/packages/System.Net.Http.4.3.1/lib/wpa81/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/xamarinios10/a b/src/packages/System.Net.Http.4.3.1/lib/xamarinios10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/xamarintvos10/a b/src/packages/System.Net.Http.4.3.1/lib/xamarintvos10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/lib/xamarinwatchos10/a b/src/packages/System.Net.Http.4.3.1/lib/xamarinwatchos10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/ref/monoandroid10/a b/src/packages/System.Net.Http.4.3.1/ref/monoandroid10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/ref/monotouch10/a b/src/packages/System.Net.Http.4.3.1/ref/monotouch10/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/ref/net45/a b/src/packages/System.Net.Http.4.3.1/ref/net45/a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/a b/src/packages/System.Net.Http.4.3.1/ref/net46/a new file mode 100644 index 00000000000..7b4e5b6a5e4 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/a @@ -0,0 +1,2306 @@ + + + + System.Net.Http + + + + Provides HTTP content based on a byte array. + + + Initializes a new instance of the class. + The content used to initialize the . + The parameter is null. + + + Initializes a new instance of the class. + The content used to initialize the . + The offset, in bytes, in the parameter used to initialize the . + The number of bytes in the starting from the parameter used to initialize the . + The parameter is null. + The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter.-or-The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter - minus the parameter. + + + Creates an HTTP content stream as an asynchronous operation for reading whose backing store is memory from the . + Returns .The task object representing the asynchronous operation. + + + Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The target stream. + Information about the transport, like channel binding token. This parameter may be null. + + + Determines whether a byte array has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the byte array. + + + Specifies how client certificates are provided. + + + The will attempt to provide all available client certificates automatically. + + + The application manually provides the client certificates to the . This value is the default. + + + A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler. + + + Creates a new instance of the class. + + + Creates a new instance of the class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Releases the unmanaged resources used by the , and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the inner handler which processes the HTTP response messages. + Returns .The inner handler for HTTP response messages. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token to cancel operation. + The was null. + + + A container for name/value tuples encoded using application/x-www-form-urlencoded MIME type. + + + Initializes a new instance of the class with a specific collection of name/value pairs. + A collection of name/value pairs. + + + Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific handler. + The HTTP handler stack to use for sending requests. + + + Initializes a new instance of the class with a specific handler. + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + Returns .The base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + + + Cancel all pending requests on this instance. + + + Gets the headers which should be sent with each request. + Returns .The headers which should be sent with each request. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Gets or sets the maximum number of bytes to buffer when reading the response content. + Returns .The maximum number of bytes to buffer when reading the response content. The default value for this property is 2 gigabytes. + The size specified is less than or equal to zero. + An operation has already been started on the current instance. + The current instance has been disposed. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Gets or sets the timespan to wait before the request times out. + Returns .The timespan to wait before the request times out. + The timeout specified is less than or equal to zero and is not . + An operation has already been started on the current instance. + The current instance has been disposed. + + + The default message handler used by . + + + Creates an instance of a class. + + + Gets or sets a value that indicates whether the handler should follow redirection responses. + Returns .true if the if the handler should follow redirection responses; otherwise false. The default value is true. + + + Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response. + Returns .The automatic decompression method used by the handler. The default value is . + + + Gets or sets the collection of security certificates that are associated with this handler. + Returns .The collection of security certificates associated with this handler. + + + Gets or sets the cookie container used to store server cookies by the handler. + Returns .The cookie container used to store server cookies by the handler. + + + Gets or sets authentication information used by this handler. + Returns .The authentication credentials associated with the handler. The default is null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the maximum number of redirects that the handler follows. + Returns .The maximum number of redirection responses that the handler follows. The default value is 50. + + + Gets or sets the maximum request content buffer size used by the handler. + Returns .The maximum request content buffer size in bytes. The default value is 2 gigabytes. + + + Gets or sets a value that indicates whether the handler sends an Authorization header with the request. + Returns .true for the handler to send an HTTP Authorization header with requests after authentication has taken place; otherwise, false. The default is false. + + + Gets or sets proxy information used by the handler. + Returns .The proxy information used by the handler. The default value is null. + + + Creates an instance of based on the information provided in the as an operation that will not block. + Returns .The task object representing the asynchronous operation. + The HTTP request message. + A cancellation token to cancel the operation. + The was null. + + + Gets a value that indicates whether the handler supports automatic response content decompression. + Returns .true if the if the handler supports automatic response content decompression; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports proxy settings. + Returns .true if the if the handler supports proxy settings; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports configuration settings for the and properties. + Returns .true if the if the handler supports configuration settings for the and properties; otherwise false. The default value is true. + + + Gets or sets a value that indicates whether the handler uses the property to store server cookies and uses these cookies when sending requests. + Returns .true if the if the handler supports uses the property to store server cookies and uses these cookies when sending requests; otherwise false. The default value is true. + + + Gets or sets a value that controls whether default credentials are sent with requests by the handler. + Returns .true if the default credentials are used; otherwise false. The default value is false. + + + Gets or sets a value that indicates whether the handler uses a proxy for requests. + Returns .true if the handler should use a proxy for requests; otherwise false. The default value is true. + + + Indicates if operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content. + + + The operation should complete after reading the entire response including the content. + + + The operation should complete as soon as a response is available and headers are read. The content is not read yet. + + + A base class representing an HTTP entity body and content headers. + + + Initializes a new instance of the class. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Serialize the HTTP content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the HTTP content headers as defined in RFC 2616. + Returns .The content headers as defined in RFC 2616. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The maximum size, in bytes, of the buffer to use. + + + Serialize the HTTP content to a byte array as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content and return a stream that represents the content as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a string as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the HTTP content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HTTP content. + + + A base type for HTTP message handlers. + + + Initializes a new instance of the class. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A specialty class that allows applications to call the method on an Http handler chain. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods. + + + Initializes a new instance of the class with a specific HTTP method. + The HTTP method. + + + Represents an HTTP DELETE protocol method. + Returns . + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The HTTP method to compare with the current object. + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Represents an HTTP GET protocol method. + Returns . + + + Serves as a hash function for this type. + Returns .A hash code for the current . + + + Represents an HTTP HEAD protocol method. The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. + Returns . + + + An HTTP method. + Returns .An HTTP method represented as a . + + + The equality operator for comparing two objects. + Returns .true if the specified and parameters are equal; otherwise, false. + The left to an equality operator. + The right to an equality operator. + + + The inequality operator for comparing two objects. + Returns .true if the specified and parameters are inequal; otherwise, false. + The left to an inequality operator. + The right to an inequality operator. + + + Represents an HTTP OPTIONS protocol method. + Returns . + + + Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI. + Returns . + + + Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI. + Returns . + + + Returns a string that represents the current object. + Returns .A string representing the current object. + + + Represents an HTTP TRACE protocol method. + Returns . + + + A base class for exceptions thrown by the and classes. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific message that describes the current exception. + A message that describes the current exception. + + + Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. + A message that describes the current exception. + The inner exception. + + + Represents a HTTP request message. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + A string that represents the request . + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + The to request. + + + Gets or sets the contents of the HTTP message. + Returns .The content of a message + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the collection of HTTP request headers. + Returns .The collection of HTTP request headers. + + + Gets or sets the HTTP method used by the HTTP request message. + Returns .The HTTP method used by the request message. The default is the GET method. + + + Gets a set of properties for the HTTP request. + Returns . + + + Gets or sets the used for the HTTP request. + Returns .The used for the HTTP request. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + Represents a HTTP response message including the status code and data. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific . + The status code of the HTTP response. + + + Gets or sets the content of a HTTP response message. + Returns .The content of the HTTP response message. + + + Releases the unmanaged resources and disposes of unmanaged resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Throws an exception if the property for the HTTP response is false. + Returns .The HTTP response message if the call is successful. + + + Gets the collection of HTTP response headers. + Returns .The collection of HTTP response headers. + + + Gets a value that indicates if the HTTP response was successful. + Returns .A value that indicates if the HTTP response was successful. true if was in the range 200-299; otherwise false. + + + Gets or sets the reason phrase which typically is sent by servers together with the status code. + Returns .The reason phrase sent by the server. + + + Gets or sets the request message which led to this response message. + Returns .The request message which led to this response message. + + + Gets or sets the status code of the HTTP response. + Returns .The status code of the HTTP response. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + A base type for handlers which only do some small processing of request and/or response messages. + + + Creates an instance of a class. + + + Creates an instance of a class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Performs processing on each request sent to the server. + Returns .The HTTP request message that was processed. + The HTTP request message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Perform processing on each response from the server. + Returns .The HTTP response message that was processed. + The HTTP response message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Provides a collection of objects that get serialized using the multipart/* content type specification. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The subtype of the multipart content. + The was null or contains only white space characters. + + + Creates a new instance of the class. + The subtype of the multipart content. + The boundary string for the multipart content. + The was null or an empty string.The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add multipart HTTP content to a collection of objects that get serialized using the multipart/* content type specification. + The HTTP content to add to the collection. + The was null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Returns an enumerator that iterates through the collection of objects that get serialized using the multipart/* content type specification.. + Returns .An object that can be used to iterate through the collection. + + + Serialize the multipart HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + The explicit implementation of the method. + Returns .An object that can be used to iterate through the collection. + + + Determines whether the HTTP multipart content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HHTP content. + + + Provides a container for content encoded using multipart/form-data MIME type. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The boundary string for the multipart form data content. + The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The was null or contains only white space characters. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The file name for the HTTP content to add to the collection. + The was null or contains only white space characters.-or-The was null or contains only white space characters. + The was null. + + + Provides HTTP content based on a stream. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The size, in bytes, of the buffer for the . + The was null. + The was less than or equal to zero. + + + Write the HTTP stream content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the stream content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the stream content. + + + Provides HTTP content based on a string. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + The media type to use for the content. + + + Represents authentication information in Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate header values. + + + Initializes a new instance of the class. + The scheme to use for authorization. + + + Initializes a new instance of the class. + The scheme to use for authorization. + The credentials containing the authentication information of the user agent for the resource being requested. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the credentials containing the authentication information of the user agent for the resource being requested. + Returns .The credentials containing the authentication information. + + + Converts a string to an instance. + Returns .An instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets the scheme to use for authorization. + Returns .The scheme to use for authorization. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Cache-Control header. + + + Initializes a new instance of the class. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Cache-extension tokens, each with an optional assigned value. + Returns .A collection of cache-extension tokens each with an optional assigned value. + + + Serves as a hash function for a object. + Returns .A hash code for the current object. + + + The maximum age, specified in seconds, that the HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .true if the HTTP client is willing to accept a response that has exceed the expiration time; otherwise, false. + + + The maximum time, in seconds, an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .The time in seconds. + + + The freshness lifetime, in seconds, that an HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale; otherwise, false. + + + Whether an HTTP client is willing to accept a cached response. + Returns .true if the HTTP client is willing to accept a cached response; otherwise, false. + + + A collection of fieldnames in the "no-cache" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether a cache must not store any part of either the HTTP request mressage or any response. + Returns .true if a cache must not store any part of either the HTTP request mressage or any response; otherwise, false. + + + Whether a cache or proxy must not change any aspect of the entity-body. + Returns .true if a cache or proxy must not change any aspect of the entity-body; otherwise, false. + + + Whether a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status. + Returns .true if a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status; otherwise, false. + + + Converts a string to an instance. + Returns .A instance. + A string that represents cache-control header value information. + + is a null reference. + + is not valid cache-control header value information. + + + Whether all or part of the HTTP response message is intended for a single user and must not be cached by a shared cache. + Returns .true if the HTTP response message is intended for a single user and must not be cached by a shared cache; otherwise, false. + + + A collection fieldnames in the "private" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale for shared user agent caches. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale for shared user agent caches; otherwise, false. + + + Whether an HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. + Returns .true if the HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache; otherwise, false. + + + The shared maximum age, specified in seconds, in an HTTP response that overrides the "max-age" directive in a cache-control header or an Expires header for a shared cache. + Returns .The time in seconds. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Disposition header. + + + Initializes a new instance of the class. + A . + + + Initializes a new instance of the class. + A string that contains a . + + + The date at which the file was created. + Returns .The file creation date. + + + The disposition type for a content body part. + Returns .The disposition type. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + A suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file. + Returns .A suggested filename. + + + A suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files. + Returns .A suggested filename of the form filename*. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + The date at which the file was last modified. + Returns .The file modification date. + + + The name for a content body part. + Returns .The name for the content body part. + + + A set of parameters included the Content-Disposition header. + Returns .A collection of parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content disposition header value information. + + is a null reference. + + is not valid content disposition header value information. + + + The date the file was last read. + Returns .The last read date. + + + The approximate size, in bytes, of the file. + Returns .The approximate size, in bytes. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Range header. + + + Initializes a new instance of the class. + The starting or ending point of the range, in bytes. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + The starting or ending point of the range, in bytes. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position, in bytes, at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the Content-Range header has a length specified. + Returns .true if the Content-Range has a length specified; otherwise, false. + + + Gets whether the Content-Range has a range specified. + Returns .true if the Content-Range has a range specified; otherwise, false. + + + Gets the length of the full entity-body. + Returns .The length of the full entity-body. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content range header value information. + + is a null reference. + + is not valid content range header value information. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + The range units used. + Returns .A that contains range units. + + + Represents an entity-tag header value. + + + Initializes a new instance of the class. + A string that contains an . + + + Initializes a new instance of the class. + A string that contains an . + A value that indicates if this entity-tag header is a weak validator. If the entity-tag header is weak validator, then should be set to true. If the entity-tag header is a strong validator, then should be set to false. + + + Gets the entity-tag header value. + Returns . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the entity-tag is prefaced by a weakness indicator. + Returns .true if the entity-tag is prefaced by a weakness indicator; otherwise, false. + + + Converts a string to an instance. + Returns .An instance. + A string that represents entity tag header value information. + + is a null reference. + + is not valid entity tag header value information. + + + Gets the opaque quoted string. + Returns .An opaque quoted string. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the collection of Content Headers as defined in RFC 2616. + + + Gets the value of the Allow content header on an HTTP response. + Returns .The value of the Allow header on an HTTP response. + + + Gets the value of the Content-Disposition content header on an HTTP response. + Returns .The value of the Content-Disposition content header on an HTTP response. + + + Gets the value of the Content-Encoding content header on an HTTP response. + Returns .The value of the Content-Encoding content header on an HTTP response. + + + Gets the value of the Content-Language content header on an HTTP response. + Returns .The value of the Content-Language content header on an HTTP response. + + + Gets or sets the value of the Content-Length content header on an HTTP response. + Returns .The value of the Content-Length content header on an HTTP response. + + + Gets or sets the value of the Content-Location content header on an HTTP response. + Returns .The value of the Content-Location content header on an HTTP response. + + + Gets or sets the value of the Content-MD5 content header on an HTTP response. + Returns .The value of the Content-MD5 content header on an HTTP response. + + + Gets or sets the value of the Content-Range content header on an HTTP response. + Returns .The value of the Content-Range content header on an HTTP response. + + + Gets or sets the value of the Content-Type content header on an HTTP response. + Returns .The value of the Content-Type content header on an HTTP response. + + + Gets or sets the value of the Expires content header on an HTTP response. + Returns .The value of the Expires content header on an HTTP response. + + + Gets or sets the value of the Last-Modified content header on an HTTP response. + Returns .The value of the Last-Modified content header on an HTTP response. + + + A collection of headers and their values as defined in RFC 2616. + + + Initializes a new instance of the class. + + + Adds the specified header and its values into the collection. + The header to add to the collection. + A list of header values to add to the collection. + + + Adds the specified header and its value into the collection. + The header to add to the collection. + The content of the header. + + + Removes all headers from the collection. + + + Returns if a specific header exists in the collection. + Returns .true is the specified header exists in the collection; otherwise false. + The specific header. + + + Returns an enumerator that can iterate through the instance. + Returns .An enumerator for the . + + + Returns all header values for a specified header stored in the collection. + Returns .An array of header strings. + The specified header to return values for. + + + Removes the specified header from the collection. + Returns . + The name of the header to remove from the collection. + + + Gets an enumerator that can iterate through a . + Returns .An instance of an implementation of an that can iterate through a . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Returns a value that indicates whether the specified header and its values were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The values of the header. + + + Returns a value that indicates whether the specified header and its value were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The content of the header. + + + Return if a specified header and specified values are stored in the collection. + Returns .true is the specified header and values are stored in the collection; otherwise false. + The specified header. + The specified header values. + + + Represents a collection of header values. + The header collection type. + + + Adds an entry to the . + The item to add to the header collection. + + + Removes all entries from the . + + + Determines if the contains an item. + Returns .true if the entry is contained in the instance; otherwise, false + The item to find to the header collection. + + + Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + + Gets the number of headers in the . + Returns .The number of headers in a collection + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Gets a value indicating whether the instance is read-only. + Returns .true if the instance is read-only; otherwise, false. + + + Parses and adds an entry to the . + The entry to add. + + + Removes the specified item from the . + Returns .true if the was removed from the instance; otherwise, false + The item to remove. + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Returns a string that represents the current object. object. + Returns .A string that represents the current object. + + + Determines whether the input could be parsed and added to the . + Returns .true if the could be parsed and added to the instance; otherwise, false + The entry to validate. + + + Represents the collection of Request Headers as defined in RFC 2616. + + + Gets the value of the Accept header for an HTTP request. + Returns .The value of the Accept header for an HTTP request. + + + Gets the value of the Accept-Charset header for an HTTP request. + Returns .The value of the Accept-Charset header for an HTTP request. + + + Gets the value of the Accept-Encoding header for an HTTP request. + Returns .The value of the Accept-Encoding header for an HTTP request. + + + Gets the value of the Accept-Language header for an HTTP request. + Returns .The value of the Accept-Language header for an HTTP request. + + + Gets or sets the value of the Authorization header for an HTTP request. + Returns .The value of the Authorization header for an HTTP request. + + + Gets or sets the value of the Cache-Control header for an HTTP request. + Returns .The value of the Cache-Control header for an HTTP request. + + + Gets the value of the Connection header for an HTTP request. + Returns .The value of the Connection header for an HTTP request. + + + Gets or sets a value that indicates if the Connection header for an HTTP request contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP request. + Returns .The value of the Date header for an HTTP request. + + + Gets the value of the Expect header for an HTTP request. + Returns .The value of the Expect header for an HTTP request. + + + Gets or sets a value that indicates if the Expect header for an HTTP request contains Continue. + Returns .true if the Expect header contains Continue, otherwise false. + + + Gets or sets the value of the From header for an HTTP request. + Returns .The value of the From header for an HTTP request. + + + Gets or sets the value of the Host header for an HTTP request. + Returns .The value of the Host header for an HTTP request. + + + Gets the value of the If-Match header for an HTTP request. + Returns .The value of the If-Match header for an HTTP request. + + + Gets or sets the value of the If-Modified-Since header for an HTTP request. + Returns .The value of the If-Modified-Since header for an HTTP request. + + + Gets the value of the If-None-Match header for an HTTP request. + Returns .Gets the value of the If-None-Match header for an HTTP request. + + + Gets or sets the value of the If-Range header for an HTTP request. + Returns .The value of the If-Range header for an HTTP request. + + + Gets or sets the value of the If-Unmodified-Since header for an HTTP request. + Returns .The value of the If-Unmodified-Since header for an HTTP request. + + + Gets or sets the value of the Max-Forwards header for an HTTP request. + Returns .The value of the Max-Forwards header for an HTTP request. + + + Gets the value of the Pragma header for an HTTP request. + Returns .The value of the Pragma header for an HTTP request. + + + Gets or sets the value of the Proxy-Authorization header for an HTTP request. + Returns .The value of the Proxy-Authorization header for an HTTP request. + + + Gets or sets the value of the Range header for an HTTP request. + Returns .The value of the Range header for an HTTP request. + + + Gets or sets the value of the Referer header for an HTTP request. + Returns .The value of the Referer header for an HTTP request. + + + Gets the value of the TE header for an HTTP request. + Returns .The value of the TE header for an HTTP request. + + + Gets the value of the Trailer header for an HTTP request. + Returns .The value of the Trailer header for an HTTP request. + + + Gets the value of the Transfer-Encoding header for an HTTP request. + Returns .The value of the Transfer-Encoding header for an HTTP request. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP request contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP request. + Returns .The value of the Upgrade header for an HTTP request. + + + Gets the value of the User-Agent header for an HTTP request. + Returns .The value of the User-Agent header for an HTTP request. + + + Gets the value of the Via header for an HTTP request. + Returns .The value of the Via header for an HTTP request. + + + Gets the value of the Warning header for an HTTP request. + Returns .The value of the Warning header for an HTTP request. + + + Represents the collection of Response Headers as defined in RFC 2616. + + + Gets the value of the Accept-Ranges header for an HTTP response. + Returns .The value of the Accept-Ranges header for an HTTP response. + + + Gets or sets the value of the Age header for an HTTP response. + Returns .The value of the Age header for an HTTP response. + + + Gets or sets the value of the Cache-Control header for an HTTP response. + Returns .The value of the Cache-Control header for an HTTP response. + + + Gets the value of the Connection header for an HTTP response. + Returns .The value of the Connection header for an HTTP response. + + + Gets or sets a value that indicates if the Connection header for an HTTP response contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP response. + Returns .The value of the Date header for an HTTP response. + + + Gets or sets the value of the ETag header for an HTTP response. + Returns .The value of the ETag header for an HTTP response. + + + Gets or sets the value of the Location header for an HTTP response. + Returns .The value of the Location header for an HTTP response. + + + Gets the value of the Pragma header for an HTTP response. + Returns .The value of the Pragma header for an HTTP response. + + + Gets the value of the Proxy-Authenticate header for an HTTP response. + Returns .The value of the Proxy-Authenticate header for an HTTP response. + + + Gets or sets the value of the Retry-After header for an HTTP response. + Returns .The value of the Retry-After header for an HTTP response. + + + Gets the value of the Server header for an HTTP response. + Returns .The value of the Server header for an HTTP response. + + + Gets the value of the Trailer header for an HTTP response. + Returns .The value of the Trailer header for an HTTP response. + + + Gets the value of the Transfer-Encoding header for an HTTP response. + Returns .The value of the Transfer-Encoding header for an HTTP response. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP response contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP response. + Returns .The value of the Upgrade header for an HTTP response. + + + Gets the value of the Vary header for an HTTP response. + Returns .The value of the Vary header for an HTTP response. + + + Gets the value of the Via header for an HTTP response. + Returns .The value of the Via header for an HTTP response. + + + Gets the value of the Warning header for an HTTP response. + Returns .The value of the Warning header for an HTTP response. + + + Gets the value of the WWW-Authenticate header for an HTTP response. + Returns .The value of the WWW-Authenticate header for an HTTP response. + + + Represents a media type used in a Content-Type header as defined in the RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The source represented as a string to initialize the new instance. + + + Gets or sets the character set. + Returns .The character set. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets or sets the media-type header value. + Returns .The media-type header value. + + + Gets or sets the media-type header value parameters. + Returns .The media-type header value parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type header value information. + + is a null reference. + + is not valid media type header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a media type with an additional quality factor used in a Content-Type header. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + The quality associated with this header value. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type with quality header value information. + + is a null reference. + + is not valid media type with quality header value information. + + + Get or set the quality value for the . + Returns .The quality value for the object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a name/value pair used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the header name. + Returns .The header name. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value header value information. + + is a null reference. + + is not valid name value header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the header value. + Returns .The header value. + + + Represents a name/value pair with parameters used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the parameters from the object. + Returns .A collection containing the parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value with parameter header value information. + + is a null reference. + + is not valid name value with parameter header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a product token value in a User-Agent header. + + + Initializes a new instance of the class. + The product name. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the name of the product token. + Returns .The name of the product token. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the version of the product token. + Returns .The version of the product token. + + + Represents a value which can either be a product or a comment in a User-Agent header. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A comment value. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Gets the comment from the object. + Returns .The comment value this . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product info header value information. + + is a null reference. + + is not valid product info header value information. + + + Gets the product from the object. + Returns .The product value from this . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents an If-Range header value which can either be a date/time or an entity-tag value. + + + Initializes a new instance of the class. + A date value used to initialize the new instance. + + + Initializes a new instance of the class. + An object used to initialize the new instance. + + + Initializes a new instance of the class. + An entity tag represented as a string used to initialize the new instance. + + + Gets the date from the object. + Returns .The date from the object. + + + Gets the entity tag from the object. + Returns .The entity tag from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range condition header value information. + + is a null reference. + + is not valid range Condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a Range header value. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a byte range. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range header value information. + + is a null reference. + + is not valid range header value information. + + + Gets the ranges specified from the object. + Returns .The ranges from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + he string to validate. + The version of the string. + + + Gets the unit from the object. + Returns .The unit from the object. + + + Represents a byte range in a Range header value. + + + Initializes a new instance of the class. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Represents a Retry-After header value which can either be a date/time or a timespan value. + + + Initializes a new instance of the class. + The date and time offset used to initialize the new instance. + + + Initializes a new instance of the class. + The delta, in seconds, used to initialize the new instance. + + + Gets the date and time offset from the object. + Returns .The date and time offset from the object. + + + Gets the delta in seconds from the object. + Returns .The delta in seconds from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents retry condition header value information. + + is a null reference. + + is not valid retry condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a string header value with an optional quality. + + + Initializes a new instance of the class. + The string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A quality factor used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents quality header value information. + + is a null reference. + + is not valid string with quality header value information. + + + Gets the quality factor from the object. + Returns .The quality factor from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the string value from the object. + Returns .The string value from the object. + + + Represents an accept-encoding header value. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the transfer-coding parameters. + Returns .The transfer-coding parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding header value information. + + is a null reference. + + is not valid transfer-coding header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the transfer-coding value. + Returns .The transfer-coding value. + + + Represents an Accept-Encoding header value.with optional quality factor. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A value for the quality factor. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding value information. + + is a null reference. + + is not valid transfer-coding with quality header value information. + + + Gets the quality factor from the . + Returns .The quality factor from the . + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of a Via header. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + The comment field used to identify the software of the recipient proxy or gateway. + + + Gets the comment field used to identify the software of the recipient proxy or gateway. + Returns .The comment field used to identify the software of the recipient proxy or gateway. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .Returns a hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents via header value information. + + is a null reference. + + is not valid via header value information. + + + Gets the protocol name of the received protocol. + Returns .The protocol name. + + + Gets the protocol version of the received protocol. + Returns .The protocol version. + + + Gets the host and port that the request or response was received by. + Returns .The host and port that the request or response was received by. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a warning value used by the Warning header. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + The date/time stamp of the warning. + + + Gets the host that attached the warning. + Returns .The host that attached the warning. + + + Gets the specific warning code. + Returns .The specific warning code. + + + Gets the date/time stamp of the warning. + Returns .The date/time stamp of the warning. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns an instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets a quoted-string containing the warning text. + Returns .A quoted-string containing the warning text. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/de/a b/src/packages/System.Net.Http.4.3.1/ref/net46/de/a new file mode 100644 index 00000000000..5c4f577656b --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/de/a @@ -0,0 +1,2350 @@ + + + + System.Net.Http + + + + Stellt HTTP-Inhalt auf Grundlage von einem Bytearray bereit. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der -Parameter ist null. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der Offset in Bytes im -Parameter, der verwendet wird, um den zu initialisieren. + Die Anzahl der Bytes in ab dem -Parameter, die zum Initialisieren von benutzt werden. + Der -Parameter ist null. + Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters angegeben wird.- oder -Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters - minus dem -Parameter angegeben wird. + + + Erstellt einen HTTP-Inhaltsdatenstrom als asynchronen Vorgang zum Lesen, dessen Sicherungsspeicher Arbeitsspeicher von ist. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Das Bytearray, das im Konstruktor bereitgestellt wird, als asynchronen Vorgang in einen HTTP-Inhaltsstream serialisieren und schreiben. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport, zum Beispiel Channelbindungstoken.Dieser Parameter kann null sein. + + + Bestimmt, ob ein Bytearray eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Bytearrays in Bytes. + + + Gibt an, wie die Clientzertifikate bereitgestellt werden. + + + Der versucht, alle verfügbaren Clientzertifikate automatisch bereitzustellen. + + + Die Anwendung stellt manuell die Clientzertifikate für den bereit.Dies ist der Standardwert. + + + Ein Typ für HTTP-Handler, die die Verarbeitung von HTTP-Antwortnachrichten in einen anderen Handler (den internen Handler) delegieren. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft den internen Handler ab, der die HTTP-Antwortnachrichten verarbeitet, oder legt diesen fest. + Gibt zurück.Der innere Handler für HTTP-Antwortnachrichten. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ein Container für die Name/Wert-Tupel, codiert mit dem "application/x-www-form-urlencoded" MIME-Typ. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Auflistung von Namen/Wert-Paaren. + Eine Sammlung von Name-Wert-Paaren. + + + Stellt eine Basisklasse zum Senden von HTTP-Anforderungen und Empfangen von HTTP-Antworten aus einer Ressource bereit, die von einem URI identifiziert wird. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der HTTP-Handlerstapel, der zum Senden von Anforderungen zu verwenden ist. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden soll, false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Ruft die Basisadresse des URI (Uniform Resource Identifier) der Internetressource ab, die verwendet wird, wenn Anforderungen gesendet werden, oder legt diese fest. + Gibt zurück.Die Basisadresse des URI (Uniform Resource Identifier) der Internetressource, die verwendet wird, wenn Anforderungen gesendet werden. + + + Alle ausstehenden Anforderungen für diese Instanz abbrechen. + + + Ruft die Header ab, die mit jeder Anforderung gesendet werden sollen. + Gibt zurück.Die Header, die mit jeder Anforderung gesendet werden sollen. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Ruft beim Lesen des Antwortinhalts die maximale Anzahl zwischenzuspeichernder Bytes ab oder legt diese fest. + Gibt zurück.Die maximale Anzahl zu puffernder Bytes, wenn der Antwortinhalt gelesen wird.Der Standardwert für diese Eigenschaft ist 2 GB. + Der angegebene Größe ist kleiner als oder gleich 0 (null). + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Ruft die Zeitspanne ab, nach der das Zeitlimit der Anforderung überschritten ist, oder legt diese fest. + Gibt zurück.Die Zeitspanne, nach der das Zeitlimit der Anforderung überschritten ist. + Der angegebene Timout ist kleiner oder gleich 0 (null) und nicht . + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Der standardmäßige Meldungshandler für . + + + Erstellt eine Instanz einer -Klasse. + + + Ruft einen Wert ab, der angibt, ob der Handler Umleitungsantworten folgen soll, oder legt diesen Wert fest. + Gibt zurück.Wenn true, wenn der Handler Umleitungsantworten folgen soll; andernfalls false.Der Standardwert ist true. + + + Ruft den Typ der Dekomprimierungsmethode ab, die vom Handler für die automatische Dekomprimierung der HTTP-Inhalt-Antwort verwendet wird, oder legt diesen fest. + Gibt zurück.Die vom Handler zu benutzende automatische Dekomprimierungsmethode.Der Standardwert ist . + + + Ruft die diesem Handler zugeordnete Auflistung von Sicherheitszertifikaten ab oder legt diese fest. + Gibt zurück.Die Auflistung von Sicherheitszertifikaten, die diesem Handler zugeordnet sind. + + + Ruft den Cookiecontainer zum Speichern von Servercookies durch den Handler ab oder diesen fest. + Gibt zurück.Der Cookie-Container zum Speichern von Server-Cookies durch den Handler. + + + Ruft die Authentifizierungsinformationen ab, die vom Handler verwendet wurden, oder legt diese fest. + Gibt zurück.Die der Authentifizierungsanforderung zugeordnete Handler.Der Standardwert ist null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die maximale Anzahl von Umleitungen ab, denen der Handler folgt, oder legt diese fest. + Gibt zurück.Die maximale Anzahl von Umleitungsantworten, denen der Handler folgt.Der Standardwert ist 50. + + + Ruft die maximale Größe des Anforderungsinhaltpuffers ab, der vom Handler verwendet wird, oder legt diese fest. + Gibt zurück.Die maximale Größe des Anforderungsinhaltpuffers in Byte.Der Standardwert beträgt 2 GB. + + + Ruft einen Wert ab, der angibt, ob der Handler mit der Anforderung ein Autorisierungsheader sendet, oder legt diesen fest. + Gibt zurück.true für den Handler zum Senden eines HTTP-Autorisierungsheaders mit Anforderungen nach einer Authentifizierung, andernfalls false.Die Standardeinstellung ist false. + + + Ruft die Proxyinformationen ab, die vom Handler verwendet werden, oder legt diese fest. + Gibt zurück.Die Proxyinformationen, die vom Handler verwendet werden.Der Standardwert ist null. + + + Erstellt eine Instanz von auf Grundlage der Informationen, die in als Operation bereitgestellt werden, der nicht blockiert. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ruft einen Wert ab, der angibt, ob der Handler die automatische Antwort-Inhaltsdekomprimierung unterstützt. + Gibt zurück.Wenn true, wenn der Handler die automatische Dekomprimierung von Antwortinhalt unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler die Proxyeinstellungen unterstützt. + Gibt zurück.Wenn true, wenn der Handler die Proxyeinstellungen unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt. + Gibt zurück.Wenn true, wenn der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und die Cookies beim Senden von Anforderungen nutzt. + Gibt zurück.Wenn true, wenn der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und diese Cookies beim Senden von Anforderungen verwendet; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der steuert, ob mit den Anforderungen vom Handler Standardanmeldeinformationen gesendet werden, oder legt diesen fest. + Gibt zurück.true, wenn die standardmäßigen Anmeldeinformationen verwendet werden, andernfalls false.Der Standardwert ist false. + + + Ruft einen Wert ab bzw. legt einen Wert fest, der angibt, ob der Handler einen Proxy für Anforderungen verwendet. + Gibt zurück.true, wenn der Handler einen Proxy für Anforderungen verwenden soll; andernfalls false.Der Standardwert ist true. + + + Gibt an, ob -Vorgänge als abgeschlossen betrachtet werden, sobald eine Antwort verfügbar ist, oder nachdem die gesamte Antwortnachricht einschließlich Inhalt gelesen wurde. + + + Der Vorgang sollte beendet werden, nachdem er die gesamte Antwort einschließlich des Inhalts gelesen hat. + + + Der Vorgang sollte beendet werden, sobald eine Antwort vorliegt und die Header gelesen wurden.Der Inhalts noch ist nicht bereit. + + + Eine Basisklasse, die einen HTTP-Entitätentext und Inhaltsheader darstellt. + + + Initialisiert eine neue Instanz der -Klasse. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherstream als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die HTTP-Inhaltsheader wie in RFC 2616 definiert ab. + Gibt zurück.Die Inhaltsheader gemäß RFC 2616. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die maximale Größe des zu verwendenden Puffers in Byte. + + + Serialisieren Sie den HTTP-Inhalt in ein Bytearray als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisieren Sie den HTTP-Inhalt und geben Sie einen Stream zurück, der den Inhalt als asynchroner Vorgang darstellt. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in eine Zeichenfolge als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der HTTP-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Ein Basistyp für HTTP-Message-Handler. + + + Initialisiert eine neue Instanz der -Klasse. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Spezialitätenklasse, die es Anwendungen ermöglicht, die Methode auf einer HTTP-Handlerkette aufzurufen. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden sollte,false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Hilfsprogrammklasse für das Abrufen und das Vergleichen von Standard-HTTP-Methoden und zum Erstellen von neuen HTTP-Methoden. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten HTTP-Methode. + Die HTTP-Methode + + + Stellt eine HTTP DELTE-Protokollmethode dar. + Gibt zurück. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Die HTTP-Methode, die mit dem aktuellen Objekt verglichen werden soll. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Stellt eine HTTP GET-Protokollmethode dar. + Gibt zurück. + + + Fungiert als Hashfunktion für diesen Typ. + Gibt zurück.Ein Hashcode für das aktuelle . + + + Stellt eine HTTP HEAD-Protokollmethode dar.Die HEAD-Methode ist mit der GET-Methode identisch, bis auf den Unterschied, dass der Server in der Antwort nur Meldungsheader und keinen Meldungstext zurückgibt. + Gibt zurück. + + + Eine HTTP-Methode. + Gibt zurück.Die HTTP-Methode dargestellt als . + + + Der Gleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter gleich sind, andernfalls false. + Die linke für einen Gleichheitsoperator. + Die rechte zu einem Gleichheitsoperator. + + + Der Ungleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter ungleich sind, andernfalls false. + Die linke für einen Ungleichheitsoperator. + Die rechte zu einem Ungleichheitsoperator. + + + Stellt eine HTTP OPTIONS-Protokollmethode dar. + Gibt zurück. + + + Stellt eine HTTP POST-Protokollmethode dar, die verwendet wird, um eine neue Entität als Zusatz zu einem URI zu senden. + Gibt zurück. + + + Stellt eine HTTP PUT-Protokollmethode dar, die verwendet wird, um eine durch einen URI bezeichnete Entität zu ersetzen. + Gibt zurück. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt eine HTTP TRACE-Protokollmethode dar. + Gibt zurück. + + + Eine Basisklasse für Ausnahmen, die von den Klassen und ausgelöst werden. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt, und einer inneren Ausnahme. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + Die innere Ausnahme. + + + Stellt eine HTTP-Nachrichtenanfrage dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Eine Zeichenfolge, die die Anforderung darstellt. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Das anzufordernde . + + + Ruft den Inhalt der HTTP-Meldung ab oder legt diesen fest. + Gibt zurück.Der Nachrichteninhalt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die Auflistung von HTTP-Anforderungsheadern ab. + Gibt zurück.Eine Auflistung von HTTP-Anforderungsheadern. + + + Ruft die von der HTTP-Anforderungsmeldung verwendete HTTP-Methode ab oder legt diese fest. + Gibt zurück.Die HTTP-Methode, die von der Anforderungnachricht benutzt wurde.Standard ist die GET-Methode. + + + Ruft eine Gruppe von Eigenschaften für die HTTP-Anforderung ab. + Gibt zurück. + + + Übernimmt oder bestimmt den , der für die HTTP-Anforderung verwendet wird. + Gibt zurück.Der , der für die aktuelle HTTP-Anforderung verwendet wird. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Stellt eine HTTP-Antwortnachricht einschließlich den Statuscodes und der Daten dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten . + Der Statuscode der ATTP-Antwort. + + + Ruft den Inhalt einer HTTP-Antwortmeldung ab oder legt diesen fest. + Gibt zurück.Der Inhalt des HTTP-Antwortnachricht. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die nicht verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Löst eine Ausnahme aus, wenn die -Eigenschaft der HTTP-Antwort false lautet. + Gibt zurück.Die HTTP-Antwortnachricht, wenn der Aufruf erfolgreich ausgeführt wurde. + + + Ruft die Auflistung von HTTP-Antwortheadern ab. + Gibt zurück.Die Auflistung von HTTP-Antwortheadern. + + + Ruft einen Wert ab, der angibt, ob die HTTP-Antwort erfolgreich war. + Gibt zurück.Ein Wert, der angibt, ob die HTTP-Antwort erfolgreich war.true, wenn sich im Bereich 200–299 befand; andernfalls false. + + + Ruft den Begründungsausdruck ab, der üblicherweise von Servern, zusammen mit dem Statuscode, gesendet wird, oder legt diesen fest. + Gibt zurück.Die vom Server gesendete Begründungsphrase. + + + Ruft die Anforderungnachricht ab, die zu dieser Antwortnachricht geführt hat, oder legt diese fest. + Gibt zurück.Die Anforderungsnachricht, die zu dieser Antwortnachricht geführt hat. + + + Übernimmt oder bestimmt den Statuscode der HTTP-Antwort. + Gibt zurück.Der Statuscode der ATTP-Antwort. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Ein Basistyp für Handler, die nur einige kleine Verarbeitung der Anforderungs- und/oder der Antwortnachrichten ausführen. + + + Erstellt eine Instanz einer -Klasse. + + + Erstellt eine Instanz einer -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Führt die Verarbeitung auf jeder Anforderung aus, die an den Server gesendet wird. + Gibt zurück.Die HTTP-Anforderungsnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Anforderungmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Führen Sie die Verarbeitung auf jeder Antwort vom Server aus. + Gibt zurück.Die HTTP-Antwortnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Antwortmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Stellt eine Auflistung von -Objekten bereit, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die war null enthält nur Leerzeichen. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die Begrenzungszeichenfolge für den Multipart-Inhalt. + Der war null oder eine leere Zeichenfolge ().Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie Mehrfach-HTTP-Inhalt einer Sammlung von -Objekten hinzu, die unter Verwendung der multipart/*-Inhaltstypspezifikation serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Gibt einen Enumerator zurück, der die Auflistung der -Objekte durchläuft, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Den Multipart-HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Eine explizite Implementierung der -Methode. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Bestimmt, ob der HTTP-Multipart-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Stellt einen Container für den Inhalt bereit, der mithilfe des multipart/form-data-MIME-Typs codiert wird. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Die Begrenzungszeichenfolge für den Multipart-Form-Dateninhalt. + Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Die war null enthält nur Leerzeichen. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Der Name der Datei, für den zur Auflistung hinzuzufügenden HTTP-Inhalt. + Die war null enthält nur Leerzeichen.- oder -Die war null enthält nur Leerzeichen. + + war null. + + + Stellt HTTP-Inhalt auf Grundlage eines Streams bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die verfügbare Größe des Puffers in Byte für die . + + war null. + Die war kleiner oder gleich 0 (null). + + + Den HTTP-Datenstrominhalt in einen Speicherstream als asynchronen Vorgang schreiben. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der Stream-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Streamsinhalts in Bytes. + + + Stellt HTTP-Inhalt auf Grundlage einer Zeichenfolge bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + Der Medientyp, der für den Inhalt verwendet werden soll. + + + Stellt Authentifizierungsinformationen in Authorization-, ProxyAuthorization-, WWW-Authenticate- und Proxy-Authenticate-Headerwerten dar. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + Die Anmeldeinformationen, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Anmeldeinformationen ab, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + Gibt zurück.Die Anmeldeinformationen, die die Informationen für die Authentifizierung enthalten. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft das Schema ab, welches für die Autorisierung verwendet werden soll. + Gibt zurück.Das Schema für die Autorisierung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Cachesteuerungsheaders dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + CACHE-EXTENSION-Tokens, jeweils mit einem optionalen zugeordneten Wert. + Gibt zurück.Eine Sammlung von Cacheerweiterungtokens, jeweils mit einem optionalen zugeordneten Wert. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Der Höchstalter in Sekunden, für das der HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat; andernfalls false. + + + Die maximale Zeit in Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die ihre Ablaufzeit überschritten hat. + Gibt zurück.Die Zeit in Sekunden. + + + Die Anzahl Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag veraltet ist; andernfalls false. + + + Ob ein HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu akzeptieren. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu übernehmen; andernfalls false. + + + Eine Sammlung von Feldnamen in der "no-cache"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf. + Gibt zurück.true, wenn ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf; andernfalls false. + + + Ob ein Cache oder ein Proxy keinen Aspekt des Entitätstexts ändern darf. + Gibt zurück.true, wenn ein Cache oder Proxy keinen Aspekt des Entitätstexts ändern darf; andernfalls false. + + + Ob ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert. + Gibt zurück.true wenn ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Cachesteuerungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Cachesteuerungsheader. + + + Gibt an, ob alles oder nur ein Teil der HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht durch das Ausführen eines freigegebenen Caches zwischengespeichert werden darf. + Gibt zurück.true, wenn die HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht von einem gemeinsam genutzten Cache zwischengespeichert werden darf; andernfalls false. + + + Eine Feldnamensammlung in der "private"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist; andernfalls false. + + + Ob eine HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde. + Gibt zurück.true, wenn die HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde; andernfalls false. + + + Das freigegebene, in Sekunden angegebene Höchstalter in einer HTTP-Antwort, die die "max-age"-Direktive in einem Cache-Control-Header oder einem Expires-Header für einen gemeinsam genutzten Cache überschreibt. + Gibt zurück.Die Zeit in Sekunden. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Disposition-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die eine enthält. + + + Das Datum, zu der die Datei erstellt wurde. + Gibt zurück.Das Dateierstellungsdatum. + + + Der Anordnungstyp für einen Textteil. + Gibt zurück.Der Anordnungstyp. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ein Vorschlag, wie Sie einen Dateinamen zum Speichern der Nachrichtennutzlast erstellen, der verwendet werden soll, wenn die Entität getrennt und in einer separaten Datei gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname. + + + Ein Vorschlag, wie Sie Dateinamen zum Speichern der Nachrichtennutzlasten erstellen, der verwendet werden soll, wenn die Entitäten getrennt und in separaten Dateien gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname des Formulardateinamens*. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Datum der letzten Dateiänderung. + Gibt zurück.Das Änderungsdatum der Datei. + + + Der Name für einen Inhaltstextteil. + Gibt zurück.Der Name des Inhaltstextteils. + + + Ein Satz von Parametern, enthalten im Content-Disposition-Header. + Gibt zurück.Eine Auflistung von Parametern. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Wertinformation des Inhaltsdisposition-Headers des Inhalts darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Inhaltsdispositionsheader. + + + Das Datum, an dem zuletzt die Datei gelesen wurde. + Gibt zurück.Das letzte gelesene Datum. + + + Die ungefähre Größe der aktuellen Datei in Bytes. + Gibt zurück.Die ungefähre Größe in Bytes. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Range-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob für den Inhaltsbereichs-Header eine Länge angegeben wurde. + Gibt zurück.true, wenn der Content-Range eine Länge angegeben hat; andernfalls false. + + + Ruft ab, ob für den Inhaltsbereich ein Bereich bestimmt wurde. + Gibt zurück.true, wenn der Content-Range einen Bereich angegeben hat; andernfalls false. + + + Ruft die Länge des vollständigen Entitätstexts ab. + Gibt zurück.Die Länge des vollständigen Entitätstexts. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Informationen des Inhaltsbereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Inhaltsbereich-Headerwert. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Die verwendeten Bereichseinheiten. + Gibt zurück.Ein , das Bereichseinheiten enthält. + + + Stellt einen Entitätstag-Headerwert dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + Ein Wert, der angibt, ob dieser Entitätstagheader ein schwaches Validierungssteuerelement ist.Wenn der Entitätstagheader ein schwaches Validierungssteuerelement ist, sollte auf true festgelegt werden.Wenn der Entitätstagheader ein starkes Validierungssteuerelement ist, sollte auf false festgelegt werden. + + + Ruft den Entitätstagheaderwert ab. + Gibt zurück. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob dem Entitätstag ein Schwächeindikator vorangestellt ist. + Gibt zurück.true, wenn das Entitätstag durch einen Schwächeindikator vorangestellt wird; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Entitätstag-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Entitätstag-Headerwert dar. + + + Ruft die nicht transparente Zeichenfolge in Anführungszeichen ab. + Gibt zurück.Eine nicht transparente Zeichenfolge in Anführungszeichen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt die Auflistung von Inhaltsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Allow-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Allow-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + + + Eine Sammlung von Headern und deren Werten, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + + + Fügt den angegebenen Header und seine Werte in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Eine Liste von Headerwerten, die der Sammlung hinzugefügt werden sollen. + + + Fügt den angegebenen Header und den Wert in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Entfernt alle Header aus der -Auflistung. + + + Gibt zurück, ob ein bestimmter Header in der -Auflistung vorhanden ist. + Gibt zurück.true, wenn der angegebene Header in der Auflistung vorhanden ist, andernfalls false. + Der spezielle Header. + + + Gibt einen Enumerator zurück, der die -Instanz durchlaufen kann. + Gibt zurück.Ein Enumerator für das . + + + Gibt alle Headerwerte für einen angegebenen Header zurück, der in der -Auflistung gespeichert wird. + Gibt zurück.Ein Array von Headerzeichenfolgen. + Der angegebene Header, für den Werte zurückgegeben werden sollen. + + + Entfernt den angegebenen Header aus der -Auflistung. + Gibt zurück. + Der Name des Headers, der aus der Auflistung entfernt werden soll. + + + Ruft einen Enumerator ab, der eine durchlaufen kann. + Gibt zurück.Eine Instanz einer -Implementierung, die eine durchlaufen kann. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Werte zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Die Werte des Headers. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Wert zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Zurückgeben, ob ein angegebener Header und angegebene Werte in der -Auflistung gespeichert sind. + Gibt zurück.true, wenn der angegebene Header und values in der Auflistung gespeichert sind; andernfalls false. + Der angegebene Header. + Die angegebenen Headerwerte. + + + Stellt eine Auflistung von Headerwerten dar. + Der Headerauflistungs-Typ. + + + Fügt der einen Eintrag hinzu. + Das Element, das der Headerauflistung hinzugefügt werden soll. + + + Entfernt sämtliche Einträge aus dem . + + + Bestimmt, ob der ein Element enthält. + Gibt zurück.true, wenn dar Eintrag in der Instanz enthalten ist, andernfalls false. + Das Element, das in der Headerauflistung gefunden werden soll. + + + Kopiert die gesamte in ein kompatibles eindimensionales , beginnend am angegebenen Index des Zielarrays. + Das eindimensionale , das das Ziel der aus der kopierten Elemente ist.Für das muss eine nullbasierte Indizierung verwendet werden. + Der nullbasierte Index im , bei dem der Kopiervorgang beginnt. + + + Ruft die Anzahl der Header im ab. + Gibt zurück.Die Anzahl der Header in einer Auflistung. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Ruft einen Wert ab, der angibt, ob das -Instanz schreibgeschützt ist. + Gibt zurück.true, wenn die -Instanz schreibgeschützt ist, andernfalls false. + + + Analysiert und fügt einen Eintrag hinzu. + Der hinzuzufügende Eintrag + + + Entfernt das angegebene Element aus . + Gibt zurück.true, wenn der erfolgreich aus der Instanz entfernt wurde, andernfalls false. + Das zu entfernende Element. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob die Eingabe analysiert und zu hinzugefügt werden kann. + Gibt zurück.true, wenn analysiert und zu Instanz hinzugefügt werden kann; andernfalls false + Der zu überprüfende Eintrag. + + + Stellt die Auflistung von Anforderungsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Charset-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Charset-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Language-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Language-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Authorization-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Connection-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Anforderung "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Expect-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Expect-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Expect-Header für eine HTTP-Anforderung "Continue" enthält. + Gibt zurück.true, wenn der Expect-Header "Fortfahren" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des From-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des From-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Host-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Host-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des If-Match-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + + + Übernimmt oder bestimmt den Wert des If-Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Referer-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Referer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des TE-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des TE-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Anforderung "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des User-Agent-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des User-Agent-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Via-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Warning-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Anforderung. + + + Stellt die Auflistung von Antwortheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Ranges-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Accept-Ranges-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Age-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Age-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Connection-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Antwort "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des ETag-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des ETag-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Location-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Location-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Retry-After-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Retry-After-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Server-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Server-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Antwort "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Vary-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Vary-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Via-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Warning-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Antwort. + + + Ruft den Wert des WWW-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des WWW-Authenticate-Headers für eine HTTP-Antwort. + + + Stellt einen Medientyp dar, der in einem Inhaltstypheader verwendet wird, wie im RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Die Quelle, die als Zeichenfolge dargestellt wird, um die neue Instanz zu initialisieren. + + + Ruft den Zeichensatz ab oder legt ihn fest. + Gibt zurück.Der Zeichensatz. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Wert des Medientyp-Headers ab oder legt ihn fest. + Gibt zurück.Der Medientyp-Headerwert. + + + Ruft die Titelwertparameter des Medientyps ab oder legt diese fest. + Gibt zurück.Die Medientyp-Headerwertparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Medientyp-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Medientyp-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Medientyp mit einem zusätzlichen Qualitätsfaktor dar, der in einem Inhaltstypheader verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + Die Qualität dieses zugeordneten Headerwert. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Medientyp mit Qualitätsheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Medientyp mit Qualitätsheaderwertinformationen. + + + Abrufen oder Festlegen des Qualitätswerts für . + Gibt zurück.Der Qualitätswert für das Objekt . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt ein Name-Wert-Paar dar, das in verschiedenen Headern verwendet wird, die in RFC 2616 definiert sind. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Headernamen ab. + Gibt zurück.Der Headername. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Namenswert-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Namenswert-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Headerwert ab. + Gibt zurück.Der Headerwert. + + + Stellt ein Name-Wert-Paar mit Parametern dar, das in verschiedenen Headern verwendet wird, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Parameter vom -Objekt ab. + Gibt zurück.Eine Auflistung, die die Parameter enthält. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Namenswert mit Parameterheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Namenswert mit Parameterheaderwertinformationen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Produkttokenwert in einem User-Agent-Header dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktname. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Namen des Produkttoken ab. + Gibt zurück.Der Name des Produkttoken. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produkt-Headerwerts darstellt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Version des Produkttoken ab. + Gibt zurück.Die Version des Produkttoken. + + + Stellt einen Wert dar, der entweder ein Produkt oder ein Kommentar in einem Benutzer-Agent-Header sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Kommentarwert. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Ruft den Kommentar vom -Objekt ab. + Gibt zurück.Der Kommentarwert dieses . + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produktinfo-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Produktinfo-Headerwert dar. + + + Ruft das Produkt vom -Objekt ab. + Gibt zurück.Der Produktwert von diesem . + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen If-Range-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Entitätstag-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Datumswert für die Initialisierung der neuen -Instanz. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Entitätstag, dargestellt als Zeichenfolge, der verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum aus dem Objekt ab. + Gibt zurück.Das Datum aus dem -Objekt. + + + Ruft das Entitätstag vom -Objekt ab. + Gibt zurück.Das Entitätstag vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichsbedingung-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereichsbedingung-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem Bytebereich. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereich-Headerwert. + + + Ruft die Bereiche ab, die vom -Objekt angegeben sind. + Gibt zurück.Die Reichweiten vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Einheit vom -Objekt ab. + Gibt zurück.Die Einheit vom -Objekt. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt einen Retry-After-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Zeitspannen-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Der Datum und Zeit Offset, der zum Initialisieren der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Das Delta, in Sekunden, das verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum und Uhrzeit-Offset vom aktuellen -Objekt ab. + Gibt zurück.Das Datum und Uhrzeit-Offset vom aktuellen -Objekt. + + + Ruft das Delta in Sekunden vom -Objekt ab. + Gibt zurück.Das Delta in Sekunden vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Wiederholungsbedingung darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für den Headerwert für die Wiederholungsbedingung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Zeichenfolgenheaderwert mit einer optionalen Qualität dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Qualitätsfaktor für die Initialisierung der neuen -Instanz. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Qualitäts-Headerwerts darstellt. + + ist ein null-Verweis. + + ist eine ungültige Zeichenfolge mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor vom -Objekt ab. + Gibt zurück.Der Qualitätsfaktor vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Zeichenfolgewert aus dem -Objekt ab. + Gibt zurück.Der Zeichenfolgewert aus dem -Objekt. + + + Stellt einen Headerwert zum Akzeptieren von Codierung dar. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Übertragungs-Codierungs-Parameter ab. + Gibt zurück.Die Übertragungscodierungsparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Übertragungscodierung darstellt. + + ist ein null-Verweis. + + ist kein ungültige Information für einen Übertragungscodierungs-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Übertragungscodierungswert ab. + Gibt zurück.Der Übertragungscodierungswert. + + + Stellt einen Accept-Encoding-Headerwert mit optionalem Qualitätsfaktor dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Wert für den Qualitätsfaktor. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Übertragungscodierungswerts darstellt. + + ist ein null-Verweis. + + ist ein ungültige Übertragungscodierung mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor von ab. + Gibt zurück.Der Qualitätsfaktor von . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Via-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Ruft das Befehlsfeld ab, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + Gibt zurück.Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Bestimmt, ob das angegebene -Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Gibt einen Hashcode für das aktuelle Objekt zurück. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Via-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Via-Headerwert. + + + Ruft den Protokollnamen des empfangenen Protokolls ab. + Gibt zurück.Der Protokollname. + + + Ruft die Protokollversion des empfangenen Protokolls ab. + Gibt zurück.Die Protokollversion. + + + Ruft den Host und Port ab, von der die Anforderung oder Antwort empfangen wurden. + Gibt zurück.Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Warnwert dar, der vom Warn-Header verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + Der Datum/Uhrzeit-Stempel der Warnung. + + + Ruft den Host ab, der die Warnung angehängt hat. + Gibt zurück.Der Host, der die Warnung angehängt hat. + + + Ruft den spezifischen Warncode ab. + Gibt zurück.Der spezifische Warncode. + + + Ruft den Datum-/Uhrzeit-Stempel der Warnung ab. + Gibt zurück.Der Datum/Uhrzeit-Stempel der Warnung. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt eine -Instanz zurück. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft eine Zeichenfolge in Anführungszeichen ab, die den Warnungstext enthält. + Gibt zurück.Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/es/a b/src/packages/System.Net.Http.4.3.1/ref/net46/es/a new file mode 100644 index 00000000000..dad879d5f34 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/es/a @@ -0,0 +1,2322 @@ + + + + System.Net.Http + + + + Proporciona contenido HTTP basado en una matriz de bytes. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El valor del parámetro es null. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El desplazamiento, en bytes, del parámetro de usado para inicializar . + El número de bytes de a partir del parámetro de usado para inicializar . + El valor del parámetro es null. + El parámetro es menor que cero.O bienEl parámetro es mayor que la longitud del contenido que especifica el parámetro .O bienEl parámetro es menor que cero.O bienEl valor del parámetro es mayor que la longitud del contenido que especifica menos el parámetro . + + + Crea una secuencia de contenido HTTP como una operación asincrónica para lectura cuya memoria auxiliar es memoria procedente del objeto . + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Serialice y escriba la matriz de bytes proporcionada en el constructor en una secuencia de contenido HTTP como operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte, como el token de enlace de canal.Este parámetro puede ser null. + + + Determina si una matriz de bytes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes de la matriz. + + + Especifica cómo se proporcionan los certificados de cliente. + + + + intentará proporcionar automáticamente todos los certificados de cliente disponibles. + + + La aplicación proporciona manualmente los certificados de cliente a .Este valor es el predeterminado. + + + Un tipo para los controladores HTTP que delegan el procesamiento de los mensajes de respuesta HTTP a otro controlador, denominado controlador interno. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Libera los recursos no administrados que utiliza el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el controlador interno que procesa los mensajes de respuesta HTTP. + Devuelve .Controlador interno para los mensajes de respuesta HTTP. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Contenedor para las tuplas de nombre-valor codificadas mediante el tipo MIME de application/x-www-form-urlencoded. + + + Inicializa una nueva instancia de la clase con una colección específica de pares de nombre y valor. + Colección de pares de nombre-valor. + + + Proporciona una clase base para enviar solicitudes HTTP y recibir respuestas HTTP de un recurso identificado por un URI. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un controlador específico. + Pila de controlador HTTP que se va a usar para enviar solicitudes. + + + Inicializa una nueva instancia de la clase con un controlador específico. + + responsable de procesar los mensajes de respuesta HTTP. + Es true si Dispose() debe desechar el controlador interno; es false si piensa reutilizar el controlador interno. + + + Obtiene o establece la dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + Devuelve .La dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + + + Cancela todas las solicitudes pendientes en esta instancia. + + + Obtiene los encabezados que se deben enviar con cada solicitud. + Devuelve .Encabezados que se deben enviar con cada solicitud. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar tanto recursos administrados como no administrados; es false para liberar únicamente recursos no administrados. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Obtiene o establece el número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta. + Devuelve .Número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta.El valor predeterminado de esta propiedad es 2 gigabytes. + El tamaño especificado es menor o igual que cero. + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Obtiene o establece el tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + Devuelve .El tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + El tiempo de espera especificado es menor o igual que cero y no es . + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Controlador de mensajes predeterminado usado por . + + + Cree una instancia de una clase . + + + Obtiene o establece un valor que indica si el controlador debe seguir las respuestas de redirección. + Devuelva .true si el controlador debe seguir las respuestas de redirección; si no false.El valor predeterminado es true. + + + Obtiene o establece el tipo de método de descompresión utilizado por el controlador para la descompresión automática de la respuesta de contenido HTTP. + Devuelva .El método de descompresión automática utilizado por el controlador.El valor predeterminado es . + + + Obtiene o establece la colección de certificados de seguridad asociados a este controlador. + Devuelva .Colección de certificados de seguridad asociados a este controlador. + + + Obtiene o establece el contenedor de cookies que el controlador usa para almacenar cookies del servidor. + Devuelva .Contenedor de cookies que el controlador usa para almacenar cookies del servidor. + + + Obtiene o establece la información de autenticación utilizada por este controlador. + Devuelva .Credenciales de autenticación asociadas con el controlador.El valor predeterminado es null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el número máximo de redirecciones que seguirá el controlador. + Devuelva .El número máximo de respuestas de redirección que seguirá el controlador.El valor predeterminado es 50. + + + Obtiene o establece el tamaño máximo del búfer de contenido de solicitud usado por el controlador. + Devuelva .Tamaño máximo de búfer de contenido de la solicitud en bytes.El valor predeterminado es 2 gigabytes. + + + Obtiene o establece un valor que indica si el controlador envía un encabezado de autorización con la solicitud. + Devuelva .Es true para que el controlador envíe un encabezado de autorización HTTP con las solicitudes después de que tenga lugar la autenticación; de lo contrario, es false.El valor predeterminado es false. + + + Obtiene o establece la información de proxy que usa el controlador. + Devuelva .La información de proxy que usará el controlador.El valor predeterminado es null. + + + Crea una instancia de basándose en la información proporcionada en el objeto como una operación que no se bloqueará. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Obtiene un valor que indica si el controlador admite la descompresión automática del contenido de la respuesta. + Devuelva .true si el controlador admite la descompresión automática del contenido de la respuesta; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite valores de proxy. + Devuelva .true si el controlador admite valores de proxy; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite opciones de configuración para las propiedades y . + Devuelva .true si el controlador admite las opciones de configuración para las propiedades y ; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que indica si el controlador utiliza la propiedad para almacenar las cookies de servidor y utiliza estas cookies al enviar solicitudes. + Devuelva .true si el controlador admite el uso de la propiedad para almacenar las cookies de servidor y usa estas cookies al enviar solicitudes; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que controla si se envían las credenciales predeterminadas con las solicitudes del controlador. + Devuelva .Es true si se utilizan las credenciales predeterminadas; en cualquier otro caso, es false.El valor predeterminado es false. + + + Obtiene o establece un valor que indica si el controlador usa un proxy para las solicitudes. + Devuelva .true si el controlador debe usar un servidor proxy para las solicitudes; si no false.El valor predeterminado es true. + + + Indica si las operaciones de se consideran completadas cualquiera tan pronto como una respuesta esté disponible o después de leer el mensaje de respuesta completo, incluido el contenido. + + + La operación debe completarse después de leer toda la respuesta incluido el contenido. + + + La operación debe completarse tan pronto como haya una respuesta disponible y se lean los encabezados.El contenido no se ha leído aún. + + + Una clase base que representa un cuerpo de entidad y encabezados de contenido HTTP. + + + Inicializa una nueva instancia de la clase . + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Serializa el contenido HTTP en una secuencia de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene los encabezados de contenido HTTP tal como se define en RFC 2616. + Devuelva .Encabezados de contenido como se define en RFC 2616. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + El tamaño máximo, en bytes, del búfer que se va a utilizar. + + + Serializa el contenido HTTP en una matriz de bytes como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializar el contenido HTTP y devolver una secuencia que representa el contenido como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una cadena como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido HTTP tiene una longitud válida en bytes. + Devuelva .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Tipo base para los controladores de mensajes HTTP. + + + Inicializa una nueva instancia de la clase . + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase especializada que permite que las aplicaciones llamen al método en una cadena de controlador HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + true si Dispose() debe desechar el controlador interno,false si piensa reutilizar el controlador interno. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase auxiliar para recuperar y comparar métodos HTTP estándar y para crear nuevos métodos HTTP. + + + Inicializa una instancia nueva de la clase con un método HTTP específico. + Método HTTP. + + + Representa un método de protocolo HTTP DELETE. + Devuelva . + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Método HTTP que se va a comparar con el objeto actual. + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Objeto que se va a comparar con el objeto actual. + + + Representa un método de protocolo HTTP GET. + Devuelva . + + + Actúa como función hash para este tipo. + Devuelva .Código hash para el objeto actual. + + + Representa un método de protocolo HTTP HEAD.El método HEAD es idéntico a GET, excepto que el servidor sólo devuelve los encabezados de mensaje en la respuesta, sin el cuerpo del mensaje. + Devuelva . + + + Un método HTTP. + Devuelva .Un método HTTP representado como . + + + Operador de igualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados son iguales; en caso contrario, es false. + + izquierdo para un operador de igualdad. + + derecho para un operador de igualdad. + + + Operador de desigualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados no son iguales; en caso contrario, es false. + + izquierdo para un operador de desigualdad. + + derecho para un operador de desigualdad. + + + Representa un método de protocolo HTTP OPTIONS. + Devuelva . + + + Representa un método de protocolo POST HTTP, utilizado para enviar una entidad nueva como adición a un identificador URI. + Devuelva . + + + Representa un método de protocolo HTTP PUT, utilizado para reemplazar una entidad identificada por un identificador URI. + Devuelva . + + + Devuelve una cadena que representa el objeto actual. + Devuelva .Cadena que representa el objeto actual. + + + Representa un método de protocolo HTTP TRACE. + Devuelva . + + + Una clase base para las excepciones que producen las clases y . + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual. + Mensaje que describe la excepción actual. + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual y una excepción interna. + Mensaje que describe la excepción actual. + Excepción interna. + + + Representa un mensaje de solicitud HTTP. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Cadena que representa el objeto de solicitud. + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Objeto que se va a solicitar. + + + Obtiene o establece el contenido del mensaje HTTP. + Devuelve .Contenido de un mensaje. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene la colección de encabezados de la solicitud HTTP. + Devuelve .Colección de encabezados de la solicitud HTTP. + + + Obtiene o establece el método HTTP usado por el mensaje de solicitud HTTP. + Devuelve .Método HTTP usado por el mensaje de solicitud.El valor predeterminado es el método GET. + + + Obtiene un conjunto de propiedades de la solicitud HTTP. + Devuelve . + + + Obtiene o establece el usado para la solicitud HTTP. + Devuelve . que se usa para la solicitud HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Representa un mensaje de respuesta HTTP incluido el código de estado y los datos. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una instancia nueva de la clase con un específico. + Código de estado de la respuesta HTTP. + + + Obtiene o establece el contenido de texto de un mensaje de respuesta HTTP. + Devuelve .Contenido del mensaje de respuesta HTTP. + + + Libera los recursos no administrados y desecha los recursos no administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Se produce una excepción si la propiedad para la respuesta HTTP es false. + Devuelve .Mensaje de respuesta HTTP si la llamada es correcta. + + + Obtiene la colección de encabezados de respuesta HTTP. + Devuelve .Colección de encabezados de respuesta HTTP. + + + Obtiene un valor que indica si la respuesta HTTP se realizó correctamente. + Devuelve .Un valor que indica si la respuesta HTTP se realizó correctamente.true si estaba en el intervalo 200-299; si no false. + + + Obtiene o establece la frase de razón que envían normalmente los servidores junto con el código de estado. + Devuelve .La frase de la razón enviada por el servidor. + + + Obtiene o establece el mensaje de solicitud que condujo a este mensaje de respuesta. + Devuelve .El mensaje de solicitud que condujo a este mensaje de respuesta. + + + Obtiene o establece el código de estado de la respuesta HTTP. + Devuelve .Código de estado de la respuesta HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Un tipo base para los controladores que solo realizan un pequeño procesamiento de mensajes de solicitud y/o de respuesta. + + + Cree una instancia de una clase . + + + Crea una instancia de una clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Realiza el procesamiento en cada solicitud enviada al servidor. + Devuelve .Mensaje de solicitud HTTP que se procesó. + Mensaje de la solicitud HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Realiza el procesamiento en cada respuesta del servidor. + Devuelve .Mensaje de respuesta HTTP que se procesó. + Mensaje de respuesta HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El valor de era null. + + + Proporciona una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + + era null o solo contiene caracteres de espacios en blanco. + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + La cadena delimitadora para el contenido con varias partes. + + era null o una cadena vacía. era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agregue contenido con varias partes HTTP a una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Devuelve un enumerador que recorre en iteración la colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Serialice el contenido HTTP con varias partes en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Implementación explícita del método . + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Determina si el contenido HTTP con varias partes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Proporciona un contenedor para contenido codificado mediante el tipo MIME multipart/form-data. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + La cadena delimitadora para el contenido de los datos de formulario con varias partes. + + era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + + era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + Nombre del archivo para el contenido HTTP se va a agregar a la colección. + + era null o solo contiene caracteres de espacios en blanco.O bien era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Proporciona contenido HTTP basado en una secuencia. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Tamaño del búfer, en bytes, para . + El valor de era null. + + era menor o igual que cero. + + + Escribe el contenido de una secuencia HTTP en una secuencia de memoria como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido de la secuencia tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes del contenido de la secuencia. + + + Proporciona contenido HTTP basado en una cadena. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + Tipo de medio que se va a utilizar para el contenido. + + + Representa la información de autenticación en los valores de los encabezados Authorization, ProxyAuthorization, WWW-Authenticate y Proxy-Authenticate. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + Credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene las credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + Devuelve .Credenciales que contienen la información de autenticación. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene el esquema que se va a usar para la autorización. + Devuelve .El esquema que se va a usar para la autorización. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Cache-Control. + + + Inicializa una nueva instancia de la clase . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Tokens de extensión de caché, cada uno con un valor asignado opcional. + Devuelve .Colección de tokens de la extensión de memoria caché, cada uno con un valor asignado opcional. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Edad máxima, especificada en segundos, que el cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta que ha superado la fecha de expiración; si no, false. + + + Tiempo máximo, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .Tiempo en segundos. + + + Duración de la actualización, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta; si no, false. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “no-cache” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta. + Devuelve .true si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta; si no, false. + + + Si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad. + Devuelve .true si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad; si no, false. + + + Si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace). + Devuelve .true si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace); si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información no válida del valor de encabezado cache-control. + + es una referencia null. + + no es información válida del valor del encabezado de control de caché. + + + Si todo o parte del mensaje de respuesta HTTP está diseñado para un único usuario y no se debe almacenar en una memoria caché compartida. + Devuelve .true si el mensaje de respuesta HTTP está pensado para un único usuario y una memoria caché compartida no lo debe almacenar en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “privada” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta para memorias caché compartidas de agente de usuario. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta para memorias caché compartidas de agente de usuario; si no, false. + + + Si cualquier memoria caché puede almacenar una respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida. + Devuelve .true si cualquier memoria caché puede almacenar la respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida; si no, false. + + + La edad máxima compartida, especificada en segundos, en una respuesta HTTP que reemplaza la directiva de "max-age" en un encabezado cache-control o un encabezado Expires para una memoria caché compartida. + Devuelve .Tiempo en segundos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Disposition. + + + Inicializa una nueva instancia de la clase . + + . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Fecha y hora de creación del archivo. + Devuelve .Fecha de creación del archivo. + + + Tipo de disposición para una parte del cuerpo de contenido. + Devuelve .Tipo de disposición. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sugerencia sobre cómo crear un nombre de archivo para almacenar la carga del mensaje que se usará si la entidad se desasocia y se almacena un en archivo independiente. + Devuelve .Nombre de archivo sugerido. + + + Sugerencia sobre cómo crear un nombres de archivo para almacenar cargas de mensajes que se usará si las entidades se desasocian y se almacenan en un archivo independiente. + Devuelve .Nombre de archivo sugerido de filename* del formulario. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Fecha y hora de la última modificación del archivo. + Devuelve .Fecha de modificación del archivo. + + + Nombre de una parte del cuerpo de contenido. + Devuelve .Nombre de la parte del cuerpo de contenido. + + + Conjunto de parámetros incluidos el encabezado de Content-Disposition. + Devuelve .Colección de parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de disposición del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de disponibilidad de contenido. + + + Fecha en que se leyó el archivo por última vez. + Devuelve .Última fecha de lectura. + + + Tamaño aproximado del archivo en bytes. + Devuelve .Tamaño aproximado en bytes. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Range. + + + Inicializa una nueva instancia de la clase . + Punto inicial o final del intervalo, en bytes. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + Punto inicial o final del intervalo, en bytes. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición, en bytes, en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si el encabezado de Content-Range tiene una longitud especificada. + Devuelve .true si Content-Range tiene una longitud especificada; si no, false. + + + Obtiene si el Content-Range tiene un intervalo especificado. + Devuelve .true si Content-Range tiene un intervalo especificado; si no, false. + + + Obtiene la longitud del cuerpo de entidad completo. + Devuelve .La longitud del cuerpo de entidad completo. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de intervalo del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo del contenido. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Las unidades de intervalo usadas. + Devuelve . que contiene unidades de intervalo. + + + Representa un valor de encabezado de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + Un valor que indica si este encabezado de la etiqueta de entidad es un validador débil.Si el encabezado de la etiqueta de entidad es un validador débil, debe establecerse en true.Si el encabezado de la etiqueta de entidad es un validador seguro, debe establecerse en false. + + + Obtiene el valor del encabezado de la etiqueta de entidad. + Devuelve . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si la etiqueta de entidad es precedida por un indicador de punto débil. + Devuelve .true si la etiqueta de entidad va precedida por un indicador de punto débil; si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la etiqueta de entidad. + + es una referencia null. + + no es información válida del valor del encabezado de la etiqueta de entidad. + + + Obtiene la cadena entre comillas opaca. + Devuelve .Una cadena entrecomillada opaca. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa la colección de encabezados de contenido tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado de contenido Allow en una respuesta HTTP. + Devuelve .Valor del encabezado Allow en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Language en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Language en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Length en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Length en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Location en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Location en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Range en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Range en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Type en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Type en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Expires en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Expires en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Last-Modified en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Last-Modified en una respuesta HTTP. + + + Colección de encabezados y sus valores como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + + + Agrega el encabezado especificado y sus valores en la colección . + Encabezado que se agrega a la colección. + Lista de valores de encabezado que se agregan a la colección. + + + Agrega el encabezado especificado y su valor en la colección . + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Quita todos los encabezados de la colección de . + + + Devuelve si un encabezado concreto existe en la colección de . + Devuelve .true si el encabezado especificado existe en la colección; en caso contrario, false. + El encabezado específico. + + + Devuelve un enumerador que puede recorrer en iteración la instancia de . + Devuelve .Enumerador para . + + + Devuelve todos los valores de un encabezado especificado almacenado en la colección de . + Devuelve .Matriz de cadenas de encabezado. + El encabezado especificado para el que se van a devolver valores. + + + Quita el encabezado especificado de la colección de . + Devuelve . + Nombre del encabezado que se quitará de la colección. + + + Obtiene un enumerador que puede recorrer en iteración un objeto . + Devuelve .Una instancia de una implementación de que puede recorrer en iteración un objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Devuelve un valor que indica si el encabezado especificado y sus valores se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Valores del encabezado. + + + Devuelve un valor que indica si el encabezado especificado y su valor se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Se devuelve si un encabezado y determinados valores especificados se almacenan en la colección . + Devuelve .true es el de encabezado especificado y values se almacenan en la colección; si no false. + Encabezado especificado. + Valores de encabezado especificados. + + + Representa una colección de valores de encabezado. + Tipo de colección de encabezado. + + + Agrega una entrada al objeto . + Elemento que se agrega al encabezado especificada. + + + Quita todas las entradas de . + + + Determina si contiene un elemento. + Devuelve .true si la entrada está contenida en la instancia ; en caso contrario, false + Elemento para encontrar el encabezado especificada. + + + Copia la totalidad de en una matriz unidimensional compatible, comenzando en el índice especificado de la matriz de destino. + + unidimensional que constituye el destino de los elementos copiados de . debe tener una indización de base cero. + Índice de base cero de en el que empieza la operación de copia. + + + Obtiene el número de encabezados de la colección . + Devuelve .Número de encabezados de una colección. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Obtiene un valor que indica si la instancia de es de solo lectura. + Devuelve .true si la instancia de es de sólo lectura; en caso contrario, false. + + + Analiza y agrega una entrada a . + Entrada que se va a agregar. + + + Quita el elemento especificado de . + Devuelve .true si se ha quitado de la instancia ; en caso contrario, false. + Elemento que se va a quitar. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Devuelve una cadena que representa el objeto actual . + Devuelve .Cadena que representa el objeto actual. + + + Determina si la entrada se puede analizar y agregar a . + Devuelve .true si se puede analizar y agregar a la instancia ; de lo contrario, false + Entrada que se va a validar. + + + Representa la colección de encabezados de solicitud tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept para una solicitud HTTP. + Devuelve .Valor del encabezado Accept para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Charset para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Charset para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Encoding para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Language para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Language para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una solicitud HTTP. + Devuelve .Valor del encabezado Cache-Control para una solicitud HTTP. + + + Obtiene el valor del encabezado Connection para una solicitud HTTP. + Devuelve .Valor del encabezado Connection para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una solicitud HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una solicitud HTTP. + Devuelve .Valor del encabezado Date para una solicitud HTTP. + + + Obtiene el valor del encabezado Expect para una solicitud HTTP. + Devuelve .Valor del encabezado Expect para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Expect para una solicitud HTTP contiene Continuar. + Devuelve .true si el encabezado Expect contiene Continue, si no false. + + + Obtiene o establece el valor del encabezado From para una solicitud HTTP. + Devuelve .Valor del encabezado From para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Host para una solicitud HTTP. + Devuelve .Valor del encabezado Host para una solicitud HTTP. + + + Obtiene el valor del encabezado If-Match para una solicitud HTTP. + Devuelve .Valor del encabezado If-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Modified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Modified-Since para una solicitud HTTP. + + + Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + Devuelve .Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Range para una solicitud HTTP. + Devuelve .Valor del encabezado If-Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Unmodified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Unmodified-Since para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Max-Forwards para una solicitud HTTP. + Devuelve .Valor del encabezado Max-Forwards para una solicitud HTTP. + + + Obtiene el valor del encabezado Pragma para una solicitud HTTP. + Devuelve .Valor del encabezado Pragma para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Proxy-Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Proxy-Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Range para una solicitud HTTP. + Devuelve .Valor del encabezado Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Referer para una solicitud HTTP. + Devuelve .Valor del encabezado Referer para una solicitud HTTP. + + + Obtiene el valor del encabezado TE para una solicitud HTTP. + Devuelve .Valor del encabezado TE para una solicitud HTTP. + + + Obtiene el valor del encabezado Trailer para una solicitud HTTP. + Devuelve .Valor del encabezado Trailer para una solicitud HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una solicitud HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una solicitud HTTP. + Devuelve .Valor del encabezado Upgrade para una solicitud HTTP. + + + Obtiene el valor del encabezado User-Agent para una solicitud HTTP. + Devuelve .Valor del encabezado User-Agent para una solicitud HTTP. + + + Obtiene el valor del encabezado Via para una solicitud HTTP. + Devuelve .Valor del encabezado Via para una solicitud HTTP. + + + Obtiene el valor del encabezado Warning para una solicitud HTTP. + Devuelve .Valor del encabezado Warning para una solicitud HTTP. + + + Representa la colección de encabezados de respuesta tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept-Ranges para una respuesta HTTP. + Devuelve .Valor del encabezado Accept-Ranges para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Age para una respuesta HTTP. + Devuelve .Valor del encabezado Age para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una respuesta HTTP. + Devuelve .Valor del encabezado Cache-Control para una respuesta HTTP. + + + Obtiene el valor del encabezado Connection para una respuesta HTTP. + Devuelve .Valor del encabezado Connection para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una respuesta HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una respuesta HTTP. + Devuelve .Valor del encabezado Date para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado ETag para una respuesta HTTP. + Devuelve .Valor del encabezado ETag para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Location para una respuesta HTTP. + Devuelve .Valor del encabezado Location para una respuesta HTTP. + + + Obtiene el valor del encabezado Pragma para una respuesta HTTP. + Devuelve .Valor del encabezado Pragma para una respuesta HTTP. + + + Obtiene el valor del encabezado Proxy-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado Proxy-Authenticate para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Retry-After para una respuesta HTTP. + Devuelve .Valor del encabezado Retry-After para una respuesta HTTP. + + + Obtiene el valor del encabezado Server para una respuesta HTTP. + Devuelve .Valor del encabezado Server para una respuesta HTTP. + + + Obtiene el valor del encabezado Trailer para una respuesta HTTP. + Devuelve .Valor del encabezado Trailer para una respuesta HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una respuesta HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una respuesta HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una respuesta HTTP. + Devuelve .Valor del encabezado Upgrade para una respuesta HTTP. + + + Obtiene el valor del encabezado Vary para una respuesta HTTP. + Devuelve .Valor del encabezado Vary para una respuesta HTTP. + + + Obtiene el valor del encabezado Via para una respuesta HTTP. + Devuelve .Valor del encabezado Via para una respuesta HTTP. + + + Obtiene el valor del encabezado Warning para una respuesta HTTP. + Devuelve .Valor del encabezado Warning para una respuesta HTTP. + + + Obtiene el valor del encabezado WWW-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado WWW-Authenticate para una respuesta HTTP. + + + Representa un tipo de medio utilizado en un encabezado Content-Type como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El origen representado como una cadena para inicializar la nueva instancia. + + + Obtiene o define el juego de caracteres. + Devuelve .El juego de caracteres. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene o establece el valor de encabezado del tipo de medio. + Devuelve .El valor del encabezado media-type. + + + Obtiene o establece los parámetros del valor de encabezado del tipo de medio. + Devuelve .Los parámetros de valores de encabezado media-type. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del tipo de medio. + + es una referencia null. + + no es información válida del valor del encabezado del tipo de medio. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un tipo de medio con un factor de calidad adicional utilizado en un encabezado Content-Type. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + La calidad asociada a este valor de encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el tipo de medios con la información de valor de encabezado de calidad. + + es una referencia null. + + es el tipo de medio no válido con información de valor de encabezado de calidad. + + + Obtiene o establece el valor de calidad de . + Devuelve .Valor de calidad del objeto . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un par de nombre y valor utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre de encabezado. + Devuelve .Nombre del encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del valor de nombre. + + es una referencia null. + + no es información válida del valor del encabezado del valor de nombre. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de encabezado. + Devuelve .Valor del encabezado. + + + Representa un par de nombre y valor con parámetros utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros del objeto . + Devuelve .Una colección que contiene los parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el valor de nombre con la información de valor de encabezado del parámetro. + + es una referencia null. + + es un valor de nombre no válido con información de valor de encabezado de parámetro. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de token de producto en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Nombre del producto. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre del token de producto. + Devuelve .Nombre del token de producto. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del producto. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la versión del token de producto. + Devuelve .Versión del token de producto. + + + Representa un valor que puede ser un producto o un comentario en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un valor de comentario. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Obtiene el comentario del objeto . + Devuelve .El valor de comentario . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la información del producto. + + es una referencia null. + + no es información válida del valor del encabezado de la información del producto. + + + Obtiene el producto del objeto . + Devuelve .El valor de producto de este . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado If-Range que puede ser de fecha y hora o de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Un valor de datos utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una etiqueta de entidad representada como cadena utilizada para inicializar la nueva instancia. + + + Obtiene la fecha del objeto . + Devuelve .La fecha del objeto . + + + Obtiene la etiqueta de entidad del objeto . + Devuelve .La etiqueta de entidad del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de intervalo. + + es una referencia null. + + no es información del valor del encabezado de la condición de intervalo. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un intervalo de bytes. + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del intervalo. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo. + + + Obtiene los intervalos especificados en el objeto . + Devuelve .Los intervalos del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la unidad del objeto . + Devuelve .La unidad del objeto . + + + Representa un intervalo de bytes en un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Representa un valor de encabezado Retry-After que puede ser de fecha y hora o de duración. + + + Inicializa una nueva instancia de la clase . + Desplazamiento de fecha y hora utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El delta, en segundos, utilizado para inicializar la nueva instancia. + + + Obtiene el desplazamiento de fecha y hora desde el objeto . + Devuelve .Desplazamiento de fecha y hora desde el objeto . + + + Obtiene el delta en segundos del objeto . + Devuelve .El delta en segundos del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de reintento. + + es una referencia null. + + no es información válida del valor del encabezado de la condición de reintento. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado de cadena con una calidad opcional. + + + Inicializa una nueva instancia de la clase . + La cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un factor de calidad utilizado para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de calidad. + + es una referencia null. + + es una cadena no válida con información de encabezado de valor de encabezado de calidad. + + + Obtiene el factor de calidad del objeto . + Devuelve .EL factor de calidad del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de cadena del objeto . + Devuelve .El valor de cadena del objeto . + + + Representa un valor de encabezado Accept-Encoding. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros de codificación de transferencia. + Devuelve .Los parámetros de codificación de transferencia. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de codificación de transferencia. + + es una referencia null. + + no es información válida del valor del encabezado de codificación de transferencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de codificación de transferencia. + Devuelve .El valor de codificación de transferencia. + + + Representa un valor del encabezado Accept-Encoding con factor de calidad opcional. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un valor para el factor de calidad. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor de codificación de transferencia. + + es una referencia null. + + es una codificación de transferencia no válida con información de valor de encabezado de calidad. + + + Obtiene el factor de calidad de . + Devuelve .El factor de calidad de . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor de un encabezado Via. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Obtiene el campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + Devuelve .El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Devuelve un código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa a través de la información del valor del encabezado. + + es una referencia null. + + no es información válida a través de la información del valor del encabezado. + + + Obtiene el nombre de protocolo del protocolo recibido. + Devuelve .Nombre del protocolo. + + + Obtiene la versión de protocolo del protocolo recibido. + Devuelve .Versión de protocolo. + + + Obtiene el host y el puerto donde se recibió la solicitud o la respuesta. + Devuelve .El host y el puerto donde se recibió la solicitud o la respuesta. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de advertencia utilizado por el encabezado Warning. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + Marca de tiempo de la advertencia. + + + Obtiene el host que adjuntó la advertencia. + Devuelve .El host que adjuntó la advertencia. + + + Obtiene el código de la advertencia específico. + Devuelve .El código de la advertencia específico. + + + Obtiene la marca de tiempo de la advertencia. + Devuelve .Marca de tiempo de la advertencia. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve una instancia . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene una cadena entre comillas que contiene el texto de advertencia. + Devuelve .Una cadena entre comillas que contiene el texto de advertencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/fr/a b/src/packages/System.Net.Http.4.3.1/ref/net46/fr/a new file mode 100644 index 00000000000..95484975134 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/fr/a @@ -0,0 +1,2361 @@ + + + + System.Net.Http + + + + Fournit du contenu HTTP basé sur un tableau d'octets. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Le paramètre est null. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Décalage, en octets, dans le paramètre utilisé pour initialiser . + Nombre d'octets dans le en commençant par le paramètre utilisé pour initialiser . + Le paramètre est null. + Le paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre.ouLe paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre . + + + Crée un flux de contenu HTTP en tant qu'opération asynchrone pour la lecture dont le magasin de stockage est lié au . + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise et écrit le tableau d'octets fourni dans le constructeur pour un flux de contenu HTTP sous forme d'une opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport, (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si un tableau d'octets a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur, en octets, du tableau d'octets. + + + Spécifie la façon dont les certificats clients sont fournis. + + + + tentera de fournir automatiquement tous les certificats client disponibles. + + + L'application fournit manuellement les certificats clients au .Cette valeur est celle par défaut. + + + Type pour les gestionnaires HTTP qui délèguent le traitement des messages de réponse HTTP à un autre gestionnaire, appelé le gestionnaire interne. + + + Crée une instance de la classe . + + + Crée une instance de la classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Libère les ressources non managées utilisées par et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le gestionnaire interne qui traite les messages de réponse HTTP. + retourne  ;Gestionnaire interne des messages de réponse HTTP. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation pour annuler une opération. + + était null. + + + Conteneur pour les tuples nom/valeur encodés en utilisant le type MIME application/x-www-form-urlencoded. + + + Initialise une nouvelle instance de la classe avec une collection de paires nom/valeur spécifique. + Collection de paires nom/valeur. + + + Fournit une classe de base pour envoyer des requêtes HTTP et recevoir des réponses HTTP d'une ressource identifiée par un URI. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + Pile du gestionnaire HTTP à utiliser pour envoyer des demandes. + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Obtient ou définit l'adresse de base de l'URI de la ressource Internet utilisée pour envoyer des demandes. + Retourne .Adresse de base de l'URI de la ressource Internet utilisée pour l'envoi des demandes. + + + Annulez toutes les demandes en attente sur cette instance. + + + Obtient les en-têtes qui doivent être envoyés avec chaque demande. + Retourne .En-têtes qui doivent être envoyés avec chaque demande. + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Obtient ou définit le nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse. + Retourne .Nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse.La valeur par défaut de cette propriété est 2 gigaoctets. + La taille spécifiée est inférieure ou égale à zéro. + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Obtient ou définit la période d'attente jusqu'à l'expiration de la demande. + Retourne .Période d'attente jusqu'à l'expiration de la demande. + Le délai d'attente spécifié est inférieur ou égal à zéro et n'est pas . + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Gestionnaire de messages par défaut utilisé par . + + + Crée une instance d'une classe . + + + Obtient ou définit une valeur qui indique si le gestionnaire doit suivre les réponses de redirection. + retourne  ;true si le gestionnaire doit suivre les réponses de redirection ; sinon false.La valeur par défaut est true. + + + Obtient ou définit le type de méthode de décompression utilisé par le gestionnaire pour la décompression automatique de la réponse de contenu HTTP. + retourne  ;Méthode de décompression automatique utilisée par le gestionnaire.La valeur par défaut est . + + + Obtient ou définit la collection de certificats de sécurité qui sont associés à ce gestionnaire. + retourne  ;Collection de certificats de sécurité associés à ce gestionnaire. + + + Obtient ou définit le conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + retourne  ;Conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + + + Obtient ou définit les informations d'authentification utilisées par ce gestionnaire. + retourne  ;Informations d'authentification associées au gestionnaire.La valeur par défaut est null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le nombre maximal de redirections suivies par le gestionnaire. + retourne  ;Nombre maximal de réponses de redirection suivies par le gestionnaire.La valeur par défaut est 50. + + + Obtient ou définit la taille maximale de mémoire tampon de contenu demandée utilisée par le gestionnaire. + retourne  ;Taille maximale de mémoire tampon de contenu en octets.La valeur par défaut est 2 gigaoctets. + + + Obtient ou définit une valeur indiquant si le gestionnaire envoie un en-tête d'autorisation avec la requête. + retourne  ;true pour que le gestionnaire envoie un en-tête HTTP d'autorisation avec les requêtes une fois l'authentification exécutée ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit les informations de proxy utilisées par le gestionnaire. + retourne  ;Informations de proxy utilisées par le gestionnaire.La valeur par défaut est null. + + + Crée une instance de en fonction des informations fournies dans le en tant qu'opération qui ne se bloque pas. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP. + Jeton d'annulation pour annuler l'opération. + + était null. + + + Obtient une valeur qui indique si le gestionnaire prend en charge la décompression de contenu de réponse automatique. + retourne  ;true si le gestionnaire prend en charge la décompression de contenu de réponse automatique ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres du proxy. + retourne  ;true si le gestionnaire prend en charge les paramètres de proxy ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et . + retourne  ;true si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et  ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise la propriété pour stocker des cookies de serveur et utilise ces cookies en envoyant les demandes. + retourne  ;true si le gestionnaire utilise la propriété pour stocker des cookies de serveur, et utilise ces cookies lors de l'envoi de requêtes ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui contrôle si les informations d'identification par défaut sont envoyées avec les requêtes par le gestionnaire. + retourne  ;true si les informations d'identification par défaut sont utilisées ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise un proxy pour les demandes. + retourne  ;true si le gestionnaire utilise un proxy pour les demandes ; sinon false.La valeur par défaut est true. + + + Indique si les opérations doivent être considérées comme étant terminées dès qu'une réponse est disponible, ou après avoir pris connaissance de l'intégralité du message de réponse intégrant le contenu. + + + L'opération doit se terminer après la lecture de l'intégralité de la réponse intégrant le contenu. + + + L'opération doit se terminer dès qu'une réponse est disponible et que les en-têtes sont lus.Le contenu n'est pas encore lu. + + + Classe de base représentant un corps d'entité HTTP et les en-têtes de contenu. + + + Initialise une nouvelle instance de la classe . + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Sérialise le contenu HTTP dans un flux de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient les en-têtes de contenu HTTP, tels que définis dans la norme RFC 2616. + retourne  ;En-têtes de contenu, tels que définis dans RFC 2616. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Taille maximale, en octets, de la mémoire tampon à utiliser. + + + Sérialise le contenu HTTP dans un tableau d'octets sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP et retourne un flux qui représente le contenu comme une opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans une chaîne sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Type de base pour les gestionnaires de message HTTP. + + + Initialise une nouvelle instance de la classe . + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe spécialisée qui permet aux applications d'appeler la méthode sur une chaîne de gestionnaire HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe d'assistance pour récupérer et comparer les méthodes HTTP standard et pour créer de nouvelles méthodes HTTP. + + + Initialise une nouvelle instance de la classe avec une méthode HTTP spécifique. + Méthode HTTP. + + + Représente une méthode de protocole HTTP DELETE. + retourne  ; + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Méthode HTTP à comparer à l'objet actif. + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Objet à comparer avec l'objet actif. + + + Représente une méthode de protocole HTTP GET. + retourne  ; + + + Sert de fonction de hachage pour ce type. + retourne  ;Code de hachage du en cours. + + + Représente une méthode de protocole HTTP HEAD.La méthode HEAD est identique à GET, mais le serveur retourne uniquement des en-têtes de message dans la réponse, sans corps du message. + retourne  ; + + + Méthode HTTP. + retourne  ;Méthode HTTP représentée en tant que . + + + Opérateur d'égalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et sont égaux ; sinon, false. + + gauche d'un opérateur d'égalité. + + droit pour un opérateur d'égalité. + + + Opérateur d'inégalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et ne sont pas égaux ; sinon, false. + + gauche d'un opérateur d'inégalité. + + droit pour un opérateur d'inégalité. + + + Représente une méthode de protocole HTTP OPTIONS. + retourne  ; + + + Représente une méthode de protocole HTTP POST utilisée pour publier une nouvelle entité en plus d'un URI. + retourne  ; + + + Représente une méthode de protocole HTTP PUT utilisée pour remplacer une entité identifiée par un URI. + retourne  ; + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une méthode de protocole HTTP TRACE. + retourne  ; + + + Classe de base pour les exceptions levées par les classes et . + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un message spécifique qui décrit l'exception actuelle. + Message qui décrit l'exception en cours. + + + Initialise une nouvelle instance de la classe avec un message spécifique décrivant l'exception actuelle et une exception interne. + Message qui décrit l'exception en cours. + Exception interne. + + + Représente un message de requête HTTP. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + Chaîne qui représente la requête . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + + à demander. + + + Obtient ou définit le contenu du message HTTP. + retourne  ;Contenu d'un message. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient la collection d'en-têtes de requête HTTP. + retourne  ;Collection d'en-têtes de demande HTTP. + + + Obtient ou définit la méthode HTTP utilisée par le message de requête HTTP. + retourne  ;Méthode HTTP utilisée par le message de requête.La valeur par défaut est la méthode GET. + + + Obtient un ensemble de propriétés pour la requête HTTP. + retourne  ; + + + Obtient ou définit l' utilisé pour la requête HTTP. + retourne  ; utilisé pour la requête HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Représente un message de réponse HTTP avec le code et les données d'état. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un spécifique. + Code d'état de la réponse HTTP. + + + Obtient ou définit le contenu d'un message de réponse HTTP. + retourne  ;Contenu du message de réponse HTTP. + + + Libère les ressources non managées et supprime les ressources non managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Lève une exception si la propriété de la réponse HTTP est false. + retourne  ;Message de réponse HTTP si l'appel a réussi. + + + Obtient la collection d'en-têtes de réponse HTTP. + retourne  ;Collection d'en-têtes de réponse HTTP. + + + Obtient une valeur qui indique si la réponse HTTP a abouti. + retourne  ;Valeur qui indique si la réponse HTTP a abouti.true si était compris entre 200 et 299 ; sinon false. + + + Obtient ou définit l'expression de raison qui en général est envoyée par les serveurs avec le code d'état. + retourne  ;Expression de raison envoyée par le serveur. + + + Obtient ou définit le message de demande qui a conduit à ce message de réponse. + retourne  ;Message de requête qui a conduit à ce message de réponse. + + + Obtient ou définit le code d'état de la réponse HTTP. + retourne  ;Code d'état de la réponse HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Type de base pour les gestionnaires qui traitent uniquement des messages de demande et/ou de réponse. + + + Crée une instance d'une classe . + + + Crée une instance d'une classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Exécute le traitement sur chaque demande envoyée au serveur. + retourne  ;Message de requête HTTP qui a été traité. + Message de la requête HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Exécute le traitement sur chaque réponse du serveur. + retourne  ;Message de réponse HTTP qui a été traité. + Message de réponse HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Fournit une collection d'objets qui sont sérialisés à l'aide de la spécification de type de contenu multipart/*. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + La a la valeur null ou ne contient que des espaces blancs. + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + Chaîne limite pour le contenu Multipart. + Le était null ou était une chaîne vide.La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu multipart HTTP à une collection d'objets de qui sont sérialisés à l'aide de la spécification de type de contenu multipart/* + Contenu HTTP à ajouter à la collection. + + était null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Retourne un énumérateur qui itère dans la collection d'objets qui sont sérialisés à l'aide de la spécification du type de contenu multipart/*. + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Sérialise le contenu multipart HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Implémentation explicite de la méthode . + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Détermine si le contenu multipart HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Fournit un conteneur pour le contenu encodé à l'aide du type MIME multipart/form-data. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Chaîne limite pour le contenu multipart/form-data. + La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + La a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + Nom de fichier du contenu HTTP à ajouter à la collection. + La a la valeur null ou ne contient que des espaces blancs.ouLa a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Fournit du contenu HTTP basé sur un flux. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Taille, en octets, de la mémoire tampon disponible pour . + + était null. + + était inférieur ou égal à zéro. + + + Écrit le contenu de flux HTTP dans un flux de mémoire sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu de flux a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du flux de contenu. + + + Fournit du contenu HTTP basé sur une chaîne. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + Type de média à utiliser pour le contenu. + + + Représente les informations d'identification dans les valeurs d'en-tête Authorization, ProxyAuthorization, WWW-Authenticate et Proxy-Authenticate. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + Informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + retourne  ;Informations d'authentification contenant les informations d'authentification. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient le schéma à utiliser pour l'autorisation. + retourne  ;Schéma à utiliser pour l'autorisation. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Cache-Control. + + + Initialise une nouvelle instance de la classe . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Jetons d'extension en cache ayant chacun une valeur assignée facultative. + retourne  ;Collection de jetons d'extension en cache ayant chacun une valeur assignée facultative. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Durée maximale, exprimée en secondes, pendant laquelle le client HTTP est prêt à accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;true si le client HTTP est prêt à accepter une réponse ayant dépassé le délai d'attente ; sinon, false. + + + Durée maximale, en secondes, pendant laquelle un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;Durée en secondes. + + + Durée de vie d'actualisation, en secondes, pendant laquelle un client HTTP peut accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée. + retourne  ;true si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée ; sinon, false. + + + Indique si un client HTTP est prêt à accepter une réponse mise en cache. + retourne  ;true si le client HTTP est prêt à accepter une réponse mise en cache ; sinon, false. + + + Collection de fieldname dans la directive "no-cache" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si un cache ne doit stocker aucune partie du message de requête HTTP ou aucune réponse. + retourne  ;true si un cache ne doit stocker aucune partie du message de requête HTTP ou d'une réponse ; sinon, false. + + + Indique si un cache ou un proxy ne doit modifier aucun aspect du corps d'entité. + retourne  ;true si un cache ou un proxy ne doivent modifier aucun aspect du corps d'entité ; sinon, false. + + + Indique si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle). + retourne  ;true si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle) ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de contrôle de cache. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de contrôle de cache valides. + + + Indique si l'ensemble ou une partie du message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé. + retourne  ;true si le message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé ; sinon, false. + + + FieldNames de collection dans la directive "privée" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée de cache est périmée pour les caches d'agent utilisateur partagés. + retourne  ;true si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée est périmée pour les caches d'agent utilisateur partagés ; sinon, false. + + + Indique si une réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé. + retourne  ;true si la réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé ; sinon, false. + + + Âge maximal partagé, en secondes, dans une réponse HTTP qui substitue la directive « max-age » dans un en-tête de contrôle du cache ou dans un en-tête Expires d'un cache partagé. + retourne  ;Durée en secondes. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Disposition. + + + Initialise une nouvelle instance de la classe . + + + + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Date de création du fichier. + retourne  ;Date de création du fichier. + + + Type de disposition d'un élément de corps de contenu. + retourne  ;Type de disposition. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Suggestion sur la façon dont construire un Filename pour stocker la charge de message à utiliser si l'entité est détachée et stockée dans un fichier séparé. + retourne  ;Filename suggéré. + + + Suggestion sur la façon dont construire des Filenames pour stocker des charges de messages à utiliser si les entités sont détachées et stockées dans des fichiers séparés. + retourne  ;Filename suggéré du nom de fichier* de formulaire. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Date de modification du fichier. + retourne  ;Date de modification du fichier. + + + Nom d'un élément de corps de contenu. + retourne  ;Nom de l'élément de corps du contenu. + + + Un jeu de paramètres a inclus l'en-tête de Content-Disposition. + retourne  ;Collection de paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de disposition de contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de disposition de contenu valides. + + + Date de la dernière lecture du fichier. + retourne  ;Date de la dernière lecture. + + + Taille approximative du fichier, en octets. + retourne  ;Taille approximative, en octets. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Range. + + + Initialise une nouvelle instance de la classe . + Point de départ ou de fin de la plage, en octets. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + Point de départ ou de fin de la plage, en octets. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position, en octets, à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si une longueur est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la longueur de Content-Range est spécifiée ; sinon, false. + + + Obtient une valeur indiquant si une plage est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la plage de Content-Range est spécifiée ; sinon, false. + + + Obtient la longueur du corps d'entité entier. + retourne  ;Longueur du corps d'entité entier. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage du contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage de contenu valides. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Unités de plage utilisées. + retourne  ; qui contient des unités de plage. + + + Représente une valeur d'en-tête de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + Valeur qui indique si cet en-tête de balise d'entité est un validateur faible.Si l'en-tête de la balise d'entité est un validateur faible, doit avoir la valeur true.Si l'en-tête de la balise d'entité est un validateur fort, doit avoir la valeur false. + + + Obtient la valeur d'en-tête de la balise d'entité. + retourne  ; + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si la balise d'entité est précédée d'un indicateur de faiblesse. + retourne  ;true si la balise d'entité est préfacée par un indicateur de faiblesse ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de balise d'entité. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de balise d'entité valides. + + + Obtient la chaîne entre guillemets opaque. + retourne  ;Chaîne entre guillemets opaque. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la collection d'en-têtes de contenu comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête de contenu Allow sur une réponse HTTP. + retourne  ;Valeur de l'en-tête Allow sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Expires sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Expires sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + + + Collection d'en-têtes et de leurs valeurs tels que définis dans RFC 2616. + + + Initialise une nouvelle instance de la classe . + + + Ajoute l'en-tête spécifié et ses valeurs dans la collection de . + En-tête à ajouter à la collection. + Liste des valeurs d'en-tête à ajouter à la collection. + + + Ajoute l'en-tête spécifié et sa valeur dans la collection de . + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Supprime tous les en-têtes de la collection . + + + Retourne si un en-tête spécifique existe dans la collection . + retourne  ;true si l'en-tête spécifié existe dans la collection ; sinon false. + En-tête spécifique. + + + Retourne un énumérateur qui peut itérer au sein de l'instance de . + retourne  ;Énumérateur pour . + + + Retourne toutes les valeurs d'en-tête pour un en-tête spécifié stockées dans la collection . + retourne  ;Tableau de chaînes d'en-tête. + En-tête spécifié pour lequel retourner les valeurs. + + + Supprime l'en-tête spécifié de la collection . + retourne  ; + Nom de l'en-tête à supprimer de la collection. + + + Obtient un énumérateur pouvant itérer au sein de . + retourne  ;Instance d'une implémentation de pouvant itérer au sein de . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Retourne une valeur qui indique si l'en-tête spécifié et ses valeurs ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Valeur de l'en-tête. + + + Retourne une valeur qui indique si l'en-tête spécifié et sa valeur ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Retourne si un en-tête spécifié et les valeurs spécifiées sont stockés dans la collection . + retourne  ;true signifie que les en-têtes spécifiés et values sont stockés dans la collection ; sinon false. + En-tête spécifié. + Valeurs des en-têtes spécifiées. + + + Représente une collection de valeurs d'en-tête. + Type de collection d'en-têtes. + + + Ajoute une entrée à . + Élément à ajouter à la collection d'en-têtes. + + + Supprime toutes les entrées de . + + + Détermine si le contient un élément. + retourne  ;true si l'entrée contient l'instance  ; sinon, false. + Élément à rechercher dans la collection d'en-têtes. + + + Copie l'ensemble de l'objet vers un objet unidimensionnel compatible, en commençant à l'index spécifié du tableau cible. + + unidimensionnel qui constitue la destination des éléments copiés à partir d'. doit avoir une indexation de base zéro. + Index de base zéro dans à partir duquel la copie commence. + + + Obtient le nombre d'en-têtes contenus dans . + retourne  ;Nombre d'en-têtes contenus dans une collection. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Obtient une valeur indiquant si l'instance est en lecture seule. + retourne  ;true si l'instance du est en lecture seule ; sinon, false. + + + Analyse et ajoute une entrée à . + Entrée à ajouter. + + + Enlève l'élément spécifié du . + retourne  ;true si a été correctement supprimé de l'instance  ; sinon, false. + Élément à supprimer. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si l'entrée peut être analysée et ajoutée à . + retourne  ;true si peut être analysé et ajouté à l'instance . Sinon, false + Entrée à valider. + + + Représente la collection d'en-têtes de requête comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Charset pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Charset pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Encoding pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Language pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Language pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une requête HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une requête HTTP. + + + Obtient la valeur de l'en-tête Connection pour une requête HTTP. + retourne  ;Valeur de l'en-tête Connection pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une requête HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une requête HTTP. + retourne  ;Valeur de l'en-tête Date pour une requête HTTP. + + + Obtient la valeur de l'en-tête Expect pour une requête HTTP. + retourne  ;Valeur de l'en-tête Expect pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Expect pour une requête HTTP contient Continue. + retourne  ;true si l'en-tête Expect contient Continue ; sinon false. + + + Obtient ou définit la valeur de l'en-tête From pour une requête HTTP. + retourne  ;Valeur de l'en-tête From pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Host pour une requête HTTP. + retourne  ;Valeur de l'en-tête Host pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-Match pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Modified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Modified-Since pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + retourne  ;Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Max-Forwards pour une requête HTTP. + retourne  ;Valeur de l'en-tête Max-Forwards pour une requête HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une requête HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Referer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Referer pour une requête HTTP. + + + Obtient la valeur de l'en-tête TE pour une requête HTTP. + retourne  ;Valeur de l'en-tête TE pour une requête HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une requête HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une requête HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une requête HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une requête HTTP. + + + Obtient la valeur de l'en-tête User-Agent pour une requête HTTP. + retourne  ;Valeur de l'en-tête User-Agent pour une requête HTTP. + + + Obtient la valeur de l'en-tête Via pour une requête HTTP. + retourne  ;Valeur de l'en-tête Via pour une requête HTTP. + + + Obtient la valeur de l'en-tête Warning pour une requête HTTP. + retourne  ;Valeur de l'en-tête Warning pour une requête HTTP. + + + Représente la collection d'en-têtes de réponse comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Age pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Age pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Connection pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Connection pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une réponse HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Date pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête ETag pour une réponse HTTP. + retourne  ;Valeur de l'en-tête ETag pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Location pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Location pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Retry-After pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Retry-After pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Server pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Server pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une réponse HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Vary pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Vary pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Via pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Via pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Warning pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Warning pour une réponse HTTP. + + + Obtient la valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + + + Représente un type de média utilisé dans un en-tête Content-Type défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Source représentée sous forme de chaîne pour initialiser la nouvelle instance. + + + Obtient ou définit le jeu de caractères. + retourne  ;Jeu de caractères. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient ou définit la valeur de l'en-tête de type de média. + retourne  ;Valeur d'en-tête de type média. + + + Obtient ou définit les paramètres de la valeur d'en-tête de type de média. + retourne  ;Paramètres des valeurs d'en-tête de type média. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du type de média. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de type de média valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente un type de média avec une considération de qualité supplémentaire, utilisé dans un en-tête Content-Type. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + Qualité associée à cette valeur d'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente le type de média avec les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas un type de média valide avec des informations de valeur d'en-tête de qualité. + + + Obtenir ou définir le critère de qualité pour . + retourne  ;Critère de qualité pour l'objet . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une paire nom/valeur utilisée dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom de l'en-tête. + retourne  ;Nom de l'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la valeur de nom. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de valeur de nom valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de l'en-tête. + retourne  ;Valeur de l'en-tête. + + + Représente une paire nom/valeur avec des paramètres utilisés dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres de l'objet . + retourne  ;Collection contenant les paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne représentant la valeur de nom avec les informations de valeur d'en-tête de paramètre. + + est une référence null. + + n'est pas une valeur de nom valide avec des informations de valeur d'en-tête de paramètre. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur de jeton de produit dans un en-tête d'agent utilisateur. + + + Initialise une nouvelle instance de la classe . + Nom du produit. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom du jeton du produit. + retourne  ;Nom du jeton de produit. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du produit. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la version du jeton du produit. + retourne  ;Version du jeton de produit. + + + Représente une valeur qui peut être un produit ou un commentaire dans un en-tête User-Agent. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Valeur de commentaire. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Obtient le commentaire de l'objet . + retourne  ;Valeur de commentaire de ce . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête des informations. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'informations produit valides. + + + Obtient le produit de l'objet . + retourne  ;Valeur de produit de cet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête If-Range qui peut être une date, une heure ou une valeur de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Valeur de date utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Balise d'entité représentée sous forme de chaîne utilisée pour initialiser la nouvelle instance. + + + Obtient la date de l'objet . + retourne  ;Date de l'objet . + + + Obtient la balise d'entité de l'objet . + retourne  ;Balise d'entité de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de plage valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une plage d'octets. + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage valides. + + + Obtient les plages spécifiées à partir de l'objet . + retourne  ;Plages de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient l'unité de l'objet . + retourne  ;Unité de l'objet . + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une valeur d'en-tête Retry-After qui peut être une date, une heure ou une valeur TimeSpan. + + + Initialise une nouvelle instance de la classe . + Offset de la date et de l'heure utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Différentiel, en secondes, utilisé pour initialiser la nouvelle instance. + + + Obtient l'offset de la date et de l'heure de l'objet . + retourne  ;Offset de la date et de l'heure de l'objet . + + + Obtient le delta en secondes de l'objet . + retourne  ;Différentiel en secondes de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de nouvelle tentative. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de nouvelle tentative valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de chaîne avec une qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Considération de qualité utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas une chaîne valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de l'objet . + retourne  ;Considération de qualité de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de chaîne de l'objet . + retourne  ;Valeur de chaîne de l'objet . + + + Représente une valeur d'en-tête Accept-Encoding. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres d'encodage de transfert. + retourne  ;Paramètres d'encodage de transfert. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de l'encodage de transfert. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'encodage de transfert valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur d'encodage de transfert. + retourne  ;Valeur d'encodage de transfert. + + + Représente une valeur d'en-tête Accept-Encoding avec une considération de qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Valeur pour la considération de qualité. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur de l'encodage de transfert. + + est une référence null. + + n'est pas un encodage de transfert valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de . + retourne  ;Considération de qualité de . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur d'un en-tête Via. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Obtient le champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire + retourne  ;Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Retourne un code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête. + + est une référence null. + + n'est pas valide pour les informations de valeur d'en-tête. + + + Obtient le nom de protocole du protocole reçu. + retourne  ;Le nom du protocole. + + + Obtient la version de protocole du protocole reçu. + retourne  ;Version du protocole. + + + Obtient l'hôte et le port via lesquels la requête ou la réponse a été reçue. + retourne  ;Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'avertissement utilisée par l'en-tête Warning. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + Les informations de date et d'heure de l'avertissement. + + + Obtient l'hôte ayant attaché l'avertissement. + retourne  ;Hôte ayant attaché l'avertissement. + + + Obtient le code d'avertissement spécifique. + retourne  ;Code d'avertissement spécifique. + + + Obtient les informations de date et d'heure de l'avertissement. + retourne  ;Les informations de date et d'heure de l'avertissement. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + Retourne une instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient une chaîne entre guillemets contenant le texte d'avertissement. + retourne  ;Chaîne entre guillemets contenant le texte d'avertissement. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/it/a b/src/packages/System.Net.Http.4.3.1/ref/net46/it/a new file mode 100644 index 00000000000..3a2ca25d00f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/it/a @@ -0,0 +1,2310 @@ + + + + System.Net.Http + + + + Fornisce il contenuto HTTP basato su una matrice di byte. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Il parametro è null. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Offset, in byte, nel parametro utilizzato per inizializzare l'oggetto . + Numero di byte in a partire dal parametro utilizzato per inizializzare . + Il parametro è null. + Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro .- oppure -Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro , meno il parametro . + + + Crea un flusso di contenuto HTTP come operazione asincrona per la lettura il cui archivio di backup è la memoria di . + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare e scrivere la matrice di byte fornita nel costruttore in un flusso di contenuto HTTP come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto, quali il token di associazione del canale.Il parametro può essere null. + + + Determina se una matrice di byte ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte della matrice di byte. + + + Specifica come i certificati client vengono forniti. + + + L'oggetto tenterà di fornire tutti i certificati client disponibili automaticamente. + + + L'applicazione manualmente fornisce i certificati client a .Questo valore è quello predefinito. + + + Tipo per gestori HTTP che delegano l'elaborazione dei messaggi di risposta HTTP a un altro gestore, chiamato gestore interno. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il gestore interno che elabora i messaggi di risposta HTTP. + Restituisce .Il gestore interno per i messaggi di risposta HTTP. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Contenitore per le tuple nome/valore codificate utilizzando il tipo MIME application/x-www-form-urlencoded. + + + Inizializza una nuova istanza della classe con una raccolta di coppie nome/valore specifica. + Raccolta di coppie nome/valore. + + + Fornisce una classe base per l'invio di richieste HTTP e la ricezione di risposte HTTP da una risorsa identificata da un URI. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un gestore specifico. + Stack del gestore HTTP da usare per inviare le richieste. + + + Inizializza una nuova istanza della classe con un gestore specifico. + Oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(), false se si intende riutilizzare il gestore interno. + + + Ottiene o imposta l'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + Restituisce .L'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + + + Annullare tutte le richieste in sospeso in questa istanza. + + + Ottiene le intestazioni che devono essere inviate con ogni richiesta. + Restituisce .Intestazioni da inviare con ogni richiesta. + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Rilascia le risorse non gestite usate da e, facoltativamente, elimina le risorse gestite. + true per rilasciare sia le risorse gestite sia quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Ottiene o imposta il numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta. + Restituisce .Numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta.Il valore predefinito di questa proprietà è 2 gigabyte. + La dimensione specificata è minore o uguale a zero. + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Ottiene o imposta l'intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Restituisce .Intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Il timeout specificato è minore o uguale a zero e non rappresenta il campo . + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Il gestore messaggi predefinito utilizzato da . + + + Crea un'istanza di una classe . + + + Recupera o imposta un valore che indica se il gestore deve seguire le risposte di reindirizzamento. + Restituisca il valore .true se il gestore deve seguire le risposte di reindirizzamento; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta il tipo di metodo di decompressione utilizzato dal gestore per la decompressione automatica della risposta del contenuto HTTP. + Restituisca il valore .Il metodo automatico di decompressione utilizzato dal gestore.Il valore predefinito è . + + + Ottiene o imposta la raccolta dei certificati di sicurezza associati al gestore. + Restituisca il valore .Raccolta di certificati di sicurezza associati a questo gestore. + + + Ottiene o imposta il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + Restituisca il valore .Il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + + + Ottiene o imposta le informazioni di autenticazione utilizzate da questo gestore. + Restituisca il valore .Credenziali di autenticazione associate al gestore.Il valore predefinito è null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il numero massimo di reindirizzamenti che il gestore segue. + Restituisca il valore .Numero massimo di risposte di reindirizzamento seguite dal gestore.Il valore predefinito è 50. + + + Ottiene o imposta la dimensione massima del buffer di contenuto della richiesta utilizzato dal gestore. + Restituisca il valore .Dimensione massima in byte del buffer di contenuto della richiesta.Il valore predefinito è 2 gigabyte. + + + Ottiene o imposta un valore che indica se il gestore invia un'intestazione di autorizzazione con la richiesta. + Restituisca il valore .true per inviare un'intestazione Autorizzazione HTTP con le richieste una volta eseguita l'autenticazione; in caso contrario, false.Il valore predefinito è false. + + + Ottiene o imposta le informazioni sul proxy utilizzato dal gestore. + Restituisca il valore .Informazioni sul proxy utilizzato dal gestore.Il valore predefinito è null. + + + Crea un'istanza di in base alle informazioni fornite in come operazione che non si bloccherà. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Ottiene un valore che indica se il gestore supporta la decompressione automatica del contenuto di risposta. + Restituisca il valore .true se il gestore supporta la decompressione automatica del contenuto della risposta; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni proxy. + Restituisca il valore .true se il gestore supporta le impostazioni proxy; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni di configurazione per le proprietà e . + Restituisca il valore .true se il gestore supporta le impostazioni di configurazione per le proprietà e ; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che indica se il gestore utilizza la proprietà per memorizzare i cookie del server e utilizza questi cookie durante l'invio delle richieste. + Restituisca il valore .true se il gestore supporta la proprietà per archiviare i cookie del server e utilizza tali cookie quando invia richieste; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che controlla se le credenziali predefinite sono inviate con le richieste dal gestore. + Restituisca il valore .true se vengono utilizzate le credenziali predefinite; in caso contrario, false.Il valore predefinito è false. + + + Recupera o imposta un valore che indica se il gestore utilizza un proxy per le richieste. + Restituisca il valore .true se il gestore deve utilizzare un proxy per le richieste; in caso contrario, false.Il valore predefinito è true. + + + Indica se le operazioni di devono essere considerate completate non appena la risposta è disponibile o dopo la lettura dell'intero messaggio di risposta, incluso il contenuto. + + + L'operazione deve essere completata dopo la lettura della risposta intera che include il contenuto. + + + L'operazione deve essere completata non appena una risposta è disponibile e le intestazioni vengono lette.Il contenuto non è ancora pronto. + + + Classe base che rappresenta un corpo di entità e intestazioni di contenuto HTTP. + + + Inizializza una nuova istanza della classe . + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Serializzare il contenuto HTTP in un flusso di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + Restituisca il valore .Le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Dimensione massima in byte del buffer da utilizzare. + + + Serializza il contenuto HTTP in una matrice di byte come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP e restituire un flusso che rappresenta il contenuto come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in una stringa come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto HTTP ha una lunghezza valida in byte. + Restituisca il valore .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Tipo di base per gestori messaggi HTTP. + + + Inizializza una nuova istanza della classe . + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Una classe di specializzazione che consente alle applicazioni di chiamare il metodo di su una catena del gestore HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(),false se si desidera riutilizzare il gestore interno. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Classe di helper per recuperare e confrontare i metodi HTTP standard e per creare nuovi metodi HTTP. + + + Inizializza una nuova istanza della classe con un metodo HTTP specifico. + Metodo HTTP. + + + Rappresenta un metodo di protocollo HTTP DELETE. + Restituisca il valore . + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Metodo HTTP da confrontare con l'oggetto corrente. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Oggetto da confrontare con l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP GET. + Restituisca il valore . + + + Funge da funzione hash per questo tipo. + Restituisca il valore .Codice hash per la classe corrente. + + + Rappresenta un metodo di protocollo HTTP HEAD.Il metodo HEAD è identico al metodo GET ad eccezione del fatto che, nella risposta, il server restituisce solo intestazioni di messaggio senza un corpo del messaggio. + Restituisca il valore . + + + Metodo HTTP. + Restituisca il valore .Metodo HTTP rappresentato come . + + + Operatore di uguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono equivalenti; in caso contrario, false. + Oggetto a sinistra di un operatore di uguaglianza. + Oggetto a destra di un operatore di uguaglianza. + + + Operatore di disuguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono uguali; in caso contrario, false. + Oggetto a sinistra di un operatore di disuguaglianza. + Oggetto a destra di un operatore di disuguaglianza. + + + Rappresenta un metodo di protocollo HTTP OPTIONS. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP POST utilizzato per inviare una nuova entità come aggiunta a un URI. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP PUT utilizzato per sostituire un'entità identificata da un URI. + Restituisca il valore . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisca il valore .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP TRACE. + Restituisca il valore . + + + Classe base per eccezioni generate dalle classi e . + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente. + Messaggio che descrive l'eccezione corrente. + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente e l'eccezione interna. + Messaggio che descrive l'eccezione corrente. + Eccezione interna. + + + Rappresenta un messaggio di richiesta HTTP. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Stringa che rappresenta la richiesta . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Oggetto da richiedere. + + + Ottiene o imposta il contenuto del messaggio HTTP. + Restituisce .Contenuto di un messaggio + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene la raccolta delle intestazioni delle richieste HTTP. + Restituisce .Raccolta di intestazioni di richiesta HTTP. + + + Ottiene o imposta il metodo HTTP utilizzato dal messaggio di richiesta HTTP. + Restituisce .Metodo HTTP utilizzato dal messaggio di richiesta.Il valore predefinito è il metodo GET. + + + Ottiene un set di proprietà per la richiesta HTTP. + Restituisce . + + + Recupera o imposta utilizzato per la richiesta HTTP. + Restituisce . utilizzato per la richiesta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Rappresenta un messaggio di risposta HTTP che include il codice di stato e i dati. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un specifico. + Codice di stato della risposta HTTP. + + + Ottiene o imposta il messaggio di risposta HTTP. + Restituisce .Contenuto del messaggio di risposta HTTP. + + + Rilascia le risorse non gestite ed elimina le risorse non gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Genera un'eccezione se la proprietà della risposta HTTP è false. + Restituisce .Il messaggio di risposta HTTP se la chiamata ha esito positivo. + + + Ottiene la raccolta delle intestazioni di risposta HTTP. + Restituisce .Raccolta di intestazioni di risposta HTTP. + + + Ottiene un valore che indica se la risposta HTTP è stata completata. + Restituisce .Valore che indica se la risposta HTTP è stata completata.true se l'oggetto è stato compreso nell'intervallo tra 200 e 299; in caso contrario, false. + + + Ottiene o imposta la frase del motivo solitamente inviata dai server insieme al codice di stato. + Restituisce .Frase del motivo inviata dal server. + + + Ottiene o imposta il messaggio di richiesta che ha determinato questo messaggio di risposta. + Restituisce .Messaggio di richiesta che ha determinato questo messaggio di risposta. + + + Ottiene o imposta il codice di stato della risposta HTTP. + Restituisce .Codice di stato della risposta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Tipo di base per gestori che possono elaborare soltanto piccole richieste e/o messaggi di risposta. + + + Crea un'istanza di una classe . + + + Crea un'istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Esegue l'elaborazione su ogni richiesta inviata al server. + Restituisce .Messaggio di richiesta HTTP elaborato. + Messaggio di richiesta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Eseguire l'elaborazione su ogni risposta dal server. + Restituisce .Messaggio di risposta HTTP elaborato. + Messaggio di risposta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Fornisce una raccolta di oggetti che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + Il parametro era null o contiene solo spazi vuoti. + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + La stringa limite per il contenuto a più parti. + Il parametro era null o una stringa vuota. è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Restituisce un enumeratore che scorre la raccolta di oggetti che vengono serializzati utilizzando la specifica del tipo di contenuto multipart/*. + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Serializzare il contenuto HTTP multipart in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Implementazione esplicita del metodo . + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Determina se il contenuto multiparte HTTP ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Fornisce un contenitore per contenuto codificato utilizzando il tipo MIME multipart/form-data. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + La stringa limite per il contenuto dati del form a più parti. + + è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + + è null o contiene solo spazi vuoti. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + Nome file del contenuto HTTP da aggiungere alla raccolta. + + è null o contiene solo spazi vuoti.- oppure - è null o contiene solo spazi vuoti. + Il parametro era null. + + + Fornisce il contenuto HTTP basato su un flusso. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Dimensione del buffer, in byte, per . + Il parametro era null. + + è minore o uguale a zero. + + + Scrive il contenuto del flusso HTTP in un flusso di memoria come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto del flusso ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto del flusso. + + + Fornisce il contenuto HTTP basato su una stringa. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + Tipo di dati multimediali da utilizzare per il contenuto. + + + Rappresenta le informazioni di autenticazione nei valori di intestazione Authorization, ProxyAuthorization, WWW-Authenticate e Proxy-Authenticate. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + Le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + Restituisce .Credenziali contenenti le informazioni di autenticazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene lo schema da utilizzare per l'autorizzazione. + Restituisce .Schema da utilizzare per l'autorizzazione. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Cache-Control. + + + Inizializza una nuova istanza della classe . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Token di estensione cache, ognuno con un valore assegnato facoltativo. + Restituisce .Raccolta di token di estensione cache, ognuno con un valore assegnato facoltativo. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + La durata massima, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .true se il client HTTP è disposto ad accettare una risposta che ha superato la data di scadenza; in caso contrario, false. + + + Il tempo massimo, in secondi, quando un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .Tempo in secondi. + + + La durata di validità, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata; in caso contrario, false. + + + Se un client HTTP è disposto ad accettare una risposta memorizzata nella cache. + Restituisce .true se il client HTTP è disposto ad accettare una risposta memorizzata nella cache; in caso contrario, false. + + + Raccolta di fieldname nella direttiva “no-cache" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se una cache non deve memorizzare una parte del messaggio di richiesta HTTP o una risposta. + Restituisce .true se una cache non deve memorizzare alcuna parte del messaggio di richiesta HTTP o alcuna risposta; in caso contrario, false. + + + Se una cache o un proxy non deve modificare alcuna parte del corpo dell'entità. + Restituisce .true se una cache o un proxy non deve modificare alcun aspetto del corpo di entità; in caso contrario, false. + + + Se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway. + Restituisce .true se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway); in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione del controllo della cache. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione Cache Control valide. + + + Se tutto o parte del messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa. + Restituisce .true se il messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa; in caso contrario, false. + + + Fieldname della raccolta nella direttiva “privata" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata per le cache condivise dell'agente utente. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata per le cache condivise dell'agente utente; in caso contrario, false. + + + Se una risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa. + Restituisce .true se la risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa; in caso contrario, false. + + + Durata massima condivisa, specificata in secondi, in una risposta HTTP che sostituisce la direttiva di durata massima in un'intestazione Cache-Control o in un'intestazione Expires per una cache condivisa. + Restituisce .Tempo in secondi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Disposition. + + + Inizializza una nuova istanza della classe . + Oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un . + + + Data di creazione del file. + Restituisce .Data di creazione del file. + + + Il tipo di disposizione per una parte del corpo del contenuto. + Restituisce .Il tipo di disposizione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Suggerimento su come creare un nome file per archiviare il payload del messaggio da utilizzare se l'entità è stata rimossa e archiviata in un file separato. + Restituisce .Nome file consigliato. + + + Suggerimento su come creare nomi file per archiviare il payload del messaggio da utilizzare se le entità sono state rimosse e archiviate in file separati. + Restituisce .Nome file consigliato del form nomefile*. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Data dell'ultima modifica apportata al file. + Restituisce .Data di modifica del file. + + + Nome per una parte del corpo del contenuto. + Restituisce .Nome per la parte del corpo del contenuto. + + + Set di parametri che include l'intestazione Content-Disposition. + Restituisce .Insieme di parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione di disposizione dei contenuti. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di disposizione del contenuto valide. + + + Data dell'ultima lettura del file. + Restituisce .Data ultimo lettura. + + + Dimensione approssimativa del file espressa in byte. + Restituisce .Dimensione approssimativa espressa in byte. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Range. + + + Inizializza una nuova istanza della classe . + Il punto iniziale o finale dell'intervallo, in byte. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + Il punto iniziale o finale dell'intervallo, in byte. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione, in byte, in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se per l'intestazione Content-Range è stata specificata una lunghezza. + Restituisce .true se il Content-range è di lunghezza specificata; in caso contrario, false. + + + Ottiene un valore che indica se per Content-Range è stato specificato un intervallo. + Restituisce .true se il Content-range è di intervallo specificato; in caso contrario, false. + + + Ottiene la lunghezza del corpo dell'entità completo. + Restituisce .La lunghezza del corpo dell'entità completo. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione dell'intervallo di contenuti. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo di contenuti. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Le unità dell'intervallo utilizzate. + Restituisce . contenente le unità dell'intervallo. + + + Rappresenta un valore di intestazione del tag di entità. + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + Un valore che indica se questa intestazione del tag di entità è una convalida debole.Se l'intestazione del tag di entità è una convalida debole, allora deve essere impostato su true.Se l'intestazione del tag di entità è una convalida forte, allora deve essere impostato su false. + + + Ottiene il valore di intestazione del tag di entità. + Restituisce . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se il tag di identità è preceduto da un indicatore di debolezza. + Restituisce .true se il tag di identità è preceduto da un indicatore di debolezza; in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del tag di entità. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dei tag di entità. + + + Ottiene la stringa tra virgolette opaca. + Restituisce .Stringa tra virgolette opaca. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta la raccolta di intestazioni di contenuto secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione del contenuto Allow in una risposta HTTP. + Restituisce .Valore dell'intestazione Allow su una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Expires in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Expires in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Last-Modified per una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Last-Modified in una risposta HTTP. + + + Raccolta di intestazioni e i relativi valori definiti nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + + + Aggiunge l'intestazione specificata e i valori relativi nella raccolta . + L'intestazione da aggiungere all'insieme. + Elenco di valori dell'intestazione da aggiungere alla raccolta. + + + Aggiunge l'intestazione specificata e il valore relativo nella raccolta . + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Rimuove tutte le intestazioni dalla raccolta . + + + Restituisce un valore che indica se un'intestazione specifica è presente nella raccolta . + Restituisce .true e l'intestazione specificata è presente nella raccolta; in caso contrario, false. + Intestazione specifica. + + + Restituisce un enumeratore che consente di scorrere l'istanza di . + Restituisce .Enumeratore per l'oggetto . + + + Restituisce tutti i valori di intestazione per un'intestazione specificata archiviata nella raccolta . + Restituisce .Matrice di stringhe di intestazione. + Intestazione specificata per cui restituire i valori. + + + Rimuove l'intestazione specificata dalla raccolta . + Restituisce . + Il nome dell'intestazione da rimuovere dall'insieme. + + + Ottiene un enumeratore che itera in un . + Restituisce .Istanza di un'implementazione di un in grado di scorrere un oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Restituisce un valore che indica se l'intestazione specificata e i relativi valori sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Valori dell'intestazione. + + + Restituisce un valore che indica se l'intestazione specificata e il relativo valore sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Restituisce un valore che indica se i valori e un'intestazione specificati sono archiviati nella raccolta . + Restituisce .true se gli oggetti e values dell'intestazione specificata vengono archiviati nella raccolta; in caso contrario, false. + Intestazione specificata. + Valori intestazione specificati. + + + Rappresenta una raccolta di valori dell'intestazione. + Tipo di raccolta di intestazione. + + + Aggiunge una voce a . + Elemento da aggiungere alla raccolta dell'intestazione. + + + Rimuove tutte le voci da . + + + Determina se contiene un articolo. + Restituisce .true se la voce è inclusa nell'istanza , in caso contrario false. + Elemento da trovare nella raccolta dell'intestazione. + + + Copia l'intero oggetto in un oggetto compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione. + Oggetto unidimensionale che rappresenta la destinazione degli elementi copiati dall'oggetto .L'indicizzazione di deve essere in base zero. + Indice in base zero della matrice specificata nel parametro in corrispondenza del quale ha inizio la copia. + + + Ottiene il numero di intestazioni in . + Restituisce .Numero di intestazioni contenute in una raccolta. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Ottiene un valore che indica se l'istanza è di sola lettura. + Restituisce .true se l'istanza di è in sola lettura, in caso contrario false. + + + Analizza e aggiunge una voce all'oggetto . + Voce da aggiungere. + + + Consente di rimuovere l'elemento selezionato dall'oggetto . + Restituisce .true se è stato correttamente rimosso dall'istanza ; in caso contrario, false. + Elemento da rimuovere. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Restituisce una stringa che rappresenta l'oggetto corrente . + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se l'input può essere analizzato e aggiunto all'oggetto . + Restituisce .true se è stato possibile analizzare e aggiungere all'istanza di ; in caso contrario, false + Voce da convalidare. + + + Rappresenta la raccolta di intestazioni di richiesta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Charset per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Charset per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Encoding per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Language per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Language per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una richiesta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Connection per una richiesta HTTP. + Restituisce .Valore dell'intestazione Connection per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una richiesta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una richiesta HTTP. + Restituisce .Valore dell'intestazione Date per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Expect per una richiesta HTTP. + Restituisce .Valore dell'intestazione Expect per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Expect per una richiesta HTTP contiene Continue. + Restituisce .true se l'intestazione Expect contiene Continue; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione From per una richiesta HTTP. + Restituisce .Valore dell'intestazione From per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Host per una richiesta HTTP. + Restituisce .Valore dell'intestazione Host per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-Match per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Modified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Modified-Since per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + Restituisce .Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Max-Forwards per una richiesta HTTP. + Restituisce .Valore dell'intestazione Max-Forwards per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una richiesta HTTP. + Restituisce .Valore dell'intestazione Pragma per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Referer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Referer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione TE per una richiesta HTTP. + Restituisce .Valore dell'intestazione TE per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Trailer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una richiesta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una richiesta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una richiesta HTTP. + + + Ottiene il valore dell'intestazione User-Agent per una richiesta HTTP. + Restituisce .Valore dell'intestazione User-Agent per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Via per una richiesta HTTP. + Restituisce .Valore dell'intestazione Via per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Warning per una richiesta HTTP. + Restituisce .Valore dell'intestazione Warning per una richiesta HTTP. + + + Rappresenta la raccolta di intestazioni di risposta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept-Ranges per una risposta HTTP. + Restituisce .Valore dell'intestazione Accept-Ranges per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Age per una risposta HTTP. + Restituisce .Valore dell'intestazione Age per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una risposta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una risposta HTTP. + + + Ottiene il valore dell'intestazione Connection per una risposta HTTP. + Restituisce .Valore dell'intestazione Connection per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una risposta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una risposta HTTP. + Restituisce .Valore dell'intestazione Date per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione ETag per una risposta HTTP. + Restituisce .Valore dell'intestazione ETag per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Location per una risposta HTTP. + Restituisce .Valore dell'intestazione Location per una risposta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una risposta HTTP. + Restituisce .Valore dell'intestazione Pragma per una risposta HTTP. + + + Ottiene il valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Retry-After per una risposta HTTP. + Restituisce .Valore dell'intestazione Retry-After per una risposta HTTP. + + + Ottiene il valore dell'intestazione Server per una risposta HTTP. + Restituisce .Valore dell'intestazione Server per una risposta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una risposta HTTP. + Restituisce .Valore dell'intestazione Trailer per una risposta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una risposta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una risposta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una risposta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una risposta HTTP. + + + Ottiene il valore dell'intestazione Vary per una risposta HTTP. + Restituisce .Valore dell'intestazione Vary per una risposta HTTP. + + + Ottiene il valore dell'intestazione Via per una risposta HTTP. + Restituisce .Valore dell'intestazione Via per una risposta HTTP. + + + Ottiene il valore dell'intestazione Warning per una risposta HTTP. + Restituisce .Valore dell'intestazione Warning per una risposta HTTP. + + + Ottiene il valore dell'intestazione WWW-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione WWW-Authenticate per una risposta HTTP. + + + Rappresenta un tipo di supporto utilizzato in un'intestazione Content-Type come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Origine rappresentata come stringa per inizializzare la nuova istanza. + + + Ottiene o imposta il set di caratteri. + Restituisce .Set di caratteri. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene o imposta il valore dell'intestazione Media-Type. + Restituisce .Il valore di intestazione del tipo di supporto. + + + Ottiene o imposta i parametri di valore dell'intestazione del tipo di supporto. + Restituisce .I parametri del valore di intestazione del tipo di supporto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione del tipo di supporto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del tipo di supporti. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un tipo di supporto con un fattore di qualità aggiuntivo utilizzato in un'intestazione Content-Type. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + Qualità associata a questo valore di intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il tipo di supporto con le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è un tipo di supporto valido con le informazioni sul valore di intestazione di qualità. + + + Ottenere o impostare il valore di qualità per . + Restituisce .Valore di qualità per l'oggetto ) + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta una coppia nome/valore utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome dell'intestazione. + Restituisce .Nome dell'intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del valore del nome. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del valore del nome. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore dell'intestazione. + Restituisce .Valore dell'intestazione. + + + Rappresenta una coppia nome/valore con parametri utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri dall'oggetto . + Restituisce .Raccolta contenente i parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il valore del nome con le informazioni sul valore di intestazione del parametro. + + è un riferimento null. + + non è un valore di nome valido con le informazioni sul valore di intestazione di parametro. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di token di prodotto in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Nome del prodotto. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome del token del prodotto. + Restituisce .Nome del token del prodotto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del prodotto. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene la versione del token del prodotto. + Restituisce .Versione del token di prodotto. + + + Rappresenta un valore che può essere un prodotto o un commento in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Valore di commento. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Ottiene il commento dall'oggetto . + Restituisce .Valore di commento di . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle informazioni di prodotto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle informazioni di prodotto. + + + Ottiene il prodotto dall'oggetto . + Restituisce .Valore del prodotto da questo . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione If-Range che può essere un valore di tipo Date/Time o tag entità. + + + Inizializza una nuova istanza della classe . + Un valore di data utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Una tag di entità rappresentata come stringa utilizzata per inizializzare la nuova istanza. + + + Ottiene la data dall'oggetto . + Restituisce .Data dall'oggetto . + + + Ottiene il tag di identità dall'oggetto . + Restituisce .Tag di identità dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dell'intervallo. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione con intervallo. + + + Inizializza una nuova istanza della classe . + + + Consente l'inizializzazione di una nuova istanza della classe con un intervallo di date. + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione dell'intervallo. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo. + + + Ottiene gli intervalli specificati dall'oggetto . + Restituisce .Intervalli dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene l'unità dall'oggetto . + Restituisce .Unità dall'oggetto . + + + Rappresenta un valore di intestazione con intervallo di byte in un intervallo. + + + Inizializza una nuova istanza della classe . + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un valore di intestazione Retry-After che può essere un valore di tipo Date/Time o Timespan. + + + Inizializza una nuova istanza della classe . + L'offset di data e ora utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Delta, in secondi, utilizzato per inizializzare la nuova istanza. + + + Ottiene l'offset della data e ora dall'oggetto . + Restituisce .L'offset della data e ora dall'oggetto . + + + Ottiene il delta in secondi dall'oggetto . + Restituisce .Delta in secondi dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni dei nuovi tentativi. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dei nuovi tentativi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione di stringa con una qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Fattore di qualità utilizzato per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è una stringa valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di stringa dall'oggetto . + Restituisce .Valore di stringa da cui ottenere l'oggetto . + + + Rappresenta un valore di intestazione Accept-Encoding. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri di codifica di trasferimento. + Restituisce .I parametri di codifica di trasferimento. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione della codifica di trasferimento. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della codifica di trasferimento. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di codifica di trasferimento. + Restituisce .Il valore di codifica di trasferimento. + + + Rappresenta un valore di intestazione di intestazione Accept-Encoding con fattore di qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Un valore per il fattore di qualità. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore della codifica di trasferimento. + + è un riferimento null. + + non è una codifica di trasferimento valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore di un'intestazione Via. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Ottiene il campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + Restituisce .Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Viene restituito un codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta mediante informazioni sul valore intestazione. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della via. + + + Ottiene il nome del protocollo ricevuto. + Restituisce .Nome del protocollo. + + + Ottiene la versione del protocollo ricevuto. + Restituisce .Versione del protocollo. + + + Ottiene l'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Restituisce .L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di avviso utilizzato dall'intestazione di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + L'indicatore di data e ora dell'avviso. + + + Ottiene l'host che ha associato l'avviso. + Restituisce .L'host che ha associato l'avviso. + + + Ottiene il codice di avviso specifico. + Restituisce .Codice di avviso specifico. + + + Ottiene l'indicatore di data e ora dell'avviso. + Restituisce .L'indicatore di data e ora dell'avviso. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce un'istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene una stringa tra virgolette contenente il testo di avviso. + Restituisce .Una stringa tra virgolette contenente il testo di avviso. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/ja/a b/src/packages/System.Net.Http.4.3.1/ref/net46/ja/a new file mode 100644 index 00000000000..10214bda61e --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/ja/a @@ -0,0 +1,2852 @@ + + + + System.Net.Http + + + + バイト配列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + パラメーターが null です。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + の初期化に使用される パラメーターのオフセット (バイト単位)。 + + を初期化するために使用される パラメーターから始まる のバイト数。 + + パラメーターが null です。 + + パラメーターが 0 未満です。または パラメーターが パラメーターで指定されたコンテンツの長さを超えています。またはパラメーターが 0 未満です。または パラメーターが、 パラメーターで指定されたコンテンツの長さから パラメーターを引いた値を超えています。 + + + バッキング ストアが からのメモリである読み取り用 HTTP コンテンツ ストリームを非同期操作として作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として HTTP コンテンツ ストリームにコンストラクターで提供されるバイト配列をシリアル化して記述します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + バイト配列が有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + バイト配列の長さ (バイト単位)。 + + + クライアント証明書がどのように提供されるかを指定します。 + + + + は、使用できるすべてのクライアント証明書を自動的に提供しようと試みます。 + + + アプリケーションは に、クライアント証明書を手動で提供します。この値が既定値です。 + + + 内部ハンドラーと呼ばれる、別のハンドラーへ HTTP 応答メッセージの処理をデリゲートする HTTP ハンドラーの型。 + + + + クラスの新しいインスタンスを作成します。 + + + 特定の内部ハンドラーを使用して、 クラスの新しいインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答メッセージを処理する内部ハンドラーを取得または設定します。 + + を返します。HTTP 応答メッセージ用の内部ハンドラー。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + application/x-www-form-urlencoded MIME 型を使用してエンコードされた名前と値の組のコンテナー。 + + + 指定した名前と値のペアのコレクションを使用して、 クラスの新しいインスタンスを初期化します。 + 名前と値のペアのコレクション。 + + + URI で識別されるリソースに HTTP 要求を送信し、そのリソースから HTTP 応答を受信するための基本クラスを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + 要求の送信に使用する HTTP ハンドラー スタック。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() で破棄する場合は true。内部ハンドラーを再利用する場合は false。 + + + 要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレスを取得または設定します。 + + を返します。要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレス。 + + + このインスタンスの保留中の要求をすべてキャンセルします。 + + + 各要求と一緒に送信する必要があるヘッダーを取得します。 + + を返します。各要求と一緒に送信する必要があるヘッダー。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + + が使用しているアンマネージ リソースを解放します。オプションとして、マネージ リソースを破棄することもできます。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 応答の内容を読み取るときにバッファーに格納できる最大バイト数を取得または設定します。 + + を返します。応答コンテンツを読み取るときに、バッファーに格納できる最大バイト数。このプロパティの既定値は 2 GB です。 + 指定されたサイズがゼロ以下です。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 要求がタイムアウトするまで待機する期間を取得または設定します。 + + を返します。要求がタイムアウトするまで待機する期間。 + 指定したタイムアウトが 0 以下のため ではありません。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + + が使用する既定のメッセージ ハンドラー。 + + + + クラスのインスタンスを作成します。 + + + ハンドラーがリダイレクト応答に従うかどうかを示す値を取得または設定します。 + + を返します。ハンドラーがリダイレクト応答に従う場合は true。それ以外の場合は false。既定値は true です。 + + + HTTP コンテンツ応答の自動圧縮解除のハンドラーが使用する圧縮解除メソッドの種類を取得または設定します。 + + を返します。ハンドラーが使用する自動圧縮解除のメソッド。既定値は です。 + + + このハンドラーに関連付けられるセキュリティ証明書のコレクションを取得または設定します。 + + を返します。このハンドラーに関連付けられているセキュリティ証明書のコレクション。 + + + ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナーを取得または設定します。 + + を返します。ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナー。 + + + このハンドラーによって使用される認証情報を取得または設定します。 + + を返します。ハンドラーに関連付けられる認証資格情報。既定値は、null です。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + ハンドラーが従うリダイレクトの最大数を取得または設定します。 + + を返します。ハンドラーによって実行されるリダイレクト応答の最大数。既定値は 50 です。 + + + ハンドラーが使用する要求コンテンツ バッファーの最大サイズを取得または設定します。 + + を返します。要求コンテンツ バッファーの最大サイズ (バイト単位)。既定値は 2 GB です。 + + + ハンドラーが要求と共に認証ヘッダーを送信するかどうかを示す値を取得または設定します。 + + を返します。認証が行われた後で、要求と共に HTTP 認証ヘッダーを送信するハンドラーの場合は true。それ以外の場合は false。既定値は、false です。 + + + ハンドラーが使用するプロキシ情報を取得または設定します。 + + を返します。ハンドラーにより使用されるプロキシ情報。既定値は null です。 + + + + で提供される情報に基づいて、ブロックされない操作として のインスタンスを作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + ハンドラーが自動的な応答内容の圧縮解除をサポートするかどうかを示す値を取得します。 + + を返します。ハンドラーが自動応答の内容の圧縮解除をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーがプロキシ設定をサポートしているかどうかを示す値を取得します。 + + を返します。ハンドラーがプロキシ設定をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが および プロパティの構成設定をサポートするかどうかを示す値を取得します。 + + を返します。 プロパティと プロパティの構成設定をハンドラーがサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 既定の資格情報がハンドラーによって要求と共に送信されるかどうかを制御する値を取得または設定します。 + + を返します。既定の資格情報を使用する場合は true。それ以外の場合は false。既定値は false です。 + + + ハンドラーが要求のプロキシを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが要求に対してプロキシを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 応答が使用できるようになった場合に 操作が完了したと見なすか、内容を含む応答メッセージ全体を読み取った後に完了したと見なすかを示します。 + + + 操作は、コンテンツを含む全体の応答を読んだ後に完了する必要があります。 + + + 操作は、応答が使用できる状態になった後か、ヘッダーが読み取られた後すぐに完了する必要があります。コンテンツがまだ読み取られていません。 + + + HTTP のエンティティ本体とコンテンツ ヘッダーを表す基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + 非同期操作としてメモリ ストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + RFC 2616 で定義されている HTTP コンテンツ ヘッダーを取得します。 + + を返します。RFC 2616 で定義されているコンテンツ ヘッダー。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 使用するバッファーの最大サイズ (バイト単位)。 + + + 非同期操作としてバイト配列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + HTTP コンテンツをシリアル化して、非同期操作としてコンテンツを表すストリームを返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として文字列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + HTTP コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + HTTP メッセージ ハンドラーの基本型。 + + + + クラスの新しいインスタンスを初期化します。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + アプリケーションが HTTP ハンドラー チェーンに対して メソッドを呼び出せるようにする専用クラス。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() が破棄する場合は true、内部ハンドラーを再利用する場合は false。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + 標準的な HTTP メソッドの取得と比較を行い、新しい HTTP メソッドを作成するためのヘルパー クラス。 + + + 指定した HTTP メソッドを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + + + HTTP DELETE プロトコル メソッドを表します。 + + を返します。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較する HTTP メソッド。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + HTTP GET プロトコル メソッドを表します。 + + を返します。 + + + この型のハッシュ関数として機能します。 + + を返します。現在の のハッシュ コード。 + + + HTTP HEAD プロトコル メソッドを表します。HEAD メソッドは、サーバーが応答でメッセージ本文は返さずにメッセージ ヘッダーだけを返すこと以外、GET と同じです。 + + を返します。 + + + HTTP メソッド。 + + を返します。 として表される HTTP メソッド。 + + + 2 つの オブジェクトを比較するための等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しい場合は true。それ以外の場合は false。 + 等値演算子の左辺にある 。 + 等値演算子の右辺の 。 + + + 2 つの オブジェクトを比較するための非等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しくない場合は true。それ以外の場合は false。 + 非等値演算子の左辺にある 。 + 非等値演算子の右辺の 。 + + + HTTP OPTIONS プロトコル メソッドを表します。 + + を返します。 + + + URI への追加として新しいエントリをポストするために使用される HTTP POST プロトコル メソッドを表します。 + + を返します。 + + + URI で識別されるエントリを置き換えるために使用される HTTP PUT プロトコル メソッドを表します。 + + を返します。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + HTTP TRACE プロトコル メソッドを表します。 + + を返します。 + + + + クラスによってスローされる例外の基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + 現在の例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + + + 現在の例外と内部例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + 内部例外。 + + + HTTP 要求メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求 を表す文字列。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求する 。 + + + HTTP メッセージの内容を取得または設定します。 + + を返します。メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 要求ヘッダーのコレクションを取得します。 + + を返します。HTTP 要求ヘッダーのコレクション。 + + + HTTP 要求メッセージで使用される HTTP メソッドを取得または設定します。 + + を返します。要求メッセージによって使用される HTTP メソッド。既定では、GET メソッドです。 + + + HTTP 要求のプロパティのセットを取得します。 + + を返します。 + + + HTTP 要求で使用する を取得または設定します。 + + を返します。HTTP 要求に使用される + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + ステータス コードとデータを含む HTTP 応答メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + を指定して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答のステータス コード。 + + + HTTP 応答メッセージの内容を取得または設定します。 + + を返します。HTTP 応答メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、アンマネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答の のプロパティが false である場合、例外がスローされます。 + + を返します。呼び出しが成功した場合は HTTP 応答メッセージ。 + + + HTTP 応答ヘッダーのコレクションを取得します。 + + を返します。HTTP 応答ヘッダーのコレクション。 + + + HTTP 応答が成功したかどうかを示す値を取得します。 + + を返します。HTTP 応答が成功したかどうかを示す値。 が 200 ~ 299 の範囲内にあった場合は true。それ以外の場合は false。 + + + 通常はステータス コードと共にサーバーによって送信される理由句を取得または設定します。 + + を返します。サーバーから送信される理由語句。 + + + この応答メッセージの原因となった要求メッセージを取得または設定します。 + + を返します。この応答メッセージの原因となった要求メッセージ。 + + + HTTP 応答のステータス コードを取得または設定します。 + + を返します。HTTP 応答のステータス コード。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + 要求と応答メッセージの小規模な処理のみをするハンドラーの基本型。 + + + + クラスのインスタンスを作成します。 + + + 指定した内部ハンドラーを使用して、 クラスのインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + サーバーに送信された各要求の処理を実行します。 + + を返します。処理された HTTP 要求メッセージ。 + 処理する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + サーバーからの各応答の処理を実行します。 + + を返します。処理された HTTP 応答メッセージ。 + 処理する HTTP 応答メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + + が null であるか、空白文字だけで構成されています。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + マルチパート コンテンツの境界の文字列。 + + は null か空の文字列でした。 が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションにマルチパート HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + multipart/* のコンテンツ タイプ仕様を使用してシリアル化する オブジェクトのコレクション全体を反復処理する列挙子を返します。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + 非同期操作としてストリームにマルチパート HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + + メソッドの明示的な実装。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + HTTP マルチパート コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + マルチパート/フォーム データの MIME タイプを使用してエンコードされたコンテンツのコンテナーを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート フォーム データ コンテンツの境界の文字列。 + + が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + + が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + コレクションに追加する HTTP コンテンツのファイル名。 + + が null であるか、空白文字だけで構成されています。または が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + ストリームに基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + のバッファーのサイズ (バイト単位)。 + + が null でした。 + + の値が 0 以下です。 + + + 非同期操作としてメモリ ストリームに HTTP ストリーム コンテンツを書き込みます。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + ストリーム コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + ストリーム コンテンツの長さ (バイト単位)。 + + + 文字列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + コンテンツに使用するメディア タイプ。 + + + Authorization、ProxyAuthorization、WWW-Authenticate、および Proxy-Authenticate のヘッダー値の認証情報を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報を取得します。 + + を返します。認証情報を格納する資格情報。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 承認のために使用するメソッドを取得します。 + + を返します。承認のために使用するスキーム。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Cache-Control ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + それぞれが省略可能な代入値を持つキャッシュ拡張トークン。 + + を返します。それぞれが省略可能な代入値を持つキャッシュ拡張トークンのコレクション。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + HTTP クライアントが応答を受け入れる最大期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが有効期限を過ぎた応答を受け入れるかどうか。 + + を返します。HTTP クライアントが有効期限を過ぎた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP クライアントが、有効期限を過ぎた応答を受け入れる最長時間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが応答を受け入れる鮮度有効期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + キャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなった場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + HTTP クライアントがキャッシュされた応答を受け入れるかどうか。 + + を返します。HTTP クライアントがキャッシュされた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "no-cache" ディレクティブにあるフィールド名のコレクション。 + + を返します。フィールド名のコレクション。 + + + HTTP 要求メッセージまたは応答の一部をキャッシュに保存できないかどうか。 + + を返します。HTTP 要求メッセージおよびあらゆる応答のどの部分もキャッシュに保存できない場合は true。それ以外の場合は false。 + + + キャッシュまたはプロキシがエンティティ本体の側面を変更できないかどうか。 + + を返します。キャッシュまたはプロキシがエンティティ本体のどの側面も変更できない場合は true。それ以外の場合は false。 + + + キャッシュが HTTP 要求の他の制約に準拠しているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答するか。 + + を返します。キャッシュが、HTTP 要求の他の制約に従っているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答する場合は true。それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + キャッシュ コントロールのヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なキャッシュ コントロール ヘッダー値の情報です。 + + + HTTP 応答メッセージの全体または一部が 1 人のユーザーを対象にしており、共有キャッシュでキャッシュできないかどうか。 + + を返します。HTTP 応答メッセージが 1 名のユーザーを対象にしており、共有キャッシュでキャッシュできない場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "private" ディレクティブにあるコレクション フィールド名。 + + を返します。フィールド名のコレクション。 + + + 共有ユーザー エージェント キャッシュのキャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなり、共有ユーザー エージェント キャッシュに適切でない場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + 通常、キャッシュ不可である場合や、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答をすべてのキャッシュでキャッシュできるかどうか。 + + を返します。通常はキャッシュ不可であるか、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答を任意のキャッシュでキャッシュできる場合は true。それ以外の場合は false。 + + + 共有キャッシュのキャッシュ制御ヘッダーまたは expires ヘッダーに対する "最大年齢" ディレクティブをオーバーライドする HTTP 応答における、共有最大期間 (秒単位で指定)。 + + を返します。時間 (秒) です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Disposition ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + ファイルが作成された日付。 + + を返します。ファイルの作成日。 + + + コンテンツ本体の配置タイプ。 + + を返します。配置タイプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。推奨ファイル名。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。フォームの filename* の推奨ファイル名。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ファイルが最後に変更された日付。 + + を返します。ファイルの変更日。 + + + コンテンツ本体の名前。 + + を返します。コンテンツ本体の名前。 + + + パラメーター セットには、Content-Disposition ヘッダーが含まれていました。 + + を返します。パラメーターのコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ配置ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ配置ヘッダー値の情報です。 + + + ファイルの読み取りが行われた最後の日付。 + + を返します。最後に読み取った日付。 + + + ファイルのおおよそのサイズ (バイト単位)。 + + を返します。おおよそのサイズ (バイト単位)。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Range ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 範囲の開始点または終了点 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + 範囲の開始点または終了点 (バイト単位)。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置 (バイト単位)。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + Content-Range ヘッダーが指定された長さかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された長さである場合は true、それ以外の場合は false。 + + + Content-Range に指定された範囲があるかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された範囲である場合は true、それ以外の場合は false。 + + + 完全なエンティティ本体の長さを取得します。 + + を返します。フル エンティティ本体の長さ。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ範囲ヘッダー値の情報です。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 使用する範囲の単位。 + + を返します。範囲の単位を含む + + + エンティティ タグのヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + このエンティティ タグ ヘッダーが弱い検証コントロールかどうかを示す値。エンティティ タグ ヘッダーが弱い検証コントロールの場合は、 を true に設定します。エンティティ タグ ヘッダーが強い検証コントロールの場合は、 を false に設定します。 + + + エンティティ タグのヘッダー値を取得します。 + + を返します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + エンティティ タグの前に脆弱性インジケーターが付いているかどうかを取得します。 + + を返します。エンティティ タグの前に脆弱性インジケーターが付いている場合は true、それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + エンティティ タグ ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なエンティティ タグ ヘッダー値の情報です。 + + + opaque 引用符で囲まれた文字列を取得します。 + + を返します。不透明な引用符で囲まれた文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義されているコンテンツ ヘッダーのコレクションを表します。 + + + HTTP 応答の Allow コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Allow ヘッダーの値。 + + + HTTP 応答の Content-Disposition コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Disposition コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Encoding コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Encoding コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Language コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Language コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Length コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Length コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Location コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Location コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-MD5 コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-MD5 コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Range コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Range コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Type コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Type コンテンツ ヘッダーの値。 + + + HTTP 応答の Expires コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Expires コンテンツ ヘッダーの値。 + + + HTTP 応答の Last-Modified コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Last-Modified コンテンツ ヘッダーの値。 + + + RFC 2616 で定義されているヘッダーおよび値のコレクション。 + + + + クラスの新しいインスタンスを初期化します。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + コレクションに追加するヘッダー値のリスト。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + + コレクションからすべてのヘッダーを削除します。 + + + 特定のヘッダーが コレクションに存在するかどうかを返します。 + + を返します。指定したヘッダーがコレクション内に存在する場合は true、それ以外の場合は false。 + 特定のヘッダー。 + + + + インスタンスを反復処理できる列挙子を返します。 + + を返します。 の列挙子。 + + + + コレクションに格納されている指定したヘッダーのすべてのヘッダー値を返します。 + + を返します。ヘッダー文字列の配列。 + 値を返す指定されたヘッダー。 + + + 指定したヘッダーを コレクションから削除します。 + + を返します。 + コレクションから削除するヘッダーの名前。 + + + + を反復処理できる列挙子を取得します。 + + を返します。 を反復処理できる を実装するインスタンス。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの値。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + 指定されたヘッダーと指定された値が コレクションに格納されているかどうかを返します。 + + を返します。指定されたヘッダー および values がコレクションに格納されている場合は true。それ以外の場合は false。 + 指定されたヘッダー。 + 指定したヘッダー値。 + + + ヘッダー値のコレクションを表します。 + ヘッダー コレクションの型。 + + + + にエントリを追加します。 + ヘッダー コレクションに追加する項目。 + + + + からすべてのエントリを削除します。 + + + + に項目が格納されているかどうかを確認します。 + + を返します。エントリが インスタンスに含まれている場合は true。それ以外の場合は false。 + ヘッダー コレクションから検索する項目。 + + + + 全体を互換性のある 1 次元の にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 + + から要素をコピーする、1 次元の です。 には、0 から始まるインデックス番号が必要です。 + コピーの開始位置となる、 内の 0 から始まるインデックス。 + + + + 内のヘッダーの数を取得します。 + + を返します。コレクション内のヘッダーの数。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + + インスタンスが読み取り専用かどうかを示す値を取得します。 + + を返します。 インスタンスが読み取り専用の場合は true。それ以外の場合は false。 + + + + にエントリを解析して追加します。 + 追加するエントリ。 + + + 指定した項目を から削除します。 + + を返します。 インスタンスから削除された場合は true。それ以外の場合は false。 + 削除する項目。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 入力を解析して に追加できるかどうかを判断します。 + + を返します。 を解析して インスタンスに追加できる場合は true。それ以外の場合は false + 検証するエントリ。 + + + RFC 2616 で定義されている要求ヘッダーのコレクションを表します。 + + + HTTP 要求の Accept ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept ヘッダーの値。 + + + HTTP 要求の Accept-Charset ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Charset ヘッダーの値。 + + + HTTP 要求の Accept-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Encoding ヘッダーの値。 + + + HTTP 要求の Accept-Language ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Language ヘッダーの値。 + + + HTTP 要求の Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Authorization ヘッダーの値。 + + + HTTP 要求の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Cache-Control ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーの値を取得します。 + + を返します。HTTP 要求の Connection ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Date ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーの値を取得します。 + + を返します。HTTP 要求の Expect ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーに Continue が含まれるかどうかを示す値を取得または設定します。 + + を返します。Expect ヘッダーに Continue が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の From ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の From ヘッダーの値。 + + + HTTP 要求の Host ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Host ヘッダーの値。 + + + HTTP 要求の If-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-Match ヘッダーの値。 + + + HTTP 要求の If-Modified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Modified-Since ヘッダーの値。 + + + HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + + HTTP 要求の If-Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Range ヘッダーの値。 + + + HTTP 要求の If-Unmodified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Unmodified-Since ヘッダーの値。 + + + HTTP 要求の Max-Forwards ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Max-Forwards ヘッダーの値。 + + + HTTP 要求の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 要求の Pragma ヘッダーの値。 + + + HTTP 要求の Proxy-Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Proxy-Authorization ヘッダーの値。 + + + HTTP 要求の Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Range ヘッダーの値。 + + + HTTP 要求の Referer ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Referer ヘッダーの値。 + + + HTTP 要求の TE ヘッダーの値を取得します。 + + を返します。HTTP 要求の TE ヘッダーの値。 + + + HTTP 要求の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 要求の Trailer ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Transfer-Encoding ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 要求の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 要求の Upgrade ヘッダーの値。 + + + HTTP 要求の User-Agent ヘッダーの値を取得します。 + + を返します。HTTP 要求の User-Agent ヘッダーの値。 + + + HTTP 要求の Via ヘッダーの値を取得します。 + + を返します。HTTP 要求の Via ヘッダーの値。 + + + HTTP 要求の Warning ヘッダーの値を取得します。 + + を返します。HTTP 要求の Warning ヘッダーの値。 + + + RFC 2616 で定義されている応答ヘッダーのコレクションを表します。 + + + HTTP 応答の Accept-Ranges ヘッダーの値を取得します。 + + を返します。HTTP 応答の Accept-Ranges ヘッダーの値。 + + + HTTP 応答の Age ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Age ヘッダーの値。 + + + HTTP 応答の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Cache-Control ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーの値を取得します。 + + を返します。HTTP 応答の Connection ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 応答の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Date ヘッダーの値。 + + + HTTP 応答の ETag ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の ETag ヘッダーの値。 + + + HTTP 応答の Location ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Location ヘッダーの値。 + + + HTTP 応答の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 応答の Pragma ヘッダーの値。 + + + HTTP 応答の Proxy-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の Proxy-Authenticate ヘッダーの値。 + + + HTTP 応答の Retry-After ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Retry-After ヘッダーの値。 + + + HTTP 応答の Server ヘッダーの値を取得します。 + + を返します。HTTP 応答の Server ヘッダーの値。 + + + HTTP 応答の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 応答の Trailer ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 応答の Transfer-Encoding ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 応答の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 応答の Upgrade ヘッダーの値。 + + + HTTP 応答の Vary ヘッダーの値を取得します。 + + を返します。HTTP 応答の Vary ヘッダーの値。 + + + HTTP 応答の Via ヘッダーの値を取得します。 + + を返します。HTTP 応答の Via ヘッダーの値。 + + + HTTP 応答の Warning ヘッダーの値を取得します。 + + を返します。HTTP 応答の Warning ヘッダーの値。 + + + HTTP 応答の WWW-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の WWW-Authenticate ヘッダーの値。 + + + RFC 2616 に定義され、コンテンツ タイプのヘッダーに使用されるメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化する文字列を表すソースです。 + + + 文字セットを取得または設定します。 + + を返します。文字セット。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + メディア種類のヘッダー値を取得または設定します。 + + を返します。メディア タイプ ヘッダー値。 + + + メディア種類のヘッダー値のパラメーターを取得または設定します。 + + を返します。メディア タイプ ヘッダー値パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + メディア種類のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なメディア タイプ ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + コンテンツ タイプ ヘッダーで使用される追加の品質ファクターとメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + このヘッダー値に関連付けられた品質です。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を含むメディア種類を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効なメディア タイプではありません。 + + + + の品質評価の値を取得または設定します。 + + を返します。 オブジェクトの品質評価の値。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用される名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ヘッダー名を取得します。 + + を返します。ヘッダーの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 名前の値のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な名前の値のヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ヘッダー値を取得します。 + + を返します。ヘッダー値。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用されるパラメーター付きの名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + + オブジェクトからパラメーターを取得します。 + + を返します。パラメーターを含むコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + パラメーター ヘッダー値の情報を含む、名前の値を表す文字列。 + + が null 参照です。 + + はパラメーター ヘッダー値の情報を含む有効な名前の値ではありません。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ユーザー エージェント ヘッダー内の製品トークン値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 製品トークンの名前を取得します。 + + を返します。製品トークンの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 製品のヘッダー値の情報を表す文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 製品トークンのバージョンを取得します。 + + を返します。製品トークンのバージョン。 + + + User-Agent ヘッダー内の製品またはコメントのいずれかになる値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + コメント値。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + + オブジェクトからコメントを取得します。 + + を返します。この のコメントの値です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 情報のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な製品情報ヘッダー値の情報です。 + + + + オブジェクトから製品を取得します。 + + を返します。この からの製品の値です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 日付/時刻またはエンティティ タグ値のいずれかとなる If-Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される日付の値。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される文字列として表現されたエンティティ タグ。 + + + + オブジェクトから日付を取得します。 + + を返します。 オブジェクトからのデータです。 + + + + オブジェクトからエンティティ タグを取得します。 + + を返します。 オブジェクトのエンティティ タグです。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + バイト範囲を使用して、 クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な範囲ヘッダー値の情報です。 + + + + オブジェクトから指定した範囲を取得します。 + + を返します。 オブジェクトからの範囲です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから単位を取得します。 + + を返します。 オブジェクトからの単位です。 + + + バイト範囲の Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 日付/時刻または期間値のいずれかとなる Retry-After ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する日付と時刻のオフセット。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される、秒単位の差分です。 + + + + オブジェクトから日付と時刻のオフセットを取得します。 + + を返します。 オブジェクトからの日付と時刻のオフセット。 + + + + オブジェクトから秒単位の差分を取得します。 + + を返します。 オブジェクトの秒単位の差分です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 再試行条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な再試行条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + オプションの品質と文字列ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 新しいインスタンスを初期化するために使用される品質要素。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な文字列ではありません。 + + + + オブジェクトから品質係数を取得します。 + + を返します。 オブジェクトからの品質係数です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから文字列値を取得します。 + + を返します。 オブジェクトから取得された文字列値。 + + + Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 転送コーディング パラメーターを取得します。 + + を返します。転送コーディング パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な転送コーディング ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 転送コーディング値を取得します。 + + を返します。転送コーディング値。 + + + オプションの品質要素と Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 品質係数の値。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な転送コーディングではありません。 + + + + から品質係数を取得します。 + + を返します。 からの品質係数です。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Via ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールドを取得します。 + + を返します。受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コードを返します。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + Via ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な Via ヘッダー値の情報です。 + + + 受信したプロトコルのプロトコル名を取得します。 + + を返します。プロトコル名。 + + + 受信したプロトコルのプロトコル バージョンを取得します。 + + を返します。プロトコル バージョン。 + + + 要求または応答が受信されたホストとポートを取得します。 + + を返します。要求または応答が受信されたホストとポート。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 警告ヘッダーで使用される警告値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + 警告の日付およびタイムスタンプ。 + + + 警告をアタッチしたホストを取得します。 + + を返します。警告をアタッチしたホスト。 + + + 特定の警告コードを取得します。 + + を返します。特定の警告コード。 + + + 警告の日付/タイム スタンプを取得します。 + + を返します。警告の日付およびタイムスタンプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + のインスタンスを返します。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 警告テキストを含む引用文字列を取得します。 + + を返します。警告テキストを含む引用文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/ko/a b/src/packages/System.Net.Http.4.3.1/ref/net46/ko/a new file mode 100644 index 00000000000..3034f4eded7 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/ko/a @@ -0,0 +1,2846 @@ + + + + System.Net.Http + + + + 바이트 배열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 매개 변수가 null입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 를 초기화하는 데 사용되는 매개 변수의 오프셋(바이트)입니다. + + 를 초기화하기 위해 사용되는 매개 변수에서 시작하는 의 바이트 수입니다. + + 매개 변수가 null입니다. + + 매개 변수가 0 미만인 경우또는 매개 변수의 값이 매개 변수가 지정한 콘텐츠 길이보다 큽니다.또는 매개 변수가 0보다 작은 경우또는 매개 변수가 매개 변수에서 지정한 콘텐츠 길이에서 매개 변수를 뺀 값보다 큽니다. + + + 백업 저장소가 의 메모리인 HTTP 콘텐츠 스트림을 읽기 위한 비동기 작업으로 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 생성자가 제공한 바이트 배열을 HTTP 콘텐츠 스트림에 비동기 작업으로 serialize하고 씁니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 채널 바인딩 토큰과 같은 전송에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 바이트 배열의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 바이트 배열의 길이(바이트)입니다. + + + 클라이언트 인증서 제공 방식을 지정합니다. + + + 사용 가능한 모든 클라이언트 인증서를 자동으로 제공하려는 입니다. + + + 응용 프로그램은 클라이언트 인증서를 에 수동으로 제공합니다.이 값이 기본값입니다. + + + HTTP 응답 메시지의 처리를 내부 처리기라는 다른 처리기로 위임하는 HTTP 처리기의 형식입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 새 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 필요에 따라 관리되는 리소스를 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답 메시지를 처리하는 내부 처리기를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지에 대한 내부 처리기입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + application/x-www-form-urlencoded MIME 형식을 사용하여 인코딩된 이름/값 튜플의 컨테이너입니다. + + + 이름/값 쌍의 특정 컬렉션을 사용하여 클래스의 새 인스턴스를 초기화합니다. + 이름/값 쌍으로 된 컬렉션입니다. + + + URI로 식별되는 리소스에서 HTTP 요청을 보내고 HTTP 응답을 받기 위한 기본 클래스를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 요청을 보내는 데 사용할 HTTP 처리기 스택입니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소를 가져오거나 설정합니다. + + 를 반환합니다.요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소입니다. + + + 이 인스턴스에서 보류 중인 모든 요청을 취소합니다. + + + 각 요청과 함께 보내야 하는 헤더를 가져옵니다. + + 를 반환합니다.각 요청과 함께 보내야 하는 헤더입니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 삭제할 수 있습니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true, 관리되지 않는 리소스만 해제하려면 false입니다. + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + 응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수를 가져오거나 설정합니다. + + 를 반환합니다.응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수입니다.이 속성의 기본값은 2GB입니다. + 지정한 크기가 0보다 작거나 같습니다. + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 요청 시간 제한 범위 내에서 대기할 기간을 가져오거나 설정합니다. + + 를 반환합니다.요청 시간 제한 범위 내에서 대기할 기간입니다. + 지정된 제한 시간이 0보다 작거나 같고 가 아닌 경우 + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + + 에 사용되는 기본 메시지 처리기입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 처리기가 리디렉션 응답을 따르는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기가 리디렉션 응답을 따라야 하는 경우 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + HTTP 콘텐츠 응답의 자동 압축 해체를 위한 처리기에서 사용되는 압축 해제 메서드의 형식을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 사용되는 자동 압축 풀기 방법입니다.기본값은 입니다. + + + 이 처리기와 관련된 보안 인증서의 컬렉션을 가져오거나 설정합니다. + + 를 반환합니다.이 처리기에 연결된 보안 인증서의 컬렉션입니다. + + + 처리기에서 서버 쿠키를 저장하는 데 사용하는 쿠키 컨테이너를 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 서버 쿠키를 저장하는 데 사용되는 쿠키 컨테이너입니다. + + + 이 처리기가 사용하는 인증 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기와 연결된 인증 자격 증명입니다.기본값은 null입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + 처리기가 따르는 최대 리디렉션 수를 가져오거나 설정합니다. + + 를 반환합니다.처리기가 따르는 최대 리디렉션 응답 수입니다.기본값은 50입니다. + + + 처리기에 사용되는 최대 요청 콘텐츠 버퍼 크기를 가져오거나 설정합니다. + + 를 반환합니다.최대 요청 콘텐츠 버퍼 크기(바이트)입니다.기본값은 2GB입니다. + + + 요청과 함께 처리기가 인증 헤더를 보낼 것인지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.인증을 수행한 이후 처리기가 요청과 함께 HTTP 권한 부여 헤더를 함께 보내는 경우 true 이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 사용하는 프록시 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기에 사용되는 프록시 정보입니다.기본값은 null입니다. + + + 차단되지 않을 작업으로 에서 제공된 정보를 기반으로 의 인스턴스를 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 처리기가 자동 응답 콘텐츠 압축 해제를 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기가 자동 응답 콘텐츠 압축 풀기를 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 프록시 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 프록시 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성에 대한 구성 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 속성에 대한 구성 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다. 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는 것을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 기본 자격 증명을 처리기의 요청과 함께 보내는지 여부를 제어하는 값을 가져오거나 설정합니다. + + 를 반환합니다.기본 자격 증명이 사용되면 true이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 요청에 대해 프록시를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 요청에 대해 프록시를 사용해야 하는 경우 true이고, otherwise false.기본값은 true입니다. + + + + 작업이 응답이 가능하면 즉시 완료된 것으로 간주되어야 하는지, 아니면 콘텐츠가 담긴 전체 응답 메시지를 읽은 후 완료된 것으로 간주되어야 하는지 여부를 나타냅니다. + + + 콘텐츠를 포함하여 전체 응답을 읽은 후 작업을 완료 해야 합니다. + + + 응답이 가능하고 헤더를 읽는 즉시 작업을 완료해야 합니다.콘텐츠를 아직 읽지 않았습니다. + + + HTTP 엔터티 본문과 콘텐츠 헤더를 나타내는 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠를 메모리 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + RFC 2616에 정의된 HTTP 콘텐츠 헤더를 가져옵니다. + + 를 반환합니다.RFC 2616에 정의된 콘텐츠 헤더입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 사용할 버퍼의 최대 크기(바이트)입니다. + + + HTTP 콘텐츠를 바이트 배열에 비동기 작업으로 Serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 serialize하고 콘텐츠를 비동기 작업으로 나타내는 스트림을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 문자열에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HTTP 콘텐츠의 길이(바이트)입니다. + + + HTTP 메시지 처리기의 기본 형식입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 응용 프로그램이 Http 처리기 체인에서 메서드를 호출할 수 있는 특수 클래스입니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 표준 HTTP 메서드를 검색 및 비교하고 새 HTTP 메서드를 만들기 위한 도우미 클래스입니다. + + + 특정 HTTP 메서드를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + + + HTTP DELETE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 HTTP 메서드입니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + HTTP GET 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 이 형식에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 의 해시 코드입니다. + + + HTTP HEAD 프로토콜 메서드를 나타냅니다.HEAD 메서드는 서버에서 응답의 메시지 본문 없이 메시지 헤더만 반환한다는 점을 제외하고는 GET 메서드와 동일합니다. + + 를 반환합니다. + + + HTTP 메서드입니다. + + 를 반환합니다.으로 표시되는 HTTP 메서드입니다. + + + 개체를 비교하는 같음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같으면 true이고, 그렇지 않으면 false입니다. + 같음 연산자의 왼쪽에 있는 입니다. + 같음 연산자의 오른쪽에 있는 입니다. + + + 개체를 비교하는 같지 않음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같지 않으면 true이고, 그렇지 않으면 false입니다. + 같지 않음 연산자의 왼쪽에 있는 입니다. + 같지 않음 연산자의 오른쪽에 있는 입니다. + + + HTTP OPTIONS 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 새 엔터티를 URI에 추가할 항목으로 게시하는 데 사용되는 HTTP POST 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + URI로 식별된 엔터티를 바꾸는 데 사용되는 HTTP PUT 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + HTTP TRACE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + + 클래스가 throw하는 예외의 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 현재 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + + + 현재 예외 및 내부 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + 내부 예외입니다. + + + HTTP 요청 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청 를 나타내는 문자열입니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청할 입니다. + + + HTTP 메시지의 내용을 가져오거나 설정합니다. + + 를 반환합니다.메시지 내용 + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 요청 헤더의 컬렉션입니다. + + + HTTP 요청 메서드에서 사용하는 HTTP 메서드를 가져오거나 설정합니다. + + 를 반환합니다.요청 메시지에서 사용하는 HTTP 메서드입니다.기본값은 GET 메서드입니다. + + + HTTP 요청의 속성 집합을 가져옵니다. + + 를 반환합니다. + + + HTTP 요청에 대한 를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청에 사용되는 입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 상태 코드와 데이터가 포함된 HTTP 응답 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 응답의 상태 코드입니다. + + + HTTP 응답 메시지의 텍스트 콘텐츠를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지의 내용입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되지 않는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답의 속성이 false이면 예외를 throw합니다. + + 를 반환합니다.호출이 성공할 경우 HTTP 응답 메시지입니다. + + + HTTP 응답 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 응답 헤더의 컬렉션입니다. + + + HTTP 응답이 성공했는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.HTTP 응답이 성공했는지 여부를 나타내는 값입니다.가 200-299 범위에 있으면 true이고, 그렇지 않으면 false입니다. + + + 일반적으로 서버에서 상태 코드와 함께 보내는 원인 문구를 가져오거나 설정합니다. + + 를 반환합니다.서버에서 보낸 원인 문구입니다. + + + 이 응답 메시지를 유도하는 요청 메시지를 가져오거나 설정합니다. + + 를 반환합니다.이 응답 메시지를 유도하는 요청 메시지입니다. + + + HTTP 응답의 상태 코드를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 상태 코드입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 요청 및/또는 응답 메시지의 적은 처리만 수행하는 처리기의 기본 형식입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + 서버에 보낸 각 요청에서 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 요청 메시지입니다. + 처리할 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 서버에서 각 응답에 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 응답 메시지입니다. + 처리할 HTTP 응답 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션을 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + + 이 null이거나 공백 문자만 있는 경우 + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + 여러 부분으로 구성된 콘텐츠에 대한 경계 문자열입니다. + + 이 null이거나 빈 문자열인 경우가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션에 multipart HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + multipart/* 콘텐츠 형식 사양을 통해 serialize된 개체의 컬렉션 사이를 이동하는 열거자를 반환합니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + multipart HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + + 메서드의 명시적 구현입니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + HTTP multipart 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HHTP 콘텐츠의 길이(바이트)입니다. + + + multipart/form-data MIME 형식을 사용하여 인코딩된 콘텐츠에 대한 컨테이너를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 데이터 콘텐츠에서 여러 부분으로 구성된 경계 문자열입니다. + + 가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + + 이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + 컬렉션에 추가할 HTTP 콘텐츠의 파일 이름입니다. + + 이 null이거나 공백 문자만 있는 경우또는이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + 스트림에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 에 대한 버퍼의 크기(바이트)입니다. + + 이 null인 경우 + + 가 0보다 작거나 같은 경우 + + + HTTP 스트림을 메모리 스트림에 비동기 작업으로 씁니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 스트림 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 스트림 콘텐츠의 길이(바이트)입니다. + + + 문자열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + 콘텐츠에 사용할 미디어 형식입니다. + + + 권한 부여, ProxyAuthorization, WWW-Authneticate 및 Proxy-Authenticate 헤더 값의 인증 정보를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명을 가져옵니다. + + 를 반환합니다.인증 정보가 들어 있는 자격 증명입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 권한 부여에 사용할 스키마를 가져옵니다. + + 를 반환합니다.권한 부여에 사용할 스키마입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Cache-Control 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 할당된 선택적 값이 각각 있는 캐시 확장 토큰입니다. + + 를 반환합니다.할당된 선택적 값이 각각 있는 캐시 확장 토큰의 컬렉션입니다. + + + + 개체에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + HTTP 클라이언트가 응답을 허용하는 최대 보관 기간(초로 지정)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 만료 시간을 초과한 응답을 수락하기까지의 최대 시간(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트가 응답을 허용하는 새로 고침 수명(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + 원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는 경우 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 캐시된 응답을 수용할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트가 캐시된 응답을 허용하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "no-cache" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는지 여부입니다. + + 를 반환합니다.캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 캐시 또는 프록시가 엔터티 본문을 변경해서는 안 되는지 여부입니다. + + 를 반환합니다.캐시나 프록시가 전체 본문의 어떤 부분도 변경하지 않아야 하는 경우 true이고, 그렇지 않으면 false입니다. + + + 캐시가 다른 HTTP 요청의 제약 조건과 일치하는 캐시 엔트리를 사용하여 반응하는지, 또는 504(게이트웨이 제한 시간) 상태로 반응하는지 여부 + + 를 반환합니다.캐시에서 HTTP 요청의 다른 제약 조건과 일관된 캐시된 엔트리를 사용하여 응답하거나 504(게이트웨이 시간 초과) 상태로 응답해야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 캐시 제어 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 캐시 제어 헤더 값 정보가 아닙니다. + + + HTTP 응답 메시지의 전체 또는 일부가 단일 사용자만 사용하기 위한 것이며 공유 캐시에서 캐시되지 않아야 하는지 여부 + + 를 반환합니다.HTTP 응답 메시지가 단일 사용자용이므로 공유 캐시에 캐시되지 않아야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "private" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하면 true이고, 그렇지 않으면 false입니다. + + + 대게 HTTP 응답이 공유되지 않는 캐시 내에서만 캐시할 수 있는지 여부도 포함하여 모든 캐시에서 캐시될 수 있는지 여부 + + 를 반환합니다.일반적으로 캐시할 수 없거나 비공유 캐시 내에서만 캐시할 수 있더라도, HTTP 응답을 캐시에서 캐시할 수 있으면 true이고, 그렇지 않으면 false입니다. + + + 초 단위로 지정된 공유된 최대 보관 기간으로, 공유 캐시의 경우 캐시 컨트롤 헤더나 Expires 헤더에서 "max-age" 지시문을 재정의하는 HTTP 응답에 사용됩니다. + + 를 반환합니다.초 단위 시간입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Disposition 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + 파일을 만든 날짜입니다. + + 를 반환합니다.파일 작성 날짜입니다. + + + 콘텐츠 본문 부분에 대한 처리 형식입니다. + + 를 반환합니다.처리 형식입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.제안된 파일 이름입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.폼 파일 이름*의 제안된 파일 이름입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 마지막으로 파일을 수정한 날짜입니다. + + 를 반환합니다.파일 수정 날짜입니다. + + + 콘텐츠 본문 부분에 대한 이름입니다. + + 를 반환합니다.콘텐츠 본문 부분에 대한 이름입니다. + + + Content-Disposition 헤더를 포함하는 매개 변수의 집합입니다. + + 를 반환합니다.매개 변수 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 처리 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 처리 헤더 값 정보가 아닙니다. + + + 파일에 마지막으로 읽은 날짜입니다. + + 를 반환합니다.마지막으로 읽은 날짜입니다. + + + 파일의 대략적인 크기(바이트)입니다. + + 를 반환합니다.대략적인 크기(바이트)입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치(바이트 단위)입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 콘텐츠 범위 헤더에 길이가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 길이가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 콘텐츠 범위에 범위가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 범위가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 전체 엔티티 본문의 길이를 가져옵니다. + + 를 반환합니다.전체 엔티티 본문의 길이입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 범위 헤더 값 정보가 아닙니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 사용된 범위의 단위입니다. + + 를 반환합니다.단위 범위를 포함하는 + + + 엔터티 태그 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + 이 엔터티 태그 헤더가 약한 유효성 검사기인지 여부를 나타내는 값입니다.엔터티 태그 헤더가 약한 유효성 검사기이면 를 true로 설정해야 합니다.엔터티 태그 헤더가 강한 유효성 검사기이면 를 false로 설정해야 합니다. + + + 엔터티 태그 헤더 값을 가져옵니다. + + 를 반환합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 엔터티 태그가 약점 표시로 시작하는지 여부를 가져옵니다. + + 를 반환합니다.취약성 표시기에 의해 엔터티 태그가 앞에 오면 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 엔터티 태그 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 엔터티 태그 헤더 값 정보가 아닙니다. + + + 불투명한 따옴표가 붙은 문자열을 가져옵니다. + + 를 반환합니다.불투명한 따옴표가 붙은 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 콘텐츠 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Allow 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Allow 헤더 값입니다. + + + HTTP 응답의 Content-Disposition 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Disposition 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Encoding 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Encoding 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Language 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Language 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Length 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Length 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Location 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Location 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-MD5 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-MD5 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Range 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Range 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Type 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Type 콘텐츠 헤더입니다. + + + HTTP 응답의 Expires 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Expires 콘텐츠 헤더입니다. + + + HTTP 응답의 Last-Modified 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Last-Modified 콘텐츠 헤더입니다. + + + RFC 2616에 정의된 헤더와 값의 컬렉션입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 컬렉션에 추가할 헤드 값의 목록입니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + + 컬렉션에서 헤더를 모두 제거합니다. + + + 특정 헤더가 컬렉션에 있는 경우 반환합니다. + + 를 반환합니다.지정된 헤더가 컬렉션에 있으면 true이고, 그렇지 않으면 false입니다. + 특정 헤더입니다. + + + + 인스턴스에서 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.에 대한 열거자입니다. + + + + 컬렉션에 저장된 지정된 헤더에 대한 모든 헤더 값을 반환합니다. + + 를 반환합니다.헤더 문자열의 배열입니다. + 값을 반환할 지정된 헤더입니다. + + + + 컬렉션에서 지정된 헤더를 제거합니다. + + 를 반환합니다. + 컬렉션에서 제거할 헤더의 이름입니다. + + + + 을 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.을 반복할 수 있는 인터페이스 구현의 인스턴스입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 지정된 헤더 및 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 값입니다. + + + 지정된 헤더 및 해당 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + 지정된 헤더와 지정된 값이 컬렉션에 저장되는 경우 반환합니다. + + 를 반환합니다.true는 지정된 헤더 이고 values는 컬렉션에 저장됩니다. 그렇지 않으면 false입니다. + 지정된 헤더입니다. + 지정된 헤더 값입니다. + + + 헤더 값의 컬렉션을 나타냅니다. + 헤더 컬렉션 형식입니다. + + + + 에 엔트리를 추가합니다. + 헤더 컬렉션에 추가할 항목입니다. + + + + 에서 모든 엔트리를 제거합니다. + + + + 에 항목이 포함되어 있는지 여부를 확인합니다. + + 를 반환합니다.엔트리가 인스턴스에 포함되어 있으면 true이고, 그렇지 않으면 false입니다. + 헤더 컬렉션을 찾을 항목입니다. + + + 대상 배열의 지정된 인덱스에서 시작하여 전체 을 호환되는 1차원 에 복사합니다. + + 에서 복사한 요소의 대상인 일차원 입니다.에는 0부터 시작하는 인덱스가 있어야 합니다. + + 에서 복사가 시작되는 인덱스(0부터 시작)입니다. + + + + 의 헤더 수를 가져옵니다. + + 를 반환합니다.컬렉션의 헤더 수입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + + 인스턴스가 읽기 전용인지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다. 인스턴스가 읽기 전용이면 true이고, 그렇지 않으면 false입니다. + + + 엔트리를 구문 분석하고 에 추가합니다. + 추가할 엔트리입니다. + + + 지정된 항목을 에서 제거합니다. + + 를 반환합니다. 인스턴스에서 제거되면 true이고, 그렇지 않으면 false입니다. + 제거할 항목입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 입력을 구문 분석하고 에 추가할 수 있는지 여부를 결정합니다. + + 를 반환합니다.을 구문 분석하고 인스턴스에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 유효성을 검사할 엔트리입니다. + + + RFC 2616에 정의된 요청 헤더의 컬렉션을 나타냅니다. + + + HTTP 요청의 Accept 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept 헤더 값입니다. + + + HTTP 요청의 Accept-Charset 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Charset 헤더 값입니다. + + + HTTP 요청의 Accept-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Encoding 헤더 값입니다. + + + HTTP 요청의 Accept-Language 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Language 헤더 값입니다. + + + HTTP 요청의 Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Authorization 헤더 값입니다. + + + HTTP 요청의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Cache-Control 헤더 값입니다. + + + HTTP 요청의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Connection 헤더 값입니다. + + + HTTP 요청에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 요청의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Date 헤더 값입니다. + + + HTTP 요청의 Expect 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Expect 헤더 값입니다. + + + HTTP 요청에 대한 Expect 헤더에 Continue가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Expect 헤더에 계속이 들어 있으면 true이고, otherwise false. + + + HTTP 요청의 From 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 From 헤더 값입니다. + + + HTTP 요청의 Host 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Host 헤더 값입니다. + + + HTTP 요청의 If-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-Match 헤더 값입니다. + + + HTTP 요청의 If-Modified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Modified-Since 헤더 값입니다. + + + HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + + HTTP 요청의 If-Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Range 헤더 값입니다. + + + HTTP 요청의 If-Unmodified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Unmodified-Since 헤더 값입니다. + + + HTTP 요청의 Max-Forwards 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Max-Forwards 헤더 값입니다. + + + HTTP 요청의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Pragma 헤더 값입니다. + + + HTTP 요청의 Proxy-Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Proxy-Authorization 헤더 값입니다. + + + HTTP 요청의 Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Range 헤더 값입니다. + + + HTTP 요청의 Referer 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Referer 헤더 값입니다. + + + HTTP 요청의 TE 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 TE 헤더 값입니다. + + + HTTP 요청의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Trailer 헤더 값입니다. + + + HTTP 요청의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Transfer-Encoding 헤더 값입니다. + + + HTTP 요청에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 요청의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Upgrade 헤더 값입니다. + + + HTTP 요청의 User-Agent 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 User-Agent 헤더 값입니다. + + + HTTP 요청의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Via 헤더 값입니다. + + + HTTP 요청의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Warning 헤더 값입니다. + + + RFC 2616에 정의된 응답 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Accept-Ranges 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Accept-Ranges 헤더 값입니다. + + + HTTP 응답의 Age 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Age 헤더 값입니다. + + + HTTP 응답의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Cache-Control 헤더 값입니다. + + + HTTP 응답의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Connection 헤더 값입니다. + + + HTTP 응답에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 응답의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Date 헤더 값입니다. + + + HTTP 응답의 ETag 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 ETag 헤더 값입니다. + + + HTTP 응답의 Location 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Location 헤더 값입니다. + + + HTTP 응답의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Pragma 헤더 값입니다. + + + HTTP 응답의 Proxy-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Proxy-Authenticate 헤더 값입니다. + + + HTTP 응답의 Retry-After 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Retry-After 헤더 값입니다. + + + HTTP 응답의 Server 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Server 헤더 값입니다. + + + HTTP 응답의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Trailer 헤더 값입니다. + + + HTTP 응답의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Transfer-Encoding 헤더 값입니다. + + + HTTP 응답에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Upgrade 헤더 값입니다. + + + HTTP 응답의 Vary 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Vary 헤더 값입니다. + + + HTTP 응답의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Via 헤더 값입니다. + + + HTTP 응답의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Warning 헤더 값입니다. + + + HTTP 응답의 WWW-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 WWW-Authenticate 헤더 값입니다. + + + RFC 2616에 정의된 대로 Content-Type 헤더에 사용된 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타낸 소스입니다. + + + 문자 집합을 가져오거나 설정합니다. + + 를 반환합니다.문자 집합입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 미디어 형식의 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값입니다. + + + 미디어 형식의 헤더 값 매개 변수를 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 유형 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 미디어 형식 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Type 헤더에 사용된 추가 품질 요소를 가진 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + 이 헤더 값과 연결된 품질입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 형식과 품질 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 미디어 형식이 아닙니다. + + + + 에 대한 품질 값을 가져오거나 설정합니다. + + 를 반환합니다. 개체의 품질 값입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 헤더 이름을 가져옵니다. + + 를 반환합니다.헤더 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 이름 값 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 헤더 값을 가져옵니다. + + 를 반환합니다.헤더 값입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 매개 변수를 가진 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + + 개체에서 매개 변수를 가져옵니다. + + 를 반환합니다.매개 변수를 포함하는 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값과 매개 변수 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 매개 변수 헤더 값 정보가 포함된 유효한 이름 값이 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + User-Agent 헤더의 제품 토큰 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 제품 토큰의 이름을 가져옵니다. + + 를 반환합니다.제품 토큰의 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 헤더 값 정보를 나타내는 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 제품 토큰의 버전을 가져옵니다. + + 를 반환합니다.제품 토큰의 버전입니다. + + + User-Agent 헤더에서 제품 또는 메모일 수 있는 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 주석 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + + 개체에서 주석을 가져옵니다. + + 를 반환합니다.이 의 주석 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 정보 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 제품 정보 헤더 값 정보가 아닙니다. + + + + 개체에서 제품을 가져옵니다. + + 를 반환합니다.이 의 제품 값입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 날짜/시간 또는 엔터티 태그 값일 수 있는 If-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 문자열로 나타내는 엔터티 태그입니다. + + + + 개체에서 날짜를 가져옵니다. + + 를 반환합니다. 개체의 날짜입니다. + + + + 개체에서 엔터티 태그를 가져옵니다. + + 를 반환합니다. 개체의 엔터티 태그입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 범위 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 바이트 범위를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 헤더 값 정보가 아닙니다. + + + + 개체에서 지정된 범위를 가져옵니다. + + 를 반환합니다. 개체의 범위입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체에서 단위를 가져옵니다. + + 를 반환합니다. 개체의 단위입니다. + + + 범위 헤더 값에서 바이트 범위를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 날짜/시간 또는 timespan 값일 수 있는 Retry-After 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜와 시간 오프셋입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 델타(초)입니다. + + + + 개체의 날짜와 시간 오프셋을 가져옵니다. + + 를 반환합니다. 개체의 날짜와 시간 오프셋입니다. + + + + 개체에서 델타(초)를 가져옵니다. + + 를 반환합니다. 개체의 델타(초)입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 다시 시도 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 다시 시도 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 선택적 품질의 문자열 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 새 인스턴스를 초기화하는 데 사용되는 품질 요소입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 품질 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 문자열이 아닙니다. + + + + 개체에서 품질 요소를 가져옵니다. + + 를 반환합니다. 개체의 품질 요소입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체의 문자열 값을 가져옵니다. + + 를 반환합니다. 개체의 문자열 값입니다. + + + accept-encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 전송 코딩 매개 변수를 가져옵니다. + + 를 반환합니다.전송 코딩 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 전송 코딩 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 전송 코딩 값을 가져옵니다. + + 를 반환합니다.전송 코딩 값입니다. + + + 선택적 품질 요소의 Accept-Encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 품질 요소의 값입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 전송 코딩이 아닙니다. + + + + 에서 품질 요소를 가져옵니다. + + 를 반환합니다.의 품질 요소입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Via 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + 수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 수취 프록시 또는 게이트웨이의 소프트웨어를 식별하는데 사용되는 설명 필드를 가져옵니다. + + 를 반환합니다.수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드를 반환합니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 Via 헤더 값 정보가 아닙니다. + + + 받은 프로토콜의 프로토콜 이름을 가져옵니다. + + 를 반환합니다.프로토콜 이름입니다. + + + 받은 프로토콜의 프로토콜 버전을 가져옵니다. + + 를 반환합니다.프로토콜 버전입니다. + + + 요청 또는 응답을 받은 호스트 및 포트를 가져옵니다. + + 를 반환합니다.요청 또는 응답을 받은 호스트 및 포트입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 경고 헤더에서 사용하는 경고 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + 경고의 날짜/시간 스탬프입니다. + + + 경고를 연결하는 호스트를 가져옵니다. + + 를 반환합니다.경고를 연결하는 호스트입니다. + + + 특정 경고 코드를 가져옵니다. + + 를 반환합니다.특정 경고 코드입니다. + + + 경고의 날짜/타임 스탬프를 가져옵니다. + + 를 반환합니다.경고의 날짜/시간 스탬프입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 인스턴스를 반환합니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 경고 텍스트가 포함된 따옴표 붙은 문자열을 가져옵니다. + + 를 반환합니다.경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/ru/a b/src/packages/System.Net.Http.4.3.1/ref/net46/ru/a new file mode 100644 index 00000000000..bc26ceba05f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/ru/a @@ -0,0 +1,2290 @@ + + + + System.Net.Http + + + + Предоставляет содержимое HTTP на основе массива байтов. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Значение параметра — null. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Смещение в байтах в параметре , используемом для инициализации объекта . + Число байтов в параметре , начиная с параметра , используемых для инициализации объекта . + Значение параметра — null. + Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром .– или –Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром без учета параметра . + + + Создает поток содержимого HTTP как асинхронную операцию для чтения, чье резервное хранилище — память из . + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация и запись указанного в конструкторе массива байтов в поток содержимого HTTP в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте, например, о токене привязки каналов.Этот параметр может иметь значение null. + + + Определяет, имеет ли массив байтов допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) массива байтов. + + + Определяет способ предоставления клиентских сертификатов. + + + Объект будет пытаться предоставить все доступные клиентские сертификаты автоматически. + + + Приложение вручную предоставляет клиентские сертификаты объектам .Это значение по умолчанию. + + + Тип для обработчиков HTTP, которые делегируют обработку ответных сообщений HTTP другому обработчику, который называется внутренним обработчиком. + + + Создание нового экземпляра класса . + + + Создает новый экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Освобождает неуправляемые ресурсы, используемые объектом , и по возможности — управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает внутренний обработчик, который обрабатывает сообщения откликов HTTP. + Возвращает .Внутренний обработчик для сообщений HTTP-откликов. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены для отмены операции. + Значение параметра — null. + + + Контейнер для кортежей " имя-значение ", закодированных с помощью типа MIME application/x-www-form-urlencoded. + + + Инициализирует новый экземпляр класса с конкретной коллекцией пар "имя-значение". + Коллекция пар имен и значений. + + + Предоставляет базовый класс для отправки HTTP-запросов и получения HTTP-ответов от ресурса с заданным URI. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса указанным обработчиком. + Стек обработчика HTTP-данных, используемый для отправки запросов. + + + Инициализирует новый экземпляр класса указанным обработчиком. + Компонент , отвечающий за обработку сообщений ответов HTTP. + Значение true, если внутренний обработчик должен быть удален с помощью Dispose(); значение false, если планируется повторно использовать внутренний обработчик. + + + Возвращает или задает базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + Возвращает .Базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + + + Отмена всех ожидающих запросов на этом экземпляре. + + + Возвращает заголовки, которые должны отправляться с каждым запросом. + Возвращает .Заголовки, которые должны отправляться с каждым запросом. + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Освобождает неуправляемые ресурсы, используемые объектом , и опционально удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Возвращает или задает максимальное число байтов в буфере при чтении содержимого отклика. + Возвращает .Максимальное число байтов в буфере при чтении содержимого отклика.Значением по умолчанию для этого свойства является 2 гигабайта. + Указанный размер меньше или равен нулю. + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Возвращает или задает время ожидания для выполнения запроса. + Возвращает .Время ожидания для выполнения запроса. + Указанное время ожидания меньше или равно нулю и не является . + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Обработчик сообщений по умолчанию, используемый объектом . + + + Создает экземпляр класса . + + + Получает или задает значение, которое указывает, должен ли обработчик следовать откликам переадресации. + Возвращает .Значение true, если обработчик должен следовать откликам перенаправления; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает тип метода распаковки, используемый обработчиком для автоматической распаковки содержимого отклика HTTP. + Возвращает .Метод автоматической распаковки, используемый обработчиком.Значение по умолчанию — . + + + Получает или задает коллекцию сертификатов безопасности, связанных с данным обработчиком. + Возвращает .Коллекция сертификатов безопасности, связанная с данным обработчиком. + + + Получает или задает контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + Возвращает .Контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + + + Получает или задает данные для аутентификации, используемые этим обработчиком. + Возвращает .Учетные данные аутентификации, связанные с заголовком.Значение по умолчанию: null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает максимальное количество переадресаций, выполняемых обработчиком. + Возвращает .Максимальное количество откликов переадресации, указаниям которых следует обработчик.Значение по умолчанию - 50. + + + Получает или задает максимальный размер буфера содержимого запроса, используемый обработчиком. + Возвращает .Максимальный размер буфера содержимого запроса в байтах.По умолчанию используется значение 2 гигабайта. + + + Получает или задает значение, указывающее, отправляет ли обработчик заголовок авторизации вместе с запросом. + Возвращает .Значение true для обработчика, с запросом требуется отправить заголовок авторизации HTTP после выполнения аутентификации; в противном случае — значение false.Значение по умолчанию — false. + + + Получает или задает сведения о прокси-сервере, используемом обработчиком. + Возвращает .Сведения о прокси-сервере, используемом обработчиком.Значение по умолчанию — null. + + + Создает экземпляр на основе сведений, предоставленных в как операция, которая не блокируется. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса. + Токен отмены для отмены операции. + Значение параметра — null. + + + Получает значение, указывающее, поддерживает ли обработчик автоматическую распаковку содержимого ответа. + Возвращает .Значение true, если обработчик поддерживает автоматическую распаковку содержимого отклика; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры прокси. + Возвращает .Значение true, если обработчик поддерживает параметры прокси-сервера; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры конфигурации для свойств и . + Возвращает .Значение true, если обработчик поддерживает параметры конфигурации для свойств и ; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, указывающее, использует ли обработчик свойство для хранения файлов cookie сервера, а также использует ли он эти файлы cookie при отправке запросов. + Возвращает .Значение true, если обработчик использует свойство для хранения файлов cookie сервера и использует эти файлы cookie при отправке запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, которое управляет отправкой обработчиком учетных данных по умолчанию вместе с запросами. + Возвращает .Значение равно true, если используются учетные данные по умолчанию, в противном случае — false.Значение по умолчанию — false. + + + Получает или задает значение, указывающее, использует ли обработчик прокси для запросов. + Возвращает .Значение true, если обработчик должен использовать прокси-сервер для запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Указывает, должны ли операции считаться завершенными, как только имеется отклик, или после чтения всего сообщения отклика, включая содержимое. + + + Операция должна завершиться после считывания всего отклика, включая содержимое. + + + Операция должна завершиться сразу после того, как отклик станет доступен и будут считаны заголовки.Содержимое еще не прочитано. + + + Базовый класс, представляющий заголовки содержимого и тело сущности HTTP. + + + Инициализирует новый экземпляр класса . + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Сериализация содержимого HTTP в поток памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает заголовки содержимого HTTP, определенные в RFC 2616. + Возвращает .Заголовки содержимого, соответствующие определениям в RFC 2616. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Максимальный размер используемого буфера в байтах. + + + Сериализация содержимого HTTP в массив байтов в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Выполнять сериализацию содержимого HTTP и возвращать поток, который представляет содержимое как асинхронную операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в строку в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое HTTP допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) HTTP-содержимого. + + + Базовый тип обработчиков сообщений HTTP. + + + Инициализирует новый экземпляр класса . + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Специальный Класс, который позволяет приложениям вызывать метод по цепочке обработчика HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + true, если внутренний обработчик должен быть удален с помощью Dispose (); false, если планируется повторно использовать внутренний обработчик. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Вспомогательный класс для получения и сравнения стандартных методов HTTP и создания новых методов HTTP. + + + Инициализирует новый экземпляр класса с конкретным методом HTTP. + Метод HTTP. + + + Представляет метод протокола HTTP DELETE. + Возвращает . + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Метод HTTP для сравнения с текущим объектом. + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Объект, который требуется сравнить с текущим объектом. + + + Представляет метод протокола HTTP GET. + Возвращает . + + + Служит в качестве хэш-функции для данного типа. + Возвращает .Хэш-код для текущего объекта . + + + Представляет метод протокола HTTP HEAD.Метод HEAD идентичен методу GET за исключением того, что сервер возвращает в ответе только заголовки сообщений без основного текста сообщений. + Возвращает . + + + Метод HTTP. + Возвращает .Метод HTTP, представленный в виде . + + + Оператор равенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и равны; в противном случае — значение false. + Объект , который находится слева от оператора равенства. + Объект , который находится справа от оператора равенства. + + + Оператор неравенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и не равны; в противном случае — значение false. + Объект , который находится слева от оператора неравенства. + Объект , который находится справа от оператора неравенства. + + + Представляет метод протокола HTTP OPTIONS. + Возвращает . + + + Представляет метод протокола HTTP POST, который используется для публикации новой сущности в качестве дополнения к URI. + Возвращает . + + + Представляет метод протокола HTTP PUT, который используется для замены сущности, указанной с помощью URI. + Возвращает . + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строка, представляющая текущий объект. + + + Представляет метод протокола HTTP TRACE. + Возвращает . + + + Базовый класс для исключений, вызванных классами и . + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключением. + Сообщение, описывающее текущее исключение. + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключение и внутреннее исключение. + Сообщение, описывающее текущее исключение. + Внутреннее исключение. + + + Представляет сообщение HTTP-запроса. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Строка, представляющая объект запроса. + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Запрашиваемый объект . + + + Получает или задает содержимое сообщения HTTP. + Возвращает .Содержимое сообщения + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает коллекцию заголовков HTTP-запросов. + Возвращает .Коллекция заголовков HTTP-запросов. + + + Получает или задает метод HTTP, используемый сообщением запроса HTTP. + Возвращает .Метод HTTP, используемый сообщением запроса.Значение по умолчанию — метод GET. + + + Получает набор свойств для HTTP-запроса. + Возвращает . + + + Получает или задает , используемый для HTTP-запроса. + Возвращает ., используемый для HTTP-запроса. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Представляет ответное сообщение HTTP, включая код и данные о состоянии. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным свойством . + Код состояния HTTP-отклика. + + + Получает или задает содержимое сообщения отклика HTTP. + Возвращает .Содержимое сообщения HTTP-отклика. + + + Освобождает неуправляемые ресурсы и удаляет неуправляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Создает исключение, если свойство для HTTP-отклика имеет значение false. + Возвращает .Сообщение ответа HTTP, если вызов метода завершился успешно. + + + Получает коллекцию заголовков HTTP-откликов. + Возвращает .Коллекция заголовков HTTP-откликов. + + + Получает значение, указывающее, был ли успешен HTTP-отклик. + Возвращает .Значение, указывающее, был ли успешен HTTP ответ.Значение true, если значение свойства находится в диапазоне 200-299; в противном случае — значение false. + + + Получает или задает фразу причины, которая обычно отправляется серверами вместе с кодом состояния. + Возвращает .Фраза причины, отправленная сервером. + + + Получает или задает сообщение запроса, на которое получено это сообщение отклика. + Возвращает .Сообщение запроса, на которое получено это сообщение отклика. + + + Получает или задает код состояния HTTP-отклика. + Возвращает .Код состояния HTTP-отклика. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Базовый тип для обработчиков, которые выполняют определенную небольшую часть обработки запросов и ответных сообщений. + + + Создает экземпляр класса . + + + Создает экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Выполняет обработку для каждого запроса, отправленного серверу. + Возвращает .Обработанное сообщение HTTP-запроса. + Сообщение HTTP-запроса для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Выполнить обработку на каждом ответе сервера. + Возвращает .Обработанное сообщение HTTP-отклика. + Сообщение HTTP-отклика для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Предоставляет коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Параметр имел значение null или содержит только пробелы. + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Строка, представляющая границу составного содержимого. + Параметр имеет значение null или содержит пустую строку.Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавить многокомпонентное содержимое HTTP в коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Возвращает перечислитель, который перебирает коллекцию объектов , которые сериализуются, используя спецификацию типа содержимого multipart/*. + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Сериализация содержимого HTTP, состоящего из нескольких частей, в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Явная реализация метода . + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Определяет, имеет ли содержимое HTTP из нескольких частей допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байта) HTTP-содержимого. + + + Предоставляет контейнер для закодированного с помощью типа MIME "multipart/form-data" содержимого. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Строка, представляющая границу составного содержимого данных формы. + Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Имя файла для HTTP-содержимого, которое требуется добавить в коллекцию. + Параметр имел значение null или содержит только пробелы.– или –Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Предоставляет содержимое HTTP на основе потока. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Размер (в байтах) буфера, доступного для . + Значение параметра — null. + Значение параметра было меньше или равно нулю. + + + Запись содержимого потока HTTP в поток в памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое потока допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) содержимого потока. + + + Предоставляет содержимое HTTP на основе строки. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + Тип мультимедиа, используемый для содержимого. + + + Представляет сведения об аутентификации в значениях заголовка Authorization, ProxyAuthorization, WWW-Authneticate и Proxy-Authenticate. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + Учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + Возвращает .Учетные данные, содержащие сведения об аутентификации. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает схему, используемую для авторизации. + Возвращает .Схема, которую требуется использовать для авторизации. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Cache-Control. + + + Инициализирует новый экземпляр класса . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Токены Кэш-расширения, каждый с необязательным присвоенным значения. + Возвращает .Коллекция токенов кэш-расширений, каждый с необязательным присвоенным значением. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Максимальная длительность, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Готов ли клиент HTTP принять отклик, срок действия которого истек. + Возвращает .Значение true, если клиент HTTP готов принять отклик, срок действия которого истек; в противном случае — значение false. + + + Максимальное время (в секундах), в течение которого клиент HTTP готов принять отклик, срок действия которого истек. + Возвращает .Время в секундах. + + + Длительность существования, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает; в противном случае — значение false. + + + Готов ли клиент HTTP принять кэшированный отклик. + Возвращает .Значение true, если клиент HTTP готов принять кэшированный отклик; в противном случае — значение false. + + + Коллекция имен полей в некэшированной директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Не должна ли храниться в кэше какая-либо часть сообщения HTTP-запроса или любого отклика. + Возвращает .Значение true, если в кэше не должна храниться какая-либо часть сообщения HTTP-запроса или любого отклика; в противном случае — значение false. + + + Не должен ли кэш или прокси изменять какой-либо аспект тела сущности. + Возвращает .Значение true, если кэш или прокси не должны изменять какой-либо аспект тела сущности; в противном случае — значение false. + + + Должен ли кэш отвечать, используя согласованную с другими ограничениями HTTP-запроса кэшированную запись или состояние 504 (время ожидания шлюза). + Возвращает .Значение true, если в отклике кэш должен либо использовать кэшированную запись, согласованную с другими ограничениями HTTP-запроса, либо состояние 504 (истекло время ожидания шлюза); в противном случае — значение false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка элемента управления кэшем. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка управления кэшем. + + + Предназначено ли все сообщение отклика HTTP или его часть для одного пользователя и не должно ли это сообщение или его часть кэшироваться в общем кэше. + Возвращает .Значение true, если сообщение HTTP-отклика предназначено для одного пользователя и не должно кэшироваться в общем кэше; в противном случае — значение false. + + + Имена полей коллекции в закрытой директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей; в противном случае — значение false. + + + Может ли отклик HTTP кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в необщем кэше. + Возвращает .Значение true, если HTTP-отклик может кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в кэше без общего доступа; в противном случае — значение false. + + + Общая максимальная длительность (в секундах) в отклике HTTP, которая переопределяет директиву "max-age" в заголовке управления кэшем или в заголовке Expires для общего кэша. + Возвращает .Время в секундах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Disposition. + + + Инициализирует новый экземпляр класса . + Объект . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Дата создания файла. + Возвращает .Дата создания файла. + + + Тип расположения для части основного текста содержимого. + Возвращает .Тип расположения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Предложение для построения имя файла для хранения полезных данные сообщения, используемое, если сущность удалена и хранится в отдельном файле. + Возвращает .Предлагаемое имя файла. + + + Предложение для построения имен файлов для хранения полезных данные сообщений, используемое, если сущности удалены и хранятся в отдельном файле. + Возвращает .Предложенное имя файла в виде filename*. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Дата последнего изменения файла. + Возвращает .Дата изменения файла. + + + Имя части тела содержимого. + Возвращает .Имя части тела содержимого. + + + Набор параметров содержал заголовок Content-Disposition. + Возвращает .Коллекция параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка расположения содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка расположения содержимого. + + + Дата последнего чтения файла. + Возвращает .Дата последнего считывания. + + + Приблизительный размер файла в байтах. + Возвращает .Приблизительный размер в байтах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Range. + + + Инициализирует новый экземпляр класса . + Начальная или конечная точка диапазона, в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + Начальная или конечная точка диапазона, в байтах. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Позиция начала передачи данных в байтах. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее, задана ли длина заголовка Content-Range. + Возвращает .true, если длина заголовка Content-Range задана; в противном случае — false. + + + Получает значение, указывающее, задано ли диапазон для Content-Range. + Возвращает .true, если диапазон заголовка Content-Range задан; в противном случае — false. + + + Получает длину полного тела сущности. + Возвращает .Длина полного тела сущности. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона содержимого. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Используемые единицы диапазона. + Возвращает .Объект , содержащий единицы диапазона. + + + Представляет значение заголовка тега сущности. + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + Значение, указывающее, является ли данный заголовок тега сущности слабым проверяющим элементом.Если заголовок тега сущности — слабый проверяющий элемент, должно быть установлено в значение true.Если заголовок тега сущности — сильный проверяющий элемент, должно быть установлено в значение false. + + + Получает значение заголовка тега сущности. + Возвращает . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее предшествует ли тегу сущности индикатор ослабления. + Возвращает .true, если тегу сущности предшествует индикатор ослабления; в противном случае — false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка тега сущности. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка тега сущности. + + + Получает Непрозрачную строку в кавычках. + Возвращает .Непрозрачная строка в кавычках. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет коллекцию заголовков Content в соответствии с RFC 2616. + + + Получает значение заголовка содержимого Allow в HTTP-ответе. + Возвращает .Значение заголовка Allow в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Disposition в HTTP-ответе. + Возвращает .Значение заголовка содержимого Content-Disposition в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Encoding в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Encoding в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Language в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Language в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Length в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Length в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Location в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Location в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-MD5 в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-MD5 в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Range в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Range в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Type в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Type в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Expires в HTTP-отклике. + Возвращает .Значение заголовка содержимого Expires в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Last-Modified в HTTP-отклике. + Возвращает .Значение заголовка содержимого Last-Modified в HTTP-отклике. + + + Коллекция заголовков и их значения, как указано в RFC 2616. + + + Инициализирует новый экземпляр класса . + + + Добавляет указанный заголовок и его значения в коллекцию . + Заголовок для добавления в коллекцию. + Список значений заголовков для добавления в коллекцию. + + + Добавляет указанный заголовок и его значение в коллекцию . + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Удаляет все заголовки из коллекции . + + + Возвращает, существует ли конкретный заголовок в коллекции . + Возвращает .Значение true, если указанный заголовок существует в коллекции; в противном случае — значение false. + Определенный заголовок. + + + Возвращает перечислитель, с помощью которого можно перебирать все элементы экземпляра коллекции . + Возвращает .Перечислитель для объекта . + + + Возвращает все значения заголовка для указанного заголовка, хранящихся в коллекции . + Возвращает .Массив строк заголовка. + Указанный заголовок, для которого требуется вернуть значения. + + + Удаляет указанный заголовок из коллекции . + Возвращает . + Имя заголовка, который должен быть удален из коллекции. + + + Возвращает перечислитель, который может перебирать элементы . + Возвращает .Экземпляр реализации , который может перебирать элементы в коллекции . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значения в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Значения заголовка. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значение в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Указывает, хранятся ли указанный заголовок и заданные значения в коллекции . + Возвращает .Значение true, если параметры и values указанного заголовка хранятся в коллекции; в противном случае — значение false. + Указанное средство чтения. + Заданные значения заголовка. + + + Представляет коллекцию значений заголовка. + Тип коллекции заголовков. + + + Добавляет запись в коллекцию . + Элемент для добавления в коллекцию заголовков. + + + Удаляет все записи из . + + + Определяет, содержит ли элемент. + Возвращает .Значение true, если запись содержится в экземпляре ; в противном случае — значение false. + Элемент для поиска в коллекцию заголовков. + + + Копирует целый массив в совместимый одномерный массив , начиная с заданного индекса целевого массива. + Одномерный массив , в который копируются элементы из интерфейса .Массив должен иметь индексацию, начинающуюся с нуля. + Индекс (с нуля) в массиве , с которого начинается копирование. + + + Получает количество заголовков в наборе . + Возвращает .Число заголовков в коллекции. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Получает значение, указывающее, действительно ли экземпляр доступен только для чтения. + Возвращает .Значение true, если экземпляр класса доступен только для чтения, в противном случае — значение false. + + + Анализирует и добавляет запись в . + Добавляемая запись. + + + Удаляет указанный элемент из поля со списком . + Возвращает .Значение true, если элемент успешно удален из экземпляра , в противном случае — значение false. + Удаляемый элемент. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Возвращает строку, представляющую текущий объект . объект. + Возвращает .Строка, представляющая текущий объект. + + + Определяет, может ли ввод быть проанализировано и добавлен в . + Возвращает .значение true, если может быть проанализировано и добавлен в экземпляр ; в противном случае — значение false + Проверяемое запись. + + + Представляет коллекцию заголовков Request в соответствии с RFC 2616. + + + Получает значение заголовка Accept для HTTP-запроса. + Возвращает .Значение заголовка Accept для HTTP-запроса. + + + Получает значение заголовка Accept-Charset для HTTP-запроса. + Возвращает .Значение заголовка Accept-Charset для HTTP-запроса. + + + Получает значение заголовка Accept-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Accept-Encoding для HTTP-запроса. + + + Получает значение заголовка Accept-Language для HTTP-запроса. + Возвращает .Значение заголовка Accept-Language для HTTP-запроса. + + + Получает или задает значение заголовка Authorization для HTTP-запроса. + Возвращает .Значение заголовка Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Cache-Control для HTTP-запроса. + Возвращает .Значение заголовка Cache-Control для HTTP-запроса. + + + Получает значение заголовка Connection для HTTP-запроса. + Возвращает .Значение заголовка Connection для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-запроса инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-запроса. + Возвращает .Значение заголовка Date для HTTP-запроса. + + + Получает значение заголовка Expect для HTTP-запроса. + Возвращает .Значение заголовка Expect для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Expect HTTP-запроса инструкцию Continue. + Возвращает .Значение true, если заголовок Expect содержит Continue; в противном случае — значение false. + + + Получает или задает значение заголовка From для HTTP-запроса. + Возвращает .Значение заголовка From для HTTP-запроса. + + + Получает или задает значение заголовка Host для HTTP-запроса. + Возвращает .Значение заголовка Host для HTTP-запроса. + + + Получает значение заголовка If-Match для HTTP-запроса. + Возвращает .Значение заголовка If-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Modified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Modified-Since для HTTP-запроса. + + + Получает значение заголовка If-None-Match для HTTP-запроса. + Возвращает .Получает значение заголовка If-None-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Range для HTTP-запроса. + Возвращает .Значение заголовка If-Range для HTTP-запроса. + + + Получает или задает значение заголовка If-Unmodified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Unmodified-Since для HTTP-запроса. + + + Получает или задает значение заголовка Max-Forwards для HTTP-запроса. + Возвращает .Значение заголовка Max-Forwards для HTTP-запроса. + + + Получает значение заголовка Pragma для HTTP-запроса. + Возвращает .Значение заголовка Pragma для HTTP-запроса. + + + Получает или задает значение заголовка Proxy-Authorization для HTTP-запроса. + Возвращает .Значение заголовка Proxy-Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Range для HTTP-запроса. + Возвращает .Значение заголовка Range для HTTP-запроса. + + + Получает или задает значение заголовка Referer для HTTP-запроса. + Возвращает .Значение заголовка Referer для HTTP-запроса. + + + Получает значение заголовка TE для HTTP-запроса. + Возвращает .Значение заголовка TE для HTTP-запроса. + + + Получает значение заголовка Trailer для HTTP-запроса. + Возвращает .Значение заголовка Trailer для HTTP-запроса. + + + Получает значение заголовка Transfer-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-запроса инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-запроса. + Возвращает .Значение заголовка Upgrade для HTTP-запроса. + + + Получает значение заголовка User-Agent для HTTP-запроса. + Возвращает .Значение заголовка User-Agent для HTTP-запроса. + + + Получает значение заголовка Via для HTTP-запроса. + Возвращает .Значение заголовка Via для HTTP-запроса. + + + Получает значение заголовка Warning для HTTP-запроса. + Возвращает .Значение заголовка Warning для HTTP-запроса. + + + Представляет коллекцию заголовков Response в соответствии с RFC 2616. + + + Получает значение заголовка Accept-Ranges для HTTP-отклика. + Возвращает .Значение заголовка Accept-Ranges для HTTP-отклика. + + + Получает или задает значение заголовка Age для HTTP-отклика. + Возвращает .Значение заголовка Age для HTTP-отклика. + + + Получает или задает значение заголовка Cache-Control для HTTP-отклика. + Возвращает .Значение заголовка Cache-Control для HTTP-отклика. + + + Получает значение заголовка Connection для HTTP-отклика. + Возвращает .Значение заголовка Connection для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-ответа инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-отклика. + Возвращает .Значение заголовка Date для HTTP-отклика. + + + Получает или задает значение заголовка ETag для HTTP-отклика. + Возвращает .Значение заголовка ETag для HTTP-отклика. + + + Получает или задает значение заголовка Location для HTTP-отклика. + Возвращает .Значение заголовка Location для HTTP-отклика. + + + Получает значение заголовка Pragma для HTTP-отклика. + Возвращает .Значение заголовка Pragma для HTTP-отклика. + + + Получает значение заголовка Proxy-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка Proxy-Authenticate для HTTP-отклика. + + + Получает или задает значение заголовка Retry-After для HTTP-отклика. + Возвращает .Значение заголовка Retry-After для HTTP-отклика. + + + Получает значение заголовка Server для HTTP-отклика. + Возвращает .Значение заголовка Server для HTTP-отклика. + + + Получает значение заголовка Trailer для HTTP-отклика. + Возвращает .Значение заголовка Trailer для HTTP-отклика. + + + Получает значение заголовка Transfer-Encoding для HTTP-отклика. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-ответа инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-отклика. + Возвращает .Значение заголовка Upgrade для HTTP-отклика. + + + Получает значение заголовка Vary для HTTP-отклика. + Возвращает .Значение заголовка Vary для HTTP-отклика. + + + Получает значение заголовка Via для HTTP-отклика. + Возвращает .Значение заголовка Via для HTTP-отклика. + + + Получает значение заголовка Warning для HTTP-отклика. + Возвращает .Значение заголовка Warning для HTTP-отклика. + + + Получает значение заголовка WWW-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка WWW-Authenticate для HTTP-отклика. + + + Представляет тип носителя, используемый в заголовке типа содержимого согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Источник, представленный в виде строки для инициализации нового экземпляра. + + + Получает или задает кодировку. + Возвращает .Набор символов. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает или задает значение заголовка типа носителя. + Возвращает .Значение заголовка типа мультимедиа. + + + Получает или задает параметры значения заголовка типа носителя. + Возвращает .Параметры значений заголовка типа мультимедиа. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка типа мультимедиа. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка типа мультимедиа. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет тип мультимедиа типа с дополнительными коэффициентом качества, используемый в заголовке типа содержимого. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + Качество, связанное с этим значением заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая тип мультимедиа со сведениями о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимыми типом мультимедиа со сведениями о значении заголовка качества. + + + Получает или задает значение качества для . + Возвращает .Значение качества для объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет пару " имя-значение ", которое используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя заголовка. + Возвращает .Имя заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка значения имени. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка значения имени. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение заголовка. + Возвращает .Значение заголовка. + + + Представляет пару " имя-значение " с параметрами, которые используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры объекта . + Возвращает .Коллекция, содержащая параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая значение имени со сведениями о значении заголовка параметров. + Параметр имеет ссылку null. + + не является допустимым значением имени со сведениями о значении заголовка параметра. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение токена продукта в заголовке агента пользователя. + + + Инициализирует новый экземпляр класса . + Название продукта. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя токена продукта. + Возвращает .Имя токена продукта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка продукта. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает версию токена продукта. + Возвращает .Версия токена продукта. + + + Представляет значение, которое может быть либо продуктом либо комментарием в заголовке User-Agent. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Значение комментария. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Получает комментарий из объекта . + Возвращает .Значение комментария — этот . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка информации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка сведений о продукте. + + + Получает продукт из объекта . + Возвращает .Значение продукта из данного объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка If-Range, которое может быть либо значением даты и времени, либо значением тега сущности. + + + Инициализирует новый экземпляр класса . + Значение даты, используемое для инициализации нового экземпляра . + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Тег сущности, представленный в виде строки, используемой для инициализации нового экземпляра. + + + Получает Дата из объекта . + Возвращает .Дата из объекта . + + + Получает Тег сущности объекта . + Возвращает .Тег сущности объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Range. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса диапазоном байтов. + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона. + + + Получает диапазоны, указанные из объекта . + Возвращает .Диапазоны из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает модуль из объекта . + Возвращает .Модуль из объекта . + + + Представляет диапазон байтов в значении заголовка Range. + + + Инициализирует новый экземпляр класса . + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Место начала передачи данных. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Представляет значение заголовка Retry-After, которое может быть либо значением даты и времени, либо значением интервала времени. + + + Инициализирует новый экземпляр класса . + Смещение даты и времени, используемое для инициализации нового экземпляра класса . + + + Инициализирует новый экземпляр класса . + Разность в секундах, используемая для инициализации нового экземпляра. + + + Получает смещение даты и времени от объекта . + Возвращает .Смещение даты и времени от объекта . + + + Получает Разность в секундах из объекта . + Возвращает .Разность в секундах из объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия повтора. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия повтора. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка строки с необязательным качеством. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Коэффициент качества, используемый для инициализации нового экземпляра . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимой строкой со сведениями о значении заголовка качества. + + + получает коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение строки из Объекта . + Возвращает .Значение строки из объекта . + + + Представляет значение заголовка Accept-Encoding. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры кодирования передачи. + Возвращает .параметры кодирования передачи. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка кодирования передачи. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка кодирования передачи. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение кодирования передачи. + Возвращает .значение кодирования передачи. + + + Представляет значение заголовка Accept-Encoding с необязательным коэффициентом качества. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Значение для коэффициента качества. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении кодирования передачи. + Параметр имеет ссылку null. + + не является допустимой кодировкой переноса со сведениями о значении заголовка качества. + + + Получает Коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Via. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Получает поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + Возвращает .Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Возвращает хэш-код текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка Via. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка Via. + + + Получает имя полученного протокола. + Возвращает .Имя протокола. + + + Получает версию полученного протокола. + Возвращает .Версия протокола. + + + Получает Узел и порт, которыми был получен запрос или ответ. + Возвращает .Узел и порт, которыми был получен запрос или отклик. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение предупреждения, используемое заголовком предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + Отметка даты и времени предупреждения. + + + Получает узел, который присоединил предупреждение. + Возвращает .Основное приложение, которое присоединило предупреждение. + + + Получает конкретный код предупреждения. + Возвращает .Конкретный код предупреждения. + + + Получает отметку даты и времени предупреждения. + Возвращает .Отметка даты и времени предупреждения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает экземпляр объекта . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает строку в кавычках, содержащую текст предупреждения. + Возвращает .Строка в кавычках, содержащая текст предупреждения. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hans/a b/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hans/a new file mode 100644 index 00000000000..3d0d1708770 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hans/a @@ -0,0 +1,2367 @@ + + + + System.Net.Http + + + + 基于字节数组提供 HTTP 内容。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数为 null。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数中用于初始化 的偏移量(以字节为单位)。 + + 中从用于初始化 参数开始的字节数。 + + 参数为 null。 + + 参数小于零。- 或 - 参数大于 参数指定的内容的长度。- 或 - 参数小于零。- 或 - 参数大于由 参数减去 参数所指定的内容长度。 + + + 创建 HTTP 内容流,它是其后备储存区是 的内存的读取的异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化并写入在构造函数中提供的字节数组到作为异步操作的 HTTP 内容流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息,例如,通道绑定。此参数可以为 null。 + + + 确定字节数组是否具有合法的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的字节数组的长度。 + + + 指定如何提供客户端证书。 + + + + 将尝试自动提供所有可用的客户端证书。 + + + 该应用程序向 手动提供客户端证书。这值是默认值。 + + + 将 HTTP 响应消息的处理委托给另一处理程序(称为“内部处理程序”)的 HTTP 处理程序的类型。 + + + 创建 类的新实例。 + + + 创建特定内部处理程序的 类的新实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置处理 HTTP 响应消息的内部处理程序。 + 返回 。HTTP 响应消息的内部处理程序。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 使用应用程序/x-www-form-urlencoded MIME 类型编码的名称/值元组的容器。 + + + 使用指定的名称/值对集合初始化 类的新实例。 + 名称/值对的集合。 + + + 提供基本类,用于发送 HTTP 请求和接收来自通过 URI 确认的资源的 HTTP 响应。 + + + 初始化 类的新实例。 + + + 用特定的处理程序初始化 类的新实例。 + 要用于发送请求的 HTTP 处理程序堆栈。 + + + 用特定的处理程序初始化 类的新实例。 + 负责处理 HTTP 响应消息的 。 + 如果内部处理程序应由 Dispose() 处理,则为 true,如果希望重用内部处理程序,则为 false。 + + + 获取或设置发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + 返回 。发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + + + 取消该实例所有挂起的请求。 + + + 获取与每个请求一起发送的标题。 + 返回 。应与每一个请求一起发送的标题。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果释放托管资源和非托管资源,则为 true;如果仅释放非托管资源,则为 false。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 获取或设置读取响应内容时要缓冲的最大字节数。 + 返回 。当读取响应内容时缓冲区的最大字节数。此属性的默认值为 2 GB。 + 指定小于或等于零。 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 获取或设置请求超时前等待的时间跨度。 + 返回 。请求超时前等待的时间跨度。 + 指定的超时值小于或等于零,并且不为 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + + 所用的默认消息版本。 + + + 创建 类的实例。 + + + 获取或设置一个值,该值指示处理程序是否应跟随重定向响应。 + 返回 。如果处理器应按照重定向响应,则为 true;否则为 false。默认值为 true。 + + + 获取或设置处理程序用于实现 HTTP 内容响应的自动解压缩的解压缩方法。 + 返回 。由处理程序使用的自动解压缩。默认值为 + + + 获取或设置与此处理程序关联的安全证书集合。 + 返回 。与此提供程序关联的安全证书的集合。 + + + 获取或设置用于存储处理程序产生的服务器 Cookie 的 Cookie 容器。 + 返回 。用于通过处理程序存储服务器 cookie 的 cookie 容器。 + + + 获取或设置此处理程序使用的身份验证信息。 + 返回 。与处理程序相关联的身份验证凭证。默认值为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置将跟随的处理程序的重定向的最大数目。 + 返回 。处理程序跟随的最大重定向响应数。默认值为 50。 + + + 获取或设置处理程序的使用的请求内容的最大缓冲区大小。 + 返回 。最大请求内容缓冲区大小(以字节为单位)。默认值为 2 GB。 + + + 获取或设置一个值,该值指示处理程序是否随请求发送一个“身份验证”标头。 + 返回 。处理程序的 true 在发生身份验证之后随请求一起发送 HTTP 授权标头;否则为 false。默认值为 false。 + + + 获取或设置处理程序使用的代理信息。 + 返回 。被处理程序使用的代理信息。默认值为 null。 + + + 创建基于作为不会阻塞的操作的 中提供的信息的 实例。 + 返回 。表示异步操作的任务对象。 + HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 获取指示处理程序是否支持自动响应内容解压的值。 + 返回 。如果处理器支持自动响应内容解压缩,则为 true;否则 false。默认值为 true。 + + + 获取指示处理程序是否支持代理设置的值。 + 返回 。如果处理器支持代理设置,则为 true;否则为 false。默认值为 true。 + + + 获取指示处理程序是否支持 属性配置设置的值。 + 返回 。如果处理器支持 属性的配置设置,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值指示发送请求时,处理程序是否使用 属性存储服务器 Cookie 并使用这些 Cookie。 + 返回 。如果处理程序支持使用 属性来存储服务器 Cookie 并在发送请求时使用这些 Cookie,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值控制默认凭据是否被处理程序随请求一起发送。 + 返回 。如果使用默认凭据,则为 true;否则为 false。默认值为 false。 + + + 获取或设置一个值,该值指示处理程序是否为请求使用代理。 + 返回 。如果该管理器应为请求使用代理项,则为 true;否则为 false。默认值为 true。 + + + 指示 操作是在响应可利用时立即视为已完成,还是在读取包含上下文的整个答案信息之后才视为已完成。 + + + 操作应在阅读包括该内容的整个响应之后完成。 + + + 响应一可用且标题可读时即应完成的操作。尚未读取的内容。 + + + 表示 HTTP 实体正文和内容标头的基类。 + + + 初始化 类的新实例。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 将 HTTP 内容序列化为内存流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 根据 RFC 2616 中的定义,获取内容标头。 + 返回 。如 RFC 2616 中定义的内容标头。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + 要使用的缓冲区的最大大小(以字节为单位)。 + + + 将 HTTP 内容序列化为字节数组以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化 HTTP 内容并返回表示内容的流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 将 HTTP 内容序列化到字符串以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定 HTTP 内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HTTP 对象的长度。 + + + HTTP 消息处理程序的基类型。 + + + 初始化 类的新实例。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个特殊类,它允许应用程序对 Http 处理程序链调用 方法。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + true 如果内部处理程序应由 Dispose 处理(),false ,如果您希望重用内部处理程序。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个帮助器类,它用于检索并比较标准 HTTP 方法并且用于创建新的 HTTP 方法。 + + + 使用指定的 HTTP 方法初始化 类的新实例。 + HTTP 方法。 + + + 表示一个 HTTP DELETE 协议方法。 + 返回 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前目标进行比较的 HTTP 方法。 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 表示一个 HTTP GET 协议方法。 + 返回 + + + 用作此类型的哈希函数。 + 返回 。当前 的哈希代码。 + + + 表示一个 HTTP HEAD 协议方法。除了服务器在响应中只返回消息头不返回消息体以外,HEAD 方法和 GET 是一样的。 + 返回 + + + HTTP 方法。 + 返回 。表示作为 的 HTTP 方法。 + + + 用于比较两个 对象的相等运算符。 + 返回 。如果指定的 参数相等,则为 true;否则为 false。 + 相等运算符左侧的 。 + 相等运算符右侧的 。 + + + 用于比较两个 对象的不相等运算符。 + 返回 。如果指定的 参数不相等,则为 true;否则为 false。 + 不相等运算符左侧的 。 + 不相等运算符右侧的 。 + + + 表示一个 HTTP OPTIONS 协议方法。 + 返回 + + + 表示一个 HTTP POST 协议方法,该方法用于将新实体作为补充发送到某个 URI。 + 返回 + + + 表示一个 HTTP PUT 协议方法,该方法用于替换 URI 标识的实体。 + 返回 + + + 返回表示当前对象的字符串。 + 返回 。一个表示当前对象的字符串。 + + + 表示一个 HTTP TRACE 协议方法。 + 返回 + + + + 所引发的异常的基类。 + + + 初始化 类的新实例。 + + + 使用由特定的用来描述当前异常的消息初始化 类的新实例。 + 描述当前异常的消息。 + + + 使用指定消息以及描述当前异常的内部异常来初始化 类的新实例。 + 描述当前异常的消息。 + 内部异常。 + + + 表示 HTTP 请求消息。 + + + 初始化 类的新实例。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 表示请求 的字符串。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 要请求的 。 + + + 获取或设置 HTTP 消息的内容。 + 返回 。消息的内容 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取 HTTP 请求标头的集合。 + 返回 。HTTP 请求标头的集合。 + + + 获取或设置 HTTP 请求信息使用的 HTTP 方法。 + 返回 。被请求消息使用的HTTP 方法。GET 是默认方法。 + + + 获取 HTTP 请求的属性集。 + 返回 + + + 获取或设置 HTTP 请求的 + 返回 。用于 HTTP 请求的 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 表示包括状态代码和数据的 HTTP 响应消息。 + + + 初始化 类的新实例。 + + + 初始化指定的 类的新实例。 + HTTP 响应的状态代码。 + + + 获取或设置 HTTP 响应消息的内容。 + 返回 。HTTP 响应消息的内容。 + + + 释放由 使用的非托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 如果 HTTP 响应的 属性为 false, 将引发异常。 + 返回 。如果调用成功则 HTTP 响应消息。 + + + 获取 HTTP 响应标头的集合。 + 返回 。HTTP 响应标头的集合。 + + + 获取一个值,该值指示 HTTP 响应是否成功。 + 返回 。指示 HTTP 响应是否成功的值。如果 在 200-299 范围中,则为 true;否则为 false。 + + + 获取或设置服务器与状态代码通常一起发送的原因短语。 + 返回 。服务器发送的原因词组。 + + + 获取或设置导致此响应消息的请求消息。 + 返回 。导致此响应信息的请求消息。 + + + 获取或设置 HTTP 响应的状态代码。 + 返回 。HTTP 响应的状态代码。 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 仅执行请求和/或响应消息的的某些小处理操作的处理程序的基类型。 + + + 创建 类的实例。 + + + 创建特定内部处理程序的 类的实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 对发送到服务器的每个响应执行处理。 + 返回 。被处理的 HTTP 请求消息。 + 要处理的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 对来自服务器的每个响应执行处理。 + 返回 。已处理的 HTTP 响应消息。 + 要处理的 HTTP 响应消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 提供 对象的集合,其可通过使用多部分/* 内容类型规范序列化。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + + 为 null 或只包含空白字符。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + 多部分内容的边界字符串。 + 为 null 或空字符串。 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 添加多部分 HTTP 内容到 对象的集合,其可通过使用多部分/* 内容类型规范获取序列化。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 返回循环访问 对象的集合的枚举器,其可通过使用多部分/* 内容类型规范序列化。 + 返回 。一个可用于循环访问集合的对象。 + + + 以异步操作将多部分 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + + 方法的显式实现。 + 返回 。一个可用于循环访问集合的对象。 + + + 确定 HTTP 多部分内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HHTP 对象的长度。 + + + 提供容器,用于使用多部分/表格数据 MIME 类型编码的内容。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分窗体数据内容的边界字符串。 + + 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + + 为 null 或只包含空白字符。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + 要添加到集合中的 HTTP 内容的文件名。 + + 为 null 或只包含空白字符。- 或 - 为 null 或只包含空白字符。 + + 为 null。 + + + 基于流提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + 的缓冲区的大小(以字节为单位)。 + + 为 null。 + + 小于或等于零。 + + + 以异步操作将 HTTP 流内容写入内存流。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定流内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的流内容的长度。 + + + 基于字符串提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + 要用于该内容的媒体。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authneticate 和 Proxy-Authenticate 标头值中的验证信息。 + + + 初始化 类的新实例。 + 用于授权的架构。 + + + 初始化 类的新实例。 + 用于授权的架构。 + 包含请求资源的用户代理的身份验证消息的凭证。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取包含所请求资源的用户代理的身份验证信息的凭据。 + 返回 。凭证包含身份验证信息。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取用于身份验证的方案。 + 返回 。用于授权的架构。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Cache-Control 标头的值。 + + + 初始化 类的新实例。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 缓存扩展符,每个缓存扩展符都赋有可选值。 + 返回 。缓存扩展符的集合,每个缓存扩展符都赋有可选值。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + HTTP 客户端愿意接受以秒为指定单位的最大生存期。 + 返回 。以秒为单位的时间。 + + + HTTP 客户是否愿意接受已超过其过期时间的响应。 + 返回 。如果HTTP 客户愿意接受已超过过期时间的响应,则为 true;否则为 false。 + + + HTTP 客户端愿意接受的已超过其过期时间的响应的最长时间(以秒为单位)。 + 返回 。以秒为单位的时间。 + + + HTTP 客户端愿意接受以秒为单位响应的新鲜生命期。 + 返回 。以秒为单位的时间。 + + + 缓存项过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 客户是否愿意接受缓存响应。 + 返回 。如果 HTTP 客户愿意接受缓存响应,则为 true,否则为 false。 + + + HTTP 响应时缓存控制标头字段中“no-cache”指令中的 fieldnames 的集合。 + 返回 。fieldnames 的集合。 + + + 缓存是否不能存储 HTTP 请求 mressage 或任何响应的任何部件。 + 返回 。如果缓存不能存储 HTTP 请求 mressage 或任何响应的任何部件,则 true;否则,为 false。 + + + 缓存或代理项是否无法更改该个体主体的任何方面。 + 返回 。如果缓存或代理项无法更改该个体主体的任何方面,则 true;否则,为 false。 + + + 缓存是否应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态。 + 返回 。如果缓存应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态,则 true;否则,为 false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示缓存控制标头值信息。 + + 为 null 引用。 + + 是无效的缓存控制标头值信息。 + + + HTTP 响应消息的全部或部分是否适用于单个用户且不得由共享缓存进行缓存。 + 返回 。如果 HTTP 响应消息的全部或部分适用于单个用户和是否必须由共享缓存进行缓存,则为 true;否则为 false。 + + + HTTP 响应时缓存控制标头字段中“私有”指令的集合 fieldnames。 + 返回 。fieldnames 的集合。 + + + 缓存项对共享的用户代理缓存过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项对共享的用户代理缓存过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 响应是否可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存。 + 返回 。如果 HTTP 响应可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存,则为 true;否则为 false。 + + + 在一个 HTTP 响应中共享的最大年龄,指定每秒,该响应直接在用于缓存-控件标题或一个用于缓存的过期标题中重载了“最大年龄”。 + 返回 。以秒为单位的时间。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Disposition 标头的值。 + + + 初始化 类的新实例。 + + 。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 创建文件的日期。 + 返回 。文件生成日期。 + + + 内容正文部分的处置类型。 + 返回 。处置类型。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 当实体在一个单独的文件中分离和储存时,如何为储存要使用的消息负载构造一个文件名的建议。 + 返回 。建议的文件名。 + + + 当主体在单独的文件中分离和储存时,如何为储存要使用的消息负载构造文件名的建议。 + 返回 。窗体 filename* 的建议文件名。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 上次修改文件的日期。 + 返回 。文件修改日期。 + + + 一个内容主体部分的名称。 + 返回 。该内容主体部分的名称。 + + + 参数集包含 Content-Disposition 标头。 + 返回 。参数的集合。 + + + 将字符串转换为 实例。 + 返回 实例。 + 字符串表示内容处置标头值信息。 + + 为 null 引用。 + + 是无效的内容处置标头值信息。 + + + 上次读取文件的日期。 + 返回 。上次读取日期。 + + + 文件的近似大小(字节)。 + 返回 。近似大小,以字节为单位。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Range 标头的值。 + + + 初始化 类的新实例。 + 范围的开始点或结束点(以字节为单位)。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + 范围的开始点或结束点(以字节为单位)。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置,以字节为单位。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取 Content-Range 标头是否具有指定的长度。 + 返回 。true如果 Content-Range 具有指定的长度,否则false。 + + + 获取 Content-Range 是否具有指定的范围。 + 返回 。true如果 Content-Range 具有指定的范围,否则false。 + + + 获取完整实体正文的长度。 + 返回 。完整的实体正文的长度。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示内容范围标头值信息。 + + 为 null 引用。 + + 是无效的内容范围标头值信息。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 使用大小单位。 + 返回 。包含范围单元的 + + + 表示实体标记标头值。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 初始化 类的新实例。 + 包含 的字符串。 + 一个指示此实体标记标头是否为弱验证程序的值。如果实体标记标头为弱验证程序,则应将 设置为 true。如果实体标记标头为强验证程序,则应将 设置为 false。 + + + 获取实体标记标头值。 + 返回 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取实体标记是否由缺点指示符开头。 + 返回 。true 如果由缺点指示符开头获取实体标记,否则false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示实体标记标头值信息。 + + 为 null 引用。 + + 是无效的实体标记标头值信息。 + + + 获取不透明的带引号字符串。 + 返回 。一个不透明的带引号的字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 响应的 Allow 内容标题的值。 + 返回 。请求 HTTP 的 Allow 标题的值。 + + + 获取 HTTP 响应的 Content-Disposition 内容标题的值。 + 返回 。请求 HTTP 的 Content-Disposition 内容标题的值。 + + + 获取 HTTP 响应的 Content-Encoding 内容标题的值。 + 返回 。请求 HTTP 的 Content-Encoding 内容标题的值。 + + + 获取 HTTP 响应的 Content-Language 内容标题的值。 + 返回 。请求 HTTP 的 Content-Language 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Length 内容标头值。 + 返回 。请求 HTTP 的 Content-Length 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Location 内容标头值。 + 返回 。请求 HTTP 的 Content-Location 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-MD5 内容标头值。 + 返回 。请求 HTTP 的 Content-MD5 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Range 内容标头值。 + 返回 。请求 HTTP 的 Content-Range 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Type 内容标头值。 + 返回 。请求 HTTP 的 Content-Type 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Expires 内容标头值。 + 返回 。请求 HTTP 的 Expires 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Last-Modified 内容标头值。 + 返回 。请求 HTTP 的 Last-Modified 内容标题的值。 + + + 标头及其在 RFC 2616 中定义的值的集合。 + + + 初始化 类的新实例。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 要向集合中添加的标头值的列表。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 标头的内容。 + + + 集合中移除所有标头。 + + + 如果指定标头存在于 集合中,则返回。 + 返回 。如果集合中存在指定标头,则为 true;否则为 false。 + 指定的读取器。 + + + 返回可循环访问 实例的枚举数。 + 返回 的一个枚举数。 + + + 返回存储在 集合中所有指定标头的标头值。 + 返回 。标头字符串数组。 + 返回值所应用的指定读取器。 + + + 集合中移除指定的标头。 + 返回 + 要从集合中移除的标头名称。 + + + 获取一个枚举数,该枚举数可以循环访问 + 返回 (可循环访问 )的实现的实例。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的值。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的内容。 + + + 如果指定的标头和指定的值存储在 集合中则返回。 + 返回 。true 是指定的标头 ,并且 values 已存储在集合中;否则 false。 + 指定标头。 + 指定的标头值。 + + + 表示标头值的集合。 + 标头集合类型。 + + + 将某项添加到 中。 + 要添加到标头集合的项。 + + + 中移除所有项。 + + + 确定 是否包含项目。 + 返回 。如果项包含在 实例中,则为 true;否则为 false。 + 要在标头集合中查找的项。 + + + 从目标数组的指定索引处开始将整个 复制到兼容的一维 + 作为从 复制的元素的目标的一维 必须具有从零开始的索引。 + + 中从零开始的索引,从此索引处开始进行复制。 + + + 获取 中标题的数目。 + 返回 。集合中的标头数 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 获取一个值,该值指示 实例是否为只读。 + 返回 。如果 实例为只读,则为 true;否则为 false。 + + + 分析项并将其添加到 + 要添加的项。 + + + 中移除指定的项。 + 返回 。如果已从 实例中成功移除 ,则为 true;否则为 false。 + 要移除的项。 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定是否能分析输入并将其添加到 + 返回 。如果可以分析 且可以将其添加到 实例,则为 true;否则为 false。 + 要验证的项。 + + + 表示在 RFC 2616 中定义的“请求标题”的集合。 + + + 获取 HTTP 请求的 Accept 标头的值。 + 返回 。请求 HTTP 的 Accept 标题的值。 + + + 获取 HTTP 请求的 Accept-Charset 标头的值。 + 返回 。请求 HTTP 的 Accept-Charset 标题的值。 + + + 获取 HTTP 请求的 Accept-Encoding 标头的值。 + 返回 。请求 HTTP 的 Accept-Encoding 标题的值。 + + + 获取 HTTP 请求的 Accept-Language 标头的值。 + 返回 。请求 HTTP 的 Accept-Language 标题的值。 + + + 获取或设置 HTTP 请求的 Authorization 标头值。 + 返回 。请求 HTTP 的 Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 请求的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取 HTTP 请求的 Expect 标头的值。 + 返回 。请求 HTTP 的 Expect 标题的值。 + + + 获取或设置指示 HTTP 请求的 Expect 标头是否应包含 Continue 的值。 + 返回 。如果 Expect 标头包含继续,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 From 标头值。 + 返回 。请求 HTTP 的 From 标题的值。 + + + 获取或设置 HTTP 请求的 Host 标头值。 + 返回 。请求 HTTP 的 Host 标题的值。 + + + 获取 HTTP 请求的 If-Match 标头的值。 + 返回 。请求 HTTP 的 If-Match 标题的值。 + + + 获取或设置 HTTP 请求的 If-Modified-Since 标头值。 + 返回 。请求 HTTP 的 If-Modified-Since 标题的值。 + + + 获取 HTTP 请求的 If-None-Match 标头的值。 + 返回 。获取 HTTP 请求的 If-None-Match 标头的值。 + + + 获取或设置 HTTP 请求的 If-Range 标头值。 + 返回 。请求 HTTP 的 If-Range 标题的值。 + + + 获取或设置 HTTP 请求的 If-Unmodified-Since 标头值。 + 返回 。请求 HTTP 的 If-Unmodified-Since 标题的值。 + + + 获取或设置 HTTP 请求的 Max-Forwards 标头值。 + 返回 。请求 HTTP 的 Max-Forwards 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取或设置 HTTP 请求的 Proxy-Authorization 标头值。 + 返回 。请求 HTTP 的 Proxy-Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Range 标头值。 + 返回 。请求 HTTP 的 Range 标题的值。 + + + 获取或设置 HTTP 请求的 Referer 标头值。 + 返回 。请求 HTTP 的 Referer 标题的值。 + + + 获取 HTTP 请求的 TE 标头的值。 + 返回 。请求 HTTP 的 TE 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 请求的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 User-Agent 标头的值。 + 返回 。请求 HTTP 的 User-Agent 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 请求的 Accept-Ranges 标头的值。 + 返回 。请求 HTTP 的 Accept-Ranges 标题的值。 + + + 获取或设置 HTTP 响应的 Age 标头值。 + 返回 。请求 HTTP 的 Age 标题的值。 + + + 获取或设置 HTTP 响应的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 响应的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 响应的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取或设置 HTTP 响应的 ETag 标头值。 + 返回 。请求 HTTP 的 ETag 标题的值。 + + + 获取或设置 HTTP 响应的 Location 标头值。 + 返回 。请求 HTTP 的 Location 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取 HTTP 请求的 Proxy-Authenticate 标头的值。 + 返回 。请求 HTTP 的 Proxy-Authenticate 标题的值。 + + + 获取或设置 HTTP 响应的 Retry-After 标头值。 + 返回 。请求 HTTP 的 Retry-After 标题的值。 + + + 获取 HTTP 请求的 Server 标头的值。 + 返回 。请求 HTTP 的 Server 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 响应的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 Vary 标头的值。 + 返回 。请求 HTTP 的 Vary 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 获取 HTTP 请求的 WWW-Authenticate 标头的值。 + 返回 。请求 HTTP 的 WWW-Authenticate 标题的值。 + + + 表示使用 Content-Type 标头的在 RFC 2616 中定义的媒体类型。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个以用于初始化新实例的字符串的形式表示的源。 + + + 获得或设置字符的设置。 + 返回 。字符集。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取或设置媒体类型标头值。 + 返回 。媒体类型的标头值。 + + + 获取或设置媒体类型标头值参数。 + 返回 。媒体类型的标头值参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示媒体类型标头值信息。 + + 为 null 引用。 + + 是无效的媒体类型标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 Content-Type 标头中使用的具有额外质量因素的媒体类型。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + 与标头值关联的质量。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有质量标头值信息的媒体类型的字符串。 + + 为 null 引用。 + + 是带有质量标头值信息的无效媒体类型。 + + + 获取或设置 的质量值。 + 返回 对象的质量值。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示用于各种标头的在 RFC 2616 中定义的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取标题名称。 + 返回 。标头名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示名称值标头值信息。 + + 为 null 引用。 + + 是无效的名称值标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取标题值。 + 返回 。标头值。 + + + 表示用于各种标头的在 RFC 2616 中定义的具有参数的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 对象获取参数。 + 返回 。一个包含参数的集合。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有参数标头值信息的名称值的字符串。 + + 为 null 引用。 + + 带有参数标头值信息的无效名称值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 User-Agent 标头中的产品标记值。 + + + 初始化 类的新实例。 + 产品名称。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取产品标记的名称。 + 返回 。产品标记的名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取产品标记的版本。 + 返回 。产品标记的版本。 + + + 表示可以是 User-Agent 标头中的产品或注释的值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个注释值。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 获取 对象中的注释。 + 返回 。此 的注释值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品信息标头值信息。 + + 为 null 引用。 + + 是无效的产品信息标头值信息。 + + + 获取 对象中的产品。 + 返回 。此 中的产品值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示可以是日期/时间或实体标记值 If-Range 标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的数据值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个实体标记,它以用于初始化新实例的字符串的形式表示。 + + + 对象获取日期。 + 返回 对象中的日期。 + + + 对象获取实体标记。 + 返回 对象的实体标记。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件范围标头值信息。 + + 为 null 引用。 + + 是无效的范围条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Range 标头值。 + + + 初始化 类的新实例。 + + + 使用字节范围初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示范围标头值信息。 + + 为 null 引用。 + + 是无效的范围标头值信息。 + + + 获取 对象中的指定范围。 + 返回 对象中的范围。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取 对象中的单元。 + 返回 对象中的单元。 + + + 表示 Range 标头值中的字节范围。 + + + 初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 表示 Retry-After 标头值,它可以是日期/时间或时间跨度值。 + + + 初始化 类的新实例。 + 用于初始化新实例的日期和时间偏移量。 + + + 初始化 类的新实例。 + 用于初始化新实例的增量(以秒为单位)。 + + + 获取相对于 对象的日期和时间偏移量。 + 返回 。当前 对象中的日期和时间偏移量。 + + + 对象获取增量(以秒为单位)。 + 返回 对象中的增量(以秒为单位)。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件重试标头值信息。 + + 为 null 引用。 + + 是无效的重试条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示具有可选外质量的字符串标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 用于初始化新实例的质量因素。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示质量标头值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效字符串。 + + + 对象获取质量因子。 + 返回 对象中的质量因子。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 对象获取字符串值。 + 返回 对象中的字符串值。 + + + 表示接受编码标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取调用代码的参数。 + 返回 。转让代码的参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码标头值信息。 + + 为 null 引用。 + + 无效的传输编码标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取调用代码的值。 + 返回 。转换代码的值。 + + + 表示具有可选额外质量因素的 Accept-Encoding 标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 质量因素的一个值。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效传输代码。 + + + 获取质量因子。 + 返回 中的质量因子。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Via 标头的值。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + 用于标识收件人代理或网关的软件的注释字段。 + + + 获取用于确定收件人代理或网关的软件的注释字段。 + 返回 。用于标识收件人代理或网关的软件的注释字段。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。返回当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示 Via 标头值信息。 + + 为 null 引用。 + + 是无效的 Via 标头值信息。 + + + 获取接受协议的协议名称。 + 返回 。协议名称。 + + + 获取接受协议的协议版本。 + 返回 。协议版本。 + + + 获取通过其进行请求或接收响应的主机和端口。 + 返回 。通过其接收请求或响应的主机和端口。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示警告标题使用的警告值。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + 文件操作的日期/警告签章。 + + + 获取附加警告的主机。 + 返回 。附加警告的主机。 + + + 获取特定警告代码。 + 返回 。特定警告代码。 + + + 获取警告的日期/时间戳。 + 返回 。文件操作的日期/警告签章。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取包含该警告文本的引用字符串。 + 返回 。包含该警告文本的引用字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hant/a b/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hant/a new file mode 100644 index 00000000000..fd129a695c2 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/net46/zh-hant/a @@ -0,0 +1,2368 @@ + + + + System.Net.Http + + + + 根據位元組陣列提供 HTTP 內容。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數為 null。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數中用來初始化 的位移 (以位元組為單位)。 + + 中的位元組數目(從用來初始化參數開始)。 + + 參數為 null。 + + 參數小於零。-或- 參數大於 參數指定的內容長度。-或- 參數小於零。-或- 參數大於 參數指定的內容長度,減去 參數。 + + + 建立 HTTP 內容資料流做為非同步讀取作業,其支援存放區是在 中的記憶體 + 傳回 。工作物件,表示非同步作業。 + + + 進行序列化,並以非同步方式將建構函式中提供的位元組陣列寫入到 HTTP 內容資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊,如通道繫結語彙基元。這個參數可以是 null。 + + + 判斷位元組陣列的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 位元組陣列的長度,以位元組為單位。 + + + 指定如何提供用戶端憑證。 + + + + 會嘗試自動提供所有可用的用戶端憑證。 + + + 應用程式會以手動方式提供用戶端憑證給 。這個值為預設值。 + + + HTTP 處理常式的類型,這些處理常式會將 HTTP 回應訊息的處理委派給另一個處理常式,也稱為內部處理常式。 + + + 建立 類別的新執行個體。 + + + 使用特定的內部處理常式,建立 類別的新執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理 HTTP 回應訊息的內部處理常式。 + 傳回 。HTTP 回應訊息的內部處理常式。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 使用 application/x-www-form-urlencoded MIME 類型編碼之名稱/值 Tuple 的容器。 + + + 使用特定名稱/值組集合,初始化 類別的新執行個體。 + 名稱/值組的集合。 + + + 提供基底類別,用來傳送 HTTP 要求,以及從 URI 所識別的資源接收 HTTP 回應。 + + + 初始化 類別的新執行個體。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 要用來傳送要求的 HTTP 處理常式堆疊。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 取得或設定傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + 傳回 。傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + + + 取消這個執行個體上的所有暫止要求。 + + + 取得應該在每個要求中傳送的標頭。 + 傳回 。應該藉由每個要求傳送的標頭。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true 表示會同時釋放 Managed 和 Unmanaged 資源;false 則表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 取得或設定讀取回應內容時要緩衝處理的位元組數目上限。 + 傳回 。讀取回應內容時要緩衝處理的位元組數目上限。此屬性的預設值是 2 GB。 + 指定的大小小於或等於零。 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 取得或設定要求逾時前等候的時間長度。 + 傳回 。要求逾時前等候的時間長度。 + 指定的逾時小於或等於零,並且不是 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + + 所使用的預設訊息處理常式。 + + + 建立 類別的執行個體。 + + + 取得或設定值,指出處理常式是否應該緊接在重新導向回應之後。 + 傳回 。如果處理常式應該接在重新導向回應之後,則為 true,否則為 false。預設值是 true。 + + + 取得或設定處理常式用來自動解壓縮 HTTP 內容回應的解壓縮方法型別。 + 傳回 。處理常式所使用的自動解壓縮方法。預設值是 + + + 取得或設定與這個處理常式相關聯的安全憑證集合。 + 傳回 。與這個處理常式相關聯的安全憑證的集合。 + + + 取得或設定處理常式用來儲存伺服器 cookie 的 cookie 容器。 + 傳回 。處理常式用來儲存伺服器 cookie 的 cookie 容器。 + + + 取得或設定這個處理常式所使用的驗證資訊。 + 傳回 。與處理常式相關聯的驗證認證。預設值為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理常式追蹤的最大重新導向數目。 + 傳回 。處理常式追蹤的最大重新導向回應數目。預設值為 50。 + + + 取得或設定處理常式所使用的要求內容緩衝區大小上限。 + 傳回 。要求內容緩衝區的大小上限,以位元組為單位。預設值為 2 GB。 + + + 取得或設定值,指出處理常式是否隨要求傳送授權標頭。 + 傳回 。true 表示在進行驗證後,處理常式隨同要求傳送 HTTP 驗證標頭,否則為 false。預設值為 false。 + + + 取得或設定處理常式使用的 Proxy 資訊。 + 傳回 。處理常式所使用的 proxy 資訊。預設值是 null。 + + + 根據 中提供的資訊,建立 的執行個體成為不會封鎖的作業。 + 傳回 。工作物件,表示非同步作業。 + HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 取得值,指出處理常式是否支援自動回應內容解壓縮。 + 傳回 。如果處理常式支援自動回應內容解壓縮,則為 true,否則為 false。預設值是 true。 + + + 取得值,指出處理常式是否支援 Proxy 設定。 + 傳回 。如果處理常式支援 Proxy 設定,則為 true,否則為 false。預設值是 true。 + + + 取得值,這個值指出處理常式是否支援 屬性的組態設定。 + 傳回 。如果處理常式支援 屬性的組態設定,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,指出處理常式是否使用 屬性,以儲存伺服器 cookie,並在傳送要求時使用這些 cookie。 + 傳回 。如果處理常式支援使用 屬性儲存伺服器 cookie,並在傳送要求時使用這些 cookie,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,該值會控制是否隨著處理常式的要求傳送預設認證。 + 傳回 。如果使用預設認證則為 true,否則為 false。預設值是 false。 + + + 取得或設定值,指出處理常式是否對要求使用 Proxy。 + 傳回 。如果處理常式應該使用 proxy 來處理要求,則為 true,否則為 false。預設值是 true。 + + + 表示 作業應該在取得回應之後立即視為已完成,或在讀取整個回應訊息 (包括內容) 之後視為已完成。 + + + 在讀取包括內容的完整回應之後,操作應該完成。 + + + 一旦回應可使用而標頭也已讀取後,就應完成作業。尚未讀取內容。 + + + 基底類別,表示 HTTP 實體內容與內容標題。 + + + 初始化 類別的新執行個體。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 內容標頭,如 RFC 2616 中所定義。 + 傳回 。RFC 2616 中所定義的標頭。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + 要使用的緩衝區的大小上限,以位元組為單位。 + + + 以非同步作業的方式將 HTTP 內容寫入至位元組陣列。 + 傳回 。工作物件,表示非同步作業。 + + + 將 HTTP 內容序列化,並以非同步作業的方式傳回表示內容的資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至字串。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷 HTTP 內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HTTP 內容的長度,以位元組為單位。 + + + HTTP 訊息處理常式的基底型別。 + + + 初始化 類別的新執行個體。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 特定類別,允許應用程式呼叫 HTTP 處理常式鏈結的 方法。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 協助程式類別,用於擷取和比較標準 HTTP 方法,以及建立新的 HTTP 方法。 + + + 使用特定 HTTP 方法,初始化 類別的新執行個體。 + HTTP 方法。 + + + 表示 HTTP DELETE 通訊協定方法。 + 傳回 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前專案比較的 HTTP 方法。 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 表示 HTTP GET 通訊協定方法。 + 傳回 + + + 做為此型別的雜湊函式。 + 傳回 。目前 的雜湊程式碼。 + + + 表示 HTTP HEAD 通訊協定方法。HEAD 方法與 GET 相同,除了伺服器只在回應中傳回訊息標頭,不含訊息主體。 + 傳回 + + + HTTP 方法。 + 傳回 。以 形式表示的 HTTP 方法。 + + + 等號比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數相等,則為 true,否則為 false。 + 等號比較運算子左邊的 。 + 等號比較運算子右邊的 。 + + + 不等比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數不相等,則為 true,否則為 false。 + 不等比較運算子左邊的 。 + 不等比較運算子右邊的 。 + + + 表示 HTTP OPTIONS 通訊協定方法。 + 傳回 + + + 表示 HTTP POST 通訊協定方法,用來公佈新實體至 URI 做為新增項目。 + 傳回 + + + 表示 HTTP PUT 通訊協定方法,用來取代 URI 所識別的實體。 + 傳回 + + + 傳回表示目前物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 HTTP TRACE 通訊協定方法。 + 傳回 + + + + 類別所擲回之例外狀況的基底類別。 + + + 初始化 類別的新執行個體。 + + + 使用描述目前例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + + + 使用描述目前例外狀況和內部例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + 內部例外狀況。 + + + 表示 HTTP 要求訊息。 + + + 初始化 類別的新執行個體。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 字串,表示要求 。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 要求的 。 + + + 取得或設定 HTTP 訊息的內容。 + 傳回 。訊息內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 要求標頭的集合。 + 傳回 。HTTP 要求標頭的集合。 + + + 取得或設定 HTTP 要求訊息所使用的 HTTP 方法。 + 傳回 。要求訊息所使用的 HTTP 方法。預設為 GET 方法。 + + + 取得 HTTP 要求的屬性集。 + 傳回 + + + 取得或設定用於 HTTP 要求的 + 傳回 。用於 HTTP 要求的 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 表示包含狀態碼及資料的 HTTP 回應訊息。 + + + 初始化 類別的新執行個體。 + + + 使用特定 ,初始化 類別的新執行個體。 + HTTP 回應的狀態碼。 + + + 取得或設定 HTTP 回應訊息的內容。 + 傳回 。HTTP 回應訊息的內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Unmanaged 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 如果 HTTP 回應的 屬性為 false,會擲回例外狀況。 + 傳回 。HTTP 回應訊息(如果該呼叫成功)。 + + + 取得 HTTP 回應標頭的集合。 + 傳回 。HTTP 回應標頭的集合。 + + + 取得值,指出 HTTP 回應是否成功。 + 傳回 。表示 HTTP 回應是否成功的值。如果 在範圍 200-299 中,則為 true,否則為 false。 + + + 取得或設定原因片語,通常由伺服器將它與狀態碼一起傳送。 + 傳回 。伺服器所傳送之原因詞彙。 + + + 取得或設定造成此回應訊息的要求訊息。 + 傳回 。造成此回應訊息的要求訊息。 + + + 取得或設定 HTTP 回應的狀態碼。 + 傳回 。HTTP 回應的狀態碼。 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 處理常式的基底型別,這些處理常式僅對要求和 (或) 回應訊息執行一些小型處理。 + + + 建立 類別的執行個體。 + + + 使用特定的內部處理常式,建立 類別的執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 執行對傳送至伺服器之每個要求的處理。 + 傳回 。處理的 HTTP 要求訊息。 + 要處理的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 執行對伺服器每個回應的處理。 + 傳回 。已處理的 HTTP 回應訊息。 + 要處理的 HTTP 回應訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + 為 null。 + + + 提供使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + + 為 null 或僅包含空白字元。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + 多重內容的界限字串。 + + 為 null,或是空字串。 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將多重部分 HTTP 內容加入至使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 傳回列舉程式,此列舉程式可以逐一查看 物件的集合,該集合會使用多重/* 內容型別規格進行序烈化。 + 傳回 。用於逐一查看集合的物件。 + + + 以非同步作業方式將多個 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + + 方法的明確實作。 + 傳回 。用於逐一查看集合的物件。 + + + 判斷 HTTP 多部分內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HHTP 內容的長度,以位元組為單位。 + + + 提供使用多重/表單資料 MIME 類型編碼內容的容器。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多重表單資料內容的界限字串。 + + 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + + 為 null 或僅包含空白字元。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + 要加入至集合中的 HTTP 內容的檔案名稱。 + + 為 null 或僅包含空白字元。-或- 為 null 或僅包含空白字元。 + + 為 null。 + + + 根據資料流提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + 的緩衝區大小,以位元組為單位。 + + 為 null。 + + 小於或等於零值。 + + + 將 HTTP 資料流內容寫入至記憶體資料流,做為非同步作業。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷資料流內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 資料流內容的長度,以位元組為單位。 + + + 根據字串提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + 要用於內容的媒體類型。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authenticate 和 Proxy 驗證標頭值中的驗證資訊。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + 認證,包含所要求資源的使用者代理程式驗證資訊。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得認證,包含所要求資源的使用者代理程式驗證資訊。 + 傳回 。包含驗證資訊的認證。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得用於授權的配置。 + 傳回 。用於授權的配置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Cache-Control標頭的值。 + + + 初始化 類別的新執行個體。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 快取擴充權杖,其中每個權杖都有選擇性指派的值。 + 傳回 。快取擴充語彙基元的集合,其中每個語彙基元都有選擇性指派的值。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + HTTP 用戶端願意接受回應的最長保留期限(以秒為單位來指定)。 + 傳回 。秒數。 + + + 否 HTTP 用戶端願意接受已經超過其到期時間的回應。 + 傳回 。如果 HTTP 用戶端願意接受已經超過到期時間的回應,則為 true,否則為 false。 + + + HTTP 用戶端願意接受已經超過其到期時間的回應的最長時間(以秒為單位)。 + 傳回 。秒數。 + + + HTTP 用戶端願意接受回應的有效期限存留期(以秒為單位)。 + 傳回 。秒數。 + + + 當快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 用戶端願意接受快取的回應。 + 傳回 。如果 HTTP 用戶端願意接受快取的回應,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "no-cache" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 是否快取絕不可以儲存 HTTP 要求訊息或任何回應的任何組成部分。 + 傳回 。如果快取中不能儲存 HTTP 要求訊息或任何回應的任何組成部分,則為 true,否則為false。 + + + 是否快取或 Proxy 絕不可以變更實體主體的任何層面。 + 傳回 。如果快取或 Proxy 絕不可以變更實體主體的任何層面,則為 true,否則為false。 + + + 是否快取應該使用符合 HTTP 要求的其他約束條件的快取項目來回應,或是以 504 (閘道逾時) 狀態來回應。 + 傳回 。如果快取必須使用符合 HTTP 要求的其他條件約束之已快取項目來做回應,或使用 504 (Gateway Timeout) 狀態做回應,則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示快取控制項標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的快取控制標頭值資訊。 + + + 是否整個或部分的 HTTP 回應訊息僅供單一使用者使用,或絕不可由共用快取來快取。 + 傳回 。如果 HTTP 回應訊息僅供單一使用者使用,而且不可由共用快取來快取,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "private" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 當共用使用者代理快取的快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當共用使用者代理快取的快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取。 + 傳回 。如果 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取,則為 true,否則為 false。 + + + HTTP 回應中的共用最長使用期限(以秒為單位),會覆蓋快取控制標頭或共用快取的到期日標頭中的 "max-age" 指示詞。 + 傳回 。秒數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Disposition 標頭的值。 + + + 初始化 類別的新執行個體。 + + 。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 建立檔案的日期。 + 傳回 。檔案建立日期。 + + + 內容內文部分的配置類型。 + 傳回 。配置類型。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。建議的檔案名稱。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。表單檔案名稱的建議檔案名稱*。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 上次修改檔案的日期。 + 傳回 。檔案修改日期。 + + + 內容主體組件的名稱。 + 傳回 。內容主體組件的名稱。 + + + 一組包含 Content-Disposition 標頭的參數。 + 傳回 。參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容配置標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容配置標頭值資訊。 + + + 上次讀取檔案的日期。 + 傳回 。上次讀取日期。 + + + 檔案的約略大小大小,以位元組為單位。 + 傳回 。約略大小,以位元組為單位。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Range 標頭的值。 + + + 初始化 類別的新執行個體。 + 範圍的起始和結束點 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + 範圍的起始和結束點 (以位元組表示)。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置 (以位元組表示)。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得 Content-Range 標頭是否有指定的長度。 + 傳回 。如果 Content-Range 有指定長度則為 true,否則為 false。 + + + 取得 Content-Range 是否有指定的範圍。 + 傳回 。如果 Content-Range 有指定範圍則為 true,否則為 false。 + + + 取得完整實體內容的長度。 + 傳回 。完整實體內容的長度。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容範圍標頭值資訊。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 使用的範圍單位。 + 傳回 。包含範圍單位的 + + + 表示實體標記標頭值。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + 表示這個實體標記標頭是否為弱式驗證程式的值。如果實體標記標頭是弱式驗證程式,則應該將 設定為 true。如果實體標記標頭是強式驗證程式,則應該將 設定為 false。 + + + 取得實體標記標頭值。 + 傳回 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得實體標記的前端是否有弱點指標。 + 傳回 。如果實體標記有弱式指標做為開頭則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示實體標記標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的實體標記標頭值資訊。 + + + 取得不透明的引號括住的字串。 + 傳回 。不透明的引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示內容標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Allow 內容標頭的值。 + 傳回 。HTTP 回應的 Allow 標頭的值。 + + + 取得 HTTP 回應的 Content-Disposition 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Disposition 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Encoding 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Encoding 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Language 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Language 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Length 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Length 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Location 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Location 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-MD5 內容標頭的值。 + 傳回 。HTTP 回應的 Content-MD5 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Range 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Range 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Type 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Type 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Expires 內容標頭的值。 + 傳回 。HTTP 回應的 Expires 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Last-Modified 內容標頭的值。 + 傳回 。HTTP 回應的 Last-Modified 內容標頭的值。 + + + 標頭及其值的集合,如 RFC 2616 中所定義的。 + + + 初始化 類別的新執行個體。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 要加入至集合的標頭值清單。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 移除 集合中的所有標頭。 + + + 傳回 集合中是否有特定標頭。 + 傳回 。true 為指定的標頭存在於集合中,否則為 false。 + 特定的標頭。 + + + 傳回可以逐一查看 執行個體的列舉值。 + 傳回 的列舉值。 + + + 傳回儲存在 集合中的指定標頭的所有標頭值。 + 傳回 。標頭字串的陣列。 + 要為其傳回值的指定標頭。 + + + 集合中移除指定的標頭。 + 傳回 + 要從集合中移除的標頭名稱。 + + + 傳回可以逐一查看 的列舉程式。 + 傳回 。可以逐一查看 實作執行個體。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的值。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 傳回指定的標頭和指定的值是否儲存在集合中。 + 傳回 。如果指定的標頭 和 values 儲存在集合中,則為 true,否則為 false。 + 指定的標頭。 + 指定的標頭值。 + + + 表示標頭值的集合。 + 標頭集合類型。 + + + 將項目加入至 + 要加入至標頭集合中的項目。 + + + 移除 的所有項目。 + + + 判斷 是否包含項目。 + 傳回 。如果 執行個體中包含項目,則為 true,否則為 false。 + 要在標頭集合中尋找的項目。 + + + 從目標陣列的指定索引開始,複製整個 至相容的一維 + 一維 ,是從 複製過來之項目的目的端。 必須有以零起始的索引。 + + 中以零起始的索引,是複製開始的位置。 + + + 取得 中的標頭數目。 + 傳回 。集合中的標頭數。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 取得值,該值指出 執行個體是否唯讀。 + 傳回 。如果 執行個體是唯讀,則為 true,否則為 false。 + + + 剖析項目並將其加入至 + 要加入的項目。 + + + 中移除指定項目。 + 傳回 。如果 已成功從 執行個體中移除,則為 true,否則為 false。 + 要移除的項目。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷輸入是否可加以剖析並加入至 + 傳回 。如果可以剖析 並將其加入至 執行個體則為 true,否則為 false + 要驗證的項目。 + + + 表示要求標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 要求的 Accept 標頭值。 + 傳回 。HTTP 要求的 Accept 標頭的值。 + + + 取得 HTTP 要求的 Accept-Charset 標頭值。 + 傳回 。HTTP 要求的 Accept-Charset 標頭的值。 + + + 取得 HTTP 要求的 Accept-Encoding 標頭值。 + 傳回 。HTTP 要求的 Accept-Encoding 標頭的值。 + + + 取得 HTTP 要求的 Accept-Language 標頭值。 + 傳回 。HTTP 要求的 Accept-Language 標頭的值。 + + + 取得或設定 HTTP 要求之 Authorization 標頭的值。 + 傳回 。HTTP 要求的 Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Cache-Control 標頭的值。 + 傳回 。HTTP 要求的 Cache-Control 標頭的值。 + + + 取得 HTTP 要求的 Connection 標頭值。 + 傳回 。HTTP 要求的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 Date 標頭的值。 + 傳回 。HTTP 要求的 Date 標頭的值。 + + + 取得 HTTP 要求的 Expect 標頭值。 + 傳回 。HTTP 要求的 Expect 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Expect 標頭是否包含 Continue。 + 傳回 。如果 Expect 標頭包含 Continue 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 From 標頭的值。 + 傳回 。HTTP 要求的 From 標頭的值。 + + + 取得或設定 HTTP 要求之 Host 標頭的值。 + 傳回 。HTTP 要求的 Host 標頭的值。 + + + 取得 HTTP 要求的 If-Match 標頭值。 + 傳回 。HTTP 要求的 If-Match 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Modified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Modified-Since 標頭的值。 + + + 取得 HTTP 要求的 If-None-Match 標頭值。 + 傳回 。取得 HTTP 要求的 If-None-Match 標頭值。 + + + 取得或設定 HTTP 要求之 If-Range 標頭的值。 + 傳回 。HTTP 要求的 If-Range 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Unmodified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Unmodified-Since 標頭的值。 + + + 取得或設定 HTTP 要求之 Max-Forwards 標頭的值。 + 傳回 。HTTP 要求的 Max-Forwards 標頭的值。 + + + 取得 HTTP 要求的 Pragma 標頭值。 + 傳回 。HTTP 要求的 Pragma 標頭的值。 + + + 取得或設定 HTTP 要求之 Proxy-Authorization 標頭的值。 + 傳回 。HTTP 要求的 Proxy-Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Range 標頭的值。 + 傳回 。HTTP 要求的 Range 標頭的值。 + + + 取得或設定 HTTP 要求之 Referer 標頭的值。 + 傳回 。HTTP 要求的 Referer 標頭的值。 + + + 取得 HTTP 要求的 TE 標頭值。 + 傳回 。HTTP 要求的 TE 標頭的值。 + + + 取得 HTTP 要求的 Trailer 標頭值。 + 傳回 。HTTP 要求的 Trailer 標頭的值。 + + + 取得 HTTP 要求的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 要求的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 要求的 Upgrade 標頭值。 + 傳回 。HTTP 要求的 Upgrade 標頭的值。 + + + 取得 HTTP 要求的 User-Agent 標頭值。 + 傳回 。HTTP 要求的 User-Agent 標頭的值。 + + + 取得 HTTP 要求的 Via 標頭值。 + 傳回 。HTTP 要求的 Via 標頭的值。 + + + 取得 HTTP 要求的 Warning 標頭值。 + 傳回 。HTTP 要求的 Warning 標頭的值。 + + + 表示回應標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Accept-Ranges 標頭值。 + 傳回 。HTTP 回應的 Accept-Ranges 標頭的值。 + + + 取得或設定 HTTP 回應之 Age 標頭的值。 + 傳回 。HTTP 回應的 Age 標頭的值。 + + + 取得或設定 HTTP 回應之 Cache-Control 標頭的值。 + 傳回 。HTTP 回應的 Cache-Control 標頭的值。 + + + 取得 HTTP 回應的 Connection 標頭值。 + 傳回 。HTTP 回應的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 回應之 Date 標頭的值。 + 傳回 。HTTP 回應的 Date 標頭的值。 + + + 取得或設定 HTTP 回應之 ETag 標頭的值。 + 傳回 。HTTP 回應的 ETag 標頭的值。 + + + 取得或設定 HTTP 回應之 Location 標頭的值。 + 傳回 。HTTP 回應的 Location 標頭的值。 + + + 取得 HTTP 回應的 Pragma 標頭值。 + 傳回 。HTTP 回應的 Pragma 標頭的值。 + + + 取得 HTTP 回應的 Proxy-Authenticate 標頭值。 + 傳回 。HTTP 回應的 Proxy-Authenticate 標頭的值。 + + + 取得或設定 HTTP 回應之 Retry-After 標頭的值。 + 傳回 。HTTP 回應的 Retry-After 標頭的值。 + + + 取得 HTTP 回應的 Server 標頭值。 + 傳回 。HTTP 回應的 Server 標頭的值。 + + + 取得 HTTP 回應的 Trailer 標頭值。 + 傳回 。HTTP 回應的 Trailer 標頭的值。 + + + 取得 HTTP 回應的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 回應的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 回應的 Upgrade 標頭值。 + 傳回 。HTTP 回應的 Upgrade 標頭的值。 + + + 取得 HTTP 回應的 Vary 標頭值。 + 傳回 。HTTP 回應的 Vary 標頭的值。 + + + 取得 HTTP 回應的 Via 標頭值。 + 傳回 。HTTP 回應的 Via 標頭的值。 + + + 取得 HTTP 回應的 Warning 標頭值。 + 傳回 。HTTP 回應的 Warning 標頭的值。 + + + 取得 HTTP 回應的 WWW-Authenticate 標頭值。 + 傳回 。HTTP 回應的 WWW-Authenticate 標頭的值。 + + + 表示用於依 RFC 2616 所定義之內容類型標頭的媒體類型。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 表示為字串以初始化新執行個體的來源。 + + + 取得或設定字元集。 + 傳回 。字元集。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得或設定媒體型別標頭值。 + 傳回 。媒體類型標頭值。 + + + 取得或設定媒體類型標頭值參數。 + 傳回 。媒體類型標頭值參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的媒體類型標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示具有用於內容類型標頭之其他品質係數的媒體類型。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + 與這個標頭值相關聯的品質。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型的字串,含有品質標頭值資訊。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效媒體類型。 + + + 取得或設定 的品質值。 + 傳回 物件的品質值。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得標頭名稱。 + 傳回 。標頭名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的名稱值標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得標頭值。 + 傳回 。標頭值。 + + + 表示搭配參數用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 物件取得參數。 + 傳回 。包含參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值的字串,含有參數標頭值資訊。 + + 為 null 參考。 + + 不是具有參數標頭值資訊的有效名稱值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示使用者代理程式標頭中的產品語彙基元值。 + + + 初始化 類別的新執行個體。 + 產品名稱。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得產品語彙基元的名稱。 + 傳回 。產品語彙基元的名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品標頭值資訊的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得產品語彙基元的版本。 + 傳回 。產品語彙基元的版本。 + + + 代表一個值,它可以是 User-Agent 標頭中的一項產品或註解。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 註解值。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 物件取得註解。 + 傳回 。這個 的註解值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品資訊標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的產品資訊標頭值資訊。 + + + 物件取得產品。 + 傳回 。這個 中的產品值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 If-Range 標頭值,它可以是日期/時間或是實體標記值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 實體標記,表示為用來初始化新執行個體的字串。 + + + 物件取得日期。 + 傳回 物件中的日期。 + + + 物件取得實體標記。 + 傳回 物件中的實體標記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Range 標頭值。 + + + 初始化 類別的新執行個體。 + + + 使用位元組範圍初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍標頭值資訊。 + + + 物件中取得指定的範圍。 + 傳回 物件提供的範圍。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得單位。 + 傳回 物件中的單位。 + + + 表示 Range 標頭值中的位元組範圍。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 Retry-After 標頭值,它可以是日期/時間或是 timespan 值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期及時間位移。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的差異,以秒為單位。 + + + 取得與 物件相差的日期及時間。 + 傳回 。與 物件相差的日期及時間。 + + + 物件取得差異,以秒為單位。 + 傳回 物件中的差異,以秒為單位。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示重試條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的重試條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示含選擇性品質的字串標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 用來初始化新執行個體的品質因素。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示品質標頭值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效字串。 + + + 物件取得品質係數。 + 傳回 物件中的品質係數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得字串值。 + 傳回 。取自 物件的字串值。 + + + 表示 accept-encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得傳輸編碼參數。 + 傳回 。傳輸編碼參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的傳輸編碼標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得傳輸編碼值。 + 傳回 。傳輸編碼值。 + + + 表示含選擇性品質係數的 Accept-Encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 品質係數的值。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效傳輸編碼。 + + + 取得品質係數。 + 傳回 中的品質係數。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Via 標頭的值。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + 用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 取得用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + 傳回 。用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 判斷指定的 是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。傳回目前物件的雜湊程式碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示 via 標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的 via 標頭值資訊。 + + + 取得接收的通訊協定的通訊協定名稱。 + 傳回 。通訊協定名稱。 + + + 取得接收的通訊協定的通訊協定版本。 + 傳回 。通訊協定版本。 + + + 取得收到要求或回應的主機和連接埠。 + 傳回 。已收到要求或回應的主機及連接埠。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示警告標頭所用的警告值。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + 警告的日期/時間戳記。 + + + 取得已附加警告的主機。 + 傳回 。已附加警告的主機。 + + + 取得特定警告碼。 + 傳回 。特定警告碼。 + + + 取得警告的日期/時間戳記。 + 傳回 。警告的日期/時間戳記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得包含警告文字的以引號括住的字串。 + 傳回 。含有警告文字的以引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/a new file mode 100644 index 00000000000..7b4e5b6a5e4 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/a @@ -0,0 +1,2306 @@ + + + + System.Net.Http + + + + Provides HTTP content based on a byte array. + + + Initializes a new instance of the class. + The content used to initialize the . + The parameter is null. + + + Initializes a new instance of the class. + The content used to initialize the . + The offset, in bytes, in the parameter used to initialize the . + The number of bytes in the starting from the parameter used to initialize the . + The parameter is null. + The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter.-or-The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter - minus the parameter. + + + Creates an HTTP content stream as an asynchronous operation for reading whose backing store is memory from the . + Returns .The task object representing the asynchronous operation. + + + Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The target stream. + Information about the transport, like channel binding token. This parameter may be null. + + + Determines whether a byte array has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the byte array. + + + Specifies how client certificates are provided. + + + The will attempt to provide all available client certificates automatically. + + + The application manually provides the client certificates to the . This value is the default. + + + A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler. + + + Creates a new instance of the class. + + + Creates a new instance of the class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Releases the unmanaged resources used by the , and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the inner handler which processes the HTTP response messages. + Returns .The inner handler for HTTP response messages. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token to cancel operation. + The was null. + + + A container for name/value tuples encoded using application/x-www-form-urlencoded MIME type. + + + Initializes a new instance of the class with a specific collection of name/value pairs. + A collection of name/value pairs. + + + Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific handler. + The HTTP handler stack to use for sending requests. + + + Initializes a new instance of the class with a specific handler. + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + Returns .The base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + + + Cancel all pending requests on this instance. + + + Gets the headers which should be sent with each request. + Returns .The headers which should be sent with each request. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Gets or sets the maximum number of bytes to buffer when reading the response content. + Returns .The maximum number of bytes to buffer when reading the response content. The default value for this property is 2 gigabytes. + The size specified is less than or equal to zero. + An operation has already been started on the current instance. + The current instance has been disposed. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Gets or sets the timespan to wait before the request times out. + Returns .The timespan to wait before the request times out. + The timeout specified is less than or equal to zero and is not . + An operation has already been started on the current instance. + The current instance has been disposed. + + + The default message handler used by . + + + Creates an instance of a class. + + + Gets or sets a value that indicates whether the handler should follow redirection responses. + Returns .true if the if the handler should follow redirection responses; otherwise false. The default value is true. + + + Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response. + Returns .The automatic decompression method used by the handler. The default value is . + + + Gets or sets the collection of security certificates that are associated with this handler. + Returns .The collection of security certificates associated with this handler. + + + Gets or sets the cookie container used to store server cookies by the handler. + Returns .The cookie container used to store server cookies by the handler. + + + Gets or sets authentication information used by this handler. + Returns .The authentication credentials associated with the handler. The default is null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the maximum number of redirects that the handler follows. + Returns .The maximum number of redirection responses that the handler follows. The default value is 50. + + + Gets or sets the maximum request content buffer size used by the handler. + Returns .The maximum request content buffer size in bytes. The default value is 2 gigabytes. + + + Gets or sets a value that indicates whether the handler sends an Authorization header with the request. + Returns .true for the handler to send an HTTP Authorization header with requests after authentication has taken place; otherwise, false. The default is false. + + + Gets or sets proxy information used by the handler. + Returns .The proxy information used by the handler. The default value is null. + + + Creates an instance of based on the information provided in the as an operation that will not block. + Returns .The task object representing the asynchronous operation. + The HTTP request message. + A cancellation token to cancel the operation. + The was null. + + + Gets a value that indicates whether the handler supports automatic response content decompression. + Returns .true if the if the handler supports automatic response content decompression; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports proxy settings. + Returns .true if the if the handler supports proxy settings; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports configuration settings for the and properties. + Returns .true if the if the handler supports configuration settings for the and properties; otherwise false. The default value is true. + + + Gets or sets a value that indicates whether the handler uses the property to store server cookies and uses these cookies when sending requests. + Returns .true if the if the handler supports uses the property to store server cookies and uses these cookies when sending requests; otherwise false. The default value is true. + + + Gets or sets a value that controls whether default credentials are sent with requests by the handler. + Returns .true if the default credentials are used; otherwise false. The default value is false. + + + Gets or sets a value that indicates whether the handler uses a proxy for requests. + Returns .true if the handler should use a proxy for requests; otherwise false. The default value is true. + + + Indicates if operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content. + + + The operation should complete after reading the entire response including the content. + + + The operation should complete as soon as a response is available and headers are read. The content is not read yet. + + + A base class representing an HTTP entity body and content headers. + + + Initializes a new instance of the class. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Serialize the HTTP content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the HTTP content headers as defined in RFC 2616. + Returns .The content headers as defined in RFC 2616. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The maximum size, in bytes, of the buffer to use. + + + Serialize the HTTP content to a byte array as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content and return a stream that represents the content as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a string as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the HTTP content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HTTP content. + + + A base type for HTTP message handlers. + + + Initializes a new instance of the class. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A specialty class that allows applications to call the method on an Http handler chain. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods. + + + Initializes a new instance of the class with a specific HTTP method. + The HTTP method. + + + Represents an HTTP DELETE protocol method. + Returns . + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The HTTP method to compare with the current object. + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Represents an HTTP GET protocol method. + Returns . + + + Serves as a hash function for this type. + Returns .A hash code for the current . + + + Represents an HTTP HEAD protocol method. The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. + Returns . + + + An HTTP method. + Returns .An HTTP method represented as a . + + + The equality operator for comparing two objects. + Returns .true if the specified and parameters are equal; otherwise, false. + The left to an equality operator. + The right to an equality operator. + + + The inequality operator for comparing two objects. + Returns .true if the specified and parameters are inequal; otherwise, false. + The left to an inequality operator. + The right to an inequality operator. + + + Represents an HTTP OPTIONS protocol method. + Returns . + + + Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI. + Returns . + + + Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI. + Returns . + + + Returns a string that represents the current object. + Returns .A string representing the current object. + + + Represents an HTTP TRACE protocol method. + Returns . + + + A base class for exceptions thrown by the and classes. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific message that describes the current exception. + A message that describes the current exception. + + + Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. + A message that describes the current exception. + The inner exception. + + + Represents a HTTP request message. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + A string that represents the request . + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + The to request. + + + Gets or sets the contents of the HTTP message. + Returns .The content of a message + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the collection of HTTP request headers. + Returns .The collection of HTTP request headers. + + + Gets or sets the HTTP method used by the HTTP request message. + Returns .The HTTP method used by the request message. The default is the GET method. + + + Gets a set of properties for the HTTP request. + Returns . + + + Gets or sets the used for the HTTP request. + Returns .The used for the HTTP request. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + Represents a HTTP response message including the status code and data. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific . + The status code of the HTTP response. + + + Gets or sets the content of a HTTP response message. + Returns .The content of the HTTP response message. + + + Releases the unmanaged resources and disposes of unmanaged resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Throws an exception if the property for the HTTP response is false. + Returns .The HTTP response message if the call is successful. + + + Gets the collection of HTTP response headers. + Returns .The collection of HTTP response headers. + + + Gets a value that indicates if the HTTP response was successful. + Returns .A value that indicates if the HTTP response was successful. true if was in the range 200-299; otherwise false. + + + Gets or sets the reason phrase which typically is sent by servers together with the status code. + Returns .The reason phrase sent by the server. + + + Gets or sets the request message which led to this response message. + Returns .The request message which led to this response message. + + + Gets or sets the status code of the HTTP response. + Returns .The status code of the HTTP response. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + A base type for handlers which only do some small processing of request and/or response messages. + + + Creates an instance of a class. + + + Creates an instance of a class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Performs processing on each request sent to the server. + Returns .The HTTP request message that was processed. + The HTTP request message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Perform processing on each response from the server. + Returns .The HTTP response message that was processed. + The HTTP response message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Provides a collection of objects that get serialized using the multipart/* content type specification. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The subtype of the multipart content. + The was null or contains only white space characters. + + + Creates a new instance of the class. + The subtype of the multipart content. + The boundary string for the multipart content. + The was null or an empty string.The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add multipart HTTP content to a collection of objects that get serialized using the multipart/* content type specification. + The HTTP content to add to the collection. + The was null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Returns an enumerator that iterates through the collection of objects that get serialized using the multipart/* content type specification.. + Returns .An object that can be used to iterate through the collection. + + + Serialize the multipart HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + The explicit implementation of the method. + Returns .An object that can be used to iterate through the collection. + + + Determines whether the HTTP multipart content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HHTP content. + + + Provides a container for content encoded using multipart/form-data MIME type. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The boundary string for the multipart form data content. + The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The was null or contains only white space characters. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The file name for the HTTP content to add to the collection. + The was null or contains only white space characters.-or-The was null or contains only white space characters. + The was null. + + + Provides HTTP content based on a stream. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The size, in bytes, of the buffer for the . + The was null. + The was less than or equal to zero. + + + Write the HTTP stream content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the stream content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the stream content. + + + Provides HTTP content based on a string. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + The media type to use for the content. + + + Represents authentication information in Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate header values. + + + Initializes a new instance of the class. + The scheme to use for authorization. + + + Initializes a new instance of the class. + The scheme to use for authorization. + The credentials containing the authentication information of the user agent for the resource being requested. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the credentials containing the authentication information of the user agent for the resource being requested. + Returns .The credentials containing the authentication information. + + + Converts a string to an instance. + Returns .An instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets the scheme to use for authorization. + Returns .The scheme to use for authorization. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Cache-Control header. + + + Initializes a new instance of the class. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Cache-extension tokens, each with an optional assigned value. + Returns .A collection of cache-extension tokens each with an optional assigned value. + + + Serves as a hash function for a object. + Returns .A hash code for the current object. + + + The maximum age, specified in seconds, that the HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .true if the HTTP client is willing to accept a response that has exceed the expiration time; otherwise, false. + + + The maximum time, in seconds, an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .The time in seconds. + + + The freshness lifetime, in seconds, that an HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale; otherwise, false. + + + Whether an HTTP client is willing to accept a cached response. + Returns .true if the HTTP client is willing to accept a cached response; otherwise, false. + + + A collection of fieldnames in the "no-cache" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether a cache must not store any part of either the HTTP request mressage or any response. + Returns .true if a cache must not store any part of either the HTTP request mressage or any response; otherwise, false. + + + Whether a cache or proxy must not change any aspect of the entity-body. + Returns .true if a cache or proxy must not change any aspect of the entity-body; otherwise, false. + + + Whether a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status. + Returns .true if a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status; otherwise, false. + + + Converts a string to an instance. + Returns .A instance. + A string that represents cache-control header value information. + + is a null reference. + + is not valid cache-control header value information. + + + Whether all or part of the HTTP response message is intended for a single user and must not be cached by a shared cache. + Returns .true if the HTTP response message is intended for a single user and must not be cached by a shared cache; otherwise, false. + + + A collection fieldnames in the "private" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale for shared user agent caches. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale for shared user agent caches; otherwise, false. + + + Whether an HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. + Returns .true if the HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache; otherwise, false. + + + The shared maximum age, specified in seconds, in an HTTP response that overrides the "max-age" directive in a cache-control header or an Expires header for a shared cache. + Returns .The time in seconds. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Disposition header. + + + Initializes a new instance of the class. + A . + + + Initializes a new instance of the class. + A string that contains a . + + + The date at which the file was created. + Returns .The file creation date. + + + The disposition type for a content body part. + Returns .The disposition type. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + A suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file. + Returns .A suggested filename. + + + A suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files. + Returns .A suggested filename of the form filename*. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + The date at which the file was last modified. + Returns .The file modification date. + + + The name for a content body part. + Returns .The name for the content body part. + + + A set of parameters included the Content-Disposition header. + Returns .A collection of parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content disposition header value information. + + is a null reference. + + is not valid content disposition header value information. + + + The date the file was last read. + Returns .The last read date. + + + The approximate size, in bytes, of the file. + Returns .The approximate size, in bytes. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Range header. + + + Initializes a new instance of the class. + The starting or ending point of the range, in bytes. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + The starting or ending point of the range, in bytes. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position, in bytes, at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the Content-Range header has a length specified. + Returns .true if the Content-Range has a length specified; otherwise, false. + + + Gets whether the Content-Range has a range specified. + Returns .true if the Content-Range has a range specified; otherwise, false. + + + Gets the length of the full entity-body. + Returns .The length of the full entity-body. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content range header value information. + + is a null reference. + + is not valid content range header value information. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + The range units used. + Returns .A that contains range units. + + + Represents an entity-tag header value. + + + Initializes a new instance of the class. + A string that contains an . + + + Initializes a new instance of the class. + A string that contains an . + A value that indicates if this entity-tag header is a weak validator. If the entity-tag header is weak validator, then should be set to true. If the entity-tag header is a strong validator, then should be set to false. + + + Gets the entity-tag header value. + Returns . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the entity-tag is prefaced by a weakness indicator. + Returns .true if the entity-tag is prefaced by a weakness indicator; otherwise, false. + + + Converts a string to an instance. + Returns .An instance. + A string that represents entity tag header value information. + + is a null reference. + + is not valid entity tag header value information. + + + Gets the opaque quoted string. + Returns .An opaque quoted string. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the collection of Content Headers as defined in RFC 2616. + + + Gets the value of the Allow content header on an HTTP response. + Returns .The value of the Allow header on an HTTP response. + + + Gets the value of the Content-Disposition content header on an HTTP response. + Returns .The value of the Content-Disposition content header on an HTTP response. + + + Gets the value of the Content-Encoding content header on an HTTP response. + Returns .The value of the Content-Encoding content header on an HTTP response. + + + Gets the value of the Content-Language content header on an HTTP response. + Returns .The value of the Content-Language content header on an HTTP response. + + + Gets or sets the value of the Content-Length content header on an HTTP response. + Returns .The value of the Content-Length content header on an HTTP response. + + + Gets or sets the value of the Content-Location content header on an HTTP response. + Returns .The value of the Content-Location content header on an HTTP response. + + + Gets or sets the value of the Content-MD5 content header on an HTTP response. + Returns .The value of the Content-MD5 content header on an HTTP response. + + + Gets or sets the value of the Content-Range content header on an HTTP response. + Returns .The value of the Content-Range content header on an HTTP response. + + + Gets or sets the value of the Content-Type content header on an HTTP response. + Returns .The value of the Content-Type content header on an HTTP response. + + + Gets or sets the value of the Expires content header on an HTTP response. + Returns .The value of the Expires content header on an HTTP response. + + + Gets or sets the value of the Last-Modified content header on an HTTP response. + Returns .The value of the Last-Modified content header on an HTTP response. + + + A collection of headers and their values as defined in RFC 2616. + + + Initializes a new instance of the class. + + + Adds the specified header and its values into the collection. + The header to add to the collection. + A list of header values to add to the collection. + + + Adds the specified header and its value into the collection. + The header to add to the collection. + The content of the header. + + + Removes all headers from the collection. + + + Returns if a specific header exists in the collection. + Returns .true is the specified header exists in the collection; otherwise false. + The specific header. + + + Returns an enumerator that can iterate through the instance. + Returns .An enumerator for the . + + + Returns all header values for a specified header stored in the collection. + Returns .An array of header strings. + The specified header to return values for. + + + Removes the specified header from the collection. + Returns . + The name of the header to remove from the collection. + + + Gets an enumerator that can iterate through a . + Returns .An instance of an implementation of an that can iterate through a . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Returns a value that indicates whether the specified header and its values were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The values of the header. + + + Returns a value that indicates whether the specified header and its value were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The content of the header. + + + Return if a specified header and specified values are stored in the collection. + Returns .true is the specified header and values are stored in the collection; otherwise false. + The specified header. + The specified header values. + + + Represents a collection of header values. + The header collection type. + + + Adds an entry to the . + The item to add to the header collection. + + + Removes all entries from the . + + + Determines if the contains an item. + Returns .true if the entry is contained in the instance; otherwise, false + The item to find to the header collection. + + + Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + + Gets the number of headers in the . + Returns .The number of headers in a collection + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Gets a value indicating whether the instance is read-only. + Returns .true if the instance is read-only; otherwise, false. + + + Parses and adds an entry to the . + The entry to add. + + + Removes the specified item from the . + Returns .true if the was removed from the instance; otherwise, false + The item to remove. + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Returns a string that represents the current object. object. + Returns .A string that represents the current object. + + + Determines whether the input could be parsed and added to the . + Returns .true if the could be parsed and added to the instance; otherwise, false + The entry to validate. + + + Represents the collection of Request Headers as defined in RFC 2616. + + + Gets the value of the Accept header for an HTTP request. + Returns .The value of the Accept header for an HTTP request. + + + Gets the value of the Accept-Charset header for an HTTP request. + Returns .The value of the Accept-Charset header for an HTTP request. + + + Gets the value of the Accept-Encoding header for an HTTP request. + Returns .The value of the Accept-Encoding header for an HTTP request. + + + Gets the value of the Accept-Language header for an HTTP request. + Returns .The value of the Accept-Language header for an HTTP request. + + + Gets or sets the value of the Authorization header for an HTTP request. + Returns .The value of the Authorization header for an HTTP request. + + + Gets or sets the value of the Cache-Control header for an HTTP request. + Returns .The value of the Cache-Control header for an HTTP request. + + + Gets the value of the Connection header for an HTTP request. + Returns .The value of the Connection header for an HTTP request. + + + Gets or sets a value that indicates if the Connection header for an HTTP request contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP request. + Returns .The value of the Date header for an HTTP request. + + + Gets the value of the Expect header for an HTTP request. + Returns .The value of the Expect header for an HTTP request. + + + Gets or sets a value that indicates if the Expect header for an HTTP request contains Continue. + Returns .true if the Expect header contains Continue, otherwise false. + + + Gets or sets the value of the From header for an HTTP request. + Returns .The value of the From header for an HTTP request. + + + Gets or sets the value of the Host header for an HTTP request. + Returns .The value of the Host header for an HTTP request. + + + Gets the value of the If-Match header for an HTTP request. + Returns .The value of the If-Match header for an HTTP request. + + + Gets or sets the value of the If-Modified-Since header for an HTTP request. + Returns .The value of the If-Modified-Since header for an HTTP request. + + + Gets the value of the If-None-Match header for an HTTP request. + Returns .Gets the value of the If-None-Match header for an HTTP request. + + + Gets or sets the value of the If-Range header for an HTTP request. + Returns .The value of the If-Range header for an HTTP request. + + + Gets or sets the value of the If-Unmodified-Since header for an HTTP request. + Returns .The value of the If-Unmodified-Since header for an HTTP request. + + + Gets or sets the value of the Max-Forwards header for an HTTP request. + Returns .The value of the Max-Forwards header for an HTTP request. + + + Gets the value of the Pragma header for an HTTP request. + Returns .The value of the Pragma header for an HTTP request. + + + Gets or sets the value of the Proxy-Authorization header for an HTTP request. + Returns .The value of the Proxy-Authorization header for an HTTP request. + + + Gets or sets the value of the Range header for an HTTP request. + Returns .The value of the Range header for an HTTP request. + + + Gets or sets the value of the Referer header for an HTTP request. + Returns .The value of the Referer header for an HTTP request. + + + Gets the value of the TE header for an HTTP request. + Returns .The value of the TE header for an HTTP request. + + + Gets the value of the Trailer header for an HTTP request. + Returns .The value of the Trailer header for an HTTP request. + + + Gets the value of the Transfer-Encoding header for an HTTP request. + Returns .The value of the Transfer-Encoding header for an HTTP request. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP request contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP request. + Returns .The value of the Upgrade header for an HTTP request. + + + Gets the value of the User-Agent header for an HTTP request. + Returns .The value of the User-Agent header for an HTTP request. + + + Gets the value of the Via header for an HTTP request. + Returns .The value of the Via header for an HTTP request. + + + Gets the value of the Warning header for an HTTP request. + Returns .The value of the Warning header for an HTTP request. + + + Represents the collection of Response Headers as defined in RFC 2616. + + + Gets the value of the Accept-Ranges header for an HTTP response. + Returns .The value of the Accept-Ranges header for an HTTP response. + + + Gets or sets the value of the Age header for an HTTP response. + Returns .The value of the Age header for an HTTP response. + + + Gets or sets the value of the Cache-Control header for an HTTP response. + Returns .The value of the Cache-Control header for an HTTP response. + + + Gets the value of the Connection header for an HTTP response. + Returns .The value of the Connection header for an HTTP response. + + + Gets or sets a value that indicates if the Connection header for an HTTP response contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP response. + Returns .The value of the Date header for an HTTP response. + + + Gets or sets the value of the ETag header for an HTTP response. + Returns .The value of the ETag header for an HTTP response. + + + Gets or sets the value of the Location header for an HTTP response. + Returns .The value of the Location header for an HTTP response. + + + Gets the value of the Pragma header for an HTTP response. + Returns .The value of the Pragma header for an HTTP response. + + + Gets the value of the Proxy-Authenticate header for an HTTP response. + Returns .The value of the Proxy-Authenticate header for an HTTP response. + + + Gets or sets the value of the Retry-After header for an HTTP response. + Returns .The value of the Retry-After header for an HTTP response. + + + Gets the value of the Server header for an HTTP response. + Returns .The value of the Server header for an HTTP response. + + + Gets the value of the Trailer header for an HTTP response. + Returns .The value of the Trailer header for an HTTP response. + + + Gets the value of the Transfer-Encoding header for an HTTP response. + Returns .The value of the Transfer-Encoding header for an HTTP response. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP response contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP response. + Returns .The value of the Upgrade header for an HTTP response. + + + Gets the value of the Vary header for an HTTP response. + Returns .The value of the Vary header for an HTTP response. + + + Gets the value of the Via header for an HTTP response. + Returns .The value of the Via header for an HTTP response. + + + Gets the value of the Warning header for an HTTP response. + Returns .The value of the Warning header for an HTTP response. + + + Gets the value of the WWW-Authenticate header for an HTTP response. + Returns .The value of the WWW-Authenticate header for an HTTP response. + + + Represents a media type used in a Content-Type header as defined in the RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The source represented as a string to initialize the new instance. + + + Gets or sets the character set. + Returns .The character set. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets or sets the media-type header value. + Returns .The media-type header value. + + + Gets or sets the media-type header value parameters. + Returns .The media-type header value parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type header value information. + + is a null reference. + + is not valid media type header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a media type with an additional quality factor used in a Content-Type header. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + The quality associated with this header value. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type with quality header value information. + + is a null reference. + + is not valid media type with quality header value information. + + + Get or set the quality value for the . + Returns .The quality value for the object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a name/value pair used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the header name. + Returns .The header name. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value header value information. + + is a null reference. + + is not valid name value header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the header value. + Returns .The header value. + + + Represents a name/value pair with parameters used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the parameters from the object. + Returns .A collection containing the parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value with parameter header value information. + + is a null reference. + + is not valid name value with parameter header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a product token value in a User-Agent header. + + + Initializes a new instance of the class. + The product name. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the name of the product token. + Returns .The name of the product token. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the version of the product token. + Returns .The version of the product token. + + + Represents a value which can either be a product or a comment in a User-Agent header. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A comment value. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Gets the comment from the object. + Returns .The comment value this . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product info header value information. + + is a null reference. + + is not valid product info header value information. + + + Gets the product from the object. + Returns .The product value from this . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents an If-Range header value which can either be a date/time or an entity-tag value. + + + Initializes a new instance of the class. + A date value used to initialize the new instance. + + + Initializes a new instance of the class. + An object used to initialize the new instance. + + + Initializes a new instance of the class. + An entity tag represented as a string used to initialize the new instance. + + + Gets the date from the object. + Returns .The date from the object. + + + Gets the entity tag from the object. + Returns .The entity tag from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range condition header value information. + + is a null reference. + + is not valid range Condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a Range header value. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a byte range. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range header value information. + + is a null reference. + + is not valid range header value information. + + + Gets the ranges specified from the object. + Returns .The ranges from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + he string to validate. + The version of the string. + + + Gets the unit from the object. + Returns .The unit from the object. + + + Represents a byte range in a Range header value. + + + Initializes a new instance of the class. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Represents a Retry-After header value which can either be a date/time or a timespan value. + + + Initializes a new instance of the class. + The date and time offset used to initialize the new instance. + + + Initializes a new instance of the class. + The delta, in seconds, used to initialize the new instance. + + + Gets the date and time offset from the object. + Returns .The date and time offset from the object. + + + Gets the delta in seconds from the object. + Returns .The delta in seconds from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents retry condition header value information. + + is a null reference. + + is not valid retry condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a string header value with an optional quality. + + + Initializes a new instance of the class. + The string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A quality factor used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents quality header value information. + + is a null reference. + + is not valid string with quality header value information. + + + Gets the quality factor from the object. + Returns .The quality factor from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the string value from the object. + Returns .The string value from the object. + + + Represents an accept-encoding header value. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the transfer-coding parameters. + Returns .The transfer-coding parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding header value information. + + is a null reference. + + is not valid transfer-coding header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the transfer-coding value. + Returns .The transfer-coding value. + + + Represents an Accept-Encoding header value.with optional quality factor. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A value for the quality factor. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding value information. + + is a null reference. + + is not valid transfer-coding with quality header value information. + + + Gets the quality factor from the . + Returns .The quality factor from the . + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of a Via header. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + The comment field used to identify the software of the recipient proxy or gateway. + + + Gets the comment field used to identify the software of the recipient proxy or gateway. + Returns .The comment field used to identify the software of the recipient proxy or gateway. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .Returns a hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents via header value information. + + is a null reference. + + is not valid via header value information. + + + Gets the protocol name of the received protocol. + Returns .The protocol name. + + + Gets the protocol version of the received protocol. + Returns .The protocol version. + + + Gets the host and port that the request or response was received by. + Returns .The host and port that the request or response was received by. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a warning value used by the Warning header. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + The date/time stamp of the warning. + + + Gets the host that attached the warning. + Returns .The host that attached the warning. + + + Gets the specific warning code. + Returns .The specific warning code. + + + Gets the date/time stamp of the warning. + Returns .The date/time stamp of the warning. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns an instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets a quoted-string containing the warning text. + Returns .A quoted-string containing the warning text. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/de/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/de/a new file mode 100644 index 00000000000..5c4f577656b --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/de/a @@ -0,0 +1,2350 @@ + + + + System.Net.Http + + + + Stellt HTTP-Inhalt auf Grundlage von einem Bytearray bereit. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der -Parameter ist null. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der Offset in Bytes im -Parameter, der verwendet wird, um den zu initialisieren. + Die Anzahl der Bytes in ab dem -Parameter, die zum Initialisieren von benutzt werden. + Der -Parameter ist null. + Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters angegeben wird.- oder -Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters - minus dem -Parameter angegeben wird. + + + Erstellt einen HTTP-Inhaltsdatenstrom als asynchronen Vorgang zum Lesen, dessen Sicherungsspeicher Arbeitsspeicher von ist. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Das Bytearray, das im Konstruktor bereitgestellt wird, als asynchronen Vorgang in einen HTTP-Inhaltsstream serialisieren und schreiben. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport, zum Beispiel Channelbindungstoken.Dieser Parameter kann null sein. + + + Bestimmt, ob ein Bytearray eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Bytearrays in Bytes. + + + Gibt an, wie die Clientzertifikate bereitgestellt werden. + + + Der versucht, alle verfügbaren Clientzertifikate automatisch bereitzustellen. + + + Die Anwendung stellt manuell die Clientzertifikate für den bereit.Dies ist der Standardwert. + + + Ein Typ für HTTP-Handler, die die Verarbeitung von HTTP-Antwortnachrichten in einen anderen Handler (den internen Handler) delegieren. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft den internen Handler ab, der die HTTP-Antwortnachrichten verarbeitet, oder legt diesen fest. + Gibt zurück.Der innere Handler für HTTP-Antwortnachrichten. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ein Container für die Name/Wert-Tupel, codiert mit dem "application/x-www-form-urlencoded" MIME-Typ. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Auflistung von Namen/Wert-Paaren. + Eine Sammlung von Name-Wert-Paaren. + + + Stellt eine Basisklasse zum Senden von HTTP-Anforderungen und Empfangen von HTTP-Antworten aus einer Ressource bereit, die von einem URI identifiziert wird. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der HTTP-Handlerstapel, der zum Senden von Anforderungen zu verwenden ist. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden soll, false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Ruft die Basisadresse des URI (Uniform Resource Identifier) der Internetressource ab, die verwendet wird, wenn Anforderungen gesendet werden, oder legt diese fest. + Gibt zurück.Die Basisadresse des URI (Uniform Resource Identifier) der Internetressource, die verwendet wird, wenn Anforderungen gesendet werden. + + + Alle ausstehenden Anforderungen für diese Instanz abbrechen. + + + Ruft die Header ab, die mit jeder Anforderung gesendet werden sollen. + Gibt zurück.Die Header, die mit jeder Anforderung gesendet werden sollen. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Ruft beim Lesen des Antwortinhalts die maximale Anzahl zwischenzuspeichernder Bytes ab oder legt diese fest. + Gibt zurück.Die maximale Anzahl zu puffernder Bytes, wenn der Antwortinhalt gelesen wird.Der Standardwert für diese Eigenschaft ist 2 GB. + Der angegebene Größe ist kleiner als oder gleich 0 (null). + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Ruft die Zeitspanne ab, nach der das Zeitlimit der Anforderung überschritten ist, oder legt diese fest. + Gibt zurück.Die Zeitspanne, nach der das Zeitlimit der Anforderung überschritten ist. + Der angegebene Timout ist kleiner oder gleich 0 (null) und nicht . + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Der standardmäßige Meldungshandler für . + + + Erstellt eine Instanz einer -Klasse. + + + Ruft einen Wert ab, der angibt, ob der Handler Umleitungsantworten folgen soll, oder legt diesen Wert fest. + Gibt zurück.Wenn true, wenn der Handler Umleitungsantworten folgen soll; andernfalls false.Der Standardwert ist true. + + + Ruft den Typ der Dekomprimierungsmethode ab, die vom Handler für die automatische Dekomprimierung der HTTP-Inhalt-Antwort verwendet wird, oder legt diesen fest. + Gibt zurück.Die vom Handler zu benutzende automatische Dekomprimierungsmethode.Der Standardwert ist . + + + Ruft die diesem Handler zugeordnete Auflistung von Sicherheitszertifikaten ab oder legt diese fest. + Gibt zurück.Die Auflistung von Sicherheitszertifikaten, die diesem Handler zugeordnet sind. + + + Ruft den Cookiecontainer zum Speichern von Servercookies durch den Handler ab oder diesen fest. + Gibt zurück.Der Cookie-Container zum Speichern von Server-Cookies durch den Handler. + + + Ruft die Authentifizierungsinformationen ab, die vom Handler verwendet wurden, oder legt diese fest. + Gibt zurück.Die der Authentifizierungsanforderung zugeordnete Handler.Der Standardwert ist null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die maximale Anzahl von Umleitungen ab, denen der Handler folgt, oder legt diese fest. + Gibt zurück.Die maximale Anzahl von Umleitungsantworten, denen der Handler folgt.Der Standardwert ist 50. + + + Ruft die maximale Größe des Anforderungsinhaltpuffers ab, der vom Handler verwendet wird, oder legt diese fest. + Gibt zurück.Die maximale Größe des Anforderungsinhaltpuffers in Byte.Der Standardwert beträgt 2 GB. + + + Ruft einen Wert ab, der angibt, ob der Handler mit der Anforderung ein Autorisierungsheader sendet, oder legt diesen fest. + Gibt zurück.true für den Handler zum Senden eines HTTP-Autorisierungsheaders mit Anforderungen nach einer Authentifizierung, andernfalls false.Die Standardeinstellung ist false. + + + Ruft die Proxyinformationen ab, die vom Handler verwendet werden, oder legt diese fest. + Gibt zurück.Die Proxyinformationen, die vom Handler verwendet werden.Der Standardwert ist null. + + + Erstellt eine Instanz von auf Grundlage der Informationen, die in als Operation bereitgestellt werden, der nicht blockiert. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ruft einen Wert ab, der angibt, ob der Handler die automatische Antwort-Inhaltsdekomprimierung unterstützt. + Gibt zurück.Wenn true, wenn der Handler die automatische Dekomprimierung von Antwortinhalt unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler die Proxyeinstellungen unterstützt. + Gibt zurück.Wenn true, wenn der Handler die Proxyeinstellungen unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt. + Gibt zurück.Wenn true, wenn der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und die Cookies beim Senden von Anforderungen nutzt. + Gibt zurück.Wenn true, wenn der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und diese Cookies beim Senden von Anforderungen verwendet; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der steuert, ob mit den Anforderungen vom Handler Standardanmeldeinformationen gesendet werden, oder legt diesen fest. + Gibt zurück.true, wenn die standardmäßigen Anmeldeinformationen verwendet werden, andernfalls false.Der Standardwert ist false. + + + Ruft einen Wert ab bzw. legt einen Wert fest, der angibt, ob der Handler einen Proxy für Anforderungen verwendet. + Gibt zurück.true, wenn der Handler einen Proxy für Anforderungen verwenden soll; andernfalls false.Der Standardwert ist true. + + + Gibt an, ob -Vorgänge als abgeschlossen betrachtet werden, sobald eine Antwort verfügbar ist, oder nachdem die gesamte Antwortnachricht einschließlich Inhalt gelesen wurde. + + + Der Vorgang sollte beendet werden, nachdem er die gesamte Antwort einschließlich des Inhalts gelesen hat. + + + Der Vorgang sollte beendet werden, sobald eine Antwort vorliegt und die Header gelesen wurden.Der Inhalts noch ist nicht bereit. + + + Eine Basisklasse, die einen HTTP-Entitätentext und Inhaltsheader darstellt. + + + Initialisiert eine neue Instanz der -Klasse. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherstream als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die HTTP-Inhaltsheader wie in RFC 2616 definiert ab. + Gibt zurück.Die Inhaltsheader gemäß RFC 2616. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die maximale Größe des zu verwendenden Puffers in Byte. + + + Serialisieren Sie den HTTP-Inhalt in ein Bytearray als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisieren Sie den HTTP-Inhalt und geben Sie einen Stream zurück, der den Inhalt als asynchroner Vorgang darstellt. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in eine Zeichenfolge als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der HTTP-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Ein Basistyp für HTTP-Message-Handler. + + + Initialisiert eine neue Instanz der -Klasse. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Spezialitätenklasse, die es Anwendungen ermöglicht, die Methode auf einer HTTP-Handlerkette aufzurufen. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden sollte,false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Hilfsprogrammklasse für das Abrufen und das Vergleichen von Standard-HTTP-Methoden und zum Erstellen von neuen HTTP-Methoden. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten HTTP-Methode. + Die HTTP-Methode + + + Stellt eine HTTP DELTE-Protokollmethode dar. + Gibt zurück. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Die HTTP-Methode, die mit dem aktuellen Objekt verglichen werden soll. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Stellt eine HTTP GET-Protokollmethode dar. + Gibt zurück. + + + Fungiert als Hashfunktion für diesen Typ. + Gibt zurück.Ein Hashcode für das aktuelle . + + + Stellt eine HTTP HEAD-Protokollmethode dar.Die HEAD-Methode ist mit der GET-Methode identisch, bis auf den Unterschied, dass der Server in der Antwort nur Meldungsheader und keinen Meldungstext zurückgibt. + Gibt zurück. + + + Eine HTTP-Methode. + Gibt zurück.Die HTTP-Methode dargestellt als . + + + Der Gleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter gleich sind, andernfalls false. + Die linke für einen Gleichheitsoperator. + Die rechte zu einem Gleichheitsoperator. + + + Der Ungleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter ungleich sind, andernfalls false. + Die linke für einen Ungleichheitsoperator. + Die rechte zu einem Ungleichheitsoperator. + + + Stellt eine HTTP OPTIONS-Protokollmethode dar. + Gibt zurück. + + + Stellt eine HTTP POST-Protokollmethode dar, die verwendet wird, um eine neue Entität als Zusatz zu einem URI zu senden. + Gibt zurück. + + + Stellt eine HTTP PUT-Protokollmethode dar, die verwendet wird, um eine durch einen URI bezeichnete Entität zu ersetzen. + Gibt zurück. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt eine HTTP TRACE-Protokollmethode dar. + Gibt zurück. + + + Eine Basisklasse für Ausnahmen, die von den Klassen und ausgelöst werden. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt, und einer inneren Ausnahme. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + Die innere Ausnahme. + + + Stellt eine HTTP-Nachrichtenanfrage dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Eine Zeichenfolge, die die Anforderung darstellt. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Das anzufordernde . + + + Ruft den Inhalt der HTTP-Meldung ab oder legt diesen fest. + Gibt zurück.Der Nachrichteninhalt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die Auflistung von HTTP-Anforderungsheadern ab. + Gibt zurück.Eine Auflistung von HTTP-Anforderungsheadern. + + + Ruft die von der HTTP-Anforderungsmeldung verwendete HTTP-Methode ab oder legt diese fest. + Gibt zurück.Die HTTP-Methode, die von der Anforderungnachricht benutzt wurde.Standard ist die GET-Methode. + + + Ruft eine Gruppe von Eigenschaften für die HTTP-Anforderung ab. + Gibt zurück. + + + Übernimmt oder bestimmt den , der für die HTTP-Anforderung verwendet wird. + Gibt zurück.Der , der für die aktuelle HTTP-Anforderung verwendet wird. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Stellt eine HTTP-Antwortnachricht einschließlich den Statuscodes und der Daten dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten . + Der Statuscode der ATTP-Antwort. + + + Ruft den Inhalt einer HTTP-Antwortmeldung ab oder legt diesen fest. + Gibt zurück.Der Inhalt des HTTP-Antwortnachricht. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die nicht verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Löst eine Ausnahme aus, wenn die -Eigenschaft der HTTP-Antwort false lautet. + Gibt zurück.Die HTTP-Antwortnachricht, wenn der Aufruf erfolgreich ausgeführt wurde. + + + Ruft die Auflistung von HTTP-Antwortheadern ab. + Gibt zurück.Die Auflistung von HTTP-Antwortheadern. + + + Ruft einen Wert ab, der angibt, ob die HTTP-Antwort erfolgreich war. + Gibt zurück.Ein Wert, der angibt, ob die HTTP-Antwort erfolgreich war.true, wenn sich im Bereich 200–299 befand; andernfalls false. + + + Ruft den Begründungsausdruck ab, der üblicherweise von Servern, zusammen mit dem Statuscode, gesendet wird, oder legt diesen fest. + Gibt zurück.Die vom Server gesendete Begründungsphrase. + + + Ruft die Anforderungnachricht ab, die zu dieser Antwortnachricht geführt hat, oder legt diese fest. + Gibt zurück.Die Anforderungsnachricht, die zu dieser Antwortnachricht geführt hat. + + + Übernimmt oder bestimmt den Statuscode der HTTP-Antwort. + Gibt zurück.Der Statuscode der ATTP-Antwort. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Ein Basistyp für Handler, die nur einige kleine Verarbeitung der Anforderungs- und/oder der Antwortnachrichten ausführen. + + + Erstellt eine Instanz einer -Klasse. + + + Erstellt eine Instanz einer -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Führt die Verarbeitung auf jeder Anforderung aus, die an den Server gesendet wird. + Gibt zurück.Die HTTP-Anforderungsnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Anforderungmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Führen Sie die Verarbeitung auf jeder Antwort vom Server aus. + Gibt zurück.Die HTTP-Antwortnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Antwortmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Stellt eine Auflistung von -Objekten bereit, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die war null enthält nur Leerzeichen. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die Begrenzungszeichenfolge für den Multipart-Inhalt. + Der war null oder eine leere Zeichenfolge ().Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie Mehrfach-HTTP-Inhalt einer Sammlung von -Objekten hinzu, die unter Verwendung der multipart/*-Inhaltstypspezifikation serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Gibt einen Enumerator zurück, der die Auflistung der -Objekte durchläuft, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Den Multipart-HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Eine explizite Implementierung der -Methode. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Bestimmt, ob der HTTP-Multipart-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Stellt einen Container für den Inhalt bereit, der mithilfe des multipart/form-data-MIME-Typs codiert wird. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Die Begrenzungszeichenfolge für den Multipart-Form-Dateninhalt. + Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Die war null enthält nur Leerzeichen. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Der Name der Datei, für den zur Auflistung hinzuzufügenden HTTP-Inhalt. + Die war null enthält nur Leerzeichen.- oder -Die war null enthält nur Leerzeichen. + + war null. + + + Stellt HTTP-Inhalt auf Grundlage eines Streams bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die verfügbare Größe des Puffers in Byte für die . + + war null. + Die war kleiner oder gleich 0 (null). + + + Den HTTP-Datenstrominhalt in einen Speicherstream als asynchronen Vorgang schreiben. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der Stream-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Streamsinhalts in Bytes. + + + Stellt HTTP-Inhalt auf Grundlage einer Zeichenfolge bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + Der Medientyp, der für den Inhalt verwendet werden soll. + + + Stellt Authentifizierungsinformationen in Authorization-, ProxyAuthorization-, WWW-Authenticate- und Proxy-Authenticate-Headerwerten dar. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + Die Anmeldeinformationen, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Anmeldeinformationen ab, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + Gibt zurück.Die Anmeldeinformationen, die die Informationen für die Authentifizierung enthalten. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft das Schema ab, welches für die Autorisierung verwendet werden soll. + Gibt zurück.Das Schema für die Autorisierung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Cachesteuerungsheaders dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + CACHE-EXTENSION-Tokens, jeweils mit einem optionalen zugeordneten Wert. + Gibt zurück.Eine Sammlung von Cacheerweiterungtokens, jeweils mit einem optionalen zugeordneten Wert. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Der Höchstalter in Sekunden, für das der HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat; andernfalls false. + + + Die maximale Zeit in Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die ihre Ablaufzeit überschritten hat. + Gibt zurück.Die Zeit in Sekunden. + + + Die Anzahl Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag veraltet ist; andernfalls false. + + + Ob ein HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu akzeptieren. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu übernehmen; andernfalls false. + + + Eine Sammlung von Feldnamen in der "no-cache"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf. + Gibt zurück.true, wenn ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf; andernfalls false. + + + Ob ein Cache oder ein Proxy keinen Aspekt des Entitätstexts ändern darf. + Gibt zurück.true, wenn ein Cache oder Proxy keinen Aspekt des Entitätstexts ändern darf; andernfalls false. + + + Ob ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert. + Gibt zurück.true wenn ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Cachesteuerungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Cachesteuerungsheader. + + + Gibt an, ob alles oder nur ein Teil der HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht durch das Ausführen eines freigegebenen Caches zwischengespeichert werden darf. + Gibt zurück.true, wenn die HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht von einem gemeinsam genutzten Cache zwischengespeichert werden darf; andernfalls false. + + + Eine Feldnamensammlung in der "private"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist; andernfalls false. + + + Ob eine HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde. + Gibt zurück.true, wenn die HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde; andernfalls false. + + + Das freigegebene, in Sekunden angegebene Höchstalter in einer HTTP-Antwort, die die "max-age"-Direktive in einem Cache-Control-Header oder einem Expires-Header für einen gemeinsam genutzten Cache überschreibt. + Gibt zurück.Die Zeit in Sekunden. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Disposition-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die eine enthält. + + + Das Datum, zu der die Datei erstellt wurde. + Gibt zurück.Das Dateierstellungsdatum. + + + Der Anordnungstyp für einen Textteil. + Gibt zurück.Der Anordnungstyp. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ein Vorschlag, wie Sie einen Dateinamen zum Speichern der Nachrichtennutzlast erstellen, der verwendet werden soll, wenn die Entität getrennt und in einer separaten Datei gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname. + + + Ein Vorschlag, wie Sie Dateinamen zum Speichern der Nachrichtennutzlasten erstellen, der verwendet werden soll, wenn die Entitäten getrennt und in separaten Dateien gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname des Formulardateinamens*. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Datum der letzten Dateiänderung. + Gibt zurück.Das Änderungsdatum der Datei. + + + Der Name für einen Inhaltstextteil. + Gibt zurück.Der Name des Inhaltstextteils. + + + Ein Satz von Parametern, enthalten im Content-Disposition-Header. + Gibt zurück.Eine Auflistung von Parametern. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Wertinformation des Inhaltsdisposition-Headers des Inhalts darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Inhaltsdispositionsheader. + + + Das Datum, an dem zuletzt die Datei gelesen wurde. + Gibt zurück.Das letzte gelesene Datum. + + + Die ungefähre Größe der aktuellen Datei in Bytes. + Gibt zurück.Die ungefähre Größe in Bytes. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Range-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob für den Inhaltsbereichs-Header eine Länge angegeben wurde. + Gibt zurück.true, wenn der Content-Range eine Länge angegeben hat; andernfalls false. + + + Ruft ab, ob für den Inhaltsbereich ein Bereich bestimmt wurde. + Gibt zurück.true, wenn der Content-Range einen Bereich angegeben hat; andernfalls false. + + + Ruft die Länge des vollständigen Entitätstexts ab. + Gibt zurück.Die Länge des vollständigen Entitätstexts. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Informationen des Inhaltsbereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Inhaltsbereich-Headerwert. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Die verwendeten Bereichseinheiten. + Gibt zurück.Ein , das Bereichseinheiten enthält. + + + Stellt einen Entitätstag-Headerwert dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + Ein Wert, der angibt, ob dieser Entitätstagheader ein schwaches Validierungssteuerelement ist.Wenn der Entitätstagheader ein schwaches Validierungssteuerelement ist, sollte auf true festgelegt werden.Wenn der Entitätstagheader ein starkes Validierungssteuerelement ist, sollte auf false festgelegt werden. + + + Ruft den Entitätstagheaderwert ab. + Gibt zurück. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob dem Entitätstag ein Schwächeindikator vorangestellt ist. + Gibt zurück.true, wenn das Entitätstag durch einen Schwächeindikator vorangestellt wird; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Entitätstag-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Entitätstag-Headerwert dar. + + + Ruft die nicht transparente Zeichenfolge in Anführungszeichen ab. + Gibt zurück.Eine nicht transparente Zeichenfolge in Anführungszeichen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt die Auflistung von Inhaltsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Allow-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Allow-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + + + Eine Sammlung von Headern und deren Werten, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + + + Fügt den angegebenen Header und seine Werte in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Eine Liste von Headerwerten, die der Sammlung hinzugefügt werden sollen. + + + Fügt den angegebenen Header und den Wert in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Entfernt alle Header aus der -Auflistung. + + + Gibt zurück, ob ein bestimmter Header in der -Auflistung vorhanden ist. + Gibt zurück.true, wenn der angegebene Header in der Auflistung vorhanden ist, andernfalls false. + Der spezielle Header. + + + Gibt einen Enumerator zurück, der die -Instanz durchlaufen kann. + Gibt zurück.Ein Enumerator für das . + + + Gibt alle Headerwerte für einen angegebenen Header zurück, der in der -Auflistung gespeichert wird. + Gibt zurück.Ein Array von Headerzeichenfolgen. + Der angegebene Header, für den Werte zurückgegeben werden sollen. + + + Entfernt den angegebenen Header aus der -Auflistung. + Gibt zurück. + Der Name des Headers, der aus der Auflistung entfernt werden soll. + + + Ruft einen Enumerator ab, der eine durchlaufen kann. + Gibt zurück.Eine Instanz einer -Implementierung, die eine durchlaufen kann. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Werte zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Die Werte des Headers. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Wert zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Zurückgeben, ob ein angegebener Header und angegebene Werte in der -Auflistung gespeichert sind. + Gibt zurück.true, wenn der angegebene Header und values in der Auflistung gespeichert sind; andernfalls false. + Der angegebene Header. + Die angegebenen Headerwerte. + + + Stellt eine Auflistung von Headerwerten dar. + Der Headerauflistungs-Typ. + + + Fügt der einen Eintrag hinzu. + Das Element, das der Headerauflistung hinzugefügt werden soll. + + + Entfernt sämtliche Einträge aus dem . + + + Bestimmt, ob der ein Element enthält. + Gibt zurück.true, wenn dar Eintrag in der Instanz enthalten ist, andernfalls false. + Das Element, das in der Headerauflistung gefunden werden soll. + + + Kopiert die gesamte in ein kompatibles eindimensionales , beginnend am angegebenen Index des Zielarrays. + Das eindimensionale , das das Ziel der aus der kopierten Elemente ist.Für das muss eine nullbasierte Indizierung verwendet werden. + Der nullbasierte Index im , bei dem der Kopiervorgang beginnt. + + + Ruft die Anzahl der Header im ab. + Gibt zurück.Die Anzahl der Header in einer Auflistung. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Ruft einen Wert ab, der angibt, ob das -Instanz schreibgeschützt ist. + Gibt zurück.true, wenn die -Instanz schreibgeschützt ist, andernfalls false. + + + Analysiert und fügt einen Eintrag hinzu. + Der hinzuzufügende Eintrag + + + Entfernt das angegebene Element aus . + Gibt zurück.true, wenn der erfolgreich aus der Instanz entfernt wurde, andernfalls false. + Das zu entfernende Element. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob die Eingabe analysiert und zu hinzugefügt werden kann. + Gibt zurück.true, wenn analysiert und zu Instanz hinzugefügt werden kann; andernfalls false + Der zu überprüfende Eintrag. + + + Stellt die Auflistung von Anforderungsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Charset-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Charset-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Language-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Language-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Authorization-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Connection-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Anforderung "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Expect-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Expect-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Expect-Header für eine HTTP-Anforderung "Continue" enthält. + Gibt zurück.true, wenn der Expect-Header "Fortfahren" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des From-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des From-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Host-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Host-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des If-Match-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + + + Übernimmt oder bestimmt den Wert des If-Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Referer-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Referer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des TE-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des TE-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Anforderung "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des User-Agent-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des User-Agent-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Via-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Warning-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Anforderung. + + + Stellt die Auflistung von Antwortheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Ranges-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Accept-Ranges-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Age-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Age-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Connection-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Antwort "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des ETag-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des ETag-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Location-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Location-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Retry-After-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Retry-After-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Server-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Server-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Antwort "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Vary-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Vary-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Via-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Warning-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Antwort. + + + Ruft den Wert des WWW-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des WWW-Authenticate-Headers für eine HTTP-Antwort. + + + Stellt einen Medientyp dar, der in einem Inhaltstypheader verwendet wird, wie im RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Die Quelle, die als Zeichenfolge dargestellt wird, um die neue Instanz zu initialisieren. + + + Ruft den Zeichensatz ab oder legt ihn fest. + Gibt zurück.Der Zeichensatz. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Wert des Medientyp-Headers ab oder legt ihn fest. + Gibt zurück.Der Medientyp-Headerwert. + + + Ruft die Titelwertparameter des Medientyps ab oder legt diese fest. + Gibt zurück.Die Medientyp-Headerwertparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Medientyp-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Medientyp-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Medientyp mit einem zusätzlichen Qualitätsfaktor dar, der in einem Inhaltstypheader verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + Die Qualität dieses zugeordneten Headerwert. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Medientyp mit Qualitätsheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Medientyp mit Qualitätsheaderwertinformationen. + + + Abrufen oder Festlegen des Qualitätswerts für . + Gibt zurück.Der Qualitätswert für das Objekt . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt ein Name-Wert-Paar dar, das in verschiedenen Headern verwendet wird, die in RFC 2616 definiert sind. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Headernamen ab. + Gibt zurück.Der Headername. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Namenswert-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Namenswert-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Headerwert ab. + Gibt zurück.Der Headerwert. + + + Stellt ein Name-Wert-Paar mit Parametern dar, das in verschiedenen Headern verwendet wird, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Parameter vom -Objekt ab. + Gibt zurück.Eine Auflistung, die die Parameter enthält. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Namenswert mit Parameterheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Namenswert mit Parameterheaderwertinformationen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Produkttokenwert in einem User-Agent-Header dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktname. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Namen des Produkttoken ab. + Gibt zurück.Der Name des Produkttoken. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produkt-Headerwerts darstellt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Version des Produkttoken ab. + Gibt zurück.Die Version des Produkttoken. + + + Stellt einen Wert dar, der entweder ein Produkt oder ein Kommentar in einem Benutzer-Agent-Header sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Kommentarwert. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Ruft den Kommentar vom -Objekt ab. + Gibt zurück.Der Kommentarwert dieses . + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produktinfo-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Produktinfo-Headerwert dar. + + + Ruft das Produkt vom -Objekt ab. + Gibt zurück.Der Produktwert von diesem . + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen If-Range-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Entitätstag-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Datumswert für die Initialisierung der neuen -Instanz. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Entitätstag, dargestellt als Zeichenfolge, der verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum aus dem Objekt ab. + Gibt zurück.Das Datum aus dem -Objekt. + + + Ruft das Entitätstag vom -Objekt ab. + Gibt zurück.Das Entitätstag vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichsbedingung-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereichsbedingung-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem Bytebereich. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereich-Headerwert. + + + Ruft die Bereiche ab, die vom -Objekt angegeben sind. + Gibt zurück.Die Reichweiten vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Einheit vom -Objekt ab. + Gibt zurück.Die Einheit vom -Objekt. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt einen Retry-After-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Zeitspannen-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Der Datum und Zeit Offset, der zum Initialisieren der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Das Delta, in Sekunden, das verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum und Uhrzeit-Offset vom aktuellen -Objekt ab. + Gibt zurück.Das Datum und Uhrzeit-Offset vom aktuellen -Objekt. + + + Ruft das Delta in Sekunden vom -Objekt ab. + Gibt zurück.Das Delta in Sekunden vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Wiederholungsbedingung darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für den Headerwert für die Wiederholungsbedingung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Zeichenfolgenheaderwert mit einer optionalen Qualität dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Qualitätsfaktor für die Initialisierung der neuen -Instanz. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Qualitäts-Headerwerts darstellt. + + ist ein null-Verweis. + + ist eine ungültige Zeichenfolge mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor vom -Objekt ab. + Gibt zurück.Der Qualitätsfaktor vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Zeichenfolgewert aus dem -Objekt ab. + Gibt zurück.Der Zeichenfolgewert aus dem -Objekt. + + + Stellt einen Headerwert zum Akzeptieren von Codierung dar. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Übertragungs-Codierungs-Parameter ab. + Gibt zurück.Die Übertragungscodierungsparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Übertragungscodierung darstellt. + + ist ein null-Verweis. + + ist kein ungültige Information für einen Übertragungscodierungs-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Übertragungscodierungswert ab. + Gibt zurück.Der Übertragungscodierungswert. + + + Stellt einen Accept-Encoding-Headerwert mit optionalem Qualitätsfaktor dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Wert für den Qualitätsfaktor. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Übertragungscodierungswerts darstellt. + + ist ein null-Verweis. + + ist ein ungültige Übertragungscodierung mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor von ab. + Gibt zurück.Der Qualitätsfaktor von . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Via-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Ruft das Befehlsfeld ab, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + Gibt zurück.Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Bestimmt, ob das angegebene -Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Gibt einen Hashcode für das aktuelle Objekt zurück. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Via-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Via-Headerwert. + + + Ruft den Protokollnamen des empfangenen Protokolls ab. + Gibt zurück.Der Protokollname. + + + Ruft die Protokollversion des empfangenen Protokolls ab. + Gibt zurück.Die Protokollversion. + + + Ruft den Host und Port ab, von der die Anforderung oder Antwort empfangen wurden. + Gibt zurück.Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Warnwert dar, der vom Warn-Header verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + Der Datum/Uhrzeit-Stempel der Warnung. + + + Ruft den Host ab, der die Warnung angehängt hat. + Gibt zurück.Der Host, der die Warnung angehängt hat. + + + Ruft den spezifischen Warncode ab. + Gibt zurück.Der spezifische Warncode. + + + Ruft den Datum-/Uhrzeit-Stempel der Warnung ab. + Gibt zurück.Der Datum/Uhrzeit-Stempel der Warnung. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt eine -Instanz zurück. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft eine Zeichenfolge in Anführungszeichen ab, die den Warnungstext enthält. + Gibt zurück.Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/es/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/es/a new file mode 100644 index 00000000000..dad879d5f34 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/es/a @@ -0,0 +1,2322 @@ + + + + System.Net.Http + + + + Proporciona contenido HTTP basado en una matriz de bytes. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El valor del parámetro es null. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El desplazamiento, en bytes, del parámetro de usado para inicializar . + El número de bytes de a partir del parámetro de usado para inicializar . + El valor del parámetro es null. + El parámetro es menor que cero.O bienEl parámetro es mayor que la longitud del contenido que especifica el parámetro .O bienEl parámetro es menor que cero.O bienEl valor del parámetro es mayor que la longitud del contenido que especifica menos el parámetro . + + + Crea una secuencia de contenido HTTP como una operación asincrónica para lectura cuya memoria auxiliar es memoria procedente del objeto . + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Serialice y escriba la matriz de bytes proporcionada en el constructor en una secuencia de contenido HTTP como operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte, como el token de enlace de canal.Este parámetro puede ser null. + + + Determina si una matriz de bytes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes de la matriz. + + + Especifica cómo se proporcionan los certificados de cliente. + + + + intentará proporcionar automáticamente todos los certificados de cliente disponibles. + + + La aplicación proporciona manualmente los certificados de cliente a .Este valor es el predeterminado. + + + Un tipo para los controladores HTTP que delegan el procesamiento de los mensajes de respuesta HTTP a otro controlador, denominado controlador interno. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Libera los recursos no administrados que utiliza el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el controlador interno que procesa los mensajes de respuesta HTTP. + Devuelve .Controlador interno para los mensajes de respuesta HTTP. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Contenedor para las tuplas de nombre-valor codificadas mediante el tipo MIME de application/x-www-form-urlencoded. + + + Inicializa una nueva instancia de la clase con una colección específica de pares de nombre y valor. + Colección de pares de nombre-valor. + + + Proporciona una clase base para enviar solicitudes HTTP y recibir respuestas HTTP de un recurso identificado por un URI. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un controlador específico. + Pila de controlador HTTP que se va a usar para enviar solicitudes. + + + Inicializa una nueva instancia de la clase con un controlador específico. + + responsable de procesar los mensajes de respuesta HTTP. + Es true si Dispose() debe desechar el controlador interno; es false si piensa reutilizar el controlador interno. + + + Obtiene o establece la dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + Devuelve .La dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + + + Cancela todas las solicitudes pendientes en esta instancia. + + + Obtiene los encabezados que se deben enviar con cada solicitud. + Devuelve .Encabezados que se deben enviar con cada solicitud. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar tanto recursos administrados como no administrados; es false para liberar únicamente recursos no administrados. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Obtiene o establece el número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta. + Devuelve .Número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta.El valor predeterminado de esta propiedad es 2 gigabytes. + El tamaño especificado es menor o igual que cero. + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Obtiene o establece el tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + Devuelve .El tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + El tiempo de espera especificado es menor o igual que cero y no es . + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Controlador de mensajes predeterminado usado por . + + + Cree una instancia de una clase . + + + Obtiene o establece un valor que indica si el controlador debe seguir las respuestas de redirección. + Devuelva .true si el controlador debe seguir las respuestas de redirección; si no false.El valor predeterminado es true. + + + Obtiene o establece el tipo de método de descompresión utilizado por el controlador para la descompresión automática de la respuesta de contenido HTTP. + Devuelva .El método de descompresión automática utilizado por el controlador.El valor predeterminado es . + + + Obtiene o establece la colección de certificados de seguridad asociados a este controlador. + Devuelva .Colección de certificados de seguridad asociados a este controlador. + + + Obtiene o establece el contenedor de cookies que el controlador usa para almacenar cookies del servidor. + Devuelva .Contenedor de cookies que el controlador usa para almacenar cookies del servidor. + + + Obtiene o establece la información de autenticación utilizada por este controlador. + Devuelva .Credenciales de autenticación asociadas con el controlador.El valor predeterminado es null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el número máximo de redirecciones que seguirá el controlador. + Devuelva .El número máximo de respuestas de redirección que seguirá el controlador.El valor predeterminado es 50. + + + Obtiene o establece el tamaño máximo del búfer de contenido de solicitud usado por el controlador. + Devuelva .Tamaño máximo de búfer de contenido de la solicitud en bytes.El valor predeterminado es 2 gigabytes. + + + Obtiene o establece un valor que indica si el controlador envía un encabezado de autorización con la solicitud. + Devuelva .Es true para que el controlador envíe un encabezado de autorización HTTP con las solicitudes después de que tenga lugar la autenticación; de lo contrario, es false.El valor predeterminado es false. + + + Obtiene o establece la información de proxy que usa el controlador. + Devuelva .La información de proxy que usará el controlador.El valor predeterminado es null. + + + Crea una instancia de basándose en la información proporcionada en el objeto como una operación que no se bloqueará. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Obtiene un valor que indica si el controlador admite la descompresión automática del contenido de la respuesta. + Devuelva .true si el controlador admite la descompresión automática del contenido de la respuesta; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite valores de proxy. + Devuelva .true si el controlador admite valores de proxy; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite opciones de configuración para las propiedades y . + Devuelva .true si el controlador admite las opciones de configuración para las propiedades y ; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que indica si el controlador utiliza la propiedad para almacenar las cookies de servidor y utiliza estas cookies al enviar solicitudes. + Devuelva .true si el controlador admite el uso de la propiedad para almacenar las cookies de servidor y usa estas cookies al enviar solicitudes; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que controla si se envían las credenciales predeterminadas con las solicitudes del controlador. + Devuelva .Es true si se utilizan las credenciales predeterminadas; en cualquier otro caso, es false.El valor predeterminado es false. + + + Obtiene o establece un valor que indica si el controlador usa un proxy para las solicitudes. + Devuelva .true si el controlador debe usar un servidor proxy para las solicitudes; si no false.El valor predeterminado es true. + + + Indica si las operaciones de se consideran completadas cualquiera tan pronto como una respuesta esté disponible o después de leer el mensaje de respuesta completo, incluido el contenido. + + + La operación debe completarse después de leer toda la respuesta incluido el contenido. + + + La operación debe completarse tan pronto como haya una respuesta disponible y se lean los encabezados.El contenido no se ha leído aún. + + + Una clase base que representa un cuerpo de entidad y encabezados de contenido HTTP. + + + Inicializa una nueva instancia de la clase . + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Serializa el contenido HTTP en una secuencia de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene los encabezados de contenido HTTP tal como se define en RFC 2616. + Devuelva .Encabezados de contenido como se define en RFC 2616. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + El tamaño máximo, en bytes, del búfer que se va a utilizar. + + + Serializa el contenido HTTP en una matriz de bytes como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializar el contenido HTTP y devolver una secuencia que representa el contenido como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una cadena como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido HTTP tiene una longitud válida en bytes. + Devuelva .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Tipo base para los controladores de mensajes HTTP. + + + Inicializa una nueva instancia de la clase . + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase especializada que permite que las aplicaciones llamen al método en una cadena de controlador HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + true si Dispose() debe desechar el controlador interno,false si piensa reutilizar el controlador interno. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase auxiliar para recuperar y comparar métodos HTTP estándar y para crear nuevos métodos HTTP. + + + Inicializa una instancia nueva de la clase con un método HTTP específico. + Método HTTP. + + + Representa un método de protocolo HTTP DELETE. + Devuelva . + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Método HTTP que se va a comparar con el objeto actual. + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Objeto que se va a comparar con el objeto actual. + + + Representa un método de protocolo HTTP GET. + Devuelva . + + + Actúa como función hash para este tipo. + Devuelva .Código hash para el objeto actual. + + + Representa un método de protocolo HTTP HEAD.El método HEAD es idéntico a GET, excepto que el servidor sólo devuelve los encabezados de mensaje en la respuesta, sin el cuerpo del mensaje. + Devuelva . + + + Un método HTTP. + Devuelva .Un método HTTP representado como . + + + Operador de igualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados son iguales; en caso contrario, es false. + + izquierdo para un operador de igualdad. + + derecho para un operador de igualdad. + + + Operador de desigualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados no son iguales; en caso contrario, es false. + + izquierdo para un operador de desigualdad. + + derecho para un operador de desigualdad. + + + Representa un método de protocolo HTTP OPTIONS. + Devuelva . + + + Representa un método de protocolo POST HTTP, utilizado para enviar una entidad nueva como adición a un identificador URI. + Devuelva . + + + Representa un método de protocolo HTTP PUT, utilizado para reemplazar una entidad identificada por un identificador URI. + Devuelva . + + + Devuelve una cadena que representa el objeto actual. + Devuelva .Cadena que representa el objeto actual. + + + Representa un método de protocolo HTTP TRACE. + Devuelva . + + + Una clase base para las excepciones que producen las clases y . + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual. + Mensaje que describe la excepción actual. + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual y una excepción interna. + Mensaje que describe la excepción actual. + Excepción interna. + + + Representa un mensaje de solicitud HTTP. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Cadena que representa el objeto de solicitud. + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Objeto que se va a solicitar. + + + Obtiene o establece el contenido del mensaje HTTP. + Devuelve .Contenido de un mensaje. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene la colección de encabezados de la solicitud HTTP. + Devuelve .Colección de encabezados de la solicitud HTTP. + + + Obtiene o establece el método HTTP usado por el mensaje de solicitud HTTP. + Devuelve .Método HTTP usado por el mensaje de solicitud.El valor predeterminado es el método GET. + + + Obtiene un conjunto de propiedades de la solicitud HTTP. + Devuelve . + + + Obtiene o establece el usado para la solicitud HTTP. + Devuelve . que se usa para la solicitud HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Representa un mensaje de respuesta HTTP incluido el código de estado y los datos. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una instancia nueva de la clase con un específico. + Código de estado de la respuesta HTTP. + + + Obtiene o establece el contenido de texto de un mensaje de respuesta HTTP. + Devuelve .Contenido del mensaje de respuesta HTTP. + + + Libera los recursos no administrados y desecha los recursos no administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Se produce una excepción si la propiedad para la respuesta HTTP es false. + Devuelve .Mensaje de respuesta HTTP si la llamada es correcta. + + + Obtiene la colección de encabezados de respuesta HTTP. + Devuelve .Colección de encabezados de respuesta HTTP. + + + Obtiene un valor que indica si la respuesta HTTP se realizó correctamente. + Devuelve .Un valor que indica si la respuesta HTTP se realizó correctamente.true si estaba en el intervalo 200-299; si no false. + + + Obtiene o establece la frase de razón que envían normalmente los servidores junto con el código de estado. + Devuelve .La frase de la razón enviada por el servidor. + + + Obtiene o establece el mensaje de solicitud que condujo a este mensaje de respuesta. + Devuelve .El mensaje de solicitud que condujo a este mensaje de respuesta. + + + Obtiene o establece el código de estado de la respuesta HTTP. + Devuelve .Código de estado de la respuesta HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Un tipo base para los controladores que solo realizan un pequeño procesamiento de mensajes de solicitud y/o de respuesta. + + + Cree una instancia de una clase . + + + Crea una instancia de una clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Realiza el procesamiento en cada solicitud enviada al servidor. + Devuelve .Mensaje de solicitud HTTP que se procesó. + Mensaje de la solicitud HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Realiza el procesamiento en cada respuesta del servidor. + Devuelve .Mensaje de respuesta HTTP que se procesó. + Mensaje de respuesta HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El valor de era null. + + + Proporciona una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + + era null o solo contiene caracteres de espacios en blanco. + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + La cadena delimitadora para el contenido con varias partes. + + era null o una cadena vacía. era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agregue contenido con varias partes HTTP a una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Devuelve un enumerador que recorre en iteración la colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Serialice el contenido HTTP con varias partes en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Implementación explícita del método . + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Determina si el contenido HTTP con varias partes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Proporciona un contenedor para contenido codificado mediante el tipo MIME multipart/form-data. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + La cadena delimitadora para el contenido de los datos de formulario con varias partes. + + era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + + era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + Nombre del archivo para el contenido HTTP se va a agregar a la colección. + + era null o solo contiene caracteres de espacios en blanco.O bien era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Proporciona contenido HTTP basado en una secuencia. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Tamaño del búfer, en bytes, para . + El valor de era null. + + era menor o igual que cero. + + + Escribe el contenido de una secuencia HTTP en una secuencia de memoria como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido de la secuencia tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes del contenido de la secuencia. + + + Proporciona contenido HTTP basado en una cadena. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + Tipo de medio que se va a utilizar para el contenido. + + + Representa la información de autenticación en los valores de los encabezados Authorization, ProxyAuthorization, WWW-Authenticate y Proxy-Authenticate. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + Credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene las credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + Devuelve .Credenciales que contienen la información de autenticación. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene el esquema que se va a usar para la autorización. + Devuelve .El esquema que se va a usar para la autorización. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Cache-Control. + + + Inicializa una nueva instancia de la clase . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Tokens de extensión de caché, cada uno con un valor asignado opcional. + Devuelve .Colección de tokens de la extensión de memoria caché, cada uno con un valor asignado opcional. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Edad máxima, especificada en segundos, que el cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta que ha superado la fecha de expiración; si no, false. + + + Tiempo máximo, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .Tiempo en segundos. + + + Duración de la actualización, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta; si no, false. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “no-cache” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta. + Devuelve .true si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta; si no, false. + + + Si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad. + Devuelve .true si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad; si no, false. + + + Si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace). + Devuelve .true si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace); si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información no válida del valor de encabezado cache-control. + + es una referencia null. + + no es información válida del valor del encabezado de control de caché. + + + Si todo o parte del mensaje de respuesta HTTP está diseñado para un único usuario y no se debe almacenar en una memoria caché compartida. + Devuelve .true si el mensaje de respuesta HTTP está pensado para un único usuario y una memoria caché compartida no lo debe almacenar en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “privada” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta para memorias caché compartidas de agente de usuario. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta para memorias caché compartidas de agente de usuario; si no, false. + + + Si cualquier memoria caché puede almacenar una respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida. + Devuelve .true si cualquier memoria caché puede almacenar la respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida; si no, false. + + + La edad máxima compartida, especificada en segundos, en una respuesta HTTP que reemplaza la directiva de "max-age" en un encabezado cache-control o un encabezado Expires para una memoria caché compartida. + Devuelve .Tiempo en segundos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Disposition. + + + Inicializa una nueva instancia de la clase . + + . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Fecha y hora de creación del archivo. + Devuelve .Fecha de creación del archivo. + + + Tipo de disposición para una parte del cuerpo de contenido. + Devuelve .Tipo de disposición. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sugerencia sobre cómo crear un nombre de archivo para almacenar la carga del mensaje que se usará si la entidad se desasocia y se almacena un en archivo independiente. + Devuelve .Nombre de archivo sugerido. + + + Sugerencia sobre cómo crear un nombres de archivo para almacenar cargas de mensajes que se usará si las entidades se desasocian y se almacenan en un archivo independiente. + Devuelve .Nombre de archivo sugerido de filename* del formulario. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Fecha y hora de la última modificación del archivo. + Devuelve .Fecha de modificación del archivo. + + + Nombre de una parte del cuerpo de contenido. + Devuelve .Nombre de la parte del cuerpo de contenido. + + + Conjunto de parámetros incluidos el encabezado de Content-Disposition. + Devuelve .Colección de parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de disposición del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de disponibilidad de contenido. + + + Fecha en que se leyó el archivo por última vez. + Devuelve .Última fecha de lectura. + + + Tamaño aproximado del archivo en bytes. + Devuelve .Tamaño aproximado en bytes. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Range. + + + Inicializa una nueva instancia de la clase . + Punto inicial o final del intervalo, en bytes. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + Punto inicial o final del intervalo, en bytes. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición, en bytes, en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si el encabezado de Content-Range tiene una longitud especificada. + Devuelve .true si Content-Range tiene una longitud especificada; si no, false. + + + Obtiene si el Content-Range tiene un intervalo especificado. + Devuelve .true si Content-Range tiene un intervalo especificado; si no, false. + + + Obtiene la longitud del cuerpo de entidad completo. + Devuelve .La longitud del cuerpo de entidad completo. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de intervalo del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo del contenido. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Las unidades de intervalo usadas. + Devuelve . que contiene unidades de intervalo. + + + Representa un valor de encabezado de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + Un valor que indica si este encabezado de la etiqueta de entidad es un validador débil.Si el encabezado de la etiqueta de entidad es un validador débil, debe establecerse en true.Si el encabezado de la etiqueta de entidad es un validador seguro, debe establecerse en false. + + + Obtiene el valor del encabezado de la etiqueta de entidad. + Devuelve . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si la etiqueta de entidad es precedida por un indicador de punto débil. + Devuelve .true si la etiqueta de entidad va precedida por un indicador de punto débil; si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la etiqueta de entidad. + + es una referencia null. + + no es información válida del valor del encabezado de la etiqueta de entidad. + + + Obtiene la cadena entre comillas opaca. + Devuelve .Una cadena entrecomillada opaca. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa la colección de encabezados de contenido tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado de contenido Allow en una respuesta HTTP. + Devuelve .Valor del encabezado Allow en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Language en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Language en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Length en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Length en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Location en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Location en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Range en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Range en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Type en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Type en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Expires en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Expires en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Last-Modified en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Last-Modified en una respuesta HTTP. + + + Colección de encabezados y sus valores como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + + + Agrega el encabezado especificado y sus valores en la colección . + Encabezado que se agrega a la colección. + Lista de valores de encabezado que se agregan a la colección. + + + Agrega el encabezado especificado y su valor en la colección . + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Quita todos los encabezados de la colección de . + + + Devuelve si un encabezado concreto existe en la colección de . + Devuelve .true si el encabezado especificado existe en la colección; en caso contrario, false. + El encabezado específico. + + + Devuelve un enumerador que puede recorrer en iteración la instancia de . + Devuelve .Enumerador para . + + + Devuelve todos los valores de un encabezado especificado almacenado en la colección de . + Devuelve .Matriz de cadenas de encabezado. + El encabezado especificado para el que se van a devolver valores. + + + Quita el encabezado especificado de la colección de . + Devuelve . + Nombre del encabezado que se quitará de la colección. + + + Obtiene un enumerador que puede recorrer en iteración un objeto . + Devuelve .Una instancia de una implementación de que puede recorrer en iteración un objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Devuelve un valor que indica si el encabezado especificado y sus valores se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Valores del encabezado. + + + Devuelve un valor que indica si el encabezado especificado y su valor se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Se devuelve si un encabezado y determinados valores especificados se almacenan en la colección . + Devuelve .true es el de encabezado especificado y values se almacenan en la colección; si no false. + Encabezado especificado. + Valores de encabezado especificados. + + + Representa una colección de valores de encabezado. + Tipo de colección de encabezado. + + + Agrega una entrada al objeto . + Elemento que se agrega al encabezado especificada. + + + Quita todas las entradas de . + + + Determina si contiene un elemento. + Devuelve .true si la entrada está contenida en la instancia ; en caso contrario, false + Elemento para encontrar el encabezado especificada. + + + Copia la totalidad de en una matriz unidimensional compatible, comenzando en el índice especificado de la matriz de destino. + + unidimensional que constituye el destino de los elementos copiados de . debe tener una indización de base cero. + Índice de base cero de en el que empieza la operación de copia. + + + Obtiene el número de encabezados de la colección . + Devuelve .Número de encabezados de una colección. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Obtiene un valor que indica si la instancia de es de solo lectura. + Devuelve .true si la instancia de es de sólo lectura; en caso contrario, false. + + + Analiza y agrega una entrada a . + Entrada que se va a agregar. + + + Quita el elemento especificado de . + Devuelve .true si se ha quitado de la instancia ; en caso contrario, false. + Elemento que se va a quitar. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Devuelve una cadena que representa el objeto actual . + Devuelve .Cadena que representa el objeto actual. + + + Determina si la entrada se puede analizar y agregar a . + Devuelve .true si se puede analizar y agregar a la instancia ; de lo contrario, false + Entrada que se va a validar. + + + Representa la colección de encabezados de solicitud tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept para una solicitud HTTP. + Devuelve .Valor del encabezado Accept para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Charset para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Charset para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Encoding para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Language para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Language para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una solicitud HTTP. + Devuelve .Valor del encabezado Cache-Control para una solicitud HTTP. + + + Obtiene el valor del encabezado Connection para una solicitud HTTP. + Devuelve .Valor del encabezado Connection para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una solicitud HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una solicitud HTTP. + Devuelve .Valor del encabezado Date para una solicitud HTTP. + + + Obtiene el valor del encabezado Expect para una solicitud HTTP. + Devuelve .Valor del encabezado Expect para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Expect para una solicitud HTTP contiene Continuar. + Devuelve .true si el encabezado Expect contiene Continue, si no false. + + + Obtiene o establece el valor del encabezado From para una solicitud HTTP. + Devuelve .Valor del encabezado From para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Host para una solicitud HTTP. + Devuelve .Valor del encabezado Host para una solicitud HTTP. + + + Obtiene el valor del encabezado If-Match para una solicitud HTTP. + Devuelve .Valor del encabezado If-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Modified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Modified-Since para una solicitud HTTP. + + + Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + Devuelve .Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Range para una solicitud HTTP. + Devuelve .Valor del encabezado If-Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Unmodified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Unmodified-Since para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Max-Forwards para una solicitud HTTP. + Devuelve .Valor del encabezado Max-Forwards para una solicitud HTTP. + + + Obtiene el valor del encabezado Pragma para una solicitud HTTP. + Devuelve .Valor del encabezado Pragma para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Proxy-Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Proxy-Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Range para una solicitud HTTP. + Devuelve .Valor del encabezado Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Referer para una solicitud HTTP. + Devuelve .Valor del encabezado Referer para una solicitud HTTP. + + + Obtiene el valor del encabezado TE para una solicitud HTTP. + Devuelve .Valor del encabezado TE para una solicitud HTTP. + + + Obtiene el valor del encabezado Trailer para una solicitud HTTP. + Devuelve .Valor del encabezado Trailer para una solicitud HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una solicitud HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una solicitud HTTP. + Devuelve .Valor del encabezado Upgrade para una solicitud HTTP. + + + Obtiene el valor del encabezado User-Agent para una solicitud HTTP. + Devuelve .Valor del encabezado User-Agent para una solicitud HTTP. + + + Obtiene el valor del encabezado Via para una solicitud HTTP. + Devuelve .Valor del encabezado Via para una solicitud HTTP. + + + Obtiene el valor del encabezado Warning para una solicitud HTTP. + Devuelve .Valor del encabezado Warning para una solicitud HTTP. + + + Representa la colección de encabezados de respuesta tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept-Ranges para una respuesta HTTP. + Devuelve .Valor del encabezado Accept-Ranges para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Age para una respuesta HTTP. + Devuelve .Valor del encabezado Age para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una respuesta HTTP. + Devuelve .Valor del encabezado Cache-Control para una respuesta HTTP. + + + Obtiene el valor del encabezado Connection para una respuesta HTTP. + Devuelve .Valor del encabezado Connection para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una respuesta HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una respuesta HTTP. + Devuelve .Valor del encabezado Date para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado ETag para una respuesta HTTP. + Devuelve .Valor del encabezado ETag para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Location para una respuesta HTTP. + Devuelve .Valor del encabezado Location para una respuesta HTTP. + + + Obtiene el valor del encabezado Pragma para una respuesta HTTP. + Devuelve .Valor del encabezado Pragma para una respuesta HTTP. + + + Obtiene el valor del encabezado Proxy-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado Proxy-Authenticate para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Retry-After para una respuesta HTTP. + Devuelve .Valor del encabezado Retry-After para una respuesta HTTP. + + + Obtiene el valor del encabezado Server para una respuesta HTTP. + Devuelve .Valor del encabezado Server para una respuesta HTTP. + + + Obtiene el valor del encabezado Trailer para una respuesta HTTP. + Devuelve .Valor del encabezado Trailer para una respuesta HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una respuesta HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una respuesta HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una respuesta HTTP. + Devuelve .Valor del encabezado Upgrade para una respuesta HTTP. + + + Obtiene el valor del encabezado Vary para una respuesta HTTP. + Devuelve .Valor del encabezado Vary para una respuesta HTTP. + + + Obtiene el valor del encabezado Via para una respuesta HTTP. + Devuelve .Valor del encabezado Via para una respuesta HTTP. + + + Obtiene el valor del encabezado Warning para una respuesta HTTP. + Devuelve .Valor del encabezado Warning para una respuesta HTTP. + + + Obtiene el valor del encabezado WWW-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado WWW-Authenticate para una respuesta HTTP. + + + Representa un tipo de medio utilizado en un encabezado Content-Type como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El origen representado como una cadena para inicializar la nueva instancia. + + + Obtiene o define el juego de caracteres. + Devuelve .El juego de caracteres. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene o establece el valor de encabezado del tipo de medio. + Devuelve .El valor del encabezado media-type. + + + Obtiene o establece los parámetros del valor de encabezado del tipo de medio. + Devuelve .Los parámetros de valores de encabezado media-type. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del tipo de medio. + + es una referencia null. + + no es información válida del valor del encabezado del tipo de medio. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un tipo de medio con un factor de calidad adicional utilizado en un encabezado Content-Type. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + La calidad asociada a este valor de encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el tipo de medios con la información de valor de encabezado de calidad. + + es una referencia null. + + es el tipo de medio no válido con información de valor de encabezado de calidad. + + + Obtiene o establece el valor de calidad de . + Devuelve .Valor de calidad del objeto . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un par de nombre y valor utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre de encabezado. + Devuelve .Nombre del encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del valor de nombre. + + es una referencia null. + + no es información válida del valor del encabezado del valor de nombre. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de encabezado. + Devuelve .Valor del encabezado. + + + Representa un par de nombre y valor con parámetros utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros del objeto . + Devuelve .Una colección que contiene los parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el valor de nombre con la información de valor de encabezado del parámetro. + + es una referencia null. + + es un valor de nombre no válido con información de valor de encabezado de parámetro. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de token de producto en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Nombre del producto. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre del token de producto. + Devuelve .Nombre del token de producto. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del producto. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la versión del token de producto. + Devuelve .Versión del token de producto. + + + Representa un valor que puede ser un producto o un comentario en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un valor de comentario. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Obtiene el comentario del objeto . + Devuelve .El valor de comentario . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la información del producto. + + es una referencia null. + + no es información válida del valor del encabezado de la información del producto. + + + Obtiene el producto del objeto . + Devuelve .El valor de producto de este . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado If-Range que puede ser de fecha y hora o de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Un valor de datos utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una etiqueta de entidad representada como cadena utilizada para inicializar la nueva instancia. + + + Obtiene la fecha del objeto . + Devuelve .La fecha del objeto . + + + Obtiene la etiqueta de entidad del objeto . + Devuelve .La etiqueta de entidad del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de intervalo. + + es una referencia null. + + no es información del valor del encabezado de la condición de intervalo. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un intervalo de bytes. + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del intervalo. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo. + + + Obtiene los intervalos especificados en el objeto . + Devuelve .Los intervalos del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la unidad del objeto . + Devuelve .La unidad del objeto . + + + Representa un intervalo de bytes en un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Representa un valor de encabezado Retry-After que puede ser de fecha y hora o de duración. + + + Inicializa una nueva instancia de la clase . + Desplazamiento de fecha y hora utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El delta, en segundos, utilizado para inicializar la nueva instancia. + + + Obtiene el desplazamiento de fecha y hora desde el objeto . + Devuelve .Desplazamiento de fecha y hora desde el objeto . + + + Obtiene el delta en segundos del objeto . + Devuelve .El delta en segundos del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de reintento. + + es una referencia null. + + no es información válida del valor del encabezado de la condición de reintento. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado de cadena con una calidad opcional. + + + Inicializa una nueva instancia de la clase . + La cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un factor de calidad utilizado para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de calidad. + + es una referencia null. + + es una cadena no válida con información de encabezado de valor de encabezado de calidad. + + + Obtiene el factor de calidad del objeto . + Devuelve .EL factor de calidad del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de cadena del objeto . + Devuelve .El valor de cadena del objeto . + + + Representa un valor de encabezado Accept-Encoding. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros de codificación de transferencia. + Devuelve .Los parámetros de codificación de transferencia. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de codificación de transferencia. + + es una referencia null. + + no es información válida del valor del encabezado de codificación de transferencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de codificación de transferencia. + Devuelve .El valor de codificación de transferencia. + + + Representa un valor del encabezado Accept-Encoding con factor de calidad opcional. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un valor para el factor de calidad. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor de codificación de transferencia. + + es una referencia null. + + es una codificación de transferencia no válida con información de valor de encabezado de calidad. + + + Obtiene el factor de calidad de . + Devuelve .El factor de calidad de . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor de un encabezado Via. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Obtiene el campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + Devuelve .El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Devuelve un código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa a través de la información del valor del encabezado. + + es una referencia null. + + no es información válida a través de la información del valor del encabezado. + + + Obtiene el nombre de protocolo del protocolo recibido. + Devuelve .Nombre del protocolo. + + + Obtiene la versión de protocolo del protocolo recibido. + Devuelve .Versión de protocolo. + + + Obtiene el host y el puerto donde se recibió la solicitud o la respuesta. + Devuelve .El host y el puerto donde se recibió la solicitud o la respuesta. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de advertencia utilizado por el encabezado Warning. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + Marca de tiempo de la advertencia. + + + Obtiene el host que adjuntó la advertencia. + Devuelve .El host que adjuntó la advertencia. + + + Obtiene el código de la advertencia específico. + Devuelve .El código de la advertencia específico. + + + Obtiene la marca de tiempo de la advertencia. + Devuelve .Marca de tiempo de la advertencia. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve una instancia . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene una cadena entre comillas que contiene el texto de advertencia. + Devuelve .Una cadena entre comillas que contiene el texto de advertencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/fr/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/fr/a new file mode 100644 index 00000000000..95484975134 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/fr/a @@ -0,0 +1,2361 @@ + + + + System.Net.Http + + + + Fournit du contenu HTTP basé sur un tableau d'octets. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Le paramètre est null. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Décalage, en octets, dans le paramètre utilisé pour initialiser . + Nombre d'octets dans le en commençant par le paramètre utilisé pour initialiser . + Le paramètre est null. + Le paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre.ouLe paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre . + + + Crée un flux de contenu HTTP en tant qu'opération asynchrone pour la lecture dont le magasin de stockage est lié au . + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise et écrit le tableau d'octets fourni dans le constructeur pour un flux de contenu HTTP sous forme d'une opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport, (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si un tableau d'octets a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur, en octets, du tableau d'octets. + + + Spécifie la façon dont les certificats clients sont fournis. + + + + tentera de fournir automatiquement tous les certificats client disponibles. + + + L'application fournit manuellement les certificats clients au .Cette valeur est celle par défaut. + + + Type pour les gestionnaires HTTP qui délèguent le traitement des messages de réponse HTTP à un autre gestionnaire, appelé le gestionnaire interne. + + + Crée une instance de la classe . + + + Crée une instance de la classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Libère les ressources non managées utilisées par et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le gestionnaire interne qui traite les messages de réponse HTTP. + retourne  ;Gestionnaire interne des messages de réponse HTTP. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation pour annuler une opération. + + était null. + + + Conteneur pour les tuples nom/valeur encodés en utilisant le type MIME application/x-www-form-urlencoded. + + + Initialise une nouvelle instance de la classe avec une collection de paires nom/valeur spécifique. + Collection de paires nom/valeur. + + + Fournit une classe de base pour envoyer des requêtes HTTP et recevoir des réponses HTTP d'une ressource identifiée par un URI. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + Pile du gestionnaire HTTP à utiliser pour envoyer des demandes. + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Obtient ou définit l'adresse de base de l'URI de la ressource Internet utilisée pour envoyer des demandes. + Retourne .Adresse de base de l'URI de la ressource Internet utilisée pour l'envoi des demandes. + + + Annulez toutes les demandes en attente sur cette instance. + + + Obtient les en-têtes qui doivent être envoyés avec chaque demande. + Retourne .En-têtes qui doivent être envoyés avec chaque demande. + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Obtient ou définit le nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse. + Retourne .Nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse.La valeur par défaut de cette propriété est 2 gigaoctets. + La taille spécifiée est inférieure ou égale à zéro. + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Obtient ou définit la période d'attente jusqu'à l'expiration de la demande. + Retourne .Période d'attente jusqu'à l'expiration de la demande. + Le délai d'attente spécifié est inférieur ou égal à zéro et n'est pas . + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Gestionnaire de messages par défaut utilisé par . + + + Crée une instance d'une classe . + + + Obtient ou définit une valeur qui indique si le gestionnaire doit suivre les réponses de redirection. + retourne  ;true si le gestionnaire doit suivre les réponses de redirection ; sinon false.La valeur par défaut est true. + + + Obtient ou définit le type de méthode de décompression utilisé par le gestionnaire pour la décompression automatique de la réponse de contenu HTTP. + retourne  ;Méthode de décompression automatique utilisée par le gestionnaire.La valeur par défaut est . + + + Obtient ou définit la collection de certificats de sécurité qui sont associés à ce gestionnaire. + retourne  ;Collection de certificats de sécurité associés à ce gestionnaire. + + + Obtient ou définit le conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + retourne  ;Conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + + + Obtient ou définit les informations d'authentification utilisées par ce gestionnaire. + retourne  ;Informations d'authentification associées au gestionnaire.La valeur par défaut est null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le nombre maximal de redirections suivies par le gestionnaire. + retourne  ;Nombre maximal de réponses de redirection suivies par le gestionnaire.La valeur par défaut est 50. + + + Obtient ou définit la taille maximale de mémoire tampon de contenu demandée utilisée par le gestionnaire. + retourne  ;Taille maximale de mémoire tampon de contenu en octets.La valeur par défaut est 2 gigaoctets. + + + Obtient ou définit une valeur indiquant si le gestionnaire envoie un en-tête d'autorisation avec la requête. + retourne  ;true pour que le gestionnaire envoie un en-tête HTTP d'autorisation avec les requêtes une fois l'authentification exécutée ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit les informations de proxy utilisées par le gestionnaire. + retourne  ;Informations de proxy utilisées par le gestionnaire.La valeur par défaut est null. + + + Crée une instance de en fonction des informations fournies dans le en tant qu'opération qui ne se bloque pas. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP. + Jeton d'annulation pour annuler l'opération. + + était null. + + + Obtient une valeur qui indique si le gestionnaire prend en charge la décompression de contenu de réponse automatique. + retourne  ;true si le gestionnaire prend en charge la décompression de contenu de réponse automatique ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres du proxy. + retourne  ;true si le gestionnaire prend en charge les paramètres de proxy ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et . + retourne  ;true si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et  ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise la propriété pour stocker des cookies de serveur et utilise ces cookies en envoyant les demandes. + retourne  ;true si le gestionnaire utilise la propriété pour stocker des cookies de serveur, et utilise ces cookies lors de l'envoi de requêtes ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui contrôle si les informations d'identification par défaut sont envoyées avec les requêtes par le gestionnaire. + retourne  ;true si les informations d'identification par défaut sont utilisées ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise un proxy pour les demandes. + retourne  ;true si le gestionnaire utilise un proxy pour les demandes ; sinon false.La valeur par défaut est true. + + + Indique si les opérations doivent être considérées comme étant terminées dès qu'une réponse est disponible, ou après avoir pris connaissance de l'intégralité du message de réponse intégrant le contenu. + + + L'opération doit se terminer après la lecture de l'intégralité de la réponse intégrant le contenu. + + + L'opération doit se terminer dès qu'une réponse est disponible et que les en-têtes sont lus.Le contenu n'est pas encore lu. + + + Classe de base représentant un corps d'entité HTTP et les en-têtes de contenu. + + + Initialise une nouvelle instance de la classe . + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Sérialise le contenu HTTP dans un flux de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient les en-têtes de contenu HTTP, tels que définis dans la norme RFC 2616. + retourne  ;En-têtes de contenu, tels que définis dans RFC 2616. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Taille maximale, en octets, de la mémoire tampon à utiliser. + + + Sérialise le contenu HTTP dans un tableau d'octets sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP et retourne un flux qui représente le contenu comme une opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans une chaîne sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Type de base pour les gestionnaires de message HTTP. + + + Initialise une nouvelle instance de la classe . + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe spécialisée qui permet aux applications d'appeler la méthode sur une chaîne de gestionnaire HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe d'assistance pour récupérer et comparer les méthodes HTTP standard et pour créer de nouvelles méthodes HTTP. + + + Initialise une nouvelle instance de la classe avec une méthode HTTP spécifique. + Méthode HTTP. + + + Représente une méthode de protocole HTTP DELETE. + retourne  ; + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Méthode HTTP à comparer à l'objet actif. + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Objet à comparer avec l'objet actif. + + + Représente une méthode de protocole HTTP GET. + retourne  ; + + + Sert de fonction de hachage pour ce type. + retourne  ;Code de hachage du en cours. + + + Représente une méthode de protocole HTTP HEAD.La méthode HEAD est identique à GET, mais le serveur retourne uniquement des en-têtes de message dans la réponse, sans corps du message. + retourne  ; + + + Méthode HTTP. + retourne  ;Méthode HTTP représentée en tant que . + + + Opérateur d'égalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et sont égaux ; sinon, false. + + gauche d'un opérateur d'égalité. + + droit pour un opérateur d'égalité. + + + Opérateur d'inégalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et ne sont pas égaux ; sinon, false. + + gauche d'un opérateur d'inégalité. + + droit pour un opérateur d'inégalité. + + + Représente une méthode de protocole HTTP OPTIONS. + retourne  ; + + + Représente une méthode de protocole HTTP POST utilisée pour publier une nouvelle entité en plus d'un URI. + retourne  ; + + + Représente une méthode de protocole HTTP PUT utilisée pour remplacer une entité identifiée par un URI. + retourne  ; + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une méthode de protocole HTTP TRACE. + retourne  ; + + + Classe de base pour les exceptions levées par les classes et . + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un message spécifique qui décrit l'exception actuelle. + Message qui décrit l'exception en cours. + + + Initialise une nouvelle instance de la classe avec un message spécifique décrivant l'exception actuelle et une exception interne. + Message qui décrit l'exception en cours. + Exception interne. + + + Représente un message de requête HTTP. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + Chaîne qui représente la requête . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + + à demander. + + + Obtient ou définit le contenu du message HTTP. + retourne  ;Contenu d'un message. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient la collection d'en-têtes de requête HTTP. + retourne  ;Collection d'en-têtes de demande HTTP. + + + Obtient ou définit la méthode HTTP utilisée par le message de requête HTTP. + retourne  ;Méthode HTTP utilisée par le message de requête.La valeur par défaut est la méthode GET. + + + Obtient un ensemble de propriétés pour la requête HTTP. + retourne  ; + + + Obtient ou définit l' utilisé pour la requête HTTP. + retourne  ; utilisé pour la requête HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Représente un message de réponse HTTP avec le code et les données d'état. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un spécifique. + Code d'état de la réponse HTTP. + + + Obtient ou définit le contenu d'un message de réponse HTTP. + retourne  ;Contenu du message de réponse HTTP. + + + Libère les ressources non managées et supprime les ressources non managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Lève une exception si la propriété de la réponse HTTP est false. + retourne  ;Message de réponse HTTP si l'appel a réussi. + + + Obtient la collection d'en-têtes de réponse HTTP. + retourne  ;Collection d'en-têtes de réponse HTTP. + + + Obtient une valeur qui indique si la réponse HTTP a abouti. + retourne  ;Valeur qui indique si la réponse HTTP a abouti.true si était compris entre 200 et 299 ; sinon false. + + + Obtient ou définit l'expression de raison qui en général est envoyée par les serveurs avec le code d'état. + retourne  ;Expression de raison envoyée par le serveur. + + + Obtient ou définit le message de demande qui a conduit à ce message de réponse. + retourne  ;Message de requête qui a conduit à ce message de réponse. + + + Obtient ou définit le code d'état de la réponse HTTP. + retourne  ;Code d'état de la réponse HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Type de base pour les gestionnaires qui traitent uniquement des messages de demande et/ou de réponse. + + + Crée une instance d'une classe . + + + Crée une instance d'une classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Exécute le traitement sur chaque demande envoyée au serveur. + retourne  ;Message de requête HTTP qui a été traité. + Message de la requête HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Exécute le traitement sur chaque réponse du serveur. + retourne  ;Message de réponse HTTP qui a été traité. + Message de réponse HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Fournit une collection d'objets qui sont sérialisés à l'aide de la spécification de type de contenu multipart/*. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + La a la valeur null ou ne contient que des espaces blancs. + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + Chaîne limite pour le contenu Multipart. + Le était null ou était une chaîne vide.La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu multipart HTTP à une collection d'objets de qui sont sérialisés à l'aide de la spécification de type de contenu multipart/* + Contenu HTTP à ajouter à la collection. + + était null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Retourne un énumérateur qui itère dans la collection d'objets qui sont sérialisés à l'aide de la spécification du type de contenu multipart/*. + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Sérialise le contenu multipart HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Implémentation explicite de la méthode . + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Détermine si le contenu multipart HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Fournit un conteneur pour le contenu encodé à l'aide du type MIME multipart/form-data. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Chaîne limite pour le contenu multipart/form-data. + La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + La a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + Nom de fichier du contenu HTTP à ajouter à la collection. + La a la valeur null ou ne contient que des espaces blancs.ouLa a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Fournit du contenu HTTP basé sur un flux. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Taille, en octets, de la mémoire tampon disponible pour . + + était null. + + était inférieur ou égal à zéro. + + + Écrit le contenu de flux HTTP dans un flux de mémoire sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu de flux a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du flux de contenu. + + + Fournit du contenu HTTP basé sur une chaîne. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + Type de média à utiliser pour le contenu. + + + Représente les informations d'identification dans les valeurs d'en-tête Authorization, ProxyAuthorization, WWW-Authenticate et Proxy-Authenticate. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + Informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + retourne  ;Informations d'authentification contenant les informations d'authentification. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient le schéma à utiliser pour l'autorisation. + retourne  ;Schéma à utiliser pour l'autorisation. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Cache-Control. + + + Initialise une nouvelle instance de la classe . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Jetons d'extension en cache ayant chacun une valeur assignée facultative. + retourne  ;Collection de jetons d'extension en cache ayant chacun une valeur assignée facultative. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Durée maximale, exprimée en secondes, pendant laquelle le client HTTP est prêt à accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;true si le client HTTP est prêt à accepter une réponse ayant dépassé le délai d'attente ; sinon, false. + + + Durée maximale, en secondes, pendant laquelle un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;Durée en secondes. + + + Durée de vie d'actualisation, en secondes, pendant laquelle un client HTTP peut accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée. + retourne  ;true si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée ; sinon, false. + + + Indique si un client HTTP est prêt à accepter une réponse mise en cache. + retourne  ;true si le client HTTP est prêt à accepter une réponse mise en cache ; sinon, false. + + + Collection de fieldname dans la directive "no-cache" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si un cache ne doit stocker aucune partie du message de requête HTTP ou aucune réponse. + retourne  ;true si un cache ne doit stocker aucune partie du message de requête HTTP ou d'une réponse ; sinon, false. + + + Indique si un cache ou un proxy ne doit modifier aucun aspect du corps d'entité. + retourne  ;true si un cache ou un proxy ne doivent modifier aucun aspect du corps d'entité ; sinon, false. + + + Indique si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle). + retourne  ;true si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle) ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de contrôle de cache. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de contrôle de cache valides. + + + Indique si l'ensemble ou une partie du message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé. + retourne  ;true si le message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé ; sinon, false. + + + FieldNames de collection dans la directive "privée" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée de cache est périmée pour les caches d'agent utilisateur partagés. + retourne  ;true si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée est périmée pour les caches d'agent utilisateur partagés ; sinon, false. + + + Indique si une réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé. + retourne  ;true si la réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé ; sinon, false. + + + Âge maximal partagé, en secondes, dans une réponse HTTP qui substitue la directive « max-age » dans un en-tête de contrôle du cache ou dans un en-tête Expires d'un cache partagé. + retourne  ;Durée en secondes. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Disposition. + + + Initialise une nouvelle instance de la classe . + + + + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Date de création du fichier. + retourne  ;Date de création du fichier. + + + Type de disposition d'un élément de corps de contenu. + retourne  ;Type de disposition. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Suggestion sur la façon dont construire un Filename pour stocker la charge de message à utiliser si l'entité est détachée et stockée dans un fichier séparé. + retourne  ;Filename suggéré. + + + Suggestion sur la façon dont construire des Filenames pour stocker des charges de messages à utiliser si les entités sont détachées et stockées dans des fichiers séparés. + retourne  ;Filename suggéré du nom de fichier* de formulaire. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Date de modification du fichier. + retourne  ;Date de modification du fichier. + + + Nom d'un élément de corps de contenu. + retourne  ;Nom de l'élément de corps du contenu. + + + Un jeu de paramètres a inclus l'en-tête de Content-Disposition. + retourne  ;Collection de paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de disposition de contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de disposition de contenu valides. + + + Date de la dernière lecture du fichier. + retourne  ;Date de la dernière lecture. + + + Taille approximative du fichier, en octets. + retourne  ;Taille approximative, en octets. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Range. + + + Initialise une nouvelle instance de la classe . + Point de départ ou de fin de la plage, en octets. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + Point de départ ou de fin de la plage, en octets. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position, en octets, à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si une longueur est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la longueur de Content-Range est spécifiée ; sinon, false. + + + Obtient une valeur indiquant si une plage est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la plage de Content-Range est spécifiée ; sinon, false. + + + Obtient la longueur du corps d'entité entier. + retourne  ;Longueur du corps d'entité entier. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage du contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage de contenu valides. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Unités de plage utilisées. + retourne  ; qui contient des unités de plage. + + + Représente une valeur d'en-tête de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + Valeur qui indique si cet en-tête de balise d'entité est un validateur faible.Si l'en-tête de la balise d'entité est un validateur faible, doit avoir la valeur true.Si l'en-tête de la balise d'entité est un validateur fort, doit avoir la valeur false. + + + Obtient la valeur d'en-tête de la balise d'entité. + retourne  ; + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si la balise d'entité est précédée d'un indicateur de faiblesse. + retourne  ;true si la balise d'entité est préfacée par un indicateur de faiblesse ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de balise d'entité. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de balise d'entité valides. + + + Obtient la chaîne entre guillemets opaque. + retourne  ;Chaîne entre guillemets opaque. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la collection d'en-têtes de contenu comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête de contenu Allow sur une réponse HTTP. + retourne  ;Valeur de l'en-tête Allow sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Expires sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Expires sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + + + Collection d'en-têtes et de leurs valeurs tels que définis dans RFC 2616. + + + Initialise une nouvelle instance de la classe . + + + Ajoute l'en-tête spécifié et ses valeurs dans la collection de . + En-tête à ajouter à la collection. + Liste des valeurs d'en-tête à ajouter à la collection. + + + Ajoute l'en-tête spécifié et sa valeur dans la collection de . + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Supprime tous les en-têtes de la collection . + + + Retourne si un en-tête spécifique existe dans la collection . + retourne  ;true si l'en-tête spécifié existe dans la collection ; sinon false. + En-tête spécifique. + + + Retourne un énumérateur qui peut itérer au sein de l'instance de . + retourne  ;Énumérateur pour . + + + Retourne toutes les valeurs d'en-tête pour un en-tête spécifié stockées dans la collection . + retourne  ;Tableau de chaînes d'en-tête. + En-tête spécifié pour lequel retourner les valeurs. + + + Supprime l'en-tête spécifié de la collection . + retourne  ; + Nom de l'en-tête à supprimer de la collection. + + + Obtient un énumérateur pouvant itérer au sein de . + retourne  ;Instance d'une implémentation de pouvant itérer au sein de . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Retourne une valeur qui indique si l'en-tête spécifié et ses valeurs ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Valeur de l'en-tête. + + + Retourne une valeur qui indique si l'en-tête spécifié et sa valeur ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Retourne si un en-tête spécifié et les valeurs spécifiées sont stockés dans la collection . + retourne  ;true signifie que les en-têtes spécifiés et values sont stockés dans la collection ; sinon false. + En-tête spécifié. + Valeurs des en-têtes spécifiées. + + + Représente une collection de valeurs d'en-tête. + Type de collection d'en-têtes. + + + Ajoute une entrée à . + Élément à ajouter à la collection d'en-têtes. + + + Supprime toutes les entrées de . + + + Détermine si le contient un élément. + retourne  ;true si l'entrée contient l'instance  ; sinon, false. + Élément à rechercher dans la collection d'en-têtes. + + + Copie l'ensemble de l'objet vers un objet unidimensionnel compatible, en commençant à l'index spécifié du tableau cible. + + unidimensionnel qui constitue la destination des éléments copiés à partir d'. doit avoir une indexation de base zéro. + Index de base zéro dans à partir duquel la copie commence. + + + Obtient le nombre d'en-têtes contenus dans . + retourne  ;Nombre d'en-têtes contenus dans une collection. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Obtient une valeur indiquant si l'instance est en lecture seule. + retourne  ;true si l'instance du est en lecture seule ; sinon, false. + + + Analyse et ajoute une entrée à . + Entrée à ajouter. + + + Enlève l'élément spécifié du . + retourne  ;true si a été correctement supprimé de l'instance  ; sinon, false. + Élément à supprimer. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si l'entrée peut être analysée et ajoutée à . + retourne  ;true si peut être analysé et ajouté à l'instance . Sinon, false + Entrée à valider. + + + Représente la collection d'en-têtes de requête comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Charset pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Charset pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Encoding pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Language pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Language pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une requête HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une requête HTTP. + + + Obtient la valeur de l'en-tête Connection pour une requête HTTP. + retourne  ;Valeur de l'en-tête Connection pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une requête HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une requête HTTP. + retourne  ;Valeur de l'en-tête Date pour une requête HTTP. + + + Obtient la valeur de l'en-tête Expect pour une requête HTTP. + retourne  ;Valeur de l'en-tête Expect pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Expect pour une requête HTTP contient Continue. + retourne  ;true si l'en-tête Expect contient Continue ; sinon false. + + + Obtient ou définit la valeur de l'en-tête From pour une requête HTTP. + retourne  ;Valeur de l'en-tête From pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Host pour une requête HTTP. + retourne  ;Valeur de l'en-tête Host pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-Match pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Modified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Modified-Since pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + retourne  ;Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Max-Forwards pour une requête HTTP. + retourne  ;Valeur de l'en-tête Max-Forwards pour une requête HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une requête HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Referer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Referer pour une requête HTTP. + + + Obtient la valeur de l'en-tête TE pour une requête HTTP. + retourne  ;Valeur de l'en-tête TE pour une requête HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une requête HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une requête HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une requête HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une requête HTTP. + + + Obtient la valeur de l'en-tête User-Agent pour une requête HTTP. + retourne  ;Valeur de l'en-tête User-Agent pour une requête HTTP. + + + Obtient la valeur de l'en-tête Via pour une requête HTTP. + retourne  ;Valeur de l'en-tête Via pour une requête HTTP. + + + Obtient la valeur de l'en-tête Warning pour une requête HTTP. + retourne  ;Valeur de l'en-tête Warning pour une requête HTTP. + + + Représente la collection d'en-têtes de réponse comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Age pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Age pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Connection pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Connection pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une réponse HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Date pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête ETag pour une réponse HTTP. + retourne  ;Valeur de l'en-tête ETag pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Location pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Location pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Retry-After pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Retry-After pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Server pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Server pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une réponse HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Vary pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Vary pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Via pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Via pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Warning pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Warning pour une réponse HTTP. + + + Obtient la valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + + + Représente un type de média utilisé dans un en-tête Content-Type défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Source représentée sous forme de chaîne pour initialiser la nouvelle instance. + + + Obtient ou définit le jeu de caractères. + retourne  ;Jeu de caractères. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient ou définit la valeur de l'en-tête de type de média. + retourne  ;Valeur d'en-tête de type média. + + + Obtient ou définit les paramètres de la valeur d'en-tête de type de média. + retourne  ;Paramètres des valeurs d'en-tête de type média. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du type de média. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de type de média valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente un type de média avec une considération de qualité supplémentaire, utilisé dans un en-tête Content-Type. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + Qualité associée à cette valeur d'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente le type de média avec les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas un type de média valide avec des informations de valeur d'en-tête de qualité. + + + Obtenir ou définir le critère de qualité pour . + retourne  ;Critère de qualité pour l'objet . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une paire nom/valeur utilisée dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom de l'en-tête. + retourne  ;Nom de l'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la valeur de nom. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de valeur de nom valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de l'en-tête. + retourne  ;Valeur de l'en-tête. + + + Représente une paire nom/valeur avec des paramètres utilisés dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres de l'objet . + retourne  ;Collection contenant les paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne représentant la valeur de nom avec les informations de valeur d'en-tête de paramètre. + + est une référence null. + + n'est pas une valeur de nom valide avec des informations de valeur d'en-tête de paramètre. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur de jeton de produit dans un en-tête d'agent utilisateur. + + + Initialise une nouvelle instance de la classe . + Nom du produit. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom du jeton du produit. + retourne  ;Nom du jeton de produit. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du produit. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la version du jeton du produit. + retourne  ;Version du jeton de produit. + + + Représente une valeur qui peut être un produit ou un commentaire dans un en-tête User-Agent. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Valeur de commentaire. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Obtient le commentaire de l'objet . + retourne  ;Valeur de commentaire de ce . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête des informations. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'informations produit valides. + + + Obtient le produit de l'objet . + retourne  ;Valeur de produit de cet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête If-Range qui peut être une date, une heure ou une valeur de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Valeur de date utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Balise d'entité représentée sous forme de chaîne utilisée pour initialiser la nouvelle instance. + + + Obtient la date de l'objet . + retourne  ;Date de l'objet . + + + Obtient la balise d'entité de l'objet . + retourne  ;Balise d'entité de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de plage valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une plage d'octets. + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage valides. + + + Obtient les plages spécifiées à partir de l'objet . + retourne  ;Plages de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient l'unité de l'objet . + retourne  ;Unité de l'objet . + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une valeur d'en-tête Retry-After qui peut être une date, une heure ou une valeur TimeSpan. + + + Initialise une nouvelle instance de la classe . + Offset de la date et de l'heure utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Différentiel, en secondes, utilisé pour initialiser la nouvelle instance. + + + Obtient l'offset de la date et de l'heure de l'objet . + retourne  ;Offset de la date et de l'heure de l'objet . + + + Obtient le delta en secondes de l'objet . + retourne  ;Différentiel en secondes de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de nouvelle tentative. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de nouvelle tentative valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de chaîne avec une qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Considération de qualité utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas une chaîne valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de l'objet . + retourne  ;Considération de qualité de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de chaîne de l'objet . + retourne  ;Valeur de chaîne de l'objet . + + + Représente une valeur d'en-tête Accept-Encoding. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres d'encodage de transfert. + retourne  ;Paramètres d'encodage de transfert. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de l'encodage de transfert. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'encodage de transfert valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur d'encodage de transfert. + retourne  ;Valeur d'encodage de transfert. + + + Représente une valeur d'en-tête Accept-Encoding avec une considération de qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Valeur pour la considération de qualité. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur de l'encodage de transfert. + + est une référence null. + + n'est pas un encodage de transfert valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de . + retourne  ;Considération de qualité de . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur d'un en-tête Via. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Obtient le champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire + retourne  ;Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Retourne un code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête. + + est une référence null. + + n'est pas valide pour les informations de valeur d'en-tête. + + + Obtient le nom de protocole du protocole reçu. + retourne  ;Le nom du protocole. + + + Obtient la version de protocole du protocole reçu. + retourne  ;Version du protocole. + + + Obtient l'hôte et le port via lesquels la requête ou la réponse a été reçue. + retourne  ;Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'avertissement utilisée par l'en-tête Warning. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + Les informations de date et d'heure de l'avertissement. + + + Obtient l'hôte ayant attaché l'avertissement. + retourne  ;Hôte ayant attaché l'avertissement. + + + Obtient le code d'avertissement spécifique. + retourne  ;Code d'avertissement spécifique. + + + Obtient les informations de date et d'heure de l'avertissement. + retourne  ;Les informations de date et d'heure de l'avertissement. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + Retourne une instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient une chaîne entre guillemets contenant le texte d'avertissement. + retourne  ;Chaîne entre guillemets contenant le texte d'avertissement. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/it/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/it/a new file mode 100644 index 00000000000..3a2ca25d00f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/it/a @@ -0,0 +1,2310 @@ + + + + System.Net.Http + + + + Fornisce il contenuto HTTP basato su una matrice di byte. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Il parametro è null. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Offset, in byte, nel parametro utilizzato per inizializzare l'oggetto . + Numero di byte in a partire dal parametro utilizzato per inizializzare . + Il parametro è null. + Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro .- oppure -Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro , meno il parametro . + + + Crea un flusso di contenuto HTTP come operazione asincrona per la lettura il cui archivio di backup è la memoria di . + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare e scrivere la matrice di byte fornita nel costruttore in un flusso di contenuto HTTP come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto, quali il token di associazione del canale.Il parametro può essere null. + + + Determina se una matrice di byte ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte della matrice di byte. + + + Specifica come i certificati client vengono forniti. + + + L'oggetto tenterà di fornire tutti i certificati client disponibili automaticamente. + + + L'applicazione manualmente fornisce i certificati client a .Questo valore è quello predefinito. + + + Tipo per gestori HTTP che delegano l'elaborazione dei messaggi di risposta HTTP a un altro gestore, chiamato gestore interno. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il gestore interno che elabora i messaggi di risposta HTTP. + Restituisce .Il gestore interno per i messaggi di risposta HTTP. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Contenitore per le tuple nome/valore codificate utilizzando il tipo MIME application/x-www-form-urlencoded. + + + Inizializza una nuova istanza della classe con una raccolta di coppie nome/valore specifica. + Raccolta di coppie nome/valore. + + + Fornisce una classe base per l'invio di richieste HTTP e la ricezione di risposte HTTP da una risorsa identificata da un URI. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un gestore specifico. + Stack del gestore HTTP da usare per inviare le richieste. + + + Inizializza una nuova istanza della classe con un gestore specifico. + Oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(), false se si intende riutilizzare il gestore interno. + + + Ottiene o imposta l'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + Restituisce .L'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + + + Annullare tutte le richieste in sospeso in questa istanza. + + + Ottiene le intestazioni che devono essere inviate con ogni richiesta. + Restituisce .Intestazioni da inviare con ogni richiesta. + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Rilascia le risorse non gestite usate da e, facoltativamente, elimina le risorse gestite. + true per rilasciare sia le risorse gestite sia quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Ottiene o imposta il numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta. + Restituisce .Numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta.Il valore predefinito di questa proprietà è 2 gigabyte. + La dimensione specificata è minore o uguale a zero. + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Ottiene o imposta l'intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Restituisce .Intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Il timeout specificato è minore o uguale a zero e non rappresenta il campo . + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Il gestore messaggi predefinito utilizzato da . + + + Crea un'istanza di una classe . + + + Recupera o imposta un valore che indica se il gestore deve seguire le risposte di reindirizzamento. + Restituisca il valore .true se il gestore deve seguire le risposte di reindirizzamento; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta il tipo di metodo di decompressione utilizzato dal gestore per la decompressione automatica della risposta del contenuto HTTP. + Restituisca il valore .Il metodo automatico di decompressione utilizzato dal gestore.Il valore predefinito è . + + + Ottiene o imposta la raccolta dei certificati di sicurezza associati al gestore. + Restituisca il valore .Raccolta di certificati di sicurezza associati a questo gestore. + + + Ottiene o imposta il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + Restituisca il valore .Il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + + + Ottiene o imposta le informazioni di autenticazione utilizzate da questo gestore. + Restituisca il valore .Credenziali di autenticazione associate al gestore.Il valore predefinito è null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il numero massimo di reindirizzamenti che il gestore segue. + Restituisca il valore .Numero massimo di risposte di reindirizzamento seguite dal gestore.Il valore predefinito è 50. + + + Ottiene o imposta la dimensione massima del buffer di contenuto della richiesta utilizzato dal gestore. + Restituisca il valore .Dimensione massima in byte del buffer di contenuto della richiesta.Il valore predefinito è 2 gigabyte. + + + Ottiene o imposta un valore che indica se il gestore invia un'intestazione di autorizzazione con la richiesta. + Restituisca il valore .true per inviare un'intestazione Autorizzazione HTTP con le richieste una volta eseguita l'autenticazione; in caso contrario, false.Il valore predefinito è false. + + + Ottiene o imposta le informazioni sul proxy utilizzato dal gestore. + Restituisca il valore .Informazioni sul proxy utilizzato dal gestore.Il valore predefinito è null. + + + Crea un'istanza di in base alle informazioni fornite in come operazione che non si bloccherà. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Ottiene un valore che indica se il gestore supporta la decompressione automatica del contenuto di risposta. + Restituisca il valore .true se il gestore supporta la decompressione automatica del contenuto della risposta; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni proxy. + Restituisca il valore .true se il gestore supporta le impostazioni proxy; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni di configurazione per le proprietà e . + Restituisca il valore .true se il gestore supporta le impostazioni di configurazione per le proprietà e ; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che indica se il gestore utilizza la proprietà per memorizzare i cookie del server e utilizza questi cookie durante l'invio delle richieste. + Restituisca il valore .true se il gestore supporta la proprietà per archiviare i cookie del server e utilizza tali cookie quando invia richieste; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che controlla se le credenziali predefinite sono inviate con le richieste dal gestore. + Restituisca il valore .true se vengono utilizzate le credenziali predefinite; in caso contrario, false.Il valore predefinito è false. + + + Recupera o imposta un valore che indica se il gestore utilizza un proxy per le richieste. + Restituisca il valore .true se il gestore deve utilizzare un proxy per le richieste; in caso contrario, false.Il valore predefinito è true. + + + Indica se le operazioni di devono essere considerate completate non appena la risposta è disponibile o dopo la lettura dell'intero messaggio di risposta, incluso il contenuto. + + + L'operazione deve essere completata dopo la lettura della risposta intera che include il contenuto. + + + L'operazione deve essere completata non appena una risposta è disponibile e le intestazioni vengono lette.Il contenuto non è ancora pronto. + + + Classe base che rappresenta un corpo di entità e intestazioni di contenuto HTTP. + + + Inizializza una nuova istanza della classe . + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Serializzare il contenuto HTTP in un flusso di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + Restituisca il valore .Le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Dimensione massima in byte del buffer da utilizzare. + + + Serializza il contenuto HTTP in una matrice di byte come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP e restituire un flusso che rappresenta il contenuto come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in una stringa come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto HTTP ha una lunghezza valida in byte. + Restituisca il valore .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Tipo di base per gestori messaggi HTTP. + + + Inizializza una nuova istanza della classe . + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Una classe di specializzazione che consente alle applicazioni di chiamare il metodo di su una catena del gestore HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(),false se si desidera riutilizzare il gestore interno. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Classe di helper per recuperare e confrontare i metodi HTTP standard e per creare nuovi metodi HTTP. + + + Inizializza una nuova istanza della classe con un metodo HTTP specifico. + Metodo HTTP. + + + Rappresenta un metodo di protocollo HTTP DELETE. + Restituisca il valore . + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Metodo HTTP da confrontare con l'oggetto corrente. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Oggetto da confrontare con l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP GET. + Restituisca il valore . + + + Funge da funzione hash per questo tipo. + Restituisca il valore .Codice hash per la classe corrente. + + + Rappresenta un metodo di protocollo HTTP HEAD.Il metodo HEAD è identico al metodo GET ad eccezione del fatto che, nella risposta, il server restituisce solo intestazioni di messaggio senza un corpo del messaggio. + Restituisca il valore . + + + Metodo HTTP. + Restituisca il valore .Metodo HTTP rappresentato come . + + + Operatore di uguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono equivalenti; in caso contrario, false. + Oggetto a sinistra di un operatore di uguaglianza. + Oggetto a destra di un operatore di uguaglianza. + + + Operatore di disuguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono uguali; in caso contrario, false. + Oggetto a sinistra di un operatore di disuguaglianza. + Oggetto a destra di un operatore di disuguaglianza. + + + Rappresenta un metodo di protocollo HTTP OPTIONS. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP POST utilizzato per inviare una nuova entità come aggiunta a un URI. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP PUT utilizzato per sostituire un'entità identificata da un URI. + Restituisca il valore . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisca il valore .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP TRACE. + Restituisca il valore . + + + Classe base per eccezioni generate dalle classi e . + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente. + Messaggio che descrive l'eccezione corrente. + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente e l'eccezione interna. + Messaggio che descrive l'eccezione corrente. + Eccezione interna. + + + Rappresenta un messaggio di richiesta HTTP. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Stringa che rappresenta la richiesta . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Oggetto da richiedere. + + + Ottiene o imposta il contenuto del messaggio HTTP. + Restituisce .Contenuto di un messaggio + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene la raccolta delle intestazioni delle richieste HTTP. + Restituisce .Raccolta di intestazioni di richiesta HTTP. + + + Ottiene o imposta il metodo HTTP utilizzato dal messaggio di richiesta HTTP. + Restituisce .Metodo HTTP utilizzato dal messaggio di richiesta.Il valore predefinito è il metodo GET. + + + Ottiene un set di proprietà per la richiesta HTTP. + Restituisce . + + + Recupera o imposta utilizzato per la richiesta HTTP. + Restituisce . utilizzato per la richiesta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Rappresenta un messaggio di risposta HTTP che include il codice di stato e i dati. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un specifico. + Codice di stato della risposta HTTP. + + + Ottiene o imposta il messaggio di risposta HTTP. + Restituisce .Contenuto del messaggio di risposta HTTP. + + + Rilascia le risorse non gestite ed elimina le risorse non gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Genera un'eccezione se la proprietà della risposta HTTP è false. + Restituisce .Il messaggio di risposta HTTP se la chiamata ha esito positivo. + + + Ottiene la raccolta delle intestazioni di risposta HTTP. + Restituisce .Raccolta di intestazioni di risposta HTTP. + + + Ottiene un valore che indica se la risposta HTTP è stata completata. + Restituisce .Valore che indica se la risposta HTTP è stata completata.true se l'oggetto è stato compreso nell'intervallo tra 200 e 299; in caso contrario, false. + + + Ottiene o imposta la frase del motivo solitamente inviata dai server insieme al codice di stato. + Restituisce .Frase del motivo inviata dal server. + + + Ottiene o imposta il messaggio di richiesta che ha determinato questo messaggio di risposta. + Restituisce .Messaggio di richiesta che ha determinato questo messaggio di risposta. + + + Ottiene o imposta il codice di stato della risposta HTTP. + Restituisce .Codice di stato della risposta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Tipo di base per gestori che possono elaborare soltanto piccole richieste e/o messaggi di risposta. + + + Crea un'istanza di una classe . + + + Crea un'istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Esegue l'elaborazione su ogni richiesta inviata al server. + Restituisce .Messaggio di richiesta HTTP elaborato. + Messaggio di richiesta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Eseguire l'elaborazione su ogni risposta dal server. + Restituisce .Messaggio di risposta HTTP elaborato. + Messaggio di risposta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Fornisce una raccolta di oggetti che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + Il parametro era null o contiene solo spazi vuoti. + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + La stringa limite per il contenuto a più parti. + Il parametro era null o una stringa vuota. è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Restituisce un enumeratore che scorre la raccolta di oggetti che vengono serializzati utilizzando la specifica del tipo di contenuto multipart/*. + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Serializzare il contenuto HTTP multipart in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Implementazione esplicita del metodo . + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Determina se il contenuto multiparte HTTP ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Fornisce un contenitore per contenuto codificato utilizzando il tipo MIME multipart/form-data. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + La stringa limite per il contenuto dati del form a più parti. + + è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + + è null o contiene solo spazi vuoti. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + Nome file del contenuto HTTP da aggiungere alla raccolta. + + è null o contiene solo spazi vuoti.- oppure - è null o contiene solo spazi vuoti. + Il parametro era null. + + + Fornisce il contenuto HTTP basato su un flusso. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Dimensione del buffer, in byte, per . + Il parametro era null. + + è minore o uguale a zero. + + + Scrive il contenuto del flusso HTTP in un flusso di memoria come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto del flusso ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto del flusso. + + + Fornisce il contenuto HTTP basato su una stringa. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + Tipo di dati multimediali da utilizzare per il contenuto. + + + Rappresenta le informazioni di autenticazione nei valori di intestazione Authorization, ProxyAuthorization, WWW-Authenticate e Proxy-Authenticate. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + Le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + Restituisce .Credenziali contenenti le informazioni di autenticazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene lo schema da utilizzare per l'autorizzazione. + Restituisce .Schema da utilizzare per l'autorizzazione. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Cache-Control. + + + Inizializza una nuova istanza della classe . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Token di estensione cache, ognuno con un valore assegnato facoltativo. + Restituisce .Raccolta di token di estensione cache, ognuno con un valore assegnato facoltativo. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + La durata massima, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .true se il client HTTP è disposto ad accettare una risposta che ha superato la data di scadenza; in caso contrario, false. + + + Il tempo massimo, in secondi, quando un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .Tempo in secondi. + + + La durata di validità, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata; in caso contrario, false. + + + Se un client HTTP è disposto ad accettare una risposta memorizzata nella cache. + Restituisce .true se il client HTTP è disposto ad accettare una risposta memorizzata nella cache; in caso contrario, false. + + + Raccolta di fieldname nella direttiva “no-cache" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se una cache non deve memorizzare una parte del messaggio di richiesta HTTP o una risposta. + Restituisce .true se una cache non deve memorizzare alcuna parte del messaggio di richiesta HTTP o alcuna risposta; in caso contrario, false. + + + Se una cache o un proxy non deve modificare alcuna parte del corpo dell'entità. + Restituisce .true se una cache o un proxy non deve modificare alcun aspetto del corpo di entità; in caso contrario, false. + + + Se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway. + Restituisce .true se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway); in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione del controllo della cache. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione Cache Control valide. + + + Se tutto o parte del messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa. + Restituisce .true se il messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa; in caso contrario, false. + + + Fieldname della raccolta nella direttiva “privata" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata per le cache condivise dell'agente utente. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata per le cache condivise dell'agente utente; in caso contrario, false. + + + Se una risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa. + Restituisce .true se la risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa; in caso contrario, false. + + + Durata massima condivisa, specificata in secondi, in una risposta HTTP che sostituisce la direttiva di durata massima in un'intestazione Cache-Control o in un'intestazione Expires per una cache condivisa. + Restituisce .Tempo in secondi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Disposition. + + + Inizializza una nuova istanza della classe . + Oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un . + + + Data di creazione del file. + Restituisce .Data di creazione del file. + + + Il tipo di disposizione per una parte del corpo del contenuto. + Restituisce .Il tipo di disposizione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Suggerimento su come creare un nome file per archiviare il payload del messaggio da utilizzare se l'entità è stata rimossa e archiviata in un file separato. + Restituisce .Nome file consigliato. + + + Suggerimento su come creare nomi file per archiviare il payload del messaggio da utilizzare se le entità sono state rimosse e archiviate in file separati. + Restituisce .Nome file consigliato del form nomefile*. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Data dell'ultima modifica apportata al file. + Restituisce .Data di modifica del file. + + + Nome per una parte del corpo del contenuto. + Restituisce .Nome per la parte del corpo del contenuto. + + + Set di parametri che include l'intestazione Content-Disposition. + Restituisce .Insieme di parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione di disposizione dei contenuti. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di disposizione del contenuto valide. + + + Data dell'ultima lettura del file. + Restituisce .Data ultimo lettura. + + + Dimensione approssimativa del file espressa in byte. + Restituisce .Dimensione approssimativa espressa in byte. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Range. + + + Inizializza una nuova istanza della classe . + Il punto iniziale o finale dell'intervallo, in byte. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + Il punto iniziale o finale dell'intervallo, in byte. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione, in byte, in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se per l'intestazione Content-Range è stata specificata una lunghezza. + Restituisce .true se il Content-range è di lunghezza specificata; in caso contrario, false. + + + Ottiene un valore che indica se per Content-Range è stato specificato un intervallo. + Restituisce .true se il Content-range è di intervallo specificato; in caso contrario, false. + + + Ottiene la lunghezza del corpo dell'entità completo. + Restituisce .La lunghezza del corpo dell'entità completo. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione dell'intervallo di contenuti. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo di contenuti. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Le unità dell'intervallo utilizzate. + Restituisce . contenente le unità dell'intervallo. + + + Rappresenta un valore di intestazione del tag di entità. + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + Un valore che indica se questa intestazione del tag di entità è una convalida debole.Se l'intestazione del tag di entità è una convalida debole, allora deve essere impostato su true.Se l'intestazione del tag di entità è una convalida forte, allora deve essere impostato su false. + + + Ottiene il valore di intestazione del tag di entità. + Restituisce . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se il tag di identità è preceduto da un indicatore di debolezza. + Restituisce .true se il tag di identità è preceduto da un indicatore di debolezza; in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del tag di entità. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dei tag di entità. + + + Ottiene la stringa tra virgolette opaca. + Restituisce .Stringa tra virgolette opaca. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta la raccolta di intestazioni di contenuto secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione del contenuto Allow in una risposta HTTP. + Restituisce .Valore dell'intestazione Allow su una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Expires in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Expires in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Last-Modified per una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Last-Modified in una risposta HTTP. + + + Raccolta di intestazioni e i relativi valori definiti nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + + + Aggiunge l'intestazione specificata e i valori relativi nella raccolta . + L'intestazione da aggiungere all'insieme. + Elenco di valori dell'intestazione da aggiungere alla raccolta. + + + Aggiunge l'intestazione specificata e il valore relativo nella raccolta . + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Rimuove tutte le intestazioni dalla raccolta . + + + Restituisce un valore che indica se un'intestazione specifica è presente nella raccolta . + Restituisce .true e l'intestazione specificata è presente nella raccolta; in caso contrario, false. + Intestazione specifica. + + + Restituisce un enumeratore che consente di scorrere l'istanza di . + Restituisce .Enumeratore per l'oggetto . + + + Restituisce tutti i valori di intestazione per un'intestazione specificata archiviata nella raccolta . + Restituisce .Matrice di stringhe di intestazione. + Intestazione specificata per cui restituire i valori. + + + Rimuove l'intestazione specificata dalla raccolta . + Restituisce . + Il nome dell'intestazione da rimuovere dall'insieme. + + + Ottiene un enumeratore che itera in un . + Restituisce .Istanza di un'implementazione di un in grado di scorrere un oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Restituisce un valore che indica se l'intestazione specificata e i relativi valori sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Valori dell'intestazione. + + + Restituisce un valore che indica se l'intestazione specificata e il relativo valore sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Restituisce un valore che indica se i valori e un'intestazione specificati sono archiviati nella raccolta . + Restituisce .true se gli oggetti e values dell'intestazione specificata vengono archiviati nella raccolta; in caso contrario, false. + Intestazione specificata. + Valori intestazione specificati. + + + Rappresenta una raccolta di valori dell'intestazione. + Tipo di raccolta di intestazione. + + + Aggiunge una voce a . + Elemento da aggiungere alla raccolta dell'intestazione. + + + Rimuove tutte le voci da . + + + Determina se contiene un articolo. + Restituisce .true se la voce è inclusa nell'istanza , in caso contrario false. + Elemento da trovare nella raccolta dell'intestazione. + + + Copia l'intero oggetto in un oggetto compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione. + Oggetto unidimensionale che rappresenta la destinazione degli elementi copiati dall'oggetto .L'indicizzazione di deve essere in base zero. + Indice in base zero della matrice specificata nel parametro in corrispondenza del quale ha inizio la copia. + + + Ottiene il numero di intestazioni in . + Restituisce .Numero di intestazioni contenute in una raccolta. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Ottiene un valore che indica se l'istanza è di sola lettura. + Restituisce .true se l'istanza di è in sola lettura, in caso contrario false. + + + Analizza e aggiunge una voce all'oggetto . + Voce da aggiungere. + + + Consente di rimuovere l'elemento selezionato dall'oggetto . + Restituisce .true se è stato correttamente rimosso dall'istanza ; in caso contrario, false. + Elemento da rimuovere. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Restituisce una stringa che rappresenta l'oggetto corrente . + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se l'input può essere analizzato e aggiunto all'oggetto . + Restituisce .true se è stato possibile analizzare e aggiungere all'istanza di ; in caso contrario, false + Voce da convalidare. + + + Rappresenta la raccolta di intestazioni di richiesta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Charset per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Charset per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Encoding per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Language per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Language per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una richiesta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Connection per una richiesta HTTP. + Restituisce .Valore dell'intestazione Connection per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una richiesta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una richiesta HTTP. + Restituisce .Valore dell'intestazione Date per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Expect per una richiesta HTTP. + Restituisce .Valore dell'intestazione Expect per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Expect per una richiesta HTTP contiene Continue. + Restituisce .true se l'intestazione Expect contiene Continue; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione From per una richiesta HTTP. + Restituisce .Valore dell'intestazione From per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Host per una richiesta HTTP. + Restituisce .Valore dell'intestazione Host per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-Match per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Modified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Modified-Since per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + Restituisce .Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Max-Forwards per una richiesta HTTP. + Restituisce .Valore dell'intestazione Max-Forwards per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una richiesta HTTP. + Restituisce .Valore dell'intestazione Pragma per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Referer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Referer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione TE per una richiesta HTTP. + Restituisce .Valore dell'intestazione TE per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Trailer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una richiesta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una richiesta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una richiesta HTTP. + + + Ottiene il valore dell'intestazione User-Agent per una richiesta HTTP. + Restituisce .Valore dell'intestazione User-Agent per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Via per una richiesta HTTP. + Restituisce .Valore dell'intestazione Via per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Warning per una richiesta HTTP. + Restituisce .Valore dell'intestazione Warning per una richiesta HTTP. + + + Rappresenta la raccolta di intestazioni di risposta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept-Ranges per una risposta HTTP. + Restituisce .Valore dell'intestazione Accept-Ranges per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Age per una risposta HTTP. + Restituisce .Valore dell'intestazione Age per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una risposta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una risposta HTTP. + + + Ottiene il valore dell'intestazione Connection per una risposta HTTP. + Restituisce .Valore dell'intestazione Connection per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una risposta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una risposta HTTP. + Restituisce .Valore dell'intestazione Date per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione ETag per una risposta HTTP. + Restituisce .Valore dell'intestazione ETag per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Location per una risposta HTTP. + Restituisce .Valore dell'intestazione Location per una risposta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una risposta HTTP. + Restituisce .Valore dell'intestazione Pragma per una risposta HTTP. + + + Ottiene il valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Retry-After per una risposta HTTP. + Restituisce .Valore dell'intestazione Retry-After per una risposta HTTP. + + + Ottiene il valore dell'intestazione Server per una risposta HTTP. + Restituisce .Valore dell'intestazione Server per una risposta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una risposta HTTP. + Restituisce .Valore dell'intestazione Trailer per una risposta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una risposta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una risposta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una risposta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una risposta HTTP. + + + Ottiene il valore dell'intestazione Vary per una risposta HTTP. + Restituisce .Valore dell'intestazione Vary per una risposta HTTP. + + + Ottiene il valore dell'intestazione Via per una risposta HTTP. + Restituisce .Valore dell'intestazione Via per una risposta HTTP. + + + Ottiene il valore dell'intestazione Warning per una risposta HTTP. + Restituisce .Valore dell'intestazione Warning per una risposta HTTP. + + + Ottiene il valore dell'intestazione WWW-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione WWW-Authenticate per una risposta HTTP. + + + Rappresenta un tipo di supporto utilizzato in un'intestazione Content-Type come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Origine rappresentata come stringa per inizializzare la nuova istanza. + + + Ottiene o imposta il set di caratteri. + Restituisce .Set di caratteri. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene o imposta il valore dell'intestazione Media-Type. + Restituisce .Il valore di intestazione del tipo di supporto. + + + Ottiene o imposta i parametri di valore dell'intestazione del tipo di supporto. + Restituisce .I parametri del valore di intestazione del tipo di supporto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione del tipo di supporto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del tipo di supporti. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un tipo di supporto con un fattore di qualità aggiuntivo utilizzato in un'intestazione Content-Type. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + Qualità associata a questo valore di intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il tipo di supporto con le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è un tipo di supporto valido con le informazioni sul valore di intestazione di qualità. + + + Ottenere o impostare il valore di qualità per . + Restituisce .Valore di qualità per l'oggetto ) + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta una coppia nome/valore utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome dell'intestazione. + Restituisce .Nome dell'intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del valore del nome. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del valore del nome. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore dell'intestazione. + Restituisce .Valore dell'intestazione. + + + Rappresenta una coppia nome/valore con parametri utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri dall'oggetto . + Restituisce .Raccolta contenente i parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il valore del nome con le informazioni sul valore di intestazione del parametro. + + è un riferimento null. + + non è un valore di nome valido con le informazioni sul valore di intestazione di parametro. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di token di prodotto in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Nome del prodotto. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome del token del prodotto. + Restituisce .Nome del token del prodotto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del prodotto. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene la versione del token del prodotto. + Restituisce .Versione del token di prodotto. + + + Rappresenta un valore che può essere un prodotto o un commento in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Valore di commento. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Ottiene il commento dall'oggetto . + Restituisce .Valore di commento di . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle informazioni di prodotto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle informazioni di prodotto. + + + Ottiene il prodotto dall'oggetto . + Restituisce .Valore del prodotto da questo . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione If-Range che può essere un valore di tipo Date/Time o tag entità. + + + Inizializza una nuova istanza della classe . + Un valore di data utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Una tag di entità rappresentata come stringa utilizzata per inizializzare la nuova istanza. + + + Ottiene la data dall'oggetto . + Restituisce .Data dall'oggetto . + + + Ottiene il tag di identità dall'oggetto . + Restituisce .Tag di identità dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dell'intervallo. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione con intervallo. + + + Inizializza una nuova istanza della classe . + + + Consente l'inizializzazione di una nuova istanza della classe con un intervallo di date. + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione dell'intervallo. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo. + + + Ottiene gli intervalli specificati dall'oggetto . + Restituisce .Intervalli dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene l'unità dall'oggetto . + Restituisce .Unità dall'oggetto . + + + Rappresenta un valore di intestazione con intervallo di byte in un intervallo. + + + Inizializza una nuova istanza della classe . + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un valore di intestazione Retry-After che può essere un valore di tipo Date/Time o Timespan. + + + Inizializza una nuova istanza della classe . + L'offset di data e ora utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Delta, in secondi, utilizzato per inizializzare la nuova istanza. + + + Ottiene l'offset della data e ora dall'oggetto . + Restituisce .L'offset della data e ora dall'oggetto . + + + Ottiene il delta in secondi dall'oggetto . + Restituisce .Delta in secondi dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni dei nuovi tentativi. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dei nuovi tentativi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione di stringa con una qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Fattore di qualità utilizzato per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è una stringa valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di stringa dall'oggetto . + Restituisce .Valore di stringa da cui ottenere l'oggetto . + + + Rappresenta un valore di intestazione Accept-Encoding. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri di codifica di trasferimento. + Restituisce .I parametri di codifica di trasferimento. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione della codifica di trasferimento. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della codifica di trasferimento. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di codifica di trasferimento. + Restituisce .Il valore di codifica di trasferimento. + + + Rappresenta un valore di intestazione di intestazione Accept-Encoding con fattore di qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Un valore per il fattore di qualità. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore della codifica di trasferimento. + + è un riferimento null. + + non è una codifica di trasferimento valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore di un'intestazione Via. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Ottiene il campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + Restituisce .Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Viene restituito un codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta mediante informazioni sul valore intestazione. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della via. + + + Ottiene il nome del protocollo ricevuto. + Restituisce .Nome del protocollo. + + + Ottiene la versione del protocollo ricevuto. + Restituisce .Versione del protocollo. + + + Ottiene l'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Restituisce .L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di avviso utilizzato dall'intestazione di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + L'indicatore di data e ora dell'avviso. + + + Ottiene l'host che ha associato l'avviso. + Restituisce .L'host che ha associato l'avviso. + + + Ottiene il codice di avviso specifico. + Restituisce .Codice di avviso specifico. + + + Ottiene l'indicatore di data e ora dell'avviso. + Restituisce .L'indicatore di data e ora dell'avviso. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce un'istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene una stringa tra virgolette contenente il testo di avviso. + Restituisce .Una stringa tra virgolette contenente il testo di avviso. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/ja/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ja/a new file mode 100644 index 00000000000..10214bda61e --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ja/a @@ -0,0 +1,2852 @@ + + + + System.Net.Http + + + + バイト配列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + パラメーターが null です。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + の初期化に使用される パラメーターのオフセット (バイト単位)。 + + を初期化するために使用される パラメーターから始まる のバイト数。 + + パラメーターが null です。 + + パラメーターが 0 未満です。または パラメーターが パラメーターで指定されたコンテンツの長さを超えています。またはパラメーターが 0 未満です。または パラメーターが、 パラメーターで指定されたコンテンツの長さから パラメーターを引いた値を超えています。 + + + バッキング ストアが からのメモリである読み取り用 HTTP コンテンツ ストリームを非同期操作として作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として HTTP コンテンツ ストリームにコンストラクターで提供されるバイト配列をシリアル化して記述します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + バイト配列が有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + バイト配列の長さ (バイト単位)。 + + + クライアント証明書がどのように提供されるかを指定します。 + + + + は、使用できるすべてのクライアント証明書を自動的に提供しようと試みます。 + + + アプリケーションは に、クライアント証明書を手動で提供します。この値が既定値です。 + + + 内部ハンドラーと呼ばれる、別のハンドラーへ HTTP 応答メッセージの処理をデリゲートする HTTP ハンドラーの型。 + + + + クラスの新しいインスタンスを作成します。 + + + 特定の内部ハンドラーを使用して、 クラスの新しいインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答メッセージを処理する内部ハンドラーを取得または設定します。 + + を返します。HTTP 応答メッセージ用の内部ハンドラー。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + application/x-www-form-urlencoded MIME 型を使用してエンコードされた名前と値の組のコンテナー。 + + + 指定した名前と値のペアのコレクションを使用して、 クラスの新しいインスタンスを初期化します。 + 名前と値のペアのコレクション。 + + + URI で識別されるリソースに HTTP 要求を送信し、そのリソースから HTTP 応答を受信するための基本クラスを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + 要求の送信に使用する HTTP ハンドラー スタック。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() で破棄する場合は true。内部ハンドラーを再利用する場合は false。 + + + 要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレスを取得または設定します。 + + を返します。要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレス。 + + + このインスタンスの保留中の要求をすべてキャンセルします。 + + + 各要求と一緒に送信する必要があるヘッダーを取得します。 + + を返します。各要求と一緒に送信する必要があるヘッダー。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + + が使用しているアンマネージ リソースを解放します。オプションとして、マネージ リソースを破棄することもできます。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 応答の内容を読み取るときにバッファーに格納できる最大バイト数を取得または設定します。 + + を返します。応答コンテンツを読み取るときに、バッファーに格納できる最大バイト数。このプロパティの既定値は 2 GB です。 + 指定されたサイズがゼロ以下です。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 要求がタイムアウトするまで待機する期間を取得または設定します。 + + を返します。要求がタイムアウトするまで待機する期間。 + 指定したタイムアウトが 0 以下のため ではありません。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + + が使用する既定のメッセージ ハンドラー。 + + + + クラスのインスタンスを作成します。 + + + ハンドラーがリダイレクト応答に従うかどうかを示す値を取得または設定します。 + + を返します。ハンドラーがリダイレクト応答に従う場合は true。それ以外の場合は false。既定値は true です。 + + + HTTP コンテンツ応答の自動圧縮解除のハンドラーが使用する圧縮解除メソッドの種類を取得または設定します。 + + を返します。ハンドラーが使用する自動圧縮解除のメソッド。既定値は です。 + + + このハンドラーに関連付けられるセキュリティ証明書のコレクションを取得または設定します。 + + を返します。このハンドラーに関連付けられているセキュリティ証明書のコレクション。 + + + ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナーを取得または設定します。 + + を返します。ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナー。 + + + このハンドラーによって使用される認証情報を取得または設定します。 + + を返します。ハンドラーに関連付けられる認証資格情報。既定値は、null です。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + ハンドラーが従うリダイレクトの最大数を取得または設定します。 + + を返します。ハンドラーによって実行されるリダイレクト応答の最大数。既定値は 50 です。 + + + ハンドラーが使用する要求コンテンツ バッファーの最大サイズを取得または設定します。 + + を返します。要求コンテンツ バッファーの最大サイズ (バイト単位)。既定値は 2 GB です。 + + + ハンドラーが要求と共に認証ヘッダーを送信するかどうかを示す値を取得または設定します。 + + を返します。認証が行われた後で、要求と共に HTTP 認証ヘッダーを送信するハンドラーの場合は true。それ以外の場合は false。既定値は、false です。 + + + ハンドラーが使用するプロキシ情報を取得または設定します。 + + を返します。ハンドラーにより使用されるプロキシ情報。既定値は null です。 + + + + で提供される情報に基づいて、ブロックされない操作として のインスタンスを作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + ハンドラーが自動的な応答内容の圧縮解除をサポートするかどうかを示す値を取得します。 + + を返します。ハンドラーが自動応答の内容の圧縮解除をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーがプロキシ設定をサポートしているかどうかを示す値を取得します。 + + を返します。ハンドラーがプロキシ設定をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが および プロパティの構成設定をサポートするかどうかを示す値を取得します。 + + を返します。 プロパティと プロパティの構成設定をハンドラーがサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 既定の資格情報がハンドラーによって要求と共に送信されるかどうかを制御する値を取得または設定します。 + + を返します。既定の資格情報を使用する場合は true。それ以外の場合は false。既定値は false です。 + + + ハンドラーが要求のプロキシを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが要求に対してプロキシを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 応答が使用できるようになった場合に 操作が完了したと見なすか、内容を含む応答メッセージ全体を読み取った後に完了したと見なすかを示します。 + + + 操作は、コンテンツを含む全体の応答を読んだ後に完了する必要があります。 + + + 操作は、応答が使用できる状態になった後か、ヘッダーが読み取られた後すぐに完了する必要があります。コンテンツがまだ読み取られていません。 + + + HTTP のエンティティ本体とコンテンツ ヘッダーを表す基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + 非同期操作としてメモリ ストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + RFC 2616 で定義されている HTTP コンテンツ ヘッダーを取得します。 + + を返します。RFC 2616 で定義されているコンテンツ ヘッダー。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 使用するバッファーの最大サイズ (バイト単位)。 + + + 非同期操作としてバイト配列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + HTTP コンテンツをシリアル化して、非同期操作としてコンテンツを表すストリームを返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として文字列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + HTTP コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + HTTP メッセージ ハンドラーの基本型。 + + + + クラスの新しいインスタンスを初期化します。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + アプリケーションが HTTP ハンドラー チェーンに対して メソッドを呼び出せるようにする専用クラス。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() が破棄する場合は true、内部ハンドラーを再利用する場合は false。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + 標準的な HTTP メソッドの取得と比較を行い、新しい HTTP メソッドを作成するためのヘルパー クラス。 + + + 指定した HTTP メソッドを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + + + HTTP DELETE プロトコル メソッドを表します。 + + を返します。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較する HTTP メソッド。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + HTTP GET プロトコル メソッドを表します。 + + を返します。 + + + この型のハッシュ関数として機能します。 + + を返します。現在の のハッシュ コード。 + + + HTTP HEAD プロトコル メソッドを表します。HEAD メソッドは、サーバーが応答でメッセージ本文は返さずにメッセージ ヘッダーだけを返すこと以外、GET と同じです。 + + を返します。 + + + HTTP メソッド。 + + を返します。 として表される HTTP メソッド。 + + + 2 つの オブジェクトを比較するための等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しい場合は true。それ以外の場合は false。 + 等値演算子の左辺にある 。 + 等値演算子の右辺の 。 + + + 2 つの オブジェクトを比較するための非等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しくない場合は true。それ以外の場合は false。 + 非等値演算子の左辺にある 。 + 非等値演算子の右辺の 。 + + + HTTP OPTIONS プロトコル メソッドを表します。 + + を返します。 + + + URI への追加として新しいエントリをポストするために使用される HTTP POST プロトコル メソッドを表します。 + + を返します。 + + + URI で識別されるエントリを置き換えるために使用される HTTP PUT プロトコル メソッドを表します。 + + を返します。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + HTTP TRACE プロトコル メソッドを表します。 + + を返します。 + + + + クラスによってスローされる例外の基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + 現在の例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + + + 現在の例外と内部例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + 内部例外。 + + + HTTP 要求メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求 を表す文字列。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求する 。 + + + HTTP メッセージの内容を取得または設定します。 + + を返します。メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 要求ヘッダーのコレクションを取得します。 + + を返します。HTTP 要求ヘッダーのコレクション。 + + + HTTP 要求メッセージで使用される HTTP メソッドを取得または設定します。 + + を返します。要求メッセージによって使用される HTTP メソッド。既定では、GET メソッドです。 + + + HTTP 要求のプロパティのセットを取得します。 + + を返します。 + + + HTTP 要求で使用する を取得または設定します。 + + を返します。HTTP 要求に使用される + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + ステータス コードとデータを含む HTTP 応答メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + を指定して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答のステータス コード。 + + + HTTP 応答メッセージの内容を取得または設定します。 + + を返します。HTTP 応答メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、アンマネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答の のプロパティが false である場合、例外がスローされます。 + + を返します。呼び出しが成功した場合は HTTP 応答メッセージ。 + + + HTTP 応答ヘッダーのコレクションを取得します。 + + を返します。HTTP 応答ヘッダーのコレクション。 + + + HTTP 応答が成功したかどうかを示す値を取得します。 + + を返します。HTTP 応答が成功したかどうかを示す値。 が 200 ~ 299 の範囲内にあった場合は true。それ以外の場合は false。 + + + 通常はステータス コードと共にサーバーによって送信される理由句を取得または設定します。 + + を返します。サーバーから送信される理由語句。 + + + この応答メッセージの原因となった要求メッセージを取得または設定します。 + + を返します。この応答メッセージの原因となった要求メッセージ。 + + + HTTP 応答のステータス コードを取得または設定します。 + + を返します。HTTP 応答のステータス コード。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + 要求と応答メッセージの小規模な処理のみをするハンドラーの基本型。 + + + + クラスのインスタンスを作成します。 + + + 指定した内部ハンドラーを使用して、 クラスのインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + サーバーに送信された各要求の処理を実行します。 + + を返します。処理された HTTP 要求メッセージ。 + 処理する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + サーバーからの各応答の処理を実行します。 + + を返します。処理された HTTP 応答メッセージ。 + 処理する HTTP 応答メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + + が null であるか、空白文字だけで構成されています。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + マルチパート コンテンツの境界の文字列。 + + は null か空の文字列でした。 が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションにマルチパート HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + multipart/* のコンテンツ タイプ仕様を使用してシリアル化する オブジェクトのコレクション全体を反復処理する列挙子を返します。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + 非同期操作としてストリームにマルチパート HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + + メソッドの明示的な実装。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + HTTP マルチパート コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + マルチパート/フォーム データの MIME タイプを使用してエンコードされたコンテンツのコンテナーを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート フォーム データ コンテンツの境界の文字列。 + + が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + + が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + コレクションに追加する HTTP コンテンツのファイル名。 + + が null であるか、空白文字だけで構成されています。または が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + ストリームに基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + のバッファーのサイズ (バイト単位)。 + + が null でした。 + + の値が 0 以下です。 + + + 非同期操作としてメモリ ストリームに HTTP ストリーム コンテンツを書き込みます。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + ストリーム コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + ストリーム コンテンツの長さ (バイト単位)。 + + + 文字列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + コンテンツに使用するメディア タイプ。 + + + Authorization、ProxyAuthorization、WWW-Authenticate、および Proxy-Authenticate のヘッダー値の認証情報を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報を取得します。 + + を返します。認証情報を格納する資格情報。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 承認のために使用するメソッドを取得します。 + + を返します。承認のために使用するスキーム。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Cache-Control ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + それぞれが省略可能な代入値を持つキャッシュ拡張トークン。 + + を返します。それぞれが省略可能な代入値を持つキャッシュ拡張トークンのコレクション。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + HTTP クライアントが応答を受け入れる最大期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが有効期限を過ぎた応答を受け入れるかどうか。 + + を返します。HTTP クライアントが有効期限を過ぎた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP クライアントが、有効期限を過ぎた応答を受け入れる最長時間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが応答を受け入れる鮮度有効期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + キャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなった場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + HTTP クライアントがキャッシュされた応答を受け入れるかどうか。 + + を返します。HTTP クライアントがキャッシュされた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "no-cache" ディレクティブにあるフィールド名のコレクション。 + + を返します。フィールド名のコレクション。 + + + HTTP 要求メッセージまたは応答の一部をキャッシュに保存できないかどうか。 + + を返します。HTTP 要求メッセージおよびあらゆる応答のどの部分もキャッシュに保存できない場合は true。それ以外の場合は false。 + + + キャッシュまたはプロキシがエンティティ本体の側面を変更できないかどうか。 + + を返します。キャッシュまたはプロキシがエンティティ本体のどの側面も変更できない場合は true。それ以外の場合は false。 + + + キャッシュが HTTP 要求の他の制約に準拠しているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答するか。 + + を返します。キャッシュが、HTTP 要求の他の制約に従っているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答する場合は true。それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + キャッシュ コントロールのヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なキャッシュ コントロール ヘッダー値の情報です。 + + + HTTP 応答メッセージの全体または一部が 1 人のユーザーを対象にしており、共有キャッシュでキャッシュできないかどうか。 + + を返します。HTTP 応答メッセージが 1 名のユーザーを対象にしており、共有キャッシュでキャッシュできない場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "private" ディレクティブにあるコレクション フィールド名。 + + を返します。フィールド名のコレクション。 + + + 共有ユーザー エージェント キャッシュのキャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなり、共有ユーザー エージェント キャッシュに適切でない場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + 通常、キャッシュ不可である場合や、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答をすべてのキャッシュでキャッシュできるかどうか。 + + を返します。通常はキャッシュ不可であるか、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答を任意のキャッシュでキャッシュできる場合は true。それ以外の場合は false。 + + + 共有キャッシュのキャッシュ制御ヘッダーまたは expires ヘッダーに対する "最大年齢" ディレクティブをオーバーライドする HTTP 応答における、共有最大期間 (秒単位で指定)。 + + を返します。時間 (秒) です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Disposition ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + ファイルが作成された日付。 + + を返します。ファイルの作成日。 + + + コンテンツ本体の配置タイプ。 + + を返します。配置タイプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。推奨ファイル名。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。フォームの filename* の推奨ファイル名。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ファイルが最後に変更された日付。 + + を返します。ファイルの変更日。 + + + コンテンツ本体の名前。 + + を返します。コンテンツ本体の名前。 + + + パラメーター セットには、Content-Disposition ヘッダーが含まれていました。 + + を返します。パラメーターのコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ配置ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ配置ヘッダー値の情報です。 + + + ファイルの読み取りが行われた最後の日付。 + + を返します。最後に読み取った日付。 + + + ファイルのおおよそのサイズ (バイト単位)。 + + を返します。おおよそのサイズ (バイト単位)。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Range ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 範囲の開始点または終了点 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + 範囲の開始点または終了点 (バイト単位)。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置 (バイト単位)。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + Content-Range ヘッダーが指定された長さかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された長さである場合は true、それ以外の場合は false。 + + + Content-Range に指定された範囲があるかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された範囲である場合は true、それ以外の場合は false。 + + + 完全なエンティティ本体の長さを取得します。 + + を返します。フル エンティティ本体の長さ。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ範囲ヘッダー値の情報です。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 使用する範囲の単位。 + + を返します。範囲の単位を含む + + + エンティティ タグのヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + このエンティティ タグ ヘッダーが弱い検証コントロールかどうかを示す値。エンティティ タグ ヘッダーが弱い検証コントロールの場合は、 を true に設定します。エンティティ タグ ヘッダーが強い検証コントロールの場合は、 を false に設定します。 + + + エンティティ タグのヘッダー値を取得します。 + + を返します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + エンティティ タグの前に脆弱性インジケーターが付いているかどうかを取得します。 + + を返します。エンティティ タグの前に脆弱性インジケーターが付いている場合は true、それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + エンティティ タグ ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なエンティティ タグ ヘッダー値の情報です。 + + + opaque 引用符で囲まれた文字列を取得します。 + + を返します。不透明な引用符で囲まれた文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義されているコンテンツ ヘッダーのコレクションを表します。 + + + HTTP 応答の Allow コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Allow ヘッダーの値。 + + + HTTP 応答の Content-Disposition コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Disposition コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Encoding コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Encoding コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Language コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Language コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Length コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Length コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Location コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Location コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-MD5 コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-MD5 コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Range コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Range コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Type コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Type コンテンツ ヘッダーの値。 + + + HTTP 応答の Expires コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Expires コンテンツ ヘッダーの値。 + + + HTTP 応答の Last-Modified コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Last-Modified コンテンツ ヘッダーの値。 + + + RFC 2616 で定義されているヘッダーおよび値のコレクション。 + + + + クラスの新しいインスタンスを初期化します。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + コレクションに追加するヘッダー値のリスト。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + + コレクションからすべてのヘッダーを削除します。 + + + 特定のヘッダーが コレクションに存在するかどうかを返します。 + + を返します。指定したヘッダーがコレクション内に存在する場合は true、それ以外の場合は false。 + 特定のヘッダー。 + + + + インスタンスを反復処理できる列挙子を返します。 + + を返します。 の列挙子。 + + + + コレクションに格納されている指定したヘッダーのすべてのヘッダー値を返します。 + + を返します。ヘッダー文字列の配列。 + 値を返す指定されたヘッダー。 + + + 指定したヘッダーを コレクションから削除します。 + + を返します。 + コレクションから削除するヘッダーの名前。 + + + + を反復処理できる列挙子を取得します。 + + を返します。 を反復処理できる を実装するインスタンス。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの値。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + 指定されたヘッダーと指定された値が コレクションに格納されているかどうかを返します。 + + を返します。指定されたヘッダー および values がコレクションに格納されている場合は true。それ以外の場合は false。 + 指定されたヘッダー。 + 指定したヘッダー値。 + + + ヘッダー値のコレクションを表します。 + ヘッダー コレクションの型。 + + + + にエントリを追加します。 + ヘッダー コレクションに追加する項目。 + + + + からすべてのエントリを削除します。 + + + + に項目が格納されているかどうかを確認します。 + + を返します。エントリが インスタンスに含まれている場合は true。それ以外の場合は false。 + ヘッダー コレクションから検索する項目。 + + + + 全体を互換性のある 1 次元の にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 + + から要素をコピーする、1 次元の です。 には、0 から始まるインデックス番号が必要です。 + コピーの開始位置となる、 内の 0 から始まるインデックス。 + + + + 内のヘッダーの数を取得します。 + + を返します。コレクション内のヘッダーの数。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + + インスタンスが読み取り専用かどうかを示す値を取得します。 + + を返します。 インスタンスが読み取り専用の場合は true。それ以外の場合は false。 + + + + にエントリを解析して追加します。 + 追加するエントリ。 + + + 指定した項目を から削除します。 + + を返します。 インスタンスから削除された場合は true。それ以外の場合は false。 + 削除する項目。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 入力を解析して に追加できるかどうかを判断します。 + + を返します。 を解析して インスタンスに追加できる場合は true。それ以外の場合は false + 検証するエントリ。 + + + RFC 2616 で定義されている要求ヘッダーのコレクションを表します。 + + + HTTP 要求の Accept ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept ヘッダーの値。 + + + HTTP 要求の Accept-Charset ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Charset ヘッダーの値。 + + + HTTP 要求の Accept-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Encoding ヘッダーの値。 + + + HTTP 要求の Accept-Language ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Language ヘッダーの値。 + + + HTTP 要求の Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Authorization ヘッダーの値。 + + + HTTP 要求の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Cache-Control ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーの値を取得します。 + + を返します。HTTP 要求の Connection ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Date ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーの値を取得します。 + + を返します。HTTP 要求の Expect ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーに Continue が含まれるかどうかを示す値を取得または設定します。 + + を返します。Expect ヘッダーに Continue が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の From ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の From ヘッダーの値。 + + + HTTP 要求の Host ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Host ヘッダーの値。 + + + HTTP 要求の If-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-Match ヘッダーの値。 + + + HTTP 要求の If-Modified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Modified-Since ヘッダーの値。 + + + HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + + HTTP 要求の If-Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Range ヘッダーの値。 + + + HTTP 要求の If-Unmodified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Unmodified-Since ヘッダーの値。 + + + HTTP 要求の Max-Forwards ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Max-Forwards ヘッダーの値。 + + + HTTP 要求の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 要求の Pragma ヘッダーの値。 + + + HTTP 要求の Proxy-Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Proxy-Authorization ヘッダーの値。 + + + HTTP 要求の Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Range ヘッダーの値。 + + + HTTP 要求の Referer ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Referer ヘッダーの値。 + + + HTTP 要求の TE ヘッダーの値を取得します。 + + を返します。HTTP 要求の TE ヘッダーの値。 + + + HTTP 要求の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 要求の Trailer ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Transfer-Encoding ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 要求の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 要求の Upgrade ヘッダーの値。 + + + HTTP 要求の User-Agent ヘッダーの値を取得します。 + + を返します。HTTP 要求の User-Agent ヘッダーの値。 + + + HTTP 要求の Via ヘッダーの値を取得します。 + + を返します。HTTP 要求の Via ヘッダーの値。 + + + HTTP 要求の Warning ヘッダーの値を取得します。 + + を返します。HTTP 要求の Warning ヘッダーの値。 + + + RFC 2616 で定義されている応答ヘッダーのコレクションを表します。 + + + HTTP 応答の Accept-Ranges ヘッダーの値を取得します。 + + を返します。HTTP 応答の Accept-Ranges ヘッダーの値。 + + + HTTP 応答の Age ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Age ヘッダーの値。 + + + HTTP 応答の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Cache-Control ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーの値を取得します。 + + を返します。HTTP 応答の Connection ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 応答の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Date ヘッダーの値。 + + + HTTP 応答の ETag ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の ETag ヘッダーの値。 + + + HTTP 応答の Location ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Location ヘッダーの値。 + + + HTTP 応答の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 応答の Pragma ヘッダーの値。 + + + HTTP 応答の Proxy-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の Proxy-Authenticate ヘッダーの値。 + + + HTTP 応答の Retry-After ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Retry-After ヘッダーの値。 + + + HTTP 応答の Server ヘッダーの値を取得します。 + + を返します。HTTP 応答の Server ヘッダーの値。 + + + HTTP 応答の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 応答の Trailer ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 応答の Transfer-Encoding ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 応答の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 応答の Upgrade ヘッダーの値。 + + + HTTP 応答の Vary ヘッダーの値を取得します。 + + を返します。HTTP 応答の Vary ヘッダーの値。 + + + HTTP 応答の Via ヘッダーの値を取得します。 + + を返します。HTTP 応答の Via ヘッダーの値。 + + + HTTP 応答の Warning ヘッダーの値を取得します。 + + を返します。HTTP 応答の Warning ヘッダーの値。 + + + HTTP 応答の WWW-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の WWW-Authenticate ヘッダーの値。 + + + RFC 2616 に定義され、コンテンツ タイプのヘッダーに使用されるメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化する文字列を表すソースです。 + + + 文字セットを取得または設定します。 + + を返します。文字セット。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + メディア種類のヘッダー値を取得または設定します。 + + を返します。メディア タイプ ヘッダー値。 + + + メディア種類のヘッダー値のパラメーターを取得または設定します。 + + を返します。メディア タイプ ヘッダー値パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + メディア種類のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なメディア タイプ ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + コンテンツ タイプ ヘッダーで使用される追加の品質ファクターとメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + このヘッダー値に関連付けられた品質です。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を含むメディア種類を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効なメディア タイプではありません。 + + + + の品質評価の値を取得または設定します。 + + を返します。 オブジェクトの品質評価の値。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用される名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ヘッダー名を取得します。 + + を返します。ヘッダーの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 名前の値のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な名前の値のヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ヘッダー値を取得します。 + + を返します。ヘッダー値。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用されるパラメーター付きの名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + + オブジェクトからパラメーターを取得します。 + + を返します。パラメーターを含むコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + パラメーター ヘッダー値の情報を含む、名前の値を表す文字列。 + + が null 参照です。 + + はパラメーター ヘッダー値の情報を含む有効な名前の値ではありません。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ユーザー エージェント ヘッダー内の製品トークン値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 製品トークンの名前を取得します。 + + を返します。製品トークンの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 製品のヘッダー値の情報を表す文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 製品トークンのバージョンを取得します。 + + を返します。製品トークンのバージョン。 + + + User-Agent ヘッダー内の製品またはコメントのいずれかになる値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + コメント値。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + + オブジェクトからコメントを取得します。 + + を返します。この のコメントの値です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 情報のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な製品情報ヘッダー値の情報です。 + + + + オブジェクトから製品を取得します。 + + を返します。この からの製品の値です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 日付/時刻またはエンティティ タグ値のいずれかとなる If-Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される日付の値。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される文字列として表現されたエンティティ タグ。 + + + + オブジェクトから日付を取得します。 + + を返します。 オブジェクトからのデータです。 + + + + オブジェクトからエンティティ タグを取得します。 + + を返します。 オブジェクトのエンティティ タグです。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + バイト範囲を使用して、 クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な範囲ヘッダー値の情報です。 + + + + オブジェクトから指定した範囲を取得します。 + + を返します。 オブジェクトからの範囲です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから単位を取得します。 + + を返します。 オブジェクトからの単位です。 + + + バイト範囲の Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 日付/時刻または期間値のいずれかとなる Retry-After ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する日付と時刻のオフセット。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される、秒単位の差分です。 + + + + オブジェクトから日付と時刻のオフセットを取得します。 + + を返します。 オブジェクトからの日付と時刻のオフセット。 + + + + オブジェクトから秒単位の差分を取得します。 + + を返します。 オブジェクトの秒単位の差分です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 再試行条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な再試行条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + オプションの品質と文字列ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 新しいインスタンスを初期化するために使用される品質要素。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な文字列ではありません。 + + + + オブジェクトから品質係数を取得します。 + + を返します。 オブジェクトからの品質係数です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから文字列値を取得します。 + + を返します。 オブジェクトから取得された文字列値。 + + + Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 転送コーディング パラメーターを取得します。 + + を返します。転送コーディング パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な転送コーディング ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 転送コーディング値を取得します。 + + を返します。転送コーディング値。 + + + オプションの品質要素と Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 品質係数の値。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な転送コーディングではありません。 + + + + から品質係数を取得します。 + + を返します。 からの品質係数です。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Via ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールドを取得します。 + + を返します。受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コードを返します。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + Via ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な Via ヘッダー値の情報です。 + + + 受信したプロトコルのプロトコル名を取得します。 + + を返します。プロトコル名。 + + + 受信したプロトコルのプロトコル バージョンを取得します。 + + を返します。プロトコル バージョン。 + + + 要求または応答が受信されたホストとポートを取得します。 + + を返します。要求または応答が受信されたホストとポート。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 警告ヘッダーで使用される警告値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + 警告の日付およびタイムスタンプ。 + + + 警告をアタッチしたホストを取得します。 + + を返します。警告をアタッチしたホスト。 + + + 特定の警告コードを取得します。 + + を返します。特定の警告コード。 + + + 警告の日付/タイム スタンプを取得します。 + + を返します。警告の日付およびタイムスタンプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + のインスタンスを返します。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 警告テキストを含む引用文字列を取得します。 + + を返します。警告テキストを含む引用文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/ko/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ko/a new file mode 100644 index 00000000000..3034f4eded7 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ko/a @@ -0,0 +1,2846 @@ + + + + System.Net.Http + + + + 바이트 배열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 매개 변수가 null입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 를 초기화하는 데 사용되는 매개 변수의 오프셋(바이트)입니다. + + 를 초기화하기 위해 사용되는 매개 변수에서 시작하는 의 바이트 수입니다. + + 매개 변수가 null입니다. + + 매개 변수가 0 미만인 경우또는 매개 변수의 값이 매개 변수가 지정한 콘텐츠 길이보다 큽니다.또는 매개 변수가 0보다 작은 경우또는 매개 변수가 매개 변수에서 지정한 콘텐츠 길이에서 매개 변수를 뺀 값보다 큽니다. + + + 백업 저장소가 의 메모리인 HTTP 콘텐츠 스트림을 읽기 위한 비동기 작업으로 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 생성자가 제공한 바이트 배열을 HTTP 콘텐츠 스트림에 비동기 작업으로 serialize하고 씁니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 채널 바인딩 토큰과 같은 전송에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 바이트 배열의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 바이트 배열의 길이(바이트)입니다. + + + 클라이언트 인증서 제공 방식을 지정합니다. + + + 사용 가능한 모든 클라이언트 인증서를 자동으로 제공하려는 입니다. + + + 응용 프로그램은 클라이언트 인증서를 에 수동으로 제공합니다.이 값이 기본값입니다. + + + HTTP 응답 메시지의 처리를 내부 처리기라는 다른 처리기로 위임하는 HTTP 처리기의 형식입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 새 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 필요에 따라 관리되는 리소스를 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답 메시지를 처리하는 내부 처리기를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지에 대한 내부 처리기입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + application/x-www-form-urlencoded MIME 형식을 사용하여 인코딩된 이름/값 튜플의 컨테이너입니다. + + + 이름/값 쌍의 특정 컬렉션을 사용하여 클래스의 새 인스턴스를 초기화합니다. + 이름/값 쌍으로 된 컬렉션입니다. + + + URI로 식별되는 리소스에서 HTTP 요청을 보내고 HTTP 응답을 받기 위한 기본 클래스를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 요청을 보내는 데 사용할 HTTP 처리기 스택입니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소를 가져오거나 설정합니다. + + 를 반환합니다.요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소입니다. + + + 이 인스턴스에서 보류 중인 모든 요청을 취소합니다. + + + 각 요청과 함께 보내야 하는 헤더를 가져옵니다. + + 를 반환합니다.각 요청과 함께 보내야 하는 헤더입니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 삭제할 수 있습니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true, 관리되지 않는 리소스만 해제하려면 false입니다. + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + 응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수를 가져오거나 설정합니다. + + 를 반환합니다.응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수입니다.이 속성의 기본값은 2GB입니다. + 지정한 크기가 0보다 작거나 같습니다. + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 요청 시간 제한 범위 내에서 대기할 기간을 가져오거나 설정합니다. + + 를 반환합니다.요청 시간 제한 범위 내에서 대기할 기간입니다. + 지정된 제한 시간이 0보다 작거나 같고 가 아닌 경우 + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + + 에 사용되는 기본 메시지 처리기입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 처리기가 리디렉션 응답을 따르는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기가 리디렉션 응답을 따라야 하는 경우 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + HTTP 콘텐츠 응답의 자동 압축 해체를 위한 처리기에서 사용되는 압축 해제 메서드의 형식을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 사용되는 자동 압축 풀기 방법입니다.기본값은 입니다. + + + 이 처리기와 관련된 보안 인증서의 컬렉션을 가져오거나 설정합니다. + + 를 반환합니다.이 처리기에 연결된 보안 인증서의 컬렉션입니다. + + + 처리기에서 서버 쿠키를 저장하는 데 사용하는 쿠키 컨테이너를 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 서버 쿠키를 저장하는 데 사용되는 쿠키 컨테이너입니다. + + + 이 처리기가 사용하는 인증 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기와 연결된 인증 자격 증명입니다.기본값은 null입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + 처리기가 따르는 최대 리디렉션 수를 가져오거나 설정합니다. + + 를 반환합니다.처리기가 따르는 최대 리디렉션 응답 수입니다.기본값은 50입니다. + + + 처리기에 사용되는 최대 요청 콘텐츠 버퍼 크기를 가져오거나 설정합니다. + + 를 반환합니다.최대 요청 콘텐츠 버퍼 크기(바이트)입니다.기본값은 2GB입니다. + + + 요청과 함께 처리기가 인증 헤더를 보낼 것인지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.인증을 수행한 이후 처리기가 요청과 함께 HTTP 권한 부여 헤더를 함께 보내는 경우 true 이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 사용하는 프록시 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기에 사용되는 프록시 정보입니다.기본값은 null입니다. + + + 차단되지 않을 작업으로 에서 제공된 정보를 기반으로 의 인스턴스를 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 처리기가 자동 응답 콘텐츠 압축 해제를 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기가 자동 응답 콘텐츠 압축 풀기를 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 프록시 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 프록시 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성에 대한 구성 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 속성에 대한 구성 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다. 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는 것을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 기본 자격 증명을 처리기의 요청과 함께 보내는지 여부를 제어하는 값을 가져오거나 설정합니다. + + 를 반환합니다.기본 자격 증명이 사용되면 true이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 요청에 대해 프록시를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 요청에 대해 프록시를 사용해야 하는 경우 true이고, otherwise false.기본값은 true입니다. + + + + 작업이 응답이 가능하면 즉시 완료된 것으로 간주되어야 하는지, 아니면 콘텐츠가 담긴 전체 응답 메시지를 읽은 후 완료된 것으로 간주되어야 하는지 여부를 나타냅니다. + + + 콘텐츠를 포함하여 전체 응답을 읽은 후 작업을 완료 해야 합니다. + + + 응답이 가능하고 헤더를 읽는 즉시 작업을 완료해야 합니다.콘텐츠를 아직 읽지 않았습니다. + + + HTTP 엔터티 본문과 콘텐츠 헤더를 나타내는 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠를 메모리 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + RFC 2616에 정의된 HTTP 콘텐츠 헤더를 가져옵니다. + + 를 반환합니다.RFC 2616에 정의된 콘텐츠 헤더입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 사용할 버퍼의 최대 크기(바이트)입니다. + + + HTTP 콘텐츠를 바이트 배열에 비동기 작업으로 Serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 serialize하고 콘텐츠를 비동기 작업으로 나타내는 스트림을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 문자열에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HTTP 콘텐츠의 길이(바이트)입니다. + + + HTTP 메시지 처리기의 기본 형식입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 응용 프로그램이 Http 처리기 체인에서 메서드를 호출할 수 있는 특수 클래스입니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 표준 HTTP 메서드를 검색 및 비교하고 새 HTTP 메서드를 만들기 위한 도우미 클래스입니다. + + + 특정 HTTP 메서드를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + + + HTTP DELETE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 HTTP 메서드입니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + HTTP GET 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 이 형식에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 의 해시 코드입니다. + + + HTTP HEAD 프로토콜 메서드를 나타냅니다.HEAD 메서드는 서버에서 응답의 메시지 본문 없이 메시지 헤더만 반환한다는 점을 제외하고는 GET 메서드와 동일합니다. + + 를 반환합니다. + + + HTTP 메서드입니다. + + 를 반환합니다.으로 표시되는 HTTP 메서드입니다. + + + 개체를 비교하는 같음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같으면 true이고, 그렇지 않으면 false입니다. + 같음 연산자의 왼쪽에 있는 입니다. + 같음 연산자의 오른쪽에 있는 입니다. + + + 개체를 비교하는 같지 않음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같지 않으면 true이고, 그렇지 않으면 false입니다. + 같지 않음 연산자의 왼쪽에 있는 입니다. + 같지 않음 연산자의 오른쪽에 있는 입니다. + + + HTTP OPTIONS 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 새 엔터티를 URI에 추가할 항목으로 게시하는 데 사용되는 HTTP POST 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + URI로 식별된 엔터티를 바꾸는 데 사용되는 HTTP PUT 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + HTTP TRACE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + + 클래스가 throw하는 예외의 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 현재 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + + + 현재 예외 및 내부 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + 내부 예외입니다. + + + HTTP 요청 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청 를 나타내는 문자열입니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청할 입니다. + + + HTTP 메시지의 내용을 가져오거나 설정합니다. + + 를 반환합니다.메시지 내용 + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 요청 헤더의 컬렉션입니다. + + + HTTP 요청 메서드에서 사용하는 HTTP 메서드를 가져오거나 설정합니다. + + 를 반환합니다.요청 메시지에서 사용하는 HTTP 메서드입니다.기본값은 GET 메서드입니다. + + + HTTP 요청의 속성 집합을 가져옵니다. + + 를 반환합니다. + + + HTTP 요청에 대한 를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청에 사용되는 입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 상태 코드와 데이터가 포함된 HTTP 응답 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 응답의 상태 코드입니다. + + + HTTP 응답 메시지의 텍스트 콘텐츠를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지의 내용입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되지 않는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답의 속성이 false이면 예외를 throw합니다. + + 를 반환합니다.호출이 성공할 경우 HTTP 응답 메시지입니다. + + + HTTP 응답 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 응답 헤더의 컬렉션입니다. + + + HTTP 응답이 성공했는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.HTTP 응답이 성공했는지 여부를 나타내는 값입니다.가 200-299 범위에 있으면 true이고, 그렇지 않으면 false입니다. + + + 일반적으로 서버에서 상태 코드와 함께 보내는 원인 문구를 가져오거나 설정합니다. + + 를 반환합니다.서버에서 보낸 원인 문구입니다. + + + 이 응답 메시지를 유도하는 요청 메시지를 가져오거나 설정합니다. + + 를 반환합니다.이 응답 메시지를 유도하는 요청 메시지입니다. + + + HTTP 응답의 상태 코드를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 상태 코드입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 요청 및/또는 응답 메시지의 적은 처리만 수행하는 처리기의 기본 형식입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + 서버에 보낸 각 요청에서 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 요청 메시지입니다. + 처리할 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 서버에서 각 응답에 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 응답 메시지입니다. + 처리할 HTTP 응답 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션을 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + + 이 null이거나 공백 문자만 있는 경우 + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + 여러 부분으로 구성된 콘텐츠에 대한 경계 문자열입니다. + + 이 null이거나 빈 문자열인 경우가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션에 multipart HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + multipart/* 콘텐츠 형식 사양을 통해 serialize된 개체의 컬렉션 사이를 이동하는 열거자를 반환합니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + multipart HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + + 메서드의 명시적 구현입니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + HTTP multipart 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HHTP 콘텐츠의 길이(바이트)입니다. + + + multipart/form-data MIME 형식을 사용하여 인코딩된 콘텐츠에 대한 컨테이너를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 데이터 콘텐츠에서 여러 부분으로 구성된 경계 문자열입니다. + + 가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + + 이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + 컬렉션에 추가할 HTTP 콘텐츠의 파일 이름입니다. + + 이 null이거나 공백 문자만 있는 경우또는이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + 스트림에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 에 대한 버퍼의 크기(바이트)입니다. + + 이 null인 경우 + + 가 0보다 작거나 같은 경우 + + + HTTP 스트림을 메모리 스트림에 비동기 작업으로 씁니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 스트림 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 스트림 콘텐츠의 길이(바이트)입니다. + + + 문자열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + 콘텐츠에 사용할 미디어 형식입니다. + + + 권한 부여, ProxyAuthorization, WWW-Authneticate 및 Proxy-Authenticate 헤더 값의 인증 정보를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명을 가져옵니다. + + 를 반환합니다.인증 정보가 들어 있는 자격 증명입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 권한 부여에 사용할 스키마를 가져옵니다. + + 를 반환합니다.권한 부여에 사용할 스키마입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Cache-Control 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 할당된 선택적 값이 각각 있는 캐시 확장 토큰입니다. + + 를 반환합니다.할당된 선택적 값이 각각 있는 캐시 확장 토큰의 컬렉션입니다. + + + + 개체에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + HTTP 클라이언트가 응답을 허용하는 최대 보관 기간(초로 지정)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 만료 시간을 초과한 응답을 수락하기까지의 최대 시간(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트가 응답을 허용하는 새로 고침 수명(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + 원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는 경우 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 캐시된 응답을 수용할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트가 캐시된 응답을 허용하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "no-cache" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는지 여부입니다. + + 를 반환합니다.캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 캐시 또는 프록시가 엔터티 본문을 변경해서는 안 되는지 여부입니다. + + 를 반환합니다.캐시나 프록시가 전체 본문의 어떤 부분도 변경하지 않아야 하는 경우 true이고, 그렇지 않으면 false입니다. + + + 캐시가 다른 HTTP 요청의 제약 조건과 일치하는 캐시 엔트리를 사용하여 반응하는지, 또는 504(게이트웨이 제한 시간) 상태로 반응하는지 여부 + + 를 반환합니다.캐시에서 HTTP 요청의 다른 제약 조건과 일관된 캐시된 엔트리를 사용하여 응답하거나 504(게이트웨이 시간 초과) 상태로 응답해야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 캐시 제어 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 캐시 제어 헤더 값 정보가 아닙니다. + + + HTTP 응답 메시지의 전체 또는 일부가 단일 사용자만 사용하기 위한 것이며 공유 캐시에서 캐시되지 않아야 하는지 여부 + + 를 반환합니다.HTTP 응답 메시지가 단일 사용자용이므로 공유 캐시에 캐시되지 않아야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "private" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하면 true이고, 그렇지 않으면 false입니다. + + + 대게 HTTP 응답이 공유되지 않는 캐시 내에서만 캐시할 수 있는지 여부도 포함하여 모든 캐시에서 캐시될 수 있는지 여부 + + 를 반환합니다.일반적으로 캐시할 수 없거나 비공유 캐시 내에서만 캐시할 수 있더라도, HTTP 응답을 캐시에서 캐시할 수 있으면 true이고, 그렇지 않으면 false입니다. + + + 초 단위로 지정된 공유된 최대 보관 기간으로, 공유 캐시의 경우 캐시 컨트롤 헤더나 Expires 헤더에서 "max-age" 지시문을 재정의하는 HTTP 응답에 사용됩니다. + + 를 반환합니다.초 단위 시간입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Disposition 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + 파일을 만든 날짜입니다. + + 를 반환합니다.파일 작성 날짜입니다. + + + 콘텐츠 본문 부분에 대한 처리 형식입니다. + + 를 반환합니다.처리 형식입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.제안된 파일 이름입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.폼 파일 이름*의 제안된 파일 이름입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 마지막으로 파일을 수정한 날짜입니다. + + 를 반환합니다.파일 수정 날짜입니다. + + + 콘텐츠 본문 부분에 대한 이름입니다. + + 를 반환합니다.콘텐츠 본문 부분에 대한 이름입니다. + + + Content-Disposition 헤더를 포함하는 매개 변수의 집합입니다. + + 를 반환합니다.매개 변수 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 처리 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 처리 헤더 값 정보가 아닙니다. + + + 파일에 마지막으로 읽은 날짜입니다. + + 를 반환합니다.마지막으로 읽은 날짜입니다. + + + 파일의 대략적인 크기(바이트)입니다. + + 를 반환합니다.대략적인 크기(바이트)입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치(바이트 단위)입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 콘텐츠 범위 헤더에 길이가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 길이가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 콘텐츠 범위에 범위가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 범위가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 전체 엔티티 본문의 길이를 가져옵니다. + + 를 반환합니다.전체 엔티티 본문의 길이입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 범위 헤더 값 정보가 아닙니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 사용된 범위의 단위입니다. + + 를 반환합니다.단위 범위를 포함하는 + + + 엔터티 태그 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + 이 엔터티 태그 헤더가 약한 유효성 검사기인지 여부를 나타내는 값입니다.엔터티 태그 헤더가 약한 유효성 검사기이면 를 true로 설정해야 합니다.엔터티 태그 헤더가 강한 유효성 검사기이면 를 false로 설정해야 합니다. + + + 엔터티 태그 헤더 값을 가져옵니다. + + 를 반환합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 엔터티 태그가 약점 표시로 시작하는지 여부를 가져옵니다. + + 를 반환합니다.취약성 표시기에 의해 엔터티 태그가 앞에 오면 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 엔터티 태그 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 엔터티 태그 헤더 값 정보가 아닙니다. + + + 불투명한 따옴표가 붙은 문자열을 가져옵니다. + + 를 반환합니다.불투명한 따옴표가 붙은 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 콘텐츠 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Allow 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Allow 헤더 값입니다. + + + HTTP 응답의 Content-Disposition 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Disposition 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Encoding 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Encoding 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Language 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Language 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Length 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Length 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Location 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Location 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-MD5 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-MD5 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Range 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Range 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Type 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Type 콘텐츠 헤더입니다. + + + HTTP 응답의 Expires 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Expires 콘텐츠 헤더입니다. + + + HTTP 응답의 Last-Modified 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Last-Modified 콘텐츠 헤더입니다. + + + RFC 2616에 정의된 헤더와 값의 컬렉션입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 컬렉션에 추가할 헤드 값의 목록입니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + + 컬렉션에서 헤더를 모두 제거합니다. + + + 특정 헤더가 컬렉션에 있는 경우 반환합니다. + + 를 반환합니다.지정된 헤더가 컬렉션에 있으면 true이고, 그렇지 않으면 false입니다. + 특정 헤더입니다. + + + + 인스턴스에서 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.에 대한 열거자입니다. + + + + 컬렉션에 저장된 지정된 헤더에 대한 모든 헤더 값을 반환합니다. + + 를 반환합니다.헤더 문자열의 배열입니다. + 값을 반환할 지정된 헤더입니다. + + + + 컬렉션에서 지정된 헤더를 제거합니다. + + 를 반환합니다. + 컬렉션에서 제거할 헤더의 이름입니다. + + + + 을 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.을 반복할 수 있는 인터페이스 구현의 인스턴스입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 지정된 헤더 및 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 값입니다. + + + 지정된 헤더 및 해당 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + 지정된 헤더와 지정된 값이 컬렉션에 저장되는 경우 반환합니다. + + 를 반환합니다.true는 지정된 헤더 이고 values는 컬렉션에 저장됩니다. 그렇지 않으면 false입니다. + 지정된 헤더입니다. + 지정된 헤더 값입니다. + + + 헤더 값의 컬렉션을 나타냅니다. + 헤더 컬렉션 형식입니다. + + + + 에 엔트리를 추가합니다. + 헤더 컬렉션에 추가할 항목입니다. + + + + 에서 모든 엔트리를 제거합니다. + + + + 에 항목이 포함되어 있는지 여부를 확인합니다. + + 를 반환합니다.엔트리가 인스턴스에 포함되어 있으면 true이고, 그렇지 않으면 false입니다. + 헤더 컬렉션을 찾을 항목입니다. + + + 대상 배열의 지정된 인덱스에서 시작하여 전체 을 호환되는 1차원 에 복사합니다. + + 에서 복사한 요소의 대상인 일차원 입니다.에는 0부터 시작하는 인덱스가 있어야 합니다. + + 에서 복사가 시작되는 인덱스(0부터 시작)입니다. + + + + 의 헤더 수를 가져옵니다. + + 를 반환합니다.컬렉션의 헤더 수입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + + 인스턴스가 읽기 전용인지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다. 인스턴스가 읽기 전용이면 true이고, 그렇지 않으면 false입니다. + + + 엔트리를 구문 분석하고 에 추가합니다. + 추가할 엔트리입니다. + + + 지정된 항목을 에서 제거합니다. + + 를 반환합니다. 인스턴스에서 제거되면 true이고, 그렇지 않으면 false입니다. + 제거할 항목입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 입력을 구문 분석하고 에 추가할 수 있는지 여부를 결정합니다. + + 를 반환합니다.을 구문 분석하고 인스턴스에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 유효성을 검사할 엔트리입니다. + + + RFC 2616에 정의된 요청 헤더의 컬렉션을 나타냅니다. + + + HTTP 요청의 Accept 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept 헤더 값입니다. + + + HTTP 요청의 Accept-Charset 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Charset 헤더 값입니다. + + + HTTP 요청의 Accept-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Encoding 헤더 값입니다. + + + HTTP 요청의 Accept-Language 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Language 헤더 값입니다. + + + HTTP 요청의 Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Authorization 헤더 값입니다. + + + HTTP 요청의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Cache-Control 헤더 값입니다. + + + HTTP 요청의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Connection 헤더 값입니다. + + + HTTP 요청에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 요청의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Date 헤더 값입니다. + + + HTTP 요청의 Expect 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Expect 헤더 값입니다. + + + HTTP 요청에 대한 Expect 헤더에 Continue가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Expect 헤더에 계속이 들어 있으면 true이고, otherwise false. + + + HTTP 요청의 From 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 From 헤더 값입니다. + + + HTTP 요청의 Host 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Host 헤더 값입니다. + + + HTTP 요청의 If-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-Match 헤더 값입니다. + + + HTTP 요청의 If-Modified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Modified-Since 헤더 값입니다. + + + HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + + HTTP 요청의 If-Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Range 헤더 값입니다. + + + HTTP 요청의 If-Unmodified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Unmodified-Since 헤더 값입니다. + + + HTTP 요청의 Max-Forwards 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Max-Forwards 헤더 값입니다. + + + HTTP 요청의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Pragma 헤더 값입니다. + + + HTTP 요청의 Proxy-Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Proxy-Authorization 헤더 값입니다. + + + HTTP 요청의 Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Range 헤더 값입니다. + + + HTTP 요청의 Referer 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Referer 헤더 값입니다. + + + HTTP 요청의 TE 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 TE 헤더 값입니다. + + + HTTP 요청의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Trailer 헤더 값입니다. + + + HTTP 요청의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Transfer-Encoding 헤더 값입니다. + + + HTTP 요청에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 요청의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Upgrade 헤더 값입니다. + + + HTTP 요청의 User-Agent 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 User-Agent 헤더 값입니다. + + + HTTP 요청의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Via 헤더 값입니다. + + + HTTP 요청의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Warning 헤더 값입니다. + + + RFC 2616에 정의된 응답 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Accept-Ranges 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Accept-Ranges 헤더 값입니다. + + + HTTP 응답의 Age 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Age 헤더 값입니다. + + + HTTP 응답의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Cache-Control 헤더 값입니다. + + + HTTP 응답의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Connection 헤더 값입니다. + + + HTTP 응답에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 응답의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Date 헤더 값입니다. + + + HTTP 응답의 ETag 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 ETag 헤더 값입니다. + + + HTTP 응답의 Location 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Location 헤더 값입니다. + + + HTTP 응답의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Pragma 헤더 값입니다. + + + HTTP 응답의 Proxy-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Proxy-Authenticate 헤더 값입니다. + + + HTTP 응답의 Retry-After 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Retry-After 헤더 값입니다. + + + HTTP 응답의 Server 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Server 헤더 값입니다. + + + HTTP 응답의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Trailer 헤더 값입니다. + + + HTTP 응답의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Transfer-Encoding 헤더 값입니다. + + + HTTP 응답에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Upgrade 헤더 값입니다. + + + HTTP 응답의 Vary 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Vary 헤더 값입니다. + + + HTTP 응답의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Via 헤더 값입니다. + + + HTTP 응답의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Warning 헤더 값입니다. + + + HTTP 응답의 WWW-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 WWW-Authenticate 헤더 값입니다. + + + RFC 2616에 정의된 대로 Content-Type 헤더에 사용된 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타낸 소스입니다. + + + 문자 집합을 가져오거나 설정합니다. + + 를 반환합니다.문자 집합입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 미디어 형식의 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값입니다. + + + 미디어 형식의 헤더 값 매개 변수를 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 유형 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 미디어 형식 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Type 헤더에 사용된 추가 품질 요소를 가진 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + 이 헤더 값과 연결된 품질입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 형식과 품질 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 미디어 형식이 아닙니다. + + + + 에 대한 품질 값을 가져오거나 설정합니다. + + 를 반환합니다. 개체의 품질 값입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 헤더 이름을 가져옵니다. + + 를 반환합니다.헤더 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 이름 값 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 헤더 값을 가져옵니다. + + 를 반환합니다.헤더 값입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 매개 변수를 가진 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + + 개체에서 매개 변수를 가져옵니다. + + 를 반환합니다.매개 변수를 포함하는 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값과 매개 변수 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 매개 변수 헤더 값 정보가 포함된 유효한 이름 값이 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + User-Agent 헤더의 제품 토큰 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 제품 토큰의 이름을 가져옵니다. + + 를 반환합니다.제품 토큰의 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 헤더 값 정보를 나타내는 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 제품 토큰의 버전을 가져옵니다. + + 를 반환합니다.제품 토큰의 버전입니다. + + + User-Agent 헤더에서 제품 또는 메모일 수 있는 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 주석 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + + 개체에서 주석을 가져옵니다. + + 를 반환합니다.이 의 주석 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 정보 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 제품 정보 헤더 값 정보가 아닙니다. + + + + 개체에서 제품을 가져옵니다. + + 를 반환합니다.이 의 제품 값입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 날짜/시간 또는 엔터티 태그 값일 수 있는 If-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 문자열로 나타내는 엔터티 태그입니다. + + + + 개체에서 날짜를 가져옵니다. + + 를 반환합니다. 개체의 날짜입니다. + + + + 개체에서 엔터티 태그를 가져옵니다. + + 를 반환합니다. 개체의 엔터티 태그입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 범위 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 바이트 범위를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 헤더 값 정보가 아닙니다. + + + + 개체에서 지정된 범위를 가져옵니다. + + 를 반환합니다. 개체의 범위입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체에서 단위를 가져옵니다. + + 를 반환합니다. 개체의 단위입니다. + + + 범위 헤더 값에서 바이트 범위를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 날짜/시간 또는 timespan 값일 수 있는 Retry-After 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜와 시간 오프셋입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 델타(초)입니다. + + + + 개체의 날짜와 시간 오프셋을 가져옵니다. + + 를 반환합니다. 개체의 날짜와 시간 오프셋입니다. + + + + 개체에서 델타(초)를 가져옵니다. + + 를 반환합니다. 개체의 델타(초)입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 다시 시도 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 다시 시도 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 선택적 품질의 문자열 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 새 인스턴스를 초기화하는 데 사용되는 품질 요소입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 품질 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 문자열이 아닙니다. + + + + 개체에서 품질 요소를 가져옵니다. + + 를 반환합니다. 개체의 품질 요소입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체의 문자열 값을 가져옵니다. + + 를 반환합니다. 개체의 문자열 값입니다. + + + accept-encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 전송 코딩 매개 변수를 가져옵니다. + + 를 반환합니다.전송 코딩 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 전송 코딩 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 전송 코딩 값을 가져옵니다. + + 를 반환합니다.전송 코딩 값입니다. + + + 선택적 품질 요소의 Accept-Encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 품질 요소의 값입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 전송 코딩이 아닙니다. + + + + 에서 품질 요소를 가져옵니다. + + 를 반환합니다.의 품질 요소입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Via 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + 수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 수취 프록시 또는 게이트웨이의 소프트웨어를 식별하는데 사용되는 설명 필드를 가져옵니다. + + 를 반환합니다.수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드를 반환합니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 Via 헤더 값 정보가 아닙니다. + + + 받은 프로토콜의 프로토콜 이름을 가져옵니다. + + 를 반환합니다.프로토콜 이름입니다. + + + 받은 프로토콜의 프로토콜 버전을 가져옵니다. + + 를 반환합니다.프로토콜 버전입니다. + + + 요청 또는 응답을 받은 호스트 및 포트를 가져옵니다. + + 를 반환합니다.요청 또는 응답을 받은 호스트 및 포트입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 경고 헤더에서 사용하는 경고 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + 경고의 날짜/시간 스탬프입니다. + + + 경고를 연결하는 호스트를 가져옵니다. + + 를 반환합니다.경고를 연결하는 호스트입니다. + + + 특정 경고 코드를 가져옵니다. + + 를 반환합니다.특정 경고 코드입니다. + + + 경고의 날짜/타임 스탬프를 가져옵니다. + + 를 반환합니다.경고의 날짜/시간 스탬프입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 인스턴스를 반환합니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 경고 텍스트가 포함된 따옴표 붙은 문자열을 가져옵니다. + + 를 반환합니다.경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/ru/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ru/a new file mode 100644 index 00000000000..bc26ceba05f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/ru/a @@ -0,0 +1,2290 @@ + + + + System.Net.Http + + + + Предоставляет содержимое HTTP на основе массива байтов. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Значение параметра — null. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Смещение в байтах в параметре , используемом для инициализации объекта . + Число байтов в параметре , начиная с параметра , используемых для инициализации объекта . + Значение параметра — null. + Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром .– или –Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром без учета параметра . + + + Создает поток содержимого HTTP как асинхронную операцию для чтения, чье резервное хранилище — память из . + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация и запись указанного в конструкторе массива байтов в поток содержимого HTTP в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте, например, о токене привязки каналов.Этот параметр может иметь значение null. + + + Определяет, имеет ли массив байтов допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) массива байтов. + + + Определяет способ предоставления клиентских сертификатов. + + + Объект будет пытаться предоставить все доступные клиентские сертификаты автоматически. + + + Приложение вручную предоставляет клиентские сертификаты объектам .Это значение по умолчанию. + + + Тип для обработчиков HTTP, которые делегируют обработку ответных сообщений HTTP другому обработчику, который называется внутренним обработчиком. + + + Создание нового экземпляра класса . + + + Создает новый экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Освобождает неуправляемые ресурсы, используемые объектом , и по возможности — управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает внутренний обработчик, который обрабатывает сообщения откликов HTTP. + Возвращает .Внутренний обработчик для сообщений HTTP-откликов. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены для отмены операции. + Значение параметра — null. + + + Контейнер для кортежей " имя-значение ", закодированных с помощью типа MIME application/x-www-form-urlencoded. + + + Инициализирует новый экземпляр класса с конкретной коллекцией пар "имя-значение". + Коллекция пар имен и значений. + + + Предоставляет базовый класс для отправки HTTP-запросов и получения HTTP-ответов от ресурса с заданным URI. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса указанным обработчиком. + Стек обработчика HTTP-данных, используемый для отправки запросов. + + + Инициализирует новый экземпляр класса указанным обработчиком. + Компонент , отвечающий за обработку сообщений ответов HTTP. + Значение true, если внутренний обработчик должен быть удален с помощью Dispose(); значение false, если планируется повторно использовать внутренний обработчик. + + + Возвращает или задает базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + Возвращает .Базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + + + Отмена всех ожидающих запросов на этом экземпляре. + + + Возвращает заголовки, которые должны отправляться с каждым запросом. + Возвращает .Заголовки, которые должны отправляться с каждым запросом. + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Освобождает неуправляемые ресурсы, используемые объектом , и опционально удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Возвращает или задает максимальное число байтов в буфере при чтении содержимого отклика. + Возвращает .Максимальное число байтов в буфере при чтении содержимого отклика.Значением по умолчанию для этого свойства является 2 гигабайта. + Указанный размер меньше или равен нулю. + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Возвращает или задает время ожидания для выполнения запроса. + Возвращает .Время ожидания для выполнения запроса. + Указанное время ожидания меньше или равно нулю и не является . + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Обработчик сообщений по умолчанию, используемый объектом . + + + Создает экземпляр класса . + + + Получает или задает значение, которое указывает, должен ли обработчик следовать откликам переадресации. + Возвращает .Значение true, если обработчик должен следовать откликам перенаправления; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает тип метода распаковки, используемый обработчиком для автоматической распаковки содержимого отклика HTTP. + Возвращает .Метод автоматической распаковки, используемый обработчиком.Значение по умолчанию — . + + + Получает или задает коллекцию сертификатов безопасности, связанных с данным обработчиком. + Возвращает .Коллекция сертификатов безопасности, связанная с данным обработчиком. + + + Получает или задает контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + Возвращает .Контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + + + Получает или задает данные для аутентификации, используемые этим обработчиком. + Возвращает .Учетные данные аутентификации, связанные с заголовком.Значение по умолчанию: null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает максимальное количество переадресаций, выполняемых обработчиком. + Возвращает .Максимальное количество откликов переадресации, указаниям которых следует обработчик.Значение по умолчанию - 50. + + + Получает или задает максимальный размер буфера содержимого запроса, используемый обработчиком. + Возвращает .Максимальный размер буфера содержимого запроса в байтах.По умолчанию используется значение 2 гигабайта. + + + Получает или задает значение, указывающее, отправляет ли обработчик заголовок авторизации вместе с запросом. + Возвращает .Значение true для обработчика, с запросом требуется отправить заголовок авторизации HTTP после выполнения аутентификации; в противном случае — значение false.Значение по умолчанию — false. + + + Получает или задает сведения о прокси-сервере, используемом обработчиком. + Возвращает .Сведения о прокси-сервере, используемом обработчиком.Значение по умолчанию — null. + + + Создает экземпляр на основе сведений, предоставленных в как операция, которая не блокируется. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса. + Токен отмены для отмены операции. + Значение параметра — null. + + + Получает значение, указывающее, поддерживает ли обработчик автоматическую распаковку содержимого ответа. + Возвращает .Значение true, если обработчик поддерживает автоматическую распаковку содержимого отклика; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры прокси. + Возвращает .Значение true, если обработчик поддерживает параметры прокси-сервера; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры конфигурации для свойств и . + Возвращает .Значение true, если обработчик поддерживает параметры конфигурации для свойств и ; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, указывающее, использует ли обработчик свойство для хранения файлов cookie сервера, а также использует ли он эти файлы cookie при отправке запросов. + Возвращает .Значение true, если обработчик использует свойство для хранения файлов cookie сервера и использует эти файлы cookie при отправке запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, которое управляет отправкой обработчиком учетных данных по умолчанию вместе с запросами. + Возвращает .Значение равно true, если используются учетные данные по умолчанию, в противном случае — false.Значение по умолчанию — false. + + + Получает или задает значение, указывающее, использует ли обработчик прокси для запросов. + Возвращает .Значение true, если обработчик должен использовать прокси-сервер для запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Указывает, должны ли операции считаться завершенными, как только имеется отклик, или после чтения всего сообщения отклика, включая содержимое. + + + Операция должна завершиться после считывания всего отклика, включая содержимое. + + + Операция должна завершиться сразу после того, как отклик станет доступен и будут считаны заголовки.Содержимое еще не прочитано. + + + Базовый класс, представляющий заголовки содержимого и тело сущности HTTP. + + + Инициализирует новый экземпляр класса . + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Сериализация содержимого HTTP в поток памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает заголовки содержимого HTTP, определенные в RFC 2616. + Возвращает .Заголовки содержимого, соответствующие определениям в RFC 2616. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Максимальный размер используемого буфера в байтах. + + + Сериализация содержимого HTTP в массив байтов в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Выполнять сериализацию содержимого HTTP и возвращать поток, который представляет содержимое как асинхронную операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в строку в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое HTTP допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) HTTP-содержимого. + + + Базовый тип обработчиков сообщений HTTP. + + + Инициализирует новый экземпляр класса . + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Специальный Класс, который позволяет приложениям вызывать метод по цепочке обработчика HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + true, если внутренний обработчик должен быть удален с помощью Dispose (); false, если планируется повторно использовать внутренний обработчик. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Вспомогательный класс для получения и сравнения стандартных методов HTTP и создания новых методов HTTP. + + + Инициализирует новый экземпляр класса с конкретным методом HTTP. + Метод HTTP. + + + Представляет метод протокола HTTP DELETE. + Возвращает . + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Метод HTTP для сравнения с текущим объектом. + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Объект, который требуется сравнить с текущим объектом. + + + Представляет метод протокола HTTP GET. + Возвращает . + + + Служит в качестве хэш-функции для данного типа. + Возвращает .Хэш-код для текущего объекта . + + + Представляет метод протокола HTTP HEAD.Метод HEAD идентичен методу GET за исключением того, что сервер возвращает в ответе только заголовки сообщений без основного текста сообщений. + Возвращает . + + + Метод HTTP. + Возвращает .Метод HTTP, представленный в виде . + + + Оператор равенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и равны; в противном случае — значение false. + Объект , который находится слева от оператора равенства. + Объект , который находится справа от оператора равенства. + + + Оператор неравенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и не равны; в противном случае — значение false. + Объект , который находится слева от оператора неравенства. + Объект , который находится справа от оператора неравенства. + + + Представляет метод протокола HTTP OPTIONS. + Возвращает . + + + Представляет метод протокола HTTP POST, который используется для публикации новой сущности в качестве дополнения к URI. + Возвращает . + + + Представляет метод протокола HTTP PUT, который используется для замены сущности, указанной с помощью URI. + Возвращает . + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строка, представляющая текущий объект. + + + Представляет метод протокола HTTP TRACE. + Возвращает . + + + Базовый класс для исключений, вызванных классами и . + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключением. + Сообщение, описывающее текущее исключение. + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключение и внутреннее исключение. + Сообщение, описывающее текущее исключение. + Внутреннее исключение. + + + Представляет сообщение HTTP-запроса. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Строка, представляющая объект запроса. + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Запрашиваемый объект . + + + Получает или задает содержимое сообщения HTTP. + Возвращает .Содержимое сообщения + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает коллекцию заголовков HTTP-запросов. + Возвращает .Коллекция заголовков HTTP-запросов. + + + Получает или задает метод HTTP, используемый сообщением запроса HTTP. + Возвращает .Метод HTTP, используемый сообщением запроса.Значение по умолчанию — метод GET. + + + Получает набор свойств для HTTP-запроса. + Возвращает . + + + Получает или задает , используемый для HTTP-запроса. + Возвращает ., используемый для HTTP-запроса. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Представляет ответное сообщение HTTP, включая код и данные о состоянии. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным свойством . + Код состояния HTTP-отклика. + + + Получает или задает содержимое сообщения отклика HTTP. + Возвращает .Содержимое сообщения HTTP-отклика. + + + Освобождает неуправляемые ресурсы и удаляет неуправляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Создает исключение, если свойство для HTTP-отклика имеет значение false. + Возвращает .Сообщение ответа HTTP, если вызов метода завершился успешно. + + + Получает коллекцию заголовков HTTP-откликов. + Возвращает .Коллекция заголовков HTTP-откликов. + + + Получает значение, указывающее, был ли успешен HTTP-отклик. + Возвращает .Значение, указывающее, был ли успешен HTTP ответ.Значение true, если значение свойства находится в диапазоне 200-299; в противном случае — значение false. + + + Получает или задает фразу причины, которая обычно отправляется серверами вместе с кодом состояния. + Возвращает .Фраза причины, отправленная сервером. + + + Получает или задает сообщение запроса, на которое получено это сообщение отклика. + Возвращает .Сообщение запроса, на которое получено это сообщение отклика. + + + Получает или задает код состояния HTTP-отклика. + Возвращает .Код состояния HTTP-отклика. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Базовый тип для обработчиков, которые выполняют определенную небольшую часть обработки запросов и ответных сообщений. + + + Создает экземпляр класса . + + + Создает экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Выполняет обработку для каждого запроса, отправленного серверу. + Возвращает .Обработанное сообщение HTTP-запроса. + Сообщение HTTP-запроса для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Выполнить обработку на каждом ответе сервера. + Возвращает .Обработанное сообщение HTTP-отклика. + Сообщение HTTP-отклика для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Предоставляет коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Параметр имел значение null или содержит только пробелы. + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Строка, представляющая границу составного содержимого. + Параметр имеет значение null или содержит пустую строку.Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавить многокомпонентное содержимое HTTP в коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Возвращает перечислитель, который перебирает коллекцию объектов , которые сериализуются, используя спецификацию типа содержимого multipart/*. + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Сериализация содержимого HTTP, состоящего из нескольких частей, в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Явная реализация метода . + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Определяет, имеет ли содержимое HTTP из нескольких частей допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байта) HTTP-содержимого. + + + Предоставляет контейнер для закодированного с помощью типа MIME "multipart/form-data" содержимого. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Строка, представляющая границу составного содержимого данных формы. + Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Имя файла для HTTP-содержимого, которое требуется добавить в коллекцию. + Параметр имел значение null или содержит только пробелы.– или –Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Предоставляет содержимое HTTP на основе потока. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Размер (в байтах) буфера, доступного для . + Значение параметра — null. + Значение параметра было меньше или равно нулю. + + + Запись содержимого потока HTTP в поток в памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое потока допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) содержимого потока. + + + Предоставляет содержимое HTTP на основе строки. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + Тип мультимедиа, используемый для содержимого. + + + Представляет сведения об аутентификации в значениях заголовка Authorization, ProxyAuthorization, WWW-Authneticate и Proxy-Authenticate. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + Учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + Возвращает .Учетные данные, содержащие сведения об аутентификации. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает схему, используемую для авторизации. + Возвращает .Схема, которую требуется использовать для авторизации. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Cache-Control. + + + Инициализирует новый экземпляр класса . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Токены Кэш-расширения, каждый с необязательным присвоенным значения. + Возвращает .Коллекция токенов кэш-расширений, каждый с необязательным присвоенным значением. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Максимальная длительность, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Готов ли клиент HTTP принять отклик, срок действия которого истек. + Возвращает .Значение true, если клиент HTTP готов принять отклик, срок действия которого истек; в противном случае — значение false. + + + Максимальное время (в секундах), в течение которого клиент HTTP готов принять отклик, срок действия которого истек. + Возвращает .Время в секундах. + + + Длительность существования, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает; в противном случае — значение false. + + + Готов ли клиент HTTP принять кэшированный отклик. + Возвращает .Значение true, если клиент HTTP готов принять кэшированный отклик; в противном случае — значение false. + + + Коллекция имен полей в некэшированной директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Не должна ли храниться в кэше какая-либо часть сообщения HTTP-запроса или любого отклика. + Возвращает .Значение true, если в кэше не должна храниться какая-либо часть сообщения HTTP-запроса или любого отклика; в противном случае — значение false. + + + Не должен ли кэш или прокси изменять какой-либо аспект тела сущности. + Возвращает .Значение true, если кэш или прокси не должны изменять какой-либо аспект тела сущности; в противном случае — значение false. + + + Должен ли кэш отвечать, используя согласованную с другими ограничениями HTTP-запроса кэшированную запись или состояние 504 (время ожидания шлюза). + Возвращает .Значение true, если в отклике кэш должен либо использовать кэшированную запись, согласованную с другими ограничениями HTTP-запроса, либо состояние 504 (истекло время ожидания шлюза); в противном случае — значение false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка элемента управления кэшем. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка управления кэшем. + + + Предназначено ли все сообщение отклика HTTP или его часть для одного пользователя и не должно ли это сообщение или его часть кэшироваться в общем кэше. + Возвращает .Значение true, если сообщение HTTP-отклика предназначено для одного пользователя и не должно кэшироваться в общем кэше; в противном случае — значение false. + + + Имена полей коллекции в закрытой директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей; в противном случае — значение false. + + + Может ли отклик HTTP кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в необщем кэше. + Возвращает .Значение true, если HTTP-отклик может кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в кэше без общего доступа; в противном случае — значение false. + + + Общая максимальная длительность (в секундах) в отклике HTTP, которая переопределяет директиву "max-age" в заголовке управления кэшем или в заголовке Expires для общего кэша. + Возвращает .Время в секундах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Disposition. + + + Инициализирует новый экземпляр класса . + Объект . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Дата создания файла. + Возвращает .Дата создания файла. + + + Тип расположения для части основного текста содержимого. + Возвращает .Тип расположения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Предложение для построения имя файла для хранения полезных данные сообщения, используемое, если сущность удалена и хранится в отдельном файле. + Возвращает .Предлагаемое имя файла. + + + Предложение для построения имен файлов для хранения полезных данные сообщений, используемое, если сущности удалены и хранятся в отдельном файле. + Возвращает .Предложенное имя файла в виде filename*. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Дата последнего изменения файла. + Возвращает .Дата изменения файла. + + + Имя части тела содержимого. + Возвращает .Имя части тела содержимого. + + + Набор параметров содержал заголовок Content-Disposition. + Возвращает .Коллекция параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка расположения содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка расположения содержимого. + + + Дата последнего чтения файла. + Возвращает .Дата последнего считывания. + + + Приблизительный размер файла в байтах. + Возвращает .Приблизительный размер в байтах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Range. + + + Инициализирует новый экземпляр класса . + Начальная или конечная точка диапазона, в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + Начальная или конечная точка диапазона, в байтах. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Позиция начала передачи данных в байтах. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее, задана ли длина заголовка Content-Range. + Возвращает .true, если длина заголовка Content-Range задана; в противном случае — false. + + + Получает значение, указывающее, задано ли диапазон для Content-Range. + Возвращает .true, если диапазон заголовка Content-Range задан; в противном случае — false. + + + Получает длину полного тела сущности. + Возвращает .Длина полного тела сущности. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона содержимого. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Используемые единицы диапазона. + Возвращает .Объект , содержащий единицы диапазона. + + + Представляет значение заголовка тега сущности. + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + Значение, указывающее, является ли данный заголовок тега сущности слабым проверяющим элементом.Если заголовок тега сущности — слабый проверяющий элемент, должно быть установлено в значение true.Если заголовок тега сущности — сильный проверяющий элемент, должно быть установлено в значение false. + + + Получает значение заголовка тега сущности. + Возвращает . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее предшествует ли тегу сущности индикатор ослабления. + Возвращает .true, если тегу сущности предшествует индикатор ослабления; в противном случае — false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка тега сущности. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка тега сущности. + + + Получает Непрозрачную строку в кавычках. + Возвращает .Непрозрачная строка в кавычках. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет коллекцию заголовков Content в соответствии с RFC 2616. + + + Получает значение заголовка содержимого Allow в HTTP-ответе. + Возвращает .Значение заголовка Allow в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Disposition в HTTP-ответе. + Возвращает .Значение заголовка содержимого Content-Disposition в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Encoding в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Encoding в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Language в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Language в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Length в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Length в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Location в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Location в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-MD5 в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-MD5 в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Range в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Range в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Type в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Type в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Expires в HTTP-отклике. + Возвращает .Значение заголовка содержимого Expires в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Last-Modified в HTTP-отклике. + Возвращает .Значение заголовка содержимого Last-Modified в HTTP-отклике. + + + Коллекция заголовков и их значения, как указано в RFC 2616. + + + Инициализирует новый экземпляр класса . + + + Добавляет указанный заголовок и его значения в коллекцию . + Заголовок для добавления в коллекцию. + Список значений заголовков для добавления в коллекцию. + + + Добавляет указанный заголовок и его значение в коллекцию . + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Удаляет все заголовки из коллекции . + + + Возвращает, существует ли конкретный заголовок в коллекции . + Возвращает .Значение true, если указанный заголовок существует в коллекции; в противном случае — значение false. + Определенный заголовок. + + + Возвращает перечислитель, с помощью которого можно перебирать все элементы экземпляра коллекции . + Возвращает .Перечислитель для объекта . + + + Возвращает все значения заголовка для указанного заголовка, хранящихся в коллекции . + Возвращает .Массив строк заголовка. + Указанный заголовок, для которого требуется вернуть значения. + + + Удаляет указанный заголовок из коллекции . + Возвращает . + Имя заголовка, который должен быть удален из коллекции. + + + Возвращает перечислитель, который может перебирать элементы . + Возвращает .Экземпляр реализации , который может перебирать элементы в коллекции . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значения в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Значения заголовка. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значение в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Указывает, хранятся ли указанный заголовок и заданные значения в коллекции . + Возвращает .Значение true, если параметры и values указанного заголовка хранятся в коллекции; в противном случае — значение false. + Указанное средство чтения. + Заданные значения заголовка. + + + Представляет коллекцию значений заголовка. + Тип коллекции заголовков. + + + Добавляет запись в коллекцию . + Элемент для добавления в коллекцию заголовков. + + + Удаляет все записи из . + + + Определяет, содержит ли элемент. + Возвращает .Значение true, если запись содержится в экземпляре ; в противном случае — значение false. + Элемент для поиска в коллекцию заголовков. + + + Копирует целый массив в совместимый одномерный массив , начиная с заданного индекса целевого массива. + Одномерный массив , в который копируются элементы из интерфейса .Массив должен иметь индексацию, начинающуюся с нуля. + Индекс (с нуля) в массиве , с которого начинается копирование. + + + Получает количество заголовков в наборе . + Возвращает .Число заголовков в коллекции. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Получает значение, указывающее, действительно ли экземпляр доступен только для чтения. + Возвращает .Значение true, если экземпляр класса доступен только для чтения, в противном случае — значение false. + + + Анализирует и добавляет запись в . + Добавляемая запись. + + + Удаляет указанный элемент из поля со списком . + Возвращает .Значение true, если элемент успешно удален из экземпляра , в противном случае — значение false. + Удаляемый элемент. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Возвращает строку, представляющую текущий объект . объект. + Возвращает .Строка, представляющая текущий объект. + + + Определяет, может ли ввод быть проанализировано и добавлен в . + Возвращает .значение true, если может быть проанализировано и добавлен в экземпляр ; в противном случае — значение false + Проверяемое запись. + + + Представляет коллекцию заголовков Request в соответствии с RFC 2616. + + + Получает значение заголовка Accept для HTTP-запроса. + Возвращает .Значение заголовка Accept для HTTP-запроса. + + + Получает значение заголовка Accept-Charset для HTTP-запроса. + Возвращает .Значение заголовка Accept-Charset для HTTP-запроса. + + + Получает значение заголовка Accept-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Accept-Encoding для HTTP-запроса. + + + Получает значение заголовка Accept-Language для HTTP-запроса. + Возвращает .Значение заголовка Accept-Language для HTTP-запроса. + + + Получает или задает значение заголовка Authorization для HTTP-запроса. + Возвращает .Значение заголовка Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Cache-Control для HTTP-запроса. + Возвращает .Значение заголовка Cache-Control для HTTP-запроса. + + + Получает значение заголовка Connection для HTTP-запроса. + Возвращает .Значение заголовка Connection для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-запроса инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-запроса. + Возвращает .Значение заголовка Date для HTTP-запроса. + + + Получает значение заголовка Expect для HTTP-запроса. + Возвращает .Значение заголовка Expect для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Expect HTTP-запроса инструкцию Continue. + Возвращает .Значение true, если заголовок Expect содержит Continue; в противном случае — значение false. + + + Получает или задает значение заголовка From для HTTP-запроса. + Возвращает .Значение заголовка From для HTTP-запроса. + + + Получает или задает значение заголовка Host для HTTP-запроса. + Возвращает .Значение заголовка Host для HTTP-запроса. + + + Получает значение заголовка If-Match для HTTP-запроса. + Возвращает .Значение заголовка If-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Modified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Modified-Since для HTTP-запроса. + + + Получает значение заголовка If-None-Match для HTTP-запроса. + Возвращает .Получает значение заголовка If-None-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Range для HTTP-запроса. + Возвращает .Значение заголовка If-Range для HTTP-запроса. + + + Получает или задает значение заголовка If-Unmodified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Unmodified-Since для HTTP-запроса. + + + Получает или задает значение заголовка Max-Forwards для HTTP-запроса. + Возвращает .Значение заголовка Max-Forwards для HTTP-запроса. + + + Получает значение заголовка Pragma для HTTP-запроса. + Возвращает .Значение заголовка Pragma для HTTP-запроса. + + + Получает или задает значение заголовка Proxy-Authorization для HTTP-запроса. + Возвращает .Значение заголовка Proxy-Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Range для HTTP-запроса. + Возвращает .Значение заголовка Range для HTTP-запроса. + + + Получает или задает значение заголовка Referer для HTTP-запроса. + Возвращает .Значение заголовка Referer для HTTP-запроса. + + + Получает значение заголовка TE для HTTP-запроса. + Возвращает .Значение заголовка TE для HTTP-запроса. + + + Получает значение заголовка Trailer для HTTP-запроса. + Возвращает .Значение заголовка Trailer для HTTP-запроса. + + + Получает значение заголовка Transfer-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-запроса инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-запроса. + Возвращает .Значение заголовка Upgrade для HTTP-запроса. + + + Получает значение заголовка User-Agent для HTTP-запроса. + Возвращает .Значение заголовка User-Agent для HTTP-запроса. + + + Получает значение заголовка Via для HTTP-запроса. + Возвращает .Значение заголовка Via для HTTP-запроса. + + + Получает значение заголовка Warning для HTTP-запроса. + Возвращает .Значение заголовка Warning для HTTP-запроса. + + + Представляет коллекцию заголовков Response в соответствии с RFC 2616. + + + Получает значение заголовка Accept-Ranges для HTTP-отклика. + Возвращает .Значение заголовка Accept-Ranges для HTTP-отклика. + + + Получает или задает значение заголовка Age для HTTP-отклика. + Возвращает .Значение заголовка Age для HTTP-отклика. + + + Получает или задает значение заголовка Cache-Control для HTTP-отклика. + Возвращает .Значение заголовка Cache-Control для HTTP-отклика. + + + Получает значение заголовка Connection для HTTP-отклика. + Возвращает .Значение заголовка Connection для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-ответа инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-отклика. + Возвращает .Значение заголовка Date для HTTP-отклика. + + + Получает или задает значение заголовка ETag для HTTP-отклика. + Возвращает .Значение заголовка ETag для HTTP-отклика. + + + Получает или задает значение заголовка Location для HTTP-отклика. + Возвращает .Значение заголовка Location для HTTP-отклика. + + + Получает значение заголовка Pragma для HTTP-отклика. + Возвращает .Значение заголовка Pragma для HTTP-отклика. + + + Получает значение заголовка Proxy-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка Proxy-Authenticate для HTTP-отклика. + + + Получает или задает значение заголовка Retry-After для HTTP-отклика. + Возвращает .Значение заголовка Retry-After для HTTP-отклика. + + + Получает значение заголовка Server для HTTP-отклика. + Возвращает .Значение заголовка Server для HTTP-отклика. + + + Получает значение заголовка Trailer для HTTP-отклика. + Возвращает .Значение заголовка Trailer для HTTP-отклика. + + + Получает значение заголовка Transfer-Encoding для HTTP-отклика. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-ответа инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-отклика. + Возвращает .Значение заголовка Upgrade для HTTP-отклика. + + + Получает значение заголовка Vary для HTTP-отклика. + Возвращает .Значение заголовка Vary для HTTP-отклика. + + + Получает значение заголовка Via для HTTP-отклика. + Возвращает .Значение заголовка Via для HTTP-отклика. + + + Получает значение заголовка Warning для HTTP-отклика. + Возвращает .Значение заголовка Warning для HTTP-отклика. + + + Получает значение заголовка WWW-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка WWW-Authenticate для HTTP-отклика. + + + Представляет тип носителя, используемый в заголовке типа содержимого согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Источник, представленный в виде строки для инициализации нового экземпляра. + + + Получает или задает кодировку. + Возвращает .Набор символов. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает или задает значение заголовка типа носителя. + Возвращает .Значение заголовка типа мультимедиа. + + + Получает или задает параметры значения заголовка типа носителя. + Возвращает .Параметры значений заголовка типа мультимедиа. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка типа мультимедиа. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка типа мультимедиа. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет тип мультимедиа типа с дополнительными коэффициентом качества, используемый в заголовке типа содержимого. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + Качество, связанное с этим значением заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая тип мультимедиа со сведениями о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимыми типом мультимедиа со сведениями о значении заголовка качества. + + + Получает или задает значение качества для . + Возвращает .Значение качества для объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет пару " имя-значение ", которое используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя заголовка. + Возвращает .Имя заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка значения имени. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка значения имени. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение заголовка. + Возвращает .Значение заголовка. + + + Представляет пару " имя-значение " с параметрами, которые используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры объекта . + Возвращает .Коллекция, содержащая параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая значение имени со сведениями о значении заголовка параметров. + Параметр имеет ссылку null. + + не является допустимым значением имени со сведениями о значении заголовка параметра. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение токена продукта в заголовке агента пользователя. + + + Инициализирует новый экземпляр класса . + Название продукта. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя токена продукта. + Возвращает .Имя токена продукта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка продукта. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает версию токена продукта. + Возвращает .Версия токена продукта. + + + Представляет значение, которое может быть либо продуктом либо комментарием в заголовке User-Agent. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Значение комментария. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Получает комментарий из объекта . + Возвращает .Значение комментария — этот . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка информации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка сведений о продукте. + + + Получает продукт из объекта . + Возвращает .Значение продукта из данного объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка If-Range, которое может быть либо значением даты и времени, либо значением тега сущности. + + + Инициализирует новый экземпляр класса . + Значение даты, используемое для инициализации нового экземпляра . + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Тег сущности, представленный в виде строки, используемой для инициализации нового экземпляра. + + + Получает Дата из объекта . + Возвращает .Дата из объекта . + + + Получает Тег сущности объекта . + Возвращает .Тег сущности объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Range. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса диапазоном байтов. + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона. + + + Получает диапазоны, указанные из объекта . + Возвращает .Диапазоны из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает модуль из объекта . + Возвращает .Модуль из объекта . + + + Представляет диапазон байтов в значении заголовка Range. + + + Инициализирует новый экземпляр класса . + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Место начала передачи данных. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Представляет значение заголовка Retry-After, которое может быть либо значением даты и времени, либо значением интервала времени. + + + Инициализирует новый экземпляр класса . + Смещение даты и времени, используемое для инициализации нового экземпляра класса . + + + Инициализирует новый экземпляр класса . + Разность в секундах, используемая для инициализации нового экземпляра. + + + Получает смещение даты и времени от объекта . + Возвращает .Смещение даты и времени от объекта . + + + Получает Разность в секундах из объекта . + Возвращает .Разность в секундах из объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия повтора. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия повтора. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка строки с необязательным качеством. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Коэффициент качества, используемый для инициализации нового экземпляра . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимой строкой со сведениями о значении заголовка качества. + + + получает коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение строки из Объекта . + Возвращает .Значение строки из объекта . + + + Представляет значение заголовка Accept-Encoding. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры кодирования передачи. + Возвращает .параметры кодирования передачи. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка кодирования передачи. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка кодирования передачи. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение кодирования передачи. + Возвращает .значение кодирования передачи. + + + Представляет значение заголовка Accept-Encoding с необязательным коэффициентом качества. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Значение для коэффициента качества. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении кодирования передачи. + Параметр имеет ссылку null. + + не является допустимой кодировкой переноса со сведениями о значении заголовка качества. + + + Получает Коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Via. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Получает поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + Возвращает .Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Возвращает хэш-код текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка Via. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка Via. + + + Получает имя полученного протокола. + Возвращает .Имя протокола. + + + Получает версию полученного протокола. + Возвращает .Версия протокола. + + + Получает Узел и порт, которыми был получен запрос или ответ. + Возвращает .Узел и порт, которыми был получен запрос или отклик. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение предупреждения, используемое заголовком предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + Отметка даты и времени предупреждения. + + + Получает узел, который присоединил предупреждение. + Возвращает .Основное приложение, которое присоединило предупреждение. + + + Получает конкретный код предупреждения. + Возвращает .Конкретный код предупреждения. + + + Получает отметку даты и времени предупреждения. + Возвращает .Отметка даты и времени предупреждения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает экземпляр объекта . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает строку в кавычках, содержащую текст предупреждения. + Возвращает .Строка в кавычках, содержащая текст предупреждения. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hans/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hans/a new file mode 100644 index 00000000000..3d0d1708770 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hans/a @@ -0,0 +1,2367 @@ + + + + System.Net.Http + + + + 基于字节数组提供 HTTP 内容。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数为 null。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数中用于初始化 的偏移量(以字节为单位)。 + + 中从用于初始化 参数开始的字节数。 + + 参数为 null。 + + 参数小于零。- 或 - 参数大于 参数指定的内容的长度。- 或 - 参数小于零。- 或 - 参数大于由 参数减去 参数所指定的内容长度。 + + + 创建 HTTP 内容流,它是其后备储存区是 的内存的读取的异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化并写入在构造函数中提供的字节数组到作为异步操作的 HTTP 内容流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息,例如,通道绑定。此参数可以为 null。 + + + 确定字节数组是否具有合法的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的字节数组的长度。 + + + 指定如何提供客户端证书。 + + + + 将尝试自动提供所有可用的客户端证书。 + + + 该应用程序向 手动提供客户端证书。这值是默认值。 + + + 将 HTTP 响应消息的处理委托给另一处理程序(称为“内部处理程序”)的 HTTP 处理程序的类型。 + + + 创建 类的新实例。 + + + 创建特定内部处理程序的 类的新实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置处理 HTTP 响应消息的内部处理程序。 + 返回 。HTTP 响应消息的内部处理程序。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 使用应用程序/x-www-form-urlencoded MIME 类型编码的名称/值元组的容器。 + + + 使用指定的名称/值对集合初始化 类的新实例。 + 名称/值对的集合。 + + + 提供基本类,用于发送 HTTP 请求和接收来自通过 URI 确认的资源的 HTTP 响应。 + + + 初始化 类的新实例。 + + + 用特定的处理程序初始化 类的新实例。 + 要用于发送请求的 HTTP 处理程序堆栈。 + + + 用特定的处理程序初始化 类的新实例。 + 负责处理 HTTP 响应消息的 。 + 如果内部处理程序应由 Dispose() 处理,则为 true,如果希望重用内部处理程序,则为 false。 + + + 获取或设置发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + 返回 。发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + + + 取消该实例所有挂起的请求。 + + + 获取与每个请求一起发送的标题。 + 返回 。应与每一个请求一起发送的标题。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果释放托管资源和非托管资源,则为 true;如果仅释放非托管资源,则为 false。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 获取或设置读取响应内容时要缓冲的最大字节数。 + 返回 。当读取响应内容时缓冲区的最大字节数。此属性的默认值为 2 GB。 + 指定小于或等于零。 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 获取或设置请求超时前等待的时间跨度。 + 返回 。请求超时前等待的时间跨度。 + 指定的超时值小于或等于零,并且不为 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + + 所用的默认消息版本。 + + + 创建 类的实例。 + + + 获取或设置一个值,该值指示处理程序是否应跟随重定向响应。 + 返回 。如果处理器应按照重定向响应,则为 true;否则为 false。默认值为 true。 + + + 获取或设置处理程序用于实现 HTTP 内容响应的自动解压缩的解压缩方法。 + 返回 。由处理程序使用的自动解压缩。默认值为 + + + 获取或设置与此处理程序关联的安全证书集合。 + 返回 。与此提供程序关联的安全证书的集合。 + + + 获取或设置用于存储处理程序产生的服务器 Cookie 的 Cookie 容器。 + 返回 。用于通过处理程序存储服务器 cookie 的 cookie 容器。 + + + 获取或设置此处理程序使用的身份验证信息。 + 返回 。与处理程序相关联的身份验证凭证。默认值为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置将跟随的处理程序的重定向的最大数目。 + 返回 。处理程序跟随的最大重定向响应数。默认值为 50。 + + + 获取或设置处理程序的使用的请求内容的最大缓冲区大小。 + 返回 。最大请求内容缓冲区大小(以字节为单位)。默认值为 2 GB。 + + + 获取或设置一个值,该值指示处理程序是否随请求发送一个“身份验证”标头。 + 返回 。处理程序的 true 在发生身份验证之后随请求一起发送 HTTP 授权标头;否则为 false。默认值为 false。 + + + 获取或设置处理程序使用的代理信息。 + 返回 。被处理程序使用的代理信息。默认值为 null。 + + + 创建基于作为不会阻塞的操作的 中提供的信息的 实例。 + 返回 。表示异步操作的任务对象。 + HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 获取指示处理程序是否支持自动响应内容解压的值。 + 返回 。如果处理器支持自动响应内容解压缩,则为 true;否则 false。默认值为 true。 + + + 获取指示处理程序是否支持代理设置的值。 + 返回 。如果处理器支持代理设置,则为 true;否则为 false。默认值为 true。 + + + 获取指示处理程序是否支持 属性配置设置的值。 + 返回 。如果处理器支持 属性的配置设置,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值指示发送请求时,处理程序是否使用 属性存储服务器 Cookie 并使用这些 Cookie。 + 返回 。如果处理程序支持使用 属性来存储服务器 Cookie 并在发送请求时使用这些 Cookie,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值控制默认凭据是否被处理程序随请求一起发送。 + 返回 。如果使用默认凭据,则为 true;否则为 false。默认值为 false。 + + + 获取或设置一个值,该值指示处理程序是否为请求使用代理。 + 返回 。如果该管理器应为请求使用代理项,则为 true;否则为 false。默认值为 true。 + + + 指示 操作是在响应可利用时立即视为已完成,还是在读取包含上下文的整个答案信息之后才视为已完成。 + + + 操作应在阅读包括该内容的整个响应之后完成。 + + + 响应一可用且标题可读时即应完成的操作。尚未读取的内容。 + + + 表示 HTTP 实体正文和内容标头的基类。 + + + 初始化 类的新实例。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 将 HTTP 内容序列化为内存流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 根据 RFC 2616 中的定义,获取内容标头。 + 返回 。如 RFC 2616 中定义的内容标头。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + 要使用的缓冲区的最大大小(以字节为单位)。 + + + 将 HTTP 内容序列化为字节数组以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化 HTTP 内容并返回表示内容的流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 将 HTTP 内容序列化到字符串以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定 HTTP 内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HTTP 对象的长度。 + + + HTTP 消息处理程序的基类型。 + + + 初始化 类的新实例。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个特殊类,它允许应用程序对 Http 处理程序链调用 方法。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + true 如果内部处理程序应由 Dispose 处理(),false ,如果您希望重用内部处理程序。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个帮助器类,它用于检索并比较标准 HTTP 方法并且用于创建新的 HTTP 方法。 + + + 使用指定的 HTTP 方法初始化 类的新实例。 + HTTP 方法。 + + + 表示一个 HTTP DELETE 协议方法。 + 返回 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前目标进行比较的 HTTP 方法。 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 表示一个 HTTP GET 协议方法。 + 返回 + + + 用作此类型的哈希函数。 + 返回 。当前 的哈希代码。 + + + 表示一个 HTTP HEAD 协议方法。除了服务器在响应中只返回消息头不返回消息体以外,HEAD 方法和 GET 是一样的。 + 返回 + + + HTTP 方法。 + 返回 。表示作为 的 HTTP 方法。 + + + 用于比较两个 对象的相等运算符。 + 返回 。如果指定的 参数相等,则为 true;否则为 false。 + 相等运算符左侧的 。 + 相等运算符右侧的 。 + + + 用于比较两个 对象的不相等运算符。 + 返回 。如果指定的 参数不相等,则为 true;否则为 false。 + 不相等运算符左侧的 。 + 不相等运算符右侧的 。 + + + 表示一个 HTTP OPTIONS 协议方法。 + 返回 + + + 表示一个 HTTP POST 协议方法,该方法用于将新实体作为补充发送到某个 URI。 + 返回 + + + 表示一个 HTTP PUT 协议方法,该方法用于替换 URI 标识的实体。 + 返回 + + + 返回表示当前对象的字符串。 + 返回 。一个表示当前对象的字符串。 + + + 表示一个 HTTP TRACE 协议方法。 + 返回 + + + + 所引发的异常的基类。 + + + 初始化 类的新实例。 + + + 使用由特定的用来描述当前异常的消息初始化 类的新实例。 + 描述当前异常的消息。 + + + 使用指定消息以及描述当前异常的内部异常来初始化 类的新实例。 + 描述当前异常的消息。 + 内部异常。 + + + 表示 HTTP 请求消息。 + + + 初始化 类的新实例。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 表示请求 的字符串。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 要请求的 。 + + + 获取或设置 HTTP 消息的内容。 + 返回 。消息的内容 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取 HTTP 请求标头的集合。 + 返回 。HTTP 请求标头的集合。 + + + 获取或设置 HTTP 请求信息使用的 HTTP 方法。 + 返回 。被请求消息使用的HTTP 方法。GET 是默认方法。 + + + 获取 HTTP 请求的属性集。 + 返回 + + + 获取或设置 HTTP 请求的 + 返回 。用于 HTTP 请求的 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 表示包括状态代码和数据的 HTTP 响应消息。 + + + 初始化 类的新实例。 + + + 初始化指定的 类的新实例。 + HTTP 响应的状态代码。 + + + 获取或设置 HTTP 响应消息的内容。 + 返回 。HTTP 响应消息的内容。 + + + 释放由 使用的非托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 如果 HTTP 响应的 属性为 false, 将引发异常。 + 返回 。如果调用成功则 HTTP 响应消息。 + + + 获取 HTTP 响应标头的集合。 + 返回 。HTTP 响应标头的集合。 + + + 获取一个值,该值指示 HTTP 响应是否成功。 + 返回 。指示 HTTP 响应是否成功的值。如果 在 200-299 范围中,则为 true;否则为 false。 + + + 获取或设置服务器与状态代码通常一起发送的原因短语。 + 返回 。服务器发送的原因词组。 + + + 获取或设置导致此响应消息的请求消息。 + 返回 。导致此响应信息的请求消息。 + + + 获取或设置 HTTP 响应的状态代码。 + 返回 。HTTP 响应的状态代码。 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 仅执行请求和/或响应消息的的某些小处理操作的处理程序的基类型。 + + + 创建 类的实例。 + + + 创建特定内部处理程序的 类的实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 对发送到服务器的每个响应执行处理。 + 返回 。被处理的 HTTP 请求消息。 + 要处理的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 对来自服务器的每个响应执行处理。 + 返回 。已处理的 HTTP 响应消息。 + 要处理的 HTTP 响应消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 提供 对象的集合,其可通过使用多部分/* 内容类型规范序列化。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + + 为 null 或只包含空白字符。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + 多部分内容的边界字符串。 + 为 null 或空字符串。 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 添加多部分 HTTP 内容到 对象的集合,其可通过使用多部分/* 内容类型规范获取序列化。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 返回循环访问 对象的集合的枚举器,其可通过使用多部分/* 内容类型规范序列化。 + 返回 。一个可用于循环访问集合的对象。 + + + 以异步操作将多部分 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + + 方法的显式实现。 + 返回 。一个可用于循环访问集合的对象。 + + + 确定 HTTP 多部分内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HHTP 对象的长度。 + + + 提供容器,用于使用多部分/表格数据 MIME 类型编码的内容。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分窗体数据内容的边界字符串。 + + 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + + 为 null 或只包含空白字符。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + 要添加到集合中的 HTTP 内容的文件名。 + + 为 null 或只包含空白字符。- 或 - 为 null 或只包含空白字符。 + + 为 null。 + + + 基于流提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + 的缓冲区的大小(以字节为单位)。 + + 为 null。 + + 小于或等于零。 + + + 以异步操作将 HTTP 流内容写入内存流。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定流内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的流内容的长度。 + + + 基于字符串提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + 要用于该内容的媒体。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authneticate 和 Proxy-Authenticate 标头值中的验证信息。 + + + 初始化 类的新实例。 + 用于授权的架构。 + + + 初始化 类的新实例。 + 用于授权的架构。 + 包含请求资源的用户代理的身份验证消息的凭证。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取包含所请求资源的用户代理的身份验证信息的凭据。 + 返回 。凭证包含身份验证信息。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取用于身份验证的方案。 + 返回 。用于授权的架构。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Cache-Control 标头的值。 + + + 初始化 类的新实例。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 缓存扩展符,每个缓存扩展符都赋有可选值。 + 返回 。缓存扩展符的集合,每个缓存扩展符都赋有可选值。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + HTTP 客户端愿意接受以秒为指定单位的最大生存期。 + 返回 。以秒为单位的时间。 + + + HTTP 客户是否愿意接受已超过其过期时间的响应。 + 返回 。如果HTTP 客户愿意接受已超过过期时间的响应,则为 true;否则为 false。 + + + HTTP 客户端愿意接受的已超过其过期时间的响应的最长时间(以秒为单位)。 + 返回 。以秒为单位的时间。 + + + HTTP 客户端愿意接受以秒为单位响应的新鲜生命期。 + 返回 。以秒为单位的时间。 + + + 缓存项过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 客户是否愿意接受缓存响应。 + 返回 。如果 HTTP 客户愿意接受缓存响应,则为 true,否则为 false。 + + + HTTP 响应时缓存控制标头字段中“no-cache”指令中的 fieldnames 的集合。 + 返回 。fieldnames 的集合。 + + + 缓存是否不能存储 HTTP 请求 mressage 或任何响应的任何部件。 + 返回 。如果缓存不能存储 HTTP 请求 mressage 或任何响应的任何部件,则 true;否则,为 false。 + + + 缓存或代理项是否无法更改该个体主体的任何方面。 + 返回 。如果缓存或代理项无法更改该个体主体的任何方面,则 true;否则,为 false。 + + + 缓存是否应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态。 + 返回 。如果缓存应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态,则 true;否则,为 false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示缓存控制标头值信息。 + + 为 null 引用。 + + 是无效的缓存控制标头值信息。 + + + HTTP 响应消息的全部或部分是否适用于单个用户且不得由共享缓存进行缓存。 + 返回 。如果 HTTP 响应消息的全部或部分适用于单个用户和是否必须由共享缓存进行缓存,则为 true;否则为 false。 + + + HTTP 响应时缓存控制标头字段中“私有”指令的集合 fieldnames。 + 返回 。fieldnames 的集合。 + + + 缓存项对共享的用户代理缓存过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项对共享的用户代理缓存过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 响应是否可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存。 + 返回 。如果 HTTP 响应可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存,则为 true;否则为 false。 + + + 在一个 HTTP 响应中共享的最大年龄,指定每秒,该响应直接在用于缓存-控件标题或一个用于缓存的过期标题中重载了“最大年龄”。 + 返回 。以秒为单位的时间。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Disposition 标头的值。 + + + 初始化 类的新实例。 + + 。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 创建文件的日期。 + 返回 。文件生成日期。 + + + 内容正文部分的处置类型。 + 返回 。处置类型。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 当实体在一个单独的文件中分离和储存时,如何为储存要使用的消息负载构造一个文件名的建议。 + 返回 。建议的文件名。 + + + 当主体在单独的文件中分离和储存时,如何为储存要使用的消息负载构造文件名的建议。 + 返回 。窗体 filename* 的建议文件名。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 上次修改文件的日期。 + 返回 。文件修改日期。 + + + 一个内容主体部分的名称。 + 返回 。该内容主体部分的名称。 + + + 参数集包含 Content-Disposition 标头。 + 返回 。参数的集合。 + + + 将字符串转换为 实例。 + 返回 实例。 + 字符串表示内容处置标头值信息。 + + 为 null 引用。 + + 是无效的内容处置标头值信息。 + + + 上次读取文件的日期。 + 返回 。上次读取日期。 + + + 文件的近似大小(字节)。 + 返回 。近似大小,以字节为单位。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Range 标头的值。 + + + 初始化 类的新实例。 + 范围的开始点或结束点(以字节为单位)。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + 范围的开始点或结束点(以字节为单位)。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置,以字节为单位。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取 Content-Range 标头是否具有指定的长度。 + 返回 。true如果 Content-Range 具有指定的长度,否则false。 + + + 获取 Content-Range 是否具有指定的范围。 + 返回 。true如果 Content-Range 具有指定的范围,否则false。 + + + 获取完整实体正文的长度。 + 返回 。完整的实体正文的长度。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示内容范围标头值信息。 + + 为 null 引用。 + + 是无效的内容范围标头值信息。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 使用大小单位。 + 返回 。包含范围单元的 + + + 表示实体标记标头值。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 初始化 类的新实例。 + 包含 的字符串。 + 一个指示此实体标记标头是否为弱验证程序的值。如果实体标记标头为弱验证程序,则应将 设置为 true。如果实体标记标头为强验证程序,则应将 设置为 false。 + + + 获取实体标记标头值。 + 返回 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取实体标记是否由缺点指示符开头。 + 返回 。true 如果由缺点指示符开头获取实体标记,否则false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示实体标记标头值信息。 + + 为 null 引用。 + + 是无效的实体标记标头值信息。 + + + 获取不透明的带引号字符串。 + 返回 。一个不透明的带引号的字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 响应的 Allow 内容标题的值。 + 返回 。请求 HTTP 的 Allow 标题的值。 + + + 获取 HTTP 响应的 Content-Disposition 内容标题的值。 + 返回 。请求 HTTP 的 Content-Disposition 内容标题的值。 + + + 获取 HTTP 响应的 Content-Encoding 内容标题的值。 + 返回 。请求 HTTP 的 Content-Encoding 内容标题的值。 + + + 获取 HTTP 响应的 Content-Language 内容标题的值。 + 返回 。请求 HTTP 的 Content-Language 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Length 内容标头值。 + 返回 。请求 HTTP 的 Content-Length 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Location 内容标头值。 + 返回 。请求 HTTP 的 Content-Location 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-MD5 内容标头值。 + 返回 。请求 HTTP 的 Content-MD5 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Range 内容标头值。 + 返回 。请求 HTTP 的 Content-Range 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Type 内容标头值。 + 返回 。请求 HTTP 的 Content-Type 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Expires 内容标头值。 + 返回 。请求 HTTP 的 Expires 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Last-Modified 内容标头值。 + 返回 。请求 HTTP 的 Last-Modified 内容标题的值。 + + + 标头及其在 RFC 2616 中定义的值的集合。 + + + 初始化 类的新实例。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 要向集合中添加的标头值的列表。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 标头的内容。 + + + 集合中移除所有标头。 + + + 如果指定标头存在于 集合中,则返回。 + 返回 。如果集合中存在指定标头,则为 true;否则为 false。 + 指定的读取器。 + + + 返回可循环访问 实例的枚举数。 + 返回 的一个枚举数。 + + + 返回存储在 集合中所有指定标头的标头值。 + 返回 。标头字符串数组。 + 返回值所应用的指定读取器。 + + + 集合中移除指定的标头。 + 返回 + 要从集合中移除的标头名称。 + + + 获取一个枚举数,该枚举数可以循环访问 + 返回 (可循环访问 )的实现的实例。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的值。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的内容。 + + + 如果指定的标头和指定的值存储在 集合中则返回。 + 返回 。true 是指定的标头 ,并且 values 已存储在集合中;否则 false。 + 指定标头。 + 指定的标头值。 + + + 表示标头值的集合。 + 标头集合类型。 + + + 将某项添加到 中。 + 要添加到标头集合的项。 + + + 中移除所有项。 + + + 确定 是否包含项目。 + 返回 。如果项包含在 实例中,则为 true;否则为 false。 + 要在标头集合中查找的项。 + + + 从目标数组的指定索引处开始将整个 复制到兼容的一维 + 作为从 复制的元素的目标的一维 必须具有从零开始的索引。 + + 中从零开始的索引,从此索引处开始进行复制。 + + + 获取 中标题的数目。 + 返回 。集合中的标头数 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 获取一个值,该值指示 实例是否为只读。 + 返回 。如果 实例为只读,则为 true;否则为 false。 + + + 分析项并将其添加到 + 要添加的项。 + + + 中移除指定的项。 + 返回 。如果已从 实例中成功移除 ,则为 true;否则为 false。 + 要移除的项。 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定是否能分析输入并将其添加到 + 返回 。如果可以分析 且可以将其添加到 实例,则为 true;否则为 false。 + 要验证的项。 + + + 表示在 RFC 2616 中定义的“请求标题”的集合。 + + + 获取 HTTP 请求的 Accept 标头的值。 + 返回 。请求 HTTP 的 Accept 标题的值。 + + + 获取 HTTP 请求的 Accept-Charset 标头的值。 + 返回 。请求 HTTP 的 Accept-Charset 标题的值。 + + + 获取 HTTP 请求的 Accept-Encoding 标头的值。 + 返回 。请求 HTTP 的 Accept-Encoding 标题的值。 + + + 获取 HTTP 请求的 Accept-Language 标头的值。 + 返回 。请求 HTTP 的 Accept-Language 标题的值。 + + + 获取或设置 HTTP 请求的 Authorization 标头值。 + 返回 。请求 HTTP 的 Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 请求的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取 HTTP 请求的 Expect 标头的值。 + 返回 。请求 HTTP 的 Expect 标题的值。 + + + 获取或设置指示 HTTP 请求的 Expect 标头是否应包含 Continue 的值。 + 返回 。如果 Expect 标头包含继续,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 From 标头值。 + 返回 。请求 HTTP 的 From 标题的值。 + + + 获取或设置 HTTP 请求的 Host 标头值。 + 返回 。请求 HTTP 的 Host 标题的值。 + + + 获取 HTTP 请求的 If-Match 标头的值。 + 返回 。请求 HTTP 的 If-Match 标题的值。 + + + 获取或设置 HTTP 请求的 If-Modified-Since 标头值。 + 返回 。请求 HTTP 的 If-Modified-Since 标题的值。 + + + 获取 HTTP 请求的 If-None-Match 标头的值。 + 返回 。获取 HTTP 请求的 If-None-Match 标头的值。 + + + 获取或设置 HTTP 请求的 If-Range 标头值。 + 返回 。请求 HTTP 的 If-Range 标题的值。 + + + 获取或设置 HTTP 请求的 If-Unmodified-Since 标头值。 + 返回 。请求 HTTP 的 If-Unmodified-Since 标题的值。 + + + 获取或设置 HTTP 请求的 Max-Forwards 标头值。 + 返回 。请求 HTTP 的 Max-Forwards 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取或设置 HTTP 请求的 Proxy-Authorization 标头值。 + 返回 。请求 HTTP 的 Proxy-Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Range 标头值。 + 返回 。请求 HTTP 的 Range 标题的值。 + + + 获取或设置 HTTP 请求的 Referer 标头值。 + 返回 。请求 HTTP 的 Referer 标题的值。 + + + 获取 HTTP 请求的 TE 标头的值。 + 返回 。请求 HTTP 的 TE 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 请求的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 User-Agent 标头的值。 + 返回 。请求 HTTP 的 User-Agent 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 请求的 Accept-Ranges 标头的值。 + 返回 。请求 HTTP 的 Accept-Ranges 标题的值。 + + + 获取或设置 HTTP 响应的 Age 标头值。 + 返回 。请求 HTTP 的 Age 标题的值。 + + + 获取或设置 HTTP 响应的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 响应的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 响应的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取或设置 HTTP 响应的 ETag 标头值。 + 返回 。请求 HTTP 的 ETag 标题的值。 + + + 获取或设置 HTTP 响应的 Location 标头值。 + 返回 。请求 HTTP 的 Location 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取 HTTP 请求的 Proxy-Authenticate 标头的值。 + 返回 。请求 HTTP 的 Proxy-Authenticate 标题的值。 + + + 获取或设置 HTTP 响应的 Retry-After 标头值。 + 返回 。请求 HTTP 的 Retry-After 标题的值。 + + + 获取 HTTP 请求的 Server 标头的值。 + 返回 。请求 HTTP 的 Server 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 响应的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 Vary 标头的值。 + 返回 。请求 HTTP 的 Vary 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 获取 HTTP 请求的 WWW-Authenticate 标头的值。 + 返回 。请求 HTTP 的 WWW-Authenticate 标题的值。 + + + 表示使用 Content-Type 标头的在 RFC 2616 中定义的媒体类型。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个以用于初始化新实例的字符串的形式表示的源。 + + + 获得或设置字符的设置。 + 返回 。字符集。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取或设置媒体类型标头值。 + 返回 。媒体类型的标头值。 + + + 获取或设置媒体类型标头值参数。 + 返回 。媒体类型的标头值参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示媒体类型标头值信息。 + + 为 null 引用。 + + 是无效的媒体类型标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 Content-Type 标头中使用的具有额外质量因素的媒体类型。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + 与标头值关联的质量。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有质量标头值信息的媒体类型的字符串。 + + 为 null 引用。 + + 是带有质量标头值信息的无效媒体类型。 + + + 获取或设置 的质量值。 + 返回 对象的质量值。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示用于各种标头的在 RFC 2616 中定义的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取标题名称。 + 返回 。标头名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示名称值标头值信息。 + + 为 null 引用。 + + 是无效的名称值标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取标题值。 + 返回 。标头值。 + + + 表示用于各种标头的在 RFC 2616 中定义的具有参数的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 对象获取参数。 + 返回 。一个包含参数的集合。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有参数标头值信息的名称值的字符串。 + + 为 null 引用。 + + 带有参数标头值信息的无效名称值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 User-Agent 标头中的产品标记值。 + + + 初始化 类的新实例。 + 产品名称。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取产品标记的名称。 + 返回 。产品标记的名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取产品标记的版本。 + 返回 。产品标记的版本。 + + + 表示可以是 User-Agent 标头中的产品或注释的值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个注释值。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 获取 对象中的注释。 + 返回 。此 的注释值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品信息标头值信息。 + + 为 null 引用。 + + 是无效的产品信息标头值信息。 + + + 获取 对象中的产品。 + 返回 。此 中的产品值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示可以是日期/时间或实体标记值 If-Range 标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的数据值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个实体标记,它以用于初始化新实例的字符串的形式表示。 + + + 对象获取日期。 + 返回 对象中的日期。 + + + 对象获取实体标记。 + 返回 对象的实体标记。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件范围标头值信息。 + + 为 null 引用。 + + 是无效的范围条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Range 标头值。 + + + 初始化 类的新实例。 + + + 使用字节范围初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示范围标头值信息。 + + 为 null 引用。 + + 是无效的范围标头值信息。 + + + 获取 对象中的指定范围。 + 返回 对象中的范围。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取 对象中的单元。 + 返回 对象中的单元。 + + + 表示 Range 标头值中的字节范围。 + + + 初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 表示 Retry-After 标头值,它可以是日期/时间或时间跨度值。 + + + 初始化 类的新实例。 + 用于初始化新实例的日期和时间偏移量。 + + + 初始化 类的新实例。 + 用于初始化新实例的增量(以秒为单位)。 + + + 获取相对于 对象的日期和时间偏移量。 + 返回 。当前 对象中的日期和时间偏移量。 + + + 对象获取增量(以秒为单位)。 + 返回 对象中的增量(以秒为单位)。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件重试标头值信息。 + + 为 null 引用。 + + 是无效的重试条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示具有可选外质量的字符串标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 用于初始化新实例的质量因素。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示质量标头值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效字符串。 + + + 对象获取质量因子。 + 返回 对象中的质量因子。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 对象获取字符串值。 + 返回 对象中的字符串值。 + + + 表示接受编码标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取调用代码的参数。 + 返回 。转让代码的参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码标头值信息。 + + 为 null 引用。 + + 无效的传输编码标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取调用代码的值。 + 返回 。转换代码的值。 + + + 表示具有可选额外质量因素的 Accept-Encoding 标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 质量因素的一个值。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效传输代码。 + + + 获取质量因子。 + 返回 中的质量因子。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Via 标头的值。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + 用于标识收件人代理或网关的软件的注释字段。 + + + 获取用于确定收件人代理或网关的软件的注释字段。 + 返回 。用于标识收件人代理或网关的软件的注释字段。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。返回当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示 Via 标头值信息。 + + 为 null 引用。 + + 是无效的 Via 标头值信息。 + + + 获取接受协议的协议名称。 + 返回 。协议名称。 + + + 获取接受协议的协议版本。 + 返回 。协议版本。 + + + 获取通过其进行请求或接收响应的主机和端口。 + 返回 。通过其接收请求或响应的主机和端口。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示警告标题使用的警告值。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + 文件操作的日期/警告签章。 + + + 获取附加警告的主机。 + 返回 。附加警告的主机。 + + + 获取特定警告代码。 + 返回 。特定警告代码。 + + + 获取警告的日期/时间戳。 + 返回 。文件操作的日期/警告签章。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取包含该警告文本的引用字符串。 + 返回 。包含该警告文本的引用字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hant/a b/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hant/a new file mode 100644 index 00000000000..fd129a695c2 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netcore50/zh-hant/a @@ -0,0 +1,2368 @@ + + + + System.Net.Http + + + + 根據位元組陣列提供 HTTP 內容。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數為 null。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數中用來初始化 的位移 (以位元組為單位)。 + + 中的位元組數目(從用來初始化參數開始)。 + + 參數為 null。 + + 參數小於零。-或- 參數大於 參數指定的內容長度。-或- 參數小於零。-或- 參數大於 參數指定的內容長度,減去 參數。 + + + 建立 HTTP 內容資料流做為非同步讀取作業,其支援存放區是在 中的記憶體 + 傳回 。工作物件,表示非同步作業。 + + + 進行序列化,並以非同步方式將建構函式中提供的位元組陣列寫入到 HTTP 內容資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊,如通道繫結語彙基元。這個參數可以是 null。 + + + 判斷位元組陣列的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 位元組陣列的長度,以位元組為單位。 + + + 指定如何提供用戶端憑證。 + + + + 會嘗試自動提供所有可用的用戶端憑證。 + + + 應用程式會以手動方式提供用戶端憑證給 。這個值為預設值。 + + + HTTP 處理常式的類型,這些處理常式會將 HTTP 回應訊息的處理委派給另一個處理常式,也稱為內部處理常式。 + + + 建立 類別的新執行個體。 + + + 使用特定的內部處理常式,建立 類別的新執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理 HTTP 回應訊息的內部處理常式。 + 傳回 。HTTP 回應訊息的內部處理常式。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 使用 application/x-www-form-urlencoded MIME 類型編碼之名稱/值 Tuple 的容器。 + + + 使用特定名稱/值組集合,初始化 類別的新執行個體。 + 名稱/值組的集合。 + + + 提供基底類別,用來傳送 HTTP 要求,以及從 URI 所識別的資源接收 HTTP 回應。 + + + 初始化 類別的新執行個體。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 要用來傳送要求的 HTTP 處理常式堆疊。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 取得或設定傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + 傳回 。傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + + + 取消這個執行個體上的所有暫止要求。 + + + 取得應該在每個要求中傳送的標頭。 + 傳回 。應該藉由每個要求傳送的標頭。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true 表示會同時釋放 Managed 和 Unmanaged 資源;false 則表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 取得或設定讀取回應內容時要緩衝處理的位元組數目上限。 + 傳回 。讀取回應內容時要緩衝處理的位元組數目上限。此屬性的預設值是 2 GB。 + 指定的大小小於或等於零。 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 取得或設定要求逾時前等候的時間長度。 + 傳回 。要求逾時前等候的時間長度。 + 指定的逾時小於或等於零,並且不是 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + + 所使用的預設訊息處理常式。 + + + 建立 類別的執行個體。 + + + 取得或設定值,指出處理常式是否應該緊接在重新導向回應之後。 + 傳回 。如果處理常式應該接在重新導向回應之後,則為 true,否則為 false。預設值是 true。 + + + 取得或設定處理常式用來自動解壓縮 HTTP 內容回應的解壓縮方法型別。 + 傳回 。處理常式所使用的自動解壓縮方法。預設值是 + + + 取得或設定與這個處理常式相關聯的安全憑證集合。 + 傳回 。與這個處理常式相關聯的安全憑證的集合。 + + + 取得或設定處理常式用來儲存伺服器 cookie 的 cookie 容器。 + 傳回 。處理常式用來儲存伺服器 cookie 的 cookie 容器。 + + + 取得或設定這個處理常式所使用的驗證資訊。 + 傳回 。與處理常式相關聯的驗證認證。預設值為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理常式追蹤的最大重新導向數目。 + 傳回 。處理常式追蹤的最大重新導向回應數目。預設值為 50。 + + + 取得或設定處理常式所使用的要求內容緩衝區大小上限。 + 傳回 。要求內容緩衝區的大小上限,以位元組為單位。預設值為 2 GB。 + + + 取得或設定值,指出處理常式是否隨要求傳送授權標頭。 + 傳回 。true 表示在進行驗證後,處理常式隨同要求傳送 HTTP 驗證標頭,否則為 false。預設值為 false。 + + + 取得或設定處理常式使用的 Proxy 資訊。 + 傳回 。處理常式所使用的 proxy 資訊。預設值是 null。 + + + 根據 中提供的資訊,建立 的執行個體成為不會封鎖的作業。 + 傳回 。工作物件,表示非同步作業。 + HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 取得值,指出處理常式是否支援自動回應內容解壓縮。 + 傳回 。如果處理常式支援自動回應內容解壓縮,則為 true,否則為 false。預設值是 true。 + + + 取得值,指出處理常式是否支援 Proxy 設定。 + 傳回 。如果處理常式支援 Proxy 設定,則為 true,否則為 false。預設值是 true。 + + + 取得值,這個值指出處理常式是否支援 屬性的組態設定。 + 傳回 。如果處理常式支援 屬性的組態設定,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,指出處理常式是否使用 屬性,以儲存伺服器 cookie,並在傳送要求時使用這些 cookie。 + 傳回 。如果處理常式支援使用 屬性儲存伺服器 cookie,並在傳送要求時使用這些 cookie,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,該值會控制是否隨著處理常式的要求傳送預設認證。 + 傳回 。如果使用預設認證則為 true,否則為 false。預設值是 false。 + + + 取得或設定值,指出處理常式是否對要求使用 Proxy。 + 傳回 。如果處理常式應該使用 proxy 來處理要求,則為 true,否則為 false。預設值是 true。 + + + 表示 作業應該在取得回應之後立即視為已完成,或在讀取整個回應訊息 (包括內容) 之後視為已完成。 + + + 在讀取包括內容的完整回應之後,操作應該完成。 + + + 一旦回應可使用而標頭也已讀取後,就應完成作業。尚未讀取內容。 + + + 基底類別,表示 HTTP 實體內容與內容標題。 + + + 初始化 類別的新執行個體。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 內容標頭,如 RFC 2616 中所定義。 + 傳回 。RFC 2616 中所定義的標頭。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + 要使用的緩衝區的大小上限,以位元組為單位。 + + + 以非同步作業的方式將 HTTP 內容寫入至位元組陣列。 + 傳回 。工作物件,表示非同步作業。 + + + 將 HTTP 內容序列化,並以非同步作業的方式傳回表示內容的資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至字串。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷 HTTP 內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HTTP 內容的長度,以位元組為單位。 + + + HTTP 訊息處理常式的基底型別。 + + + 初始化 類別的新執行個體。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 特定類別,允許應用程式呼叫 HTTP 處理常式鏈結的 方法。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 協助程式類別,用於擷取和比較標準 HTTP 方法,以及建立新的 HTTP 方法。 + + + 使用特定 HTTP 方法,初始化 類別的新執行個體。 + HTTP 方法。 + + + 表示 HTTP DELETE 通訊協定方法。 + 傳回 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前專案比較的 HTTP 方法。 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 表示 HTTP GET 通訊協定方法。 + 傳回 + + + 做為此型別的雜湊函式。 + 傳回 。目前 的雜湊程式碼。 + + + 表示 HTTP HEAD 通訊協定方法。HEAD 方法與 GET 相同,除了伺服器只在回應中傳回訊息標頭,不含訊息主體。 + 傳回 + + + HTTP 方法。 + 傳回 。以 形式表示的 HTTP 方法。 + + + 等號比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數相等,則為 true,否則為 false。 + 等號比較運算子左邊的 。 + 等號比較運算子右邊的 。 + + + 不等比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數不相等,則為 true,否則為 false。 + 不等比較運算子左邊的 。 + 不等比較運算子右邊的 。 + + + 表示 HTTP OPTIONS 通訊協定方法。 + 傳回 + + + 表示 HTTP POST 通訊協定方法,用來公佈新實體至 URI 做為新增項目。 + 傳回 + + + 表示 HTTP PUT 通訊協定方法,用來取代 URI 所識別的實體。 + 傳回 + + + 傳回表示目前物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 HTTP TRACE 通訊協定方法。 + 傳回 + + + + 類別所擲回之例外狀況的基底類別。 + + + 初始化 類別的新執行個體。 + + + 使用描述目前例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + + + 使用描述目前例外狀況和內部例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + 內部例外狀況。 + + + 表示 HTTP 要求訊息。 + + + 初始化 類別的新執行個體。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 字串,表示要求 。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 要求的 。 + + + 取得或設定 HTTP 訊息的內容。 + 傳回 。訊息內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 要求標頭的集合。 + 傳回 。HTTP 要求標頭的集合。 + + + 取得或設定 HTTP 要求訊息所使用的 HTTP 方法。 + 傳回 。要求訊息所使用的 HTTP 方法。預設為 GET 方法。 + + + 取得 HTTP 要求的屬性集。 + 傳回 + + + 取得或設定用於 HTTP 要求的 + 傳回 。用於 HTTP 要求的 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 表示包含狀態碼及資料的 HTTP 回應訊息。 + + + 初始化 類別的新執行個體。 + + + 使用特定 ,初始化 類別的新執行個體。 + HTTP 回應的狀態碼。 + + + 取得或設定 HTTP 回應訊息的內容。 + 傳回 。HTTP 回應訊息的內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Unmanaged 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 如果 HTTP 回應的 屬性為 false,會擲回例外狀況。 + 傳回 。HTTP 回應訊息(如果該呼叫成功)。 + + + 取得 HTTP 回應標頭的集合。 + 傳回 。HTTP 回應標頭的集合。 + + + 取得值,指出 HTTP 回應是否成功。 + 傳回 。表示 HTTP 回應是否成功的值。如果 在範圍 200-299 中,則為 true,否則為 false。 + + + 取得或設定原因片語,通常由伺服器將它與狀態碼一起傳送。 + 傳回 。伺服器所傳送之原因詞彙。 + + + 取得或設定造成此回應訊息的要求訊息。 + 傳回 。造成此回應訊息的要求訊息。 + + + 取得或設定 HTTP 回應的狀態碼。 + 傳回 。HTTP 回應的狀態碼。 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 處理常式的基底型別,這些處理常式僅對要求和 (或) 回應訊息執行一些小型處理。 + + + 建立 類別的執行個體。 + + + 使用特定的內部處理常式,建立 類別的執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 執行對傳送至伺服器之每個要求的處理。 + 傳回 。處理的 HTTP 要求訊息。 + 要處理的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 執行對伺服器每個回應的處理。 + 傳回 。已處理的 HTTP 回應訊息。 + 要處理的 HTTP 回應訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + 為 null。 + + + 提供使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + + 為 null 或僅包含空白字元。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + 多重內容的界限字串。 + + 為 null,或是空字串。 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將多重部分 HTTP 內容加入至使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 傳回列舉程式,此列舉程式可以逐一查看 物件的集合,該集合會使用多重/* 內容型別規格進行序烈化。 + 傳回 。用於逐一查看集合的物件。 + + + 以非同步作業方式將多個 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + + 方法的明確實作。 + 傳回 。用於逐一查看集合的物件。 + + + 判斷 HTTP 多部分內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HHTP 內容的長度,以位元組為單位。 + + + 提供使用多重/表單資料 MIME 類型編碼內容的容器。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多重表單資料內容的界限字串。 + + 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + + 為 null 或僅包含空白字元。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + 要加入至集合中的 HTTP 內容的檔案名稱。 + + 為 null 或僅包含空白字元。-或- 為 null 或僅包含空白字元。 + + 為 null。 + + + 根據資料流提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + 的緩衝區大小,以位元組為單位。 + + 為 null。 + + 小於或等於零值。 + + + 將 HTTP 資料流內容寫入至記憶體資料流,做為非同步作業。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷資料流內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 資料流內容的長度,以位元組為單位。 + + + 根據字串提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + 要用於內容的媒體類型。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authenticate 和 Proxy 驗證標頭值中的驗證資訊。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + 認證,包含所要求資源的使用者代理程式驗證資訊。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得認證,包含所要求資源的使用者代理程式驗證資訊。 + 傳回 。包含驗證資訊的認證。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得用於授權的配置。 + 傳回 。用於授權的配置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Cache-Control標頭的值。 + + + 初始化 類別的新執行個體。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 快取擴充權杖,其中每個權杖都有選擇性指派的值。 + 傳回 。快取擴充語彙基元的集合,其中每個語彙基元都有選擇性指派的值。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + HTTP 用戶端願意接受回應的最長保留期限(以秒為單位來指定)。 + 傳回 。秒數。 + + + 否 HTTP 用戶端願意接受已經超過其到期時間的回應。 + 傳回 。如果 HTTP 用戶端願意接受已經超過到期時間的回應,則為 true,否則為 false。 + + + HTTP 用戶端願意接受已經超過其到期時間的回應的最長時間(以秒為單位)。 + 傳回 。秒數。 + + + HTTP 用戶端願意接受回應的有效期限存留期(以秒為單位)。 + 傳回 。秒數。 + + + 當快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 用戶端願意接受快取的回應。 + 傳回 。如果 HTTP 用戶端願意接受快取的回應,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "no-cache" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 是否快取絕不可以儲存 HTTP 要求訊息或任何回應的任何組成部分。 + 傳回 。如果快取中不能儲存 HTTP 要求訊息或任何回應的任何組成部分,則為 true,否則為false。 + + + 是否快取或 Proxy 絕不可以變更實體主體的任何層面。 + 傳回 。如果快取或 Proxy 絕不可以變更實體主體的任何層面,則為 true,否則為false。 + + + 是否快取應該使用符合 HTTP 要求的其他約束條件的快取項目來回應,或是以 504 (閘道逾時) 狀態來回應。 + 傳回 。如果快取必須使用符合 HTTP 要求的其他條件約束之已快取項目來做回應,或使用 504 (Gateway Timeout) 狀態做回應,則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示快取控制項標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的快取控制標頭值資訊。 + + + 是否整個或部分的 HTTP 回應訊息僅供單一使用者使用,或絕不可由共用快取來快取。 + 傳回 。如果 HTTP 回應訊息僅供單一使用者使用,而且不可由共用快取來快取,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "private" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 當共用使用者代理快取的快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當共用使用者代理快取的快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取。 + 傳回 。如果 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取,則為 true,否則為 false。 + + + HTTP 回應中的共用最長使用期限(以秒為單位),會覆蓋快取控制標頭或共用快取的到期日標頭中的 "max-age" 指示詞。 + 傳回 。秒數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Disposition 標頭的值。 + + + 初始化 類別的新執行個體。 + + 。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 建立檔案的日期。 + 傳回 。檔案建立日期。 + + + 內容內文部分的配置類型。 + 傳回 。配置類型。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。建議的檔案名稱。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。表單檔案名稱的建議檔案名稱*。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 上次修改檔案的日期。 + 傳回 。檔案修改日期。 + + + 內容主體組件的名稱。 + 傳回 。內容主體組件的名稱。 + + + 一組包含 Content-Disposition 標頭的參數。 + 傳回 。參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容配置標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容配置標頭值資訊。 + + + 上次讀取檔案的日期。 + 傳回 。上次讀取日期。 + + + 檔案的約略大小大小,以位元組為單位。 + 傳回 。約略大小,以位元組為單位。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Range 標頭的值。 + + + 初始化 類別的新執行個體。 + 範圍的起始和結束點 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + 範圍的起始和結束點 (以位元組表示)。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置 (以位元組表示)。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得 Content-Range 標頭是否有指定的長度。 + 傳回 。如果 Content-Range 有指定長度則為 true,否則為 false。 + + + 取得 Content-Range 是否有指定的範圍。 + 傳回 。如果 Content-Range 有指定範圍則為 true,否則為 false。 + + + 取得完整實體內容的長度。 + 傳回 。完整實體內容的長度。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容範圍標頭值資訊。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 使用的範圍單位。 + 傳回 。包含範圍單位的 + + + 表示實體標記標頭值。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + 表示這個實體標記標頭是否為弱式驗證程式的值。如果實體標記標頭是弱式驗證程式,則應該將 設定為 true。如果實體標記標頭是強式驗證程式,則應該將 設定為 false。 + + + 取得實體標記標頭值。 + 傳回 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得實體標記的前端是否有弱點指標。 + 傳回 。如果實體標記有弱式指標做為開頭則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示實體標記標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的實體標記標頭值資訊。 + + + 取得不透明的引號括住的字串。 + 傳回 。不透明的引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示內容標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Allow 內容標頭的值。 + 傳回 。HTTP 回應的 Allow 標頭的值。 + + + 取得 HTTP 回應的 Content-Disposition 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Disposition 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Encoding 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Encoding 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Language 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Language 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Length 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Length 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Location 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Location 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-MD5 內容標頭的值。 + 傳回 。HTTP 回應的 Content-MD5 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Range 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Range 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Type 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Type 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Expires 內容標頭的值。 + 傳回 。HTTP 回應的 Expires 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Last-Modified 內容標頭的值。 + 傳回 。HTTP 回應的 Last-Modified 內容標頭的值。 + + + 標頭及其值的集合,如 RFC 2616 中所定義的。 + + + 初始化 類別的新執行個體。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 要加入至集合的標頭值清單。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 移除 集合中的所有標頭。 + + + 傳回 集合中是否有特定標頭。 + 傳回 。true 為指定的標頭存在於集合中,否則為 false。 + 特定的標頭。 + + + 傳回可以逐一查看 執行個體的列舉值。 + 傳回 的列舉值。 + + + 傳回儲存在 集合中的指定標頭的所有標頭值。 + 傳回 。標頭字串的陣列。 + 要為其傳回值的指定標頭。 + + + 集合中移除指定的標頭。 + 傳回 + 要從集合中移除的標頭名稱。 + + + 傳回可以逐一查看 的列舉程式。 + 傳回 。可以逐一查看 實作執行個體。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的值。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 傳回指定的標頭和指定的值是否儲存在集合中。 + 傳回 。如果指定的標頭 和 values 儲存在集合中,則為 true,否則為 false。 + 指定的標頭。 + 指定的標頭值。 + + + 表示標頭值的集合。 + 標頭集合類型。 + + + 將項目加入至 + 要加入至標頭集合中的項目。 + + + 移除 的所有項目。 + + + 判斷 是否包含項目。 + 傳回 。如果 執行個體中包含項目,則為 true,否則為 false。 + 要在標頭集合中尋找的項目。 + + + 從目標陣列的指定索引開始,複製整個 至相容的一維 + 一維 ,是從 複製過來之項目的目的端。 必須有以零起始的索引。 + + 中以零起始的索引,是複製開始的位置。 + + + 取得 中的標頭數目。 + 傳回 。集合中的標頭數。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 取得值,該值指出 執行個體是否唯讀。 + 傳回 。如果 執行個體是唯讀,則為 true,否則為 false。 + + + 剖析項目並將其加入至 + 要加入的項目。 + + + 中移除指定項目。 + 傳回 。如果 已成功從 執行個體中移除,則為 true,否則為 false。 + 要移除的項目。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷輸入是否可加以剖析並加入至 + 傳回 。如果可以剖析 並將其加入至 執行個體則為 true,否則為 false + 要驗證的項目。 + + + 表示要求標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 要求的 Accept 標頭值。 + 傳回 。HTTP 要求的 Accept 標頭的值。 + + + 取得 HTTP 要求的 Accept-Charset 標頭值。 + 傳回 。HTTP 要求的 Accept-Charset 標頭的值。 + + + 取得 HTTP 要求的 Accept-Encoding 標頭值。 + 傳回 。HTTP 要求的 Accept-Encoding 標頭的值。 + + + 取得 HTTP 要求的 Accept-Language 標頭值。 + 傳回 。HTTP 要求的 Accept-Language 標頭的值。 + + + 取得或設定 HTTP 要求之 Authorization 標頭的值。 + 傳回 。HTTP 要求的 Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Cache-Control 標頭的值。 + 傳回 。HTTP 要求的 Cache-Control 標頭的值。 + + + 取得 HTTP 要求的 Connection 標頭值。 + 傳回 。HTTP 要求的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 Date 標頭的值。 + 傳回 。HTTP 要求的 Date 標頭的值。 + + + 取得 HTTP 要求的 Expect 標頭值。 + 傳回 。HTTP 要求的 Expect 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Expect 標頭是否包含 Continue。 + 傳回 。如果 Expect 標頭包含 Continue 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 From 標頭的值。 + 傳回 。HTTP 要求的 From 標頭的值。 + + + 取得或設定 HTTP 要求之 Host 標頭的值。 + 傳回 。HTTP 要求的 Host 標頭的值。 + + + 取得 HTTP 要求的 If-Match 標頭值。 + 傳回 。HTTP 要求的 If-Match 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Modified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Modified-Since 標頭的值。 + + + 取得 HTTP 要求的 If-None-Match 標頭值。 + 傳回 。取得 HTTP 要求的 If-None-Match 標頭值。 + + + 取得或設定 HTTP 要求之 If-Range 標頭的值。 + 傳回 。HTTP 要求的 If-Range 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Unmodified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Unmodified-Since 標頭的值。 + + + 取得或設定 HTTP 要求之 Max-Forwards 標頭的值。 + 傳回 。HTTP 要求的 Max-Forwards 標頭的值。 + + + 取得 HTTP 要求的 Pragma 標頭值。 + 傳回 。HTTP 要求的 Pragma 標頭的值。 + + + 取得或設定 HTTP 要求之 Proxy-Authorization 標頭的值。 + 傳回 。HTTP 要求的 Proxy-Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Range 標頭的值。 + 傳回 。HTTP 要求的 Range 標頭的值。 + + + 取得或設定 HTTP 要求之 Referer 標頭的值。 + 傳回 。HTTP 要求的 Referer 標頭的值。 + + + 取得 HTTP 要求的 TE 標頭值。 + 傳回 。HTTP 要求的 TE 標頭的值。 + + + 取得 HTTP 要求的 Trailer 標頭值。 + 傳回 。HTTP 要求的 Trailer 標頭的值。 + + + 取得 HTTP 要求的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 要求的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 要求的 Upgrade 標頭值。 + 傳回 。HTTP 要求的 Upgrade 標頭的值。 + + + 取得 HTTP 要求的 User-Agent 標頭值。 + 傳回 。HTTP 要求的 User-Agent 標頭的值。 + + + 取得 HTTP 要求的 Via 標頭值。 + 傳回 。HTTP 要求的 Via 標頭的值。 + + + 取得 HTTP 要求的 Warning 標頭值。 + 傳回 。HTTP 要求的 Warning 標頭的值。 + + + 表示回應標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Accept-Ranges 標頭值。 + 傳回 。HTTP 回應的 Accept-Ranges 標頭的值。 + + + 取得或設定 HTTP 回應之 Age 標頭的值。 + 傳回 。HTTP 回應的 Age 標頭的值。 + + + 取得或設定 HTTP 回應之 Cache-Control 標頭的值。 + 傳回 。HTTP 回應的 Cache-Control 標頭的值。 + + + 取得 HTTP 回應的 Connection 標頭值。 + 傳回 。HTTP 回應的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 回應之 Date 標頭的值。 + 傳回 。HTTP 回應的 Date 標頭的值。 + + + 取得或設定 HTTP 回應之 ETag 標頭的值。 + 傳回 。HTTP 回應的 ETag 標頭的值。 + + + 取得或設定 HTTP 回應之 Location 標頭的值。 + 傳回 。HTTP 回應的 Location 標頭的值。 + + + 取得 HTTP 回應的 Pragma 標頭值。 + 傳回 。HTTP 回應的 Pragma 標頭的值。 + + + 取得 HTTP 回應的 Proxy-Authenticate 標頭值。 + 傳回 。HTTP 回應的 Proxy-Authenticate 標頭的值。 + + + 取得或設定 HTTP 回應之 Retry-After 標頭的值。 + 傳回 。HTTP 回應的 Retry-After 標頭的值。 + + + 取得 HTTP 回應的 Server 標頭值。 + 傳回 。HTTP 回應的 Server 標頭的值。 + + + 取得 HTTP 回應的 Trailer 標頭值。 + 傳回 。HTTP 回應的 Trailer 標頭的值。 + + + 取得 HTTP 回應的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 回應的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 回應的 Upgrade 標頭值。 + 傳回 。HTTP 回應的 Upgrade 標頭的值。 + + + 取得 HTTP 回應的 Vary 標頭值。 + 傳回 。HTTP 回應的 Vary 標頭的值。 + + + 取得 HTTP 回應的 Via 標頭值。 + 傳回 。HTTP 回應的 Via 標頭的值。 + + + 取得 HTTP 回應的 Warning 標頭值。 + 傳回 。HTTP 回應的 Warning 標頭的值。 + + + 取得 HTTP 回應的 WWW-Authenticate 標頭值。 + 傳回 。HTTP 回應的 WWW-Authenticate 標頭的值。 + + + 表示用於依 RFC 2616 所定義之內容類型標頭的媒體類型。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 表示為字串以初始化新執行個體的來源。 + + + 取得或設定字元集。 + 傳回 。字元集。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得或設定媒體型別標頭值。 + 傳回 。媒體類型標頭值。 + + + 取得或設定媒體類型標頭值參數。 + 傳回 。媒體類型標頭值參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的媒體類型標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示具有用於內容類型標頭之其他品質係數的媒體類型。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + 與這個標頭值相關聯的品質。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型的字串,含有品質標頭值資訊。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效媒體類型。 + + + 取得或設定 的品質值。 + 傳回 物件的品質值。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得標頭名稱。 + 傳回 。標頭名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的名稱值標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得標頭值。 + 傳回 。標頭值。 + + + 表示搭配參數用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 物件取得參數。 + 傳回 。包含參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值的字串,含有參數標頭值資訊。 + + 為 null 參考。 + + 不是具有參數標頭值資訊的有效名稱值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示使用者代理程式標頭中的產品語彙基元值。 + + + 初始化 類別的新執行個體。 + 產品名稱。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得產品語彙基元的名稱。 + 傳回 。產品語彙基元的名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品標頭值資訊的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得產品語彙基元的版本。 + 傳回 。產品語彙基元的版本。 + + + 代表一個值,它可以是 User-Agent 標頭中的一項產品或註解。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 註解值。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 物件取得註解。 + 傳回 。這個 的註解值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品資訊標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的產品資訊標頭值資訊。 + + + 物件取得產品。 + 傳回 。這個 中的產品值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 If-Range 標頭值,它可以是日期/時間或是實體標記值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 實體標記,表示為用來初始化新執行個體的字串。 + + + 物件取得日期。 + 傳回 物件中的日期。 + + + 物件取得實體標記。 + 傳回 物件中的實體標記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Range 標頭值。 + + + 初始化 類別的新執行個體。 + + + 使用位元組範圍初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍標頭值資訊。 + + + 物件中取得指定的範圍。 + 傳回 物件提供的範圍。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得單位。 + 傳回 物件中的單位。 + + + 表示 Range 標頭值中的位元組範圍。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 Retry-After 標頭值,它可以是日期/時間或是 timespan 值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期及時間位移。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的差異,以秒為單位。 + + + 取得與 物件相差的日期及時間。 + 傳回 。與 物件相差的日期及時間。 + + + 物件取得差異,以秒為單位。 + 傳回 物件中的差異,以秒為單位。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示重試條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的重試條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示含選擇性品質的字串標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 用來初始化新執行個體的品質因素。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示品質標頭值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效字串。 + + + 物件取得品質係數。 + 傳回 物件中的品質係數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得字串值。 + 傳回 。取自 物件的字串值。 + + + 表示 accept-encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得傳輸編碼參數。 + 傳回 。傳輸編碼參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的傳輸編碼標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得傳輸編碼值。 + 傳回 。傳輸編碼值。 + + + 表示含選擇性品質係數的 Accept-Encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 品質係數的值。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效傳輸編碼。 + + + 取得品質係數。 + 傳回 中的品質係數。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Via 標頭的值。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + 用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 取得用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + 傳回 。用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 判斷指定的 是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。傳回目前物件的雜湊程式碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示 via 標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的 via 標頭值資訊。 + + + 取得接收的通訊協定的通訊協定名稱。 + 傳回 。通訊協定名稱。 + + + 取得接收的通訊協定的通訊協定版本。 + 傳回 。通訊協定版本。 + + + 取得收到要求或回應的主機和連接埠。 + 傳回 。已收到要求或回應的主機及連接埠。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示警告標頭所用的警告值。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + 警告的日期/時間戳記。 + + + 取得已附加警告的主機。 + 傳回 。已附加警告的主機。 + + + 取得特定警告碼。 + 傳回 。特定警告碼。 + + + 取得警告的日期/時間戳記。 + 傳回 。警告的日期/時間戳記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得包含警告文字的以引號括住的字串。 + 傳回 。含有警告文字的以引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/a new file mode 100644 index 00000000000..734d536358a Binary files /dev/null and b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/a differ diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/b b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/b new file mode 100644 index 00000000000..7b4e5b6a5e4 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/b @@ -0,0 +1,2306 @@ + + + + System.Net.Http + + + + Provides HTTP content based on a byte array. + + + Initializes a new instance of the class. + The content used to initialize the . + The parameter is null. + + + Initializes a new instance of the class. + The content used to initialize the . + The offset, in bytes, in the parameter used to initialize the . + The number of bytes in the starting from the parameter used to initialize the . + The parameter is null. + The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter.-or-The parameter is less than zero.-or-The parameter is greater than the length of content specified by the parameter - minus the parameter. + + + Creates an HTTP content stream as an asynchronous operation for reading whose backing store is memory from the . + Returns .The task object representing the asynchronous operation. + + + Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The target stream. + Information about the transport, like channel binding token. This parameter may be null. + + + Determines whether a byte array has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the byte array. + + + Specifies how client certificates are provided. + + + The will attempt to provide all available client certificates automatically. + + + The application manually provides the client certificates to the . This value is the default. + + + A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler. + + + Creates a new instance of the class. + + + Creates a new instance of the class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Releases the unmanaged resources used by the , and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the inner handler which processes the HTTP response messages. + Returns .The inner handler for HTTP response messages. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns . The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token to cancel operation. + The was null. + + + A container for name/value tuples encoded using application/x-www-form-urlencoded MIME type. + + + Initializes a new instance of the class with a specific collection of name/value pairs. + A collection of name/value pairs. + + + Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific handler. + The HTTP handler stack to use for sending requests. + + + Initializes a new instance of the class with a specific handler. + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + Returns .The base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. + + + Cancel all pending requests on this instance. + + + Gets the headers which should be sent with each request. + Returns .The headers which should be sent with each request. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + The request message was already sent by the instance. + + + Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + The request message was already sent by the instance. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns . + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + The was null. + + + Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + An HTTP completion option value that indicates when the operation should be considered completed. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The was null. + + + Gets or sets the maximum number of bytes to buffer when reading the response content. + Returns .The maximum number of bytes to buffer when reading the response content. The default value for this property is 2 gigabytes. + The size specified is less than or equal to zero. + An operation has already been started on the current instance. + The current instance has been disposed. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a POST request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a POST request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send a PUT request to the specified Uri as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + The was null. + + + Send a PUT request with a cancellation token as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The Uri the request is sent to. + The HTTP request content sent to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + When the operation should complete (as soon as a response is available or after reading the whole response content). + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + The request message was already sent by the instance. + + + Gets or sets the timespan to wait before the request times out. + Returns .The timespan to wait before the request times out. + The timeout specified is less than or equal to zero and is not . + An operation has already been started on the current instance. + The current instance has been disposed. + + + The default message handler used by . + + + Creates an instance of a class. + + + Gets or sets a value that indicates whether the handler should follow redirection responses. + Returns .true if the if the handler should follow redirection responses; otherwise false. The default value is true. + + + Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response. + Returns .The automatic decompression method used by the handler. The default value is . + + + Gets or sets the collection of security certificates that are associated with this handler. + Returns .The collection of security certificates associated with this handler. + + + Gets or sets the cookie container used to store server cookies by the handler. + Returns .The cookie container used to store server cookies by the handler. + + + Gets or sets authentication information used by this handler. + Returns .The authentication credentials associated with the handler. The default is null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets or sets the maximum number of redirects that the handler follows. + Returns .The maximum number of redirection responses that the handler follows. The default value is 50. + + + Gets or sets the maximum request content buffer size used by the handler. + Returns .The maximum request content buffer size in bytes. The default value is 2 gigabytes. + + + Gets or sets a value that indicates whether the handler sends an Authorization header with the request. + Returns .true for the handler to send an HTTP Authorization header with requests after authentication has taken place; otherwise, false. The default is false. + + + Gets or sets proxy information used by the handler. + Returns .The proxy information used by the handler. The default value is null. + + + Creates an instance of based on the information provided in the as an operation that will not block. + Returns .The task object representing the asynchronous operation. + The HTTP request message. + A cancellation token to cancel the operation. + The was null. + + + Gets a value that indicates whether the handler supports automatic response content decompression. + Returns .true if the if the handler supports automatic response content decompression; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports proxy settings. + Returns .true if the if the handler supports proxy settings; otherwise false. The default value is true. + + + Gets a value that indicates whether the handler supports configuration settings for the and properties. + Returns .true if the if the handler supports configuration settings for the and properties; otherwise false. The default value is true. + + + Gets or sets a value that indicates whether the handler uses the property to store server cookies and uses these cookies when sending requests. + Returns .true if the if the handler supports uses the property to store server cookies and uses these cookies when sending requests; otherwise false. The default value is true. + + + Gets or sets a value that controls whether default credentials are sent with requests by the handler. + Returns .true if the default credentials are used; otherwise false. The default value is false. + + + Gets or sets a value that indicates whether the handler uses a proxy for requests. + Returns .true if the handler should use a proxy for requests; otherwise false. The default value is true. + + + Indicates if operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content. + + + The operation should complete after reading the entire response including the content. + + + The operation should complete as soon as a response is available and headers are read. The content is not read yet. + + + A base class representing an HTTP entity body and content headers. + + + Initializes a new instance of the class. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + + + Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the parameter. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Serialize the HTTP content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the HTTP content headers as defined in RFC 2616. + Returns .The content headers as defined in RFC 2616. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a memory buffer as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The maximum size, in bytes, of the buffer to use. + + + Serialize the HTTP content to a byte array as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content and return a stream that represents the content as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a string as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the HTTP content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HTTP content. + + + A base type for HTTP message handlers. + + + Initializes a new instance of the class. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A specialty class that allows applications to call the method on an Http handler chain. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + + + Initializes an instance of a class with a specific . + The responsible for processing the HTTP response messages. + true if the inner handler should be disposed of by Dispose(),false if you intend to reuse the inner handler. + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Send an HTTP request as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + The was null. + + + A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods. + + + Initializes a new instance of the class with a specific HTTP method. + The HTTP method. + + + Represents an HTTP DELETE protocol method. + Returns . + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The HTTP method to compare with the current object. + + + Determines whether the specified is equal to the current . + Returns .true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Represents an HTTP GET protocol method. + Returns . + + + Serves as a hash function for this type. + Returns .A hash code for the current . + + + Represents an HTTP HEAD protocol method. The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. + Returns . + + + An HTTP method. + Returns .An HTTP method represented as a . + + + The equality operator for comparing two objects. + Returns .true if the specified and parameters are equal; otherwise, false. + The left to an equality operator. + The right to an equality operator. + + + The inequality operator for comparing two objects. + Returns .true if the specified and parameters are inequal; otherwise, false. + The left to an inequality operator. + The right to an inequality operator. + + + Represents an HTTP OPTIONS protocol method. + Returns . + + + Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI. + Returns . + + + Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI. + Returns . + + + Returns a string that represents the current object. + Returns .A string representing the current object. + + + Represents an HTTP TRACE protocol method. + Returns . + + + A base class for exceptions thrown by the and classes. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific message that describes the current exception. + A message that describes the current exception. + + + Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. + A message that describes the current exception. + The inner exception. + + + Represents a HTTP request message. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + A string that represents the request . + + + Initializes a new instance of the class with an HTTP method and a request . + The HTTP method. + The to request. + + + Gets or sets the contents of the HTTP message. + Returns .The content of a message + + + Releases the unmanaged resources and disposes of the managed resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Gets the collection of HTTP request headers. + Returns .The collection of HTTP request headers. + + + Gets or sets the HTTP method used by the HTTP request message. + Returns .The HTTP method used by the request message. The default is the GET method. + + + Gets a set of properties for the HTTP request. + Returns . + + + Gets or sets the used for the HTTP request. + Returns .The used for the HTTP request. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + Represents a HTTP response message including the status code and data. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specific . + The status code of the HTTP response. + + + Gets or sets the content of a HTTP response message. + Returns .The content of the HTTP response message. + + + Releases the unmanaged resources and disposes of unmanaged resources used by the . + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Throws an exception if the property for the HTTP response is false. + Returns .The HTTP response message if the call is successful. + + + Gets the collection of HTTP response headers. + Returns .The collection of HTTP response headers. + + + Gets a value that indicates if the HTTP response was successful. + Returns .A value that indicates if the HTTP response was successful. true if was in the range 200-299; otherwise false. + + + Gets or sets the reason phrase which typically is sent by servers together with the status code. + Returns .The reason phrase sent by the server. + + + Gets or sets the request message which led to this response message. + Returns .The request message which led to this response message. + + + Gets or sets the status code of the HTTP response. + Returns .The status code of the HTTP response. + + + Returns a string that represents the current object. + Returns .A string representation of the current object. + + + Gets or sets the HTTP message version. + Returns .The HTTP message version. The default is 1.1. + + + A base type for handlers which only do some small processing of request and/or response messages. + + + Creates an instance of a class. + + + Creates an instance of a class with a specific inner handler. + The inner handler which is responsible for processing the HTTP response messages. + + + Performs processing on each request sent to the server. + Returns .The HTTP request message that was processed. + The HTTP request message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Perform processing on each response from the server. + Returns .The HTTP response message that was processed. + The HTTP response message to process. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + + + Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The HTTP request message to send to the server. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The was null. + + + Provides a collection of objects that get serialized using the multipart/* content type specification. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The subtype of the multipart content. + The was null or contains only white space characters. + + + Creates a new instance of the class. + The subtype of the multipart content. + The boundary string for the multipart content. + The was null or an empty string.The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add multipart HTTP content to a collection of objects that get serialized using the multipart/* content type specification. + The HTTP content to add to the collection. + The was null. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Returns an enumerator that iterates through the collection of objects that get serialized using the multipart/* content type specification.. + Returns .An object that can be used to iterate through the collection. + + + Serialize the multipart HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + The explicit implementation of the method. + Returns .An object that can be used to iterate through the collection. + + + Determines whether the HTTP multipart content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the HHTP content. + + + Provides a container for content encoded using multipart/form-data MIME type. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + The boundary string for the multipart form data content. + The was null or contains only white space characters.-or-The ends with a space character. + The length of the was greater than 70. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The was null or contains only white space characters. + The was null. + + + Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. + The HTTP content to add to the collection. + The name for the HTTP content to add. + The file name for the HTTP content to add to the collection. + The was null or contains only white space characters.-or-The was null or contains only white space characters. + The was null. + + + Provides HTTP content based on a stream. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The size, in bytes, of the buffer for the . + The was null. + The was less than or equal to zero. + + + Write the HTTP stream content to a memory stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + + + Releases the unmanaged resources used by the and optionally disposes of the managed resources. + true to release both managed and unmanaged resources; false to releases only unmanaged resources. + + + Serialize the HTTP content to a stream as an asynchronous operation. + Returns .The task object representing the asynchronous operation. + The target stream. + Information about the transport (channel binding token, for example). This parameter may be null. + + + Determines whether the stream content has a valid length in bytes. + Returns .true if is a valid length; otherwise, false. + The length in bytes of the stream content. + + + Provides HTTP content based on a string. + + + Creates a new instance of the class. + The content used to initialize the . + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + + + Creates a new instance of the class. + The content used to initialize the . + The encoding to use for the content. + The media type to use for the content. + + + Represents authentication information in Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate header values. + + + Initializes a new instance of the class. + The scheme to use for authorization. + + + Initializes a new instance of the class. + The scheme to use for authorization. + The credentials containing the authentication information of the user agent for the resource being requested. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the credentials containing the authentication information of the user agent for the resource being requested. + Returns .The credentials containing the authentication information. + + + Converts a string to an instance. + Returns .An instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets the scheme to use for authorization. + Returns .The scheme to use for authorization. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Cache-Control header. + + + Initializes a new instance of the class. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Cache-extension tokens, each with an optional assigned value. + Returns .A collection of cache-extension tokens each with an optional assigned value. + + + Serves as a hash function for a object. + Returns .A hash code for the current object. + + + The maximum age, specified in seconds, that the HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .true if the HTTP client is willing to accept a response that has exceed the expiration time; otherwise, false. + + + The maximum time, in seconds, an HTTP client is willing to accept a response that has exceeded its expiration time. + Returns .The time in seconds. + + + The freshness lifetime, in seconds, that an HTTP client is willing to accept a response. + Returns .The time in seconds. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale; otherwise, false. + + + Whether an HTTP client is willing to accept a cached response. + Returns .true if the HTTP client is willing to accept a cached response; otherwise, false. + + + A collection of fieldnames in the "no-cache" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether a cache must not store any part of either the HTTP request mressage or any response. + Returns .true if a cache must not store any part of either the HTTP request mressage or any response; otherwise, false. + + + Whether a cache or proxy must not change any aspect of the entity-body. + Returns .true if a cache or proxy must not change any aspect of the entity-body; otherwise, false. + + + Whether a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status. + Returns .true if a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status; otherwise, false. + + + Converts a string to an instance. + Returns .A instance. + A string that represents cache-control header value information. + + is a null reference. + + is not valid cache-control header value information. + + + Whether all or part of the HTTP response message is intended for a single user and must not be cached by a shared cache. + Returns .true if the HTTP response message is intended for a single user and must not be cached by a shared cache; otherwise, false. + + + A collection fieldnames in the "private" directive in a cache-control header field on an HTTP response. + Returns .A collection of fieldnames. + + + Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale for shared user agent caches. + Returns .true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale for shared user agent caches; otherwise, false. + + + Whether an HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. + Returns .true if the HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache; otherwise, false. + + + The shared maximum age, specified in seconds, in an HTTP response that overrides the "max-age" directive in a cache-control header or an Expires header for a shared cache. + Returns .The time in seconds. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Disposition header. + + + Initializes a new instance of the class. + A . + + + Initializes a new instance of the class. + A string that contains a . + + + The date at which the file was created. + Returns .The file creation date. + + + The disposition type for a content body part. + Returns .The disposition type. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + A suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file. + Returns .A suggested filename. + + + A suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files. + Returns .A suggested filename of the form filename*. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + The date at which the file was last modified. + Returns .The file modification date. + + + The name for a content body part. + Returns .The name for the content body part. + + + A set of parameters included the Content-Disposition header. + Returns .A collection of parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content disposition header value information. + + is a null reference. + + is not valid content disposition header value information. + + + The date the file was last read. + Returns .The last read date. + + + The approximate size, in bytes, of the file. + Returns .The approximate size, in bytes. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of the Content-Range header. + + + Initializes a new instance of the class. + The starting or ending point of the range, in bytes. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + + + Initializes a new instance of the class. + The position, in bytes, at which to start sending data. + The position, in bytes, at which to stop sending data. + The starting or ending point of the range, in bytes. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position, in bytes, at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the Content-Range header has a length specified. + Returns .true if the Content-Range has a length specified; otherwise, false. + + + Gets whether the Content-Range has a range specified. + Returns .true if the Content-Range has a range specified; otherwise, false. + + + Gets the length of the full entity-body. + Returns .The length of the full entity-body. + + + Converts a string to an instance. + Returns .An instance. + A string that represents content range header value information. + + is a null reference. + + is not valid content range header value information. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + The range units used. + Returns .A that contains range units. + + + Represents an entity-tag header value. + + + Initializes a new instance of the class. + A string that contains an . + + + Initializes a new instance of the class. + A string that contains an . + A value that indicates if this entity-tag header is a weak validator. If the entity-tag header is weak validator, then should be set to true. If the entity-tag header is a strong validator, then should be set to false. + + + Gets the entity-tag header value. + Returns . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets whether the entity-tag is prefaced by a weakness indicator. + Returns .true if the entity-tag is prefaced by a weakness indicator; otherwise, false. + + + Converts a string to an instance. + Returns .An instance. + A string that represents entity tag header value information. + + is a null reference. + + is not valid entity tag header value information. + + + Gets the opaque quoted string. + Returns .An opaque quoted string. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the collection of Content Headers as defined in RFC 2616. + + + Gets the value of the Allow content header on an HTTP response. + Returns .The value of the Allow header on an HTTP response. + + + Gets the value of the Content-Disposition content header on an HTTP response. + Returns .The value of the Content-Disposition content header on an HTTP response. + + + Gets the value of the Content-Encoding content header on an HTTP response. + Returns .The value of the Content-Encoding content header on an HTTP response. + + + Gets the value of the Content-Language content header on an HTTP response. + Returns .The value of the Content-Language content header on an HTTP response. + + + Gets or sets the value of the Content-Length content header on an HTTP response. + Returns .The value of the Content-Length content header on an HTTP response. + + + Gets or sets the value of the Content-Location content header on an HTTP response. + Returns .The value of the Content-Location content header on an HTTP response. + + + Gets or sets the value of the Content-MD5 content header on an HTTP response. + Returns .The value of the Content-MD5 content header on an HTTP response. + + + Gets or sets the value of the Content-Range content header on an HTTP response. + Returns .The value of the Content-Range content header on an HTTP response. + + + Gets or sets the value of the Content-Type content header on an HTTP response. + Returns .The value of the Content-Type content header on an HTTP response. + + + Gets or sets the value of the Expires content header on an HTTP response. + Returns .The value of the Expires content header on an HTTP response. + + + Gets or sets the value of the Last-Modified content header on an HTTP response. + Returns .The value of the Last-Modified content header on an HTTP response. + + + A collection of headers and their values as defined in RFC 2616. + + + Initializes a new instance of the class. + + + Adds the specified header and its values into the collection. + The header to add to the collection. + A list of header values to add to the collection. + + + Adds the specified header and its value into the collection. + The header to add to the collection. + The content of the header. + + + Removes all headers from the collection. + + + Returns if a specific header exists in the collection. + Returns .true is the specified header exists in the collection; otherwise false. + The specific header. + + + Returns an enumerator that can iterate through the instance. + Returns .An enumerator for the . + + + Returns all header values for a specified header stored in the collection. + Returns .An array of header strings. + The specified header to return values for. + + + Removes the specified header from the collection. + Returns . + The name of the header to remove from the collection. + + + Gets an enumerator that can iterate through a . + Returns .An instance of an implementation of an that can iterate through a . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Returns a value that indicates whether the specified header and its values were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The values of the header. + + + Returns a value that indicates whether the specified header and its value were added to the collection without validating the provided information. + Returns .true if the specified header and could be added to the collection; otherwise false. + The header to add to the collection. + The content of the header. + + + Return if a specified header and specified values are stored in the collection. + Returns .true is the specified header and values are stored in the collection; otherwise false. + The specified header. + The specified header values. + + + Represents a collection of header values. + The header collection type. + + + Adds an entry to the . + The item to add to the header collection. + + + Removes all entries from the . + + + Determines if the contains an item. + Returns .true if the entry is contained in the instance; otherwise, false + The item to find to the header collection. + + + Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + + Gets the number of headers in the . + Returns .The number of headers in a collection + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Gets a value indicating whether the instance is read-only. + Returns .true if the instance is read-only; otherwise, false. + + + Parses and adds an entry to the . + The entry to add. + + + Removes the specified item from the . + Returns .true if the was removed from the instance; otherwise, false + The item to remove. + + + Returns an enumerator that iterates through the . + Returns .An enumerator for the instance. + + + Returns a string that represents the current object. object. + Returns .A string that represents the current object. + + + Determines whether the input could be parsed and added to the . + Returns .true if the could be parsed and added to the instance; otherwise, false + The entry to validate. + + + Represents the collection of Request Headers as defined in RFC 2616. + + + Gets the value of the Accept header for an HTTP request. + Returns .The value of the Accept header for an HTTP request. + + + Gets the value of the Accept-Charset header for an HTTP request. + Returns .The value of the Accept-Charset header for an HTTP request. + + + Gets the value of the Accept-Encoding header for an HTTP request. + Returns .The value of the Accept-Encoding header for an HTTP request. + + + Gets the value of the Accept-Language header for an HTTP request. + Returns .The value of the Accept-Language header for an HTTP request. + + + Gets or sets the value of the Authorization header for an HTTP request. + Returns .The value of the Authorization header for an HTTP request. + + + Gets or sets the value of the Cache-Control header for an HTTP request. + Returns .The value of the Cache-Control header for an HTTP request. + + + Gets the value of the Connection header for an HTTP request. + Returns .The value of the Connection header for an HTTP request. + + + Gets or sets a value that indicates if the Connection header for an HTTP request contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP request. + Returns .The value of the Date header for an HTTP request. + + + Gets the value of the Expect header for an HTTP request. + Returns .The value of the Expect header for an HTTP request. + + + Gets or sets a value that indicates if the Expect header for an HTTP request contains Continue. + Returns .true if the Expect header contains Continue, otherwise false. + + + Gets or sets the value of the From header for an HTTP request. + Returns .The value of the From header for an HTTP request. + + + Gets or sets the value of the Host header for an HTTP request. + Returns .The value of the Host header for an HTTP request. + + + Gets the value of the If-Match header for an HTTP request. + Returns .The value of the If-Match header for an HTTP request. + + + Gets or sets the value of the If-Modified-Since header for an HTTP request. + Returns .The value of the If-Modified-Since header for an HTTP request. + + + Gets the value of the If-None-Match header for an HTTP request. + Returns .Gets the value of the If-None-Match header for an HTTP request. + + + Gets or sets the value of the If-Range header for an HTTP request. + Returns .The value of the If-Range header for an HTTP request. + + + Gets or sets the value of the If-Unmodified-Since header for an HTTP request. + Returns .The value of the If-Unmodified-Since header for an HTTP request. + + + Gets or sets the value of the Max-Forwards header for an HTTP request. + Returns .The value of the Max-Forwards header for an HTTP request. + + + Gets the value of the Pragma header for an HTTP request. + Returns .The value of the Pragma header for an HTTP request. + + + Gets or sets the value of the Proxy-Authorization header for an HTTP request. + Returns .The value of the Proxy-Authorization header for an HTTP request. + + + Gets or sets the value of the Range header for an HTTP request. + Returns .The value of the Range header for an HTTP request. + + + Gets or sets the value of the Referer header for an HTTP request. + Returns .The value of the Referer header for an HTTP request. + + + Gets the value of the TE header for an HTTP request. + Returns .The value of the TE header for an HTTP request. + + + Gets the value of the Trailer header for an HTTP request. + Returns .The value of the Trailer header for an HTTP request. + + + Gets the value of the Transfer-Encoding header for an HTTP request. + Returns .The value of the Transfer-Encoding header for an HTTP request. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP request contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP request. + Returns .The value of the Upgrade header for an HTTP request. + + + Gets the value of the User-Agent header for an HTTP request. + Returns .The value of the User-Agent header for an HTTP request. + + + Gets the value of the Via header for an HTTP request. + Returns .The value of the Via header for an HTTP request. + + + Gets the value of the Warning header for an HTTP request. + Returns .The value of the Warning header for an HTTP request. + + + Represents the collection of Response Headers as defined in RFC 2616. + + + Gets the value of the Accept-Ranges header for an HTTP response. + Returns .The value of the Accept-Ranges header for an HTTP response. + + + Gets or sets the value of the Age header for an HTTP response. + Returns .The value of the Age header for an HTTP response. + + + Gets or sets the value of the Cache-Control header for an HTTP response. + Returns .The value of the Cache-Control header for an HTTP response. + + + Gets the value of the Connection header for an HTTP response. + Returns .The value of the Connection header for an HTTP response. + + + Gets or sets a value that indicates if the Connection header for an HTTP response contains Close. + Returns .true if the Connection header contains Close, otherwise false. + + + Gets or sets the value of the Date header for an HTTP response. + Returns .The value of the Date header for an HTTP response. + + + Gets or sets the value of the ETag header for an HTTP response. + Returns .The value of the ETag header for an HTTP response. + + + Gets or sets the value of the Location header for an HTTP response. + Returns .The value of the Location header for an HTTP response. + + + Gets the value of the Pragma header for an HTTP response. + Returns .The value of the Pragma header for an HTTP response. + + + Gets the value of the Proxy-Authenticate header for an HTTP response. + Returns .The value of the Proxy-Authenticate header for an HTTP response. + + + Gets or sets the value of the Retry-After header for an HTTP response. + Returns .The value of the Retry-After header for an HTTP response. + + + Gets the value of the Server header for an HTTP response. + Returns .The value of the Server header for an HTTP response. + + + Gets the value of the Trailer header for an HTTP response. + Returns .The value of the Trailer header for an HTTP response. + + + Gets the value of the Transfer-Encoding header for an HTTP response. + Returns .The value of the Transfer-Encoding header for an HTTP response. + + + Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP response contains chunked. + Returns .true if the Transfer-Encoding header contains chunked, otherwise false. + + + Gets the value of the Upgrade header for an HTTP response. + Returns .The value of the Upgrade header for an HTTP response. + + + Gets the value of the Vary header for an HTTP response. + Returns .The value of the Vary header for an HTTP response. + + + Gets the value of the Via header for an HTTP response. + Returns .The value of the Via header for an HTTP response. + + + Gets the value of the Warning header for an HTTP response. + Returns .The value of the Warning header for an HTTP response. + + + Gets the value of the WWW-Authenticate header for an HTTP response. + Returns .The value of the WWW-Authenticate header for an HTTP response. + + + Represents a media type used in a Content-Type header as defined in the RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The source represented as a string to initialize the new instance. + + + Gets or sets the character set. + Returns .The character set. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets or sets the media-type header value. + Returns .The media-type header value. + + + Gets or sets the media-type header value parameters. + Returns .The media-type header value parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type header value information. + + is a null reference. + + is not valid media type header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a media type with an additional quality factor used in a Content-Type header. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + + + Initializes a new instance of the class. + A represented as string to initialize the new instance. + The quality associated with this header value. + + + Converts a string to an instance. + Returns .An instance. + A string that represents media type with quality header value information. + + is a null reference. + + is not valid media type with quality header value information. + + + Get or set the quality value for the . + Returns .The quality value for the object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a name/value pair used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the header name. + Returns .The header name. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value header value information. + + is a null reference. + + is not valid name value header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the header value. + Returns .The header value. + + + Represents a name/value pair with parameters used in various headers as defined in RFC 2616. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + The header name. + + + Initializes a new instance of the class. + The header name. + The header value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the parameters from the object. + Returns .A collection containing the parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents name value with parameter header value information. + + is a null reference. + + is not valid name value with parameter header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a product token value in a User-Agent header. + + + Initializes a new instance of the class. + The product name. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the name of the product token. + Returns .The name of the product token. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the version of the product token. + Returns .The version of the product token. + + + Represents a value which can either be a product or a comment in a User-Agent header. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A comment value. + + + Initializes a new instance of the class. + The product name value. + The product version value. + + + Gets the comment from the object. + Returns .The comment value this . + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents product info header value information. + + is a null reference. + + is not valid product info header value information. + + + Gets the product from the object. + Returns .The product value from this . + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents an If-Range header value which can either be a date/time or an entity-tag value. + + + Initializes a new instance of the class. + A date value used to initialize the new instance. + + + Initializes a new instance of the class. + An object used to initialize the new instance. + + + Initializes a new instance of the class. + An entity tag represented as a string used to initialize the new instance. + + + Gets the date from the object. + Returns .The date from the object. + + + Gets the entity tag from the object. + Returns .The entity tag from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range condition header value information. + + is a null reference. + + is not valid range Condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a Range header value. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a byte range. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents range header value information. + + is a null reference. + + is not valid range header value information. + + + Gets the ranges specified from the object. + Returns .The ranges from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + he string to validate. + The version of the string. + + + Gets the unit from the object. + Returns .The unit from the object. + + + Represents a byte range in a Range header value. + + + Initializes a new instance of the class. + The position at which to start sending data. + The position at which to stop sending data. + + is greater than -or- or is less than 0. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Gets the position at which to start sending data. + Returns .The position at which to start sending data. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the position at which to stop sending data. + Returns .The position at which to stop sending data. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Represents a Retry-After header value which can either be a date/time or a timespan value. + + + Initializes a new instance of the class. + The date and time offset used to initialize the new instance. + + + Initializes a new instance of the class. + The delta, in seconds, used to initialize the new instance. + + + Gets the date and time offset from the object. + Returns .The date and time offset from the object. + + + Gets the delta in seconds from the object. + Returns .The delta in seconds from the object. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents retry condition header value information. + + is a null reference. + + is not valid retry condition header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a string header value with an optional quality. + + + Initializes a new instance of the class. + The string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A quality factor used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents quality header value information. + + is a null reference. + + is not valid string with quality header value information. + + + Gets the quality factor from the object. + Returns .The quality factor from the object. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the string value from the object. + Returns .The string value from the object. + + + Represents an accept-encoding header value. + + + Initializes a new instance of the class. + A object used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Determines whether the specified Object is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Gets the transfer-coding parameters. + Returns .The transfer-coding parameters. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding header value information. + + is a null reference. + + is not valid transfer-coding header value information. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Gets the transfer-coding value. + Returns .The transfer-coding value. + + + Represents an Accept-Encoding header value.with optional quality factor. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + + + Initializes a new instance of the class. + A string used to initialize the new instance. + A value for the quality factor. + + + Converts a string to an instance. + Returns .An instance. + A string that represents transfer-coding value information. + + is a null reference. + + is not valid transfer-coding with quality header value information. + + + Gets the quality factor from the . + Returns .The quality factor from the . + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents the value of a Via header. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + + + Initializes a new instance of the class. + The protocol version of the received protocol. + The host and port that the request or response was received by. + The protocol name of the received protocol. + The comment field used to identify the software of the recipient proxy or gateway. + + + Gets the comment field used to identify the software of the recipient proxy or gateway. + Returns .The comment field used to identify the software of the recipient proxy or gateway. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .Returns a hash code for the current object. + + + Converts a string to an instance. + Returns .An instance. + A string that represents via header value information. + + is a null reference. + + is not valid via header value information. + + + Gets the protocol name of the received protocol. + Returns .The protocol name. + + + Gets the protocol version of the received protocol. + Returns .The protocol version. + + + Gets the host and port that the request or response was received by. + Returns .The host and port that the request or response was received by. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + Represents a warning value used by the Warning header. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + + + Initializes a new instance of the class. + The specific warning code. + The host that attached the warning. + A quoted-string containing the warning text. + The date/time stamp of the warning. + + + Gets the host that attached the warning. + Returns .The host that attached the warning. + + + Gets the specific warning code. + Returns .The specific warning code. + + + Gets the date/time stamp of the warning. + Returns .The date/time stamp of the warning. + + + Determines whether the specified is equal to the current object. + Returns .true if the specified is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Serves as a hash function for an object. + Returns .A hash code for the current object. + + + Converts a string to an instance. + Returns an instance. + A string that represents authentication header value information. + + is a null reference. + + is not valid authentication header value information. + + + Gets a quoted-string containing the warning text. + Returns .A quoted-string containing the warning text. + + + Returns a string that represents the current object. + Returns .A string that represents the current object. + + + Determines whether a string is valid information. + Returns .true if is valid information; otherwise, false. + The string to validate. + The version of the string. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/de/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/de/a new file mode 100644 index 00000000000..5c4f577656b --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/de/a @@ -0,0 +1,2350 @@ + + + + System.Net.Http + + + + Stellt HTTP-Inhalt auf Grundlage von einem Bytearray bereit. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der -Parameter ist null. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der Offset in Bytes im -Parameter, der verwendet wird, um den zu initialisieren. + Die Anzahl der Bytes in ab dem -Parameter, die zum Initialisieren von benutzt werden. + Der -Parameter ist null. + Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters angegeben wird.- oder -Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters - minus dem -Parameter angegeben wird. + + + Erstellt einen HTTP-Inhaltsdatenstrom als asynchronen Vorgang zum Lesen, dessen Sicherungsspeicher Arbeitsspeicher von ist. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Das Bytearray, das im Konstruktor bereitgestellt wird, als asynchronen Vorgang in einen HTTP-Inhaltsstream serialisieren und schreiben. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport, zum Beispiel Channelbindungstoken.Dieser Parameter kann null sein. + + + Bestimmt, ob ein Bytearray eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Bytearrays in Bytes. + + + Gibt an, wie die Clientzertifikate bereitgestellt werden. + + + Der versucht, alle verfügbaren Clientzertifikate automatisch bereitzustellen. + + + Die Anwendung stellt manuell die Clientzertifikate für den bereit.Dies ist der Standardwert. + + + Ein Typ für HTTP-Handler, die die Verarbeitung von HTTP-Antwortnachrichten in einen anderen Handler (den internen Handler) delegieren. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft den internen Handler ab, der die HTTP-Antwortnachrichten verarbeitet, oder legt diesen fest. + Gibt zurück.Der innere Handler für HTTP-Antwortnachrichten. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ein Container für die Name/Wert-Tupel, codiert mit dem "application/x-www-form-urlencoded" MIME-Typ. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Auflistung von Namen/Wert-Paaren. + Eine Sammlung von Name-Wert-Paaren. + + + Stellt eine Basisklasse zum Senden von HTTP-Anforderungen und Empfangen von HTTP-Antworten aus einer Ressource bereit, die von einem URI identifiziert wird. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der HTTP-Handlerstapel, der zum Senden von Anforderungen zu verwenden ist. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden soll, false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Ruft die Basisadresse des URI (Uniform Resource Identifier) der Internetressource ab, die verwendet wird, wenn Anforderungen gesendet werden, oder legt diese fest. + Gibt zurück.Die Basisadresse des URI (Uniform Resource Identifier) der Internetressource, die verwendet wird, wenn Anforderungen gesendet werden. + + + Alle ausstehenden Anforderungen für diese Instanz abbrechen. + + + Ruft die Header ab, die mit jeder Anforderung gesendet werden sollen. + Gibt zurück.Die Header, die mit jeder Anforderung gesendet werden sollen. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Ruft beim Lesen des Antwortinhalts die maximale Anzahl zwischenzuspeichernder Bytes ab oder legt diese fest. + Gibt zurück.Die maximale Anzahl zu puffernder Bytes, wenn der Antwortinhalt gelesen wird.Der Standardwert für diese Eigenschaft ist 2 GB. + Der angegebene Größe ist kleiner als oder gleich 0 (null). + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Ruft die Zeitspanne ab, nach der das Zeitlimit der Anforderung überschritten ist, oder legt diese fest. + Gibt zurück.Die Zeitspanne, nach der das Zeitlimit der Anforderung überschritten ist. + Der angegebene Timout ist kleiner oder gleich 0 (null) und nicht . + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Der standardmäßige Meldungshandler für . + + + Erstellt eine Instanz einer -Klasse. + + + Ruft einen Wert ab, der angibt, ob der Handler Umleitungsantworten folgen soll, oder legt diesen Wert fest. + Gibt zurück.Wenn true, wenn der Handler Umleitungsantworten folgen soll; andernfalls false.Der Standardwert ist true. + + + Ruft den Typ der Dekomprimierungsmethode ab, die vom Handler für die automatische Dekomprimierung der HTTP-Inhalt-Antwort verwendet wird, oder legt diesen fest. + Gibt zurück.Die vom Handler zu benutzende automatische Dekomprimierungsmethode.Der Standardwert ist . + + + Ruft die diesem Handler zugeordnete Auflistung von Sicherheitszertifikaten ab oder legt diese fest. + Gibt zurück.Die Auflistung von Sicherheitszertifikaten, die diesem Handler zugeordnet sind. + + + Ruft den Cookiecontainer zum Speichern von Servercookies durch den Handler ab oder diesen fest. + Gibt zurück.Der Cookie-Container zum Speichern von Server-Cookies durch den Handler. + + + Ruft die Authentifizierungsinformationen ab, die vom Handler verwendet wurden, oder legt diese fest. + Gibt zurück.Die der Authentifizierungsanforderung zugeordnete Handler.Der Standardwert ist null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die maximale Anzahl von Umleitungen ab, denen der Handler folgt, oder legt diese fest. + Gibt zurück.Die maximale Anzahl von Umleitungsantworten, denen der Handler folgt.Der Standardwert ist 50. + + + Ruft die maximale Größe des Anforderungsinhaltpuffers ab, der vom Handler verwendet wird, oder legt diese fest. + Gibt zurück.Die maximale Größe des Anforderungsinhaltpuffers in Byte.Der Standardwert beträgt 2 GB. + + + Ruft einen Wert ab, der angibt, ob der Handler mit der Anforderung ein Autorisierungsheader sendet, oder legt diesen fest. + Gibt zurück.true für den Handler zum Senden eines HTTP-Autorisierungsheaders mit Anforderungen nach einer Authentifizierung, andernfalls false.Die Standardeinstellung ist false. + + + Ruft die Proxyinformationen ab, die vom Handler verwendet werden, oder legt diese fest. + Gibt zurück.Die Proxyinformationen, die vom Handler verwendet werden.Der Standardwert ist null. + + + Erstellt eine Instanz von auf Grundlage der Informationen, die in als Operation bereitgestellt werden, der nicht blockiert. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ruft einen Wert ab, der angibt, ob der Handler die automatische Antwort-Inhaltsdekomprimierung unterstützt. + Gibt zurück.Wenn true, wenn der Handler die automatische Dekomprimierung von Antwortinhalt unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler die Proxyeinstellungen unterstützt. + Gibt zurück.Wenn true, wenn der Handler die Proxyeinstellungen unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt. + Gibt zurück.Wenn true, wenn der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und die Cookies beim Senden von Anforderungen nutzt. + Gibt zurück.Wenn true, wenn der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und diese Cookies beim Senden von Anforderungen verwendet; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der steuert, ob mit den Anforderungen vom Handler Standardanmeldeinformationen gesendet werden, oder legt diesen fest. + Gibt zurück.true, wenn die standardmäßigen Anmeldeinformationen verwendet werden, andernfalls false.Der Standardwert ist false. + + + Ruft einen Wert ab bzw. legt einen Wert fest, der angibt, ob der Handler einen Proxy für Anforderungen verwendet. + Gibt zurück.true, wenn der Handler einen Proxy für Anforderungen verwenden soll; andernfalls false.Der Standardwert ist true. + + + Gibt an, ob -Vorgänge als abgeschlossen betrachtet werden, sobald eine Antwort verfügbar ist, oder nachdem die gesamte Antwortnachricht einschließlich Inhalt gelesen wurde. + + + Der Vorgang sollte beendet werden, nachdem er die gesamte Antwort einschließlich des Inhalts gelesen hat. + + + Der Vorgang sollte beendet werden, sobald eine Antwort vorliegt und die Header gelesen wurden.Der Inhalts noch ist nicht bereit. + + + Eine Basisklasse, die einen HTTP-Entitätentext und Inhaltsheader darstellt. + + + Initialisiert eine neue Instanz der -Klasse. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherstream als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die HTTP-Inhaltsheader wie in RFC 2616 definiert ab. + Gibt zurück.Die Inhaltsheader gemäß RFC 2616. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die maximale Größe des zu verwendenden Puffers in Byte. + + + Serialisieren Sie den HTTP-Inhalt in ein Bytearray als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisieren Sie den HTTP-Inhalt und geben Sie einen Stream zurück, der den Inhalt als asynchroner Vorgang darstellt. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in eine Zeichenfolge als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der HTTP-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Ein Basistyp für HTTP-Message-Handler. + + + Initialisiert eine neue Instanz der -Klasse. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Spezialitätenklasse, die es Anwendungen ermöglicht, die Methode auf einer HTTP-Handlerkette aufzurufen. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden sollte,false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Hilfsprogrammklasse für das Abrufen und das Vergleichen von Standard-HTTP-Methoden und zum Erstellen von neuen HTTP-Methoden. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten HTTP-Methode. + Die HTTP-Methode + + + Stellt eine HTTP DELTE-Protokollmethode dar. + Gibt zurück. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Die HTTP-Methode, die mit dem aktuellen Objekt verglichen werden soll. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Stellt eine HTTP GET-Protokollmethode dar. + Gibt zurück. + + + Fungiert als Hashfunktion für diesen Typ. + Gibt zurück.Ein Hashcode für das aktuelle . + + + Stellt eine HTTP HEAD-Protokollmethode dar.Die HEAD-Methode ist mit der GET-Methode identisch, bis auf den Unterschied, dass der Server in der Antwort nur Meldungsheader und keinen Meldungstext zurückgibt. + Gibt zurück. + + + Eine HTTP-Methode. + Gibt zurück.Die HTTP-Methode dargestellt als . + + + Der Gleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter gleich sind, andernfalls false. + Die linke für einen Gleichheitsoperator. + Die rechte zu einem Gleichheitsoperator. + + + Der Ungleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter ungleich sind, andernfalls false. + Die linke für einen Ungleichheitsoperator. + Die rechte zu einem Ungleichheitsoperator. + + + Stellt eine HTTP OPTIONS-Protokollmethode dar. + Gibt zurück. + + + Stellt eine HTTP POST-Protokollmethode dar, die verwendet wird, um eine neue Entität als Zusatz zu einem URI zu senden. + Gibt zurück. + + + Stellt eine HTTP PUT-Protokollmethode dar, die verwendet wird, um eine durch einen URI bezeichnete Entität zu ersetzen. + Gibt zurück. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt eine HTTP TRACE-Protokollmethode dar. + Gibt zurück. + + + Eine Basisklasse für Ausnahmen, die von den Klassen und ausgelöst werden. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt, und einer inneren Ausnahme. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + Die innere Ausnahme. + + + Stellt eine HTTP-Nachrichtenanfrage dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Eine Zeichenfolge, die die Anforderung darstellt. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Das anzufordernde . + + + Ruft den Inhalt der HTTP-Meldung ab oder legt diesen fest. + Gibt zurück.Der Nachrichteninhalt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die Auflistung von HTTP-Anforderungsheadern ab. + Gibt zurück.Eine Auflistung von HTTP-Anforderungsheadern. + + + Ruft die von der HTTP-Anforderungsmeldung verwendete HTTP-Methode ab oder legt diese fest. + Gibt zurück.Die HTTP-Methode, die von der Anforderungnachricht benutzt wurde.Standard ist die GET-Methode. + + + Ruft eine Gruppe von Eigenschaften für die HTTP-Anforderung ab. + Gibt zurück. + + + Übernimmt oder bestimmt den , der für die HTTP-Anforderung verwendet wird. + Gibt zurück.Der , der für die aktuelle HTTP-Anforderung verwendet wird. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Stellt eine HTTP-Antwortnachricht einschließlich den Statuscodes und der Daten dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten . + Der Statuscode der ATTP-Antwort. + + + Ruft den Inhalt einer HTTP-Antwortmeldung ab oder legt diesen fest. + Gibt zurück.Der Inhalt des HTTP-Antwortnachricht. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die nicht verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Löst eine Ausnahme aus, wenn die -Eigenschaft der HTTP-Antwort false lautet. + Gibt zurück.Die HTTP-Antwortnachricht, wenn der Aufruf erfolgreich ausgeführt wurde. + + + Ruft die Auflistung von HTTP-Antwortheadern ab. + Gibt zurück.Die Auflistung von HTTP-Antwortheadern. + + + Ruft einen Wert ab, der angibt, ob die HTTP-Antwort erfolgreich war. + Gibt zurück.Ein Wert, der angibt, ob die HTTP-Antwort erfolgreich war.true, wenn sich im Bereich 200–299 befand; andernfalls false. + + + Ruft den Begründungsausdruck ab, der üblicherweise von Servern, zusammen mit dem Statuscode, gesendet wird, oder legt diesen fest. + Gibt zurück.Die vom Server gesendete Begründungsphrase. + + + Ruft die Anforderungnachricht ab, die zu dieser Antwortnachricht geführt hat, oder legt diese fest. + Gibt zurück.Die Anforderungsnachricht, die zu dieser Antwortnachricht geführt hat. + + + Übernimmt oder bestimmt den Statuscode der HTTP-Antwort. + Gibt zurück.Der Statuscode der ATTP-Antwort. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Ein Basistyp für Handler, die nur einige kleine Verarbeitung der Anforderungs- und/oder der Antwortnachrichten ausführen. + + + Erstellt eine Instanz einer -Klasse. + + + Erstellt eine Instanz einer -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Führt die Verarbeitung auf jeder Anforderung aus, die an den Server gesendet wird. + Gibt zurück.Die HTTP-Anforderungsnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Anforderungmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Führen Sie die Verarbeitung auf jeder Antwort vom Server aus. + Gibt zurück.Die HTTP-Antwortnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Antwortmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Stellt eine Auflistung von -Objekten bereit, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die war null enthält nur Leerzeichen. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die Begrenzungszeichenfolge für den Multipart-Inhalt. + Der war null oder eine leere Zeichenfolge ().Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie Mehrfach-HTTP-Inhalt einer Sammlung von -Objekten hinzu, die unter Verwendung der multipart/*-Inhaltstypspezifikation serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Gibt einen Enumerator zurück, der die Auflistung der -Objekte durchläuft, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Den Multipart-HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Eine explizite Implementierung der -Methode. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Bestimmt, ob der HTTP-Multipart-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Stellt einen Container für den Inhalt bereit, der mithilfe des multipart/form-data-MIME-Typs codiert wird. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Die Begrenzungszeichenfolge für den Multipart-Form-Dateninhalt. + Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Die war null enthält nur Leerzeichen. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Der Name der Datei, für den zur Auflistung hinzuzufügenden HTTP-Inhalt. + Die war null enthält nur Leerzeichen.- oder -Die war null enthält nur Leerzeichen. + + war null. + + + Stellt HTTP-Inhalt auf Grundlage eines Streams bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die verfügbare Größe des Puffers in Byte für die . + + war null. + Die war kleiner oder gleich 0 (null). + + + Den HTTP-Datenstrominhalt in einen Speicherstream als asynchronen Vorgang schreiben. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der Stream-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Streamsinhalts in Bytes. + + + Stellt HTTP-Inhalt auf Grundlage einer Zeichenfolge bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + Der Medientyp, der für den Inhalt verwendet werden soll. + + + Stellt Authentifizierungsinformationen in Authorization-, ProxyAuthorization-, WWW-Authenticate- und Proxy-Authenticate-Headerwerten dar. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + Die Anmeldeinformationen, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Anmeldeinformationen ab, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + Gibt zurück.Die Anmeldeinformationen, die die Informationen für die Authentifizierung enthalten. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft das Schema ab, welches für die Autorisierung verwendet werden soll. + Gibt zurück.Das Schema für die Autorisierung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Cachesteuerungsheaders dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + CACHE-EXTENSION-Tokens, jeweils mit einem optionalen zugeordneten Wert. + Gibt zurück.Eine Sammlung von Cacheerweiterungtokens, jeweils mit einem optionalen zugeordneten Wert. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Der Höchstalter in Sekunden, für das der HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat; andernfalls false. + + + Die maximale Zeit in Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die ihre Ablaufzeit überschritten hat. + Gibt zurück.Die Zeit in Sekunden. + + + Die Anzahl Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag veraltet ist; andernfalls false. + + + Ob ein HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu akzeptieren. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu übernehmen; andernfalls false. + + + Eine Sammlung von Feldnamen in der "no-cache"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf. + Gibt zurück.true, wenn ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf; andernfalls false. + + + Ob ein Cache oder ein Proxy keinen Aspekt des Entitätstexts ändern darf. + Gibt zurück.true, wenn ein Cache oder Proxy keinen Aspekt des Entitätstexts ändern darf; andernfalls false. + + + Ob ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert. + Gibt zurück.true wenn ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Cachesteuerungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Cachesteuerungsheader. + + + Gibt an, ob alles oder nur ein Teil der HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht durch das Ausführen eines freigegebenen Caches zwischengespeichert werden darf. + Gibt zurück.true, wenn die HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht von einem gemeinsam genutzten Cache zwischengespeichert werden darf; andernfalls false. + + + Eine Feldnamensammlung in der "private"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist; andernfalls false. + + + Ob eine HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde. + Gibt zurück.true, wenn die HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde; andernfalls false. + + + Das freigegebene, in Sekunden angegebene Höchstalter in einer HTTP-Antwort, die die "max-age"-Direktive in einem Cache-Control-Header oder einem Expires-Header für einen gemeinsam genutzten Cache überschreibt. + Gibt zurück.Die Zeit in Sekunden. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Disposition-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die eine enthält. + + + Das Datum, zu der die Datei erstellt wurde. + Gibt zurück.Das Dateierstellungsdatum. + + + Der Anordnungstyp für einen Textteil. + Gibt zurück.Der Anordnungstyp. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ein Vorschlag, wie Sie einen Dateinamen zum Speichern der Nachrichtennutzlast erstellen, der verwendet werden soll, wenn die Entität getrennt und in einer separaten Datei gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname. + + + Ein Vorschlag, wie Sie Dateinamen zum Speichern der Nachrichtennutzlasten erstellen, der verwendet werden soll, wenn die Entitäten getrennt und in separaten Dateien gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname des Formulardateinamens*. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Datum der letzten Dateiänderung. + Gibt zurück.Das Änderungsdatum der Datei. + + + Der Name für einen Inhaltstextteil. + Gibt zurück.Der Name des Inhaltstextteils. + + + Ein Satz von Parametern, enthalten im Content-Disposition-Header. + Gibt zurück.Eine Auflistung von Parametern. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Wertinformation des Inhaltsdisposition-Headers des Inhalts darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Inhaltsdispositionsheader. + + + Das Datum, an dem zuletzt die Datei gelesen wurde. + Gibt zurück.Das letzte gelesene Datum. + + + Die ungefähre Größe der aktuellen Datei in Bytes. + Gibt zurück.Die ungefähre Größe in Bytes. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Range-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob für den Inhaltsbereichs-Header eine Länge angegeben wurde. + Gibt zurück.true, wenn der Content-Range eine Länge angegeben hat; andernfalls false. + + + Ruft ab, ob für den Inhaltsbereich ein Bereich bestimmt wurde. + Gibt zurück.true, wenn der Content-Range einen Bereich angegeben hat; andernfalls false. + + + Ruft die Länge des vollständigen Entitätstexts ab. + Gibt zurück.Die Länge des vollständigen Entitätstexts. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Informationen des Inhaltsbereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Inhaltsbereich-Headerwert. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Die verwendeten Bereichseinheiten. + Gibt zurück.Ein , das Bereichseinheiten enthält. + + + Stellt einen Entitätstag-Headerwert dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + Ein Wert, der angibt, ob dieser Entitätstagheader ein schwaches Validierungssteuerelement ist.Wenn der Entitätstagheader ein schwaches Validierungssteuerelement ist, sollte auf true festgelegt werden.Wenn der Entitätstagheader ein starkes Validierungssteuerelement ist, sollte auf false festgelegt werden. + + + Ruft den Entitätstagheaderwert ab. + Gibt zurück. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob dem Entitätstag ein Schwächeindikator vorangestellt ist. + Gibt zurück.true, wenn das Entitätstag durch einen Schwächeindikator vorangestellt wird; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Entitätstag-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Entitätstag-Headerwert dar. + + + Ruft die nicht transparente Zeichenfolge in Anführungszeichen ab. + Gibt zurück.Eine nicht transparente Zeichenfolge in Anführungszeichen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt die Auflistung von Inhaltsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Allow-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Allow-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + + + Eine Sammlung von Headern und deren Werten, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + + + Fügt den angegebenen Header und seine Werte in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Eine Liste von Headerwerten, die der Sammlung hinzugefügt werden sollen. + + + Fügt den angegebenen Header und den Wert in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Entfernt alle Header aus der -Auflistung. + + + Gibt zurück, ob ein bestimmter Header in der -Auflistung vorhanden ist. + Gibt zurück.true, wenn der angegebene Header in der Auflistung vorhanden ist, andernfalls false. + Der spezielle Header. + + + Gibt einen Enumerator zurück, der die -Instanz durchlaufen kann. + Gibt zurück.Ein Enumerator für das . + + + Gibt alle Headerwerte für einen angegebenen Header zurück, der in der -Auflistung gespeichert wird. + Gibt zurück.Ein Array von Headerzeichenfolgen. + Der angegebene Header, für den Werte zurückgegeben werden sollen. + + + Entfernt den angegebenen Header aus der -Auflistung. + Gibt zurück. + Der Name des Headers, der aus der Auflistung entfernt werden soll. + + + Ruft einen Enumerator ab, der eine durchlaufen kann. + Gibt zurück.Eine Instanz einer -Implementierung, die eine durchlaufen kann. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Werte zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Die Werte des Headers. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Wert zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Zurückgeben, ob ein angegebener Header und angegebene Werte in der -Auflistung gespeichert sind. + Gibt zurück.true, wenn der angegebene Header und values in der Auflistung gespeichert sind; andernfalls false. + Der angegebene Header. + Die angegebenen Headerwerte. + + + Stellt eine Auflistung von Headerwerten dar. + Der Headerauflistungs-Typ. + + + Fügt der einen Eintrag hinzu. + Das Element, das der Headerauflistung hinzugefügt werden soll. + + + Entfernt sämtliche Einträge aus dem . + + + Bestimmt, ob der ein Element enthält. + Gibt zurück.true, wenn dar Eintrag in der Instanz enthalten ist, andernfalls false. + Das Element, das in der Headerauflistung gefunden werden soll. + + + Kopiert die gesamte in ein kompatibles eindimensionales , beginnend am angegebenen Index des Zielarrays. + Das eindimensionale , das das Ziel der aus der kopierten Elemente ist.Für das muss eine nullbasierte Indizierung verwendet werden. + Der nullbasierte Index im , bei dem der Kopiervorgang beginnt. + + + Ruft die Anzahl der Header im ab. + Gibt zurück.Die Anzahl der Header in einer Auflistung. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Ruft einen Wert ab, der angibt, ob das -Instanz schreibgeschützt ist. + Gibt zurück.true, wenn die -Instanz schreibgeschützt ist, andernfalls false. + + + Analysiert und fügt einen Eintrag hinzu. + Der hinzuzufügende Eintrag + + + Entfernt das angegebene Element aus . + Gibt zurück.true, wenn der erfolgreich aus der Instanz entfernt wurde, andernfalls false. + Das zu entfernende Element. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob die Eingabe analysiert und zu hinzugefügt werden kann. + Gibt zurück.true, wenn analysiert und zu Instanz hinzugefügt werden kann; andernfalls false + Der zu überprüfende Eintrag. + + + Stellt die Auflistung von Anforderungsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Charset-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Charset-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Language-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Language-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Authorization-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Connection-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Anforderung "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Expect-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Expect-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Expect-Header für eine HTTP-Anforderung "Continue" enthält. + Gibt zurück.true, wenn der Expect-Header "Fortfahren" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des From-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des From-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Host-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Host-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des If-Match-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + + + Übernimmt oder bestimmt den Wert des If-Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Referer-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Referer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des TE-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des TE-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Anforderung "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des User-Agent-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des User-Agent-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Via-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Warning-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Anforderung. + + + Stellt die Auflistung von Antwortheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Ranges-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Accept-Ranges-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Age-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Age-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Connection-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Antwort "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des ETag-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des ETag-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Location-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Location-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Retry-After-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Retry-After-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Server-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Server-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Antwort "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Vary-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Vary-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Via-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Warning-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Antwort. + + + Ruft den Wert des WWW-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des WWW-Authenticate-Headers für eine HTTP-Antwort. + + + Stellt einen Medientyp dar, der in einem Inhaltstypheader verwendet wird, wie im RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Die Quelle, die als Zeichenfolge dargestellt wird, um die neue Instanz zu initialisieren. + + + Ruft den Zeichensatz ab oder legt ihn fest. + Gibt zurück.Der Zeichensatz. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Wert des Medientyp-Headers ab oder legt ihn fest. + Gibt zurück.Der Medientyp-Headerwert. + + + Ruft die Titelwertparameter des Medientyps ab oder legt diese fest. + Gibt zurück.Die Medientyp-Headerwertparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Medientyp-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Medientyp-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Medientyp mit einem zusätzlichen Qualitätsfaktor dar, der in einem Inhaltstypheader verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + Die Qualität dieses zugeordneten Headerwert. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Medientyp mit Qualitätsheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Medientyp mit Qualitätsheaderwertinformationen. + + + Abrufen oder Festlegen des Qualitätswerts für . + Gibt zurück.Der Qualitätswert für das Objekt . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt ein Name-Wert-Paar dar, das in verschiedenen Headern verwendet wird, die in RFC 2616 definiert sind. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Headernamen ab. + Gibt zurück.Der Headername. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Namenswert-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Namenswert-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Headerwert ab. + Gibt zurück.Der Headerwert. + + + Stellt ein Name-Wert-Paar mit Parametern dar, das in verschiedenen Headern verwendet wird, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Parameter vom -Objekt ab. + Gibt zurück.Eine Auflistung, die die Parameter enthält. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Namenswert mit Parameterheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Namenswert mit Parameterheaderwertinformationen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Produkttokenwert in einem User-Agent-Header dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktname. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Namen des Produkttoken ab. + Gibt zurück.Der Name des Produkttoken. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produkt-Headerwerts darstellt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Version des Produkttoken ab. + Gibt zurück.Die Version des Produkttoken. + + + Stellt einen Wert dar, der entweder ein Produkt oder ein Kommentar in einem Benutzer-Agent-Header sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Kommentarwert. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Ruft den Kommentar vom -Objekt ab. + Gibt zurück.Der Kommentarwert dieses . + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produktinfo-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Produktinfo-Headerwert dar. + + + Ruft das Produkt vom -Objekt ab. + Gibt zurück.Der Produktwert von diesem . + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen If-Range-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Entitätstag-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Datumswert für die Initialisierung der neuen -Instanz. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Entitätstag, dargestellt als Zeichenfolge, der verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum aus dem Objekt ab. + Gibt zurück.Das Datum aus dem -Objekt. + + + Ruft das Entitätstag vom -Objekt ab. + Gibt zurück.Das Entitätstag vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichsbedingung-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereichsbedingung-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem Bytebereich. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereich-Headerwert. + + + Ruft die Bereiche ab, die vom -Objekt angegeben sind. + Gibt zurück.Die Reichweiten vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Einheit vom -Objekt ab. + Gibt zurück.Die Einheit vom -Objekt. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt einen Retry-After-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Zeitspannen-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Der Datum und Zeit Offset, der zum Initialisieren der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Das Delta, in Sekunden, das verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum und Uhrzeit-Offset vom aktuellen -Objekt ab. + Gibt zurück.Das Datum und Uhrzeit-Offset vom aktuellen -Objekt. + + + Ruft das Delta in Sekunden vom -Objekt ab. + Gibt zurück.Das Delta in Sekunden vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Wiederholungsbedingung darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für den Headerwert für die Wiederholungsbedingung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Zeichenfolgenheaderwert mit einer optionalen Qualität dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Qualitätsfaktor für die Initialisierung der neuen -Instanz. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Qualitäts-Headerwerts darstellt. + + ist ein null-Verweis. + + ist eine ungültige Zeichenfolge mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor vom -Objekt ab. + Gibt zurück.Der Qualitätsfaktor vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Zeichenfolgewert aus dem -Objekt ab. + Gibt zurück.Der Zeichenfolgewert aus dem -Objekt. + + + Stellt einen Headerwert zum Akzeptieren von Codierung dar. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Übertragungs-Codierungs-Parameter ab. + Gibt zurück.Die Übertragungscodierungsparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Übertragungscodierung darstellt. + + ist ein null-Verweis. + + ist kein ungültige Information für einen Übertragungscodierungs-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Übertragungscodierungswert ab. + Gibt zurück.Der Übertragungscodierungswert. + + + Stellt einen Accept-Encoding-Headerwert mit optionalem Qualitätsfaktor dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Wert für den Qualitätsfaktor. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Übertragungscodierungswerts darstellt. + + ist ein null-Verweis. + + ist ein ungültige Übertragungscodierung mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor von ab. + Gibt zurück.Der Qualitätsfaktor von . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Via-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Ruft das Befehlsfeld ab, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + Gibt zurück.Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Bestimmt, ob das angegebene -Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Gibt einen Hashcode für das aktuelle Objekt zurück. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Via-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Via-Headerwert. + + + Ruft den Protokollnamen des empfangenen Protokolls ab. + Gibt zurück.Der Protokollname. + + + Ruft die Protokollversion des empfangenen Protokolls ab. + Gibt zurück.Die Protokollversion. + + + Ruft den Host und Port ab, von der die Anforderung oder Antwort empfangen wurden. + Gibt zurück.Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Warnwert dar, der vom Warn-Header verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + Der Datum/Uhrzeit-Stempel der Warnung. + + + Ruft den Host ab, der die Warnung angehängt hat. + Gibt zurück.Der Host, der die Warnung angehängt hat. + + + Ruft den spezifischen Warncode ab. + Gibt zurück.Der spezifische Warncode. + + + Ruft den Datum-/Uhrzeit-Stempel der Warnung ab. + Gibt zurück.Der Datum/Uhrzeit-Stempel der Warnung. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt eine -Instanz zurück. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft eine Zeichenfolge in Anführungszeichen ab, die den Warnungstext enthält. + Gibt zurück.Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/es/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/es/a new file mode 100644 index 00000000000..dad879d5f34 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/es/a @@ -0,0 +1,2322 @@ + + + + System.Net.Http + + + + Proporciona contenido HTTP basado en una matriz de bytes. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El valor del parámetro es null. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El desplazamiento, en bytes, del parámetro de usado para inicializar . + El número de bytes de a partir del parámetro de usado para inicializar . + El valor del parámetro es null. + El parámetro es menor que cero.O bienEl parámetro es mayor que la longitud del contenido que especifica el parámetro .O bienEl parámetro es menor que cero.O bienEl valor del parámetro es mayor que la longitud del contenido que especifica menos el parámetro . + + + Crea una secuencia de contenido HTTP como una operación asincrónica para lectura cuya memoria auxiliar es memoria procedente del objeto . + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Serialice y escriba la matriz de bytes proporcionada en el constructor en una secuencia de contenido HTTP como operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte, como el token de enlace de canal.Este parámetro puede ser null. + + + Determina si una matriz de bytes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes de la matriz. + + + Especifica cómo se proporcionan los certificados de cliente. + + + + intentará proporcionar automáticamente todos los certificados de cliente disponibles. + + + La aplicación proporciona manualmente los certificados de cliente a .Este valor es el predeterminado. + + + Un tipo para los controladores HTTP que delegan el procesamiento de los mensajes de respuesta HTTP a otro controlador, denominado controlador interno. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Libera los recursos no administrados que utiliza el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el controlador interno que procesa los mensajes de respuesta HTTP. + Devuelve .Controlador interno para los mensajes de respuesta HTTP. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Contenedor para las tuplas de nombre-valor codificadas mediante el tipo MIME de application/x-www-form-urlencoded. + + + Inicializa una nueva instancia de la clase con una colección específica de pares de nombre y valor. + Colección de pares de nombre-valor. + + + Proporciona una clase base para enviar solicitudes HTTP y recibir respuestas HTTP de un recurso identificado por un URI. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un controlador específico. + Pila de controlador HTTP que se va a usar para enviar solicitudes. + + + Inicializa una nueva instancia de la clase con un controlador específico. + + responsable de procesar los mensajes de respuesta HTTP. + Es true si Dispose() debe desechar el controlador interno; es false si piensa reutilizar el controlador interno. + + + Obtiene o establece la dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + Devuelve .La dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + + + Cancela todas las solicitudes pendientes en esta instancia. + + + Obtiene los encabezados que se deben enviar con cada solicitud. + Devuelve .Encabezados que se deben enviar con cada solicitud. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar tanto recursos administrados como no administrados; es false para liberar únicamente recursos no administrados. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Obtiene o establece el número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta. + Devuelve .Número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta.El valor predeterminado de esta propiedad es 2 gigabytes. + El tamaño especificado es menor o igual que cero. + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Obtiene o establece el tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + Devuelve .El tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + El tiempo de espera especificado es menor o igual que cero y no es . + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Controlador de mensajes predeterminado usado por . + + + Cree una instancia de una clase . + + + Obtiene o establece un valor que indica si el controlador debe seguir las respuestas de redirección. + Devuelva .true si el controlador debe seguir las respuestas de redirección; si no false.El valor predeterminado es true. + + + Obtiene o establece el tipo de método de descompresión utilizado por el controlador para la descompresión automática de la respuesta de contenido HTTP. + Devuelva .El método de descompresión automática utilizado por el controlador.El valor predeterminado es . + + + Obtiene o establece la colección de certificados de seguridad asociados a este controlador. + Devuelva .Colección de certificados de seguridad asociados a este controlador. + + + Obtiene o establece el contenedor de cookies que el controlador usa para almacenar cookies del servidor. + Devuelva .Contenedor de cookies que el controlador usa para almacenar cookies del servidor. + + + Obtiene o establece la información de autenticación utilizada por este controlador. + Devuelva .Credenciales de autenticación asociadas con el controlador.El valor predeterminado es null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el número máximo de redirecciones que seguirá el controlador. + Devuelva .El número máximo de respuestas de redirección que seguirá el controlador.El valor predeterminado es 50. + + + Obtiene o establece el tamaño máximo del búfer de contenido de solicitud usado por el controlador. + Devuelva .Tamaño máximo de búfer de contenido de la solicitud en bytes.El valor predeterminado es 2 gigabytes. + + + Obtiene o establece un valor que indica si el controlador envía un encabezado de autorización con la solicitud. + Devuelva .Es true para que el controlador envíe un encabezado de autorización HTTP con las solicitudes después de que tenga lugar la autenticación; de lo contrario, es false.El valor predeterminado es false. + + + Obtiene o establece la información de proxy que usa el controlador. + Devuelva .La información de proxy que usará el controlador.El valor predeterminado es null. + + + Crea una instancia de basándose en la información proporcionada en el objeto como una operación que no se bloqueará. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Obtiene un valor que indica si el controlador admite la descompresión automática del contenido de la respuesta. + Devuelva .true si el controlador admite la descompresión automática del contenido de la respuesta; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite valores de proxy. + Devuelva .true si el controlador admite valores de proxy; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite opciones de configuración para las propiedades y . + Devuelva .true si el controlador admite las opciones de configuración para las propiedades y ; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que indica si el controlador utiliza la propiedad para almacenar las cookies de servidor y utiliza estas cookies al enviar solicitudes. + Devuelva .true si el controlador admite el uso de la propiedad para almacenar las cookies de servidor y usa estas cookies al enviar solicitudes; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que controla si se envían las credenciales predeterminadas con las solicitudes del controlador. + Devuelva .Es true si se utilizan las credenciales predeterminadas; en cualquier otro caso, es false.El valor predeterminado es false. + + + Obtiene o establece un valor que indica si el controlador usa un proxy para las solicitudes. + Devuelva .true si el controlador debe usar un servidor proxy para las solicitudes; si no false.El valor predeterminado es true. + + + Indica si las operaciones de se consideran completadas cualquiera tan pronto como una respuesta esté disponible o después de leer el mensaje de respuesta completo, incluido el contenido. + + + La operación debe completarse después de leer toda la respuesta incluido el contenido. + + + La operación debe completarse tan pronto como haya una respuesta disponible y se lean los encabezados.El contenido no se ha leído aún. + + + Una clase base que representa un cuerpo de entidad y encabezados de contenido HTTP. + + + Inicializa una nueva instancia de la clase . + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Serializa el contenido HTTP en una secuencia de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene los encabezados de contenido HTTP tal como se define en RFC 2616. + Devuelva .Encabezados de contenido como se define en RFC 2616. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + El tamaño máximo, en bytes, del búfer que se va a utilizar. + + + Serializa el contenido HTTP en una matriz de bytes como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializar el contenido HTTP y devolver una secuencia que representa el contenido como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una cadena como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido HTTP tiene una longitud válida en bytes. + Devuelva .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Tipo base para los controladores de mensajes HTTP. + + + Inicializa una nueva instancia de la clase . + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase especializada que permite que las aplicaciones llamen al método en una cadena de controlador HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + true si Dispose() debe desechar el controlador interno,false si piensa reutilizar el controlador interno. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase auxiliar para recuperar y comparar métodos HTTP estándar y para crear nuevos métodos HTTP. + + + Inicializa una instancia nueva de la clase con un método HTTP específico. + Método HTTP. + + + Representa un método de protocolo HTTP DELETE. + Devuelva . + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Método HTTP que se va a comparar con el objeto actual. + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Objeto que se va a comparar con el objeto actual. + + + Representa un método de protocolo HTTP GET. + Devuelva . + + + Actúa como función hash para este tipo. + Devuelva .Código hash para el objeto actual. + + + Representa un método de protocolo HTTP HEAD.El método HEAD es idéntico a GET, excepto que el servidor sólo devuelve los encabezados de mensaje en la respuesta, sin el cuerpo del mensaje. + Devuelva . + + + Un método HTTP. + Devuelva .Un método HTTP representado como . + + + Operador de igualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados son iguales; en caso contrario, es false. + + izquierdo para un operador de igualdad. + + derecho para un operador de igualdad. + + + Operador de desigualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados no son iguales; en caso contrario, es false. + + izquierdo para un operador de desigualdad. + + derecho para un operador de desigualdad. + + + Representa un método de protocolo HTTP OPTIONS. + Devuelva . + + + Representa un método de protocolo POST HTTP, utilizado para enviar una entidad nueva como adición a un identificador URI. + Devuelva . + + + Representa un método de protocolo HTTP PUT, utilizado para reemplazar una entidad identificada por un identificador URI. + Devuelva . + + + Devuelve una cadena que representa el objeto actual. + Devuelva .Cadena que representa el objeto actual. + + + Representa un método de protocolo HTTP TRACE. + Devuelva . + + + Una clase base para las excepciones que producen las clases y . + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual. + Mensaje que describe la excepción actual. + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual y una excepción interna. + Mensaje que describe la excepción actual. + Excepción interna. + + + Representa un mensaje de solicitud HTTP. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Cadena que representa el objeto de solicitud. + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Objeto que se va a solicitar. + + + Obtiene o establece el contenido del mensaje HTTP. + Devuelve .Contenido de un mensaje. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene la colección de encabezados de la solicitud HTTP. + Devuelve .Colección de encabezados de la solicitud HTTP. + + + Obtiene o establece el método HTTP usado por el mensaje de solicitud HTTP. + Devuelve .Método HTTP usado por el mensaje de solicitud.El valor predeterminado es el método GET. + + + Obtiene un conjunto de propiedades de la solicitud HTTP. + Devuelve . + + + Obtiene o establece el usado para la solicitud HTTP. + Devuelve . que se usa para la solicitud HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Representa un mensaje de respuesta HTTP incluido el código de estado y los datos. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una instancia nueva de la clase con un específico. + Código de estado de la respuesta HTTP. + + + Obtiene o establece el contenido de texto de un mensaje de respuesta HTTP. + Devuelve .Contenido del mensaje de respuesta HTTP. + + + Libera los recursos no administrados y desecha los recursos no administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Se produce una excepción si la propiedad para la respuesta HTTP es false. + Devuelve .Mensaje de respuesta HTTP si la llamada es correcta. + + + Obtiene la colección de encabezados de respuesta HTTP. + Devuelve .Colección de encabezados de respuesta HTTP. + + + Obtiene un valor que indica si la respuesta HTTP se realizó correctamente. + Devuelve .Un valor que indica si la respuesta HTTP se realizó correctamente.true si estaba en el intervalo 200-299; si no false. + + + Obtiene o establece la frase de razón que envían normalmente los servidores junto con el código de estado. + Devuelve .La frase de la razón enviada por el servidor. + + + Obtiene o establece el mensaje de solicitud que condujo a este mensaje de respuesta. + Devuelve .El mensaje de solicitud que condujo a este mensaje de respuesta. + + + Obtiene o establece el código de estado de la respuesta HTTP. + Devuelve .Código de estado de la respuesta HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Un tipo base para los controladores que solo realizan un pequeño procesamiento de mensajes de solicitud y/o de respuesta. + + + Cree una instancia de una clase . + + + Crea una instancia de una clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Realiza el procesamiento en cada solicitud enviada al servidor. + Devuelve .Mensaje de solicitud HTTP que se procesó. + Mensaje de la solicitud HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Realiza el procesamiento en cada respuesta del servidor. + Devuelve .Mensaje de respuesta HTTP que se procesó. + Mensaje de respuesta HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El valor de era null. + + + Proporciona una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + + era null o solo contiene caracteres de espacios en blanco. + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + La cadena delimitadora para el contenido con varias partes. + + era null o una cadena vacía. era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agregue contenido con varias partes HTTP a una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Devuelve un enumerador que recorre en iteración la colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Serialice el contenido HTTP con varias partes en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Implementación explícita del método . + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Determina si el contenido HTTP con varias partes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Proporciona un contenedor para contenido codificado mediante el tipo MIME multipart/form-data. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + La cadena delimitadora para el contenido de los datos de formulario con varias partes. + + era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + + era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + Nombre del archivo para el contenido HTTP se va a agregar a la colección. + + era null o solo contiene caracteres de espacios en blanco.O bien era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Proporciona contenido HTTP basado en una secuencia. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Tamaño del búfer, en bytes, para . + El valor de era null. + + era menor o igual que cero. + + + Escribe el contenido de una secuencia HTTP en una secuencia de memoria como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido de la secuencia tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes del contenido de la secuencia. + + + Proporciona contenido HTTP basado en una cadena. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + Tipo de medio que se va a utilizar para el contenido. + + + Representa la información de autenticación en los valores de los encabezados Authorization, ProxyAuthorization, WWW-Authenticate y Proxy-Authenticate. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + Credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene las credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + Devuelve .Credenciales que contienen la información de autenticación. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene el esquema que se va a usar para la autorización. + Devuelve .El esquema que se va a usar para la autorización. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Cache-Control. + + + Inicializa una nueva instancia de la clase . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Tokens de extensión de caché, cada uno con un valor asignado opcional. + Devuelve .Colección de tokens de la extensión de memoria caché, cada uno con un valor asignado opcional. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Edad máxima, especificada en segundos, que el cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta que ha superado la fecha de expiración; si no, false. + + + Tiempo máximo, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .Tiempo en segundos. + + + Duración de la actualización, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta; si no, false. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “no-cache” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta. + Devuelve .true si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta; si no, false. + + + Si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad. + Devuelve .true si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad; si no, false. + + + Si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace). + Devuelve .true si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace); si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información no válida del valor de encabezado cache-control. + + es una referencia null. + + no es información válida del valor del encabezado de control de caché. + + + Si todo o parte del mensaje de respuesta HTTP está diseñado para un único usuario y no se debe almacenar en una memoria caché compartida. + Devuelve .true si el mensaje de respuesta HTTP está pensado para un único usuario y una memoria caché compartida no lo debe almacenar en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “privada” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta para memorias caché compartidas de agente de usuario. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta para memorias caché compartidas de agente de usuario; si no, false. + + + Si cualquier memoria caché puede almacenar una respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida. + Devuelve .true si cualquier memoria caché puede almacenar la respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida; si no, false. + + + La edad máxima compartida, especificada en segundos, en una respuesta HTTP que reemplaza la directiva de "max-age" en un encabezado cache-control o un encabezado Expires para una memoria caché compartida. + Devuelve .Tiempo en segundos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Disposition. + + + Inicializa una nueva instancia de la clase . + + . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Fecha y hora de creación del archivo. + Devuelve .Fecha de creación del archivo. + + + Tipo de disposición para una parte del cuerpo de contenido. + Devuelve .Tipo de disposición. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sugerencia sobre cómo crear un nombre de archivo para almacenar la carga del mensaje que se usará si la entidad se desasocia y se almacena un en archivo independiente. + Devuelve .Nombre de archivo sugerido. + + + Sugerencia sobre cómo crear un nombres de archivo para almacenar cargas de mensajes que se usará si las entidades se desasocian y se almacenan en un archivo independiente. + Devuelve .Nombre de archivo sugerido de filename* del formulario. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Fecha y hora de la última modificación del archivo. + Devuelve .Fecha de modificación del archivo. + + + Nombre de una parte del cuerpo de contenido. + Devuelve .Nombre de la parte del cuerpo de contenido. + + + Conjunto de parámetros incluidos el encabezado de Content-Disposition. + Devuelve .Colección de parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de disposición del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de disponibilidad de contenido. + + + Fecha en que se leyó el archivo por última vez. + Devuelve .Última fecha de lectura. + + + Tamaño aproximado del archivo en bytes. + Devuelve .Tamaño aproximado en bytes. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Range. + + + Inicializa una nueva instancia de la clase . + Punto inicial o final del intervalo, en bytes. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + Punto inicial o final del intervalo, en bytes. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición, en bytes, en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si el encabezado de Content-Range tiene una longitud especificada. + Devuelve .true si Content-Range tiene una longitud especificada; si no, false. + + + Obtiene si el Content-Range tiene un intervalo especificado. + Devuelve .true si Content-Range tiene un intervalo especificado; si no, false. + + + Obtiene la longitud del cuerpo de entidad completo. + Devuelve .La longitud del cuerpo de entidad completo. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de intervalo del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo del contenido. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Las unidades de intervalo usadas. + Devuelve . que contiene unidades de intervalo. + + + Representa un valor de encabezado de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + Un valor que indica si este encabezado de la etiqueta de entidad es un validador débil.Si el encabezado de la etiqueta de entidad es un validador débil, debe establecerse en true.Si el encabezado de la etiqueta de entidad es un validador seguro, debe establecerse en false. + + + Obtiene el valor del encabezado de la etiqueta de entidad. + Devuelve . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si la etiqueta de entidad es precedida por un indicador de punto débil. + Devuelve .true si la etiqueta de entidad va precedida por un indicador de punto débil; si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la etiqueta de entidad. + + es una referencia null. + + no es información válida del valor del encabezado de la etiqueta de entidad. + + + Obtiene la cadena entre comillas opaca. + Devuelve .Una cadena entrecomillada opaca. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa la colección de encabezados de contenido tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado de contenido Allow en una respuesta HTTP. + Devuelve .Valor del encabezado Allow en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Language en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Language en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Length en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Length en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Location en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Location en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Range en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Range en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Type en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Type en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Expires en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Expires en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Last-Modified en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Last-Modified en una respuesta HTTP. + + + Colección de encabezados y sus valores como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + + + Agrega el encabezado especificado y sus valores en la colección . + Encabezado que se agrega a la colección. + Lista de valores de encabezado que se agregan a la colección. + + + Agrega el encabezado especificado y su valor en la colección . + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Quita todos los encabezados de la colección de . + + + Devuelve si un encabezado concreto existe en la colección de . + Devuelve .true si el encabezado especificado existe en la colección; en caso contrario, false. + El encabezado específico. + + + Devuelve un enumerador que puede recorrer en iteración la instancia de . + Devuelve .Enumerador para . + + + Devuelve todos los valores de un encabezado especificado almacenado en la colección de . + Devuelve .Matriz de cadenas de encabezado. + El encabezado especificado para el que se van a devolver valores. + + + Quita el encabezado especificado de la colección de . + Devuelve . + Nombre del encabezado que se quitará de la colección. + + + Obtiene un enumerador que puede recorrer en iteración un objeto . + Devuelve .Una instancia de una implementación de que puede recorrer en iteración un objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Devuelve un valor que indica si el encabezado especificado y sus valores se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Valores del encabezado. + + + Devuelve un valor que indica si el encabezado especificado y su valor se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Se devuelve si un encabezado y determinados valores especificados se almacenan en la colección . + Devuelve .true es el de encabezado especificado y values se almacenan en la colección; si no false. + Encabezado especificado. + Valores de encabezado especificados. + + + Representa una colección de valores de encabezado. + Tipo de colección de encabezado. + + + Agrega una entrada al objeto . + Elemento que se agrega al encabezado especificada. + + + Quita todas las entradas de . + + + Determina si contiene un elemento. + Devuelve .true si la entrada está contenida en la instancia ; en caso contrario, false + Elemento para encontrar el encabezado especificada. + + + Copia la totalidad de en una matriz unidimensional compatible, comenzando en el índice especificado de la matriz de destino. + + unidimensional que constituye el destino de los elementos copiados de . debe tener una indización de base cero. + Índice de base cero de en el que empieza la operación de copia. + + + Obtiene el número de encabezados de la colección . + Devuelve .Número de encabezados de una colección. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Obtiene un valor que indica si la instancia de es de solo lectura. + Devuelve .true si la instancia de es de sólo lectura; en caso contrario, false. + + + Analiza y agrega una entrada a . + Entrada que se va a agregar. + + + Quita el elemento especificado de . + Devuelve .true si se ha quitado de la instancia ; en caso contrario, false. + Elemento que se va a quitar. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Devuelve una cadena que representa el objeto actual . + Devuelve .Cadena que representa el objeto actual. + + + Determina si la entrada se puede analizar y agregar a . + Devuelve .true si se puede analizar y agregar a la instancia ; de lo contrario, false + Entrada que se va a validar. + + + Representa la colección de encabezados de solicitud tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept para una solicitud HTTP. + Devuelve .Valor del encabezado Accept para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Charset para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Charset para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Encoding para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Language para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Language para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una solicitud HTTP. + Devuelve .Valor del encabezado Cache-Control para una solicitud HTTP. + + + Obtiene el valor del encabezado Connection para una solicitud HTTP. + Devuelve .Valor del encabezado Connection para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una solicitud HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una solicitud HTTP. + Devuelve .Valor del encabezado Date para una solicitud HTTP. + + + Obtiene el valor del encabezado Expect para una solicitud HTTP. + Devuelve .Valor del encabezado Expect para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Expect para una solicitud HTTP contiene Continuar. + Devuelve .true si el encabezado Expect contiene Continue, si no false. + + + Obtiene o establece el valor del encabezado From para una solicitud HTTP. + Devuelve .Valor del encabezado From para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Host para una solicitud HTTP. + Devuelve .Valor del encabezado Host para una solicitud HTTP. + + + Obtiene el valor del encabezado If-Match para una solicitud HTTP. + Devuelve .Valor del encabezado If-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Modified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Modified-Since para una solicitud HTTP. + + + Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + Devuelve .Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Range para una solicitud HTTP. + Devuelve .Valor del encabezado If-Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Unmodified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Unmodified-Since para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Max-Forwards para una solicitud HTTP. + Devuelve .Valor del encabezado Max-Forwards para una solicitud HTTP. + + + Obtiene el valor del encabezado Pragma para una solicitud HTTP. + Devuelve .Valor del encabezado Pragma para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Proxy-Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Proxy-Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Range para una solicitud HTTP. + Devuelve .Valor del encabezado Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Referer para una solicitud HTTP. + Devuelve .Valor del encabezado Referer para una solicitud HTTP. + + + Obtiene el valor del encabezado TE para una solicitud HTTP. + Devuelve .Valor del encabezado TE para una solicitud HTTP. + + + Obtiene el valor del encabezado Trailer para una solicitud HTTP. + Devuelve .Valor del encabezado Trailer para una solicitud HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una solicitud HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una solicitud HTTP. + Devuelve .Valor del encabezado Upgrade para una solicitud HTTP. + + + Obtiene el valor del encabezado User-Agent para una solicitud HTTP. + Devuelve .Valor del encabezado User-Agent para una solicitud HTTP. + + + Obtiene el valor del encabezado Via para una solicitud HTTP. + Devuelve .Valor del encabezado Via para una solicitud HTTP. + + + Obtiene el valor del encabezado Warning para una solicitud HTTP. + Devuelve .Valor del encabezado Warning para una solicitud HTTP. + + + Representa la colección de encabezados de respuesta tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept-Ranges para una respuesta HTTP. + Devuelve .Valor del encabezado Accept-Ranges para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Age para una respuesta HTTP. + Devuelve .Valor del encabezado Age para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una respuesta HTTP. + Devuelve .Valor del encabezado Cache-Control para una respuesta HTTP. + + + Obtiene el valor del encabezado Connection para una respuesta HTTP. + Devuelve .Valor del encabezado Connection para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una respuesta HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una respuesta HTTP. + Devuelve .Valor del encabezado Date para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado ETag para una respuesta HTTP. + Devuelve .Valor del encabezado ETag para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Location para una respuesta HTTP. + Devuelve .Valor del encabezado Location para una respuesta HTTP. + + + Obtiene el valor del encabezado Pragma para una respuesta HTTP. + Devuelve .Valor del encabezado Pragma para una respuesta HTTP. + + + Obtiene el valor del encabezado Proxy-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado Proxy-Authenticate para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Retry-After para una respuesta HTTP. + Devuelve .Valor del encabezado Retry-After para una respuesta HTTP. + + + Obtiene el valor del encabezado Server para una respuesta HTTP. + Devuelve .Valor del encabezado Server para una respuesta HTTP. + + + Obtiene el valor del encabezado Trailer para una respuesta HTTP. + Devuelve .Valor del encabezado Trailer para una respuesta HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una respuesta HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una respuesta HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una respuesta HTTP. + Devuelve .Valor del encabezado Upgrade para una respuesta HTTP. + + + Obtiene el valor del encabezado Vary para una respuesta HTTP. + Devuelve .Valor del encabezado Vary para una respuesta HTTP. + + + Obtiene el valor del encabezado Via para una respuesta HTTP. + Devuelve .Valor del encabezado Via para una respuesta HTTP. + + + Obtiene el valor del encabezado Warning para una respuesta HTTP. + Devuelve .Valor del encabezado Warning para una respuesta HTTP. + + + Obtiene el valor del encabezado WWW-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado WWW-Authenticate para una respuesta HTTP. + + + Representa un tipo de medio utilizado en un encabezado Content-Type como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El origen representado como una cadena para inicializar la nueva instancia. + + + Obtiene o define el juego de caracteres. + Devuelve .El juego de caracteres. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene o establece el valor de encabezado del tipo de medio. + Devuelve .El valor del encabezado media-type. + + + Obtiene o establece los parámetros del valor de encabezado del tipo de medio. + Devuelve .Los parámetros de valores de encabezado media-type. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del tipo de medio. + + es una referencia null. + + no es información válida del valor del encabezado del tipo de medio. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un tipo de medio con un factor de calidad adicional utilizado en un encabezado Content-Type. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + La calidad asociada a este valor de encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el tipo de medios con la información de valor de encabezado de calidad. + + es una referencia null. + + es el tipo de medio no válido con información de valor de encabezado de calidad. + + + Obtiene o establece el valor de calidad de . + Devuelve .Valor de calidad del objeto . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un par de nombre y valor utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre de encabezado. + Devuelve .Nombre del encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del valor de nombre. + + es una referencia null. + + no es información válida del valor del encabezado del valor de nombre. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de encabezado. + Devuelve .Valor del encabezado. + + + Representa un par de nombre y valor con parámetros utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros del objeto . + Devuelve .Una colección que contiene los parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el valor de nombre con la información de valor de encabezado del parámetro. + + es una referencia null. + + es un valor de nombre no válido con información de valor de encabezado de parámetro. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de token de producto en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Nombre del producto. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre del token de producto. + Devuelve .Nombre del token de producto. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del producto. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la versión del token de producto. + Devuelve .Versión del token de producto. + + + Representa un valor que puede ser un producto o un comentario en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un valor de comentario. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Obtiene el comentario del objeto . + Devuelve .El valor de comentario . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la información del producto. + + es una referencia null. + + no es información válida del valor del encabezado de la información del producto. + + + Obtiene el producto del objeto . + Devuelve .El valor de producto de este . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado If-Range que puede ser de fecha y hora o de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Un valor de datos utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una etiqueta de entidad representada como cadena utilizada para inicializar la nueva instancia. + + + Obtiene la fecha del objeto . + Devuelve .La fecha del objeto . + + + Obtiene la etiqueta de entidad del objeto . + Devuelve .La etiqueta de entidad del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de intervalo. + + es una referencia null. + + no es información del valor del encabezado de la condición de intervalo. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un intervalo de bytes. + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del intervalo. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo. + + + Obtiene los intervalos especificados en el objeto . + Devuelve .Los intervalos del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la unidad del objeto . + Devuelve .La unidad del objeto . + + + Representa un intervalo de bytes en un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Representa un valor de encabezado Retry-After que puede ser de fecha y hora o de duración. + + + Inicializa una nueva instancia de la clase . + Desplazamiento de fecha y hora utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El delta, en segundos, utilizado para inicializar la nueva instancia. + + + Obtiene el desplazamiento de fecha y hora desde el objeto . + Devuelve .Desplazamiento de fecha y hora desde el objeto . + + + Obtiene el delta en segundos del objeto . + Devuelve .El delta en segundos del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de reintento. + + es una referencia null. + + no es información válida del valor del encabezado de la condición de reintento. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado de cadena con una calidad opcional. + + + Inicializa una nueva instancia de la clase . + La cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un factor de calidad utilizado para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de calidad. + + es una referencia null. + + es una cadena no válida con información de encabezado de valor de encabezado de calidad. + + + Obtiene el factor de calidad del objeto . + Devuelve .EL factor de calidad del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de cadena del objeto . + Devuelve .El valor de cadena del objeto . + + + Representa un valor de encabezado Accept-Encoding. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros de codificación de transferencia. + Devuelve .Los parámetros de codificación de transferencia. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de codificación de transferencia. + + es una referencia null. + + no es información válida del valor del encabezado de codificación de transferencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de codificación de transferencia. + Devuelve .El valor de codificación de transferencia. + + + Representa un valor del encabezado Accept-Encoding con factor de calidad opcional. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un valor para el factor de calidad. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor de codificación de transferencia. + + es una referencia null. + + es una codificación de transferencia no válida con información de valor de encabezado de calidad. + + + Obtiene el factor de calidad de . + Devuelve .El factor de calidad de . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor de un encabezado Via. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Obtiene el campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + Devuelve .El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Devuelve un código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa a través de la información del valor del encabezado. + + es una referencia null. + + no es información válida a través de la información del valor del encabezado. + + + Obtiene el nombre de protocolo del protocolo recibido. + Devuelve .Nombre del protocolo. + + + Obtiene la versión de protocolo del protocolo recibido. + Devuelve .Versión de protocolo. + + + Obtiene el host y el puerto donde se recibió la solicitud o la respuesta. + Devuelve .El host y el puerto donde se recibió la solicitud o la respuesta. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de advertencia utilizado por el encabezado Warning. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + Marca de tiempo de la advertencia. + + + Obtiene el host que adjuntó la advertencia. + Devuelve .El host que adjuntó la advertencia. + + + Obtiene el código de la advertencia específico. + Devuelve .El código de la advertencia específico. + + + Obtiene la marca de tiempo de la advertencia. + Devuelve .Marca de tiempo de la advertencia. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve una instancia . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene una cadena entre comillas que contiene el texto de advertencia. + Devuelve .Una cadena entre comillas que contiene el texto de advertencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/fr/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/fr/a new file mode 100644 index 00000000000..95484975134 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/fr/a @@ -0,0 +1,2361 @@ + + + + System.Net.Http + + + + Fournit du contenu HTTP basé sur un tableau d'octets. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Le paramètre est null. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Décalage, en octets, dans le paramètre utilisé pour initialiser . + Nombre d'octets dans le en commençant par le paramètre utilisé pour initialiser . + Le paramètre est null. + Le paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre.ouLe paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre . + + + Crée un flux de contenu HTTP en tant qu'opération asynchrone pour la lecture dont le magasin de stockage est lié au . + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise et écrit le tableau d'octets fourni dans le constructeur pour un flux de contenu HTTP sous forme d'une opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport, (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si un tableau d'octets a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur, en octets, du tableau d'octets. + + + Spécifie la façon dont les certificats clients sont fournis. + + + + tentera de fournir automatiquement tous les certificats client disponibles. + + + L'application fournit manuellement les certificats clients au .Cette valeur est celle par défaut. + + + Type pour les gestionnaires HTTP qui délèguent le traitement des messages de réponse HTTP à un autre gestionnaire, appelé le gestionnaire interne. + + + Crée une instance de la classe . + + + Crée une instance de la classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Libère les ressources non managées utilisées par et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le gestionnaire interne qui traite les messages de réponse HTTP. + retourne  ;Gestionnaire interne des messages de réponse HTTP. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation pour annuler une opération. + + était null. + + + Conteneur pour les tuples nom/valeur encodés en utilisant le type MIME application/x-www-form-urlencoded. + + + Initialise une nouvelle instance de la classe avec une collection de paires nom/valeur spécifique. + Collection de paires nom/valeur. + + + Fournit une classe de base pour envoyer des requêtes HTTP et recevoir des réponses HTTP d'une ressource identifiée par un URI. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + Pile du gestionnaire HTTP à utiliser pour envoyer des demandes. + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Obtient ou définit l'adresse de base de l'URI de la ressource Internet utilisée pour envoyer des demandes. + Retourne .Adresse de base de l'URI de la ressource Internet utilisée pour l'envoi des demandes. + + + Annulez toutes les demandes en attente sur cette instance. + + + Obtient les en-têtes qui doivent être envoyés avec chaque demande. + Retourne .En-têtes qui doivent être envoyés avec chaque demande. + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Obtient ou définit le nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse. + Retourne .Nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse.La valeur par défaut de cette propriété est 2 gigaoctets. + La taille spécifiée est inférieure ou égale à zéro. + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Obtient ou définit la période d'attente jusqu'à l'expiration de la demande. + Retourne .Période d'attente jusqu'à l'expiration de la demande. + Le délai d'attente spécifié est inférieur ou égal à zéro et n'est pas . + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Gestionnaire de messages par défaut utilisé par . + + + Crée une instance d'une classe . + + + Obtient ou définit une valeur qui indique si le gestionnaire doit suivre les réponses de redirection. + retourne  ;true si le gestionnaire doit suivre les réponses de redirection ; sinon false.La valeur par défaut est true. + + + Obtient ou définit le type de méthode de décompression utilisé par le gestionnaire pour la décompression automatique de la réponse de contenu HTTP. + retourne  ;Méthode de décompression automatique utilisée par le gestionnaire.La valeur par défaut est . + + + Obtient ou définit la collection de certificats de sécurité qui sont associés à ce gestionnaire. + retourne  ;Collection de certificats de sécurité associés à ce gestionnaire. + + + Obtient ou définit le conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + retourne  ;Conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + + + Obtient ou définit les informations d'authentification utilisées par ce gestionnaire. + retourne  ;Informations d'authentification associées au gestionnaire.La valeur par défaut est null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le nombre maximal de redirections suivies par le gestionnaire. + retourne  ;Nombre maximal de réponses de redirection suivies par le gestionnaire.La valeur par défaut est 50. + + + Obtient ou définit la taille maximale de mémoire tampon de contenu demandée utilisée par le gestionnaire. + retourne  ;Taille maximale de mémoire tampon de contenu en octets.La valeur par défaut est 2 gigaoctets. + + + Obtient ou définit une valeur indiquant si le gestionnaire envoie un en-tête d'autorisation avec la requête. + retourne  ;true pour que le gestionnaire envoie un en-tête HTTP d'autorisation avec les requêtes une fois l'authentification exécutée ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit les informations de proxy utilisées par le gestionnaire. + retourne  ;Informations de proxy utilisées par le gestionnaire.La valeur par défaut est null. + + + Crée une instance de en fonction des informations fournies dans le en tant qu'opération qui ne se bloque pas. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP. + Jeton d'annulation pour annuler l'opération. + + était null. + + + Obtient une valeur qui indique si le gestionnaire prend en charge la décompression de contenu de réponse automatique. + retourne  ;true si le gestionnaire prend en charge la décompression de contenu de réponse automatique ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres du proxy. + retourne  ;true si le gestionnaire prend en charge les paramètres de proxy ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et . + retourne  ;true si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et  ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise la propriété pour stocker des cookies de serveur et utilise ces cookies en envoyant les demandes. + retourne  ;true si le gestionnaire utilise la propriété pour stocker des cookies de serveur, et utilise ces cookies lors de l'envoi de requêtes ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui contrôle si les informations d'identification par défaut sont envoyées avec les requêtes par le gestionnaire. + retourne  ;true si les informations d'identification par défaut sont utilisées ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise un proxy pour les demandes. + retourne  ;true si le gestionnaire utilise un proxy pour les demandes ; sinon false.La valeur par défaut est true. + + + Indique si les opérations doivent être considérées comme étant terminées dès qu'une réponse est disponible, ou après avoir pris connaissance de l'intégralité du message de réponse intégrant le contenu. + + + L'opération doit se terminer après la lecture de l'intégralité de la réponse intégrant le contenu. + + + L'opération doit se terminer dès qu'une réponse est disponible et que les en-têtes sont lus.Le contenu n'est pas encore lu. + + + Classe de base représentant un corps d'entité HTTP et les en-têtes de contenu. + + + Initialise une nouvelle instance de la classe . + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Sérialise le contenu HTTP dans un flux de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient les en-têtes de contenu HTTP, tels que définis dans la norme RFC 2616. + retourne  ;En-têtes de contenu, tels que définis dans RFC 2616. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Taille maximale, en octets, de la mémoire tampon à utiliser. + + + Sérialise le contenu HTTP dans un tableau d'octets sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP et retourne un flux qui représente le contenu comme une opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans une chaîne sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Type de base pour les gestionnaires de message HTTP. + + + Initialise une nouvelle instance de la classe . + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe spécialisée qui permet aux applications d'appeler la méthode sur une chaîne de gestionnaire HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe d'assistance pour récupérer et comparer les méthodes HTTP standard et pour créer de nouvelles méthodes HTTP. + + + Initialise une nouvelle instance de la classe avec une méthode HTTP spécifique. + Méthode HTTP. + + + Représente une méthode de protocole HTTP DELETE. + retourne  ; + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Méthode HTTP à comparer à l'objet actif. + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Objet à comparer avec l'objet actif. + + + Représente une méthode de protocole HTTP GET. + retourne  ; + + + Sert de fonction de hachage pour ce type. + retourne  ;Code de hachage du en cours. + + + Représente une méthode de protocole HTTP HEAD.La méthode HEAD est identique à GET, mais le serveur retourne uniquement des en-têtes de message dans la réponse, sans corps du message. + retourne  ; + + + Méthode HTTP. + retourne  ;Méthode HTTP représentée en tant que . + + + Opérateur d'égalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et sont égaux ; sinon, false. + + gauche d'un opérateur d'égalité. + + droit pour un opérateur d'égalité. + + + Opérateur d'inégalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et ne sont pas égaux ; sinon, false. + + gauche d'un opérateur d'inégalité. + + droit pour un opérateur d'inégalité. + + + Représente une méthode de protocole HTTP OPTIONS. + retourne  ; + + + Représente une méthode de protocole HTTP POST utilisée pour publier une nouvelle entité en plus d'un URI. + retourne  ; + + + Représente une méthode de protocole HTTP PUT utilisée pour remplacer une entité identifiée par un URI. + retourne  ; + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une méthode de protocole HTTP TRACE. + retourne  ; + + + Classe de base pour les exceptions levées par les classes et . + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un message spécifique qui décrit l'exception actuelle. + Message qui décrit l'exception en cours. + + + Initialise une nouvelle instance de la classe avec un message spécifique décrivant l'exception actuelle et une exception interne. + Message qui décrit l'exception en cours. + Exception interne. + + + Représente un message de requête HTTP. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + Chaîne qui représente la requête . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + + à demander. + + + Obtient ou définit le contenu du message HTTP. + retourne  ;Contenu d'un message. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient la collection d'en-têtes de requête HTTP. + retourne  ;Collection d'en-têtes de demande HTTP. + + + Obtient ou définit la méthode HTTP utilisée par le message de requête HTTP. + retourne  ;Méthode HTTP utilisée par le message de requête.La valeur par défaut est la méthode GET. + + + Obtient un ensemble de propriétés pour la requête HTTP. + retourne  ; + + + Obtient ou définit l' utilisé pour la requête HTTP. + retourne  ; utilisé pour la requête HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Représente un message de réponse HTTP avec le code et les données d'état. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un spécifique. + Code d'état de la réponse HTTP. + + + Obtient ou définit le contenu d'un message de réponse HTTP. + retourne  ;Contenu du message de réponse HTTP. + + + Libère les ressources non managées et supprime les ressources non managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Lève une exception si la propriété de la réponse HTTP est false. + retourne  ;Message de réponse HTTP si l'appel a réussi. + + + Obtient la collection d'en-têtes de réponse HTTP. + retourne  ;Collection d'en-têtes de réponse HTTP. + + + Obtient une valeur qui indique si la réponse HTTP a abouti. + retourne  ;Valeur qui indique si la réponse HTTP a abouti.true si était compris entre 200 et 299 ; sinon false. + + + Obtient ou définit l'expression de raison qui en général est envoyée par les serveurs avec le code d'état. + retourne  ;Expression de raison envoyée par le serveur. + + + Obtient ou définit le message de demande qui a conduit à ce message de réponse. + retourne  ;Message de requête qui a conduit à ce message de réponse. + + + Obtient ou définit le code d'état de la réponse HTTP. + retourne  ;Code d'état de la réponse HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Type de base pour les gestionnaires qui traitent uniquement des messages de demande et/ou de réponse. + + + Crée une instance d'une classe . + + + Crée une instance d'une classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Exécute le traitement sur chaque demande envoyée au serveur. + retourne  ;Message de requête HTTP qui a été traité. + Message de la requête HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Exécute le traitement sur chaque réponse du serveur. + retourne  ;Message de réponse HTTP qui a été traité. + Message de réponse HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Fournit une collection d'objets qui sont sérialisés à l'aide de la spécification de type de contenu multipart/*. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + La a la valeur null ou ne contient que des espaces blancs. + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + Chaîne limite pour le contenu Multipart. + Le était null ou était une chaîne vide.La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu multipart HTTP à une collection d'objets de qui sont sérialisés à l'aide de la spécification de type de contenu multipart/* + Contenu HTTP à ajouter à la collection. + + était null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Retourne un énumérateur qui itère dans la collection d'objets qui sont sérialisés à l'aide de la spécification du type de contenu multipart/*. + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Sérialise le contenu multipart HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Implémentation explicite de la méthode . + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Détermine si le contenu multipart HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Fournit un conteneur pour le contenu encodé à l'aide du type MIME multipart/form-data. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Chaîne limite pour le contenu multipart/form-data. + La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + La a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + Nom de fichier du contenu HTTP à ajouter à la collection. + La a la valeur null ou ne contient que des espaces blancs.ouLa a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Fournit du contenu HTTP basé sur un flux. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Taille, en octets, de la mémoire tampon disponible pour . + + était null. + + était inférieur ou égal à zéro. + + + Écrit le contenu de flux HTTP dans un flux de mémoire sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu de flux a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du flux de contenu. + + + Fournit du contenu HTTP basé sur une chaîne. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + Type de média à utiliser pour le contenu. + + + Représente les informations d'identification dans les valeurs d'en-tête Authorization, ProxyAuthorization, WWW-Authenticate et Proxy-Authenticate. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + Informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + retourne  ;Informations d'authentification contenant les informations d'authentification. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient le schéma à utiliser pour l'autorisation. + retourne  ;Schéma à utiliser pour l'autorisation. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Cache-Control. + + + Initialise une nouvelle instance de la classe . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Jetons d'extension en cache ayant chacun une valeur assignée facultative. + retourne  ;Collection de jetons d'extension en cache ayant chacun une valeur assignée facultative. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Durée maximale, exprimée en secondes, pendant laquelle le client HTTP est prêt à accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;true si le client HTTP est prêt à accepter une réponse ayant dépassé le délai d'attente ; sinon, false. + + + Durée maximale, en secondes, pendant laquelle un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;Durée en secondes. + + + Durée de vie d'actualisation, en secondes, pendant laquelle un client HTTP peut accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée. + retourne  ;true si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée ; sinon, false. + + + Indique si un client HTTP est prêt à accepter une réponse mise en cache. + retourne  ;true si le client HTTP est prêt à accepter une réponse mise en cache ; sinon, false. + + + Collection de fieldname dans la directive "no-cache" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si un cache ne doit stocker aucune partie du message de requête HTTP ou aucune réponse. + retourne  ;true si un cache ne doit stocker aucune partie du message de requête HTTP ou d'une réponse ; sinon, false. + + + Indique si un cache ou un proxy ne doit modifier aucun aspect du corps d'entité. + retourne  ;true si un cache ou un proxy ne doivent modifier aucun aspect du corps d'entité ; sinon, false. + + + Indique si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle). + retourne  ;true si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle) ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de contrôle de cache. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de contrôle de cache valides. + + + Indique si l'ensemble ou une partie du message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé. + retourne  ;true si le message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé ; sinon, false. + + + FieldNames de collection dans la directive "privée" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée de cache est périmée pour les caches d'agent utilisateur partagés. + retourne  ;true si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée est périmée pour les caches d'agent utilisateur partagés ; sinon, false. + + + Indique si une réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé. + retourne  ;true si la réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé ; sinon, false. + + + Âge maximal partagé, en secondes, dans une réponse HTTP qui substitue la directive « max-age » dans un en-tête de contrôle du cache ou dans un en-tête Expires d'un cache partagé. + retourne  ;Durée en secondes. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Disposition. + + + Initialise une nouvelle instance de la classe . + + + + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Date de création du fichier. + retourne  ;Date de création du fichier. + + + Type de disposition d'un élément de corps de contenu. + retourne  ;Type de disposition. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Suggestion sur la façon dont construire un Filename pour stocker la charge de message à utiliser si l'entité est détachée et stockée dans un fichier séparé. + retourne  ;Filename suggéré. + + + Suggestion sur la façon dont construire des Filenames pour stocker des charges de messages à utiliser si les entités sont détachées et stockées dans des fichiers séparés. + retourne  ;Filename suggéré du nom de fichier* de formulaire. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Date de modification du fichier. + retourne  ;Date de modification du fichier. + + + Nom d'un élément de corps de contenu. + retourne  ;Nom de l'élément de corps du contenu. + + + Un jeu de paramètres a inclus l'en-tête de Content-Disposition. + retourne  ;Collection de paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de disposition de contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de disposition de contenu valides. + + + Date de la dernière lecture du fichier. + retourne  ;Date de la dernière lecture. + + + Taille approximative du fichier, en octets. + retourne  ;Taille approximative, en octets. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Range. + + + Initialise une nouvelle instance de la classe . + Point de départ ou de fin de la plage, en octets. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + Point de départ ou de fin de la plage, en octets. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position, en octets, à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si une longueur est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la longueur de Content-Range est spécifiée ; sinon, false. + + + Obtient une valeur indiquant si une plage est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la plage de Content-Range est spécifiée ; sinon, false. + + + Obtient la longueur du corps d'entité entier. + retourne  ;Longueur du corps d'entité entier. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage du contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage de contenu valides. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Unités de plage utilisées. + retourne  ; qui contient des unités de plage. + + + Représente une valeur d'en-tête de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + Valeur qui indique si cet en-tête de balise d'entité est un validateur faible.Si l'en-tête de la balise d'entité est un validateur faible, doit avoir la valeur true.Si l'en-tête de la balise d'entité est un validateur fort, doit avoir la valeur false. + + + Obtient la valeur d'en-tête de la balise d'entité. + retourne  ; + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si la balise d'entité est précédée d'un indicateur de faiblesse. + retourne  ;true si la balise d'entité est préfacée par un indicateur de faiblesse ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de balise d'entité. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de balise d'entité valides. + + + Obtient la chaîne entre guillemets opaque. + retourne  ;Chaîne entre guillemets opaque. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la collection d'en-têtes de contenu comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête de contenu Allow sur une réponse HTTP. + retourne  ;Valeur de l'en-tête Allow sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Expires sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Expires sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + + + Collection d'en-têtes et de leurs valeurs tels que définis dans RFC 2616. + + + Initialise une nouvelle instance de la classe . + + + Ajoute l'en-tête spécifié et ses valeurs dans la collection de . + En-tête à ajouter à la collection. + Liste des valeurs d'en-tête à ajouter à la collection. + + + Ajoute l'en-tête spécifié et sa valeur dans la collection de . + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Supprime tous les en-têtes de la collection . + + + Retourne si un en-tête spécifique existe dans la collection . + retourne  ;true si l'en-tête spécifié existe dans la collection ; sinon false. + En-tête spécifique. + + + Retourne un énumérateur qui peut itérer au sein de l'instance de . + retourne  ;Énumérateur pour . + + + Retourne toutes les valeurs d'en-tête pour un en-tête spécifié stockées dans la collection . + retourne  ;Tableau de chaînes d'en-tête. + En-tête spécifié pour lequel retourner les valeurs. + + + Supprime l'en-tête spécifié de la collection . + retourne  ; + Nom de l'en-tête à supprimer de la collection. + + + Obtient un énumérateur pouvant itérer au sein de . + retourne  ;Instance d'une implémentation de pouvant itérer au sein de . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Retourne une valeur qui indique si l'en-tête spécifié et ses valeurs ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Valeur de l'en-tête. + + + Retourne une valeur qui indique si l'en-tête spécifié et sa valeur ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Retourne si un en-tête spécifié et les valeurs spécifiées sont stockés dans la collection . + retourne  ;true signifie que les en-têtes spécifiés et values sont stockés dans la collection ; sinon false. + En-tête spécifié. + Valeurs des en-têtes spécifiées. + + + Représente une collection de valeurs d'en-tête. + Type de collection d'en-têtes. + + + Ajoute une entrée à . + Élément à ajouter à la collection d'en-têtes. + + + Supprime toutes les entrées de . + + + Détermine si le contient un élément. + retourne  ;true si l'entrée contient l'instance  ; sinon, false. + Élément à rechercher dans la collection d'en-têtes. + + + Copie l'ensemble de l'objet vers un objet unidimensionnel compatible, en commençant à l'index spécifié du tableau cible. + + unidimensionnel qui constitue la destination des éléments copiés à partir d'. doit avoir une indexation de base zéro. + Index de base zéro dans à partir duquel la copie commence. + + + Obtient le nombre d'en-têtes contenus dans . + retourne  ;Nombre d'en-têtes contenus dans une collection. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Obtient une valeur indiquant si l'instance est en lecture seule. + retourne  ;true si l'instance du est en lecture seule ; sinon, false. + + + Analyse et ajoute une entrée à . + Entrée à ajouter. + + + Enlève l'élément spécifié du . + retourne  ;true si a été correctement supprimé de l'instance  ; sinon, false. + Élément à supprimer. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si l'entrée peut être analysée et ajoutée à . + retourne  ;true si peut être analysé et ajouté à l'instance . Sinon, false + Entrée à valider. + + + Représente la collection d'en-têtes de requête comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Charset pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Charset pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Encoding pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Language pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Language pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une requête HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une requête HTTP. + + + Obtient la valeur de l'en-tête Connection pour une requête HTTP. + retourne  ;Valeur de l'en-tête Connection pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une requête HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une requête HTTP. + retourne  ;Valeur de l'en-tête Date pour une requête HTTP. + + + Obtient la valeur de l'en-tête Expect pour une requête HTTP. + retourne  ;Valeur de l'en-tête Expect pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Expect pour une requête HTTP contient Continue. + retourne  ;true si l'en-tête Expect contient Continue ; sinon false. + + + Obtient ou définit la valeur de l'en-tête From pour une requête HTTP. + retourne  ;Valeur de l'en-tête From pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Host pour une requête HTTP. + retourne  ;Valeur de l'en-tête Host pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-Match pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Modified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Modified-Since pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + retourne  ;Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Max-Forwards pour une requête HTTP. + retourne  ;Valeur de l'en-tête Max-Forwards pour une requête HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une requête HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Referer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Referer pour une requête HTTP. + + + Obtient la valeur de l'en-tête TE pour une requête HTTP. + retourne  ;Valeur de l'en-tête TE pour une requête HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une requête HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une requête HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une requête HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une requête HTTP. + + + Obtient la valeur de l'en-tête User-Agent pour une requête HTTP. + retourne  ;Valeur de l'en-tête User-Agent pour une requête HTTP. + + + Obtient la valeur de l'en-tête Via pour une requête HTTP. + retourne  ;Valeur de l'en-tête Via pour une requête HTTP. + + + Obtient la valeur de l'en-tête Warning pour une requête HTTP. + retourne  ;Valeur de l'en-tête Warning pour une requête HTTP. + + + Représente la collection d'en-têtes de réponse comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Age pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Age pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Connection pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Connection pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une réponse HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Date pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête ETag pour une réponse HTTP. + retourne  ;Valeur de l'en-tête ETag pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Location pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Location pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Retry-After pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Retry-After pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Server pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Server pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une réponse HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Vary pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Vary pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Via pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Via pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Warning pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Warning pour une réponse HTTP. + + + Obtient la valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + + + Représente un type de média utilisé dans un en-tête Content-Type défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Source représentée sous forme de chaîne pour initialiser la nouvelle instance. + + + Obtient ou définit le jeu de caractères. + retourne  ;Jeu de caractères. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient ou définit la valeur de l'en-tête de type de média. + retourne  ;Valeur d'en-tête de type média. + + + Obtient ou définit les paramètres de la valeur d'en-tête de type de média. + retourne  ;Paramètres des valeurs d'en-tête de type média. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du type de média. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de type de média valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente un type de média avec une considération de qualité supplémentaire, utilisé dans un en-tête Content-Type. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + Qualité associée à cette valeur d'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente le type de média avec les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas un type de média valide avec des informations de valeur d'en-tête de qualité. + + + Obtenir ou définir le critère de qualité pour . + retourne  ;Critère de qualité pour l'objet . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une paire nom/valeur utilisée dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom de l'en-tête. + retourne  ;Nom de l'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la valeur de nom. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de valeur de nom valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de l'en-tête. + retourne  ;Valeur de l'en-tête. + + + Représente une paire nom/valeur avec des paramètres utilisés dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres de l'objet . + retourne  ;Collection contenant les paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne représentant la valeur de nom avec les informations de valeur d'en-tête de paramètre. + + est une référence null. + + n'est pas une valeur de nom valide avec des informations de valeur d'en-tête de paramètre. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur de jeton de produit dans un en-tête d'agent utilisateur. + + + Initialise une nouvelle instance de la classe . + Nom du produit. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom du jeton du produit. + retourne  ;Nom du jeton de produit. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du produit. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la version du jeton du produit. + retourne  ;Version du jeton de produit. + + + Représente une valeur qui peut être un produit ou un commentaire dans un en-tête User-Agent. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Valeur de commentaire. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Obtient le commentaire de l'objet . + retourne  ;Valeur de commentaire de ce . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête des informations. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'informations produit valides. + + + Obtient le produit de l'objet . + retourne  ;Valeur de produit de cet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête If-Range qui peut être une date, une heure ou une valeur de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Valeur de date utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Balise d'entité représentée sous forme de chaîne utilisée pour initialiser la nouvelle instance. + + + Obtient la date de l'objet . + retourne  ;Date de l'objet . + + + Obtient la balise d'entité de l'objet . + retourne  ;Balise d'entité de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de plage valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une plage d'octets. + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage valides. + + + Obtient les plages spécifiées à partir de l'objet . + retourne  ;Plages de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient l'unité de l'objet . + retourne  ;Unité de l'objet . + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une valeur d'en-tête Retry-After qui peut être une date, une heure ou une valeur TimeSpan. + + + Initialise une nouvelle instance de la classe . + Offset de la date et de l'heure utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Différentiel, en secondes, utilisé pour initialiser la nouvelle instance. + + + Obtient l'offset de la date et de l'heure de l'objet . + retourne  ;Offset de la date et de l'heure de l'objet . + + + Obtient le delta en secondes de l'objet . + retourne  ;Différentiel en secondes de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de nouvelle tentative. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de nouvelle tentative valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de chaîne avec une qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Considération de qualité utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas une chaîne valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de l'objet . + retourne  ;Considération de qualité de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de chaîne de l'objet . + retourne  ;Valeur de chaîne de l'objet . + + + Représente une valeur d'en-tête Accept-Encoding. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres d'encodage de transfert. + retourne  ;Paramètres d'encodage de transfert. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de l'encodage de transfert. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'encodage de transfert valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur d'encodage de transfert. + retourne  ;Valeur d'encodage de transfert. + + + Représente une valeur d'en-tête Accept-Encoding avec une considération de qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Valeur pour la considération de qualité. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur de l'encodage de transfert. + + est une référence null. + + n'est pas un encodage de transfert valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de . + retourne  ;Considération de qualité de . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur d'un en-tête Via. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Obtient le champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire + retourne  ;Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Retourne un code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête. + + est une référence null. + + n'est pas valide pour les informations de valeur d'en-tête. + + + Obtient le nom de protocole du protocole reçu. + retourne  ;Le nom du protocole. + + + Obtient la version de protocole du protocole reçu. + retourne  ;Version du protocole. + + + Obtient l'hôte et le port via lesquels la requête ou la réponse a été reçue. + retourne  ;Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'avertissement utilisée par l'en-tête Warning. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + Les informations de date et d'heure de l'avertissement. + + + Obtient l'hôte ayant attaché l'avertissement. + retourne  ;Hôte ayant attaché l'avertissement. + + + Obtient le code d'avertissement spécifique. + retourne  ;Code d'avertissement spécifique. + + + Obtient les informations de date et d'heure de l'avertissement. + retourne  ;Les informations de date et d'heure de l'avertissement. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + Retourne une instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient une chaîne entre guillemets contenant le texte d'avertissement. + retourne  ;Chaîne entre guillemets contenant le texte d'avertissement. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/it/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/it/a new file mode 100644 index 00000000000..3a2ca25d00f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/it/a @@ -0,0 +1,2310 @@ + + + + System.Net.Http + + + + Fornisce il contenuto HTTP basato su una matrice di byte. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Il parametro è null. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Offset, in byte, nel parametro utilizzato per inizializzare l'oggetto . + Numero di byte in a partire dal parametro utilizzato per inizializzare . + Il parametro è null. + Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro .- oppure -Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro , meno il parametro . + + + Crea un flusso di contenuto HTTP come operazione asincrona per la lettura il cui archivio di backup è la memoria di . + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare e scrivere la matrice di byte fornita nel costruttore in un flusso di contenuto HTTP come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto, quali il token di associazione del canale.Il parametro può essere null. + + + Determina se una matrice di byte ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte della matrice di byte. + + + Specifica come i certificati client vengono forniti. + + + L'oggetto tenterà di fornire tutti i certificati client disponibili automaticamente. + + + L'applicazione manualmente fornisce i certificati client a .Questo valore è quello predefinito. + + + Tipo per gestori HTTP che delegano l'elaborazione dei messaggi di risposta HTTP a un altro gestore, chiamato gestore interno. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il gestore interno che elabora i messaggi di risposta HTTP. + Restituisce .Il gestore interno per i messaggi di risposta HTTP. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Contenitore per le tuple nome/valore codificate utilizzando il tipo MIME application/x-www-form-urlencoded. + + + Inizializza una nuova istanza della classe con una raccolta di coppie nome/valore specifica. + Raccolta di coppie nome/valore. + + + Fornisce una classe base per l'invio di richieste HTTP e la ricezione di risposte HTTP da una risorsa identificata da un URI. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un gestore specifico. + Stack del gestore HTTP da usare per inviare le richieste. + + + Inizializza una nuova istanza della classe con un gestore specifico. + Oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(), false se si intende riutilizzare il gestore interno. + + + Ottiene o imposta l'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + Restituisce .L'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + + + Annullare tutte le richieste in sospeso in questa istanza. + + + Ottiene le intestazioni che devono essere inviate con ogni richiesta. + Restituisce .Intestazioni da inviare con ogni richiesta. + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Rilascia le risorse non gestite usate da e, facoltativamente, elimina le risorse gestite. + true per rilasciare sia le risorse gestite sia quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Ottiene o imposta il numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta. + Restituisce .Numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta.Il valore predefinito di questa proprietà è 2 gigabyte. + La dimensione specificata è minore o uguale a zero. + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Ottiene o imposta l'intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Restituisce .Intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Il timeout specificato è minore o uguale a zero e non rappresenta il campo . + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Il gestore messaggi predefinito utilizzato da . + + + Crea un'istanza di una classe . + + + Recupera o imposta un valore che indica se il gestore deve seguire le risposte di reindirizzamento. + Restituisca il valore .true se il gestore deve seguire le risposte di reindirizzamento; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta il tipo di metodo di decompressione utilizzato dal gestore per la decompressione automatica della risposta del contenuto HTTP. + Restituisca il valore .Il metodo automatico di decompressione utilizzato dal gestore.Il valore predefinito è . + + + Ottiene o imposta la raccolta dei certificati di sicurezza associati al gestore. + Restituisca il valore .Raccolta di certificati di sicurezza associati a questo gestore. + + + Ottiene o imposta il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + Restituisca il valore .Il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + + + Ottiene o imposta le informazioni di autenticazione utilizzate da questo gestore. + Restituisca il valore .Credenziali di autenticazione associate al gestore.Il valore predefinito è null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il numero massimo di reindirizzamenti che il gestore segue. + Restituisca il valore .Numero massimo di risposte di reindirizzamento seguite dal gestore.Il valore predefinito è 50. + + + Ottiene o imposta la dimensione massima del buffer di contenuto della richiesta utilizzato dal gestore. + Restituisca il valore .Dimensione massima in byte del buffer di contenuto della richiesta.Il valore predefinito è 2 gigabyte. + + + Ottiene o imposta un valore che indica se il gestore invia un'intestazione di autorizzazione con la richiesta. + Restituisca il valore .true per inviare un'intestazione Autorizzazione HTTP con le richieste una volta eseguita l'autenticazione; in caso contrario, false.Il valore predefinito è false. + + + Ottiene o imposta le informazioni sul proxy utilizzato dal gestore. + Restituisca il valore .Informazioni sul proxy utilizzato dal gestore.Il valore predefinito è null. + + + Crea un'istanza di in base alle informazioni fornite in come operazione che non si bloccherà. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Ottiene un valore che indica se il gestore supporta la decompressione automatica del contenuto di risposta. + Restituisca il valore .true se il gestore supporta la decompressione automatica del contenuto della risposta; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni proxy. + Restituisca il valore .true se il gestore supporta le impostazioni proxy; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni di configurazione per le proprietà e . + Restituisca il valore .true se il gestore supporta le impostazioni di configurazione per le proprietà e ; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che indica se il gestore utilizza la proprietà per memorizzare i cookie del server e utilizza questi cookie durante l'invio delle richieste. + Restituisca il valore .true se il gestore supporta la proprietà per archiviare i cookie del server e utilizza tali cookie quando invia richieste; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che controlla se le credenziali predefinite sono inviate con le richieste dal gestore. + Restituisca il valore .true se vengono utilizzate le credenziali predefinite; in caso contrario, false.Il valore predefinito è false. + + + Recupera o imposta un valore che indica se il gestore utilizza un proxy per le richieste. + Restituisca il valore .true se il gestore deve utilizzare un proxy per le richieste; in caso contrario, false.Il valore predefinito è true. + + + Indica se le operazioni di devono essere considerate completate non appena la risposta è disponibile o dopo la lettura dell'intero messaggio di risposta, incluso il contenuto. + + + L'operazione deve essere completata dopo la lettura della risposta intera che include il contenuto. + + + L'operazione deve essere completata non appena una risposta è disponibile e le intestazioni vengono lette.Il contenuto non è ancora pronto. + + + Classe base che rappresenta un corpo di entità e intestazioni di contenuto HTTP. + + + Inizializza una nuova istanza della classe . + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Serializzare il contenuto HTTP in un flusso di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + Restituisca il valore .Le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Dimensione massima in byte del buffer da utilizzare. + + + Serializza il contenuto HTTP in una matrice di byte come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP e restituire un flusso che rappresenta il contenuto come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in una stringa come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto HTTP ha una lunghezza valida in byte. + Restituisca il valore .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Tipo di base per gestori messaggi HTTP. + + + Inizializza una nuova istanza della classe . + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Una classe di specializzazione che consente alle applicazioni di chiamare il metodo di su una catena del gestore HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(),false se si desidera riutilizzare il gestore interno. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Classe di helper per recuperare e confrontare i metodi HTTP standard e per creare nuovi metodi HTTP. + + + Inizializza una nuova istanza della classe con un metodo HTTP specifico. + Metodo HTTP. + + + Rappresenta un metodo di protocollo HTTP DELETE. + Restituisca il valore . + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Metodo HTTP da confrontare con l'oggetto corrente. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Oggetto da confrontare con l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP GET. + Restituisca il valore . + + + Funge da funzione hash per questo tipo. + Restituisca il valore .Codice hash per la classe corrente. + + + Rappresenta un metodo di protocollo HTTP HEAD.Il metodo HEAD è identico al metodo GET ad eccezione del fatto che, nella risposta, il server restituisce solo intestazioni di messaggio senza un corpo del messaggio. + Restituisca il valore . + + + Metodo HTTP. + Restituisca il valore .Metodo HTTP rappresentato come . + + + Operatore di uguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono equivalenti; in caso contrario, false. + Oggetto a sinistra di un operatore di uguaglianza. + Oggetto a destra di un operatore di uguaglianza. + + + Operatore di disuguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono uguali; in caso contrario, false. + Oggetto a sinistra di un operatore di disuguaglianza. + Oggetto a destra di un operatore di disuguaglianza. + + + Rappresenta un metodo di protocollo HTTP OPTIONS. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP POST utilizzato per inviare una nuova entità come aggiunta a un URI. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP PUT utilizzato per sostituire un'entità identificata da un URI. + Restituisca il valore . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisca il valore .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP TRACE. + Restituisca il valore . + + + Classe base per eccezioni generate dalle classi e . + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente. + Messaggio che descrive l'eccezione corrente. + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente e l'eccezione interna. + Messaggio che descrive l'eccezione corrente. + Eccezione interna. + + + Rappresenta un messaggio di richiesta HTTP. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Stringa che rappresenta la richiesta . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Oggetto da richiedere. + + + Ottiene o imposta il contenuto del messaggio HTTP. + Restituisce .Contenuto di un messaggio + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene la raccolta delle intestazioni delle richieste HTTP. + Restituisce .Raccolta di intestazioni di richiesta HTTP. + + + Ottiene o imposta il metodo HTTP utilizzato dal messaggio di richiesta HTTP. + Restituisce .Metodo HTTP utilizzato dal messaggio di richiesta.Il valore predefinito è il metodo GET. + + + Ottiene un set di proprietà per la richiesta HTTP. + Restituisce . + + + Recupera o imposta utilizzato per la richiesta HTTP. + Restituisce . utilizzato per la richiesta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Rappresenta un messaggio di risposta HTTP che include il codice di stato e i dati. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un specifico. + Codice di stato della risposta HTTP. + + + Ottiene o imposta il messaggio di risposta HTTP. + Restituisce .Contenuto del messaggio di risposta HTTP. + + + Rilascia le risorse non gestite ed elimina le risorse non gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Genera un'eccezione se la proprietà della risposta HTTP è false. + Restituisce .Il messaggio di risposta HTTP se la chiamata ha esito positivo. + + + Ottiene la raccolta delle intestazioni di risposta HTTP. + Restituisce .Raccolta di intestazioni di risposta HTTP. + + + Ottiene un valore che indica se la risposta HTTP è stata completata. + Restituisce .Valore che indica se la risposta HTTP è stata completata.true se l'oggetto è stato compreso nell'intervallo tra 200 e 299; in caso contrario, false. + + + Ottiene o imposta la frase del motivo solitamente inviata dai server insieme al codice di stato. + Restituisce .Frase del motivo inviata dal server. + + + Ottiene o imposta il messaggio di richiesta che ha determinato questo messaggio di risposta. + Restituisce .Messaggio di richiesta che ha determinato questo messaggio di risposta. + + + Ottiene o imposta il codice di stato della risposta HTTP. + Restituisce .Codice di stato della risposta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Tipo di base per gestori che possono elaborare soltanto piccole richieste e/o messaggi di risposta. + + + Crea un'istanza di una classe . + + + Crea un'istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Esegue l'elaborazione su ogni richiesta inviata al server. + Restituisce .Messaggio di richiesta HTTP elaborato. + Messaggio di richiesta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Eseguire l'elaborazione su ogni risposta dal server. + Restituisce .Messaggio di risposta HTTP elaborato. + Messaggio di risposta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Fornisce una raccolta di oggetti che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + Il parametro era null o contiene solo spazi vuoti. + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + La stringa limite per il contenuto a più parti. + Il parametro era null o una stringa vuota. è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Restituisce un enumeratore che scorre la raccolta di oggetti che vengono serializzati utilizzando la specifica del tipo di contenuto multipart/*. + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Serializzare il contenuto HTTP multipart in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Implementazione esplicita del metodo . + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Determina se il contenuto multiparte HTTP ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Fornisce un contenitore per contenuto codificato utilizzando il tipo MIME multipart/form-data. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + La stringa limite per il contenuto dati del form a più parti. + + è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + + è null o contiene solo spazi vuoti. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + Nome file del contenuto HTTP da aggiungere alla raccolta. + + è null o contiene solo spazi vuoti.- oppure - è null o contiene solo spazi vuoti. + Il parametro era null. + + + Fornisce il contenuto HTTP basato su un flusso. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Dimensione del buffer, in byte, per . + Il parametro era null. + + è minore o uguale a zero. + + + Scrive il contenuto del flusso HTTP in un flusso di memoria come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto del flusso ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto del flusso. + + + Fornisce il contenuto HTTP basato su una stringa. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + Tipo di dati multimediali da utilizzare per il contenuto. + + + Rappresenta le informazioni di autenticazione nei valori di intestazione Authorization, ProxyAuthorization, WWW-Authenticate e Proxy-Authenticate. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + Le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + Restituisce .Credenziali contenenti le informazioni di autenticazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene lo schema da utilizzare per l'autorizzazione. + Restituisce .Schema da utilizzare per l'autorizzazione. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Cache-Control. + + + Inizializza una nuova istanza della classe . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Token di estensione cache, ognuno con un valore assegnato facoltativo. + Restituisce .Raccolta di token di estensione cache, ognuno con un valore assegnato facoltativo. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + La durata massima, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .true se il client HTTP è disposto ad accettare una risposta che ha superato la data di scadenza; in caso contrario, false. + + + Il tempo massimo, in secondi, quando un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .Tempo in secondi. + + + La durata di validità, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata; in caso contrario, false. + + + Se un client HTTP è disposto ad accettare una risposta memorizzata nella cache. + Restituisce .true se il client HTTP è disposto ad accettare una risposta memorizzata nella cache; in caso contrario, false. + + + Raccolta di fieldname nella direttiva “no-cache" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se una cache non deve memorizzare una parte del messaggio di richiesta HTTP o una risposta. + Restituisce .true se una cache non deve memorizzare alcuna parte del messaggio di richiesta HTTP o alcuna risposta; in caso contrario, false. + + + Se una cache o un proxy non deve modificare alcuna parte del corpo dell'entità. + Restituisce .true se una cache o un proxy non deve modificare alcun aspetto del corpo di entità; in caso contrario, false. + + + Se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway. + Restituisce .true se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway); in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione del controllo della cache. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione Cache Control valide. + + + Se tutto o parte del messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa. + Restituisce .true se il messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa; in caso contrario, false. + + + Fieldname della raccolta nella direttiva “privata" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata per le cache condivise dell'agente utente. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata per le cache condivise dell'agente utente; in caso contrario, false. + + + Se una risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa. + Restituisce .true se la risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa; in caso contrario, false. + + + Durata massima condivisa, specificata in secondi, in una risposta HTTP che sostituisce la direttiva di durata massima in un'intestazione Cache-Control o in un'intestazione Expires per una cache condivisa. + Restituisce .Tempo in secondi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Disposition. + + + Inizializza una nuova istanza della classe . + Oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un . + + + Data di creazione del file. + Restituisce .Data di creazione del file. + + + Il tipo di disposizione per una parte del corpo del contenuto. + Restituisce .Il tipo di disposizione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Suggerimento su come creare un nome file per archiviare il payload del messaggio da utilizzare se l'entità è stata rimossa e archiviata in un file separato. + Restituisce .Nome file consigliato. + + + Suggerimento su come creare nomi file per archiviare il payload del messaggio da utilizzare se le entità sono state rimosse e archiviate in file separati. + Restituisce .Nome file consigliato del form nomefile*. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Data dell'ultima modifica apportata al file. + Restituisce .Data di modifica del file. + + + Nome per una parte del corpo del contenuto. + Restituisce .Nome per la parte del corpo del contenuto. + + + Set di parametri che include l'intestazione Content-Disposition. + Restituisce .Insieme di parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione di disposizione dei contenuti. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di disposizione del contenuto valide. + + + Data dell'ultima lettura del file. + Restituisce .Data ultimo lettura. + + + Dimensione approssimativa del file espressa in byte. + Restituisce .Dimensione approssimativa espressa in byte. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Range. + + + Inizializza una nuova istanza della classe . + Il punto iniziale o finale dell'intervallo, in byte. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + Il punto iniziale o finale dell'intervallo, in byte. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione, in byte, in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se per l'intestazione Content-Range è stata specificata una lunghezza. + Restituisce .true se il Content-range è di lunghezza specificata; in caso contrario, false. + + + Ottiene un valore che indica se per Content-Range è stato specificato un intervallo. + Restituisce .true se il Content-range è di intervallo specificato; in caso contrario, false. + + + Ottiene la lunghezza del corpo dell'entità completo. + Restituisce .La lunghezza del corpo dell'entità completo. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione dell'intervallo di contenuti. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo di contenuti. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Le unità dell'intervallo utilizzate. + Restituisce . contenente le unità dell'intervallo. + + + Rappresenta un valore di intestazione del tag di entità. + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + Un valore che indica se questa intestazione del tag di entità è una convalida debole.Se l'intestazione del tag di entità è una convalida debole, allora deve essere impostato su true.Se l'intestazione del tag di entità è una convalida forte, allora deve essere impostato su false. + + + Ottiene il valore di intestazione del tag di entità. + Restituisce . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se il tag di identità è preceduto da un indicatore di debolezza. + Restituisce .true se il tag di identità è preceduto da un indicatore di debolezza; in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del tag di entità. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dei tag di entità. + + + Ottiene la stringa tra virgolette opaca. + Restituisce .Stringa tra virgolette opaca. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta la raccolta di intestazioni di contenuto secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione del contenuto Allow in una risposta HTTP. + Restituisce .Valore dell'intestazione Allow su una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Expires in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Expires in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Last-Modified per una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Last-Modified in una risposta HTTP. + + + Raccolta di intestazioni e i relativi valori definiti nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + + + Aggiunge l'intestazione specificata e i valori relativi nella raccolta . + L'intestazione da aggiungere all'insieme. + Elenco di valori dell'intestazione da aggiungere alla raccolta. + + + Aggiunge l'intestazione specificata e il valore relativo nella raccolta . + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Rimuove tutte le intestazioni dalla raccolta . + + + Restituisce un valore che indica se un'intestazione specifica è presente nella raccolta . + Restituisce .true e l'intestazione specificata è presente nella raccolta; in caso contrario, false. + Intestazione specifica. + + + Restituisce un enumeratore che consente di scorrere l'istanza di . + Restituisce .Enumeratore per l'oggetto . + + + Restituisce tutti i valori di intestazione per un'intestazione specificata archiviata nella raccolta . + Restituisce .Matrice di stringhe di intestazione. + Intestazione specificata per cui restituire i valori. + + + Rimuove l'intestazione specificata dalla raccolta . + Restituisce . + Il nome dell'intestazione da rimuovere dall'insieme. + + + Ottiene un enumeratore che itera in un . + Restituisce .Istanza di un'implementazione di un in grado di scorrere un oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Restituisce un valore che indica se l'intestazione specificata e i relativi valori sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Valori dell'intestazione. + + + Restituisce un valore che indica se l'intestazione specificata e il relativo valore sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Restituisce un valore che indica se i valori e un'intestazione specificati sono archiviati nella raccolta . + Restituisce .true se gli oggetti e values dell'intestazione specificata vengono archiviati nella raccolta; in caso contrario, false. + Intestazione specificata. + Valori intestazione specificati. + + + Rappresenta una raccolta di valori dell'intestazione. + Tipo di raccolta di intestazione. + + + Aggiunge una voce a . + Elemento da aggiungere alla raccolta dell'intestazione. + + + Rimuove tutte le voci da . + + + Determina se contiene un articolo. + Restituisce .true se la voce è inclusa nell'istanza , in caso contrario false. + Elemento da trovare nella raccolta dell'intestazione. + + + Copia l'intero oggetto in un oggetto compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione. + Oggetto unidimensionale che rappresenta la destinazione degli elementi copiati dall'oggetto .L'indicizzazione di deve essere in base zero. + Indice in base zero della matrice specificata nel parametro in corrispondenza del quale ha inizio la copia. + + + Ottiene il numero di intestazioni in . + Restituisce .Numero di intestazioni contenute in una raccolta. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Ottiene un valore che indica se l'istanza è di sola lettura. + Restituisce .true se l'istanza di è in sola lettura, in caso contrario false. + + + Analizza e aggiunge una voce all'oggetto . + Voce da aggiungere. + + + Consente di rimuovere l'elemento selezionato dall'oggetto . + Restituisce .true se è stato correttamente rimosso dall'istanza ; in caso contrario, false. + Elemento da rimuovere. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Restituisce una stringa che rappresenta l'oggetto corrente . + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se l'input può essere analizzato e aggiunto all'oggetto . + Restituisce .true se è stato possibile analizzare e aggiungere all'istanza di ; in caso contrario, false + Voce da convalidare. + + + Rappresenta la raccolta di intestazioni di richiesta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Charset per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Charset per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Encoding per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Language per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Language per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una richiesta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Connection per una richiesta HTTP. + Restituisce .Valore dell'intestazione Connection per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una richiesta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una richiesta HTTP. + Restituisce .Valore dell'intestazione Date per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Expect per una richiesta HTTP. + Restituisce .Valore dell'intestazione Expect per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Expect per una richiesta HTTP contiene Continue. + Restituisce .true se l'intestazione Expect contiene Continue; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione From per una richiesta HTTP. + Restituisce .Valore dell'intestazione From per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Host per una richiesta HTTP. + Restituisce .Valore dell'intestazione Host per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-Match per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Modified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Modified-Since per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + Restituisce .Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Max-Forwards per una richiesta HTTP. + Restituisce .Valore dell'intestazione Max-Forwards per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una richiesta HTTP. + Restituisce .Valore dell'intestazione Pragma per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Referer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Referer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione TE per una richiesta HTTP. + Restituisce .Valore dell'intestazione TE per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Trailer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una richiesta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una richiesta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una richiesta HTTP. + + + Ottiene il valore dell'intestazione User-Agent per una richiesta HTTP. + Restituisce .Valore dell'intestazione User-Agent per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Via per una richiesta HTTP. + Restituisce .Valore dell'intestazione Via per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Warning per una richiesta HTTP. + Restituisce .Valore dell'intestazione Warning per una richiesta HTTP. + + + Rappresenta la raccolta di intestazioni di risposta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept-Ranges per una risposta HTTP. + Restituisce .Valore dell'intestazione Accept-Ranges per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Age per una risposta HTTP. + Restituisce .Valore dell'intestazione Age per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una risposta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una risposta HTTP. + + + Ottiene il valore dell'intestazione Connection per una risposta HTTP. + Restituisce .Valore dell'intestazione Connection per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una risposta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una risposta HTTP. + Restituisce .Valore dell'intestazione Date per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione ETag per una risposta HTTP. + Restituisce .Valore dell'intestazione ETag per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Location per una risposta HTTP. + Restituisce .Valore dell'intestazione Location per una risposta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una risposta HTTP. + Restituisce .Valore dell'intestazione Pragma per una risposta HTTP. + + + Ottiene il valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Retry-After per una risposta HTTP. + Restituisce .Valore dell'intestazione Retry-After per una risposta HTTP. + + + Ottiene il valore dell'intestazione Server per una risposta HTTP. + Restituisce .Valore dell'intestazione Server per una risposta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una risposta HTTP. + Restituisce .Valore dell'intestazione Trailer per una risposta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una risposta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una risposta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una risposta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una risposta HTTP. + + + Ottiene il valore dell'intestazione Vary per una risposta HTTP. + Restituisce .Valore dell'intestazione Vary per una risposta HTTP. + + + Ottiene il valore dell'intestazione Via per una risposta HTTP. + Restituisce .Valore dell'intestazione Via per una risposta HTTP. + + + Ottiene il valore dell'intestazione Warning per una risposta HTTP. + Restituisce .Valore dell'intestazione Warning per una risposta HTTP. + + + Ottiene il valore dell'intestazione WWW-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione WWW-Authenticate per una risposta HTTP. + + + Rappresenta un tipo di supporto utilizzato in un'intestazione Content-Type come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Origine rappresentata come stringa per inizializzare la nuova istanza. + + + Ottiene o imposta il set di caratteri. + Restituisce .Set di caratteri. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene o imposta il valore dell'intestazione Media-Type. + Restituisce .Il valore di intestazione del tipo di supporto. + + + Ottiene o imposta i parametri di valore dell'intestazione del tipo di supporto. + Restituisce .I parametri del valore di intestazione del tipo di supporto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione del tipo di supporto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del tipo di supporti. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un tipo di supporto con un fattore di qualità aggiuntivo utilizzato in un'intestazione Content-Type. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + Qualità associata a questo valore di intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il tipo di supporto con le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è un tipo di supporto valido con le informazioni sul valore di intestazione di qualità. + + + Ottenere o impostare il valore di qualità per . + Restituisce .Valore di qualità per l'oggetto ) + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta una coppia nome/valore utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome dell'intestazione. + Restituisce .Nome dell'intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del valore del nome. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del valore del nome. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore dell'intestazione. + Restituisce .Valore dell'intestazione. + + + Rappresenta una coppia nome/valore con parametri utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri dall'oggetto . + Restituisce .Raccolta contenente i parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il valore del nome con le informazioni sul valore di intestazione del parametro. + + è un riferimento null. + + non è un valore di nome valido con le informazioni sul valore di intestazione di parametro. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di token di prodotto in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Nome del prodotto. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome del token del prodotto. + Restituisce .Nome del token del prodotto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del prodotto. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene la versione del token del prodotto. + Restituisce .Versione del token di prodotto. + + + Rappresenta un valore che può essere un prodotto o un commento in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Valore di commento. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Ottiene il commento dall'oggetto . + Restituisce .Valore di commento di . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle informazioni di prodotto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle informazioni di prodotto. + + + Ottiene il prodotto dall'oggetto . + Restituisce .Valore del prodotto da questo . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione If-Range che può essere un valore di tipo Date/Time o tag entità. + + + Inizializza una nuova istanza della classe . + Un valore di data utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Una tag di entità rappresentata come stringa utilizzata per inizializzare la nuova istanza. + + + Ottiene la data dall'oggetto . + Restituisce .Data dall'oggetto . + + + Ottiene il tag di identità dall'oggetto . + Restituisce .Tag di identità dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dell'intervallo. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione con intervallo. + + + Inizializza una nuova istanza della classe . + + + Consente l'inizializzazione di una nuova istanza della classe con un intervallo di date. + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione dell'intervallo. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo. + + + Ottiene gli intervalli specificati dall'oggetto . + Restituisce .Intervalli dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene l'unità dall'oggetto . + Restituisce .Unità dall'oggetto . + + + Rappresenta un valore di intestazione con intervallo di byte in un intervallo. + + + Inizializza una nuova istanza della classe . + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un valore di intestazione Retry-After che può essere un valore di tipo Date/Time o Timespan. + + + Inizializza una nuova istanza della classe . + L'offset di data e ora utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Delta, in secondi, utilizzato per inizializzare la nuova istanza. + + + Ottiene l'offset della data e ora dall'oggetto . + Restituisce .L'offset della data e ora dall'oggetto . + + + Ottiene il delta in secondi dall'oggetto . + Restituisce .Delta in secondi dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni dei nuovi tentativi. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dei nuovi tentativi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione di stringa con una qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Fattore di qualità utilizzato per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è una stringa valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di stringa dall'oggetto . + Restituisce .Valore di stringa da cui ottenere l'oggetto . + + + Rappresenta un valore di intestazione Accept-Encoding. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri di codifica di trasferimento. + Restituisce .I parametri di codifica di trasferimento. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione della codifica di trasferimento. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della codifica di trasferimento. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di codifica di trasferimento. + Restituisce .Il valore di codifica di trasferimento. + + + Rappresenta un valore di intestazione di intestazione Accept-Encoding con fattore di qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Un valore per il fattore di qualità. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore della codifica di trasferimento. + + è un riferimento null. + + non è una codifica di trasferimento valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore di un'intestazione Via. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Ottiene il campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + Restituisce .Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Viene restituito un codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta mediante informazioni sul valore intestazione. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della via. + + + Ottiene il nome del protocollo ricevuto. + Restituisce .Nome del protocollo. + + + Ottiene la versione del protocollo ricevuto. + Restituisce .Versione del protocollo. + + + Ottiene l'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Restituisce .L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di avviso utilizzato dall'intestazione di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + L'indicatore di data e ora dell'avviso. + + + Ottiene l'host che ha associato l'avviso. + Restituisce .L'host che ha associato l'avviso. + + + Ottiene il codice di avviso specifico. + Restituisce .Codice di avviso specifico. + + + Ottiene l'indicatore di data e ora dell'avviso. + Restituisce .L'indicatore di data e ora dell'avviso. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce un'istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene una stringa tra virgolette contenente il testo di avviso. + Restituisce .Una stringa tra virgolette contenente il testo di avviso. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ja/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ja/a new file mode 100644 index 00000000000..10214bda61e --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ja/a @@ -0,0 +1,2852 @@ + + + + System.Net.Http + + + + バイト配列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + パラメーターが null です。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + の初期化に使用される パラメーターのオフセット (バイト単位)。 + + を初期化するために使用される パラメーターから始まる のバイト数。 + + パラメーターが null です。 + + パラメーターが 0 未満です。または パラメーターが パラメーターで指定されたコンテンツの長さを超えています。またはパラメーターが 0 未満です。または パラメーターが、 パラメーターで指定されたコンテンツの長さから パラメーターを引いた値を超えています。 + + + バッキング ストアが からのメモリである読み取り用 HTTP コンテンツ ストリームを非同期操作として作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として HTTP コンテンツ ストリームにコンストラクターで提供されるバイト配列をシリアル化して記述します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + バイト配列が有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + バイト配列の長さ (バイト単位)。 + + + クライアント証明書がどのように提供されるかを指定します。 + + + + は、使用できるすべてのクライアント証明書を自動的に提供しようと試みます。 + + + アプリケーションは に、クライアント証明書を手動で提供します。この値が既定値です。 + + + 内部ハンドラーと呼ばれる、別のハンドラーへ HTTP 応答メッセージの処理をデリゲートする HTTP ハンドラーの型。 + + + + クラスの新しいインスタンスを作成します。 + + + 特定の内部ハンドラーを使用して、 クラスの新しいインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答メッセージを処理する内部ハンドラーを取得または設定します。 + + を返します。HTTP 応答メッセージ用の内部ハンドラー。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + application/x-www-form-urlencoded MIME 型を使用してエンコードされた名前と値の組のコンテナー。 + + + 指定した名前と値のペアのコレクションを使用して、 クラスの新しいインスタンスを初期化します。 + 名前と値のペアのコレクション。 + + + URI で識別されるリソースに HTTP 要求を送信し、そのリソースから HTTP 応答を受信するための基本クラスを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + 要求の送信に使用する HTTP ハンドラー スタック。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() で破棄する場合は true。内部ハンドラーを再利用する場合は false。 + + + 要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレスを取得または設定します。 + + を返します。要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレス。 + + + このインスタンスの保留中の要求をすべてキャンセルします。 + + + 各要求と一緒に送信する必要があるヘッダーを取得します。 + + を返します。各要求と一緒に送信する必要があるヘッダー。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + + が使用しているアンマネージ リソースを解放します。オプションとして、マネージ リソースを破棄することもできます。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 応答の内容を読み取るときにバッファーに格納できる最大バイト数を取得または設定します。 + + を返します。応答コンテンツを読み取るときに、バッファーに格納できる最大バイト数。このプロパティの既定値は 2 GB です。 + 指定されたサイズがゼロ以下です。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 要求がタイムアウトするまで待機する期間を取得または設定します。 + + を返します。要求がタイムアウトするまで待機する期間。 + 指定したタイムアウトが 0 以下のため ではありません。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + + が使用する既定のメッセージ ハンドラー。 + + + + クラスのインスタンスを作成します。 + + + ハンドラーがリダイレクト応答に従うかどうかを示す値を取得または設定します。 + + を返します。ハンドラーがリダイレクト応答に従う場合は true。それ以外の場合は false。既定値は true です。 + + + HTTP コンテンツ応答の自動圧縮解除のハンドラーが使用する圧縮解除メソッドの種類を取得または設定します。 + + を返します。ハンドラーが使用する自動圧縮解除のメソッド。既定値は です。 + + + このハンドラーに関連付けられるセキュリティ証明書のコレクションを取得または設定します。 + + を返します。このハンドラーに関連付けられているセキュリティ証明書のコレクション。 + + + ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナーを取得または設定します。 + + を返します。ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナー。 + + + このハンドラーによって使用される認証情報を取得または設定します。 + + を返します。ハンドラーに関連付けられる認証資格情報。既定値は、null です。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + ハンドラーが従うリダイレクトの最大数を取得または設定します。 + + を返します。ハンドラーによって実行されるリダイレクト応答の最大数。既定値は 50 です。 + + + ハンドラーが使用する要求コンテンツ バッファーの最大サイズを取得または設定します。 + + を返します。要求コンテンツ バッファーの最大サイズ (バイト単位)。既定値は 2 GB です。 + + + ハンドラーが要求と共に認証ヘッダーを送信するかどうかを示す値を取得または設定します。 + + を返します。認証が行われた後で、要求と共に HTTP 認証ヘッダーを送信するハンドラーの場合は true。それ以外の場合は false。既定値は、false です。 + + + ハンドラーが使用するプロキシ情報を取得または設定します。 + + を返します。ハンドラーにより使用されるプロキシ情報。既定値は null です。 + + + + で提供される情報に基づいて、ブロックされない操作として のインスタンスを作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + ハンドラーが自動的な応答内容の圧縮解除をサポートするかどうかを示す値を取得します。 + + を返します。ハンドラーが自動応答の内容の圧縮解除をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーがプロキシ設定をサポートしているかどうかを示す値を取得します。 + + を返します。ハンドラーがプロキシ設定をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが および プロパティの構成設定をサポートするかどうかを示す値を取得します。 + + を返します。 プロパティと プロパティの構成設定をハンドラーがサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 既定の資格情報がハンドラーによって要求と共に送信されるかどうかを制御する値を取得または設定します。 + + を返します。既定の資格情報を使用する場合は true。それ以外の場合は false。既定値は false です。 + + + ハンドラーが要求のプロキシを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが要求に対してプロキシを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 応答が使用できるようになった場合に 操作が完了したと見なすか、内容を含む応答メッセージ全体を読み取った後に完了したと見なすかを示します。 + + + 操作は、コンテンツを含む全体の応答を読んだ後に完了する必要があります。 + + + 操作は、応答が使用できる状態になった後か、ヘッダーが読み取られた後すぐに完了する必要があります。コンテンツがまだ読み取られていません。 + + + HTTP のエンティティ本体とコンテンツ ヘッダーを表す基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + 非同期操作としてメモリ ストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + RFC 2616 で定義されている HTTP コンテンツ ヘッダーを取得します。 + + を返します。RFC 2616 で定義されているコンテンツ ヘッダー。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 使用するバッファーの最大サイズ (バイト単位)。 + + + 非同期操作としてバイト配列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + HTTP コンテンツをシリアル化して、非同期操作としてコンテンツを表すストリームを返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として文字列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + HTTP コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + HTTP メッセージ ハンドラーの基本型。 + + + + クラスの新しいインスタンスを初期化します。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + アプリケーションが HTTP ハンドラー チェーンに対して メソッドを呼び出せるようにする専用クラス。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() が破棄する場合は true、内部ハンドラーを再利用する場合は false。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + 標準的な HTTP メソッドの取得と比較を行い、新しい HTTP メソッドを作成するためのヘルパー クラス。 + + + 指定した HTTP メソッドを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + + + HTTP DELETE プロトコル メソッドを表します。 + + を返します。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較する HTTP メソッド。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + HTTP GET プロトコル メソッドを表します。 + + を返します。 + + + この型のハッシュ関数として機能します。 + + を返します。現在の のハッシュ コード。 + + + HTTP HEAD プロトコル メソッドを表します。HEAD メソッドは、サーバーが応答でメッセージ本文は返さずにメッセージ ヘッダーだけを返すこと以外、GET と同じです。 + + を返します。 + + + HTTP メソッド。 + + を返します。 として表される HTTP メソッド。 + + + 2 つの オブジェクトを比較するための等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しい場合は true。それ以外の場合は false。 + 等値演算子の左辺にある 。 + 等値演算子の右辺の 。 + + + 2 つの オブジェクトを比較するための非等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しくない場合は true。それ以外の場合は false。 + 非等値演算子の左辺にある 。 + 非等値演算子の右辺の 。 + + + HTTP OPTIONS プロトコル メソッドを表します。 + + を返します。 + + + URI への追加として新しいエントリをポストするために使用される HTTP POST プロトコル メソッドを表します。 + + を返します。 + + + URI で識別されるエントリを置き換えるために使用される HTTP PUT プロトコル メソッドを表します。 + + を返します。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + HTTP TRACE プロトコル メソッドを表します。 + + を返します。 + + + + クラスによってスローされる例外の基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + 現在の例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + + + 現在の例外と内部例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + 内部例外。 + + + HTTP 要求メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求 を表す文字列。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求する 。 + + + HTTP メッセージの内容を取得または設定します。 + + を返します。メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 要求ヘッダーのコレクションを取得します。 + + を返します。HTTP 要求ヘッダーのコレクション。 + + + HTTP 要求メッセージで使用される HTTP メソッドを取得または設定します。 + + を返します。要求メッセージによって使用される HTTP メソッド。既定では、GET メソッドです。 + + + HTTP 要求のプロパティのセットを取得します。 + + を返します。 + + + HTTP 要求で使用する を取得または設定します。 + + を返します。HTTP 要求に使用される + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + ステータス コードとデータを含む HTTP 応答メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + を指定して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答のステータス コード。 + + + HTTP 応答メッセージの内容を取得または設定します。 + + を返します。HTTP 応答メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、アンマネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答の のプロパティが false である場合、例外がスローされます。 + + を返します。呼び出しが成功した場合は HTTP 応答メッセージ。 + + + HTTP 応答ヘッダーのコレクションを取得します。 + + を返します。HTTP 応答ヘッダーのコレクション。 + + + HTTP 応答が成功したかどうかを示す値を取得します。 + + を返します。HTTP 応答が成功したかどうかを示す値。 が 200 ~ 299 の範囲内にあった場合は true。それ以外の場合は false。 + + + 通常はステータス コードと共にサーバーによって送信される理由句を取得または設定します。 + + を返します。サーバーから送信される理由語句。 + + + この応答メッセージの原因となった要求メッセージを取得または設定します。 + + を返します。この応答メッセージの原因となった要求メッセージ。 + + + HTTP 応答のステータス コードを取得または設定します。 + + を返します。HTTP 応答のステータス コード。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + 要求と応答メッセージの小規模な処理のみをするハンドラーの基本型。 + + + + クラスのインスタンスを作成します。 + + + 指定した内部ハンドラーを使用して、 クラスのインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + サーバーに送信された各要求の処理を実行します。 + + を返します。処理された HTTP 要求メッセージ。 + 処理する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + サーバーからの各応答の処理を実行します。 + + を返します。処理された HTTP 応答メッセージ。 + 処理する HTTP 応答メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + + が null であるか、空白文字だけで構成されています。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + マルチパート コンテンツの境界の文字列。 + + は null か空の文字列でした。 が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションにマルチパート HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + multipart/* のコンテンツ タイプ仕様を使用してシリアル化する オブジェクトのコレクション全体を反復処理する列挙子を返します。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + 非同期操作としてストリームにマルチパート HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + + メソッドの明示的な実装。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + HTTP マルチパート コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + マルチパート/フォーム データの MIME タイプを使用してエンコードされたコンテンツのコンテナーを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート フォーム データ コンテンツの境界の文字列。 + + が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + + が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + コレクションに追加する HTTP コンテンツのファイル名。 + + が null であるか、空白文字だけで構成されています。または が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + ストリームに基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + のバッファーのサイズ (バイト単位)。 + + が null でした。 + + の値が 0 以下です。 + + + 非同期操作としてメモリ ストリームに HTTP ストリーム コンテンツを書き込みます。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + ストリーム コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + ストリーム コンテンツの長さ (バイト単位)。 + + + 文字列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + コンテンツに使用するメディア タイプ。 + + + Authorization、ProxyAuthorization、WWW-Authenticate、および Proxy-Authenticate のヘッダー値の認証情報を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報を取得します。 + + を返します。認証情報を格納する資格情報。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 承認のために使用するメソッドを取得します。 + + を返します。承認のために使用するスキーム。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Cache-Control ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + それぞれが省略可能な代入値を持つキャッシュ拡張トークン。 + + を返します。それぞれが省略可能な代入値を持つキャッシュ拡張トークンのコレクション。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + HTTP クライアントが応答を受け入れる最大期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが有効期限を過ぎた応答を受け入れるかどうか。 + + を返します。HTTP クライアントが有効期限を過ぎた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP クライアントが、有効期限を過ぎた応答を受け入れる最長時間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが応答を受け入れる鮮度有効期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + キャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなった場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + HTTP クライアントがキャッシュされた応答を受け入れるかどうか。 + + を返します。HTTP クライアントがキャッシュされた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "no-cache" ディレクティブにあるフィールド名のコレクション。 + + を返します。フィールド名のコレクション。 + + + HTTP 要求メッセージまたは応答の一部をキャッシュに保存できないかどうか。 + + を返します。HTTP 要求メッセージおよびあらゆる応答のどの部分もキャッシュに保存できない場合は true。それ以外の場合は false。 + + + キャッシュまたはプロキシがエンティティ本体の側面を変更できないかどうか。 + + を返します。キャッシュまたはプロキシがエンティティ本体のどの側面も変更できない場合は true。それ以外の場合は false。 + + + キャッシュが HTTP 要求の他の制約に準拠しているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答するか。 + + を返します。キャッシュが、HTTP 要求の他の制約に従っているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答する場合は true。それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + キャッシュ コントロールのヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なキャッシュ コントロール ヘッダー値の情報です。 + + + HTTP 応答メッセージの全体または一部が 1 人のユーザーを対象にしており、共有キャッシュでキャッシュできないかどうか。 + + を返します。HTTP 応答メッセージが 1 名のユーザーを対象にしており、共有キャッシュでキャッシュできない場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "private" ディレクティブにあるコレクション フィールド名。 + + を返します。フィールド名のコレクション。 + + + 共有ユーザー エージェント キャッシュのキャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなり、共有ユーザー エージェント キャッシュに適切でない場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + 通常、キャッシュ不可である場合や、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答をすべてのキャッシュでキャッシュできるかどうか。 + + を返します。通常はキャッシュ不可であるか、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答を任意のキャッシュでキャッシュできる場合は true。それ以外の場合は false。 + + + 共有キャッシュのキャッシュ制御ヘッダーまたは expires ヘッダーに対する "最大年齢" ディレクティブをオーバーライドする HTTP 応答における、共有最大期間 (秒単位で指定)。 + + を返します。時間 (秒) です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Disposition ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + ファイルが作成された日付。 + + を返します。ファイルの作成日。 + + + コンテンツ本体の配置タイプ。 + + を返します。配置タイプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。推奨ファイル名。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。フォームの filename* の推奨ファイル名。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ファイルが最後に変更された日付。 + + を返します。ファイルの変更日。 + + + コンテンツ本体の名前。 + + を返します。コンテンツ本体の名前。 + + + パラメーター セットには、Content-Disposition ヘッダーが含まれていました。 + + を返します。パラメーターのコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ配置ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ配置ヘッダー値の情報です。 + + + ファイルの読み取りが行われた最後の日付。 + + を返します。最後に読み取った日付。 + + + ファイルのおおよそのサイズ (バイト単位)。 + + を返します。おおよそのサイズ (バイト単位)。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Range ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 範囲の開始点または終了点 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + 範囲の開始点または終了点 (バイト単位)。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置 (バイト単位)。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + Content-Range ヘッダーが指定された長さかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された長さである場合は true、それ以外の場合は false。 + + + Content-Range に指定された範囲があるかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された範囲である場合は true、それ以外の場合は false。 + + + 完全なエンティティ本体の長さを取得します。 + + を返します。フル エンティティ本体の長さ。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ範囲ヘッダー値の情報です。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 使用する範囲の単位。 + + を返します。範囲の単位を含む + + + エンティティ タグのヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + このエンティティ タグ ヘッダーが弱い検証コントロールかどうかを示す値。エンティティ タグ ヘッダーが弱い検証コントロールの場合は、 を true に設定します。エンティティ タグ ヘッダーが強い検証コントロールの場合は、 を false に設定します。 + + + エンティティ タグのヘッダー値を取得します。 + + を返します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + エンティティ タグの前に脆弱性インジケーターが付いているかどうかを取得します。 + + を返します。エンティティ タグの前に脆弱性インジケーターが付いている場合は true、それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + エンティティ タグ ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なエンティティ タグ ヘッダー値の情報です。 + + + opaque 引用符で囲まれた文字列を取得します。 + + を返します。不透明な引用符で囲まれた文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義されているコンテンツ ヘッダーのコレクションを表します。 + + + HTTP 応答の Allow コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Allow ヘッダーの値。 + + + HTTP 応答の Content-Disposition コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Disposition コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Encoding コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Encoding コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Language コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Language コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Length コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Length コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Location コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Location コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-MD5 コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-MD5 コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Range コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Range コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Type コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Type コンテンツ ヘッダーの値。 + + + HTTP 応答の Expires コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Expires コンテンツ ヘッダーの値。 + + + HTTP 応答の Last-Modified コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Last-Modified コンテンツ ヘッダーの値。 + + + RFC 2616 で定義されているヘッダーおよび値のコレクション。 + + + + クラスの新しいインスタンスを初期化します。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + コレクションに追加するヘッダー値のリスト。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + + コレクションからすべてのヘッダーを削除します。 + + + 特定のヘッダーが コレクションに存在するかどうかを返します。 + + を返します。指定したヘッダーがコレクション内に存在する場合は true、それ以外の場合は false。 + 特定のヘッダー。 + + + + インスタンスを反復処理できる列挙子を返します。 + + を返します。 の列挙子。 + + + + コレクションに格納されている指定したヘッダーのすべてのヘッダー値を返します。 + + を返します。ヘッダー文字列の配列。 + 値を返す指定されたヘッダー。 + + + 指定したヘッダーを コレクションから削除します。 + + を返します。 + コレクションから削除するヘッダーの名前。 + + + + を反復処理できる列挙子を取得します。 + + を返します。 を反復処理できる を実装するインスタンス。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの値。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + 指定されたヘッダーと指定された値が コレクションに格納されているかどうかを返します。 + + を返します。指定されたヘッダー および values がコレクションに格納されている場合は true。それ以外の場合は false。 + 指定されたヘッダー。 + 指定したヘッダー値。 + + + ヘッダー値のコレクションを表します。 + ヘッダー コレクションの型。 + + + + にエントリを追加します。 + ヘッダー コレクションに追加する項目。 + + + + からすべてのエントリを削除します。 + + + + に項目が格納されているかどうかを確認します。 + + を返します。エントリが インスタンスに含まれている場合は true。それ以外の場合は false。 + ヘッダー コレクションから検索する項目。 + + + + 全体を互換性のある 1 次元の にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 + + から要素をコピーする、1 次元の です。 には、0 から始まるインデックス番号が必要です。 + コピーの開始位置となる、 内の 0 から始まるインデックス。 + + + + 内のヘッダーの数を取得します。 + + を返します。コレクション内のヘッダーの数。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + + インスタンスが読み取り専用かどうかを示す値を取得します。 + + を返します。 インスタンスが読み取り専用の場合は true。それ以外の場合は false。 + + + + にエントリを解析して追加します。 + 追加するエントリ。 + + + 指定した項目を から削除します。 + + を返します。 インスタンスから削除された場合は true。それ以外の場合は false。 + 削除する項目。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 入力を解析して に追加できるかどうかを判断します。 + + を返します。 を解析して インスタンスに追加できる場合は true。それ以外の場合は false + 検証するエントリ。 + + + RFC 2616 で定義されている要求ヘッダーのコレクションを表します。 + + + HTTP 要求の Accept ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept ヘッダーの値。 + + + HTTP 要求の Accept-Charset ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Charset ヘッダーの値。 + + + HTTP 要求の Accept-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Encoding ヘッダーの値。 + + + HTTP 要求の Accept-Language ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Language ヘッダーの値。 + + + HTTP 要求の Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Authorization ヘッダーの値。 + + + HTTP 要求の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Cache-Control ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーの値を取得します。 + + を返します。HTTP 要求の Connection ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Date ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーの値を取得します。 + + を返します。HTTP 要求の Expect ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーに Continue が含まれるかどうかを示す値を取得または設定します。 + + を返します。Expect ヘッダーに Continue が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の From ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の From ヘッダーの値。 + + + HTTP 要求の Host ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Host ヘッダーの値。 + + + HTTP 要求の If-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-Match ヘッダーの値。 + + + HTTP 要求の If-Modified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Modified-Since ヘッダーの値。 + + + HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + + HTTP 要求の If-Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Range ヘッダーの値。 + + + HTTP 要求の If-Unmodified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Unmodified-Since ヘッダーの値。 + + + HTTP 要求の Max-Forwards ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Max-Forwards ヘッダーの値。 + + + HTTP 要求の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 要求の Pragma ヘッダーの値。 + + + HTTP 要求の Proxy-Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Proxy-Authorization ヘッダーの値。 + + + HTTP 要求の Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Range ヘッダーの値。 + + + HTTP 要求の Referer ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Referer ヘッダーの値。 + + + HTTP 要求の TE ヘッダーの値を取得します。 + + を返します。HTTP 要求の TE ヘッダーの値。 + + + HTTP 要求の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 要求の Trailer ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Transfer-Encoding ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 要求の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 要求の Upgrade ヘッダーの値。 + + + HTTP 要求の User-Agent ヘッダーの値を取得します。 + + を返します。HTTP 要求の User-Agent ヘッダーの値。 + + + HTTP 要求の Via ヘッダーの値を取得します。 + + を返します。HTTP 要求の Via ヘッダーの値。 + + + HTTP 要求の Warning ヘッダーの値を取得します。 + + を返します。HTTP 要求の Warning ヘッダーの値。 + + + RFC 2616 で定義されている応答ヘッダーのコレクションを表します。 + + + HTTP 応答の Accept-Ranges ヘッダーの値を取得します。 + + を返します。HTTP 応答の Accept-Ranges ヘッダーの値。 + + + HTTP 応答の Age ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Age ヘッダーの値。 + + + HTTP 応答の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Cache-Control ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーの値を取得します。 + + を返します。HTTP 応答の Connection ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 応答の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Date ヘッダーの値。 + + + HTTP 応答の ETag ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の ETag ヘッダーの値。 + + + HTTP 応答の Location ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Location ヘッダーの値。 + + + HTTP 応答の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 応答の Pragma ヘッダーの値。 + + + HTTP 応答の Proxy-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の Proxy-Authenticate ヘッダーの値。 + + + HTTP 応答の Retry-After ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Retry-After ヘッダーの値。 + + + HTTP 応答の Server ヘッダーの値を取得します。 + + を返します。HTTP 応答の Server ヘッダーの値。 + + + HTTP 応答の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 応答の Trailer ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 応答の Transfer-Encoding ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 応答の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 応答の Upgrade ヘッダーの値。 + + + HTTP 応答の Vary ヘッダーの値を取得します。 + + を返します。HTTP 応答の Vary ヘッダーの値。 + + + HTTP 応答の Via ヘッダーの値を取得します。 + + を返します。HTTP 応答の Via ヘッダーの値。 + + + HTTP 応答の Warning ヘッダーの値を取得します。 + + を返します。HTTP 応答の Warning ヘッダーの値。 + + + HTTP 応答の WWW-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の WWW-Authenticate ヘッダーの値。 + + + RFC 2616 に定義され、コンテンツ タイプのヘッダーに使用されるメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化する文字列を表すソースです。 + + + 文字セットを取得または設定します。 + + を返します。文字セット。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + メディア種類のヘッダー値を取得または設定します。 + + を返します。メディア タイプ ヘッダー値。 + + + メディア種類のヘッダー値のパラメーターを取得または設定します。 + + を返します。メディア タイプ ヘッダー値パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + メディア種類のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なメディア タイプ ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + コンテンツ タイプ ヘッダーで使用される追加の品質ファクターとメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + このヘッダー値に関連付けられた品質です。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を含むメディア種類を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効なメディア タイプではありません。 + + + + の品質評価の値を取得または設定します。 + + を返します。 オブジェクトの品質評価の値。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用される名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ヘッダー名を取得します。 + + を返します。ヘッダーの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 名前の値のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な名前の値のヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ヘッダー値を取得します。 + + を返します。ヘッダー値。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用されるパラメーター付きの名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + + オブジェクトからパラメーターを取得します。 + + を返します。パラメーターを含むコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + パラメーター ヘッダー値の情報を含む、名前の値を表す文字列。 + + が null 参照です。 + + はパラメーター ヘッダー値の情報を含む有効な名前の値ではありません。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ユーザー エージェント ヘッダー内の製品トークン値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 製品トークンの名前を取得します。 + + を返します。製品トークンの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 製品のヘッダー値の情報を表す文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 製品トークンのバージョンを取得します。 + + を返します。製品トークンのバージョン。 + + + User-Agent ヘッダー内の製品またはコメントのいずれかになる値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + コメント値。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + + オブジェクトからコメントを取得します。 + + を返します。この のコメントの値です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 情報のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な製品情報ヘッダー値の情報です。 + + + + オブジェクトから製品を取得します。 + + を返します。この からの製品の値です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 日付/時刻またはエンティティ タグ値のいずれかとなる If-Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される日付の値。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される文字列として表現されたエンティティ タグ。 + + + + オブジェクトから日付を取得します。 + + を返します。 オブジェクトからのデータです。 + + + + オブジェクトからエンティティ タグを取得します。 + + を返します。 オブジェクトのエンティティ タグです。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + バイト範囲を使用して、 クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な範囲ヘッダー値の情報です。 + + + + オブジェクトから指定した範囲を取得します。 + + を返します。 オブジェクトからの範囲です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから単位を取得します。 + + を返します。 オブジェクトからの単位です。 + + + バイト範囲の Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 日付/時刻または期間値のいずれかとなる Retry-After ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する日付と時刻のオフセット。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される、秒単位の差分です。 + + + + オブジェクトから日付と時刻のオフセットを取得します。 + + を返します。 オブジェクトからの日付と時刻のオフセット。 + + + + オブジェクトから秒単位の差分を取得します。 + + を返します。 オブジェクトの秒単位の差分です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 再試行条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な再試行条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + オプションの品質と文字列ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 新しいインスタンスを初期化するために使用される品質要素。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な文字列ではありません。 + + + + オブジェクトから品質係数を取得します。 + + を返します。 オブジェクトからの品質係数です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから文字列値を取得します。 + + を返します。 オブジェクトから取得された文字列値。 + + + Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 転送コーディング パラメーターを取得します。 + + を返します。転送コーディング パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な転送コーディング ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 転送コーディング値を取得します。 + + を返します。転送コーディング値。 + + + オプションの品質要素と Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 品質係数の値。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な転送コーディングではありません。 + + + + から品質係数を取得します。 + + を返します。 からの品質係数です。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Via ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールドを取得します。 + + を返します。受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コードを返します。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + Via ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な Via ヘッダー値の情報です。 + + + 受信したプロトコルのプロトコル名を取得します。 + + を返します。プロトコル名。 + + + 受信したプロトコルのプロトコル バージョンを取得します。 + + を返します。プロトコル バージョン。 + + + 要求または応答が受信されたホストとポートを取得します。 + + を返します。要求または応答が受信されたホストとポート。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 警告ヘッダーで使用される警告値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + 警告の日付およびタイムスタンプ。 + + + 警告をアタッチしたホストを取得します。 + + を返します。警告をアタッチしたホスト。 + + + 特定の警告コードを取得します。 + + を返します。特定の警告コード。 + + + 警告の日付/タイム スタンプを取得します。 + + を返します。警告の日付およびタイムスタンプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + のインスタンスを返します。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 警告テキストを含む引用文字列を取得します。 + + を返します。警告テキストを含む引用文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ko/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ko/a new file mode 100644 index 00000000000..3034f4eded7 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ko/a @@ -0,0 +1,2846 @@ + + + + System.Net.Http + + + + 바이트 배열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 매개 변수가 null입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 를 초기화하는 데 사용되는 매개 변수의 오프셋(바이트)입니다. + + 를 초기화하기 위해 사용되는 매개 변수에서 시작하는 의 바이트 수입니다. + + 매개 변수가 null입니다. + + 매개 변수가 0 미만인 경우또는 매개 변수의 값이 매개 변수가 지정한 콘텐츠 길이보다 큽니다.또는 매개 변수가 0보다 작은 경우또는 매개 변수가 매개 변수에서 지정한 콘텐츠 길이에서 매개 변수를 뺀 값보다 큽니다. + + + 백업 저장소가 의 메모리인 HTTP 콘텐츠 스트림을 읽기 위한 비동기 작업으로 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 생성자가 제공한 바이트 배열을 HTTP 콘텐츠 스트림에 비동기 작업으로 serialize하고 씁니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 채널 바인딩 토큰과 같은 전송에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 바이트 배열의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 바이트 배열의 길이(바이트)입니다. + + + 클라이언트 인증서 제공 방식을 지정합니다. + + + 사용 가능한 모든 클라이언트 인증서를 자동으로 제공하려는 입니다. + + + 응용 프로그램은 클라이언트 인증서를 에 수동으로 제공합니다.이 값이 기본값입니다. + + + HTTP 응답 메시지의 처리를 내부 처리기라는 다른 처리기로 위임하는 HTTP 처리기의 형식입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 새 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 필요에 따라 관리되는 리소스를 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답 메시지를 처리하는 내부 처리기를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지에 대한 내부 처리기입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + application/x-www-form-urlencoded MIME 형식을 사용하여 인코딩된 이름/값 튜플의 컨테이너입니다. + + + 이름/값 쌍의 특정 컬렉션을 사용하여 클래스의 새 인스턴스를 초기화합니다. + 이름/값 쌍으로 된 컬렉션입니다. + + + URI로 식별되는 리소스에서 HTTP 요청을 보내고 HTTP 응답을 받기 위한 기본 클래스를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 요청을 보내는 데 사용할 HTTP 처리기 스택입니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소를 가져오거나 설정합니다. + + 를 반환합니다.요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소입니다. + + + 이 인스턴스에서 보류 중인 모든 요청을 취소합니다. + + + 각 요청과 함께 보내야 하는 헤더를 가져옵니다. + + 를 반환합니다.각 요청과 함께 보내야 하는 헤더입니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 삭제할 수 있습니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true, 관리되지 않는 리소스만 해제하려면 false입니다. + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + 응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수를 가져오거나 설정합니다. + + 를 반환합니다.응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수입니다.이 속성의 기본값은 2GB입니다. + 지정한 크기가 0보다 작거나 같습니다. + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 요청 시간 제한 범위 내에서 대기할 기간을 가져오거나 설정합니다. + + 를 반환합니다.요청 시간 제한 범위 내에서 대기할 기간입니다. + 지정된 제한 시간이 0보다 작거나 같고 가 아닌 경우 + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + + 에 사용되는 기본 메시지 처리기입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 처리기가 리디렉션 응답을 따르는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기가 리디렉션 응답을 따라야 하는 경우 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + HTTP 콘텐츠 응답의 자동 압축 해체를 위한 처리기에서 사용되는 압축 해제 메서드의 형식을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 사용되는 자동 압축 풀기 방법입니다.기본값은 입니다. + + + 이 처리기와 관련된 보안 인증서의 컬렉션을 가져오거나 설정합니다. + + 를 반환합니다.이 처리기에 연결된 보안 인증서의 컬렉션입니다. + + + 처리기에서 서버 쿠키를 저장하는 데 사용하는 쿠키 컨테이너를 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 서버 쿠키를 저장하는 데 사용되는 쿠키 컨테이너입니다. + + + 이 처리기가 사용하는 인증 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기와 연결된 인증 자격 증명입니다.기본값은 null입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + 처리기가 따르는 최대 리디렉션 수를 가져오거나 설정합니다. + + 를 반환합니다.처리기가 따르는 최대 리디렉션 응답 수입니다.기본값은 50입니다. + + + 처리기에 사용되는 최대 요청 콘텐츠 버퍼 크기를 가져오거나 설정합니다. + + 를 반환합니다.최대 요청 콘텐츠 버퍼 크기(바이트)입니다.기본값은 2GB입니다. + + + 요청과 함께 처리기가 인증 헤더를 보낼 것인지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.인증을 수행한 이후 처리기가 요청과 함께 HTTP 권한 부여 헤더를 함께 보내는 경우 true 이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 사용하는 프록시 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기에 사용되는 프록시 정보입니다.기본값은 null입니다. + + + 차단되지 않을 작업으로 에서 제공된 정보를 기반으로 의 인스턴스를 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 처리기가 자동 응답 콘텐츠 압축 해제를 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기가 자동 응답 콘텐츠 압축 풀기를 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 프록시 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 프록시 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성에 대한 구성 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 속성에 대한 구성 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다. 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는 것을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 기본 자격 증명을 처리기의 요청과 함께 보내는지 여부를 제어하는 값을 가져오거나 설정합니다. + + 를 반환합니다.기본 자격 증명이 사용되면 true이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 요청에 대해 프록시를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 요청에 대해 프록시를 사용해야 하는 경우 true이고, otherwise false.기본값은 true입니다. + + + + 작업이 응답이 가능하면 즉시 완료된 것으로 간주되어야 하는지, 아니면 콘텐츠가 담긴 전체 응답 메시지를 읽은 후 완료된 것으로 간주되어야 하는지 여부를 나타냅니다. + + + 콘텐츠를 포함하여 전체 응답을 읽은 후 작업을 완료 해야 합니다. + + + 응답이 가능하고 헤더를 읽는 즉시 작업을 완료해야 합니다.콘텐츠를 아직 읽지 않았습니다. + + + HTTP 엔터티 본문과 콘텐츠 헤더를 나타내는 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠를 메모리 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + RFC 2616에 정의된 HTTP 콘텐츠 헤더를 가져옵니다. + + 를 반환합니다.RFC 2616에 정의된 콘텐츠 헤더입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 사용할 버퍼의 최대 크기(바이트)입니다. + + + HTTP 콘텐츠를 바이트 배열에 비동기 작업으로 Serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 serialize하고 콘텐츠를 비동기 작업으로 나타내는 스트림을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 문자열에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HTTP 콘텐츠의 길이(바이트)입니다. + + + HTTP 메시지 처리기의 기본 형식입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 응용 프로그램이 Http 처리기 체인에서 메서드를 호출할 수 있는 특수 클래스입니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 표준 HTTP 메서드를 검색 및 비교하고 새 HTTP 메서드를 만들기 위한 도우미 클래스입니다. + + + 특정 HTTP 메서드를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + + + HTTP DELETE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 HTTP 메서드입니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + HTTP GET 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 이 형식에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 의 해시 코드입니다. + + + HTTP HEAD 프로토콜 메서드를 나타냅니다.HEAD 메서드는 서버에서 응답의 메시지 본문 없이 메시지 헤더만 반환한다는 점을 제외하고는 GET 메서드와 동일합니다. + + 를 반환합니다. + + + HTTP 메서드입니다. + + 를 반환합니다.으로 표시되는 HTTP 메서드입니다. + + + 개체를 비교하는 같음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같으면 true이고, 그렇지 않으면 false입니다. + 같음 연산자의 왼쪽에 있는 입니다. + 같음 연산자의 오른쪽에 있는 입니다. + + + 개체를 비교하는 같지 않음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같지 않으면 true이고, 그렇지 않으면 false입니다. + 같지 않음 연산자의 왼쪽에 있는 입니다. + 같지 않음 연산자의 오른쪽에 있는 입니다. + + + HTTP OPTIONS 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 새 엔터티를 URI에 추가할 항목으로 게시하는 데 사용되는 HTTP POST 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + URI로 식별된 엔터티를 바꾸는 데 사용되는 HTTP PUT 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + HTTP TRACE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + + 클래스가 throw하는 예외의 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 현재 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + + + 현재 예외 및 내부 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + 내부 예외입니다. + + + HTTP 요청 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청 를 나타내는 문자열입니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청할 입니다. + + + HTTP 메시지의 내용을 가져오거나 설정합니다. + + 를 반환합니다.메시지 내용 + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 요청 헤더의 컬렉션입니다. + + + HTTP 요청 메서드에서 사용하는 HTTP 메서드를 가져오거나 설정합니다. + + 를 반환합니다.요청 메시지에서 사용하는 HTTP 메서드입니다.기본값은 GET 메서드입니다. + + + HTTP 요청의 속성 집합을 가져옵니다. + + 를 반환합니다. + + + HTTP 요청에 대한 를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청에 사용되는 입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 상태 코드와 데이터가 포함된 HTTP 응답 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 응답의 상태 코드입니다. + + + HTTP 응답 메시지의 텍스트 콘텐츠를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지의 내용입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되지 않는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답의 속성이 false이면 예외를 throw합니다. + + 를 반환합니다.호출이 성공할 경우 HTTP 응답 메시지입니다. + + + HTTP 응답 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 응답 헤더의 컬렉션입니다. + + + HTTP 응답이 성공했는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.HTTP 응답이 성공했는지 여부를 나타내는 값입니다.가 200-299 범위에 있으면 true이고, 그렇지 않으면 false입니다. + + + 일반적으로 서버에서 상태 코드와 함께 보내는 원인 문구를 가져오거나 설정합니다. + + 를 반환합니다.서버에서 보낸 원인 문구입니다. + + + 이 응답 메시지를 유도하는 요청 메시지를 가져오거나 설정합니다. + + 를 반환합니다.이 응답 메시지를 유도하는 요청 메시지입니다. + + + HTTP 응답의 상태 코드를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 상태 코드입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 요청 및/또는 응답 메시지의 적은 처리만 수행하는 처리기의 기본 형식입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + 서버에 보낸 각 요청에서 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 요청 메시지입니다. + 처리할 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 서버에서 각 응답에 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 응답 메시지입니다. + 처리할 HTTP 응답 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션을 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + + 이 null이거나 공백 문자만 있는 경우 + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + 여러 부분으로 구성된 콘텐츠에 대한 경계 문자열입니다. + + 이 null이거나 빈 문자열인 경우가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션에 multipart HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + multipart/* 콘텐츠 형식 사양을 통해 serialize된 개체의 컬렉션 사이를 이동하는 열거자를 반환합니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + multipart HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + + 메서드의 명시적 구현입니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + HTTP multipart 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HHTP 콘텐츠의 길이(바이트)입니다. + + + multipart/form-data MIME 형식을 사용하여 인코딩된 콘텐츠에 대한 컨테이너를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 데이터 콘텐츠에서 여러 부분으로 구성된 경계 문자열입니다. + + 가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + + 이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + 컬렉션에 추가할 HTTP 콘텐츠의 파일 이름입니다. + + 이 null이거나 공백 문자만 있는 경우또는이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + 스트림에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 에 대한 버퍼의 크기(바이트)입니다. + + 이 null인 경우 + + 가 0보다 작거나 같은 경우 + + + HTTP 스트림을 메모리 스트림에 비동기 작업으로 씁니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 스트림 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 스트림 콘텐츠의 길이(바이트)입니다. + + + 문자열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + 콘텐츠에 사용할 미디어 형식입니다. + + + 권한 부여, ProxyAuthorization, WWW-Authneticate 및 Proxy-Authenticate 헤더 값의 인증 정보를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명을 가져옵니다. + + 를 반환합니다.인증 정보가 들어 있는 자격 증명입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 권한 부여에 사용할 스키마를 가져옵니다. + + 를 반환합니다.권한 부여에 사용할 스키마입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Cache-Control 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 할당된 선택적 값이 각각 있는 캐시 확장 토큰입니다. + + 를 반환합니다.할당된 선택적 값이 각각 있는 캐시 확장 토큰의 컬렉션입니다. + + + + 개체에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + HTTP 클라이언트가 응답을 허용하는 최대 보관 기간(초로 지정)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 만료 시간을 초과한 응답을 수락하기까지의 최대 시간(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트가 응답을 허용하는 새로 고침 수명(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + 원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는 경우 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 캐시된 응답을 수용할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트가 캐시된 응답을 허용하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "no-cache" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는지 여부입니다. + + 를 반환합니다.캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 캐시 또는 프록시가 엔터티 본문을 변경해서는 안 되는지 여부입니다. + + 를 반환합니다.캐시나 프록시가 전체 본문의 어떤 부분도 변경하지 않아야 하는 경우 true이고, 그렇지 않으면 false입니다. + + + 캐시가 다른 HTTP 요청의 제약 조건과 일치하는 캐시 엔트리를 사용하여 반응하는지, 또는 504(게이트웨이 제한 시간) 상태로 반응하는지 여부 + + 를 반환합니다.캐시에서 HTTP 요청의 다른 제약 조건과 일관된 캐시된 엔트리를 사용하여 응답하거나 504(게이트웨이 시간 초과) 상태로 응답해야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 캐시 제어 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 캐시 제어 헤더 값 정보가 아닙니다. + + + HTTP 응답 메시지의 전체 또는 일부가 단일 사용자만 사용하기 위한 것이며 공유 캐시에서 캐시되지 않아야 하는지 여부 + + 를 반환합니다.HTTP 응답 메시지가 단일 사용자용이므로 공유 캐시에 캐시되지 않아야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "private" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하면 true이고, 그렇지 않으면 false입니다. + + + 대게 HTTP 응답이 공유되지 않는 캐시 내에서만 캐시할 수 있는지 여부도 포함하여 모든 캐시에서 캐시될 수 있는지 여부 + + 를 반환합니다.일반적으로 캐시할 수 없거나 비공유 캐시 내에서만 캐시할 수 있더라도, HTTP 응답을 캐시에서 캐시할 수 있으면 true이고, 그렇지 않으면 false입니다. + + + 초 단위로 지정된 공유된 최대 보관 기간으로, 공유 캐시의 경우 캐시 컨트롤 헤더나 Expires 헤더에서 "max-age" 지시문을 재정의하는 HTTP 응답에 사용됩니다. + + 를 반환합니다.초 단위 시간입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Disposition 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + 파일을 만든 날짜입니다. + + 를 반환합니다.파일 작성 날짜입니다. + + + 콘텐츠 본문 부분에 대한 처리 형식입니다. + + 를 반환합니다.처리 형식입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.제안된 파일 이름입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.폼 파일 이름*의 제안된 파일 이름입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 마지막으로 파일을 수정한 날짜입니다. + + 를 반환합니다.파일 수정 날짜입니다. + + + 콘텐츠 본문 부분에 대한 이름입니다. + + 를 반환합니다.콘텐츠 본문 부분에 대한 이름입니다. + + + Content-Disposition 헤더를 포함하는 매개 변수의 집합입니다. + + 를 반환합니다.매개 변수 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 처리 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 처리 헤더 값 정보가 아닙니다. + + + 파일에 마지막으로 읽은 날짜입니다. + + 를 반환합니다.마지막으로 읽은 날짜입니다. + + + 파일의 대략적인 크기(바이트)입니다. + + 를 반환합니다.대략적인 크기(바이트)입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치(바이트 단위)입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 콘텐츠 범위 헤더에 길이가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 길이가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 콘텐츠 범위에 범위가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 범위가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 전체 엔티티 본문의 길이를 가져옵니다. + + 를 반환합니다.전체 엔티티 본문의 길이입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 범위 헤더 값 정보가 아닙니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 사용된 범위의 단위입니다. + + 를 반환합니다.단위 범위를 포함하는 + + + 엔터티 태그 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + 이 엔터티 태그 헤더가 약한 유효성 검사기인지 여부를 나타내는 값입니다.엔터티 태그 헤더가 약한 유효성 검사기이면 를 true로 설정해야 합니다.엔터티 태그 헤더가 강한 유효성 검사기이면 를 false로 설정해야 합니다. + + + 엔터티 태그 헤더 값을 가져옵니다. + + 를 반환합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 엔터티 태그가 약점 표시로 시작하는지 여부를 가져옵니다. + + 를 반환합니다.취약성 표시기에 의해 엔터티 태그가 앞에 오면 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 엔터티 태그 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 엔터티 태그 헤더 값 정보가 아닙니다. + + + 불투명한 따옴표가 붙은 문자열을 가져옵니다. + + 를 반환합니다.불투명한 따옴표가 붙은 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 콘텐츠 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Allow 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Allow 헤더 값입니다. + + + HTTP 응답의 Content-Disposition 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Disposition 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Encoding 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Encoding 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Language 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Language 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Length 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Length 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Location 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Location 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-MD5 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-MD5 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Range 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Range 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Type 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Type 콘텐츠 헤더입니다. + + + HTTP 응답의 Expires 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Expires 콘텐츠 헤더입니다. + + + HTTP 응답의 Last-Modified 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Last-Modified 콘텐츠 헤더입니다. + + + RFC 2616에 정의된 헤더와 값의 컬렉션입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 컬렉션에 추가할 헤드 값의 목록입니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + + 컬렉션에서 헤더를 모두 제거합니다. + + + 특정 헤더가 컬렉션에 있는 경우 반환합니다. + + 를 반환합니다.지정된 헤더가 컬렉션에 있으면 true이고, 그렇지 않으면 false입니다. + 특정 헤더입니다. + + + + 인스턴스에서 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.에 대한 열거자입니다. + + + + 컬렉션에 저장된 지정된 헤더에 대한 모든 헤더 값을 반환합니다. + + 를 반환합니다.헤더 문자열의 배열입니다. + 값을 반환할 지정된 헤더입니다. + + + + 컬렉션에서 지정된 헤더를 제거합니다. + + 를 반환합니다. + 컬렉션에서 제거할 헤더의 이름입니다. + + + + 을 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.을 반복할 수 있는 인터페이스 구현의 인스턴스입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 지정된 헤더 및 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 값입니다. + + + 지정된 헤더 및 해당 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + 지정된 헤더와 지정된 값이 컬렉션에 저장되는 경우 반환합니다. + + 를 반환합니다.true는 지정된 헤더 이고 values는 컬렉션에 저장됩니다. 그렇지 않으면 false입니다. + 지정된 헤더입니다. + 지정된 헤더 값입니다. + + + 헤더 값의 컬렉션을 나타냅니다. + 헤더 컬렉션 형식입니다. + + + + 에 엔트리를 추가합니다. + 헤더 컬렉션에 추가할 항목입니다. + + + + 에서 모든 엔트리를 제거합니다. + + + + 에 항목이 포함되어 있는지 여부를 확인합니다. + + 를 반환합니다.엔트리가 인스턴스에 포함되어 있으면 true이고, 그렇지 않으면 false입니다. + 헤더 컬렉션을 찾을 항목입니다. + + + 대상 배열의 지정된 인덱스에서 시작하여 전체 을 호환되는 1차원 에 복사합니다. + + 에서 복사한 요소의 대상인 일차원 입니다.에는 0부터 시작하는 인덱스가 있어야 합니다. + + 에서 복사가 시작되는 인덱스(0부터 시작)입니다. + + + + 의 헤더 수를 가져옵니다. + + 를 반환합니다.컬렉션의 헤더 수입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + + 인스턴스가 읽기 전용인지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다. 인스턴스가 읽기 전용이면 true이고, 그렇지 않으면 false입니다. + + + 엔트리를 구문 분석하고 에 추가합니다. + 추가할 엔트리입니다. + + + 지정된 항목을 에서 제거합니다. + + 를 반환합니다. 인스턴스에서 제거되면 true이고, 그렇지 않으면 false입니다. + 제거할 항목입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 입력을 구문 분석하고 에 추가할 수 있는지 여부를 결정합니다. + + 를 반환합니다.을 구문 분석하고 인스턴스에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 유효성을 검사할 엔트리입니다. + + + RFC 2616에 정의된 요청 헤더의 컬렉션을 나타냅니다. + + + HTTP 요청의 Accept 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept 헤더 값입니다. + + + HTTP 요청의 Accept-Charset 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Charset 헤더 값입니다. + + + HTTP 요청의 Accept-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Encoding 헤더 값입니다. + + + HTTP 요청의 Accept-Language 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Language 헤더 값입니다. + + + HTTP 요청의 Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Authorization 헤더 값입니다. + + + HTTP 요청의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Cache-Control 헤더 값입니다. + + + HTTP 요청의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Connection 헤더 값입니다. + + + HTTP 요청에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 요청의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Date 헤더 값입니다. + + + HTTP 요청의 Expect 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Expect 헤더 값입니다. + + + HTTP 요청에 대한 Expect 헤더에 Continue가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Expect 헤더에 계속이 들어 있으면 true이고, otherwise false. + + + HTTP 요청의 From 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 From 헤더 값입니다. + + + HTTP 요청의 Host 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Host 헤더 값입니다. + + + HTTP 요청의 If-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-Match 헤더 값입니다. + + + HTTP 요청의 If-Modified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Modified-Since 헤더 값입니다. + + + HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + + HTTP 요청의 If-Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Range 헤더 값입니다. + + + HTTP 요청의 If-Unmodified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Unmodified-Since 헤더 값입니다. + + + HTTP 요청의 Max-Forwards 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Max-Forwards 헤더 값입니다. + + + HTTP 요청의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Pragma 헤더 값입니다. + + + HTTP 요청의 Proxy-Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Proxy-Authorization 헤더 값입니다. + + + HTTP 요청의 Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Range 헤더 값입니다. + + + HTTP 요청의 Referer 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Referer 헤더 값입니다. + + + HTTP 요청의 TE 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 TE 헤더 값입니다. + + + HTTP 요청의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Trailer 헤더 값입니다. + + + HTTP 요청의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Transfer-Encoding 헤더 값입니다. + + + HTTP 요청에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 요청의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Upgrade 헤더 값입니다. + + + HTTP 요청의 User-Agent 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 User-Agent 헤더 값입니다. + + + HTTP 요청의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Via 헤더 값입니다. + + + HTTP 요청의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Warning 헤더 값입니다. + + + RFC 2616에 정의된 응답 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Accept-Ranges 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Accept-Ranges 헤더 값입니다. + + + HTTP 응답의 Age 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Age 헤더 값입니다. + + + HTTP 응답의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Cache-Control 헤더 값입니다. + + + HTTP 응답의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Connection 헤더 값입니다. + + + HTTP 응답에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 응답의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Date 헤더 값입니다. + + + HTTP 응답의 ETag 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 ETag 헤더 값입니다. + + + HTTP 응답의 Location 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Location 헤더 값입니다. + + + HTTP 응답의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Pragma 헤더 값입니다. + + + HTTP 응답의 Proxy-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Proxy-Authenticate 헤더 값입니다. + + + HTTP 응답의 Retry-After 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Retry-After 헤더 값입니다. + + + HTTP 응답의 Server 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Server 헤더 값입니다. + + + HTTP 응답의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Trailer 헤더 값입니다. + + + HTTP 응답의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Transfer-Encoding 헤더 값입니다. + + + HTTP 응답에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Upgrade 헤더 값입니다. + + + HTTP 응답의 Vary 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Vary 헤더 값입니다. + + + HTTP 응답의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Via 헤더 값입니다. + + + HTTP 응답의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Warning 헤더 값입니다. + + + HTTP 응답의 WWW-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 WWW-Authenticate 헤더 값입니다. + + + RFC 2616에 정의된 대로 Content-Type 헤더에 사용된 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타낸 소스입니다. + + + 문자 집합을 가져오거나 설정합니다. + + 를 반환합니다.문자 집합입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 미디어 형식의 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값입니다. + + + 미디어 형식의 헤더 값 매개 변수를 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 유형 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 미디어 형식 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Type 헤더에 사용된 추가 품질 요소를 가진 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + 이 헤더 값과 연결된 품질입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 형식과 품질 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 미디어 형식이 아닙니다. + + + + 에 대한 품질 값을 가져오거나 설정합니다. + + 를 반환합니다. 개체의 품질 값입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 헤더 이름을 가져옵니다. + + 를 반환합니다.헤더 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 이름 값 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 헤더 값을 가져옵니다. + + 를 반환합니다.헤더 값입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 매개 변수를 가진 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + + 개체에서 매개 변수를 가져옵니다. + + 를 반환합니다.매개 변수를 포함하는 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값과 매개 변수 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 매개 변수 헤더 값 정보가 포함된 유효한 이름 값이 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + User-Agent 헤더의 제품 토큰 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 제품 토큰의 이름을 가져옵니다. + + 를 반환합니다.제품 토큰의 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 헤더 값 정보를 나타내는 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 제품 토큰의 버전을 가져옵니다. + + 를 반환합니다.제품 토큰의 버전입니다. + + + User-Agent 헤더에서 제품 또는 메모일 수 있는 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 주석 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + + 개체에서 주석을 가져옵니다. + + 를 반환합니다.이 의 주석 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 정보 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 제품 정보 헤더 값 정보가 아닙니다. + + + + 개체에서 제품을 가져옵니다. + + 를 반환합니다.이 의 제품 값입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 날짜/시간 또는 엔터티 태그 값일 수 있는 If-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 문자열로 나타내는 엔터티 태그입니다. + + + + 개체에서 날짜를 가져옵니다. + + 를 반환합니다. 개체의 날짜입니다. + + + + 개체에서 엔터티 태그를 가져옵니다. + + 를 반환합니다. 개체의 엔터티 태그입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 범위 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 바이트 범위를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 헤더 값 정보가 아닙니다. + + + + 개체에서 지정된 범위를 가져옵니다. + + 를 반환합니다. 개체의 범위입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체에서 단위를 가져옵니다. + + 를 반환합니다. 개체의 단위입니다. + + + 범위 헤더 값에서 바이트 범위를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 날짜/시간 또는 timespan 값일 수 있는 Retry-After 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜와 시간 오프셋입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 델타(초)입니다. + + + + 개체의 날짜와 시간 오프셋을 가져옵니다. + + 를 반환합니다. 개체의 날짜와 시간 오프셋입니다. + + + + 개체에서 델타(초)를 가져옵니다. + + 를 반환합니다. 개체의 델타(초)입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 다시 시도 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 다시 시도 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 선택적 품질의 문자열 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 새 인스턴스를 초기화하는 데 사용되는 품질 요소입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 품질 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 문자열이 아닙니다. + + + + 개체에서 품질 요소를 가져옵니다. + + 를 반환합니다. 개체의 품질 요소입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체의 문자열 값을 가져옵니다. + + 를 반환합니다. 개체의 문자열 값입니다. + + + accept-encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 전송 코딩 매개 변수를 가져옵니다. + + 를 반환합니다.전송 코딩 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 전송 코딩 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 전송 코딩 값을 가져옵니다. + + 를 반환합니다.전송 코딩 값입니다. + + + 선택적 품질 요소의 Accept-Encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 품질 요소의 값입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 전송 코딩이 아닙니다. + + + + 에서 품질 요소를 가져옵니다. + + 를 반환합니다.의 품질 요소입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Via 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + 수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 수취 프록시 또는 게이트웨이의 소프트웨어를 식별하는데 사용되는 설명 필드를 가져옵니다. + + 를 반환합니다.수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드를 반환합니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 Via 헤더 값 정보가 아닙니다. + + + 받은 프로토콜의 프로토콜 이름을 가져옵니다. + + 를 반환합니다.프로토콜 이름입니다. + + + 받은 프로토콜의 프로토콜 버전을 가져옵니다. + + 를 반환합니다.프로토콜 버전입니다. + + + 요청 또는 응답을 받은 호스트 및 포트를 가져옵니다. + + 를 반환합니다.요청 또는 응답을 받은 호스트 및 포트입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 경고 헤더에서 사용하는 경고 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + 경고의 날짜/시간 스탬프입니다. + + + 경고를 연결하는 호스트를 가져옵니다. + + 를 반환합니다.경고를 연결하는 호스트입니다. + + + 특정 경고 코드를 가져옵니다. + + 를 반환합니다.특정 경고 코드입니다. + + + 경고의 날짜/타임 스탬프를 가져옵니다. + + 를 반환합니다.경고의 날짜/시간 스탬프입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 인스턴스를 반환합니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 경고 텍스트가 포함된 따옴표 붙은 문자열을 가져옵니다. + + 를 반환합니다.경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ru/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ru/a new file mode 100644 index 00000000000..bc26ceba05f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/ru/a @@ -0,0 +1,2290 @@ + + + + System.Net.Http + + + + Предоставляет содержимое HTTP на основе массива байтов. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Значение параметра — null. + + + Инициализирует новый экземпляр класса . + Содержимое, используемое для инициализации . + Смещение в байтах в параметре , используемом для инициализации объекта . + Число байтов в параметре , начиная с параметра , используемых для инициализации объекта . + Значение параметра — null. + Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром .– или –Значение параметра меньше нуля.– или –Значение параметра больше длины содержимого, указанного параметром без учета параметра . + + + Создает поток содержимого HTTP как асинхронную операцию для чтения, чье резервное хранилище — память из . + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация и запись указанного в конструкторе массива байтов в поток содержимого HTTP в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте, например, о токене привязки каналов.Этот параметр может иметь значение null. + + + Определяет, имеет ли массив байтов допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) массива байтов. + + + Определяет способ предоставления клиентских сертификатов. + + + Объект будет пытаться предоставить все доступные клиентские сертификаты автоматически. + + + Приложение вручную предоставляет клиентские сертификаты объектам .Это значение по умолчанию. + + + Тип для обработчиков HTTP, которые делегируют обработку ответных сообщений HTTP другому обработчику, который называется внутренним обработчиком. + + + Создание нового экземпляра класса . + + + Создает новый экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Освобождает неуправляемые ресурсы, используемые объектом , и по возможности — управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает внутренний обработчик, который обрабатывает сообщения откликов HTTP. + Возвращает .Внутренний обработчик для сообщений HTTP-откликов. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает . Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены для отмены операции. + Значение параметра — null. + + + Контейнер для кортежей " имя-значение ", закодированных с помощью типа MIME application/x-www-form-urlencoded. + + + Инициализирует новый экземпляр класса с конкретной коллекцией пар "имя-значение". + Коллекция пар имен и значений. + + + Предоставляет базовый класс для отправки HTTP-запросов и получения HTTP-ответов от ресурса с заданным URI. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса указанным обработчиком. + Стек обработчика HTTP-данных, используемый для отправки запросов. + + + Инициализирует новый экземпляр класса указанным обработчиком. + Компонент , отвечающий за обработку сообщений ответов HTTP. + Значение true, если внутренний обработчик должен быть удален с помощью Dispose(); значение false, если планируется повторно использовать внутренний обработчик. + + + Возвращает или задает базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + Возвращает .Базовый адрес универсального кода ресурса (URI) интернет-ресурса, используемого при отправке запросов. + + + Отмена всех ожидающих запросов на этом экземпляре. + + + Возвращает заголовки, которые должны отправляться с каждым запросом. + Возвращает .Заголовки, которые должны отправляться с каждым запросом. + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка запроса DELETE к указанному URI с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Освобождает неуправляемые ресурсы, используемые объектом , и опционально удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает . + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Значение параметра — null. + + + Отправка запроса GET к указанному универсальному коду ресурса (URI) с параметром "выполнение HTTP" и токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра завершения операции HTTP, указывающее, когда следует считать операцию завершенной. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса DELETE указанному универсальному коду ресурса (URI) с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде массива байтов в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде потока в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Отправка запроса GET согласно указанному универсальному коду ресурса (URI) и возврат текста ответа в виде строки в асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Значение параметра — null. + + + Возвращает или задает максимальное число байтов в буфере при чтении содержимого отклика. + Возвращает .Максимальное число байтов в буфере при чтении содержимого отклика.Значением по умолчанию для этого свойства является 2 гигабайта. + Указанный размер меньше или равен нулю. + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса POST по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса POST с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка запроса PUT по указанному универсальному коду ресурса (URI) в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Значение параметра — null. + + + Отправка запроса PUT с токеном отмены в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Универсальный код ресурса (URI), по которому отправляется запрос. + Содержимое HTTP-запроса, отправляемое на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Когда должна завершиться операция (как только будет доступен отклик или после считывания всего содержимого отклика). + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Отправка HTTP-запроса в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + Сообщение запроса уже было отправлено экземпляром . + + + Возвращает или задает время ожидания для выполнения запроса. + Возвращает .Время ожидания для выполнения запроса. + Указанное время ожидания меньше или равно нулю и не является . + Операция для текущего экземпляра уже запущена. + Текущий экземпляр был удален. + + + Обработчик сообщений по умолчанию, используемый объектом . + + + Создает экземпляр класса . + + + Получает или задает значение, которое указывает, должен ли обработчик следовать откликам переадресации. + Возвращает .Значение true, если обработчик должен следовать откликам перенаправления; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает тип метода распаковки, используемый обработчиком для автоматической распаковки содержимого отклика HTTP. + Возвращает .Метод автоматической распаковки, используемый обработчиком.Значение по умолчанию — . + + + Получает или задает коллекцию сертификатов безопасности, связанных с данным обработчиком. + Возвращает .Коллекция сертификатов безопасности, связанная с данным обработчиком. + + + Получает или задает контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + Возвращает .Контейнер файлов cookie, используемый для хранения файлов cookie сервера обработчиком. + + + Получает или задает данные для аутентификации, используемые этим обработчиком. + Возвращает .Учетные данные аутентификации, связанные с заголовком.Значение по умолчанию: null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает или задает максимальное количество переадресаций, выполняемых обработчиком. + Возвращает .Максимальное количество откликов переадресации, указаниям которых следует обработчик.Значение по умолчанию - 50. + + + Получает или задает максимальный размер буфера содержимого запроса, используемый обработчиком. + Возвращает .Максимальный размер буфера содержимого запроса в байтах.По умолчанию используется значение 2 гигабайта. + + + Получает или задает значение, указывающее, отправляет ли обработчик заголовок авторизации вместе с запросом. + Возвращает .Значение true для обработчика, с запросом требуется отправить заголовок авторизации HTTP после выполнения аутентификации; в противном случае — значение false.Значение по умолчанию — false. + + + Получает или задает сведения о прокси-сервере, используемом обработчиком. + Возвращает .Сведения о прокси-сервере, используемом обработчиком.Значение по умолчанию — null. + + + Создает экземпляр на основе сведений, предоставленных в как операция, которая не блокируется. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса. + Токен отмены для отмены операции. + Значение параметра — null. + + + Получает значение, указывающее, поддерживает ли обработчик автоматическую распаковку содержимого ответа. + Возвращает .Значение true, если обработчик поддерживает автоматическую распаковку содержимого отклика; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры прокси. + Возвращает .Значение true, если обработчик поддерживает параметры прокси-сервера; в противном случае — значение false.Значение по умолчанию — true. + + + Получает значение, указывающее, поддерживает ли обработчик параметры конфигурации для свойств и . + Возвращает .Значение true, если обработчик поддерживает параметры конфигурации для свойств и ; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, указывающее, использует ли обработчик свойство для хранения файлов cookie сервера, а также использует ли он эти файлы cookie при отправке запросов. + Возвращает .Значение true, если обработчик использует свойство для хранения файлов cookie сервера и использует эти файлы cookie при отправке запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Получает или задает значение, которое управляет отправкой обработчиком учетных данных по умолчанию вместе с запросами. + Возвращает .Значение равно true, если используются учетные данные по умолчанию, в противном случае — false.Значение по умолчанию — false. + + + Получает или задает значение, указывающее, использует ли обработчик прокси для запросов. + Возвращает .Значение true, если обработчик должен использовать прокси-сервер для запросов; в противном случае — значение false.Значение по умолчанию — true. + + + Указывает, должны ли операции считаться завершенными, как только имеется отклик, или после чтения всего сообщения отклика, включая содержимое. + + + Операция должна завершиться после считывания всего отклика, включая содержимое. + + + Операция должна завершиться сразу после того, как отклик станет доступен и будут считаны заголовки.Содержимое еще не прочитано. + + + Базовый класс, представляющий заголовки содержимого и тело сущности HTTP. + + + Инициализирует новый экземпляр класса . + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + + + Выполнит сериализацию содержимого HTTP в поток байтов и копирует его в объект потока, предоставленный в качестве параметра . + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Сериализация содержимого HTTP в поток памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает заголовки содержимого HTTP, определенные в RFC 2616. + Возвращает .Заголовки содержимого, соответствующие определениям в RFC 2616. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в буфер памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Максимальный размер используемого буфера в байтах. + + + Сериализация содержимого HTTP в массив байтов в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Выполнять сериализацию содержимого HTTP и возвращать поток, который представляет содержимое как асинхронную операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в строку в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое HTTP допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) HTTP-содержимого. + + + Базовый тип обработчиков сообщений HTTP. + + + Инициализирует новый экземпляр класса . + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Специальный Класс, который позволяет приложениям вызывать метод по цепочке обработчика HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + + + Инициализирует экземпляр класса с конкретным . + + , отвечающий за обработку сообщений откликов HTTP. + true, если внутренний обработчик должен быть удален с помощью Dispose (); false, если планируется повторно использовать внутренний обработчик. + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Отправляет HTTP-запрос в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщение HTTP-запроса для отправки. + Токен отмены для отмены операции. + Значение параметра — null. + + + Вспомогательный класс для получения и сравнения стандартных методов HTTP и создания новых методов HTTP. + + + Инициализирует новый экземпляр класса с конкретным методом HTTP. + Метод HTTP. + + + Представляет метод протокола HTTP DELETE. + Возвращает . + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Метод HTTP для сравнения с текущим объектом. + + + Определяет, равен ли указанный объект текущему объекту . + Возвращает .true, если заданный объект равен текущему объекту; в противном случае — false. + Объект, который требуется сравнить с текущим объектом. + + + Представляет метод протокола HTTP GET. + Возвращает . + + + Служит в качестве хэш-функции для данного типа. + Возвращает .Хэш-код для текущего объекта . + + + Представляет метод протокола HTTP HEAD.Метод HEAD идентичен методу GET за исключением того, что сервер возвращает в ответе только заголовки сообщений без основного текста сообщений. + Возвращает . + + + Метод HTTP. + Возвращает .Метод HTTP, представленный в виде . + + + Оператор равенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и равны; в противном случае — значение false. + Объект , который находится слева от оператора равенства. + Объект , который находится справа от оператора равенства. + + + Оператор неравенства для сравнения двух объектов . + Возвращает .Значение true, если указанные параметры и не равны; в противном случае — значение false. + Объект , который находится слева от оператора неравенства. + Объект , который находится справа от оператора неравенства. + + + Представляет метод протокола HTTP OPTIONS. + Возвращает . + + + Представляет метод протокола HTTP POST, который используется для публикации новой сущности в качестве дополнения к URI. + Возвращает . + + + Представляет метод протокола HTTP PUT, который используется для замены сущности, указанной с помощью URI. + Возвращает . + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строка, представляющая текущий объект. + + + Представляет метод протокола HTTP TRACE. + Возвращает . + + + Базовый класс для исключений, вызванных классами и . + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключением. + Сообщение, описывающее текущее исключение. + + + Инициализирует новый экземпляр класса с конкретным сообщением, описывающим текущее исключение и внутреннее исключение. + Сообщение, описывающее текущее исключение. + Внутреннее исключение. + + + Представляет сообщение HTTP-запроса. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Строка, представляющая объект запроса. + + + Инициализирует новый экземпляр класса с методом HTTP и запроса. + Метод HTTP. + Запрашиваемый объект . + + + Получает или задает содержимое сообщения HTTP. + Возвращает .Содержимое сообщения + + + Освобождает неуправляемые ресурсы и удаляет управляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Получает коллекцию заголовков HTTP-запросов. + Возвращает .Коллекция заголовков HTTP-запросов. + + + Получает или задает метод HTTP, используемый сообщением запроса HTTP. + Возвращает .Метод HTTP, используемый сообщением запроса.Значение по умолчанию — метод GET. + + + Получает набор свойств для HTTP-запроса. + Возвращает . + + + Получает или задает , используемый для HTTP-запроса. + Возвращает ., используемый для HTTP-запроса. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Представляет ответное сообщение HTTP, включая код и данные о состоянии. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса с конкретным свойством . + Код состояния HTTP-отклика. + + + Получает или задает содержимое сообщения отклика HTTP. + Возвращает .Содержимое сообщения HTTP-отклика. + + + Освобождает неуправляемые ресурсы и удаляет неуправляемые ресурсы, используемые объектом . + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Создает исключение, если свойство для HTTP-отклика имеет значение false. + Возвращает .Сообщение ответа HTTP, если вызов метода завершился успешно. + + + Получает коллекцию заголовков HTTP-откликов. + Возвращает .Коллекция заголовков HTTP-откликов. + + + Получает значение, указывающее, был ли успешен HTTP-отклик. + Возвращает .Значение, указывающее, был ли успешен HTTP ответ.Значение true, если значение свойства находится в диапазоне 200-299; в противном случае — значение false. + + + Получает или задает фразу причины, которая обычно отправляется серверами вместе с кодом состояния. + Возвращает .Фраза причины, отправленная сервером. + + + Получает или задает сообщение запроса, на которое получено это сообщение отклика. + Возвращает .Сообщение запроса, на которое получено это сообщение отклика. + + + Получает или задает код состояния HTTP-отклика. + Возвращает .Код состояния HTTP-отклика. + + + Возвращает строку, представляющую текущий объект. + Возвращает .Строковое представление текущего объекта. + + + Получает или задает версию сообщения HTTP. + Возвращает .Версия сообщения HTTP.Значение по умолчанию — 1.1. + + + Базовый тип для обработчиков, которые выполняют определенную небольшую часть обработки запросов и ответных сообщений. + + + Создает экземпляр класса . + + + Создает экземпляр класса с указанным внутренним обработчиком. + Внутренний обработчик, отвечающий за обработку сообщений откликов HTTP. + + + Выполняет обработку для каждого запроса, отправленного серверу. + Возвращает .Обработанное сообщение HTTP-запроса. + Сообщение HTTP-запроса для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Выполнить обработку на каждом ответе сервера. + Возвращает .Обработанное сообщение HTTP-отклика. + Сообщение HTTP-отклика для обработки. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + + + Отправляет HTTP-запрос внутреннему обработчику, отправляемый серверу в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Сообщения HTTP-запроса, которые необходимо отправить на сервер. + Токен отмены, который может использоваться другими объектами или потоками для получения уведомления об отмене. + Значение параметра — null. + + + Предоставляет коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Параметр имел значение null или содержит только пробелы. + + + Создание нового экземпляра класса . + Подтип составного содержимого. + Строка, представляющая границу составного содержимого. + Параметр имеет значение null или содержит пустую строку.Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавить многокомпонентное содержимое HTTP в коллекцию объектов , которые сериализуются используя спецификацию типа содержимого multipart/*. + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Возвращает перечислитель, который перебирает коллекцию объектов , которые сериализуются, используя спецификацию типа содержимого multipart/*. + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Сериализация содержимого HTTP, состоящего из нескольких частей, в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Явная реализация метода . + Возвращает .Объект, который может использоваться для итерации по коллекции. + + + Определяет, имеет ли содержимое HTTP из нескольких частей допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байта) HTTP-содержимого. + + + Предоставляет контейнер для закодированного с помощью типа MIME "multipart/form-data" содержимого. + + + Создание нового экземпляра класса . + + + Создание нового экземпляра класса . + Строка, представляющая границу составного содержимого данных формы. + Параметр имел значение null или содержит только пробелы.– или –Параметр заканчивается символом пробела. + Длина параметра больше 70. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Добавление содержимого HTTP в коллекцию объектов , которые сериализуются в тип MIME "multipart/form-data". + HTTP-содержимое, добавляемое в коллекцию. + Имя добавляемого содержимого HTTP. + Имя файла для HTTP-содержимого, которое требуется добавить в коллекцию. + Параметр имел значение null или содержит только пробелы.– или –Параметр имел значение null или содержит только пробелы. + Значение параметра — null. + + + Предоставляет содержимое HTTP на основе потока. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Размер (в байтах) буфера, доступного для . + Значение параметра — null. + Значение параметра было меньше или равно нулю. + + + Запись содержимого потока HTTP в поток в памяти в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + + + Освобождает неуправляемые ресурсы, используемые объектом , и при необходимости удаляет управляемые ресурсы. + Значение true для освобождения управляемых и неуправляемых ресурсов; значение false для освобождения только неуправляемых ресурсов. + + + Сериализация содержимого HTTP в поток в качестве асинхронной операции. + Возвращает .Объект задачи, представляющий асинхронную операцию. + Целевой поток. + Сведения о транспорте (например, о токене привязки каналов).Этот параметр может иметь значение null. + + + Определяет, имеет ли содержимое потока допустимую длину в байтах. + Возвращает .Значение true, если является допустимой длиной; в противном случае — значение false. + Длина (в байтах) содержимого потока. + + + Предоставляет содержимое HTTP на основе строки. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + + + Создание нового экземпляра класса . + Содержимое, используемое для инициализации . + Кодировка, используемая для содержимого. + Тип мультимедиа, используемый для содержимого. + + + Представляет сведения об аутентификации в значениях заголовка Authorization, ProxyAuthorization, WWW-Authneticate и Proxy-Authenticate. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + + + Инициализирует новый экземпляр класса . + Схема, которую требуется использовать для авторизации. + Учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает учетные данные, содержащие сведения для аутентификации агента пользователя для запрашиваемого ресурса. + Возвращает .Учетные данные, содержащие сведения об аутентификации. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает схему, используемую для авторизации. + Возвращает .Схема, которую требуется использовать для авторизации. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Cache-Control. + + + Инициализирует новый экземпляр класса . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Токены Кэш-расширения, каждый с необязательным присвоенным значения. + Возвращает .Коллекция токенов кэш-расширений, каждый с необязательным присвоенным значением. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Максимальная длительность, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Готов ли клиент HTTP принять отклик, срок действия которого истек. + Возвращает .Значение true, если клиент HTTP готов принять отклик, срок действия которого истек; в противном случае — значение false. + + + Максимальное время (в секундах), в течение которого клиент HTTP готов принять отклик, срок действия которого истек. + Возвращает .Время в секундах. + + + Длительность существования, указанная в секундах, в течение которой клиент HTTP готов принять отклик. + Возвращает .Время в секундах. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает; в противном случае — значение false. + + + Готов ли клиент HTTP принять кэшированный отклик. + Возвращает .Значение true, если клиент HTTP готов принять кэшированный отклик; в противном случае — значение false. + + + Коллекция имен полей в некэшированной директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Не должна ли храниться в кэше какая-либо часть сообщения HTTP-запроса или любого отклика. + Возвращает .Значение true, если в кэше не должна храниться какая-либо часть сообщения HTTP-запроса или любого отклика; в противном случае — значение false. + + + Не должен ли кэш или прокси изменять какой-либо аспект тела сущности. + Возвращает .Значение true, если кэш или прокси не должны изменять какой-либо аспект тела сущности; в противном случае — значение false. + + + Должен ли кэш отвечать, используя согласованную с другими ограничениями HTTP-запроса кэшированную запись или состояние 504 (время ожидания шлюза). + Возвращает .Значение true, если в отклике кэш должен либо использовать кэшированную запись, согласованную с другими ограничениями HTTP-запроса, либо состояние 504 (истекло время ожидания шлюза); в противном случае — значение false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка элемента управления кэшем. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка управления кэшем. + + + Предназначено ли все сообщение отклика HTTP или его часть для одного пользователя и не должно ли это сообщение или его часть кэшироваться в общем кэше. + Возвращает .Значение true, если сообщение HTTP-отклика предназначено для одного пользователя и не должно кэшироваться в общем кэше; в противном случае — значение false. + + + Имена полей коллекции в закрытой директиве в поле заголовка кэш-элемента управления в HTTP-отклике. + Возвращает .Коллекция имен полей. + + + Требует ли сервер-источник выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей. + Возвращает .Значение true, если сервер-источник требует выполнения повторной проверки записи кэша при любом последующем использовании, когда запись кэша устаревает для общих кэшей агентов пользователей; в противном случае — значение false. + + + Может ли отклик HTTP кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в необщем кэше. + Возвращает .Значение true, если HTTP-отклик может кэшироваться любым кэшем, даже если он обычно не кэшируется или кэшируется только в кэше без общего доступа; в противном случае — значение false. + + + Общая максимальная длительность (в секундах) в отклике HTTP, которая переопределяет директиву "max-age" в заголовке управления кэшем или в заголовке Expires для общего кэша. + Возвращает .Время в секундах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Disposition. + + + Инициализирует новый экземпляр класса . + Объект . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Дата создания файла. + Возвращает .Дата создания файла. + + + Тип расположения для части основного текста содержимого. + Возвращает .Тип расположения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Предложение для построения имя файла для хранения полезных данные сообщения, используемое, если сущность удалена и хранится в отдельном файле. + Возвращает .Предлагаемое имя файла. + + + Предложение для построения имен файлов для хранения полезных данные сообщений, используемое, если сущности удалены и хранятся в отдельном файле. + Возвращает .Предложенное имя файла в виде filename*. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Дата последнего изменения файла. + Возвращает .Дата изменения файла. + + + Имя части тела содержимого. + Возвращает .Имя части тела содержимого. + + + Набор параметров содержал заголовок Content-Disposition. + Возвращает .Коллекция параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка расположения содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка расположения содержимого. + + + Дата последнего чтения файла. + Возвращает .Дата последнего считывания. + + + Приблизительный размер файла в байтах. + Возвращает .Приблизительный размер в байтах. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Content-Range. + + + Инициализирует новый экземпляр класса . + Начальная или конечная точка диапазона, в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + + + Инициализирует новый экземпляр класса . + Позиция начала передачи данных в байтах. + Позиция окончания передачи данных в байтах. + Начальная или конечная точка диапазона, в байтах. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Позиция начала передачи данных в байтах. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее, задана ли длина заголовка Content-Range. + Возвращает .true, если длина заголовка Content-Range задана; в противном случае — false. + + + Получает значение, указывающее, задано ли диапазон для Content-Range. + Возвращает .true, если диапазон заголовка Content-Range задан; в противном случае — false. + + + Получает длину полного тела сущности. + Возвращает .Длина полного тела сущности. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона содержимого. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона содержимого. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Используемые единицы диапазона. + Возвращает .Объект , содержащий единицы диапазона. + + + Представляет значение заголовка тега сущности. + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + + + Инициализирует новый экземпляр класса . + Строка, содержащая . + Значение, указывающее, является ли данный заголовок тега сущности слабым проверяющим элементом.Если заголовок тега сущности — слабый проверяющий элемент, должно быть установлено в значение true.Если заголовок тега сущности — сильный проверяющий элемент, должно быть установлено в значение false. + + + Получает значение заголовка тега сущности. + Возвращает . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает значение, указывающее предшествует ли тегу сущности индикатор ослабления. + Возвращает .true, если тегу сущности предшествует индикатор ослабления; в противном случае — false. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка тега сущности. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка тега сущности. + + + Получает Непрозрачную строку в кавычках. + Возвращает .Непрозрачная строка в кавычках. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет коллекцию заголовков Content в соответствии с RFC 2616. + + + Получает значение заголовка содержимого Allow в HTTP-ответе. + Возвращает .Значение заголовка Allow в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Disposition в HTTP-ответе. + Возвращает .Значение заголовка содержимого Content-Disposition в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Encoding в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Encoding в HTTP-отклике. + + + Получает значение заголовка содержимого Content-Language в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Language в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Length в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Length в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Location в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Location в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-MD5 в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-MD5 в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Range в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Range в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Content-Type в HTTP-отклике. + Возвращает .Значение заголовка содержимого Content-Type в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Expires в HTTP-отклике. + Возвращает .Значение заголовка содержимого Expires в HTTP-отклике. + + + Получает или задает значение заголовка содержимого Last-Modified в HTTP-отклике. + Возвращает .Значение заголовка содержимого Last-Modified в HTTP-отклике. + + + Коллекция заголовков и их значения, как указано в RFC 2616. + + + Инициализирует новый экземпляр класса . + + + Добавляет указанный заголовок и его значения в коллекцию . + Заголовок для добавления в коллекцию. + Список значений заголовков для добавления в коллекцию. + + + Добавляет указанный заголовок и его значение в коллекцию . + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Удаляет все заголовки из коллекции . + + + Возвращает, существует ли конкретный заголовок в коллекции . + Возвращает .Значение true, если указанный заголовок существует в коллекции; в противном случае — значение false. + Определенный заголовок. + + + Возвращает перечислитель, с помощью которого можно перебирать все элементы экземпляра коллекции . + Возвращает .Перечислитель для объекта . + + + Возвращает все значения заголовка для указанного заголовка, хранящихся в коллекции . + Возвращает .Массив строк заголовка. + Указанный заголовок, для которого требуется вернуть значения. + + + Удаляет указанный заголовок из коллекции . + Возвращает . + Имя заголовка, который должен быть удален из коллекции. + + + Возвращает перечислитель, который может перебирать элементы . + Возвращает .Экземпляр реализации , который может перебирать элементы в коллекции . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значения в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Значения заголовка. + + + Возвращает значение, указывающее, были ли добавлены указанный заголовок и его значение в коллекцию без проверки предоставленных сведения. + Возвращает .Значение true, если указанный заголовок и можно добавить в коллекцию; в противном случае — значение false. + Заголовок для добавления в коллекцию. + Содержимое данного заголовка. + + + Указывает, хранятся ли указанный заголовок и заданные значения в коллекции . + Возвращает .Значение true, если параметры и values указанного заголовка хранятся в коллекции; в противном случае — значение false. + Указанное средство чтения. + Заданные значения заголовка. + + + Представляет коллекцию значений заголовка. + Тип коллекции заголовков. + + + Добавляет запись в коллекцию . + Элемент для добавления в коллекцию заголовков. + + + Удаляет все записи из . + + + Определяет, содержит ли элемент. + Возвращает .Значение true, если запись содержится в экземпляре ; в противном случае — значение false. + Элемент для поиска в коллекцию заголовков. + + + Копирует целый массив в совместимый одномерный массив , начиная с заданного индекса целевого массива. + Одномерный массив , в который копируются элементы из интерфейса .Массив должен иметь индексацию, начинающуюся с нуля. + Индекс (с нуля) в массиве , с которого начинается копирование. + + + Получает количество заголовков в наборе . + Возвращает .Число заголовков в коллекции. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Получает значение, указывающее, действительно ли экземпляр доступен только для чтения. + Возвращает .Значение true, если экземпляр класса доступен только для чтения, в противном случае — значение false. + + + Анализирует и добавляет запись в . + Добавляемая запись. + + + Удаляет указанный элемент из поля со списком . + Возвращает .Значение true, если элемент успешно удален из экземпляра , в противном случае — значение false. + Удаляемый элемент. + + + Возвращает перечислитель, осуществляющий перебор элементов списка . + Возвращает .Возвращает перечислитель для экземпляра . + + + Возвращает строку, представляющую текущий объект . объект. + Возвращает .Строка, представляющая текущий объект. + + + Определяет, может ли ввод быть проанализировано и добавлен в . + Возвращает .значение true, если может быть проанализировано и добавлен в экземпляр ; в противном случае — значение false + Проверяемое запись. + + + Представляет коллекцию заголовков Request в соответствии с RFC 2616. + + + Получает значение заголовка Accept для HTTP-запроса. + Возвращает .Значение заголовка Accept для HTTP-запроса. + + + Получает значение заголовка Accept-Charset для HTTP-запроса. + Возвращает .Значение заголовка Accept-Charset для HTTP-запроса. + + + Получает значение заголовка Accept-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Accept-Encoding для HTTP-запроса. + + + Получает значение заголовка Accept-Language для HTTP-запроса. + Возвращает .Значение заголовка Accept-Language для HTTP-запроса. + + + Получает или задает значение заголовка Authorization для HTTP-запроса. + Возвращает .Значение заголовка Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Cache-Control для HTTP-запроса. + Возвращает .Значение заголовка Cache-Control для HTTP-запроса. + + + Получает значение заголовка Connection для HTTP-запроса. + Возвращает .Значение заголовка Connection для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-запроса инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-запроса. + Возвращает .Значение заголовка Date для HTTP-запроса. + + + Получает значение заголовка Expect для HTTP-запроса. + Возвращает .Значение заголовка Expect для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Expect HTTP-запроса инструкцию Continue. + Возвращает .Значение true, если заголовок Expect содержит Continue; в противном случае — значение false. + + + Получает или задает значение заголовка From для HTTP-запроса. + Возвращает .Значение заголовка From для HTTP-запроса. + + + Получает или задает значение заголовка Host для HTTP-запроса. + Возвращает .Значение заголовка Host для HTTP-запроса. + + + Получает значение заголовка If-Match для HTTP-запроса. + Возвращает .Значение заголовка If-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Modified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Modified-Since для HTTP-запроса. + + + Получает значение заголовка If-None-Match для HTTP-запроса. + Возвращает .Получает значение заголовка If-None-Match для HTTP-запроса. + + + Получает или задает значение заголовка If-Range для HTTP-запроса. + Возвращает .Значение заголовка If-Range для HTTP-запроса. + + + Получает или задает значение заголовка If-Unmodified-Since для HTTP-запроса. + Возвращает .Значение заголовка If-Unmodified-Since для HTTP-запроса. + + + Получает или задает значение заголовка Max-Forwards для HTTP-запроса. + Возвращает .Значение заголовка Max-Forwards для HTTP-запроса. + + + Получает значение заголовка Pragma для HTTP-запроса. + Возвращает .Значение заголовка Pragma для HTTP-запроса. + + + Получает или задает значение заголовка Proxy-Authorization для HTTP-запроса. + Возвращает .Значение заголовка Proxy-Authorization для HTTP-запроса. + + + Получает или задает значение заголовка Range для HTTP-запроса. + Возвращает .Значение заголовка Range для HTTP-запроса. + + + Получает или задает значение заголовка Referer для HTTP-запроса. + Возвращает .Значение заголовка Referer для HTTP-запроса. + + + Получает значение заголовка TE для HTTP-запроса. + Возвращает .Значение заголовка TE для HTTP-запроса. + + + Получает значение заголовка Trailer для HTTP-запроса. + Возвращает .Значение заголовка Trailer для HTTP-запроса. + + + Получает значение заголовка Transfer-Encoding для HTTP-запроса. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-запроса. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-запроса инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-запроса. + Возвращает .Значение заголовка Upgrade для HTTP-запроса. + + + Получает значение заголовка User-Agent для HTTP-запроса. + Возвращает .Значение заголовка User-Agent для HTTP-запроса. + + + Получает значение заголовка Via для HTTP-запроса. + Возвращает .Значение заголовка Via для HTTP-запроса. + + + Получает значение заголовка Warning для HTTP-запроса. + Возвращает .Значение заголовка Warning для HTTP-запроса. + + + Представляет коллекцию заголовков Response в соответствии с RFC 2616. + + + Получает значение заголовка Accept-Ranges для HTTP-отклика. + Возвращает .Значение заголовка Accept-Ranges для HTTP-отклика. + + + Получает или задает значение заголовка Age для HTTP-отклика. + Возвращает .Значение заголовка Age для HTTP-отклика. + + + Получает или задает значение заголовка Cache-Control для HTTP-отклика. + Возвращает .Значение заголовка Cache-Control для HTTP-отклика. + + + Получает значение заголовка Connection для HTTP-отклика. + Возвращает .Значение заголовка Connection для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Connection HTTP-ответа инструкцию Close. + Возвращает .Значение true, если заголовок Connection содержит Close; в противном случае — значение false. + + + Получает или задает значение заголовка Date для HTTP-отклика. + Возвращает .Значение заголовка Date для HTTP-отклика. + + + Получает или задает значение заголовка ETag для HTTP-отклика. + Возвращает .Значение заголовка ETag для HTTP-отклика. + + + Получает или задает значение заголовка Location для HTTP-отклика. + Возвращает .Значение заголовка Location для HTTP-отклика. + + + Получает значение заголовка Pragma для HTTP-отклика. + Возвращает .Значение заголовка Pragma для HTTP-отклика. + + + Получает значение заголовка Proxy-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка Proxy-Authenticate для HTTP-отклика. + + + Получает или задает значение заголовка Retry-After для HTTP-отклика. + Возвращает .Значение заголовка Retry-After для HTTP-отклика. + + + Получает значение заголовка Server для HTTP-отклика. + Возвращает .Значение заголовка Server для HTTP-отклика. + + + Получает значение заголовка Trailer для HTTP-отклика. + Возвращает .Значение заголовка Trailer для HTTP-отклика. + + + Получает значение заголовка Transfer-Encoding для HTTP-отклика. + Возвращает .Значение заголовка Transfer-Encoding для HTTP-отклика. + + + Получает или задает значение, указывающее, содержит ли заголовок Transfer-Encoding HTTP-ответа инструкцию chunked. + Возвращает .Значение true, если заголовок Transfer-Encoding содержит параметр "chunked"; в противном случае — значение false. + + + Получает значение заголовка Upgrade для HTTP-отклика. + Возвращает .Значение заголовка Upgrade для HTTP-отклика. + + + Получает значение заголовка Vary для HTTP-отклика. + Возвращает .Значение заголовка Vary для HTTP-отклика. + + + Получает значение заголовка Via для HTTP-отклика. + Возвращает .Значение заголовка Via для HTTP-отклика. + + + Получает значение заголовка Warning для HTTP-отклика. + Возвращает .Значение заголовка Warning для HTTP-отклика. + + + Получает значение заголовка WWW-Authenticate для HTTP-отклика. + Возвращает .Значение заголовка WWW-Authenticate для HTTP-отклика. + + + Представляет тип носителя, используемый в заголовке типа содержимого согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Источник, представленный в виде строки для инициализации нового экземпляра. + + + Получает или задает кодировку. + Возвращает .Набор символов. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает или задает значение заголовка типа носителя. + Возвращает .Значение заголовка типа мультимедиа. + + + Получает или задает параметры значения заголовка типа носителя. + Возвращает .Параметры значений заголовка типа мультимедиа. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка типа мультимедиа. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка типа мультимедиа. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет тип мультимедиа типа с дополнительными коэффициентом качества, используемый в заголовке типа содержимого. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + + , представленный в виде строки для инициализации нового экземпляра. + Качество, связанное с этим значением заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая тип мультимедиа со сведениями о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимыми типом мультимедиа со сведениями о значении заголовка качества. + + + Получает или задает значение качества для . + Возвращает .Значение качества для объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет пару " имя-значение ", которое используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя заголовка. + Возвращает .Имя заголовка. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка значения имени. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка значения имени. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение заголовка. + Возвращает .Значение заголовка. + + + Представляет пару " имя-значение " с параметрами, которые используется в различных заголовках согласно определению в стандарте RFC 2616. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + + + Инициализирует новый экземпляр класса . + Имя заголовка. + Значение заголовка. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры объекта . + Возвращает .Коллекция, содержащая параметров. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая значение имени со сведениями о значении заголовка параметров. + Параметр имеет ссылку null. + + не является допустимым значением имени со сведениями о значении заголовка параметра. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение токена продукта в заголовке агента пользователя. + + + Инициализирует новый экземпляр класса . + Название продукта. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает имя токена продукта. + Возвращает .Имя токена продукта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка продукта. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает версию токена продукта. + Возвращает .Версия токена продукта. + + + Представляет значение, которое может быть либо продуктом либо комментарием в заголовке User-Agent. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Значение комментария. + + + Инициализирует новый экземпляр класса . + Значение имени продукта. + Значение Версии продукта. + + + Получает комментарий из объекта . + Возвращает .Значение комментария — этот . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка информации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка сведений о продукте. + + + Получает продукт из объекта . + Возвращает .Значение продукта из данного объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка If-Range, которое может быть либо значением даты и времени, либо значением тега сущности. + + + Инициализирует новый экземпляр класса . + Значение даты, используемое для инициализации нового экземпляра . + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Тег сущности, представленный в виде строки, используемой для инициализации нового экземпляра. + + + Получает Дата из объекта . + Возвращает .Дата из объекта . + + + Получает Тег сущности объекта . + Возвращает .Тег сущности объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Range. + + + Инициализирует новый экземпляр класса . + + + Инициализирует новый экземпляр класса диапазоном байтов. + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка диапазона. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка диапазона. + + + Получает диапазоны, указанные из объекта . + Возвращает .Диапазоны из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает модуль из объекта . + Возвращает .Модуль из объекта . + + + Представляет диапазон байтов в значении заголовка Range. + + + Инициализирует новый экземпляр класса . + Место начала передачи данных. + Место остановки передачи данных. + Значение параметра больше величины – или – Значение или меньше 0. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Получает положение, с которого начнется отправка данных. + Возвращает .Место начала передачи данных. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает положение остановки передачи данных. + Возвращает .Место остановки передачи данных. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Представляет значение заголовка Retry-After, которое может быть либо значением даты и времени, либо значением интервала времени. + + + Инициализирует новый экземпляр класса . + Смещение даты и времени, используемое для инициализации нового экземпляра класса . + + + Инициализирует новый экземпляр класса . + Разность в секундах, используемая для инициализации нового экземпляра. + + + Получает смещение даты и времени от объекта . + Возвращает .Смещение даты и времени от объекта . + + + Получает Разность в секундах из объекта . + Возвращает .Разность в секундах из объекта . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка условия повтора. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка условия повтора. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка строки с необязательным качеством. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Коэффициент качества, используемый для инициализации нового экземпляра . + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка представляющая сведения о значении заголовка качества. + Параметр имеет ссылку null. + + не является допустимой строкой со сведениями о значении заголовка качества. + + + получает коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение строки из Объекта . + Возвращает .Значение строки из объекта . + + + Представляет значение заголовка Accept-Encoding. + + + Инициализирует новый экземпляр класса . + Объект , который используется для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Получает параметры кодирования передачи. + Возвращает .параметры кодирования передачи. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка кодирования передачи. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка кодирования передачи. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Получает значение кодирования передачи. + Возвращает .значение кодирования передачи. + + + Представляет значение заголовка Accept-Encoding с необязательным коэффициентом качества. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + + + Инициализирует новый экземпляр класса . + Строка, используемая для инициализации нового экземпляра. + Значение для коэффициента качества. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении кодирования передачи. + Параметр имеет ссылку null. + + не является допустимой кодировкой переноса со сведениями о значении заголовка качества. + + + Получает Коэффициент качества из объекта . + Возвращает .Коэффициент качества из объекта . + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение заголовка Via. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + + + Инициализирует новый экземпляр класса . + Версия полученного протокола. + Узел и порт, которыми был получен запрос или отклик. + Имя полученного протокола. + Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Получает поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + Возвращает .Поле комментария, используемое для идентификации программного обеспечения принимающего прокси или шлюза. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Возвращает хэш-код текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает .Экземпляр . + Строка, представляющая сведения о значении заголовка Via. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка Via. + + + Получает имя полученного протокола. + Возвращает .Имя протокола. + + + Получает версию полученного протокола. + Возвращает .Версия протокола. + + + Получает Узел и порт, которыми был получен запрос или ответ. + Возвращает .Узел и порт, которыми был получен запрос или отклик. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + Представляет значение предупреждения, используемое заголовком предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + + + Инициализирует новый экземпляр класса . + Конкретный код предупреждения. + Основное приложение, которое присоединило предупреждение. + Строка в кавычках, содержащая текст предупреждения. + Отметка даты и времени предупреждения. + + + Получает узел, который присоединил предупреждение. + Возвращает .Основное приложение, которое присоединило предупреждение. + + + Получает конкретный код предупреждения. + Возвращает .Конкретный код предупреждения. + + + Получает отметку даты и времени предупреждения. + Возвращает .Отметка даты и времени предупреждения. + + + Определяет, равен ли заданный объект текущему объекту . + Возвращает .Значение true, если заданный объект равен текущему объекту; в противном случае — значение false. + Объект, который требуется сравнить с текущим объектом. + + + Служит в качестве хэш-функции для объекта . + Возвращает .Хэш-код для текущего объекта. + + + Преобразует строку в экземпляр . + Возвращает экземпляр объекта . + Строка представляющая сведения о значении заголовка аутентификации. + Параметр имеет ссылку null. + + не является допустимыми сведениями о значении заголовка аутентификации. + + + Получает строку в кавычках, содержащую текст предупреждения. + Возвращает .Строка в кавычках, содержащая текст предупреждения. + + + Возвращает строку, представляющую текущий объект . + Возвращает .Строка, представляющая текущий объект. + + + Определяет, является ли строка допустимой информацией . + Возвращает .Значение true, если параметр является допустимой информацией ; в противном случае — значение false. + Строка, которую следует проверить. + Возвращает версию строки . + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hans/q b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hans/q new file mode 100644 index 00000000000..3d0d1708770 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hans/q @@ -0,0 +1,2367 @@ + + + + System.Net.Http + + + + 基于字节数组提供 HTTP 内容。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数为 null。 + + + 初始化 类的新实例。 + 用于初始化 的内容。 + + 参数中用于初始化 的偏移量(以字节为单位)。 + + 中从用于初始化 参数开始的字节数。 + + 参数为 null。 + + 参数小于零。- 或 - 参数大于 参数指定的内容的长度。- 或 - 参数小于零。- 或 - 参数大于由 参数减去 参数所指定的内容长度。 + + + 创建 HTTP 内容流,它是其后备储存区是 的内存的读取的异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化并写入在构造函数中提供的字节数组到作为异步操作的 HTTP 内容流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息,例如,通道绑定。此参数可以为 null。 + + + 确定字节数组是否具有合法的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的字节数组的长度。 + + + 指定如何提供客户端证书。 + + + + 将尝试自动提供所有可用的客户端证书。 + + + 该应用程序向 手动提供客户端证书。这值是默认值。 + + + 将 HTTP 响应消息的处理委托给另一处理程序(称为“内部处理程序”)的 HTTP 处理程序的类型。 + + + 创建 类的新实例。 + + + 创建特定内部处理程序的 类的新实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置处理 HTTP 响应消息的内部处理程序。 + 返回 。HTTP 响应消息的内部处理程序。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 使用应用程序/x-www-form-urlencoded MIME 类型编码的名称/值元组的容器。 + + + 使用指定的名称/值对集合初始化 类的新实例。 + 名称/值对的集合。 + + + 提供基本类,用于发送 HTTP 请求和接收来自通过 URI 确认的资源的 HTTP 响应。 + + + 初始化 类的新实例。 + + + 用特定的处理程序初始化 类的新实例。 + 要用于发送请求的 HTTP 处理程序堆栈。 + + + 用特定的处理程序初始化 类的新实例。 + 负责处理 HTTP 响应消息的 。 + 如果内部处理程序应由 Dispose() 处理,则为 true,如果希望重用内部处理程序,则为 false。 + + + 获取或设置发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + 返回 。发送请求时使用的 Internet 资源的统一资源标识符 (URI) 的基址。 + + + 取消该实例所有挂起的请求。 + + + 获取与每个请求一起发送的标题。 + 返回 。应与每一个请求一起发送的标题。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作将 DELETE 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + 请求消息已由 实例发送。 + + + 用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果释放托管资源和非托管资源,则为 true;如果仅释放非托管资源,则为 false。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 GET 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + + 为 null。 + + + 用以异步操作的 HTTP 完成选项和取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 指示操作应视为已完成的时间的 HTTP 完成选项值。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 用以异步操作的取消标记发送 GET 请求到指定的 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字节数组的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 将 GET 请求发送到指定 URI 并在异步操作中以字符串的形式返回响应正文。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + + 为 null。 + + + 获取或设置读取响应内容时要缓冲的最大字节数。 + 返回 。当读取响应内容时缓冲区的最大字节数。此属性的默认值为 2 GB。 + 指定小于或等于零。 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 POST 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 POST 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作将 PUT 请求发送给指定 URI。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + + 为 null。 + + + 用以异步操作的取消标记发送 PUT 请求。 + 返回 。表示异步操作的任务对象。 + 请求发送到的 URI。 + 发送到服务器的 HTTP 请求内容。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 操作应完成时(在响应可利用或在读取整个响应内容之后)。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + 请求消息已由 实例发送。 + + + 获取或设置请求超时前等待的时间跨度。 + 返回 。请求超时前等待的时间跨度。 + 指定的超时值小于或等于零,并且不为 + 在当前实例中已启动操作。 + 已释放当前的实例。 + + + + 所用的默认消息版本。 + + + 创建 类的实例。 + + + 获取或设置一个值,该值指示处理程序是否应跟随重定向响应。 + 返回 。如果处理器应按照重定向响应,则为 true;否则为 false。默认值为 true。 + + + 获取或设置处理程序用于实现 HTTP 内容响应的自动解压缩的解压缩方法。 + 返回 。由处理程序使用的自动解压缩。默认值为 + + + 获取或设置与此处理程序关联的安全证书集合。 + 返回 。与此提供程序关联的安全证书的集合。 + + + 获取或设置用于存储处理程序产生的服务器 Cookie 的 Cookie 容器。 + 返回 。用于通过处理程序存储服务器 cookie 的 cookie 容器。 + + + 获取或设置此处理程序使用的身份验证信息。 + 返回 。与处理程序相关联的身份验证凭证。默认值为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取或设置将跟随的处理程序的重定向的最大数目。 + 返回 。处理程序跟随的最大重定向响应数。默认值为 50。 + + + 获取或设置处理程序的使用的请求内容的最大缓冲区大小。 + 返回 。最大请求内容缓冲区大小(以字节为单位)。默认值为 2 GB。 + + + 获取或设置一个值,该值指示处理程序是否随请求发送一个“身份验证”标头。 + 返回 。处理程序的 true 在发生身份验证之后随请求一起发送 HTTP 授权标头;否则为 false。默认值为 false。 + + + 获取或设置处理程序使用的代理信息。 + 返回 。被处理程序使用的代理信息。默认值为 null。 + + + 创建基于作为不会阻塞的操作的 中提供的信息的 实例。 + 返回 。表示异步操作的任务对象。 + HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 获取指示处理程序是否支持自动响应内容解压的值。 + 返回 。如果处理器支持自动响应内容解压缩,则为 true;否则 false。默认值为 true。 + + + 获取指示处理程序是否支持代理设置的值。 + 返回 。如果处理器支持代理设置,则为 true;否则为 false。默认值为 true。 + + + 获取指示处理程序是否支持 属性配置设置的值。 + 返回 。如果处理器支持 属性的配置设置,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值指示发送请求时,处理程序是否使用 属性存储服务器 Cookie 并使用这些 Cookie。 + 返回 。如果处理程序支持使用 属性来存储服务器 Cookie 并在发送请求时使用这些 Cookie,则为 true;否则为 false。默认值为 true。 + + + 获取或设置一个值,该值控制默认凭据是否被处理程序随请求一起发送。 + 返回 。如果使用默认凭据,则为 true;否则为 false。默认值为 false。 + + + 获取或设置一个值,该值指示处理程序是否为请求使用代理。 + 返回 。如果该管理器应为请求使用代理项,则为 true;否则为 false。默认值为 true。 + + + 指示 操作是在响应可利用时立即视为已完成,还是在读取包含上下文的整个答案信息之后才视为已完成。 + + + 操作应在阅读包括该内容的整个响应之后完成。 + + + 响应一可用且标题可读时即应完成的操作。尚未读取的内容。 + + + 表示 HTTP 实体正文和内容标头的基类。 + + + 初始化 类的新实例。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + + + 将 HTTP 内容序列化为字节流并将其复制到作为 参数提供的流对象。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 将 HTTP 内容序列化为内存流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 根据 RFC 2616 中的定义,获取内容标头。 + 返回 。如 RFC 2616 中定义的内容标头。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到内存缓冲区。 + 返回 。表示异步操作的任务对象。 + 要使用的缓冲区的最大大小(以字节为单位)。 + + + 将 HTTP 内容序列化为字节数组以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 序列化 HTTP 内容并返回表示内容的流以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 将 HTTP 内容序列化到字符串以作为异步操作。 + 返回 。表示异步操作的任务对象。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定 HTTP 内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HTTP 对象的长度。 + + + HTTP 消息处理程序的基类型。 + + + 初始化 类的新实例。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个特殊类,它允许应用程序对 Http 处理程序链调用 方法。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + + + 初始化指定的 类的实例。 + + 负责处理 HTTP 响应消息。 + true 如果内部处理程序应由 Dispose 处理(),false ,如果您希望重用内部处理程序。 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作发送 HTTP 请求。 + 返回 。表示异步操作的任务对象。 + 要发送的 HTTP 请求消息。 + 取消操作的取消标记。 + + 为 null。 + + + 一个帮助器类,它用于检索并比较标准 HTTP 方法并且用于创建新的 HTTP 方法。 + + + 使用指定的 HTTP 方法初始化 类的新实例。 + HTTP 方法。 + + + 表示一个 HTTP DELETE 协议方法。 + 返回 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前目标进行比较的 HTTP 方法。 + + + 确定指定的 是否等于当前的 + 返回 。如果指定的对象等于当前对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 表示一个 HTTP GET 协议方法。 + 返回 + + + 用作此类型的哈希函数。 + 返回 。当前 的哈希代码。 + + + 表示一个 HTTP HEAD 协议方法。除了服务器在响应中只返回消息头不返回消息体以外,HEAD 方法和 GET 是一样的。 + 返回 + + + HTTP 方法。 + 返回 。表示作为 的 HTTP 方法。 + + + 用于比较两个 对象的相等运算符。 + 返回 。如果指定的 参数相等,则为 true;否则为 false。 + 相等运算符左侧的 。 + 相等运算符右侧的 。 + + + 用于比较两个 对象的不相等运算符。 + 返回 。如果指定的 参数不相等,则为 true;否则为 false。 + 不相等运算符左侧的 。 + 不相等运算符右侧的 。 + + + 表示一个 HTTP OPTIONS 协议方法。 + 返回 + + + 表示一个 HTTP POST 协议方法,该方法用于将新实体作为补充发送到某个 URI。 + 返回 + + + 表示一个 HTTP PUT 协议方法,该方法用于替换 URI 标识的实体。 + 返回 + + + 返回表示当前对象的字符串。 + 返回 。一个表示当前对象的字符串。 + + + 表示一个 HTTP TRACE 协议方法。 + 返回 + + + + 所引发的异常的基类。 + + + 初始化 类的新实例。 + + + 使用由特定的用来描述当前异常的消息初始化 类的新实例。 + 描述当前异常的消息。 + + + 使用指定消息以及描述当前异常的内部异常来初始化 类的新实例。 + 描述当前异常的消息。 + 内部异常。 + + + 表示 HTTP 请求消息。 + + + 初始化 类的新实例。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 表示请求 的字符串。 + + + 初始化 HTTP 方法和请求 类的新实例。 + HTTP 方法。 + 要请求的 。 + + + 获取或设置 HTTP 消息的内容。 + 返回 。消息的内容 + + + 释放由 使用的非托管资源和托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 获取 HTTP 请求标头的集合。 + 返回 。HTTP 请求标头的集合。 + + + 获取或设置 HTTP 请求信息使用的 HTTP 方法。 + 返回 。被请求消息使用的HTTP 方法。GET 是默认方法。 + + + 获取 HTTP 请求的属性集。 + 返回 + + + 获取或设置 HTTP 请求的 + 返回 。用于 HTTP 请求的 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 表示包括状态代码和数据的 HTTP 响应消息。 + + + 初始化 类的新实例。 + + + 初始化指定的 类的新实例。 + HTTP 响应的状态代码。 + + + 获取或设置 HTTP 响应消息的内容。 + 返回 。HTTP 响应消息的内容。 + + + 释放由 使用的非托管资源。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 如果 HTTP 响应的 属性为 false, 将引发异常。 + 返回 。如果调用成功则 HTTP 响应消息。 + + + 获取 HTTP 响应标头的集合。 + 返回 。HTTP 响应标头的集合。 + + + 获取一个值,该值指示 HTTP 响应是否成功。 + 返回 。指示 HTTP 响应是否成功的值。如果 在 200-299 范围中,则为 true;否则为 false。 + + + 获取或设置服务器与状态代码通常一起发送的原因短语。 + 返回 。服务器发送的原因词组。 + + + 获取或设置导致此响应消息的请求消息。 + 返回 。导致此响应信息的请求消息。 + + + 获取或设置 HTTP 响应的状态代码。 + 返回 。HTTP 响应的状态代码。 + + + 返回表示当前对象的字符串。 + 返回 。当前对象的字符串表示形式。 + + + 获取或设置 HTTP 消息版本。 + 返回 。HTTP 消息版本。默认值为 1.1。 + + + 仅执行请求和/或响应消息的的某些小处理操作的处理程序的基类型。 + + + 创建 类的实例。 + + + 创建特定内部处理程序的 类的实例。 + 负责处理 HTTP 响应消息的内部处理程序。 + + + 对发送到服务器的每个响应执行处理。 + 返回 。被处理的 HTTP 请求消息。 + 要处理的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 对来自服务器的每个响应执行处理。 + 返回 。已处理的 HTTP 响应消息。 + 要处理的 HTTP 响应消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + + 以异步操作发送 HTTP 请求到内部管理器以发送到服务器。 + 返回 。表示异步操作的任务对象。 + 要发送到服务器的 HTTP 请求消息。 + 可由其他对象或线程用以接收取消通知的取消标记。 + + 为 null。 + + + 提供 对象的集合,其可通过使用多部分/* 内容类型规范序列化。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + + 为 null 或只包含空白字符。 + + + 创建 类的新实例。 + 多部分内容的子类型。 + 多部分内容的边界字符串。 + 为 null 或空字符串。 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 添加多部分 HTTP 内容到 对象的集合,其可通过使用多部分/* 内容类型规范获取序列化。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 返回循环访问 对象的集合的枚举器,其可通过使用多部分/* 内容类型规范序列化。 + 返回 。一个可用于循环访问集合的对象。 + + + 以异步操作将多部分 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + + 方法的显式实现。 + 返回 。一个可用于循环访问集合的对象。 + + + 确定 HTTP 多部分内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的 HHTP 对象的长度。 + + + 提供容器,用于使用多部分/表格数据 MIME 类型编码的内容。 + + + 创建 类的新实例。 + + + 创建 类的新实例。 + 多部分窗体数据内容的边界字符串。 + + 为 null 或只包含空白字符。- 或 - 以空白字符结尾。 + + 的长度大于 70。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + + 为 null 或只包含空白字符。 + + 为 null。 + + + 向序列化到多部/窗体数据 MIME 类型的 对象集合添加 HTTP 内容。 + 要添加到集合中的 HTTP 内容。 + 要添加的 HTTP 内容的名称。 + 要添加到集合中的 HTTP 内容的文件名。 + + 为 null 或只包含空白字符。- 或 - 为 null 或只包含空白字符。 + + 为 null。 + + + 基于流提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + 的缓冲区的大小(以字节为单位)。 + + 为 null。 + + 小于或等于零。 + + + 以异步操作将 HTTP 流内容写入内存流。 + 返回 。表示异步操作的任务对象。 + + + 释放由 使用的非托管资源,并可根据需要释放托管资源。 + 如果为 true,则释放托管资源和非托管资源;如果为 false,则仅释放非托管资源。 + + + 以异步操作将 HTTP 内容序列化到流。 + 返回 。表示异步操作的任务对象。 + 目标流。 + 有关传输的信息(例如,通道绑定)。此参数可以为 null。 + + + 确定流内容是否具备有效的字节长度。 + 返回 。如果 为有效长度,则为 true;否则,为 false。 + 以字节为单位的流内容的长度。 + + + 基于字符串提供 HTTP 内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + + + 创建 类的新实例。 + 用于初始化 的内容。 + 用于内容的编码。 + 要用于该内容的媒体。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authneticate 和 Proxy-Authenticate 标头值中的验证信息。 + + + 初始化 类的新实例。 + 用于授权的架构。 + + + 初始化 类的新实例。 + 用于授权的架构。 + 包含请求资源的用户代理的身份验证消息的凭证。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取包含所请求资源的用户代理的身份验证信息的凭据。 + 返回 。凭证包含身份验证信息。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取用于身份验证的方案。 + 返回 。用于授权的架构。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Cache-Control 标头的值。 + + + 初始化 类的新实例。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 缓存扩展符,每个缓存扩展符都赋有可选值。 + 返回 。缓存扩展符的集合,每个缓存扩展符都赋有可选值。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + HTTP 客户端愿意接受以秒为指定单位的最大生存期。 + 返回 。以秒为单位的时间。 + + + HTTP 客户是否愿意接受已超过其过期时间的响应。 + 返回 。如果HTTP 客户愿意接受已超过过期时间的响应,则为 true;否则为 false。 + + + HTTP 客户端愿意接受的已超过其过期时间的响应的最长时间(以秒为单位)。 + 返回 。以秒为单位的时间。 + + + HTTP 客户端愿意接受以秒为单位响应的新鲜生命期。 + 返回 。以秒为单位的时间。 + + + 缓存项过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 客户是否愿意接受缓存响应。 + 返回 。如果 HTTP 客户愿意接受缓存响应,则为 true,否则为 false。 + + + HTTP 响应时缓存控制标头字段中“no-cache”指令中的 fieldnames 的集合。 + 返回 。fieldnames 的集合。 + + + 缓存是否不能存储 HTTP 请求 mressage 或任何响应的任何部件。 + 返回 。如果缓存不能存储 HTTP 请求 mressage 或任何响应的任何部件,则 true;否则,为 false。 + + + 缓存或代理项是否无法更改该个体主体的任何方面。 + 返回 。如果缓存或代理项无法更改该个体主体的任何方面,则 true;否则,为 false。 + + + 缓存是否应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态。 + 返回 。如果缓存应使用与其他 HTTP 请求一致的缓存项进行响应或响应 504(网关超时)状态,则 true;否则,为 false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示缓存控制标头值信息。 + + 为 null 引用。 + + 是无效的缓存控制标头值信息。 + + + HTTP 响应消息的全部或部分是否适用于单个用户且不得由共享缓存进行缓存。 + 返回 。如果 HTTP 响应消息的全部或部分适用于单个用户和是否必须由共享缓存进行缓存,则为 true;否则为 false。 + + + HTTP 响应时缓存控制标头字段中“私有”指令的集合 fieldnames。 + 返回 。fieldnames 的集合。 + + + 缓存项对共享的用户代理缓存过时时,源服务器是否需要对任何后续使用的缓存项进行验证。 + 返回 。如果缓存项对共享的用户代理缓存过时时源服务器需要对任何后续使用的缓存项进行验证,则为 true;否则为 false。 + + + HTTP 响应是否可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存。 + 返回 。如果 HTTP 响应可由任何缓存进行缓存,即使它通常在非共享缓存中仅不可缓存或可缓存,则为 true;否则为 false。 + + + 在一个 HTTP 响应中共享的最大年龄,指定每秒,该响应直接在用于缓存-控件标题或一个用于缓存的过期标题中重载了“最大年龄”。 + 返回 。以秒为单位的时间。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Disposition 标头的值。 + + + 初始化 类的新实例。 + + 。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 创建文件的日期。 + 返回 。文件生成日期。 + + + 内容正文部分的处置类型。 + 返回 。处置类型。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 当实体在一个单独的文件中分离和储存时,如何为储存要使用的消息负载构造一个文件名的建议。 + 返回 。建议的文件名。 + + + 当主体在单独的文件中分离和储存时,如何为储存要使用的消息负载构造文件名的建议。 + 返回 。窗体 filename* 的建议文件名。 + + + 用作 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 上次修改文件的日期。 + 返回 。文件修改日期。 + + + 一个内容主体部分的名称。 + 返回 。该内容主体部分的名称。 + + + 参数集包含 Content-Disposition 标头。 + 返回 。参数的集合。 + + + 将字符串转换为 实例。 + 返回 实例。 + 字符串表示内容处置标头值信息。 + + 为 null 引用。 + + 是无效的内容处置标头值信息。 + + + 上次读取文件的日期。 + 返回 。上次读取日期。 + + + 文件的近似大小(字节)。 + 返回 。近似大小,以字节为单位。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Content-Range 标头的值。 + + + 初始化 类的新实例。 + 范围的开始点或结束点(以字节为单位)。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + + + 初始化 类的新实例。 + 开始发送数据的位置,以字节为单位。 + 停止发送数据的位置,以字节为单位。 + 范围的开始点或结束点(以字节为单位)。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置,以字节为单位。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取 Content-Range 标头是否具有指定的长度。 + 返回 。true如果 Content-Range 具有指定的长度,否则false。 + + + 获取 Content-Range 是否具有指定的范围。 + 返回 。true如果 Content-Range 具有指定的范围,否则false。 + + + 获取完整实体正文的长度。 + 返回 。完整的实体正文的长度。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示内容范围标头值信息。 + + 为 null 引用。 + + 是无效的内容范围标头值信息。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 使用大小单位。 + 返回 。包含范围单元的 + + + 表示实体标记标头值。 + + + 初始化 类的新实例。 + 包含 的字符串。 + + + 初始化 类的新实例。 + 包含 的字符串。 + 一个指示此实体标记标头是否为弱验证程序的值。如果实体标记标头为弱验证程序,则应将 设置为 true。如果实体标记标头为强验证程序,则应将 设置为 false。 + + + 获取实体标记标头值。 + 返回 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取实体标记是否由缺点指示符开头。 + 返回 。true 如果由缺点指示符开头获取实体标记,否则false。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示实体标记标头值信息。 + + 为 null 引用。 + + 是无效的实体标记标头值信息。 + + + 获取不透明的带引号字符串。 + 返回 。一个不透明的带引号的字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 响应的 Allow 内容标题的值。 + 返回 。请求 HTTP 的 Allow 标题的值。 + + + 获取 HTTP 响应的 Content-Disposition 内容标题的值。 + 返回 。请求 HTTP 的 Content-Disposition 内容标题的值。 + + + 获取 HTTP 响应的 Content-Encoding 内容标题的值。 + 返回 。请求 HTTP 的 Content-Encoding 内容标题的值。 + + + 获取 HTTP 响应的 Content-Language 内容标题的值。 + 返回 。请求 HTTP 的 Content-Language 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Length 内容标头值。 + 返回 。请求 HTTP 的 Content-Length 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Location 内容标头值。 + 返回 。请求 HTTP 的 Content-Location 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-MD5 内容标头值。 + 返回 。请求 HTTP 的 Content-MD5 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Range 内容标头值。 + 返回 。请求 HTTP 的 Content-Range 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Content-Type 内容标头值。 + 返回 。请求 HTTP 的 Content-Type 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Expires 内容标头值。 + 返回 。请求 HTTP 的 Expires 内容标题的值。 + + + 获取或设置 HTTP 响应上的 Last-Modified 内容标头值。 + 返回 。请求 HTTP 的 Last-Modified 内容标题的值。 + + + 标头及其在 RFC 2616 中定义的值的集合。 + + + 初始化 类的新实例。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 要向集合中添加的标头值的列表。 + + + 添加指定的标头及其值到 集合中。 + 要添加到集合中的标头。 + 标头的内容。 + + + 集合中移除所有标头。 + + + 如果指定标头存在于 集合中,则返回。 + 返回 。如果集合中存在指定标头,则为 true;否则为 false。 + 指定的读取器。 + + + 返回可循环访问 实例的枚举数。 + 返回 的一个枚举数。 + + + 返回存储在 集合中所有指定标头的标头值。 + 返回 。标头字符串数组。 + 返回值所应用的指定读取器。 + + + 集合中移除指定的标头。 + 返回 + 要从集合中移除的标头名称。 + + + 获取一个枚举数,该枚举数可以循环访问 + 返回 (可循环访问 )的实现的实例。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的值。 + + + 返回一个值,该值指示是否已将指定标头及其值添加到 集合而未验证所提供的信息。 + 返回 。如果指定标头 可以添加到集合中,则为 true;否则为 false。 + 要添加到集合中的标头。 + 标头的内容。 + + + 如果指定的标头和指定的值存储在 集合中则返回。 + 返回 。true 是指定的标头 ,并且 values 已存储在集合中;否则 false。 + 指定标头。 + 指定的标头值。 + + + 表示标头值的集合。 + 标头集合类型。 + + + 将某项添加到 中。 + 要添加到标头集合的项。 + + + 中移除所有项。 + + + 确定 是否包含项目。 + 返回 。如果项包含在 实例中,则为 true;否则为 false。 + 要在标头集合中查找的项。 + + + 从目标数组的指定索引处开始将整个 复制到兼容的一维 + 作为从 复制的元素的目标的一维 必须具有从零开始的索引。 + + 中从零开始的索引,从此索引处开始进行复制。 + + + 获取 中标题的数目。 + 返回 。集合中的标头数 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 获取一个值,该值指示 实例是否为只读。 + 返回 。如果 实例为只读,则为 true;否则为 false。 + + + 分析项并将其添加到 + 要添加的项。 + + + 中移除指定的项。 + 返回 。如果已从 实例中成功移除 ,则为 true;否则为 false。 + 要移除的项。 + + + 返回循环访问 的枚举数。 + 返回 实例的枚举数。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定是否能分析输入并将其添加到 + 返回 。如果可以分析 且可以将其添加到 实例,则为 true;否则为 false。 + 要验证的项。 + + + 表示在 RFC 2616 中定义的“请求标题”的集合。 + + + 获取 HTTP 请求的 Accept 标头的值。 + 返回 。请求 HTTP 的 Accept 标题的值。 + + + 获取 HTTP 请求的 Accept-Charset 标头的值。 + 返回 。请求 HTTP 的 Accept-Charset 标题的值。 + + + 获取 HTTP 请求的 Accept-Encoding 标头的值。 + 返回 。请求 HTTP 的 Accept-Encoding 标题的值。 + + + 获取 HTTP 请求的 Accept-Language 标头的值。 + 返回 。请求 HTTP 的 Accept-Language 标题的值。 + + + 获取或设置 HTTP 请求的 Authorization 标头值。 + 返回 。请求 HTTP 的 Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 请求的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取 HTTP 请求的 Expect 标头的值。 + 返回 。请求 HTTP 的 Expect 标题的值。 + + + 获取或设置指示 HTTP 请求的 Expect 标头是否应包含 Continue 的值。 + 返回 。如果 Expect 标头包含继续,则为 true;否则 false。 + + + 获取或设置 HTTP 请求的 From 标头值。 + 返回 。请求 HTTP 的 From 标题的值。 + + + 获取或设置 HTTP 请求的 Host 标头值。 + 返回 。请求 HTTP 的 Host 标题的值。 + + + 获取 HTTP 请求的 If-Match 标头的值。 + 返回 。请求 HTTP 的 If-Match 标题的值。 + + + 获取或设置 HTTP 请求的 If-Modified-Since 标头值。 + 返回 。请求 HTTP 的 If-Modified-Since 标题的值。 + + + 获取 HTTP 请求的 If-None-Match 标头的值。 + 返回 。获取 HTTP 请求的 If-None-Match 标头的值。 + + + 获取或设置 HTTP 请求的 If-Range 标头值。 + 返回 。请求 HTTP 的 If-Range 标题的值。 + + + 获取或设置 HTTP 请求的 If-Unmodified-Since 标头值。 + 返回 。请求 HTTP 的 If-Unmodified-Since 标题的值。 + + + 获取或设置 HTTP 请求的 Max-Forwards 标头值。 + 返回 。请求 HTTP 的 Max-Forwards 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取或设置 HTTP 请求的 Proxy-Authorization 标头值。 + 返回 。请求 HTTP 的 Proxy-Authorization 标题的值。 + + + 获取或设置 HTTP 请求的 Range 标头值。 + 返回 。请求 HTTP 的 Range 标题的值。 + + + 获取或设置 HTTP 请求的 Referer 标头值。 + 返回 。请求 HTTP 的 Referer 标题的值。 + + + 获取 HTTP 请求的 TE 标头的值。 + 返回 。请求 HTTP 的 TE 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 请求的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 User-Agent 标头的值。 + 返回 。请求 HTTP 的 User-Agent 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 表示在 RFC 2616 中定义的“内容标题”的集合。 + + + 获取 HTTP 请求的 Accept-Ranges 标头的值。 + 返回 。请求 HTTP 的 Accept-Ranges 标题的值。 + + + 获取或设置 HTTP 响应的 Age 标头值。 + 返回 。请求 HTTP 的 Age 标题的值。 + + + 获取或设置 HTTP 响应的 Cache-Control 标头值。 + 返回 。请求 HTTP 的 Cache-Control 标题的值。 + + + 获取 HTTP 请求的 Connection 标头的值。 + 返回 。请求 HTTP 的 Connection 标题的值。 + + + 获取或设置指示 HTTP 响应的 Connection 标头是否应包含 Close 的值。 + 返回 。如果 Connection 标头包含关闭,则为 true;否则 false。 + + + 获取或设置 HTTP 响应的 Date 标头值。 + 返回 。请求 HTTP 的 Date 标题的值。 + + + 获取或设置 HTTP 响应的 ETag 标头值。 + 返回 。请求 HTTP 的 ETag 标题的值。 + + + 获取或设置 HTTP 响应的 Location 标头值。 + 返回 。请求 HTTP 的 Location 标题的值。 + + + 获取 HTTP 请求的 Pragma 标头的值。 + 返回 。请求 HTTP 的 Pragma 标题的值。 + + + 获取 HTTP 请求的 Proxy-Authenticate 标头的值。 + 返回 。请求 HTTP 的 Proxy-Authenticate 标题的值。 + + + 获取或设置 HTTP 响应的 Retry-After 标头值。 + 返回 。请求 HTTP 的 Retry-After 标题的值。 + + + 获取 HTTP 请求的 Server 标头的值。 + 返回 。请求 HTTP 的 Server 标题的值。 + + + 获取 HTTP 请求的 Trailer 标头的值。 + 返回 。请求 HTTP 的 Trailer 标题的值。 + + + 获取 HTTP 请求的 Transfer-Encoding 标头的值。 + 返回 。请求 HTTP 的 Transfer-Encoding 标题的值。 + + + 获取或设置指示 HTTP 响应的 Transfer-Encoding 标头是否应包含 chunked 的值。 + 返回 。如果 Transfer-Encoding 标头包含分块,则为 true;否则 false。 + + + 获取 HTTP 请求的 Upgrade 标头的值。 + 返回 。请求 HTTP 的 Upgrade 标题的值。 + + + 获取 HTTP 请求的 Vary 标头的值。 + 返回 。请求 HTTP 的 Vary 标题的值。 + + + 获取 HTTP 请求的 Via 标头的值。 + 返回 。请求 HTTP 的 Via 标题的值。 + + + 获取 HTTP 请求的 Warning 标头的值。 + 返回 。请求 HTTP 的 Warning 标题的值。 + + + 获取 HTTP 请求的 WWW-Authenticate 标头的值。 + 返回 。请求 HTTP 的 WWW-Authenticate 标题的值。 + + + 表示使用 Content-Type 标头的在 RFC 2616 中定义的媒体类型。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个以用于初始化新实例的字符串的形式表示的源。 + + + 获得或设置字符的设置。 + 返回 。字符集。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取或设置媒体类型标头值。 + 返回 。媒体类型的标头值。 + + + 获取或设置媒体类型标头值参数。 + 返回 。媒体类型的标头值参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示媒体类型标头值信息。 + + 为 null 引用。 + + 是无效的媒体类型标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示在 Content-Type 标头中使用的具有额外质量因素的媒体类型。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 一个 ,它表示要用于初始化新实例的字符串。 + 与标头值关联的质量。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有质量标头值信息的媒体类型的字符串。 + + 为 null 引用。 + + 是带有质量标头值信息的无效媒体类型。 + + + 获取或设置 的质量值。 + 返回 对象的质量值。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示用于各种标头的在 RFC 2616 中定义的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取标题名称。 + 返回 。标头名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示名称值标头值信息。 + + 为 null 引用。 + + 是无效的名称值标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取标题值。 + 返回 。标头值。 + + + 表示用于各种标头的在 RFC 2616 中定义的具有参数的名称/值对。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 标头名称。 + + + 初始化 类的新实例。 + 标头名称。 + 标头值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 对象获取参数。 + 返回 。一个包含参数的集合。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 表示带有参数标头值信息的名称值的字符串。 + + 为 null 引用。 + + 带有参数标头值信息的无效名称值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 User-Agent 标头中的产品标记值。 + + + 初始化 类的新实例。 + 产品名称。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取产品标记的名称。 + 返回 。产品标记的名称。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取产品标记的版本。 + 返回 。产品标记的版本。 + + + 表示可以是 User-Agent 标头中的产品或注释的值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个注释值。 + + + 初始化 类的新实例。 + 产品名称值。 + 产品版本值。 + + + 获取 对象中的注释。 + 返回 。此 的注释值。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示产品信息标头值信息。 + + 为 null 引用。 + + 是无效的产品信息标头值信息。 + + + 获取 对象中的产品。 + 返回 。此 中的产品值。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示可以是日期/时间或实体标记值 If-Range 标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的数据值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 一个实体标记,它以用于初始化新实例的字符串的形式表示。 + + + 对象获取日期。 + 返回 对象中的日期。 + + + 对象获取实体标记。 + 返回 对象的实体标记。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件范围标头值信息。 + + 为 null 引用。 + + 是无效的范围条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Range 标头值。 + + + 初始化 类的新实例。 + + + 使用字节范围初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示范围标头值信息。 + + 为 null 引用。 + + 是无效的范围标头值信息。 + + + 获取 对象中的指定范围。 + 返回 对象中的范围。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取 对象中的单元。 + 返回 对象中的单元。 + + + 表示 Range 标头值中的字节范围。 + + + 初始化 类的新实例。 + 开始发送数据的位置。 + 停止发送数据的位置。 + + 大于。- 或 - 小于 0。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 获取开始发送数据的位置。 + 返回 。开始发送数据的位置。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取停止发送数据的位置。 + 返回 。停止发送数据的位置。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 表示 Retry-After 标头值,它可以是日期/时间或时间跨度值。 + + + 初始化 类的新实例。 + 用于初始化新实例的日期和时间偏移量。 + + + 初始化 类的新实例。 + 用于初始化新实例的增量(以秒为单位)。 + + + 获取相对于 对象的日期和时间偏移量。 + 返回 。当前 对象中的日期和时间偏移量。 + + + 对象获取增量(以秒为单位)。 + 返回 对象中的增量(以秒为单位)。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 字符串表示条件重试标头值信息。 + + 为 null 引用。 + + 是无效的重试条件标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示具有可选外质量的字符串标题值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 用于初始化新实例的质量因素。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示质量标头值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效字符串。 + + + 对象获取质量因子。 + 返回 对象中的质量因子。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 对象获取字符串值。 + 返回 对象中的字符串值。 + + + 表示接受编码标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的 对象。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 确定指定的对象是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 获取调用代码的参数。 + 返回 。转让代码的参数。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码标头值信息。 + + 为 null 引用。 + + 无效的传输编码标头值信息。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 获取调用代码的值。 + 返回 。转换代码的值。 + + + 表示具有可选额外质量因素的 Accept-Encoding 标头值。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + + + 初始化 类的新实例。 + 用于初始化新实例的字符串。 + 质量因素的一个值。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示传输编码值信息。 + + 为 null 引用。 + + 是带有质量标头值信息的无效传输代码。 + + + 获取质量因子。 + 返回 中的质量因子。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示 Via 标头的值。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + + + 初始化 类的新实例。 + 接受协议的协议版本。 + 通过其接收请求或响应的主机和端口。 + 接受协议的协议名称。 + 用于标识收件人代理或网关的软件的注释字段。 + + + 获取用于确定收件人代理或网关的软件的注释字段。 + 返回 。用于标识收件人代理或网关的软件的注释字段。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。返回当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 。一个 实例。 + 一个字符串,表示 Via 标头值信息。 + + 为 null 引用。 + + 是无效的 Via 标头值信息。 + + + 获取接受协议的协议名称。 + 返回 。协议名称。 + + + 获取接受协议的协议版本。 + 返回 。协议版本。 + + + 获取通过其进行请求或接收响应的主机和端口。 + 返回 。通过其接收请求或响应的主机和端口。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + 表示警告标题使用的警告值。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + + + 初始化 类的新实例。 + 特定警告代码。 + 附加警告的主机。 + 包含该警告文本的引用字符串。 + 文件操作的日期/警告签章。 + + + 获取附加警告的主机。 + 返回 。附加警告的主机。 + + + 获取特定警告代码。 + 返回 。特定警告代码。 + + + 获取警告的日期/时间戳。 + 返回 。文件操作的日期/警告签章。 + + + 确定指定的 是否等于当前的 对象。 + 返回 。如果指定的 等于当前的对象,则为 true;否则为 false。 + 要与当前对象进行比较的对象。 + + + 作为 对象的哈希函数。 + 返回 。当前对象的哈希代码。 + + + 将字符串转换为 实例。 + 返回 实例。 + 一个字符串,表示认证标头值信息。 + + 为 null 引用。 + + 是无效的身份验证标头值信息。 + + + 获取包含该警告文本的引用字符串。 + 返回 。包含该警告文本的引用字符串。 + + + 返回表示当前 对象的字符串。 + 返回 。表示当前对象的字符串。 + + + 确定字符串是否是有效的 信息。 + 返回 。如果 为有效 信息,则为 true;否则为 false。 + 要验证的字符串。 + 字符串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hant/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hant/a new file mode 100644 index 00000000000..fd129a695c2 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.1/zh-hant/a @@ -0,0 +1,2368 @@ + + + + System.Net.Http + + + + 根據位元組陣列提供 HTTP 內容。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數為 null。 + + + 初始化 類別的新執行個體。 + 用來初始化 的內容。 + + 參數中用來初始化 的位移 (以位元組為單位)。 + + 中的位元組數目(從用來初始化參數開始)。 + + 參數為 null。 + + 參數小於零。-或- 參數大於 參數指定的內容長度。-或- 參數小於零。-或- 參數大於 參數指定的內容長度,減去 參數。 + + + 建立 HTTP 內容資料流做為非同步讀取作業,其支援存放區是在 中的記憶體 + 傳回 。工作物件,表示非同步作業。 + + + 進行序列化,並以非同步方式將建構函式中提供的位元組陣列寫入到 HTTP 內容資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊,如通道繫結語彙基元。這個參數可以是 null。 + + + 判斷位元組陣列的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 位元組陣列的長度,以位元組為單位。 + + + 指定如何提供用戶端憑證。 + + + + 會嘗試自動提供所有可用的用戶端憑證。 + + + 應用程式會以手動方式提供用戶端憑證給 。這個值為預設值。 + + + HTTP 處理常式的類型,這些處理常式會將 HTTP 回應訊息的處理委派給另一個處理常式,也稱為內部處理常式。 + + + 建立 類別的新執行個體。 + + + 使用特定的內部處理常式,建立 類別的新執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理 HTTP 回應訊息的內部處理常式。 + 傳回 。HTTP 回應訊息的內部處理常式。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 使用 application/x-www-form-urlencoded MIME 類型編碼之名稱/值 Tuple 的容器。 + + + 使用特定名稱/值組集合,初始化 類別的新執行個體。 + 名稱/值組的集合。 + + + 提供基底類別,用來傳送 HTTP 要求,以及從 URI 所識別的資源接收 HTTP 回應。 + + + 初始化 類別的新執行個體。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 要用來傳送要求的 HTTP 處理常式堆疊。 + + + 使用特定處理常式,初始化 類別的新執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 取得或設定傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + 傳回 。傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。 + + + 取消這個執行個體上的所有暫止要求。 + + + 取得應該在每個要求中傳送的標頭。 + 傳回 。應該藉由每個要求傳送的標頭。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,將 DELETE 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 DELETE 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true 表示會同時釋放 Managed 和 Unmanaged 資源;false 則表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 GET 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和 HTTP 完成選項以及取消語彙基元至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + HTTP 完成選項值,表示作業應該被視為已完成。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 GET 要求和取消權杖至指定的 Uri。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以位元組陣列形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以資料流形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 將 GET 要求傳送至指定的 URI,並透過非同步作業,以字串形式傳回回應內容。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + + 為 null。 + + + 取得或設定讀取回應內容時要緩衝處理的位元組數目上限。 + 傳回 。讀取回應內容時要緩衝處理的位元組數目上限。此屬性的預設值是 2 GB。 + 指定的大小小於或等於零。 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 POST 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 POST 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,將 PUT 要求傳送至指定的 URI。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + + 為 null。 + + + 以非同步作業的方式,傳送 PUT 要求和取消語彙基元。 + 傳回 。工作物件,表示非同步作業。 + 傳送要求的目標 URI。 + 傳送至伺服器的 HTTP 要求內容。 + 取消語彙基元,可由其他物件或執行緒用來接收取消通知。 + + 為 null。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 當作業應該完成時 (可取得回應時或讀取整個回應內容之後)。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + 要求訊息已由執行個體傳送。 + + + 取得或設定要求逾時前等候的時間長度。 + 傳回 。要求逾時前等候的時間長度。 + 指定的逾時小於或等於零,並且不是 + 作業已經在目前的執行個體上啟動。 + 已經處置目前的執行個體。 + + + + 所使用的預設訊息處理常式。 + + + 建立 類別的執行個體。 + + + 取得或設定值,指出處理常式是否應該緊接在重新導向回應之後。 + 傳回 。如果處理常式應該接在重新導向回應之後,則為 true,否則為 false。預設值是 true。 + + + 取得或設定處理常式用來自動解壓縮 HTTP 內容回應的解壓縮方法型別。 + 傳回 。處理常式所使用的自動解壓縮方法。預設值是 + + + 取得或設定與這個處理常式相關聯的安全憑證集合。 + 傳回 。與這個處理常式相關聯的安全憑證的集合。 + + + 取得或設定處理常式用來儲存伺服器 cookie 的 cookie 容器。 + 傳回 。處理常式用來儲存伺服器 cookie 的 cookie 容器。 + + + 取得或設定這個處理常式所使用的驗證資訊。 + 傳回 。與處理常式相關聯的驗證認證。預設值為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得或設定處理常式追蹤的最大重新導向數目。 + 傳回 。處理常式追蹤的最大重新導向回應數目。預設值為 50。 + + + 取得或設定處理常式所使用的要求內容緩衝區大小上限。 + 傳回 。要求內容緩衝區的大小上限,以位元組為單位。預設值為 2 GB。 + + + 取得或設定值,指出處理常式是否隨要求傳送授權標頭。 + 傳回 。true 表示在進行驗證後,處理常式隨同要求傳送 HTTP 驗證標頭,否則為 false。預設值為 false。 + + + 取得或設定處理常式使用的 Proxy 資訊。 + 傳回 。處理常式所使用的 proxy 資訊。預設值是 null。 + + + 根據 中提供的資訊,建立 的執行個體成為不會封鎖的作業。 + 傳回 。工作物件,表示非同步作業。 + HTTP 要求訊息。 + 要取消作業的取消語彙基元。 + + 為 null。 + + + 取得值,指出處理常式是否支援自動回應內容解壓縮。 + 傳回 。如果處理常式支援自動回應內容解壓縮,則為 true,否則為 false。預設值是 true。 + + + 取得值,指出處理常式是否支援 Proxy 設定。 + 傳回 。如果處理常式支援 Proxy 設定,則為 true,否則為 false。預設值是 true。 + + + 取得值,這個值指出處理常式是否支援 屬性的組態設定。 + 傳回 。如果處理常式支援 屬性的組態設定,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,指出處理常式是否使用 屬性,以儲存伺服器 cookie,並在傳送要求時使用這些 cookie。 + 傳回 。如果處理常式支援使用 屬性儲存伺服器 cookie,並在傳送要求時使用這些 cookie,則為 true,否則為 false。預設值是 true。 + + + 取得或設定值,該值會控制是否隨著處理常式的要求傳送預設認證。 + 傳回 。如果使用預設認證則為 true,否則為 false。預設值是 false。 + + + 取得或設定值,指出處理常式是否對要求使用 Proxy。 + 傳回 。如果處理常式應該使用 proxy 來處理要求,則為 true,否則為 false。預設值是 true。 + + + 表示 作業應該在取得回應之後立即視為已完成,或在讀取整個回應訊息 (包括內容) 之後視為已完成。 + + + 在讀取包括內容的完整回應之後,操作應該完成。 + + + 一旦回應可使用而標頭也已讀取後,就應完成作業。尚未讀取內容。 + + + 基底類別,表示 HTTP 實體內容與內容標題。 + + + 初始化 類別的新執行個體。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + + + 將 HTTP 內容序列化成位元組資料流,然後複製到 參數所提供的資料流物件。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 內容標頭,如 RFC 2616 中所定義。 + 傳回 。RFC 2616 中所定義的標頭。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。 + 傳回 。工作物件,表示非同步作業。 + 要使用的緩衝區的大小上限,以位元組為單位。 + + + 以非同步作業的方式將 HTTP 內容寫入至位元組陣列。 + 傳回 。工作物件,表示非同步作業。 + + + 將 HTTP 內容序列化,並以非同步作業的方式傳回表示內容的資料流。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至字串。 + 傳回 。工作物件,表示非同步作業。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷 HTTP 內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HTTP 內容的長度,以位元組為單位。 + + + HTTP 訊息處理常式的基底型別。 + + + 初始化 類別的新執行個體。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 特定類別,允許應用程式呼叫 HTTP 處理常式鏈結的 方法。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + + + 使用特定 ,初始化 類別的執行個體。 + 負責處理 HTTP 回應訊息的 。 + 如果內部處理常式應由 Dispose() 處置則為 true,如果您想要重複使用內部處理常式則為 false。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業的方式,傳送 HTTP 要求。 + 傳回 。工作物件,表示非同步作業。 + 要傳送的 HTTP 要求訊息。 + 用於取消作業的取消語彙基元。 + + 為 null。 + + + 協助程式類別,用於擷取和比較標準 HTTP 方法,以及建立新的 HTTP 方法。 + + + 使用特定 HTTP 方法,初始化 類別的新執行個體。 + HTTP 方法。 + + + 表示 HTTP DELETE 通訊協定方法。 + 傳回 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前專案比較的 HTTP 方法。 + + + 判斷指定的 和目前的 是否相等。 + 傳回 。如果指定的物件等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 表示 HTTP GET 通訊協定方法。 + 傳回 + + + 做為此型別的雜湊函式。 + 傳回 。目前 的雜湊程式碼。 + + + 表示 HTTP HEAD 通訊協定方法。HEAD 方法與 GET 相同,除了伺服器只在回應中傳回訊息標頭,不含訊息主體。 + 傳回 + + + HTTP 方法。 + 傳回 。以 形式表示的 HTTP 方法。 + + + 等號比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數相等,則為 true,否則為 false。 + 等號比較運算子左邊的 。 + 等號比較運算子右邊的 。 + + + 不等比較運算子,用來比較兩個 物件。 + 傳回 。如果指定的 參數不相等,則為 true,否則為 false。 + 不等比較運算子左邊的 。 + 不等比較運算子右邊的 。 + + + 表示 HTTP OPTIONS 通訊協定方法。 + 傳回 + + + 表示 HTTP POST 通訊協定方法,用來公佈新實體至 URI 做為新增項目。 + 傳回 + + + 表示 HTTP PUT 通訊協定方法,用來取代 URI 所識別的實體。 + 傳回 + + + 傳回表示目前物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 HTTP TRACE 通訊協定方法。 + 傳回 + + + + 類別所擲回之例外狀況的基底類別。 + + + 初始化 類別的新執行個體。 + + + 使用描述目前例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + + + 使用描述目前例外狀況和內部例外狀況的特定訊息,初始化 類別的新執行個體。 + 描述目前例外狀況的訊息。 + 內部例外狀況。 + + + 表示 HTTP 要求訊息。 + + + 初始化 類別的新執行個體。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 字串,表示要求 。 + + + 使用 HTTP 方法和要求 ,初始化 類別的新執行個體。 + HTTP 方法。 + 要求的 。 + + + 取得或設定 HTTP 訊息的內容。 + 傳回 。訊息內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Managed 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 取得 HTTP 要求標頭的集合。 + 傳回 。HTTP 要求標頭的集合。 + + + 取得或設定 HTTP 要求訊息所使用的 HTTP 方法。 + 傳回 。要求訊息所使用的 HTTP 方法。預設為 GET 方法。 + + + 取得 HTTP 要求的屬性集。 + 傳回 + + + 取得或設定用於 HTTP 要求的 + 傳回 。用於 HTTP 要求的 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 表示包含狀態碼及資料的 HTTP 回應訊息。 + + + 初始化 類別的新執行個體。 + + + 使用特定 ,初始化 類別的新執行個體。 + HTTP 回應的狀態碼。 + + + 取得或設定 HTTP 回應訊息的內容。 + 傳回 。HTTP 回應訊息的內容。 + + + 釋放 Unmanaged 資源,並處置 所使用的 Unmanaged 資源。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 如果 HTTP 回應的 屬性為 false,會擲回例外狀況。 + 傳回 。HTTP 回應訊息(如果該呼叫成功)。 + + + 取得 HTTP 回應標頭的集合。 + 傳回 。HTTP 回應標頭的集合。 + + + 取得值,指出 HTTP 回應是否成功。 + 傳回 。表示 HTTP 回應是否成功的值。如果 在範圍 200-299 中,則為 true,否則為 false。 + + + 取得或設定原因片語,通常由伺服器將它與狀態碼一起傳送。 + 傳回 。伺服器所傳送之原因詞彙。 + + + 取得或設定造成此回應訊息的要求訊息。 + 傳回 。造成此回應訊息的要求訊息。 + + + 取得或設定 HTTP 回應的狀態碼。 + 傳回 。HTTP 回應的狀態碼。 + + + 傳回表示目前物件的字串。 + 傳回 。目前物件的字串表示。 + + + 取得或設定 HTTP 訊息版本。 + 傳回 。HTTP 訊息版本。預設值為 1.1。 + + + 處理常式的基底型別,這些處理常式僅對要求和 (或) 回應訊息執行一些小型處理。 + + + 建立 類別的執行個體。 + + + 使用特定的內部處理常式,建立 類別的執行個體。 + 負責處理 HTTP 回應訊息的內部處理常式。 + + + 執行對傳送至伺服器之每個要求的處理。 + 傳回 。處理的 HTTP 要求訊息。 + 要處理的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 執行對伺服器每個回應的處理。 + 傳回 。已處理的 HTTP 回應訊息。 + 要處理的 HTTP 回應訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + + 將 HTTP 要求傳送到內部處理常式,以非同步作業方式傳送到伺服器。 + 傳回 。工作物件,表示非同步作業。 + 要傳送到伺服器的 HTTP 要求訊息。 + 取消語彙基元,可由其他物件或執行緒使用以接收的取消通知。 + + 為 null。 + + + 提供使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + + 為 null 或僅包含空白字元。 + + + 建立 類別的新執行個體。 + 多部分內容的子型別。 + 多重內容的界限字串。 + + 為 null,或是空字串。 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將多重部分 HTTP 內容加入至使用 multipart/* 內容類型規格進行序列化之 物件的集合。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 傳回列舉程式,此列舉程式可以逐一查看 物件的集合,該集合會使用多重/* 內容型別規格進行序烈化。 + 傳回 。用於逐一查看集合的物件。 + + + 以非同步作業方式將多個 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + + 方法的明確實作。 + 傳回 。用於逐一查看集合的物件。 + + + 判斷 HTTP 多部分內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + HHTP 內容的長度,以位元組為單位。 + + + 提供使用多重/表單資料 MIME 類型編碼內容的容器。 + + + 建立 類別的新執行個體。 + + + 建立 類別的新執行個體。 + 多重表單資料內容的界限字串。 + + 為 null 或僅包含空白字元。-或- 以空白字元結束。 + + 的長度大於 70。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + + 為 null 或僅包含空白字元。 + + 為 null。 + + + 將 HTTP 內容加入至 物件的集合,會序列化為 multipart/form-data MIME 類型。 + 要新增至集合中的 HTTP 內容。 + 要為 HTTP 內容加入的名稱。 + 要加入至集合中的 HTTP 內容的檔案名稱。 + + 為 null 或僅包含空白字元。-或- 為 null 或僅包含空白字元。 + + 為 null。 + + + 根據資料流提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + 的緩衝區大小,以位元組為單位。 + + 為 null。 + + 小於或等於零值。 + + + 將 HTTP 資料流內容寫入至記憶體資料流,做為非同步作業。 + 傳回 。工作物件,表示非同步作業。 + + + 釋放 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。 + true,表示釋放 Managed 和 Unmanaged 資源;false,表示只釋放 Unmanaged 資源。 + + + 以非同步作業方式將 HTTP 內容序列化至資料流。 + 傳回 。工作物件,表示非同步作業。 + 目標資料流。 + 傳輸的相關資訊 (例如通道繫結語彙基元)。這個參數可以是 null。 + + + 判斷資料流內容的長度 (以位元組為單位) 是否有效。 + 傳回 。如果 是有效長度則為 true,否則為 false。 + 資料流內容的長度,以位元組為單位。 + + + 根據字串提供 HTTP 內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + + + 建立 類別的新執行個體。 + 用來初始化 的內容。 + 要用於內容的編碼方式。 + 要用於內容的媒體類型。 + + + 表示 Authorization、ProxyAuthorization、WWW-Authenticate 和 Proxy 驗證標頭值中的驗證資訊。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + + + 初始化 類別的新執行個體。 + 用於授權的配置。 + 認證,包含所要求資源的使用者代理程式驗證資訊。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得認證,包含所要求資源的使用者代理程式驗證資訊。 + 傳回 。包含驗證資訊的認證。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得用於授權的配置。 + 傳回 。用於授權的配置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Cache-Control標頭的值。 + + + 初始化 類別的新執行個體。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 快取擴充權杖,其中每個權杖都有選擇性指派的值。 + 傳回 。快取擴充語彙基元的集合,其中每個語彙基元都有選擇性指派的值。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + HTTP 用戶端願意接受回應的最長保留期限(以秒為單位來指定)。 + 傳回 。秒數。 + + + 否 HTTP 用戶端願意接受已經超過其到期時間的回應。 + 傳回 。如果 HTTP 用戶端願意接受已經超過到期時間的回應,則為 true,否則為 false。 + + + HTTP 用戶端願意接受已經超過其到期時間的回應的最長時間(以秒為單位)。 + 傳回 。秒數。 + + + HTTP 用戶端願意接受回應的有效期限存留期(以秒為單位)。 + 傳回 。秒數。 + + + 當快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 用戶端願意接受快取的回應。 + 傳回 。如果 HTTP 用戶端願意接受快取的回應,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "no-cache" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 是否快取絕不可以儲存 HTTP 要求訊息或任何回應的任何組成部分。 + 傳回 。如果快取中不能儲存 HTTP 要求訊息或任何回應的任何組成部分,則為 true,否則為false。 + + + 是否快取或 Proxy 絕不可以變更實體主體的任何層面。 + 傳回 。如果快取或 Proxy 絕不可以變更實體主體的任何層面,則為 true,否則為false。 + + + 是否快取應該使用符合 HTTP 要求的其他約束條件的快取項目來回應,或是以 504 (閘道逾時) 狀態來回應。 + 傳回 。如果快取必須使用符合 HTTP 要求的其他條件約束之已快取項目來做回應,或使用 504 (Gateway Timeout) 狀態做回應,則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示快取控制項標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的快取控制標頭值資訊。 + + + 是否整個或部分的 HTTP 回應訊息僅供單一使用者使用,或絕不可由共用快取來快取。 + 傳回 。如果 HTTP 回應訊息僅供單一使用者使用,而且不可由共用快取來快取,則為 true,否則為 false。 + + + 在 HTTP 回應上,Cache-Control 標頭欄位之 "private" 指示詞中的 fieldnames 集合。 + 傳回 。欄位名稱的集合。 + + + 當共用使用者代理快取的快取項目變成過時,在接續的使用中,原始伺服器是否需要重新驗證快取項目。 + 傳回 。如果當共用使用者代理快取的快取項目變成過時,在後續的使用中,原始伺服器需要重新驗證快取項目,則為 true,否則為 false。 + + + 是否 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取。 + 傳回 。如果 HTTP 回應可以由任何快取來快取,即使它通常不可快取,或只可以在非共用的快取中快取,則為 true,否則為 false。 + + + HTTP 回應中的共用最長使用期限(以秒為單位),會覆蓋快取控制標頭或共用快取的到期日標頭中的 "max-age" 指示詞。 + 傳回 。秒數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Disposition 標頭的值。 + + + 初始化 類別的新執行個體。 + + 。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 建立檔案的日期。 + 傳回 。檔案建立日期。 + + + 內容內文部分的配置類型。 + 傳回 。配置類型。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。建議的檔案名稱。 + + + 對於如何建構要在實體已中斷連結且儲存於不同檔案時用來儲存訊息承載之檔案名稱的建議。 + 傳回 。表單檔案名稱的建議檔案名稱*。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 上次修改檔案的日期。 + 傳回 。檔案修改日期。 + + + 內容主體組件的名稱。 + 傳回 。內容主體組件的名稱。 + + + 一組包含 Content-Disposition 標頭的參數。 + 傳回 。參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容配置標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容配置標頭值資訊。 + + + 上次讀取檔案的日期。 + 傳回 。上次讀取日期。 + + + 檔案的約略大小大小,以位元組為單位。 + 傳回 。約略大小,以位元組為單位。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Content-Range 標頭的值。 + + + 初始化 類別的新執行個體。 + 範圍的起始和結束點 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置 (以位元組表示)。 + 要停止傳送資料的位置 (以位元組表示)。 + 範圍的起始和結束點 (以位元組表示)。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置 (以位元組表示)。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得 Content-Range 標頭是否有指定的長度。 + 傳回 。如果 Content-Range 有指定長度則為 true,否則為 false。 + + + 取得 Content-Range 是否有指定的範圍。 + 傳回 。如果 Content-Range 有指定範圍則為 true,否則為 false。 + + + 取得完整實體內容的長度。 + 傳回 。完整實體內容的長度。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示內容範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的內容範圍標頭值資訊。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 使用的範圍單位。 + 傳回 。包含範圍單位的 + + + 表示實體標記標頭值。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + + + 初始化 類別的新執行個體。 + 包含 的字串。 + 表示這個實體標記標頭是否為弱式驗證程式的值。如果實體標記標頭是弱式驗證程式,則應該將 設定為 true。如果實體標記標頭是強式驗證程式,則應該將 設定為 false。 + + + 取得實體標記標頭值。 + 傳回 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得實體標記的前端是否有弱點指標。 + 傳回 。如果實體標記有弱式指標做為開頭則為 true,否則為 false。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示實體標記標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的實體標記標頭值資訊。 + + + 取得不透明的引號括住的字串。 + 傳回 。不透明的引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示內容標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Allow 內容標頭的值。 + 傳回 。HTTP 回應的 Allow 標頭的值。 + + + 取得 HTTP 回應的 Content-Disposition 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Disposition 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Encoding 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Encoding 內容標頭的值。 + + + 取得 HTTP 回應的 Content-Language 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Language 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Length 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Length 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Location 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Location 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-MD5 內容標頭的值。 + 傳回 。HTTP 回應的 Content-MD5 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Range 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Range 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Content-Type 內容標頭的值。 + 傳回 。HTTP 回應的 Content-Type 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Expires 內容標頭的值。 + 傳回 。HTTP 回應的 Expires 內容標頭的值。 + + + 取得或設定 HTTP 回應之 Last-Modified 內容標頭的值。 + 傳回 。HTTP 回應的 Last-Modified 內容標頭的值。 + + + 標頭及其值的集合,如 RFC 2616 中所定義的。 + + + 初始化 類別的新執行個體。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 要加入至集合的標頭值清單。 + + + 將指定的標頭及其值加入至 集合中。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 移除 集合中的所有標頭。 + + + 傳回 集合中是否有特定標頭。 + 傳回 。true 為指定的標頭存在於集合中,否則為 false。 + 特定的標頭。 + + + 傳回可以逐一查看 執行個體的列舉值。 + 傳回 的列舉值。 + + + 傳回儲存在 集合中的指定標頭的所有標頭值。 + 傳回 。標頭字串的陣列。 + 要為其傳回值的指定標頭。 + + + 集合中移除指定的標頭。 + 傳回 + 要從集合中移除的標頭名稱。 + + + 傳回可以逐一查看 的列舉程式。 + 傳回 。可以逐一查看 實作執行個體。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的值。 + + + 傳回值,這個值表示指定的標頭及其值是否已在沒有驗證所提供之資訊的情況下加入至 集合。 + 傳回 。如果指定的標頭 可加入至集合中,則為 true,否則為 false。 + 要加入至集合的標頭。 + 標頭的內容。 + + + 傳回指定的標頭和指定的值是否儲存在集合中。 + 傳回 。如果指定的標頭 和 values 儲存在集合中,則為 true,否則為 false。 + 指定的標頭。 + 指定的標頭值。 + + + 表示標頭值的集合。 + 標頭集合類型。 + + + 將項目加入至 + 要加入至標頭集合中的項目。 + + + 移除 的所有項目。 + + + 判斷 是否包含項目。 + 傳回 。如果 執行個體中包含項目,則為 true,否則為 false。 + 要在標頭集合中尋找的項目。 + + + 從目標陣列的指定索引開始,複製整個 至相容的一維 + 一維 ,是從 複製過來之項目的目的端。 必須有以零起始的索引。 + + 中以零起始的索引,是複製開始的位置。 + + + 取得 中的標頭數目。 + 傳回 。集合中的標頭數。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 取得值,該值指出 執行個體是否唯讀。 + 傳回 。如果 執行個體是唯讀,則為 true,否則為 false。 + + + 剖析項目並將其加入至 + 要加入的項目。 + + + 中移除指定項目。 + 傳回 。如果 已成功從 執行個體中移除,則為 true,否則為 false。 + 要移除的項目。 + + + 傳回在 中逐一查看的列舉值。 + 傳回 執行個體的列舉程式。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷輸入是否可加以剖析並加入至 + 傳回 。如果可以剖析 並將其加入至 執行個體則為 true,否則為 false + 要驗證的項目。 + + + 表示要求標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 要求的 Accept 標頭值。 + 傳回 。HTTP 要求的 Accept 標頭的值。 + + + 取得 HTTP 要求的 Accept-Charset 標頭值。 + 傳回 。HTTP 要求的 Accept-Charset 標頭的值。 + + + 取得 HTTP 要求的 Accept-Encoding 標頭值。 + 傳回 。HTTP 要求的 Accept-Encoding 標頭的值。 + + + 取得 HTTP 要求的 Accept-Language 標頭值。 + 傳回 。HTTP 要求的 Accept-Language 標頭的值。 + + + 取得或設定 HTTP 要求之 Authorization 標頭的值。 + 傳回 。HTTP 要求的 Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Cache-Control 標頭的值。 + 傳回 。HTTP 要求的 Cache-Control 標頭的值。 + + + 取得 HTTP 要求的 Connection 標頭值。 + 傳回 。HTTP 要求的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 Date 標頭的值。 + 傳回 。HTTP 要求的 Date 標頭的值。 + + + 取得 HTTP 要求的 Expect 標頭值。 + 傳回 。HTTP 要求的 Expect 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Expect 標頭是否包含 Continue。 + 傳回 。如果 Expect 標頭包含 Continue 則為 true,否則為 false。 + + + 取得或設定 HTTP 要求之 From 標頭的值。 + 傳回 。HTTP 要求的 From 標頭的值。 + + + 取得或設定 HTTP 要求之 Host 標頭的值。 + 傳回 。HTTP 要求的 Host 標頭的值。 + + + 取得 HTTP 要求的 If-Match 標頭值。 + 傳回 。HTTP 要求的 If-Match 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Modified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Modified-Since 標頭的值。 + + + 取得 HTTP 要求的 If-None-Match 標頭值。 + 傳回 。取得 HTTP 要求的 If-None-Match 標頭值。 + + + 取得或設定 HTTP 要求之 If-Range 標頭的值。 + 傳回 。HTTP 要求的 If-Range 標頭的值。 + + + 取得或設定 HTTP 要求之 If-Unmodified-Since 標頭的值。 + 傳回 。HTTP 要求的 If-Unmodified-Since 標頭的值。 + + + 取得或設定 HTTP 要求之 Max-Forwards 標頭的值。 + 傳回 。HTTP 要求的 Max-Forwards 標頭的值。 + + + 取得 HTTP 要求的 Pragma 標頭值。 + 傳回 。HTTP 要求的 Pragma 標頭的值。 + + + 取得或設定 HTTP 要求之 Proxy-Authorization 標頭的值。 + 傳回 。HTTP 要求的 Proxy-Authorization 標頭的值。 + + + 取得或設定 HTTP 要求之 Range 標頭的值。 + 傳回 。HTTP 要求的 Range 標頭的值。 + + + 取得或設定 HTTP 要求之 Referer 標頭的值。 + 傳回 。HTTP 要求的 Referer 標頭的值。 + + + 取得 HTTP 要求的 TE 標頭值。 + 傳回 。HTTP 要求的 TE 標頭的值。 + + + 取得 HTTP 要求的 Trailer 標頭值。 + 傳回 。HTTP 要求的 Trailer 標頭的值。 + + + 取得 HTTP 要求的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 要求的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 要求的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 要求的 Upgrade 標頭值。 + 傳回 。HTTP 要求的 Upgrade 標頭的值。 + + + 取得 HTTP 要求的 User-Agent 標頭值。 + 傳回 。HTTP 要求的 User-Agent 標頭的值。 + + + 取得 HTTP 要求的 Via 標頭值。 + 傳回 。HTTP 要求的 Via 標頭的值。 + + + 取得 HTTP 要求的 Warning 標頭值。 + 傳回 。HTTP 要求的 Warning 標頭的值。 + + + 表示回應標頭集合,如 RFC 2616 中的定義。 + + + 取得 HTTP 回應的 Accept-Ranges 標頭值。 + 傳回 。HTTP 回應的 Accept-Ranges 標頭的值。 + + + 取得或設定 HTTP 回應之 Age 標頭的值。 + 傳回 。HTTP 回應的 Age 標頭的值。 + + + 取得或設定 HTTP 回應之 Cache-Control 標頭的值。 + 傳回 。HTTP 回應的 Cache-Control 標頭的值。 + + + 取得 HTTP 回應的 Connection 標頭值。 + 傳回 。HTTP 回應的 Connection 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Connection 標頭是否包含 Close。 + 傳回 。如果 Connection 標頭包含 Close 則為 true,否則為 false。 + + + 取得或設定 HTTP 回應之 Date 標頭的值。 + 傳回 。HTTP 回應的 Date 標頭的值。 + + + 取得或設定 HTTP 回應之 ETag 標頭的值。 + 傳回 。HTTP 回應的 ETag 標頭的值。 + + + 取得或設定 HTTP 回應之 Location 標頭的值。 + 傳回 。HTTP 回應的 Location 標頭的值。 + + + 取得 HTTP 回應的 Pragma 標頭值。 + 傳回 。HTTP 回應的 Pragma 標頭的值。 + + + 取得 HTTP 回應的 Proxy-Authenticate 標頭值。 + 傳回 。HTTP 回應的 Proxy-Authenticate 標頭的值。 + + + 取得或設定 HTTP 回應之 Retry-After 標頭的值。 + 傳回 。HTTP 回應的 Retry-After 標頭的值。 + + + 取得 HTTP 回應的 Server 標頭值。 + 傳回 。HTTP 回應的 Server 標頭的值。 + + + 取得 HTTP 回應的 Trailer 標頭值。 + 傳回 。HTTP 回應的 Trailer 標頭的值。 + + + 取得 HTTP 回應的 Transfer-Encoding 標頭值。 + 傳回 。HTTP 回應的 Transfer-Encoding 標頭的值。 + + + 取得或設定值,指出 HTTP 回應的 Transfer-Encoding 標頭是否包含 chunked。 + 傳回 。如果 Transfer-Encoding 標頭包含 chunked 則為 true,否則為 false。 + + + 取得 HTTP 回應的 Upgrade 標頭值。 + 傳回 。HTTP 回應的 Upgrade 標頭的值。 + + + 取得 HTTP 回應的 Vary 標頭值。 + 傳回 。HTTP 回應的 Vary 標頭的值。 + + + 取得 HTTP 回應的 Via 標頭值。 + 傳回 。HTTP 回應的 Via 標頭的值。 + + + 取得 HTTP 回應的 Warning 標頭值。 + 傳回 。HTTP 回應的 Warning 標頭的值。 + + + 取得 HTTP 回應的 WWW-Authenticate 標頭值。 + 傳回 。HTTP 回應的 WWW-Authenticate 標頭的值。 + + + 表示用於依 RFC 2616 所定義之內容類型標頭的媒體類型。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 表示為字串以初始化新執行個體的來源。 + + + 取得或設定字元集。 + 傳回 。字元集。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得或設定媒體型別標頭值。 + 傳回 。媒體類型標頭值。 + + + 取得或設定媒體類型標頭值參數。 + 傳回 。媒體類型標頭值參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的媒體類型標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示具有用於內容類型標頭之其他品質係數的媒體類型。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + + + 初始化 類別的新執行個體。 + + ,表示為字串以初始化新執行個體。 + 與這個標頭值相關聯的品質。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示媒體類型的字串,含有品質標頭值資訊。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效媒體類型。 + + + 取得或設定 的品質值。 + 傳回 物件的品質值。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得標頭名稱。 + 傳回 。標頭名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的名稱值標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得標頭值。 + 傳回 。標頭值。 + + + 表示搭配參數用於各種依 RFC 2616 所定義之標頭的名稱/值組。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + + + 初始化 類別的新執行個體。 + 標頭名稱。 + 標頭值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 物件取得參數。 + 傳回 。包含參數的集合。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示名稱值的字串,含有參數標頭值資訊。 + + 為 null 參考。 + + 不是具有參數標頭值資訊的有效名稱值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示使用者代理程式標頭中的產品語彙基元值。 + + + 初始化 類別的新執行個體。 + 產品名稱。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得產品語彙基元的名稱。 + 傳回 。產品語彙基元的名稱。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品標頭值資訊的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得產品語彙基元的版本。 + 傳回 。產品語彙基元的版本。 + + + 代表一個值,它可以是 User-Agent 標頭中的一項產品或註解。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 註解值。 + + + 初始化 類別的新執行個體。 + 產品名稱值。 + 產品版本值。 + + + 物件取得註解。 + 傳回 。這個 的註解值。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示產品資訊標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的產品資訊標頭值資訊。 + + + 物件取得產品。 + 傳回 。這個 中的產品值。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 If-Range 標頭值,它可以是日期/時間或是實體標記值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 實體標記,表示為用來初始化新執行個體的字串。 + + + 物件取得日期。 + 傳回 物件中的日期。 + + + 物件取得實體標記。 + 傳回 物件中的實體標記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Range 標頭值。 + + + 初始化 類別的新執行個體。 + + + 使用位元組範圍初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示範圍標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的範圍標頭值資訊。 + + + 物件中取得指定的範圍。 + 傳回 物件提供的範圍。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得單位。 + 傳回 物件中的單位。 + + + 表示 Range 標頭值中的位元組範圍。 + + + 初始化 類別的新執行個體。 + 要開始傳送資料的位置。 + 要停止傳送資料的位置。 + + 大於 -或- 小於 0 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 取得要開始傳送資料的位置。 + 傳回 。要開始傳送資料的位置。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得要停止傳送資料的位置。 + 傳回 。要停止傳送資料的位置。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 表示 Retry-After 標頭值,它可以是日期/時間或是 timespan 值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的日期及時間位移。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的差異,以秒為單位。 + + + 取得與 物件相差的日期及時間。 + 傳回 。與 物件相差的日期及時間。 + + + 物件取得差異,以秒為單位。 + 傳回 物件中的差異,以秒為單位。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示重試條件標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的重試條件標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示含選擇性品質的字串標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 用來初始化新執行個體的品質因素。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示品質標頭值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效字串。 + + + 物件取得品質係數。 + 傳回 物件中的品質係數。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 物件取得字串值。 + 傳回 。取自 物件的字串值。 + + + 表示 accept-encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的 物件。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 判斷指定的物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 取得傳輸編碼參數。 + 傳回 。傳輸編碼參數。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的傳輸編碼標頭值資訊。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 取得傳輸編碼值。 + 傳回 。傳輸編碼值。 + + + 表示含選擇性品質係數的 Accept-Encoding 標頭值。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + + + 初始化 類別的新執行個體。 + 用來初始化新執行個體的字串。 + 品質係數的值。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示傳輸編碼值資訊的字串。 + + 為 null 參考。 + + 不是具有品質標頭值資訊的有效傳輸編碼。 + + + 取得品質係數。 + 傳回 中的品質係數。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示 Via 標頭的值。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + + + 初始化 類別的新執行個體。 + 接收的通訊協定的通訊協定版本。 + 已收到要求或回應的主機及連接埠。 + 接收的通訊協定的通訊協定名稱。 + 用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 取得用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + 傳回 。用來識別收件者 Proxy 或閘道之軟體的註解欄位。 + + + 判斷指定的 是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。傳回目前物件的雜湊程式碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示 via 標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的 via 標頭值資訊。 + + + 取得接收的通訊協定的通訊協定名稱。 + 傳回 。通訊協定名稱。 + + + 取得接收的通訊協定的通訊協定版本。 + 傳回 。通訊協定版本。 + + + 取得收到要求或回應的主機和連接埠。 + 傳回 。已收到要求或回應的主機及連接埠。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + 表示警告標頭所用的警告值。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + + + 初始化 類別的新執行個體。 + 特定警告碼。 + 已附加警告的主機。 + 含有警告文字的以引號括住的字串。 + 警告的日期/時間戳記。 + + + 取得已附加警告的主機。 + 傳回 。已附加警告的主機。 + + + 取得特定警告碼。 + 傳回 。特定警告碼。 + + + 取得警告的日期/時間戳記。 + 傳回 。警告的日期/時間戳記。 + + + 判斷指定的 物件是否等於目前的 物件。 + 傳回 。如果指定的 等於目前的物件,則為 true,否則為 false。 + 要與目前物件比較的物件。 + + + 做為 物件的雜湊函式。 + 傳回 。目前物件的雜湊碼。 + + + 將字串轉換為 執行個體。 + 傳回 執行個體。 + 表示驗證標頭值資訊的字串。 + + 為 null 參考。 + + 不是有效的驗證標頭值資訊。 + + + 取得包含警告文字的以引號括住的字串。 + 傳回 。含有警告文字的以引號括住的字串。 + + + 傳回表示目前 物件的字串。 + 傳回 。表示目前物件的字串。 + + + 判斷字串是否為有效的 資訊。 + 傳回 。如果 為有效的 資訊,則為 true,否則為 false。 + 要驗證的字串。 + 字串的 版本。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/de/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/de/a new file mode 100644 index 00000000000..5c4f577656b --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/de/a @@ -0,0 +1,2350 @@ + + + + System.Net.Http + + + + Stellt HTTP-Inhalt auf Grundlage von einem Bytearray bereit. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der -Parameter ist null. + + + Initialisiert eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Der Offset in Bytes im -Parameter, der verwendet wird, um den zu initialisieren. + Die Anzahl der Bytes in ab dem -Parameter, die zum Initialisieren von benutzt werden. + Der -Parameter ist null. + Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters angegeben wird.- oder -Der -Parameter ist kleiner als 0 (null).- oder -Der -Parameter größer als die Länge des Inhalts, der durch den -Parameters - minus dem -Parameter angegeben wird. + + + Erstellt einen HTTP-Inhaltsdatenstrom als asynchronen Vorgang zum Lesen, dessen Sicherungsspeicher Arbeitsspeicher von ist. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Das Bytearray, das im Konstruktor bereitgestellt wird, als asynchronen Vorgang in einen HTTP-Inhaltsstream serialisieren und schreiben. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport, zum Beispiel Channelbindungstoken.Dieser Parameter kann null sein. + + + Bestimmt, ob ein Bytearray eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Bytearrays in Bytes. + + + Gibt an, wie die Clientzertifikate bereitgestellt werden. + + + Der versucht, alle verfügbaren Clientzertifikate automatisch bereitzustellen. + + + Die Anwendung stellt manuell die Clientzertifikate für den bereit.Dies ist der Standardwert. + + + Ein Typ für HTTP-Handler, die die Verarbeitung von HTTP-Antwortnachrichten in einen anderen Handler (den internen Handler) delegieren. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft den internen Handler ab, der die HTTP-Antwortnachrichten verarbeitet, oder legt diesen fest. + Gibt zurück.Der innere Handler für HTTP-Antwortnachrichten. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück. Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ein Container für die Name/Wert-Tupel, codiert mit dem "application/x-www-form-urlencoded" MIME-Typ. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Auflistung von Namen/Wert-Paaren. + Eine Sammlung von Name-Wert-Paaren. + + + Stellt eine Basisklasse zum Senden von HTTP-Anforderungen und Empfangen von HTTP-Antworten aus einer Ressource bereit, die von einem URI identifiziert wird. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der HTTP-Handlerstapel, der zum Senden von Anforderungen zu verwenden ist. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten Handler. + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden soll, false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Ruft die Basisadresse des URI (Uniform Resource Identifier) der Internetressource ab, die verwendet wird, wenn Anforderungen gesendet werden, oder legt diese fest. + Gibt zurück.Die Basisadresse des URI (Uniform Resource Identifier) der Internetressource, die verwendet wird, wenn Anforderungen gesendet werden. + + + Alle ausstehenden Anforderungen für diese Instanz abbrechen. + + + Ruft die Header ab, die mit jeder Anforderung gesendet werden sollen. + Gibt zurück.Die Header, die mit jeder Anforderung gesendet werden sollen. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Eine DELETE-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + + war null. + + + Eine GET-Anforderung an den angegebenen URI mit einer HTTP-Abschlussoption und einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein HTTP-Abschlussoptions-Wert, der angibt, wann die Operation als abgeschlossen betrachtet werden soll. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine GET-Anforderung für den angegebenen URI mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Bytearray in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Datenstrom in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Senden Sie eine GET-Anforderung an den angegebenen URI und geben Sie den Antworttext als Zeichenfolge in einem asynchronen Vorgang zurück. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + + war null. + + + Ruft beim Lesen des Antwortinhalts die maximale Anzahl zwischenzuspeichernder Bytes ab oder legt diese fest. + Gibt zurück.Die maximale Anzahl zu puffernder Bytes, wenn der Antwortinhalt gelesen wird.Der Standardwert für diese Eigenschaft ist 2 GB. + Der angegebene Größe ist kleiner als oder gleich 0 (null). + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine POST-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine POST-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Eine PUT-Anforderung an den angegebenen URI als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + + war null. + + + Eine PUT-Anforderung mit einem Abbruchtoken als asynchronen Vorgang senden. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Der URI, an den die Anforderung gesendet wird. + Der Inhalt der HTTP-Anforderung, die an den Server gesendet wird. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Wann der Vorgang abgeschlossen werden sollte (sobald eine Antwort verfügbar ist, oder nach dem Lesen des gesamten Inhalts der Antwort). + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Senden Sie eine HTTP-Anforderung als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + Die Anforderungsnachricht wurde bereits von der -Instanz gesendet. + + + Ruft die Zeitspanne ab, nach der das Zeitlimit der Anforderung überschritten ist, oder legt diese fest. + Gibt zurück.Die Zeitspanne, nach der das Zeitlimit der Anforderung überschritten ist. + Der angegebene Timout ist kleiner oder gleich 0 (null) und nicht . + Ein Vorgang ist bereits in der aktuellen Instanz gestartet worden. + Die aktuelle Instanz wurde bereits verworfen. + + + Der standardmäßige Meldungshandler für . + + + Erstellt eine Instanz einer -Klasse. + + + Ruft einen Wert ab, der angibt, ob der Handler Umleitungsantworten folgen soll, oder legt diesen Wert fest. + Gibt zurück.Wenn true, wenn der Handler Umleitungsantworten folgen soll; andernfalls false.Der Standardwert ist true. + + + Ruft den Typ der Dekomprimierungsmethode ab, die vom Handler für die automatische Dekomprimierung der HTTP-Inhalt-Antwort verwendet wird, oder legt diesen fest. + Gibt zurück.Die vom Handler zu benutzende automatische Dekomprimierungsmethode.Der Standardwert ist . + + + Ruft die diesem Handler zugeordnete Auflistung von Sicherheitszertifikaten ab oder legt diese fest. + Gibt zurück.Die Auflistung von Sicherheitszertifikaten, die diesem Handler zugeordnet sind. + + + Ruft den Cookiecontainer zum Speichern von Servercookies durch den Handler ab oder diesen fest. + Gibt zurück.Der Cookie-Container zum Speichern von Server-Cookies durch den Handler. + + + Ruft die Authentifizierungsinformationen ab, die vom Handler verwendet wurden, oder legt diese fest. + Gibt zurück.Die der Authentifizierungsanforderung zugeordnete Handler.Der Standardwert ist null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die maximale Anzahl von Umleitungen ab, denen der Handler folgt, oder legt diese fest. + Gibt zurück.Die maximale Anzahl von Umleitungsantworten, denen der Handler folgt.Der Standardwert ist 50. + + + Ruft die maximale Größe des Anforderungsinhaltpuffers ab, der vom Handler verwendet wird, oder legt diese fest. + Gibt zurück.Die maximale Größe des Anforderungsinhaltpuffers in Byte.Der Standardwert beträgt 2 GB. + + + Ruft einen Wert ab, der angibt, ob der Handler mit der Anforderung ein Autorisierungsheader sendet, oder legt diesen fest. + Gibt zurück.true für den Handler zum Senden eines HTTP-Autorisierungsheaders mit Anforderungen nach einer Authentifizierung, andernfalls false.Die Standardeinstellung ist false. + + + Ruft die Proxyinformationen ab, die vom Handler verwendet werden, oder legt diese fest. + Gibt zurück.Die Proxyinformationen, die vom Handler verwendet werden.Der Standardwert ist null. + + + Erstellt eine Instanz von auf Grundlage der Informationen, die in als Operation bereitgestellt werden, der nicht blockiert. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die HTTP-Anforderungsnachricht. + Ein Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Ruft einen Wert ab, der angibt, ob der Handler die automatische Antwort-Inhaltsdekomprimierung unterstützt. + Gibt zurück.Wenn true, wenn der Handler die automatische Dekomprimierung von Antwortinhalt unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler die Proxyeinstellungen unterstützt. + Gibt zurück.Wenn true, wenn der Handler die Proxyeinstellungen unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der angibt, ob der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt. + Gibt zurück.Wenn true, wenn der Handler Konfigurationseinstellungen für die - und -Eigenschaften unterstützt; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und die Cookies beim Senden von Anforderungen nutzt. + Gibt zurück.Wenn true, wenn der Handler die -Eigenschaft zum Speichern von Servercookies verwendet und diese Cookies beim Senden von Anforderungen verwendet; andernfalls false.Der Standardwert ist true. + + + Ruft einen Wert ab, der steuert, ob mit den Anforderungen vom Handler Standardanmeldeinformationen gesendet werden, oder legt diesen fest. + Gibt zurück.true, wenn die standardmäßigen Anmeldeinformationen verwendet werden, andernfalls false.Der Standardwert ist false. + + + Ruft einen Wert ab bzw. legt einen Wert fest, der angibt, ob der Handler einen Proxy für Anforderungen verwendet. + Gibt zurück.true, wenn der Handler einen Proxy für Anforderungen verwenden soll; andernfalls false.Der Standardwert ist true. + + + Gibt an, ob -Vorgänge als abgeschlossen betrachtet werden, sobald eine Antwort verfügbar ist, oder nachdem die gesamte Antwortnachricht einschließlich Inhalt gelesen wurde. + + + Der Vorgang sollte beendet werden, nachdem er die gesamte Antwort einschließlich des Inhalts gelesen hat. + + + Der Vorgang sollte beendet werden, sobald eine Antwort vorliegt und die Header gelesen wurden.Der Inhalts noch ist nicht bereit. + + + Eine Basisklasse, die einen HTTP-Entitätentext und Inhaltsheader darstellt. + + + Initialisiert eine neue Instanz der -Klasse. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + + + Serialisieren Sie den HTTP-Inhalt in einen Stream von Bytes und kopieren Sie dieses in das Streamobjekt, das als -Parameter bereitgestellt wird. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherstream als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die HTTP-Inhaltsheader wie in RFC 2616 definiert ab. + Gibt zurück.Die Inhaltsheader gemäß RFC 2616. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisiert den HTTP-Inhalt in einen Arbeitsspeicherpuffer als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die maximale Größe des zu verwendenden Puffers in Byte. + + + Serialisieren Sie den HTTP-Inhalt in ein Bytearray als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Serialisieren Sie den HTTP-Inhalt und geben Sie einen Stream zurück, der den Inhalt als asynchroner Vorgang darstellt. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in eine Zeichenfolge als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der HTTP-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Ein Basistyp für HTTP-Message-Handler. + + + Initialisiert eine neue Instanz der -Klasse. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Spezialitätenklasse, die es Anwendungen ermöglicht, die Methode auf einer HTTP-Handlerkette aufzurufen. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + + + Initialisiert eine neue Instanz einer -Klasse mit einem bestimmten . + Der , der für die Verarbeitung der HTTP-Antwortnachrichten verantwortlich ist. + true, wenn der innere Handler von Dispose() verworfen werden sollte,false, wenn Sie beabsichtigen, den inneren Handler wiederzuverwenden. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Senden Sie eine HTTP-Anforderung als asynchroner Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die zu sendende HTTP-Anforderungsmeldung. + Das Abbruchtoken, um den Vorgang abzubrechen. + + war null. + + + Eine Hilfsprogrammklasse für das Abrufen und das Vergleichen von Standard-HTTP-Methoden und zum Erstellen von neuen HTTP-Methoden. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten HTTP-Methode. + Die HTTP-Methode + + + Stellt eine HTTP DELTE-Protokollmethode dar. + Gibt zurück. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Die HTTP-Methode, die mit dem aktuellen Objekt verglichen werden soll. + + + Bestimmt, ob die angegebene und die aktuelle gleich sind. + Gibt zurück.true, wenn das angegebene Objekt und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Stellt eine HTTP GET-Protokollmethode dar. + Gibt zurück. + + + Fungiert als Hashfunktion für diesen Typ. + Gibt zurück.Ein Hashcode für das aktuelle . + + + Stellt eine HTTP HEAD-Protokollmethode dar.Die HEAD-Methode ist mit der GET-Methode identisch, bis auf den Unterschied, dass der Server in der Antwort nur Meldungsheader und keinen Meldungstext zurückgibt. + Gibt zurück. + + + Eine HTTP-Methode. + Gibt zurück.Die HTTP-Methode dargestellt als . + + + Der Gleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter gleich sind, andernfalls false. + Die linke für einen Gleichheitsoperator. + Die rechte zu einem Gleichheitsoperator. + + + Der Ungleichheitsoperator (=) zum Vergleichen von zwei -Objekten. + Gibt zurück.true, wenn der angegebene -Parameter und der angegebene -Parameter ungleich sind, andernfalls false. + Die linke für einen Ungleichheitsoperator. + Die rechte zu einem Ungleichheitsoperator. + + + Stellt eine HTTP OPTIONS-Protokollmethode dar. + Gibt zurück. + + + Stellt eine HTTP POST-Protokollmethode dar, die verwendet wird, um eine neue Entität als Zusatz zu einem URI zu senden. + Gibt zurück. + + + Stellt eine HTTP PUT-Protokollmethode dar, die verwendet wird, um eine durch einen URI bezeichnete Entität zu ersetzen. + Gibt zurück. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt eine HTTP TRACE-Protokollmethode dar. + Gibt zurück. + + + Eine Basisklasse für Ausnahmen, die von den Klassen und ausgelöst werden. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + + + Initialisiert eine neue Instanz der -Klasse mit einer bestimmten Meldung, die die aktuelle Ausnahme beschreibt, und einer inneren Ausnahme. + Eine Meldung, die die aktuelle Ausnahme beschreibt. + Die innere Ausnahme. + + + Stellt eine HTTP-Nachrichtenanfrage dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Eine Zeichenfolge, die die Anforderung darstellt. + + + Initialisiert eine neue Instanz der -Klasse mit einer HTTP-Methode und einer Anforderungs-. + Die HTTP-Methode + Das anzufordernde . + + + Ruft den Inhalt der HTTP-Meldung ab oder legt diesen fest. + Gibt zurück.Der Nachrichteninhalt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Ruft die Auflistung von HTTP-Anforderungsheadern ab. + Gibt zurück.Eine Auflistung von HTTP-Anforderungsheadern. + + + Ruft die von der HTTP-Anforderungsmeldung verwendete HTTP-Methode ab oder legt diese fest. + Gibt zurück.Die HTTP-Methode, die von der Anforderungnachricht benutzt wurde.Standard ist die GET-Methode. + + + Ruft eine Gruppe von Eigenschaften für die HTTP-Anforderung ab. + Gibt zurück. + + + Übernimmt oder bestimmt den , der für die HTTP-Anforderung verwendet wird. + Gibt zurück.Der , der für die aktuelle HTTP-Anforderung verwendet wird. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Stellt eine HTTP-Antwortnachricht einschließlich den Statuscodes und der Daten dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem bestimmten . + Der Statuscode der ATTP-Antwort. + + + Ruft den Inhalt einer HTTP-Antwortmeldung ab oder legt diesen fest. + Gibt zurück.Der Inhalt des HTTP-Antwortnachricht. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft die nicht verwalteten Ressourcen. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Löst eine Ausnahme aus, wenn die -Eigenschaft der HTTP-Antwort false lautet. + Gibt zurück.Die HTTP-Antwortnachricht, wenn der Aufruf erfolgreich ausgeführt wurde. + + + Ruft die Auflistung von HTTP-Antwortheadern ab. + Gibt zurück.Die Auflistung von HTTP-Antwortheadern. + + + Ruft einen Wert ab, der angibt, ob die HTTP-Antwort erfolgreich war. + Gibt zurück.Ein Wert, der angibt, ob die HTTP-Antwort erfolgreich war.true, wenn sich im Bereich 200–299 befand; andernfalls false. + + + Ruft den Begründungsausdruck ab, der üblicherweise von Servern, zusammen mit dem Statuscode, gesendet wird, oder legt diesen fest. + Gibt zurück.Die vom Server gesendete Begründungsphrase. + + + Ruft die Anforderungnachricht ab, die zu dieser Antwortnachricht geführt hat, oder legt diese fest. + Gibt zurück.Die Anforderungsnachricht, die zu dieser Antwortnachricht geführt hat. + + + Übernimmt oder bestimmt den Statuscode der HTTP-Antwort. + Gibt zurück.Der Statuscode der ATTP-Antwort. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolgendarstellung des aktuellen Objekts. + + + Ruft die HTTP-Meldungsversion ab oder legt sie fest. + Gibt zurück.Die HTTP-Nachrichtenversion.Standardwert: 1.1. + + + Ein Basistyp für Handler, die nur einige kleine Verarbeitung der Anforderungs- und/oder der Antwortnachrichten ausführen. + + + Erstellt eine Instanz einer -Klasse. + + + Erstellt eine Instanz einer -Klasse mit einem bestimmten inneren Handler. + Der innere Handler, der für die Verarbeitung der HTTP-Antwortnachrichten zuständig ist. + + + Führt die Verarbeitung auf jeder Anforderung aus, die an den Server gesendet wird. + Gibt zurück.Die HTTP-Anforderungsnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Anforderungmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Führen Sie die Verarbeitung auf jeder Antwort vom Server aus. + Gibt zurück.Die HTTP-Antwortnachricht, die verarbeitet wurde. + Die zu verarbeitende HTTP-Antwortmeldung. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + + Sendet eine HTTP-Anforderung an den internen Handler zum Senden an den Server als asynchronen Vorgang. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die an den Server zu sendende HTTP-Anforderungsnachricht. + Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um Nachricht vom Abbruch zu empfangen. + + war null. + + + Stellt eine Auflistung von -Objekten bereit, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die war null enthält nur Leerzeichen. + + + Erstellt eine neue Instanz der -Klasse. + Der Untertyp des Multipart-Inhalts. + Die Begrenzungszeichenfolge für den Multipart-Inhalt. + Der war null oder eine leere Zeichenfolge ().Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie Mehrfach-HTTP-Inhalt einer Sammlung von -Objekten hinzu, die unter Verwendung der multipart/*-Inhaltstypspezifikation serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Gibt einen Enumerator zurück, der die Auflistung der -Objekte durchläuft, die mithilfe der multipart/*-Inhaltstypspezifikation serialisiert werden. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Den Multipart-HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Eine explizite Implementierung der -Methode. + Gibt zurück.Ein Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + + Bestimmt, ob der HTTP-Multipart-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des HTTP-Inhalts in Bytes. + + + Stellt einen Container für den Inhalt bereit, der mithilfe des multipart/form-data-MIME-Typs codiert wird. + + + Erstellt eine neue Instanz der -Klasse. + + + Erstellt eine neue Instanz der -Klasse. + Die Begrenzungszeichenfolge für den Multipart-Form-Dateninhalt. + Die war null enthält nur Leerzeichen.- oder -Die endet mit einem Leerzeichen. + Die Länge des war größer als 70. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Die war null enthält nur Leerzeichen. + + war null. + + + Fügen Sie HTTP-Inhalt einer Auflistung von -Objekten hinzu, die in multipart/form-data-MIME-Typ serialisiert werden. + Der zur Auflistung hinzuzufügende HTTP-Inhalt. + Der Name für den HTTP-Inhalt, der hinzugefügt wird. + Der Name der Datei, für den zur Auflistung hinzuzufügenden HTTP-Inhalt. + Die war null enthält nur Leerzeichen.- oder -Die war null enthält nur Leerzeichen. + + war null. + + + Stellt HTTP-Inhalt auf Grundlage eines Streams bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die verfügbare Größe des Puffers in Byte für die . + + war null. + Die war kleiner oder gleich 0 (null). + + + Den HTTP-Datenstrominhalt in einen Speicherstream als asynchronen Vorgang schreiben. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + + + Gibt die vom verwendeten, nicht verwalteten Ressourcen frei und verwirft optional auch die verwalteten Ressourcen. + true, um sowohl verwaltete als auch nicht verwaltete Ressourcen freizugeben. false, wenn ausschließlich nicht verwaltete Ressourcen freigegeben werden sollen. + + + Den HTTP-Inhalt in einen Stream als asynchronen Vorgang serialisieren. + Gibt zurück.Das Aufgabenobjekt, das den asynchronen Vorgang darstellt. + Die Zielstream. + Informationen über den Transport (z. B. Channelbindungstoken).Dieser Parameter kann null sein. + + + Bestimmt, ob der Stream-Inhalt eine gültige Länge in Bytes enthält. + Gibt zurück.true, wenn eine gültige Länge ist, andernfalls false. + Die Länge des Streamsinhalts in Bytes. + + + Stellt HTTP-Inhalt auf Grundlage einer Zeichenfolge bereit. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + + + Erstellt eine neue Instanz der -Klasse. + Der Inhalt, der zum Initialisieren der verwendet wird. + Die für den Inhalt zu verwendende Codierung. + Der Medientyp, der für den Inhalt verwendet werden soll. + + + Stellt Authentifizierungsinformationen in Authorization-, ProxyAuthorization-, WWW-Authenticate- und Proxy-Authenticate-Headerwerten dar. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + + + Initialisiert eine neue Instanz der -Klasse. + Das Schema für die Autorisierung. + Die Anmeldeinformationen, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Anmeldeinformationen ab, die die Authentifizierungsinformationen des Benutzer-Agents für die angeforderte Ressource enthält. + Gibt zurück.Die Anmeldeinformationen, die die Informationen für die Authentifizierung enthalten. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft das Schema ab, welches für die Autorisierung verwendet werden soll. + Gibt zurück.Das Schema für die Autorisierung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Cachesteuerungsheaders dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + CACHE-EXTENSION-Tokens, jeweils mit einem optionalen zugeordneten Wert. + Gibt zurück.Eine Sammlung von Cacheerweiterungtokens, jeweils mit einem optionalen zugeordneten Wert. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Der Höchstalter in Sekunden, für das der HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine Antwort zu akzeptieren, die die Ablaufzeit überschritten hat; andernfalls false. + + + Die maximale Zeit in Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu akzeptieren, die ihre Ablaufzeit überschritten hat. + Gibt zurück.Die Zeit in Sekunden. + + + Die Anzahl Sekunden, die ein HTTP-Client bereit ist, eine Antwort zu übernehmen. + Gibt zurück.Die Zeit in Sekunden. + + + Ob der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung eines Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag veraltet ist; andernfalls false. + + + Ob ein HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu akzeptieren. + Gibt zurück.true, wenn der HTTP-Client bereit ist, eine zwischengespeicherte Antwort zu übernehmen; andernfalls false. + + + Eine Sammlung von Feldnamen in der "no-cache"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf. + Gibt zurück.true, wenn ein Cache keinen Teil der HTTP-Anforderungsnachricht oder einer Antwort speichern darf; andernfalls false. + + + Ob ein Cache oder ein Proxy keinen Aspekt des Entitätstexts ändern darf. + Gibt zurück.true, wenn ein Cache oder Proxy keinen Aspekt des Entitätstexts ändern darf; andernfalls false. + + + Ob ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert. + Gibt zurück.true wenn ein Cache entweder mithilfe eines zwischengespeicherten Eintrags reagiert, der mit den anderen Einschränkungen der HTTP-Anforderung konsistent ist, oder mit einem 504-Status (Gateway Timeout) reagiert; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Cachesteuerungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Cachesteuerungsheader. + + + Gibt an, ob alles oder nur ein Teil der HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht durch das Ausführen eines freigegebenen Caches zwischengespeichert werden darf. + Gibt zurück.true, wenn die HTTP-Antwortnachricht für einen einzelnen Benutzer bestimmt ist und nicht von einem gemeinsam genutzten Cache zwischengespeichert werden darf; andernfalls false. + + + Eine Feldnamensammlung in der "private"-Direktive in einem Cachesteuerungsheaderfeld in einer HTTP-Antwort. + Gibt zurück.Eine Sammlung von Feldnamen. + + + Ob der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Cache-Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist. + Gibt zurück.true, wenn der Ursprungsserver eine erneute Validierung des Cacheeintrags bei nachfolgender Verwendung erfordert, wenn der Eintrag für freigegebene Benutzer-Agent-Caches veraltet ist; andernfalls false. + + + Ob eine HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde. + Gibt zurück.true, wenn die HTTP-Antwort möglicherweise von einem Cache zwischengespeichert wurde, auch wenn sie normalerweise nicht zwischenspeicherbar wäre oder nur innerhalb eines nicht freigegeben Cache zwischengespeichert werden würde; andernfalls false. + + + Das freigegebene, in Sekunden angegebene Höchstalter in einer HTTP-Antwort, die die "max-age"-Direktive in einem Cache-Control-Header oder einem Expires-Header für einen gemeinsam genutzten Cache überschreibt. + Gibt zurück.Die Zeit in Sekunden. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Disposition-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die eine enthält. + + + Das Datum, zu der die Datei erstellt wurde. + Gibt zurück.Das Dateierstellungsdatum. + + + Der Anordnungstyp für einen Textteil. + Gibt zurück.Der Anordnungstyp. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ein Vorschlag, wie Sie einen Dateinamen zum Speichern der Nachrichtennutzlast erstellen, der verwendet werden soll, wenn die Entität getrennt und in einer separaten Datei gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname. + + + Ein Vorschlag, wie Sie Dateinamen zum Speichern der Nachrichtennutzlasten erstellen, der verwendet werden soll, wenn die Entitäten getrennt und in separaten Dateien gespeichert wird. + Gibt zurück.Ein vorgeschlagener Dateiname des Formulardateinamens*. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Datum der letzten Dateiänderung. + Gibt zurück.Das Änderungsdatum der Datei. + + + Der Name für einen Inhaltstextteil. + Gibt zurück.Der Name des Inhaltstextteils. + + + Ein Satz von Parametern, enthalten im Content-Disposition-Header. + Gibt zurück.Eine Auflistung von Parametern. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Wertinformation des Inhaltsdisposition-Headers des Inhalts darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Inhaltsdispositionsheader. + + + Das Datum, an dem zuletzt die Datei gelesen wurde. + Gibt zurück.Das letzte gelesene Datum. + + + Die ungefähre Größe der aktuellen Datei in Bytes. + Gibt zurück.Die ungefähre Größe in Bytes. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Content-Range-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + Die Position in Bytes, an der das Senden von Daten beendet werden soll. + Der Start- oder Endpunkt des Bereichs in Bytes. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position in Bytes, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob für den Inhaltsbereichs-Header eine Länge angegeben wurde. + Gibt zurück.true, wenn der Content-Range eine Länge angegeben hat; andernfalls false. + + + Ruft ab, ob für den Inhaltsbereich ein Bereich bestimmt wurde. + Gibt zurück.true, wenn der Content-Range einen Bereich angegeben hat; andernfalls false. + + + Ruft die Länge des vollständigen Entitätstexts ab. + Gibt zurück.Die Länge des vollständigen Entitätstexts. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die die Informationen des Inhaltsbereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Inhaltsbereich-Headerwert. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Die verwendeten Bereichseinheiten. + Gibt zurück.Ein , das Bereichseinheiten enthält. + + + Stellt einen Entitätstag-Headerwert dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die enthält. + Ein Wert, der angibt, ob dieser Entitätstagheader ein schwaches Validierungssteuerelement ist.Wenn der Entitätstagheader ein schwaches Validierungssteuerelement ist, sollte auf true festgelegt werden.Wenn der Entitätstagheader ein starkes Validierungssteuerelement ist, sollte auf false festgelegt werden. + + + Ruft den Entitätstagheaderwert ab. + Gibt zurück. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft ab, ob dem Entitätstag ein Schwächeindikator vorangestellt ist. + Gibt zurück.true, wenn das Entitätstag durch einen Schwächeindikator vorangestellt wird; andernfalls false. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Entitätstag-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Entitätstag-Headerwert dar. + + + Ruft die nicht transparente Zeichenfolge in Anführungszeichen ab. + Gibt zurück.Eine nicht transparente Zeichenfolge in Anführungszeichen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt die Auflistung von Inhaltsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Allow-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Allow-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Disposition-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Encoding-Inhaltsheaders für eine HTTP-Antwort. + + + Ruft den Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Content-Language-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Length-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Location-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-MD5-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Range-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Content-Type-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Expires-Inhaltsheaders für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + Gibt zurück.Der Wert des Last-Modified-Inhaltsheaders für eine HTTP-Antwort. + + + Eine Sammlung von Headern und deren Werten, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + + + Fügt den angegebenen Header und seine Werte in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Eine Liste von Headerwerten, die der Sammlung hinzugefügt werden sollen. + + + Fügt den angegebenen Header und den Wert in die -Sammlung hinzu. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Entfernt alle Header aus der -Auflistung. + + + Gibt zurück, ob ein bestimmter Header in der -Auflistung vorhanden ist. + Gibt zurück.true, wenn der angegebene Header in der Auflistung vorhanden ist, andernfalls false. + Der spezielle Header. + + + Gibt einen Enumerator zurück, der die -Instanz durchlaufen kann. + Gibt zurück.Ein Enumerator für das . + + + Gibt alle Headerwerte für einen angegebenen Header zurück, der in der -Auflistung gespeichert wird. + Gibt zurück.Ein Array von Headerzeichenfolgen. + Der angegebene Header, für den Werte zurückgegeben werden sollen. + + + Entfernt den angegebenen Header aus der -Auflistung. + Gibt zurück. + Der Name des Headers, der aus der Auflistung entfernt werden soll. + + + Ruft einen Enumerator ab, der eine durchlaufen kann. + Gibt zurück.Eine Instanz einer -Implementierung, die eine durchlaufen kann. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Werte zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Die Werte des Headers. + + + Gibt einen Wert zurück, der angibt, ob der angegebene Header und dessen Wert zur -Auflistung hinzugefügt wurden, ohne die bereitgestellten Informationen zu überprüfen. + Gibt zurück.true, wenn der angegebene Header und zur Auflistung hinzugefügt werden konnten, andernfalls false. + Der Header, der der Auflistung hinzugefügt werden soll. + Der Inhalt des Headers. + + + Zurückgeben, ob ein angegebener Header und angegebene Werte in der -Auflistung gespeichert sind. + Gibt zurück.true, wenn der angegebene Header und values in der Auflistung gespeichert sind; andernfalls false. + Der angegebene Header. + Die angegebenen Headerwerte. + + + Stellt eine Auflistung von Headerwerten dar. + Der Headerauflistungs-Typ. + + + Fügt der einen Eintrag hinzu. + Das Element, das der Headerauflistung hinzugefügt werden soll. + + + Entfernt sämtliche Einträge aus dem . + + + Bestimmt, ob der ein Element enthält. + Gibt zurück.true, wenn dar Eintrag in der Instanz enthalten ist, andernfalls false. + Das Element, das in der Headerauflistung gefunden werden soll. + + + Kopiert die gesamte in ein kompatibles eindimensionales , beginnend am angegebenen Index des Zielarrays. + Das eindimensionale , das das Ziel der aus der kopierten Elemente ist.Für das muss eine nullbasierte Indizierung verwendet werden. + Der nullbasierte Index im , bei dem der Kopiervorgang beginnt. + + + Ruft die Anzahl der Header im ab. + Gibt zurück.Die Anzahl der Header in einer Auflistung. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Ruft einen Wert ab, der angibt, ob das -Instanz schreibgeschützt ist. + Gibt zurück.true, wenn die -Instanz schreibgeschützt ist, andernfalls false. + + + Analysiert und fügt einen Eintrag hinzu. + Der hinzuzufügende Eintrag + + + Entfernt das angegebene Element aus . + Gibt zurück.true, wenn der erfolgreich aus der Instanz entfernt wurde, andernfalls false. + Das zu entfernende Element. + + + Gibt einen Enumerator zurück, der die durchläuft. + Gibt zurück.Ein Enumerator für die Instanz. + + + Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob die Eingabe analysiert und zu hinzugefügt werden kann. + Gibt zurück.true, wenn analysiert und zu Instanz hinzugefügt werden kann; andernfalls false + Der zu überprüfende Eintrag. + + + Stellt die Auflistung von Anforderungsheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Charset-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Charset-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Accept-Language-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Accept-Language-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Authorization-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Connection-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Anforderung "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Anfrage. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Expect-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Expect-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Expect-Header für eine HTTP-Anforderung "Continue" enthält. + Gibt zurück.true, wenn der Expect-Header "Fortfahren" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des From-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des From-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Host-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Host-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des If-Match-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Modified-Since-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Ruft den Wert des If-None-Match-Headers für eine HTTP-Anforderung ab. + + + Übernimmt oder bestimmt den Wert des If-Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des If-Unmodified-Since-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Max-Forwards-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Proxy-Authorization-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Range-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Range-Headers für eine HTTP-Anforderung. + + + Übernimmt oder bestimmt den Wert des Referer-Headers für eine HTTP-Anforderung. + Gibt zurück.Der Wert des Referer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des TE-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des TE-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Anforderung. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Anforderung "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des User-Agent-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des User-Agent-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Via-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Anforderung. + + + Ruft den Wert des Warning-Headers für eine HTTP-Anforderung ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Anforderung. + + + Stellt die Auflistung von Antwortheadern dar, wie in RFC 2616 definiert. + + + Ruft den Wert des Accept-Ranges-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Accept-Ranges-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Age-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Age-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Cache-Control-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Cache-Control-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Connection-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Connection-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Connection-Header für eine HTTP-Antwort "Close" enthält. + Gibt zurück.true, wenn der Connection-Header "Schließen" enthält; andernfalls false. + + + Übernimmt oder bestimmt den Wert des Date-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Date-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des ETag-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des ETag-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Location-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Location-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Pragma-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Pragma-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Proxy-Authenticate-Headers für eine HTTP-Antwort. + + + Übernimmt oder bestimmt den Wert des Retry-After-Headers für eine HTTP-Antwort. + Gibt zurück.Der Wert des Retry-After-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Server-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Server-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Trailer-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Trailer-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Transfer-Encoding-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Transfer-Encoding-Headers für eine HTTP-Antwort. + + + Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob der Transfer-Encoding-Header für eine HTTP-Antwort "Chunked" enthält. + Gibt zurück.true, wenn der Transfer-Encoding-Header segmentierte Elemente enthält; andernfalls false. + + + Ruft den Wert des Upgrade-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Upgrade-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Vary-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Vary-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Via-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Via-Headers für eine HTTP-Antwort. + + + Ruft den Wert des Warning-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des Warning-Headers für eine HTTP-Antwort. + + + Ruft den Wert des WWW-Authenticate-Headers für eine HTTP-Antwort ab. + Gibt zurück.Der Wert des WWW-Authenticate-Headers für eine HTTP-Antwort. + + + Stellt einen Medientyp dar, der in einem Inhaltstypheader verwendet wird, wie im RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Die Quelle, die als Zeichenfolge dargestellt wird, um die neue Instanz zu initialisieren. + + + Ruft den Zeichensatz ab oder legt ihn fest. + Gibt zurück.Der Zeichensatz. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Wert des Medientyp-Headers ab oder legt ihn fest. + Gibt zurück.Der Medientyp-Headerwert. + + + Ruft die Titelwertparameter des Medientyps ab oder legt diese fest. + Gibt zurück.Die Medientyp-Headerwertparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Medientyp-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Medientyp-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Medientyp mit einem zusätzlichen Qualitätsfaktor dar, der in einem Inhaltstypheader verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + + + Initialisiert eine neue Instanz der -Klasse. + + dargestellt als Zeichenfolge, um die neue Instanz zu initialisieren. + Die Qualität dieses zugeordneten Headerwert. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Medientyp mit Qualitätsheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Medientyp mit Qualitätsheaderwertinformationen. + + + Abrufen oder Festlegen des Qualitätswerts für . + Gibt zurück.Der Qualitätswert für das Objekt . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt ein Name-Wert-Paar dar, das in verschiedenen Headern verwendet wird, die in RFC 2616 definiert sind. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Headernamen ab. + Gibt zurück.Der Headername. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Namenswert-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Namenswert-Headerwert dar. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Headerwert ab. + Gibt zurück.Der Headerwert. + + + Stellt ein Name-Wert-Paar mit Parametern dar, das in verschiedenen Headern verwendet wird, wie in RFC 2616 definiert. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + + + Initialisiert eine neue Instanz der -Klasse. + Der Headername. + Der Headerwert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Parameter vom -Objekt ab. + Gibt zurück.Eine Auflistung, die die Parameter enthält. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Namenswert mit Parameterheaderwertinformationen darstellt. + + ist ein null-Verweis. + + ist ein ungültiger Namenswert mit Parameterheaderwertinformationen. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Produkttokenwert in einem User-Agent-Header dar. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktname. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft den Namen des Produkttoken ab. + Gibt zurück.Der Name des Produkttoken. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produkt-Headerwerts darstellt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Version des Produkttoken ab. + Gibt zurück.Die Version des Produkttoken. + + + Stellt einen Wert dar, der entweder ein Produkt oder ein Kommentar in einem Benutzer-Agent-Header sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Kommentarwert. + + + Initialisiert eine neue Instanz der -Klasse. + Der Produktnamenswert. + Die Produktversionswert. + + + Ruft den Kommentar vom -Objekt ab. + Gibt zurück.Der Kommentarwert dieses . + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Produktinfo-Headerwerts darstellt. + + ist ein null-Verweis. + + stellt keinen gültigen Produktinfo-Headerwert dar. + + + Ruft das Produkt vom -Objekt ab. + Gibt zurück.Der Produktwert von diesem . + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen If-Range-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Entitätstag-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Datumswert für die Initialisierung der neuen -Instanz. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Entitätstag, dargestellt als Zeichenfolge, der verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum aus dem Objekt ab. + Gibt zurück.Das Datum aus dem -Objekt. + + + Ruft das Entitätstag vom -Objekt ab. + Gibt zurück.Das Entitätstag vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichsbedingung-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereichsbedingung-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + + + Initialisiert eine neue Instanz der -Klasse mit einem Bytebereich. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Bereichs-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Bereich-Headerwert. + + + Ruft die Bereiche ab, die vom -Objekt angegeben sind. + Gibt zurück.Die Reichweiten vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft die Einheit vom -Objekt ab. + Gibt zurück.Die Einheit vom -Objekt. + + + Stellt einen Bereichsheaderwert des Bytebereichs dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Position, an der mit dem Senden von Daten begonnen werden soll. + Die Position, an der das Senden von Daten beendet werden soll. + + ist größer als .- oder - oder ist kleiner als 0. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Ruft die Position ab, an der mit dem Senden von Daten begonnen werden soll. + Gibt zurück.Die Position, an der mit dem Senden von Daten begonnen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Position ab, an der das Senden von Daten beendet werden soll. + Gibt zurück.Die Position, an der das Senden von Daten beendet werden soll. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Stellt einen Retry-After-Headerwert dar, der entweder ein Datum/Uhrzeit- oder ein Zeitspannen-Wert sein kann. + + + Initialisiert eine neue Instanz der -Klasse. + Der Datum und Zeit Offset, der zum Initialisieren der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Das Delta, in Sekunden, das verwendet wird, um die neue Instanz zu initialisieren. + + + Ruft das Datum und Uhrzeit-Offset vom aktuellen -Objekt ab. + Gibt zurück.Das Datum und Uhrzeit-Offset vom aktuellen -Objekt. + + + Ruft das Delta in Sekunden vom -Objekt ab. + Gibt zurück.Das Delta in Sekunden vom -Objekt. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Wiederholungsbedingung darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für den Headerwert für die Wiederholungsbedingung. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Zeichenfolgenheaderwert mit einer optionalen Qualität dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Qualitätsfaktor für die Initialisierung der neuen -Instanz. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Qualitäts-Headerwerts darstellt. + + ist ein null-Verweis. + + ist eine ungültige Zeichenfolge mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor vom -Objekt ab. + Gibt zurück.Der Qualitätsfaktor vom -Objekt. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Zeichenfolgewert aus dem -Objekt ab. + Gibt zurück.Der Zeichenfolgewert aus dem -Objekt. + + + Stellt einen Headerwert zum Akzeptieren von Codierung dar. + + + Initialisiert eine neue Instanz der -Klasse. + Ein Objekt, das zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Bestimmt, ob das angegebene Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Ruft die Übertragungs-Codierungs-Parameter ab. + Gibt zurück.Die Übertragungscodierungsparameter. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Headerwerts für die Übertragungscodierung darstellt. + + ist ein null-Verweis. + + ist kein ungültige Information für einen Übertragungscodierungs-Headerwert. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Ruft den Übertragungscodierungswert ab. + Gibt zurück.Der Übertragungscodierungswert. + + + Stellt einen Accept-Encoding-Headerwert mit optionalem Qualitätsfaktor dar. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Eine Zeichenfolge, die zur Initialisierung der neuen Instanz verwendet wird. + Ein Wert für den Qualitätsfaktor. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Übertragungscodierungswerts darstellt. + + ist ein null-Verweis. + + ist ein ungültige Übertragungscodierung mit Qualitätsheaderwertinformationen. + + + Ruft den Qualitätsfaktor von ab. + Gibt zurück.Der Qualitätsfaktor von . + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt den Wert des Via-Headers dar. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + + + Initialisiert eine neue Instanz der -Klasse. + Die Protokollversion des empfangenen Protokolls. + Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + Der Protokollname des empfangenen Protokolls. + Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Ruft das Befehlsfeld ab, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + Gibt zurück.Das Befehlsfeld, das verwendet wird, um die Software des empfangenen Proxys oder Gateways zu identifizieren. + + + Bestimmt, ob das angegebene -Objekt und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Gibt einen Hashcode für das aktuelle Objekt zurück. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt zurück.Eine -Instanz. + Eine Zeichenfolge, die Informationen des Via-Headerwerts darstellt. + + ist ein null-Verweis. + + ist keine gültige Information für einen Via-Headerwert. + + + Ruft den Protokollnamen des empfangenen Protokolls ab. + Gibt zurück.Der Protokollname. + + + Ruft die Protokollversion des empfangenen Protokolls ab. + Gibt zurück.Die Protokollversion. + + + Ruft den Host und Port ab, von der die Anforderung oder Antwort empfangen wurden. + Gibt zurück.Der Host und der Port, von denen die Anforderung oder Antwort empfangen wurde. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + Stellt einen Warnwert dar, der vom Warn-Header verwendet wird. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Initialisiert eine neue Instanz der -Klasse. + Der spezifische Warncode. + Der Host, der die Warnung angehängt hat. + Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + Der Datum/Uhrzeit-Stempel der Warnung. + + + Ruft den Host ab, der die Warnung angehängt hat. + Gibt zurück.Der Host, der die Warnung angehängt hat. + + + Ruft den spezifischen Warncode ab. + Gibt zurück.Der spezifische Warncode. + + + Ruft den Datum-/Uhrzeit-Stempel der Warnung ab. + Gibt zurück.Der Datum/Uhrzeit-Stempel der Warnung. + + + Bestimmt, ob das angegebene und das aktuelle -Objekt gleich sind. + Gibt zurück.true, wenn das angegebene und das aktuelle Objekt gleich sind, andernfalls false. + Das Objekt, das mit dem aktuellen Objekt verglichen werden soll. + + + Fungiert als Hashfunktion für ein -Objekt. + Gibt zurück.Ein Hashcode für das aktuelle Objekt. + + + Konvertiert eine Zeichenfolge in eine -Instanz. + Gibt eine -Instanz zurück. + Eine Zeichenfolge, die Authentifizierungsheader-Wertinformationen darstellt. + + ist ein null-Verweis. + + ist keine gültige Wertinformation für einen Authentifizierungsheader. + + + Ruft eine Zeichenfolge in Anführungszeichen ab, die den Warnungstext enthält. + Gibt zurück.Eine Zeichenfolge in Anführungszeichen, die den Warnungs-Text enthält. + + + Gibt eine Zeichenfolge zurück, die das aktuelle -Objekt darstellt. + Gibt zurück.Eine Zeichenfolge, die das aktuelle Objekt darstellt. + + + Bestimmt, ob es sich bei einer Zeichenfolge um gültige -Informationen handelt. + Gibt zurück.true, wenn gültige -Informationen sind; andernfalls false. + Die zu validierende Zeichenfolge. + Die -Version der Zeichenfolge. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/es/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/es/a new file mode 100644 index 00000000000..dad879d5f34 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/es/a @@ -0,0 +1,2322 @@ + + + + System.Net.Http + + + + Proporciona contenido HTTP basado en una matriz de bytes. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El valor del parámetro es null. + + + Inicializa una nueva instancia de la clase . + Contenido usado para inicializar . + El desplazamiento, en bytes, del parámetro de usado para inicializar . + El número de bytes de a partir del parámetro de usado para inicializar . + El valor del parámetro es null. + El parámetro es menor que cero.O bienEl parámetro es mayor que la longitud del contenido que especifica el parámetro .O bienEl parámetro es menor que cero.O bienEl valor del parámetro es mayor que la longitud del contenido que especifica menos el parámetro . + + + Crea una secuencia de contenido HTTP como una operación asincrónica para lectura cuya memoria auxiliar es memoria procedente del objeto . + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Serialice y escriba la matriz de bytes proporcionada en el constructor en una secuencia de contenido HTTP como operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte, como el token de enlace de canal.Este parámetro puede ser null. + + + Determina si una matriz de bytes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes de la matriz. + + + Especifica cómo se proporcionan los certificados de cliente. + + + + intentará proporcionar automáticamente todos los certificados de cliente disponibles. + + + La aplicación proporciona manualmente los certificados de cliente a .Este valor es el predeterminado. + + + Un tipo para los controladores HTTP que delegan el procesamiento de los mensajes de respuesta HTTP a otro controlador, denominado controlador interno. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Libera los recursos no administrados que utiliza el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el controlador interno que procesa los mensajes de respuesta HTTP. + Devuelve .Controlador interno para los mensajes de respuesta HTTP. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve . Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Contenedor para las tuplas de nombre-valor codificadas mediante el tipo MIME de application/x-www-form-urlencoded. + + + Inicializa una nueva instancia de la clase con una colección específica de pares de nombre y valor. + Colección de pares de nombre-valor. + + + Proporciona una clase base para enviar solicitudes HTTP y recibir respuestas HTTP de un recurso identificado por un URI. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un controlador específico. + Pila de controlador HTTP que se va a usar para enviar solicitudes. + + + Inicializa una nueva instancia de la clase con un controlador específico. + + responsable de procesar los mensajes de respuesta HTTP. + Es true si Dispose() debe desechar el controlador interno; es false si piensa reutilizar el controlador interno. + + + Obtiene o establece la dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + Devuelve .La dirección base de Identificador uniforme de recursos (URI) del recurso de Internet utilizado cuando se envían solicitudes. + + + Cancela todas las solicitudes pendientes en esta instancia. + + + Obtiene los encabezados que se deben enviar con cada solicitud. + Devuelve .Encabezados que se deben enviar con cada solicitud. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud DELETE al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar tanto recursos administrados como no administrados; es false para liberar únicamente recursos no administrados. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve . + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + El era null. + + + Envía una solicitud GET al URI especificado con una opción de finalización de HTTP y un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Valor de opción de finalización de HTTP que indica cuándo se debe considerar completada la operación. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado con un token de cancelación como operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una matriz de bytes en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una secuencia en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Envía una solicitud GET al URI especificado y devuelve el cuerpo de la respuesta como una cadena en una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + El era null. + + + Obtiene o establece el número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta. + Devuelve .Número máximo de bytes que se van a almacenar en búfer al leer el contenido de la respuesta.El valor predeterminado de esta propiedad es 2 gigabytes. + El tamaño especificado es menor o igual que cero. + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud POST al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud POST con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud PUT al URI especificado como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + El era null. + + + Envía una solicitud PUT con un token de cancelación como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + URI al que se envía la solicitud. + Contenido de la solicitud HTTP que se envía al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El era null. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Cuándo se debe completar la operación (tan pronto como haya una respuesta disponible o después de leer todo el contenido de la respuesta). + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El era null. + Ya se ha enviado el mensaje de solicitud a la instancia. + + + Obtiene o establece el tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + Devuelve .El tiempo de espera hasta que se agota el tiempo de espera de la solicitud. + El tiempo de espera especificado es menor o igual que cero y no es . + Una operación se ha iniciado en la instancia actual. + Se ha eliminado la instancia actual. + + + Controlador de mensajes predeterminado usado por . + + + Cree una instancia de una clase . + + + Obtiene o establece un valor que indica si el controlador debe seguir las respuestas de redirección. + Devuelva .true si el controlador debe seguir las respuestas de redirección; si no false.El valor predeterminado es true. + + + Obtiene o establece el tipo de método de descompresión utilizado por el controlador para la descompresión automática de la respuesta de contenido HTTP. + Devuelva .El método de descompresión automática utilizado por el controlador.El valor predeterminado es . + + + Obtiene o establece la colección de certificados de seguridad asociados a este controlador. + Devuelva .Colección de certificados de seguridad asociados a este controlador. + + + Obtiene o establece el contenedor de cookies que el controlador usa para almacenar cookies del servidor. + Devuelva .Contenedor de cookies que el controlador usa para almacenar cookies del servidor. + + + Obtiene o establece la información de autenticación utilizada por este controlador. + Devuelva .Credenciales de autenticación asociadas con el controlador.El valor predeterminado es null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene o establece el número máximo de redirecciones que seguirá el controlador. + Devuelva .El número máximo de respuestas de redirección que seguirá el controlador.El valor predeterminado es 50. + + + Obtiene o establece el tamaño máximo del búfer de contenido de solicitud usado por el controlador. + Devuelva .Tamaño máximo de búfer de contenido de la solicitud en bytes.El valor predeterminado es 2 gigabytes. + + + Obtiene o establece un valor que indica si el controlador envía un encabezado de autorización con la solicitud. + Devuelva .Es true para que el controlador envíe un encabezado de autorización HTTP con las solicitudes después de que tenga lugar la autenticación; de lo contrario, es false.El valor predeterminado es false. + + + Obtiene o establece la información de proxy que usa el controlador. + Devuelva .La información de proxy que usará el controlador.El valor predeterminado es null. + + + Crea una instancia de basándose en la información proporcionada en el objeto como una operación que no se bloqueará. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Obtiene un valor que indica si el controlador admite la descompresión automática del contenido de la respuesta. + Devuelva .true si el controlador admite la descompresión automática del contenido de la respuesta; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite valores de proxy. + Devuelva .true si el controlador admite valores de proxy; si no false.El valor predeterminado es true. + + + Obtiene un valor que indica si el controlador admite opciones de configuración para las propiedades y . + Devuelva .true si el controlador admite las opciones de configuración para las propiedades y ; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que indica si el controlador utiliza la propiedad para almacenar las cookies de servidor y utiliza estas cookies al enviar solicitudes. + Devuelva .true si el controlador admite el uso de la propiedad para almacenar las cookies de servidor y usa estas cookies al enviar solicitudes; si no false.El valor predeterminado es true. + + + Obtiene o establece un valor que controla si se envían las credenciales predeterminadas con las solicitudes del controlador. + Devuelva .Es true si se utilizan las credenciales predeterminadas; en cualquier otro caso, es false.El valor predeterminado es false. + + + Obtiene o establece un valor que indica si el controlador usa un proxy para las solicitudes. + Devuelva .true si el controlador debe usar un servidor proxy para las solicitudes; si no false.El valor predeterminado es true. + + + Indica si las operaciones de se consideran completadas cualquiera tan pronto como una respuesta esté disponible o después de leer el mensaje de respuesta completo, incluido el contenido. + + + La operación debe completarse después de leer toda la respuesta incluido el contenido. + + + La operación debe completarse tan pronto como haya una respuesta disponible y se lean los encabezados.El contenido no se ha leído aún. + + + Una clase base que representa un cuerpo de entidad y encabezados de contenido HTTP. + + + Inicializa una nueva instancia de la clase . + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + + + Serialice el contenido HTTP en una secuencia de bytes y de copias en el objeto de secuencia proporcionado como el parámetro de . + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Serializa el contenido HTTP en una secuencia de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene los encabezados de contenido HTTP tal como se define en RFC 2616. + Devuelva .Encabezados de contenido como se define en RFC 2616. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializa el contenido HTTP en un búfer de memoria como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + El tamaño máximo, en bytes, del búfer que se va a utilizar. + + + Serializa el contenido HTTP en una matriz de bytes como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serializar el contenido HTTP y devolver una secuencia que representa el contenido como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una cadena como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido HTTP tiene una longitud válida en bytes. + Devuelva .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Tipo base para los controladores de mensajes HTTP. + + + Inicializa una nueva instancia de la clase . + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelva .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase especializada que permite que las aplicaciones llamen al método en una cadena de controlador HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + + + Inicializa una instancia de una clase con un específico. + + responsable de procesar los mensajes de respuesta HTTP. + true si Dispose() debe desechar el controlador interno,false si piensa reutilizar el controlador interno. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Envía una solicitud HTTP como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de la solicitud HTTP que se va a enviar. + Token de cancelación para cancelar la operación. + El valor de era null. + + + Una clase auxiliar para recuperar y comparar métodos HTTP estándar y para crear nuevos métodos HTTP. + + + Inicializa una instancia nueva de la clase con un método HTTP específico. + Método HTTP. + + + Representa un método de protocolo HTTP DELETE. + Devuelva . + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Método HTTP que se va a comparar con el objeto actual. + + + Determina si la estructura especificada es igual que la estructura actual. + Devuelva .true si el objeto especificado es igual al objeto actual; de lo contrario, false. + Objeto que se va a comparar con el objeto actual. + + + Representa un método de protocolo HTTP GET. + Devuelva . + + + Actúa como función hash para este tipo. + Devuelva .Código hash para el objeto actual. + + + Representa un método de protocolo HTTP HEAD.El método HEAD es idéntico a GET, excepto que el servidor sólo devuelve los encabezados de mensaje en la respuesta, sin el cuerpo del mensaje. + Devuelva . + + + Un método HTTP. + Devuelva .Un método HTTP representado como . + + + Operador de igualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados son iguales; en caso contrario, es false. + + izquierdo para un operador de igualdad. + + derecho para un operador de igualdad. + + + Operador de desigualdad para comparar dos objetos . + Devuelva .Es true si los parámetros y especificados no son iguales; en caso contrario, es false. + + izquierdo para un operador de desigualdad. + + derecho para un operador de desigualdad. + + + Representa un método de protocolo HTTP OPTIONS. + Devuelva . + + + Representa un método de protocolo POST HTTP, utilizado para enviar una entidad nueva como adición a un identificador URI. + Devuelva . + + + Representa un método de protocolo HTTP PUT, utilizado para reemplazar una entidad identificada por un identificador URI. + Devuelva . + + + Devuelve una cadena que representa el objeto actual. + Devuelva .Cadena que representa el objeto actual. + + + Representa un método de protocolo HTTP TRACE. + Devuelva . + + + Una clase base para las excepciones que producen las clases y . + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual. + Mensaje que describe la excepción actual. + + + Inicializa una nueva instancia de la clase con un mensaje específico que describe la excepción actual y una excepción interna. + Mensaje que describe la excepción actual. + Excepción interna. + + + Representa un mensaje de solicitud HTTP. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Cadena que representa el objeto de solicitud. + + + Inicializa una nueva instancia de la clase con un método HTTP y una solicitud . + Método HTTP. + Objeto que se va a solicitar. + + + Obtiene o establece el contenido del mensaje HTTP. + Devuelve .Contenido de un mensaje. + + + Libera los recursos no administrados y desecha los recursos administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Obtiene la colección de encabezados de la solicitud HTTP. + Devuelve .Colección de encabezados de la solicitud HTTP. + + + Obtiene o establece el método HTTP usado por el mensaje de solicitud HTTP. + Devuelve .Método HTTP usado por el mensaje de solicitud.El valor predeterminado es el método GET. + + + Obtiene un conjunto de propiedades de la solicitud HTTP. + Devuelve . + + + Obtiene o establece el usado para la solicitud HTTP. + Devuelve . que se usa para la solicitud HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Representa un mensaje de respuesta HTTP incluido el código de estado y los datos. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una instancia nueva de la clase con un específico. + Código de estado de la respuesta HTTP. + + + Obtiene o establece el contenido de texto de un mensaje de respuesta HTTP. + Devuelve .Contenido del mensaje de respuesta HTTP. + + + Libera los recursos no administrados y desecha los recursos no administrados que usa . + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Se produce una excepción si la propiedad para la respuesta HTTP es false. + Devuelve .Mensaje de respuesta HTTP si la llamada es correcta. + + + Obtiene la colección de encabezados de respuesta HTTP. + Devuelve .Colección de encabezados de respuesta HTTP. + + + Obtiene un valor que indica si la respuesta HTTP se realizó correctamente. + Devuelve .Un valor que indica si la respuesta HTTP se realizó correctamente.true si estaba en el intervalo 200-299; si no false. + + + Obtiene o establece la frase de razón que envían normalmente los servidores junto con el código de estado. + Devuelve .La frase de la razón enviada por el servidor. + + + Obtiene o establece el mensaje de solicitud que condujo a este mensaje de respuesta. + Devuelve .El mensaje de solicitud que condujo a este mensaje de respuesta. + + + Obtiene o establece el código de estado de la respuesta HTTP. + Devuelve .Código de estado de la respuesta HTTP. + + + Devuelve una cadena que representa el objeto actual. + Devuelve .Representación en forma de cadena del objeto actual. + + + Obtiene o establece la versión de mensaje HTTP. + Devuelve .Versión de mensaje HTTP.El valor predeterminado es 1.1. + + + Un tipo base para los controladores que solo realizan un pequeño procesamiento de mensajes de solicitud y/o de respuesta. + + + Cree una instancia de una clase . + + + Crea una instancia de una clase con un controlador interno concreto. + Controlador interno que es responsable de procesar los mensajes de respuesta HTTP. + + + Realiza el procesamiento en cada solicitud enviada al servidor. + Devuelve .Mensaje de solicitud HTTP que se procesó. + Mensaje de la solicitud HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Realiza el procesamiento en cada respuesta del servidor. + Devuelve .Mensaje de respuesta HTTP que se procesó. + Mensaje de respuesta HTTP que se va a procesar. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + + + Envía una solicitud HTTP al controlador interno para enviar al servidor como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Mensaje de solicitud HTTP para enviar al servidor. + Token de cancelación que pueden usar otros objetos o subprocesos para recibir el aviso de cancelación. + El valor de era null. + + + Proporciona una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + + era null o solo contiene caracteres de espacios en blanco. + + + Crea una nueva instancia de la clase . + Subtipo del contenido con varias partes. + La cadena delimitadora para el contenido con varias partes. + + era null o una cadena vacía. era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agregue contenido con varias partes HTTP a una colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Devuelve un enumerador que recorre en iteración la colección de objetos que se serializan mediante la especificación de tipo de contenido multipart/*. + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Serialice el contenido HTTP con varias partes en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Implementación explícita del método . + Devuelve .Objeto que puede usarse para recorrer en iteración la colección. + + + Determina si el contenido HTTP con varias partes tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bites del contenido HTTP. + + + Proporciona un contenedor para contenido codificado mediante el tipo MIME multipart/form-data. + + + Crea una nueva instancia de la clase . + + + Crea una nueva instancia de la clase . + La cadena delimitadora para el contenido de los datos de formulario con varias partes. + + era null o solo contiene caracteres de espacios en blanco.O bien termina con un carácter de espacio. + La longitud de fue mayor que 70. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + + era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Agrega contenido HTTP a una colección de objetos que se serializan al tipo MIME multipart/form-data. + Contenido HTTP que se agregará a la colección. + Nombre para el contenido HTTP que se va a agregar. + Nombre del archivo para el contenido HTTP se va a agregar a la colección. + + era null o solo contiene caracteres de espacios en blanco.O bien era null o solo contiene caracteres de espacios en blanco. + El valor de era null. + + + Proporciona contenido HTTP basado en una secuencia. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Tamaño del búfer, en bytes, para . + El valor de era null. + + era menor o igual que cero. + + + Escribe el contenido de una secuencia HTTP en una secuencia de memoria como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + + + Libera los recursos no administrados que usa el objeto y, de forma opcional, desecha los recursos administrados. + Es true para liberar los recursos administrados y no administrados; es false para liberar sólo los recursos no administrados. + + + Serialice el contenido HTTP en una secuencia como una operación asincrónica. + Devuelve .Objeto de tarea que representa la operación asincrónica. + Secuencia de destino. + Información sobre el transporte (token de enlace de canal, por ejemplo).Este parámetro puede ser null. + + + Determina si el contenido de la secuencia tiene una longitud válida en bytes. + Devuelve .true si es un longitud válida; de lo contrario, false. + Longitud en bytes del contenido de la secuencia. + + + Proporciona contenido HTTP basado en una cadena. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + + + Crea una nueva instancia de la clase . + Contenido usado para inicializar . + Codificación que se va a usar para el contenido. + Tipo de medio que se va a utilizar para el contenido. + + + Representa la información de autenticación en los valores de los encabezados Authorization, ProxyAuthorization, WWW-Authenticate y Proxy-Authenticate. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + + + Inicializa una nueva instancia de la clase . + El esquema que se va a usar para la autorización. + Credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene las credenciales que contienen la información de autenticación del agente de usuario para el recurso que se está solicitando. + Devuelve .Credenciales que contienen la información de autenticación. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene el esquema que se va a usar para la autorización. + Devuelve .El esquema que se va a usar para la autorización. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Cache-Control. + + + Inicializa una nueva instancia de la clase . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Tokens de extensión de caché, cada uno con un valor asignado opcional. + Devuelve .Colección de tokens de la extensión de memoria caché, cada uno con un valor asignado opcional. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Edad máxima, especificada en segundos, que el cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta que ha superado la fecha de expiración; si no, false. + + + Tiempo máximo, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta que ha superado el período de expiración. + Devuelve .Tiempo en segundos. + + + Duración de la actualización, en segundos, que un cliente HTTP está dispuesto a aceptar una respuesta. + Devuelve .Tiempo en segundos. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta; si no, false. + + + Si un cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché. + Devuelve .true si el cliente HTTP está dispuesto a aceptar una respuesta almacenada en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “no-cache” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta. + Devuelve .true si una memoria caché no debe almacenar ninguna parte del mensaje de solicitud HTTP o ninguna respuesta; si no, false. + + + Si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad. + Devuelve .true si una memoria caché o un proxy no debe cambiar ningún aspecto del cuerpo de entidad; si no, false. + + + Si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace). + Devuelve .true si una memoria caché debe responder con una entrada almacenada en memoria caché que sea coherente con las demás restricciones de la solicitud HTTP o responder con un estado 504 (tiempo de espera de la puerta de enlace); si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información no válida del valor de encabezado cache-control. + + es una referencia null. + + no es información válida del valor del encabezado de control de caché. + + + Si todo o parte del mensaje de respuesta HTTP está diseñado para un único usuario y no se debe almacenar en una memoria caché compartida. + Devuelve .true si el mensaje de respuesta HTTP está pensado para un único usuario y una memoria caché compartida no lo debe almacenar en memoria caché; si no, false. + + + Nombres de campo de una colección en la directiva “privada” de un campo de encabezado de la caché de controles en una respuesta HTTP. + Devuelve .Colección de fieldnames. + + + Si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada de caché se vuelva obsoleta para memorias caché compartidas de agente de usuario. + Devuelve .true si el servidor de origen necesita volver a validar una entrada de caché en cualquier uso posterior cuando la entrada se vuelva obsoleta para memorias caché compartidas de agente de usuario; si no, false. + + + Si cualquier memoria caché puede almacenar una respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida. + Devuelve .true si cualquier memoria caché puede almacenar la respuesta HTTP en memoria caché, aunque sería normalmente no almacenable en caché o almacenable solo dentro de la caché no compartida; si no, false. + + + La edad máxima compartida, especificada en segundos, en una respuesta HTTP que reemplaza la directiva de "max-age" en un encabezado cache-control o un encabezado Expires para una memoria caché compartida. + Devuelve .Tiempo en segundos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Disposition. + + + Inicializa una nueva instancia de la clase . + + . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Fecha y hora de creación del archivo. + Devuelve .Fecha de creación del archivo. + + + Tipo de disposición para una parte del cuerpo de contenido. + Devuelve .Tipo de disposición. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sugerencia sobre cómo crear un nombre de archivo para almacenar la carga del mensaje que se usará si la entidad se desasocia y se almacena un en archivo independiente. + Devuelve .Nombre de archivo sugerido. + + + Sugerencia sobre cómo crear un nombres de archivo para almacenar cargas de mensajes que se usará si las entidades se desasocian y se almacenan en un archivo independiente. + Devuelve .Nombre de archivo sugerido de filename* del formulario. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Fecha y hora de la última modificación del archivo. + Devuelve .Fecha de modificación del archivo. + + + Nombre de una parte del cuerpo de contenido. + Devuelve .Nombre de la parte del cuerpo de contenido. + + + Conjunto de parámetros incluidos el encabezado de Content-Disposition. + Devuelve .Colección de parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de disposición del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de disponibilidad de contenido. + + + Fecha en que se leyó el archivo por última vez. + Devuelve .Última fecha de lectura. + + + Tamaño aproximado del archivo en bytes. + Devuelve .Tamaño aproximado en bytes. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor del encabezado Content-Range. + + + Inicializa una nueva instancia de la clase . + Punto inicial o final del intervalo, en bytes. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + + + Inicializa una nueva instancia de la clase . + Posición, en bytes, en la que se va a empezar a enviar datos. + Posición, en bytes, en la que se va a terminar de enviar datos. + Punto inicial o final del intervalo, en bytes. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición, en bytes, en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si el encabezado de Content-Range tiene una longitud especificada. + Devuelve .true si Content-Range tiene una longitud especificada; si no, false. + + + Obtiene si el Content-Range tiene un intervalo especificado. + Devuelve .true si Content-Range tiene un intervalo especificado; si no, false. + + + Obtiene la longitud del cuerpo de entidad completo. + Devuelve .La longitud del cuerpo de entidad completo. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de intervalo del contenido. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo del contenido. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Las unidades de intervalo usadas. + Devuelve . que contiene unidades de intervalo. + + + Representa un valor de encabezado de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + + + Inicializa una nueva instancia de la clase . + Cadena que contiene . + Un valor que indica si este encabezado de la etiqueta de entidad es un validador débil.Si el encabezado de la etiqueta de entidad es un validador débil, debe establecerse en true.Si el encabezado de la etiqueta de entidad es un validador seguro, debe establecerse en false. + + + Obtiene el valor del encabezado de la etiqueta de entidad. + Devuelve . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene si la etiqueta de entidad es precedida por un indicador de punto débil. + Devuelve .true si la etiqueta de entidad va precedida por un indicador de punto débil; si no, false. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la etiqueta de entidad. + + es una referencia null. + + no es información válida del valor del encabezado de la etiqueta de entidad. + + + Obtiene la cadena entre comillas opaca. + Devuelve .Una cadena entrecomillada opaca. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa la colección de encabezados de contenido tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado de contenido Allow en una respuesta HTTP. + Devuelve .Valor del encabezado Allow en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Disposition en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Encoding en una respuesta HTTP. + + + Obtiene el valor del encabezado de contenido Content-Language en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Language en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Length en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Length en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Location en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Location en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-MD5 en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Range en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Range en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Content-Type en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Content-Type en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Expires en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Expires en una respuesta HTTP. + + + Obtiene o establece el valor del encabezado de contenido Last-Modified en una respuesta HTTP. + Devuelve .Valor del encabezado de contenido Last-Modified en una respuesta HTTP. + + + Colección de encabezados y sus valores como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + + + Agrega el encabezado especificado y sus valores en la colección . + Encabezado que se agrega a la colección. + Lista de valores de encabezado que se agregan a la colección. + + + Agrega el encabezado especificado y su valor en la colección . + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Quita todos los encabezados de la colección de . + + + Devuelve si un encabezado concreto existe en la colección de . + Devuelve .true si el encabezado especificado existe en la colección; en caso contrario, false. + El encabezado específico. + + + Devuelve un enumerador que puede recorrer en iteración la instancia de . + Devuelve .Enumerador para . + + + Devuelve todos los valores de un encabezado especificado almacenado en la colección de . + Devuelve .Matriz de cadenas de encabezado. + El encabezado especificado para el que se van a devolver valores. + + + Quita el encabezado especificado de la colección de . + Devuelve . + Nombre del encabezado que se quitará de la colección. + + + Obtiene un enumerador que puede recorrer en iteración un objeto . + Devuelve .Una instancia de una implementación de que puede recorrer en iteración un objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Devuelve un valor que indica si el encabezado especificado y sus valores se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Valores del encabezado. + + + Devuelve un valor que indica si el encabezado especificado y su valor se agregaron a la colección sin validar la información proporcionada. + Devuelve .true si se pudo agregar el encabezado especificado y a la colección; de lo contrario, es false. + Encabezado que se agrega a la colección. + Contenido del encabezado. + + + Se devuelve si un encabezado y determinados valores especificados se almacenan en la colección . + Devuelve .true es el de encabezado especificado y values se almacenan en la colección; si no false. + Encabezado especificado. + Valores de encabezado especificados. + + + Representa una colección de valores de encabezado. + Tipo de colección de encabezado. + + + Agrega una entrada al objeto . + Elemento que se agrega al encabezado especificada. + + + Quita todas las entradas de . + + + Determina si contiene un elemento. + Devuelve .true si la entrada está contenida en la instancia ; en caso contrario, false + Elemento para encontrar el encabezado especificada. + + + Copia la totalidad de en una matriz unidimensional compatible, comenzando en el índice especificado de la matriz de destino. + + unidimensional que constituye el destino de los elementos copiados de . debe tener una indización de base cero. + Índice de base cero de en el que empieza la operación de copia. + + + Obtiene el número de encabezados de la colección . + Devuelve .Número de encabezados de una colección. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Obtiene un valor que indica si la instancia de es de solo lectura. + Devuelve .true si la instancia de es de sólo lectura; en caso contrario, false. + + + Analiza y agrega una entrada a . + Entrada que se va a agregar. + + + Quita el elemento especificado de . + Devuelve .true si se ha quitado de la instancia ; en caso contrario, false. + Elemento que se va a quitar. + + + Devuelve un enumerador que recorre en iteración la colección . + Devuelve .Enumerador para la instancia . + + + Devuelve una cadena que representa el objeto actual . + Devuelve .Cadena que representa el objeto actual. + + + Determina si la entrada se puede analizar y agregar a . + Devuelve .true si se puede analizar y agregar a la instancia ; de lo contrario, false + Entrada que se va a validar. + + + Representa la colección de encabezados de solicitud tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept para una solicitud HTTP. + Devuelve .Valor del encabezado Accept para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Charset para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Charset para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Encoding para una solicitud HTTP. + + + Obtiene el valor del encabezado Accept-Language para una solicitud HTTP. + Devuelve .Valor del encabezado Accept-Language para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una solicitud HTTP. + Devuelve .Valor del encabezado Cache-Control para una solicitud HTTP. + + + Obtiene el valor del encabezado Connection para una solicitud HTTP. + Devuelve .Valor del encabezado Connection para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una solicitud HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una solicitud HTTP. + Devuelve .Valor del encabezado Date para una solicitud HTTP. + + + Obtiene el valor del encabezado Expect para una solicitud HTTP. + Devuelve .Valor del encabezado Expect para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Expect para una solicitud HTTP contiene Continuar. + Devuelve .true si el encabezado Expect contiene Continue, si no false. + + + Obtiene o establece el valor del encabezado From para una solicitud HTTP. + Devuelve .Valor del encabezado From para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Host para una solicitud HTTP. + Devuelve .Valor del encabezado Host para una solicitud HTTP. + + + Obtiene el valor del encabezado If-Match para una solicitud HTTP. + Devuelve .Valor del encabezado If-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Modified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Modified-Since para una solicitud HTTP. + + + Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + Devuelve .Obtiene el valor del encabezado If-None-Match para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Range para una solicitud HTTP. + Devuelve .Valor del encabezado If-Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado If-Unmodified-Since para una solicitud HTTP. + Devuelve .Valor del encabezado If-Unmodified-Since para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Max-Forwards para una solicitud HTTP. + Devuelve .Valor del encabezado Max-Forwards para una solicitud HTTP. + + + Obtiene el valor del encabezado Pragma para una solicitud HTTP. + Devuelve .Valor del encabezado Pragma para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Proxy-Authorization para una solicitud HTTP. + Devuelve .Valor del encabezado Proxy-Authorization para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Range para una solicitud HTTP. + Devuelve .Valor del encabezado Range para una solicitud HTTP. + + + Obtiene o establece el valor del encabezado Referer para una solicitud HTTP. + Devuelve .Valor del encabezado Referer para una solicitud HTTP. + + + Obtiene el valor del encabezado TE para una solicitud HTTP. + Devuelve .Valor del encabezado TE para una solicitud HTTP. + + + Obtiene el valor del encabezado Trailer para una solicitud HTTP. + Devuelve .Valor del encabezado Trailer para una solicitud HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una solicitud HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una solicitud HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una solicitud HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una solicitud HTTP. + Devuelve .Valor del encabezado Upgrade para una solicitud HTTP. + + + Obtiene el valor del encabezado User-Agent para una solicitud HTTP. + Devuelve .Valor del encabezado User-Agent para una solicitud HTTP. + + + Obtiene el valor del encabezado Via para una solicitud HTTP. + Devuelve .Valor del encabezado Via para una solicitud HTTP. + + + Obtiene el valor del encabezado Warning para una solicitud HTTP. + Devuelve .Valor del encabezado Warning para una solicitud HTTP. + + + Representa la colección de encabezados de respuesta tal y como se define en RFC 2616. + + + Obtiene el valor del encabezado Accept-Ranges para una respuesta HTTP. + Devuelve .Valor del encabezado Accept-Ranges para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Age para una respuesta HTTP. + Devuelve .Valor del encabezado Age para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Cache-Control para una respuesta HTTP. + Devuelve .Valor del encabezado Cache-Control para una respuesta HTTP. + + + Obtiene el valor del encabezado Connection para una respuesta HTTP. + Devuelve .Valor del encabezado Connection para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Connection para una respuesta HTTP contiene Cerrar. + Devuelve .true si el encabezado Connection contiene Close; si no, false. + + + Obtiene o establece el valor del encabezado Date para una respuesta HTTP. + Devuelve .Valor del encabezado Date para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado ETag para una respuesta HTTP. + Devuelve .Valor del encabezado ETag para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Location para una respuesta HTTP. + Devuelve .Valor del encabezado Location para una respuesta HTTP. + + + Obtiene el valor del encabezado Pragma para una respuesta HTTP. + Devuelve .Valor del encabezado Pragma para una respuesta HTTP. + + + Obtiene el valor del encabezado Proxy-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado Proxy-Authenticate para una respuesta HTTP. + + + Obtiene o establece el valor del encabezado Retry-After para una respuesta HTTP. + Devuelve .Valor del encabezado Retry-After para una respuesta HTTP. + + + Obtiene el valor del encabezado Server para una respuesta HTTP. + Devuelve .Valor del encabezado Server para una respuesta HTTP. + + + Obtiene el valor del encabezado Trailer para una respuesta HTTP. + Devuelve .Valor del encabezado Trailer para una respuesta HTTP. + + + Obtiene el valor del encabezado Transfer-Encoding para una respuesta HTTP. + Devuelve .Valor del encabezado Transfer-Encoding para una respuesta HTTP. + + + Obtiene o establece un valor que indica si el encabezado de Transfer-Encoding para una respuesta HTTP contiene Fragmentar. + Devuelve .true si el encabezado Transfer-Encoding contiene fragmentos, si no false. + + + Obtiene el valor del encabezado Upgrade para una respuesta HTTP. + Devuelve .Valor del encabezado Upgrade para una respuesta HTTP. + + + Obtiene el valor del encabezado Vary para una respuesta HTTP. + Devuelve .Valor del encabezado Vary para una respuesta HTTP. + + + Obtiene el valor del encabezado Via para una respuesta HTTP. + Devuelve .Valor del encabezado Via para una respuesta HTTP. + + + Obtiene el valor del encabezado Warning para una respuesta HTTP. + Devuelve .Valor del encabezado Warning para una respuesta HTTP. + + + Obtiene el valor del encabezado WWW-Authenticate para una respuesta HTTP. + Devuelve .Valor del encabezado WWW-Authenticate para una respuesta HTTP. + + + Representa un tipo de medio utilizado en un encabezado Content-Type como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El origen representado como una cadena para inicializar la nueva instancia. + + + Obtiene o define el juego de caracteres. + Devuelve .El juego de caracteres. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene o establece el valor de encabezado del tipo de medio. + Devuelve .El valor del encabezado media-type. + + + Obtiene o establece los parámetros del valor de encabezado del tipo de medio. + Devuelve .Los parámetros de valores de encabezado media-type. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del tipo de medio. + + es una referencia null. + + no es información válida del valor del encabezado del tipo de medio. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un tipo de medio con un factor de calidad adicional utilizado en un encabezado Content-Type. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un representado como una cadena para inicializar la nueva instancia. + La calidad asociada a este valor de encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el tipo de medios con la información de valor de encabezado de calidad. + + es una referencia null. + + es el tipo de medio no válido con información de valor de encabezado de calidad. + + + Obtiene o establece el valor de calidad de . + Devuelve .Valor de calidad del objeto . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un par de nombre y valor utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre de encabezado. + Devuelve .Nombre del encabezado. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del valor de nombre. + + es una referencia null. + + no es información válida del valor del encabezado del valor de nombre. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de encabezado. + Devuelve .Valor del encabezado. + + + Representa un par de nombre y valor con parámetros utilizado en diferentes encabezados como se define en RFC 2616. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + + + Inicializa una nueva instancia de la clase . + Nombre del encabezado. + Valor del encabezado. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros del objeto . + Devuelve .Una colección que contiene los parámetros. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa el valor de nombre con la información de valor de encabezado del parámetro. + + es una referencia null. + + es un valor de nombre no válido con información de valor de encabezado de parámetro. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de token de producto en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Nombre del producto. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene el nombre del token de producto. + Devuelve .Nombre del token de producto. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del producto. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la versión del token de producto. + Devuelve .Versión del token de producto. + + + Representa un valor que puede ser un producto o un comentario en un encabezado User-Agent. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Un valor de comentario. + + + Inicializa una nueva instancia de la clase . + El valor del nombre del producto. + El valor de la versión del producto. + + + Obtiene el comentario del objeto . + Devuelve .El valor de comentario . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la información del producto. + + es una referencia null. + + no es información válida del valor del encabezado de la información del producto. + + + Obtiene el producto del objeto . + Devuelve .El valor de producto de este . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado If-Range que puede ser de fecha y hora o de etiqueta de entidad. + + + Inicializa una nueva instancia de la clase . + Un valor de datos utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una etiqueta de entidad representada como cadena utilizada para inicializar la nueva instancia. + + + Obtiene la fecha del objeto . + Devuelve .La fecha del objeto . + + + Obtiene la etiqueta de entidad del objeto . + Devuelve .La etiqueta de entidad del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de intervalo. + + es una referencia null. + + no es información del valor del encabezado de la condición de intervalo. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + + + Inicializa una nueva instancia de la clase con un intervalo de bytes. + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado del intervalo. + + es una referencia null. + + no es información válida del valor del encabezado de intervalo. + + + Obtiene los intervalos especificados en el objeto . + Devuelve .Los intervalos del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene la unidad del objeto . + Devuelve .La unidad del objeto . + + + Representa un intervalo de bytes en un valor de encabezado Range. + + + Inicializa una nueva instancia de la clase . + Posición en la que se va a empezar a enviar datos. + Posición en la que se va a terminar de enviar datos. + + es mayor que O bien o es menor que 0. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Obtiene la posición en la que se va a empezar a enviar datos. + Devuelve .Posición en la que se va a empezar a enviar datos. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene la posición en la que se va a terminar de enviar datos. + Devuelve .Posición en la que se va a terminar de enviar datos. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Representa un valor de encabezado Retry-After que puede ser de fecha y hora o de duración. + + + Inicializa una nueva instancia de la clase . + Desplazamiento de fecha y hora utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + El delta, en segundos, utilizado para inicializar la nueva instancia. + + + Obtiene el desplazamiento de fecha y hora desde el objeto . + Devuelve .Desplazamiento de fecha y hora desde el objeto . + + + Obtiene el delta en segundos del objeto . + Devuelve .El delta en segundos del objeto . + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de la condición de reintento. + + es una referencia null. + + no es información válida del valor del encabezado de la condición de reintento. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de encabezado de cadena con una calidad opcional. + + + Inicializa una nueva instancia de la clase . + La cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un factor de calidad utilizado para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de calidad. + + es una referencia null. + + es una cadena no válida con información de encabezado de valor de encabezado de calidad. + + + Obtiene el factor de calidad del objeto . + Devuelve .EL factor de calidad del objeto . + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de cadena del objeto . + Devuelve .El valor de cadena del objeto . + + + Representa un valor de encabezado Accept-Encoding. + + + Inicializa una nueva instancia de la clase . + Objeto utilizado para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Determina si el objeto especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Obtiene los parámetros de codificación de transferencia. + Devuelve .Los parámetros de codificación de transferencia. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor del encabezado de codificación de transferencia. + + es una referencia null. + + no es información válida del valor del encabezado de codificación de transferencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Obtiene el valor de codificación de transferencia. + Devuelve .El valor de codificación de transferencia. + + + Representa un valor del encabezado Accept-Encoding con factor de calidad opcional. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + + + Inicializa una nueva instancia de la clase . + Una cadena utilizada para inicializar la nueva instancia. + Un valor para el factor de calidad. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa la información del valor de codificación de transferencia. + + es una referencia null. + + es una codificación de transferencia no válida con información de valor de encabezado de calidad. + + + Obtiene el factor de calidad de . + Devuelve .El factor de calidad de . + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa el valor de un encabezado Via. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + + + Inicializa una nueva instancia de la clase . + La versión de protocolo del protocolo recibido. + El host y el puerto donde se recibió la solicitud o la respuesta. + El nombre de protocolo del protocolo recibido. + El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Obtiene el campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + Devuelve .El campo de comentario usado para identificar el software de proxy o la puerta de enlace del destinatario. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Devuelve un código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve .Instancia de . + Cadena que representa a través de la información del valor del encabezado. + + es una referencia null. + + no es información válida a través de la información del valor del encabezado. + + + Obtiene el nombre de protocolo del protocolo recibido. + Devuelve .Nombre del protocolo. + + + Obtiene la versión de protocolo del protocolo recibido. + Devuelve .Versión de protocolo. + + + Obtiene el host y el puerto donde se recibió la solicitud o la respuesta. + Devuelve .El host y el puerto donde se recibió la solicitud o la respuesta. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + Representa un valor de advertencia utilizado por el encabezado Warning. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + + + Inicializa una nueva instancia de la clase . + El código de la advertencia específico. + El host que adjuntó la advertencia. + Una cadena entre comillas que contiene el texto de advertencia. + Marca de tiempo de la advertencia. + + + Obtiene el host que adjuntó la advertencia. + Devuelve .El host que adjuntó la advertencia. + + + Obtiene el código de la advertencia específico. + Devuelve .El código de la advertencia específico. + + + Obtiene la marca de tiempo de la advertencia. + Devuelve .Marca de tiempo de la advertencia. + + + Determina si el especificado es igual al objeto actual. + Devuelve .true si el especificado es igual al objeto actual; en caso contrario, es false. + Objeto que se va a comparar con el objeto actual. + + + Sirve como función hash de un objeto . + Devuelve .Código hash para el objeto actual. + + + Convierte una cadena en una instancia de . + Devuelve una instancia . + Cadena que representa la información del valor del encabezado de autenticación. + + es una referencia null. + + no es información válida del valor del encabezado de autenticación. + + + Obtiene una cadena entre comillas que contiene el texto de advertencia. + Devuelve .Una cadena entre comillas que contiene el texto de advertencia. + + + Devuelve una cadena que representa el actual objeto . + Devuelve .Cadena que representa el objeto actual. + + + Determina si una cadena es una información de válida. + Devuelve .true si es información de válida; de lo contrario, es false. + Cadena que se va a validar. + Versión de la cadena. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/fr/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/fr/a new file mode 100644 index 00000000000..95484975134 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/fr/a @@ -0,0 +1,2361 @@ + + + + System.Net.Http + + + + Fournit du contenu HTTP basé sur un tableau d'octets. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Le paramètre est null. + + + Initialise une nouvelle instance de la classe . + Contenu utilisé pour initialiser le . + Décalage, en octets, dans le paramètre utilisé pour initialiser . + Nombre d'octets dans le en commençant par le paramètre utilisé pour initialiser . + Le paramètre est null. + Le paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre.ouLe paramètre est inférieur à zéro.ouLe paramètre est supérieur à la longueur du contenu spécifié par le paramètre moins le paramètre . + + + Crée un flux de contenu HTTP en tant qu'opération asynchrone pour la lecture dont le magasin de stockage est lié au . + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise et écrit le tableau d'octets fourni dans le constructeur pour un flux de contenu HTTP sous forme d'une opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport, (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si un tableau d'octets a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur, en octets, du tableau d'octets. + + + Spécifie la façon dont les certificats clients sont fournis. + + + + tentera de fournir automatiquement tous les certificats client disponibles. + + + L'application fournit manuellement les certificats clients au .Cette valeur est celle par défaut. + + + Type pour les gestionnaires HTTP qui délèguent le traitement des messages de réponse HTTP à un autre gestionnaire, appelé le gestionnaire interne. + + + Crée une instance de la classe . + + + Crée une instance de la classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Libère les ressources non managées utilisées par et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le gestionnaire interne qui traite les messages de réponse HTTP. + retourne  ;Gestionnaire interne des messages de réponse HTTP. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ; Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation pour annuler une opération. + + était null. + + + Conteneur pour les tuples nom/valeur encodés en utilisant le type MIME application/x-www-form-urlencoded. + + + Initialise une nouvelle instance de la classe avec une collection de paires nom/valeur spécifique. + Collection de paires nom/valeur. + + + Fournit une classe de base pour envoyer des requêtes HTTP et recevoir des réponses HTTP d'une ressource identifiée par un URI. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + Pile du gestionnaire HTTP à utiliser pour envoyer des demandes. + + + Initialise une nouvelle instance de la classe avec un gestionnaire spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Obtient ou définit l'adresse de base de l'URI de la ressource Internet utilisée pour envoyer des demandes. + Retourne .Adresse de base de l'URI de la ressource Internet utilisée pour l'envoi des demandes. + + + Annulez toutes les demandes en attente sur cette instance. + + + Obtient les en-têtes qui doivent être envoyés avec chaque demande. + Retourne .En-têtes qui doivent être envoyés avec chaque demande. + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une demande DELETE à l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête DELETE à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne . + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + + était null. + + + Envoie une requête GET à l'URI spécifié avec une option d'achèvement HTTP et un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Valeur d'option d'achèvement HTTP qui indique quand l'opération doit être considérée comme terminée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de tableau d'octets dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de flux dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Envoie une requête GET à l'URI spécifié et retourne le corps de la réponse sous forme de chaîne dans une opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + + était null. + + + Obtient ou définit le nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse. + Retourne .Nombre maximal d'octets à mettre en mémoire tampon lors de la lecture du contenu de réponse.La valeur par défaut de cette propriété est 2 gigaoctets. + La taille spécifiée est inférieure ou égale à zéro. + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête POST vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoie une requête POST avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête PUT vers l'URI spécifié sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + + était null. + + + Envoyez une requête PUT avec un jeton d'annulation sous forme d'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + URI auquel la requête est envoyée. + Contenu de requête HTTP envoyé au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Moment auquel l'opération doit s'exécuter (dès qu'une réponse est disponible ou après avoir pris connaissance du contenu de réponse entier). + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Envoie une requête HTTP en tant qu'opération asynchrone. + Retourne .Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + Le message de demande a déjà été envoyé par l'instance . + + + Obtient ou définit la période d'attente jusqu'à l'expiration de la demande. + Retourne .Période d'attente jusqu'à l'expiration de la demande. + Le délai d'attente spécifié est inférieur ou égal à zéro et n'est pas . + Opération a déjà démarrée sur l'instance actuelle. + L'instance actuelle a été supprimée. + + + Gestionnaire de messages par défaut utilisé par . + + + Crée une instance d'une classe . + + + Obtient ou définit une valeur qui indique si le gestionnaire doit suivre les réponses de redirection. + retourne  ;true si le gestionnaire doit suivre les réponses de redirection ; sinon false.La valeur par défaut est true. + + + Obtient ou définit le type de méthode de décompression utilisé par le gestionnaire pour la décompression automatique de la réponse de contenu HTTP. + retourne  ;Méthode de décompression automatique utilisée par le gestionnaire.La valeur par défaut est . + + + Obtient ou définit la collection de certificats de sécurité qui sont associés à ce gestionnaire. + retourne  ;Collection de certificats de sécurité associés à ce gestionnaire. + + + Obtient ou définit le conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + retourne  ;Conteneur de cookies utilisé par le gestionnaire pour stocker des cookies de serveur. + + + Obtient ou définit les informations d'authentification utilisées par ce gestionnaire. + retourne  ;Informations d'authentification associées au gestionnaire.La valeur par défaut est null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient ou définit le nombre maximal de redirections suivies par le gestionnaire. + retourne  ;Nombre maximal de réponses de redirection suivies par le gestionnaire.La valeur par défaut est 50. + + + Obtient ou définit la taille maximale de mémoire tampon de contenu demandée utilisée par le gestionnaire. + retourne  ;Taille maximale de mémoire tampon de contenu en octets.La valeur par défaut est 2 gigaoctets. + + + Obtient ou définit une valeur indiquant si le gestionnaire envoie un en-tête d'autorisation avec la requête. + retourne  ;true pour que le gestionnaire envoie un en-tête HTTP d'autorisation avec les requêtes une fois l'authentification exécutée ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit les informations de proxy utilisées par le gestionnaire. + retourne  ;Informations de proxy utilisées par le gestionnaire.La valeur par défaut est null. + + + Crée une instance de en fonction des informations fournies dans le en tant qu'opération qui ne se bloque pas. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP. + Jeton d'annulation pour annuler l'opération. + + était null. + + + Obtient une valeur qui indique si le gestionnaire prend en charge la décompression de contenu de réponse automatique. + retourne  ;true si le gestionnaire prend en charge la décompression de contenu de réponse automatique ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres du proxy. + retourne  ;true si le gestionnaire prend en charge les paramètres de proxy ; sinon false.La valeur par défaut est true. + + + Obtient une valeur qui indique si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et . + retourne  ;true si le gestionnaire prend en charge les paramètres de configuration pour les propriétés et  ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise la propriété pour stocker des cookies de serveur et utilise ces cookies en envoyant les demandes. + retourne  ;true si le gestionnaire utilise la propriété pour stocker des cookies de serveur, et utilise ces cookies lors de l'envoi de requêtes ; sinon false.La valeur par défaut est true. + + + Obtient ou définit une valeur qui contrôle si les informations d'identification par défaut sont envoyées avec les requêtes par le gestionnaire. + retourne  ;true si les informations d'identification par défaut sont utilisées ; sinon, false.La valeur par défaut est false. + + + Obtient ou définit une valeur qui indique si le gestionnaire utilise un proxy pour les demandes. + retourne  ;true si le gestionnaire utilise un proxy pour les demandes ; sinon false.La valeur par défaut est true. + + + Indique si les opérations doivent être considérées comme étant terminées dès qu'une réponse est disponible, ou après avoir pris connaissance de l'intégralité du message de réponse intégrant le contenu. + + + L'opération doit se terminer après la lecture de l'intégralité de la réponse intégrant le contenu. + + + L'opération doit se terminer dès qu'une réponse est disponible et que les en-têtes sont lus.Le contenu n'est pas encore lu. + + + Classe de base représentant un corps d'entité HTTP et les en-têtes de contenu. + + + Initialise une nouvelle instance de la classe . + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + + + Sérialise le contenu HTTP dans un flux d'octets et le copie dans l'objet de flux fourni en tant que paramètre . + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Sérialise le contenu HTTP dans un flux de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient les en-têtes de contenu HTTP, tels que définis dans la norme RFC 2616. + retourne  ;En-têtes de contenu, tels que définis dans RFC 2616. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un tampon de mémoire en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Taille maximale, en octets, de la mémoire tampon à utiliser. + + + Sérialise le contenu HTTP dans un tableau d'octets sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP et retourne un flux qui représente le contenu comme une opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans une chaîne sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Type de base pour les gestionnaires de message HTTP. + + + Initialise une nouvelle instance de la classe . + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe spécialisée qui permet aux applications d'appeler la méthode sur une chaîne de gestionnaire HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + + + Initialise une nouvelle instance d'une classe avec un spécifique. + + chargé de traiter les messages de réponse HTTP. + true si le gestionnaire interne doit être supprimé à l'aide de Dispose(),false si vous prévoyez de réutiliser le gestionnaire interne. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Envoie une requête HTTP en tant qu'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de la requête HTTP à envoyer. + Jeton d'annulation pour annuler une opération. + + était null. + + + Classe d'assistance pour récupérer et comparer les méthodes HTTP standard et pour créer de nouvelles méthodes HTTP. + + + Initialise une nouvelle instance de la classe avec une méthode HTTP spécifique. + Méthode HTTP. + + + Représente une méthode de protocole HTTP DELETE. + retourne  ; + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Méthode HTTP à comparer à l'objet actif. + + + Détermine si le spécifié est égal au actuel. + retourne  ;true si l'objet spécifié est égal à l'objet actuel ; sinon, false. + Objet à comparer avec l'objet actif. + + + Représente une méthode de protocole HTTP GET. + retourne  ; + + + Sert de fonction de hachage pour ce type. + retourne  ;Code de hachage du en cours. + + + Représente une méthode de protocole HTTP HEAD.La méthode HEAD est identique à GET, mais le serveur retourne uniquement des en-têtes de message dans la réponse, sans corps du message. + retourne  ; + + + Méthode HTTP. + retourne  ;Méthode HTTP représentée en tant que . + + + Opérateur d'égalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et sont égaux ; sinon, false. + + gauche d'un opérateur d'égalité. + + droit pour un opérateur d'égalité. + + + Opérateur d'inégalité pour la comparaison de deux objets . + retourne  ;true si les paramètres et ne sont pas égaux ; sinon, false. + + gauche d'un opérateur d'inégalité. + + droit pour un opérateur d'inégalité. + + + Représente une méthode de protocole HTTP OPTIONS. + retourne  ; + + + Représente une méthode de protocole HTTP POST utilisée pour publier une nouvelle entité en plus d'un URI. + retourne  ; + + + Représente une méthode de protocole HTTP PUT utilisée pour remplacer une entité identifiée par un URI. + retourne  ; + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une méthode de protocole HTTP TRACE. + retourne  ; + + + Classe de base pour les exceptions levées par les classes et . + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un message spécifique qui décrit l'exception actuelle. + Message qui décrit l'exception en cours. + + + Initialise une nouvelle instance de la classe avec un message spécifique décrivant l'exception actuelle et une exception interne. + Message qui décrit l'exception en cours. + Exception interne. + + + Représente un message de requête HTTP. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + Chaîne qui représente la requête . + + + Initialise une nouvelle instance de la classe avec une méthode HTTP et une requête . + Méthode HTTP. + + à demander. + + + Obtient ou définit le contenu du message HTTP. + retourne  ;Contenu d'un message. + + + Libère les ressources non managées et supprime les ressources managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Obtient la collection d'en-têtes de requête HTTP. + retourne  ;Collection d'en-têtes de demande HTTP. + + + Obtient ou définit la méthode HTTP utilisée par le message de requête HTTP. + retourne  ;Méthode HTTP utilisée par le message de requête.La valeur par défaut est la méthode GET. + + + Obtient un ensemble de propriétés pour la requête HTTP. + retourne  ; + + + Obtient ou définit l' utilisé pour la requête HTTP. + retourne  ; utilisé pour la requête HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Représente un message de réponse HTTP avec le code et les données d'état. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec un spécifique. + Code d'état de la réponse HTTP. + + + Obtient ou définit le contenu d'un message de réponse HTTP. + retourne  ;Contenu du message de réponse HTTP. + + + Libère les ressources non managées et supprime les ressources non managées utilisées par le . + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Lève une exception si la propriété de la réponse HTTP est false. + retourne  ;Message de réponse HTTP si l'appel a réussi. + + + Obtient la collection d'en-têtes de réponse HTTP. + retourne  ;Collection d'en-têtes de réponse HTTP. + + + Obtient une valeur qui indique si la réponse HTTP a abouti. + retourne  ;Valeur qui indique si la réponse HTTP a abouti.true si était compris entre 200 et 299 ; sinon false. + + + Obtient ou définit l'expression de raison qui en général est envoyée par les serveurs avec le code d'état. + retourne  ;Expression de raison envoyée par le serveur. + + + Obtient ou définit le message de demande qui a conduit à ce message de réponse. + retourne  ;Message de requête qui a conduit à ce message de réponse. + + + Obtient ou définit le code d'état de la réponse HTTP. + retourne  ;Code d'état de la réponse HTTP. + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Représentation sous forme de chaîne de l'objet en cours. + + + Obtient ou définit la version de messages HTTP. + retourne  ;Version du message HTTP.La valeur par défaut est 1.1. + + + Type de base pour les gestionnaires qui traitent uniquement des messages de demande et/ou de réponse. + + + Crée une instance d'une classe . + + + Crée une instance d'une classe avec un gestionnaire interne spécifique. + Gestionnaire interne chargé de traiter les messages de réponse HTTP. + + + Exécute le traitement sur chaque demande envoyée au serveur. + retourne  ;Message de requête HTTP qui a été traité. + Message de la requête HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Exécute le traitement sur chaque réponse du serveur. + retourne  ;Message de réponse HTTP qui a été traité. + Message de réponse HTTP à traiter. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + + Envoie une requête HTTP au gestionnaire interne à envoyer au serveur sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Message de requête HTTP à envoyer au serveur. + Jeton d'annulation qui peut être utilisé par d'autres objets ou threads pour être informés de l'annulation. + + était null. + + + Fournit une collection d'objets qui sont sérialisés à l'aide de la spécification de type de contenu multipart/*. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + La a la valeur null ou ne contient que des espaces blancs. + + + Crée une instance de la classe . + Sous-type du contenu Multipart. + Chaîne limite pour le contenu Multipart. + Le était null ou était une chaîne vide.La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu multipart HTTP à une collection d'objets de qui sont sérialisés à l'aide de la spécification de type de contenu multipart/* + Contenu HTTP à ajouter à la collection. + + était null. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Retourne un énumérateur qui itère dans la collection d'objets qui sont sérialisés à l'aide de la spécification du type de contenu multipart/*. + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Sérialise le contenu multipart HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Implémentation explicite de la méthode . + retourne  ;Objet qui peut être utilisé pour itérer au sein de la collection. + + + Détermine si le contenu multipart HTTP a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du contenu HTTP. + + + Fournit un conteneur pour le contenu encodé à l'aide du type MIME multipart/form-data. + + + Crée une instance de la classe . + + + Crée une instance de la classe . + Chaîne limite pour le contenu multipart/form-data. + La a la valeur null ou ne contient que des espaces blancs.ou se termine par un espace. + La longueur de la est supérieure à 70. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + La a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Ajoute le contenu HTTP à une collection d'objets qui sont sérialisés au type MIME multipart/form-data. + Contenu HTTP à ajouter à la collection. + Nom du contenu HTTP à ajouter. + Nom de fichier du contenu HTTP à ajouter à la collection. + La a la valeur null ou ne contient que des espaces blancs.ouLa a la valeur null ou ne contient que des espaces blancs. + + était null. + + + Fournit du contenu HTTP basé sur un flux. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Taille, en octets, de la mémoire tampon disponible pour . + + était null. + + était inférieur ou égal à zéro. + + + Écrit le contenu de flux HTTP dans un flux de mémoire sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + + + Libère les ressources non managées utilisées par le et supprime éventuellement les ressources managées. + true pour libérer les ressources managées et non managées ; false pour libérer uniquement les ressources non managées. + + + Sérialise le contenu HTTP dans un flux sous forme d'opération asynchrone. + retourne  ;Objet de tâche représentant l'opération asynchrone. + Flux cible. + Informations sur le transport (jeton de liaison de canal, par exemple).Ce paramètre peut être null. + + + Détermine si le contenu de flux a une longueur valide en octets. + retourne  ;true si l'élément correspond à une longueur valide, sinon false. + Longueur en octets du flux de contenu. + + + Fournit du contenu HTTP basé sur une chaîne. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + + + Crée une instance de la classe . + Contenu utilisé pour initialiser le . + Encodage à utiliser pour le contenu. + Type de média à utiliser pour le contenu. + + + Représente les informations d'identification dans les valeurs d'en-tête Authorization, ProxyAuthorization, WWW-Authenticate et Proxy-Authenticate. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + + + Initialise une nouvelle instance de la classe . + Schéma à utiliser pour l'autorisation. + Informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les informations d'identification contenant les informations d'authentification de l'agent utilisateur pour la ressource demandée. + retourne  ;Informations d'authentification contenant les informations d'authentification. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient le schéma à utiliser pour l'autorisation. + retourne  ;Schéma à utiliser pour l'autorisation. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Cache-Control. + + + Initialise une nouvelle instance de la classe . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Jetons d'extension en cache ayant chacun une valeur assignée facultative. + retourne  ;Collection de jetons d'extension en cache ayant chacun une valeur assignée facultative. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Durée maximale, exprimée en secondes, pendant laquelle le client HTTP est prêt à accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;true si le client HTTP est prêt à accepter une réponse ayant dépassé le délai d'attente ; sinon, false. + + + Durée maximale, en secondes, pendant laquelle un client HTTP est prêt à accepter une réponse qui a dépassé son délai d'attente. + retourne  ;Durée en secondes. + + + Durée de vie d'actualisation, en secondes, pendant laquelle un client HTTP peut accepter une réponse. + retourne  ;Durée en secondes. + + + Indique si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée. + retourne  ;true si le serveur d'origine nécessite une nouvelle validation d'une entrée de cache lorsque cette dernière devient périmée ; sinon, false. + + + Indique si un client HTTP est prêt à accepter une réponse mise en cache. + retourne  ;true si le client HTTP est prêt à accepter une réponse mise en cache ; sinon, false. + + + Collection de fieldname dans la directive "no-cache" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si un cache ne doit stocker aucune partie du message de requête HTTP ou aucune réponse. + retourne  ;true si un cache ne doit stocker aucune partie du message de requête HTTP ou d'une réponse ; sinon, false. + + + Indique si un cache ou un proxy ne doit modifier aucun aspect du corps d'entité. + retourne  ;true si un cache ou un proxy ne doivent modifier aucun aspect du corps d'entité ; sinon, false. + + + Indique si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle). + retourne  ;true si un cache doit répondre à l'aide d'une entrée mise en cache cohérente par rapport aux autres contraintes de la requête HTTP, ou s'il doit répondre à un état 504 (Dépassement du délai de la passerelle) ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de contrôle de cache. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de contrôle de cache valides. + + + Indique si l'ensemble ou une partie du message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé. + retourne  ;true si le message de réponse HTTP est destiné à un seul utilisateur et ne doit pas être mis en cache par un cache partagé ; sinon, false. + + + FieldNames de collection dans la directive "privée" dans un champ d'en-tête Cache-Control sur une réponse HTTP. + retourne  ;Collection de fieldnames. + + + Indique si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée de cache est périmée pour les caches d'agent utilisateur partagés. + retourne  ;true si le serveur d'origine nécessite la revalidation d'une entrée de cache lors d'une prochaine utilisation lorsque cette entrée est périmée pour les caches d'agent utilisateur partagés ; sinon, false. + + + Indique si une réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé. + retourne  ;true si la réponse HTTP peut être mise en cache par n'importe quel cache, même si elle ne peut d'habitude pas être mise en cache ou si elle peut l'être, mais uniquement si le cache n'est pas partagé ; sinon, false. + + + Âge maximal partagé, en secondes, dans une réponse HTTP qui substitue la directive « max-age » dans un en-tête de contrôle du cache ou dans un en-tête Expires d'un cache partagé. + retourne  ;Durée en secondes. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Disposition. + + + Initialise une nouvelle instance de la classe . + + + + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Date de création du fichier. + retourne  ;Date de création du fichier. + + + Type de disposition d'un élément de corps de contenu. + retourne  ;Type de disposition. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Suggestion sur la façon dont construire un Filename pour stocker la charge de message à utiliser si l'entité est détachée et stockée dans un fichier séparé. + retourne  ;Filename suggéré. + + + Suggestion sur la façon dont construire des Filenames pour stocker des charges de messages à utiliser si les entités sont détachées et stockées dans des fichiers séparés. + retourne  ;Filename suggéré du nom de fichier* de formulaire. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Date de modification du fichier. + retourne  ;Date de modification du fichier. + + + Nom d'un élément de corps de contenu. + retourne  ;Nom de l'élément de corps du contenu. + + + Un jeu de paramètres a inclus l'en-tête de Content-Disposition. + retourne  ;Collection de paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de disposition de contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de disposition de contenu valides. + + + Date de la dernière lecture du fichier. + retourne  ;Date de la dernière lecture. + + + Taille approximative du fichier, en octets. + retourne  ;Taille approximative, en octets. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur de l'en-tête Content-Range. + + + Initialise une nouvelle instance de la classe . + Point de départ ou de fin de la plage, en octets. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + + + Initialise une nouvelle instance de la classe . + Position, en octets, à laquelle démarrer l'envoi de données. + Position, en octets, à laquelle arrêter l'envoi de données. + Point de départ ou de fin de la plage, en octets. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position, en octets, à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si une longueur est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la longueur de Content-Range est spécifiée ; sinon, false. + + + Obtient une valeur indiquant si une plage est spécifiée dans l'en-tête Content-Range. + retourne  ;true si la plage de Content-Range est spécifiée ; sinon, false. + + + Obtient la longueur du corps d'entité entier. + retourne  ;Longueur du corps d'entité entier. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage du contenu. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage de contenu valides. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Unités de plage utilisées. + retourne  ; qui contient des unités de plage. + + + Représente une valeur d'en-tête de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + + + Initialise une nouvelle instance de la classe . + Chaîne qui contient un . + Valeur qui indique si cet en-tête de balise d'entité est un validateur faible.Si l'en-tête de la balise d'entité est un validateur faible, doit avoir la valeur true.Si l'en-tête de la balise d'entité est un validateur fort, doit avoir la valeur false. + + + Obtient la valeur d'en-tête de la balise d'entité. + retourne  ; + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient une valeur indiquant si la balise d'entité est précédée d'un indicateur de faiblesse. + retourne  ;true si la balise d'entité est préfacée par un indicateur de faiblesse ; sinon, false. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de balise d'entité. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de balise d'entité valides. + + + Obtient la chaîne entre guillemets opaque. + retourne  ;Chaîne entre guillemets opaque. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la collection d'en-têtes de contenu comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête de contenu Allow sur une réponse HTTP. + retourne  ;Valeur de l'en-tête Allow sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Disposition sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Encoding sur une réponse HTTP. + + + Obtient la valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Language sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Length sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Location sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-MD5 sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Range sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Content-Type sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Expires sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Expires sur une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + retourne  ;Valeur de l'en-tête de contenu Last-Modified sur une réponse HTTP. + + + Collection d'en-têtes et de leurs valeurs tels que définis dans RFC 2616. + + + Initialise une nouvelle instance de la classe . + + + Ajoute l'en-tête spécifié et ses valeurs dans la collection de . + En-tête à ajouter à la collection. + Liste des valeurs d'en-tête à ajouter à la collection. + + + Ajoute l'en-tête spécifié et sa valeur dans la collection de . + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Supprime tous les en-têtes de la collection . + + + Retourne si un en-tête spécifique existe dans la collection . + retourne  ;true si l'en-tête spécifié existe dans la collection ; sinon false. + En-tête spécifique. + + + Retourne un énumérateur qui peut itérer au sein de l'instance de . + retourne  ;Énumérateur pour . + + + Retourne toutes les valeurs d'en-tête pour un en-tête spécifié stockées dans la collection . + retourne  ;Tableau de chaînes d'en-tête. + En-tête spécifié pour lequel retourner les valeurs. + + + Supprime l'en-tête spécifié de la collection . + retourne  ; + Nom de l'en-tête à supprimer de la collection. + + + Obtient un énumérateur pouvant itérer au sein de . + retourne  ;Instance d'une implémentation de pouvant itérer au sein de . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Retourne une valeur qui indique si l'en-tête spécifié et ses valeurs ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Valeur de l'en-tête. + + + Retourne une valeur qui indique si l'en-tête spécifié et sa valeur ont été ajoutés à la collection sans valider les informations fournies. + retourne  ;true si et de l'en-tête spécifié ont pu être ajoutés à la collection ; sinon, false. + En-tête à ajouter à la collection. + Contenu de l'en-tête. + + + Retourne si un en-tête spécifié et les valeurs spécifiées sont stockés dans la collection . + retourne  ;true signifie que les en-têtes spécifiés et values sont stockés dans la collection ; sinon false. + En-tête spécifié. + Valeurs des en-têtes spécifiées. + + + Représente une collection de valeurs d'en-tête. + Type de collection d'en-têtes. + + + Ajoute une entrée à . + Élément à ajouter à la collection d'en-têtes. + + + Supprime toutes les entrées de . + + + Détermine si le contient un élément. + retourne  ;true si l'entrée contient l'instance  ; sinon, false. + Élément à rechercher dans la collection d'en-têtes. + + + Copie l'ensemble de l'objet vers un objet unidimensionnel compatible, en commençant à l'index spécifié du tableau cible. + + unidimensionnel qui constitue la destination des éléments copiés à partir d'. doit avoir une indexation de base zéro. + Index de base zéro dans à partir duquel la copie commence. + + + Obtient le nombre d'en-têtes contenus dans . + retourne  ;Nombre d'en-têtes contenus dans une collection. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Obtient une valeur indiquant si l'instance est en lecture seule. + retourne  ;true si l'instance du est en lecture seule ; sinon, false. + + + Analyse et ajoute une entrée à . + Entrée à ajouter. + + + Enlève l'élément spécifié du . + retourne  ;true si a été correctement supprimé de l'instance  ; sinon, false. + Élément à supprimer. + + + Retourne un énumérateur qui itère au sein de . + retourne  ;Énumérateur pour l'instance . + + + Retourne une chaîne qui représente l'objet actif. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si l'entrée peut être analysée et ajoutée à . + retourne  ;true si peut être analysé et ajouté à l'instance . Sinon, false + Entrée à valider. + + + Représente la collection d'en-têtes de requête comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Charset pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Charset pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Encoding pour une requête HTTP. + + + Obtient la valeur de l'en-tête Accept-Language pour une requête HTTP. + retourne  ;Valeur de l'en-tête Accept-Language pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une requête HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une requête HTTP. + + + Obtient la valeur de l'en-tête Connection pour une requête HTTP. + retourne  ;Valeur de l'en-tête Connection pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une requête HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une requête HTTP. + retourne  ;Valeur de l'en-tête Date pour une requête HTTP. + + + Obtient la valeur de l'en-tête Expect pour une requête HTTP. + retourne  ;Valeur de l'en-tête Expect pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Expect pour une requête HTTP contient Continue. + retourne  ;true si l'en-tête Expect contient Continue ; sinon false. + + + Obtient ou définit la valeur de l'en-tête From pour une requête HTTP. + retourne  ;Valeur de l'en-tête From pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Host pour une requête HTTP. + retourne  ;Valeur de l'en-tête Host pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-Match pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Modified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Modified-Since pour une requête HTTP. + + + Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + retourne  ;Obtient la valeur de l'en-tête If-None-Match pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + retourne  ;Valeur de l'en-tête If-Unmodified-Since pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Max-Forwards pour une requête HTTP. + retourne  ;Valeur de l'en-tête Max-Forwards pour une requête HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une requête HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authorization pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Range pour une requête HTTP. + retourne  ;Valeur de l'en-tête Range pour une requête HTTP. + + + Obtient ou définit la valeur de l'en-tête Referer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Referer pour une requête HTTP. + + + Obtient la valeur de l'en-tête TE pour une requête HTTP. + retourne  ;Valeur de l'en-tête TE pour une requête HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une requête HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une requête HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une requête HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une requête HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une requête HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une requête HTTP. + + + Obtient la valeur de l'en-tête User-Agent pour une requête HTTP. + retourne  ;Valeur de l'en-tête User-Agent pour une requête HTTP. + + + Obtient la valeur de l'en-tête Via pour une requête HTTP. + retourne  ;Valeur de l'en-tête Via pour une requête HTTP. + + + Obtient la valeur de l'en-tête Warning pour une requête HTTP. + retourne  ;Valeur de l'en-tête Warning pour une requête HTTP. + + + Représente la collection d'en-têtes de réponse comme définie dans RFC 2616. + + + Obtient la valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Accept-Ranges pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Age pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Age pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Cache-Control pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Cache-Control pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Connection pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Connection pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Connection pour une réponse HTTP contient Close. + retourne  ;true si l'en-tête Connection contient Close ; sinon false. + + + Obtient ou définit la valeur de l'en-tête Date pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Date pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête ETag pour une réponse HTTP. + retourne  ;Valeur de l'en-tête ETag pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Location pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Location pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Pragma pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Pragma pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Proxy-Authenticate pour une réponse HTTP. + + + Obtient ou définit la valeur de l'en-tête Retry-After pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Retry-After pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Server pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Server pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Trailer pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Trailer pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Transfer-Encoding pour une réponse HTTP. + + + Obtient ou définit une valeur qui indique si l'en-tête Transfer-Encoding pour une réponse HTTP contient Chunked. + retourne  ;true si l'en-tête Transfer-Encoding correspond à un encodage de transfert mémorisé en bloc ; sinon, false. + + + Obtient la valeur de l'en-tête Upgrade pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Upgrade pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Vary pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Vary pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Via pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Via pour une réponse HTTP. + + + Obtient la valeur de l'en-tête Warning pour une réponse HTTP. + retourne  ;Valeur de l'en-tête Warning pour une réponse HTTP. + + + Obtient la valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + retourne  ;Valeur de l'en-tête WWW-Authenticate pour une réponse HTTP. + + + Représente un type de média utilisé dans un en-tête Content-Type défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Source représentée sous forme de chaîne pour initialiser la nouvelle instance. + + + Obtient ou définit le jeu de caractères. + retourne  ;Jeu de caractères. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient ou définit la valeur de l'en-tête de type de média. + retourne  ;Valeur d'en-tête de type média. + + + Obtient ou définit les paramètres de la valeur d'en-tête de type de média. + retourne  ;Paramètres des valeurs d'en-tête de type média. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du type de média. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de type de média valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente un type de média avec une considération de qualité supplémentaire, utilisé dans un en-tête Content-Type. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + + représenté sous forme de chaîne pour initialiser la nouvelle instance. + Qualité associée à cette valeur d'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente le type de média avec les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas un type de média valide avec des informations de valeur d'en-tête de qualité. + + + Obtenir ou définir le critère de qualité pour . + retourne  ;Critère de qualité pour l'objet . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une paire nom/valeur utilisée dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom de l'en-tête. + retourne  ;Nom de l'en-tête. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la valeur de nom. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de valeur de nom valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de l'en-tête. + retourne  ;Valeur de l'en-tête. + + + Représente une paire nom/valeur avec des paramètres utilisés dans différents en-têtes comme défini dans la norme RFC 2616. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + + + Initialise une nouvelle instance de la classe . + Nom de l'en-tête. + Valeur de l'en-tête. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres de l'objet . + retourne  ;Collection contenant les paramètres. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne représentant la valeur de nom avec les informations de valeur d'en-tête de paramètre. + + est une référence null. + + n'est pas une valeur de nom valide avec des informations de valeur d'en-tête de paramètre. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur de jeton de produit dans un en-tête d'agent utilisateur. + + + Initialise une nouvelle instance de la classe . + Nom du produit. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient le nom du jeton du produit. + retourne  ;Nom du jeton de produit. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête du produit. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la version du jeton du produit. + retourne  ;Version du jeton de produit. + + + Représente une valeur qui peut être un produit ou un commentaire dans un en-tête User-Agent. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Valeur de commentaire. + + + Initialise une nouvelle instance de la classe . + Valeur du nom de produit. + Valeur de la version du produit. + + + Obtient le commentaire de l'objet . + retourne  ;Valeur de commentaire de ce . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête des informations. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'informations produit valides. + + + Obtient le produit de l'objet . + retourne  ;Valeur de produit de cet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête If-Range qui peut être une date, une heure ou une valeur de balise d'entité. + + + Initialise une nouvelle instance de la classe . + Valeur de date utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Balise d'entité représentée sous forme de chaîne utilisée pour initialiser la nouvelle instance. + + + Obtient la date de l'objet . + retourne  ;Date de l'objet . + + + Obtient la balise d'entité de l'objet . + retourne  ;Balise d'entité de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de plage valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + + + Initialise une nouvelle instance de la classe avec une plage d'octets. + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de plage. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de plage valides. + + + Obtient les plages spécifiées à partir de l'objet . + retourne  ;Plages de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient l'unité de l'objet . + retourne  ;Unité de l'objet . + + + Représente une valeur d'en-tête de plage. + + + Initialise une nouvelle instance de la classe . + Position à laquelle démarrer l'envoi de données. + Position à laquelle arrêter l'envoi de données. + + est supérieur à .ou ou est inférieur à 0. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Obtient la position à laquelle démarrer l'envoi de données. + retourne  ;Position à laquelle démarrer l'envoi de données. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient la position à laquelle arrêter l'envoi de données. + retourne  ;Position à laquelle arrêter l'envoi de données. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Représente une valeur d'en-tête Retry-After qui peut être une date, une heure ou une valeur TimeSpan. + + + Initialise une nouvelle instance de la classe . + Offset de la date et de l'heure utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Différentiel, en secondes, utilisé pour initialiser la nouvelle instance. + + + Obtient l'offset de la date et de l'heure de l'objet . + retourne  ;Offset de la date et de l'heure de l'objet . + + + Obtient le delta en secondes de l'objet . + retourne  ;Différentiel en secondes de l'objet . + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de la condition de nouvelle tentative. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête de condition de nouvelle tentative valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'en-tête de chaîne avec une qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Considération de qualité utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de qualité. + + est une référence null. + + n'est pas une chaîne valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de l'objet . + retourne  ;Considération de qualité de l'objet . + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur de chaîne de l'objet . + retourne  ;Valeur de chaîne de l'objet . + + + Représente une valeur d'en-tête Accept-Encoding. + + + Initialise une nouvelle instance de la classe . + Objet utilisé pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Détermine si l'objet spécifié est égal à l'objet en cours. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Obtient les paramètres d'encodage de transfert. + retourne  ;Paramètres d'encodage de transfert. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête de l'encodage de transfert. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'encodage de transfert valides. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Obtient la valeur d'encodage de transfert. + retourne  ;Valeur d'encodage de transfert. + + + Représente une valeur d'en-tête Accept-Encoding avec une considération de qualité facultative. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + + + Initialise une nouvelle instance de la classe . + Chaîne utilisée pour initialiser la nouvelle instance. + Valeur pour la considération de qualité. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur de l'encodage de transfert. + + est une référence null. + + n'est pas un encodage de transfert valide avec des informations de valeur d'en-tête de qualité. + + + Obtient la considération de qualité de . + retourne  ;Considération de qualité de . + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente la valeur d'un en-tête Via. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + + + Initialise une nouvelle instance de la classe . + Version de protocole du protocole reçu. + Hôte et port via lesquels la requête ou la réponse a été reçue. + Nom de protocole du protocole reçu. + Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Obtient le champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire + retourne  ;Champ de commentaire utilisé pour identifier le logiciel de la passerelle ou du proxy destinataire. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Retourne un code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + retourne  ;Instance de . + Chaîne qui représente les informations de valeur d'en-tête. + + est une référence null. + + n'est pas valide pour les informations de valeur d'en-tête. + + + Obtient le nom de protocole du protocole reçu. + retourne  ;Le nom du protocole. + + + Obtient la version de protocole du protocole reçu. + retourne  ;Version du protocole. + + + Obtient l'hôte et le port via lesquels la requête ou la réponse a été reçue. + retourne  ;Hôte et port via lesquels la requête ou la réponse a été reçue. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + Représente une valeur d'avertissement utilisée par l'en-tête Warning. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + + + Initialise une nouvelle instance de la classe . + Code d'avertissement spécifique. + Hôte ayant attaché l'avertissement. + Chaîne entre guillemets contenant le texte d'avertissement. + Les informations de date et d'heure de l'avertissement. + + + Obtient l'hôte ayant attaché l'avertissement. + retourne  ;Hôte ayant attaché l'avertissement. + + + Obtient le code d'avertissement spécifique. + retourne  ;Code d'avertissement spécifique. + + + Obtient les informations de date et d'heure de l'avertissement. + retourne  ;Les informations de date et d'heure de l'avertissement. + + + Détermine si l'objet spécifié est égal à l'objet actuel. + retourne  ;true si l' spécifié est égal à l'objet actif ; sinon, false. + Objet à comparer avec l'objet actif. + + + Sert de fonction de hachage pour un objet . + retourne  ;Code de hachage pour l'objet en cours. + + + Convertit une chaîne en instance . + Retourne une instance de . + Chaîne qui représente les informations de valeur d'en-tête d'authentification. + + est une référence null. + + ne correspond pas à des informations de valeur d'en-tête d'authentification valides. + + + Obtient une chaîne entre guillemets contenant le texte d'avertissement. + retourne  ;Chaîne entre guillemets contenant le texte d'avertissement. + + + Retourne une chaîne qui représente l'objet actuel. + retourne  ;Chaîne qui représente l'objet actif. + + + Détermine si une chaîne correspond à des informations valides. + retourne  ;true si est valide  ; sinon, false. + Chaîne à valider. + Version de la chaîne. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/it/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/it/a new file mode 100644 index 00000000000..3a2ca25d00f --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/it/a @@ -0,0 +1,2310 @@ + + + + System.Net.Http + + + + Fornisce il contenuto HTTP basato su una matrice di byte. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Il parametro è null. + + + Inizializza una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Offset, in byte, nel parametro utilizzato per inizializzare l'oggetto . + Numero di byte in a partire dal parametro utilizzato per inizializzare . + Il parametro è null. + Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro .- oppure -Il valore del parametro è minore di zero.- oppure -Il parametro è maggiore della lunghezza del contenuto specificato dal parametro , meno il parametro . + + + Crea un flusso di contenuto HTTP come operazione asincrona per la lettura il cui archivio di backup è la memoria di . + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare e scrivere la matrice di byte fornita nel costruttore in un flusso di contenuto HTTP come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto, quali il token di associazione del canale.Il parametro può essere null. + + + Determina se una matrice di byte ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte della matrice di byte. + + + Specifica come i certificati client vengono forniti. + + + L'oggetto tenterà di fornire tutti i certificati client disponibili automaticamente. + + + L'applicazione manualmente fornisce i certificati client a .Questo valore è quello predefinito. + + + Tipo per gestori HTTP che delegano l'elaborazione dei messaggi di risposta HTTP a un altro gestore, chiamato gestore interno. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il gestore interno che elabora i messaggi di risposta HTTP. + Restituisce .Il gestore interno per i messaggi di risposta HTTP. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce . Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Contenitore per le tuple nome/valore codificate utilizzando il tipo MIME application/x-www-form-urlencoded. + + + Inizializza una nuova istanza della classe con una raccolta di coppie nome/valore specifica. + Raccolta di coppie nome/valore. + + + Fornisce una classe base per l'invio di richieste HTTP e la ricezione di risposte HTTP da una risorsa identificata da un URI. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un gestore specifico. + Stack del gestore HTTP da usare per inviare le richieste. + + + Inizializza una nuova istanza della classe con un gestore specifico. + Oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(), false se si intende riutilizzare il gestore interno. + + + Ottiene o imposta l'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + Restituisce .L'indirizzo di base dell'URI (Uniform Resource Identifier) della risorsa Internet usata quando si inviano le richieste. + + + Annullare tutte le richieste in sospeso in questa istanza. + + + Ottiene le intestazioni che devono essere inviate con ogni richiesta. + Restituisce .Intestazioni da inviare con ogni richiesta. + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta DELETE all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Rilascia le risorse non gestite usate da e, facoltativamente, elimina le risorse gestite. + true per rilasciare sia le risorse gestite sia quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce . + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un'opzione di completamento HTTP e un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Valore di opzione di completamento HTTP che indica quando l'operazione deve essere considerata completata. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituire il corpo della risposta come matrice di byte in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come flusso in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Inviare una richiesta GET all'URI specificato e restituisce il corpo della risposta come stringa in un'operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il parametro era null. + + + Ottiene o imposta il numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta. + Restituisce .Numero massimo di byte per la memorizzazione nel buffer durante la lettura del contenuto della risposta.Il valore predefinito di questa proprietà è 2 gigabyte. + La dimensione specificata è minore o uguale a zero. + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta POST all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta POST con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta PUT all'URI specificato come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Il parametro era null. + + + Inviare una richiesta PUT con un token di annullamento come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + L'URI a cui viene inviata la richiesta. + Il contenuto della richiesta HTTP inviato al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Quando l'operazione deve essere completata (non appena la risposta è disponibile o dopo aver letto l'intero contenuto della risposta). + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Token di annullamento per annullare l'operazione. + Il parametro era null. + Il messaggio di richiesta è già stato inviato dall'istanza di . + + + Ottiene o imposta l'intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Restituisce .Intervallo di tempo da attendere prima che si verifichi il timeout della richiesta. + Il timeout specificato è minore o uguale a zero e non rappresenta il campo . + È già stata avviata un'operazione di lettura asincrona sull'istanza corrente. + L'istanza corrente è stata eliminata. + + + Il gestore messaggi predefinito utilizzato da . + + + Crea un'istanza di una classe . + + + Recupera o imposta un valore che indica se il gestore deve seguire le risposte di reindirizzamento. + Restituisca il valore .true se il gestore deve seguire le risposte di reindirizzamento; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta il tipo di metodo di decompressione utilizzato dal gestore per la decompressione automatica della risposta del contenuto HTTP. + Restituisca il valore .Il metodo automatico di decompressione utilizzato dal gestore.Il valore predefinito è . + + + Ottiene o imposta la raccolta dei certificati di sicurezza associati al gestore. + Restituisca il valore .Raccolta di certificati di sicurezza associati a questo gestore. + + + Ottiene o imposta il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + Restituisca il valore .Il contenitore di cookie utilizzato per archiviare i cookie del server tramite il gestore. + + + Ottiene o imposta le informazioni di autenticazione utilizzate da questo gestore. + Restituisca il valore .Credenziali di autenticazione associate al gestore.Il valore predefinito è null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene o imposta il numero massimo di reindirizzamenti che il gestore segue. + Restituisca il valore .Numero massimo di risposte di reindirizzamento seguite dal gestore.Il valore predefinito è 50. + + + Ottiene o imposta la dimensione massima del buffer di contenuto della richiesta utilizzato dal gestore. + Restituisca il valore .Dimensione massima in byte del buffer di contenuto della richiesta.Il valore predefinito è 2 gigabyte. + + + Ottiene o imposta un valore che indica se il gestore invia un'intestazione di autorizzazione con la richiesta. + Restituisca il valore .true per inviare un'intestazione Autorizzazione HTTP con le richieste una volta eseguita l'autenticazione; in caso contrario, false.Il valore predefinito è false. + + + Ottiene o imposta le informazioni sul proxy utilizzato dal gestore. + Restituisca il valore .Informazioni sul proxy utilizzato dal gestore.Il valore predefinito è null. + + + Crea un'istanza di in base alle informazioni fornite in come operazione che non si bloccherà. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP. + Token di annullamento per annullare l'operazione. + Il parametro era null. + + + Ottiene un valore che indica se il gestore supporta la decompressione automatica del contenuto di risposta. + Restituisca il valore .true se il gestore supporta la decompressione automatica del contenuto della risposta; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni proxy. + Restituisca il valore .true se il gestore supporta le impostazioni proxy; in caso contrario, false.Il valore predefinito è true. + + + Ottiene un valore che indica se il gestore supporta le impostazioni di configurazione per le proprietà e . + Restituisca il valore .true se il gestore supporta le impostazioni di configurazione per le proprietà e ; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che indica se il gestore utilizza la proprietà per memorizzare i cookie del server e utilizza questi cookie durante l'invio delle richieste. + Restituisca il valore .true se il gestore supporta la proprietà per archiviare i cookie del server e utilizza tali cookie quando invia richieste; in caso contrario, false.Il valore predefinito è true. + + + Ottiene o imposta un valore che controlla se le credenziali predefinite sono inviate con le richieste dal gestore. + Restituisca il valore .true se vengono utilizzate le credenziali predefinite; in caso contrario, false.Il valore predefinito è false. + + + Recupera o imposta un valore che indica se il gestore utilizza un proxy per le richieste. + Restituisca il valore .true se il gestore deve utilizzare un proxy per le richieste; in caso contrario, false.Il valore predefinito è true. + + + Indica se le operazioni di devono essere considerate completate non appena la risposta è disponibile o dopo la lettura dell'intero messaggio di risposta, incluso il contenuto. + + + L'operazione deve essere completata dopo la lettura della risposta intera che include il contenuto. + + + L'operazione deve essere completata non appena una risposta è disponibile e le intestazioni vengono lette.Il contenuto non è ancora pronto. + + + Classe base che rappresenta un corpo di entità e intestazioni di contenuto HTTP. + + + Inizializza una nuova istanza della classe . + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + + + Serializza il contenuto HTTP in un flusso di byte e lo copia nell'oggetto flusso fornito come parametro di . + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Serializzare il contenuto HTTP in un flusso di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + Restituisca il valore .Le intestazioni di contenuto HTTP come definito nello standard RFC 2616. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un buffer di memoria come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Dimensione massima in byte del buffer da utilizzare. + + + Serializza il contenuto HTTP in una matrice di byte come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP e restituire un flusso che rappresenta il contenuto come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in una stringa come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto HTTP ha una lunghezza valida in byte. + Restituisca il valore .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Tipo di base per gestori messaggi HTTP. + + + Inizializza una nuova istanza della classe . + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisca il valore .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Una classe di specializzazione che consente alle applicazioni di chiamare il metodo di su una catena del gestore HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + + + Inizializza una nuova istanza di una classe con un specifico. + L'oggetto responsabile dell'elaborazione dei messaggi di risposta HTTP. + true se il gestore interno deve essere eliminato da Dispose(),false se si desidera riutilizzare il gestore interno. + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Inviare una richiesta HTTP come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare. + Il token di annullamento per annullare l'operazione. + Il parametro era null. + + + Classe di helper per recuperare e confrontare i metodi HTTP standard e per creare nuovi metodi HTTP. + + + Inizializza una nuova istanza della classe con un metodo HTTP specifico. + Metodo HTTP. + + + Rappresenta un metodo di protocollo HTTP DELETE. + Restituisca il valore . + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Metodo HTTP da confrontare con l'oggetto corrente. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisca il valore .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario false. + Oggetto da confrontare con l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP GET. + Restituisca il valore . + + + Funge da funzione hash per questo tipo. + Restituisca il valore .Codice hash per la classe corrente. + + + Rappresenta un metodo di protocollo HTTP HEAD.Il metodo HEAD è identico al metodo GET ad eccezione del fatto che, nella risposta, il server restituisce solo intestazioni di messaggio senza un corpo del messaggio. + Restituisca il valore . + + + Metodo HTTP. + Restituisca il valore .Metodo HTTP rappresentato come . + + + Operatore di uguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono equivalenti; in caso contrario, false. + Oggetto a sinistra di un operatore di uguaglianza. + Oggetto a destra di un operatore di uguaglianza. + + + Operatore di disuguaglianza per il confronto di due oggetti . + Restituisca il valore .true se i parametri e specificati non sono uguali; in caso contrario, false. + Oggetto a sinistra di un operatore di disuguaglianza. + Oggetto a destra di un operatore di disuguaglianza. + + + Rappresenta un metodo di protocollo HTTP OPTIONS. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP POST utilizzato per inviare una nuova entità come aggiunta a un URI. + Restituisca il valore . + + + Rappresenta un metodo di protocollo HTTP PUT utilizzato per sostituire un'entità identificata da un URI. + Restituisca il valore . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisca il valore .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un metodo di protocollo HTTP TRACE. + Restituisca il valore . + + + Classe base per eccezioni generate dalle classi e . + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente. + Messaggio che descrive l'eccezione corrente. + + + Inizializza una nuova istanza della classe con un messaggio specifico che descrive l'eccezione corrente e l'eccezione interna. + Messaggio che descrive l'eccezione corrente. + Eccezione interna. + + + Rappresenta un messaggio di richiesta HTTP. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Stringa che rappresenta la richiesta . + + + Inizializza una nuova istanza della classe con un metodo HTTP e una richiesta . + Metodo HTTP. + Oggetto da richiedere. + + + Ottiene o imposta il contenuto del messaggio HTTP. + Restituisce .Contenuto di un messaggio + + + Rilascia le risorse non gestite ed elimina le risorse gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Ottiene la raccolta delle intestazioni delle richieste HTTP. + Restituisce .Raccolta di intestazioni di richiesta HTTP. + + + Ottiene o imposta il metodo HTTP utilizzato dal messaggio di richiesta HTTP. + Restituisce .Metodo HTTP utilizzato dal messaggio di richiesta.Il valore predefinito è il metodo GET. + + + Ottiene un set di proprietà per la richiesta HTTP. + Restituisce . + + + Recupera o imposta utilizzato per la richiesta HTTP. + Restituisce . utilizzato per la richiesta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Rappresenta un messaggio di risposta HTTP che include il codice di stato e i dati. + + + Inizializza una nuova istanza della classe . + + + Inizializza una nuova istanza della classe con un specifico. + Codice di stato della risposta HTTP. + + + Ottiene o imposta il messaggio di risposta HTTP. + Restituisce .Contenuto del messaggio di risposta HTTP. + + + Rilascia le risorse non gestite ed elimina le risorse non gestite utilizzate dall'oggetto . + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Genera un'eccezione se la proprietà della risposta HTTP è false. + Restituisce .Il messaggio di risposta HTTP se la chiamata ha esito positivo. + + + Ottiene la raccolta delle intestazioni di risposta HTTP. + Restituisce .Raccolta di intestazioni di risposta HTTP. + + + Ottiene un valore che indica se la risposta HTTP è stata completata. + Restituisce .Valore che indica se la risposta HTTP è stata completata.true se l'oggetto è stato compreso nell'intervallo tra 200 e 299; in caso contrario, false. + + + Ottiene o imposta la frase del motivo solitamente inviata dai server insieme al codice di stato. + Restituisce .Frase del motivo inviata dal server. + + + Ottiene o imposta il messaggio di richiesta che ha determinato questo messaggio di risposta. + Restituisce .Messaggio di richiesta che ha determinato questo messaggio di risposta. + + + Ottiene o imposta il codice di stato della risposta HTTP. + Restituisce .Codice di stato della risposta HTTP. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Rappresentazione stringa dell'oggetto corrente. + + + Ottiene o imposta la versione del messaggio HTTP. + Restituisce .La versione del messaggio HTTP.Il valore predefinito è 1.1. + + + Tipo di base per gestori che possono elaborare soltanto piccole richieste e/o messaggi di risposta. + + + Crea un'istanza di una classe . + + + Crea un'istanza di una classe con un gestore interno specificato. + Gestore interno responsabile per l'elaborazione dei messaggi di risposta HTTP. + + + Esegue l'elaborazione su ogni richiesta inviata al server. + Restituisce .Messaggio di richiesta HTTP elaborato. + Messaggio di richiesta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Eseguire l'elaborazione su ogni risposta dal server. + Restituisce .Messaggio di risposta HTTP elaborato. + Messaggio di risposta HTTP da elaborare. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + + + Invia una richiesta HTTP al gestore interno da inviare al server come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Messaggio di richiesta HTTP da inviare al server. + Token di annullamento utilizzabile da altri oggetti o thread per ricevere l'avviso dell'annullamento. + Il parametro era null. + + + Fornisce una raccolta di oggetti che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + Il parametro era null o contiene solo spazi vuoti. + + + Crea una nuova istanza della classe . + Sottotipo del contenuto multiparte. + La stringa limite per il contenuto a più parti. + Il parametro era null o una stringa vuota. è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati utilizzando la specifica di tipo di contenuto multipart/*. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Restituisce un enumeratore che scorre la raccolta di oggetti che vengono serializzati utilizzando la specifica del tipo di contenuto multipart/*. + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Serializzare il contenuto HTTP multipart in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Implementazione esplicita del metodo . + Restituisce .Oggetto che può essere utilizzato per scorrere l'insieme. + + + Determina se il contenuto multiparte HTTP ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto HTTP. + + + Fornisce un contenitore per contenuto codificato utilizzando il tipo MIME multipart/form-data. + + + Crea una nuova istanza della classe . + + + Crea una nuova istanza della classe . + La stringa limite per il contenuto dati del form a più parti. + + è null o contiene solo spazi vuoti.- oppure - termina con un spazio. + La lunghezza di è maggiore di 70. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + + è null o contiene solo spazi vuoti. + Il parametro era null. + + + Aggiungere il contenuto HTTP multipart a una raccolta di oggetti di che vengono serializzati nel tipo MIME multipart/form-data. + Contenuto HTTP da aggiungere alla raccolta. + Nome del contenuto HTTP da aggiungere. + Nome file del contenuto HTTP da aggiungere alla raccolta. + + è null o contiene solo spazi vuoti.- oppure - è null o contiene solo spazi vuoti. + Il parametro era null. + + + Fornisce il contenuto HTTP basato su un flusso. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Dimensione del buffer, in byte, per . + Il parametro era null. + + è minore o uguale a zero. + + + Scrive il contenuto del flusso HTTP in un flusso di memoria come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + + + Rilascia le risorse non gestite utilizzate dall'oggetto ed eventualmente elimina le risorse gestite. + true per liberare sia le risorse gestite che quelle non gestite; false per rilasciare solo le risorse non gestite. + + + Serializzare il contenuto HTTP in un flusso come operazione asincrona. + Restituisce .Oggetto dell'attività che rappresenta l'operazione asincrona. + Il flusso di destinazione. + Informazioni sul trasporto (ad esempio sul token di associazione del canale).Il parametro può essere null. + + + Determina se il contenuto del flusso ha una lunghezza valida in byte. + Restituisce .true se il è una lunghezza valida; in caso contrario,false. + Lunghezza in byte del contenuto del flusso. + + + Fornisce il contenuto HTTP basato su una stringa. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + + + Crea una nuova istanza della classe . + Contenuto utilizzato per inizializzare l'oggetto . + Codifica da utilizzare per il contenuto. + Tipo di dati multimediali da utilizzare per il contenuto. + + + Rappresenta le informazioni di autenticazione nei valori di intestazione Authorization, ProxyAuthorization, WWW-Authenticate e Proxy-Authenticate. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + + + Inizializza una nuova istanza della classe . + Schema da utilizzare per l'autorizzazione. + Le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene le credenziali che contengono le informazioni di autenticazione dell'agente utente per la risorsa richiesta. + Restituisce .Credenziali contenenti le informazioni di autenticazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene lo schema da utilizzare per l'autorizzazione. + Restituisce .Schema da utilizzare per l'autorizzazione. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Cache-Control. + + + Inizializza una nuova istanza della classe . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Token di estensione cache, ognuno con un valore assegnato facoltativo. + Restituisce .Raccolta di token di estensione cache, ognuno con un valore assegnato facoltativo. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + La durata massima, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .true se il client HTTP è disposto ad accettare una risposta che ha superato la data di scadenza; in caso contrario, false. + + + Il tempo massimo, in secondi, quando un client HTTP è disposto ad accettare una risposta che ha superato l'ora di scadenza. + Restituisce .Tempo in secondi. + + + La durata di validità, in secondi, di un client HTTP per accettare una risposta. + Restituisce .Tempo in secondi. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata; in caso contrario, false. + + + Se un client HTTP è disposto ad accettare una risposta memorizzata nella cache. + Restituisce .true se il client HTTP è disposto ad accettare una risposta memorizzata nella cache; in caso contrario, false. + + + Raccolta di fieldname nella direttiva “no-cache" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se una cache non deve memorizzare una parte del messaggio di richiesta HTTP o una risposta. + Restituisce .true se una cache non deve memorizzare alcuna parte del messaggio di richiesta HTTP o alcuna risposta; in caso contrario, false. + + + Se una cache o un proxy non deve modificare alcuna parte del corpo dell'entità. + Restituisce .true se una cache o un proxy non deve modificare alcun aspetto del corpo di entità; in caso contrario, false. + + + Se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway. + Restituisce .true se una cache deve rispondere utilizzando una voce della cache coerente con gli altri vincoli della richiesta HTTP o rispondere con uno stato 504 (timeout gateway); in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore intestazione del controllo della cache. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione Cache Control valide. + + + Se tutto o parte del messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa. + Restituisce .true se il messaggio di risposta HTTP è destinato a un singolo utente e non deve essere memorizzato nella cache da una cache condivisa; in caso contrario, false. + + + Fieldname della raccolta nella direttiva “privata" in un campo di intestazione controllo cache su una risposta HTTP. + Restituisce .Raccolta di nomicampo. + + + Se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce della cache non risulta più aggiornata per le cache condivise dell'agente utente. + Restituisce .true se il server di origine richiede la riconvalida di una voce della cache su qualsiasi utilizzo successivo quando la voce non risulta più aggiornata per le cache condivise dell'agente utente; in caso contrario, false. + + + Se una risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa. + Restituisce .true se la risposta HTTP può essere memorizzata nella cache da qualsiasi cache, anche se sarebbe generalmente non memorizzabile o memorizzabile nella cache solo all'interno di una cache non condivisa; in caso contrario, false. + + + Durata massima condivisa, specificata in secondi, in una risposta HTTP che sostituisce la direttiva di durata massima in un'intestazione Cache-Control o in un'intestazione Expires per una cache condivisa. + Restituisce .Tempo in secondi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Disposition. + + + Inizializza una nuova istanza della classe . + Oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un . + + + Data di creazione del file. + Restituisce .Data di creazione del file. + + + Il tipo di disposizione per una parte del corpo del contenuto. + Restituisce .Il tipo di disposizione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Suggerimento su come creare un nome file per archiviare il payload del messaggio da utilizzare se l'entità è stata rimossa e archiviata in un file separato. + Restituisce .Nome file consigliato. + + + Suggerimento su come creare nomi file per archiviare il payload del messaggio da utilizzare se le entità sono state rimosse e archiviate in file separati. + Restituisce .Nome file consigliato del form nomefile*. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Data dell'ultima modifica apportata al file. + Restituisce .Data di modifica del file. + + + Nome per una parte del corpo del contenuto. + Restituisce .Nome per la parte del corpo del contenuto. + + + Set di parametri che include l'intestazione Content-Disposition. + Restituisce .Insieme di parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione di disposizione dei contenuti. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di disposizione del contenuto valide. + + + Data dell'ultima lettura del file. + Restituisce .Data ultimo lettura. + + + Dimensione approssimativa del file espressa in byte. + Restituisce .Dimensione approssimativa espressa in byte. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore dell'intestazione Content-Range. + + + Inizializza una nuova istanza della classe . + Il punto iniziale o finale dell'intervallo, in byte. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + + + Inizializza una nuova istanza della classe . + La posizione, in byte, in cui avviare l'invio dei dati. + La posizione, in byte, in cui interrompere l'invio dei dati. + Il punto iniziale o finale dell'intervallo, in byte. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione, in byte, in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se per l'intestazione Content-Range è stata specificata una lunghezza. + Restituisce .true se il Content-range è di lunghezza specificata; in caso contrario, false. + + + Ottiene un valore che indica se per Content-Range è stato specificato un intervallo. + Restituisce .true se il Content-range è di intervallo specificato; in caso contrario, false. + + + Ottiene la lunghezza del corpo dell'entità completo. + Restituisce .La lunghezza del corpo dell'entità completo. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione dell'intervallo di contenuti. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo di contenuti. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Le unità dell'intervallo utilizzate. + Restituisce . contenente le unità dell'intervallo. + + + Rappresenta un valore di intestazione del tag di entità. + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + + + Inizializza una nuova istanza della classe . + Stringa contenente un oggetto . + Un valore che indica se questa intestazione del tag di entità è una convalida debole.Se l'intestazione del tag di entità è una convalida debole, allora deve essere impostato su true.Se l'intestazione del tag di entità è una convalida forte, allora deve essere impostato su false. + + + Ottiene il valore di intestazione del tag di entità. + Restituisce . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene un valore che indica se il tag di identità è preceduto da un indicatore di debolezza. + Restituisce .true se il tag di identità è preceduto da un indicatore di debolezza; in caso contrario, false. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del tag di entità. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dei tag di entità. + + + Ottiene la stringa tra virgolette opaca. + Restituisce .Stringa tra virgolette opaca. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta la raccolta di intestazioni di contenuto secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione del contenuto Allow in una risposta HTTP. + Restituisce .Valore dell'intestazione Allow su una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Disposition in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Encoding in una risposta HTTP. + + + Ottiene il valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Language in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Length in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Location in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-MD5 in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Range in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Content-Type in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Expires in una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Expires in una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione del contenuto Last-Modified per una risposta HTTP. + Restituisce .Valore dell'intestazione del contenuto Last-Modified in una risposta HTTP. + + + Raccolta di intestazioni e i relativi valori definiti nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + + + Aggiunge l'intestazione specificata e i valori relativi nella raccolta . + L'intestazione da aggiungere all'insieme. + Elenco di valori dell'intestazione da aggiungere alla raccolta. + + + Aggiunge l'intestazione specificata e il valore relativo nella raccolta . + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Rimuove tutte le intestazioni dalla raccolta . + + + Restituisce un valore che indica se un'intestazione specifica è presente nella raccolta . + Restituisce .true e l'intestazione specificata è presente nella raccolta; in caso contrario, false. + Intestazione specifica. + + + Restituisce un enumeratore che consente di scorrere l'istanza di . + Restituisce .Enumeratore per l'oggetto . + + + Restituisce tutti i valori di intestazione per un'intestazione specificata archiviata nella raccolta . + Restituisce .Matrice di stringhe di intestazione. + Intestazione specificata per cui restituire i valori. + + + Rimuove l'intestazione specificata dalla raccolta . + Restituisce . + Il nome dell'intestazione da rimuovere dall'insieme. + + + Ottiene un enumeratore che itera in un . + Restituisce .Istanza di un'implementazione di un in grado di scorrere un oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Restituisce un valore che indica se l'intestazione specificata e i relativi valori sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Valori dell'intestazione. + + + Restituisce un valore che indica se l'intestazione specificata e il relativo valore sono stati aggiunti alla raccolta di senza convalidare le informazioni fornite. + Restituisce .true se è stato possibile aggiungere l'intestazione specificata e nella raccolta; altrimenti false. + L'intestazione da aggiungere all'insieme. + Il contenuto dell'intestazione. + + + Restituisce un valore che indica se i valori e un'intestazione specificati sono archiviati nella raccolta . + Restituisce .true se gli oggetti e values dell'intestazione specificata vengono archiviati nella raccolta; in caso contrario, false. + Intestazione specificata. + Valori intestazione specificati. + + + Rappresenta una raccolta di valori dell'intestazione. + Tipo di raccolta di intestazione. + + + Aggiunge una voce a . + Elemento da aggiungere alla raccolta dell'intestazione. + + + Rimuove tutte le voci da . + + + Determina se contiene un articolo. + Restituisce .true se la voce è inclusa nell'istanza , in caso contrario false. + Elemento da trovare nella raccolta dell'intestazione. + + + Copia l'intero oggetto in un oggetto compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione. + Oggetto unidimensionale che rappresenta la destinazione degli elementi copiati dall'oggetto .L'indicizzazione di deve essere in base zero. + Indice in base zero della matrice specificata nel parametro in corrispondenza del quale ha inizio la copia. + + + Ottiene il numero di intestazioni in . + Restituisce .Numero di intestazioni contenute in una raccolta. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Ottiene un valore che indica se l'istanza è di sola lettura. + Restituisce .true se l'istanza di è in sola lettura, in caso contrario false. + + + Analizza e aggiunge una voce all'oggetto . + Voce da aggiungere. + + + Consente di rimuovere l'elemento selezionato dall'oggetto . + Restituisce .true se è stato correttamente rimosso dall'istanza ; in caso contrario, false. + Elemento da rimuovere. + + + Restituisce un enumeratore che scorre la classe . + Restituisce .Enumeratore per l'istanza . + + + Restituisce una stringa che rappresenta l'oggetto corrente . + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se l'input può essere analizzato e aggiunto all'oggetto . + Restituisce .true se è stato possibile analizzare e aggiungere all'istanza di ; in caso contrario, false + Voce da convalidare. + + + Rappresenta la raccolta di intestazioni di richiesta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Charset per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Charset per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Encoding per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Accept-Language per una richiesta HTTP. + Restituisce .Valore dell'intestazione Accept-Language per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una richiesta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Connection per una richiesta HTTP. + Restituisce .Valore dell'intestazione Connection per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una richiesta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una richiesta HTTP. + Restituisce .Valore dell'intestazione Date per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Expect per una richiesta HTTP. + Restituisce .Valore dell'intestazione Expect per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Expect per una richiesta HTTP contiene Continue. + Restituisce .true se l'intestazione Expect contiene Continue; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione From per una richiesta HTTP. + Restituisce .Valore dell'intestazione From per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Host per una richiesta HTTP. + Restituisce .Valore dell'intestazione Host per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-Match per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Modified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Modified-Since per una richiesta HTTP. + + + Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + Restituisce .Ottiene il valore dell'intestazione If-None-Match per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + Restituisce .Valore dell'intestazione If-Unmodified-Since per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Max-Forwards per una richiesta HTTP. + Restituisce .Valore dell'intestazione Max-Forwards per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una richiesta HTTP. + Restituisce .Valore dell'intestazione Pragma per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authorization per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Range per una richiesta HTTP. + Restituisce .Valore dell'intestazione Range per una richiesta HTTP. + + + Ottiene o imposta il valore dell'intestazione Referer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Referer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione TE per una richiesta HTTP. + Restituisce .Valore dell'intestazione TE per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una richiesta HTTP. + Restituisce .Valore dell'intestazione Trailer per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una richiesta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una richiesta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una richiesta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una richiesta HTTP. + + + Ottiene il valore dell'intestazione User-Agent per una richiesta HTTP. + Restituisce .Valore dell'intestazione User-Agent per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Via per una richiesta HTTP. + Restituisce .Valore dell'intestazione Via per una richiesta HTTP. + + + Ottiene il valore dell'intestazione Warning per una richiesta HTTP. + Restituisce .Valore dell'intestazione Warning per una richiesta HTTP. + + + Rappresenta la raccolta di intestazioni di risposta secondo quanto definito in RFC 2616. + + + Ottiene il valore dell'intestazione Accept-Ranges per una risposta HTTP. + Restituisce .Valore dell'intestazione Accept-Ranges per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Age per una risposta HTTP. + Restituisce .Valore dell'intestazione Age per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Cache-Control per una risposta HTTP. + Restituisce .Valore dell'intestazione Cache-Control per una risposta HTTP. + + + Ottiene il valore dell'intestazione Connection per una risposta HTTP. + Restituisce .Valore dell'intestazione Connection per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Connection per una risposta HTTP contiene Close. + Restituisce .true se l'intestazione Connection contiene Close; in caso contrario, false. + + + Ottiene o imposta il valore dell'intestazione Date per una risposta HTTP. + Restituisce .Valore dell'intestazione Date per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione ETag per una risposta HTTP. + Restituisce .Valore dell'intestazione ETag per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Location per una risposta HTTP. + Restituisce .Valore dell'intestazione Location per una risposta HTTP. + + + Ottiene il valore dell'intestazione Pragma per una risposta HTTP. + Restituisce .Valore dell'intestazione Pragma per una risposta HTTP. + + + Ottiene il valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione Proxy-Authenticate per una risposta HTTP. + + + Ottiene o imposta il valore dell'intestazione Retry-After per una risposta HTTP. + Restituisce .Valore dell'intestazione Retry-After per una risposta HTTP. + + + Ottiene il valore dell'intestazione Server per una risposta HTTP. + Restituisce .Valore dell'intestazione Server per una risposta HTTP. + + + Ottiene il valore dell'intestazione Trailer per una risposta HTTP. + Restituisce .Valore dell'intestazione Trailer per una risposta HTTP. + + + Ottiene il valore dell'intestazione Transfer-Encoding per una risposta HTTP. + Restituisce .Valore dell'intestazione Transfer-Encoding per una risposta HTTP. + + + Ottiene o imposta un valore che indica se l'intestazione di Transfer-Encoding per una risposta HTTP contiene Chunked. + Restituisce .true se l'intestazione Transfer-Encoding contiene Chunked; in caso contrario, false. + + + Ottiene il valore dell'intestazione Upgrade per una risposta HTTP. + Restituisce .Valore dell'intestazione Upgrade per una risposta HTTP. + + + Ottiene il valore dell'intestazione Vary per una risposta HTTP. + Restituisce .Valore dell'intestazione Vary per una risposta HTTP. + + + Ottiene il valore dell'intestazione Via per una risposta HTTP. + Restituisce .Valore dell'intestazione Via per una risposta HTTP. + + + Ottiene il valore dell'intestazione Warning per una risposta HTTP. + Restituisce .Valore dell'intestazione Warning per una risposta HTTP. + + + Ottiene il valore dell'intestazione WWW-Authenticate per una risposta HTTP. + Restituisce .Valore dell'intestazione WWW-Authenticate per una risposta HTTP. + + + Rappresenta un tipo di supporto utilizzato in un'intestazione Content-Type come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Origine rappresentata come stringa per inizializzare la nuova istanza. + + + Ottiene o imposta il set di caratteri. + Restituisce .Set di caratteri. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene o imposta il valore dell'intestazione Media-Type. + Restituisce .Il valore di intestazione del tipo di supporto. + + + Ottiene o imposta i parametri di valore dell'intestazione del tipo di supporto. + Restituisce .I parametri del valore di intestazione del tipo di supporto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione del tipo di supporto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del tipo di supporti. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un tipo di supporto con un fattore di qualità aggiuntivo utilizzato in un'intestazione Content-Type. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto rappresentato come stringa per inizializzare la nuova istanza. + Qualità associata a questo valore di intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il tipo di supporto con le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è un tipo di supporto valido con le informazioni sul valore di intestazione di qualità. + + + Ottenere o impostare il valore di qualità per . + Restituisce .Valore di qualità per l'oggetto ) + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta una coppia nome/valore utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome dell'intestazione. + Restituisce .Nome dell'intestazione. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del valore del nome. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione del valore del nome. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore dell'intestazione. + Restituisce .Valore dell'intestazione. + + + Rappresenta una coppia nome/valore con parametri utilizzata in varie intestazioni come definito nello standard RFC 2616. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + + + Inizializza una nuova istanza della classe . + Nome dell'intestazione. + Valore dell'intestazione. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri dall'oggetto . + Restituisce .Raccolta contenente i parametri. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta il valore del nome con le informazioni sul valore di intestazione del parametro. + + è un riferimento null. + + non è un valore di nome valido con le informazioni sul valore di intestazione di parametro. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di token di prodotto in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Nome del prodotto. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene il nome del token del prodotto. + Restituisce .Nome del token del prodotto. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore dell'intestazione del prodotto. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene la versione del token del prodotto. + Restituisce .Versione del token di prodotto. + + + Rappresenta un valore che può essere un prodotto o un commento in un'intestazione User-Agent. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Valore di commento. + + + Inizializza una nuova istanza della classe . + Valore del nome prodotto. + Valore della versione del prodotto. + + + Ottiene il commento dall'oggetto . + Restituisce .Valore di commento di . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle informazioni di prodotto. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle informazioni di prodotto. + + + Ottiene il prodotto dall'oggetto . + Restituisce .Valore del prodotto da questo . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione If-Range che può essere un valore di tipo Date/Time o tag entità. + + + Inizializza una nuova istanza della classe . + Un valore di data utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Una tag di entità rappresentata come stringa utilizzata per inizializzare la nuova istanza. + + + Ottiene la data dall'oggetto . + Restituisce .Data dall'oggetto . + + + Ottiene il tag di identità dall'oggetto . + Restituisce .Tag di identità dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dell'intervallo. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione con intervallo. + + + Inizializza una nuova istanza della classe . + + + Consente l'inizializzazione di una nuova istanza della classe con un intervallo di date. + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione dell'intervallo. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione dell'intervallo. + + + Ottiene gli intervalli specificati dall'oggetto . + Restituisce .Intervalli dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene l'unità dall'oggetto . + Restituisce .Unità dall'oggetto . + + + Rappresenta un valore di intestazione con intervallo di byte in un intervallo. + + + Inizializza una nuova istanza della classe . + La posizione in cui avviare l'invio dei dati. + La posizione in cui arrestare l'invio dei dati. + + è maggiore di .- oppure - o è minore di 0. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Ottiene la posizione in cui avviare l'invio dei dati. + Restituisce .La posizione in cui avviare l'invio dei dati. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene la posizione in cui arrestare l'invio dei dati. + Restituisce .La posizione in cui arrestare l'invio dei dati. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Rappresenta un valore di intestazione Retry-After che può essere un valore di tipo Date/Time o Timespan. + + + Inizializza una nuova istanza della classe . + L'offset di data e ora utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Delta, in secondi, utilizzato per inizializzare la nuova istanza. + + + Ottiene l'offset della data e ora dall'oggetto . + Restituisce .L'offset della data e ora dall'oggetto . + + + Ottiene il delta in secondi dall'oggetto . + Restituisce .Delta in secondi dall'oggetto . + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione delle condizioni dei nuovi tentativi. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione delle condizioni dei nuovi tentativi. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di intestazione di stringa con una qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Fattore di qualità utilizzato per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione di qualità. + + è un riferimento null. + + non è una stringa valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di stringa dall'oggetto . + Restituisce .Valore di stringa da cui ottenere l'oggetto . + + + Rappresenta un valore di intestazione Accept-Encoding. + + + Inizializza una nuova istanza della classe . + Oggetto utilizzato per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Determina se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Ottiene i parametri di codifica di trasferimento. + Restituisce .I parametri di codifica di trasferimento. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore di intestazione della codifica di trasferimento. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della codifica di trasferimento. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Ottiene il valore di codifica di trasferimento. + Restituisce .Il valore di codifica di trasferimento. + + + Rappresenta un valore di intestazione di intestazione Accept-Encoding con fattore di qualità facoltativa. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + + + Inizializza una nuova istanza della classe . + Stringa utilizzata per inizializzare la nuova istanza. + Un valore per il fattore di qualità. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta le informazioni sul valore della codifica di trasferimento. + + è un riferimento null. + + non è una codifica di trasferimento valida con le informazioni sul valore di intestazione di qualità. + + + Ottiene il fattore di qualità dall'oggetto . + Restituisce .Fattore di qualità dall'oggetto . + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta il valore di un'intestazione Via. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + + + Inizializza una nuova istanza della classe . + La versione del protocollo ricevuto. + L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Il nome del protocollo ricevuto. + Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Ottiene il campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + Restituisce .Campo commento utilizzato per identificare il software del proxy o del gateway del destinatario. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Viene restituito un codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce .Istanza di . + Stringa che rappresenta mediante informazioni sul valore intestazione. + + è un riferimento null. + + non contiene informazioni valide sul valore dell'intestazione della via. + + + Ottiene il nome del protocollo ricevuto. + Restituisce .Nome del protocollo. + + + Ottiene la versione del protocollo ricevuto. + Restituisce .Versione del protocollo. + + + Ottiene l'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + Restituisce .L'host e la porta tramite cui la richiesta o la risposta è stata ricevuta. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + Rappresenta un valore di avviso utilizzato dall'intestazione di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + + + Inizializza una nuova istanza della classe . + Codice di avviso specifico. + L'host che ha associato l'avviso. + Una stringa tra virgolette contenente il testo di avviso. + L'indicatore di data e ora dell'avviso. + + + Ottiene l'host che ha associato l'avviso. + Restituisce .L'host che ha associato l'avviso. + + + Ottiene il codice di avviso specifico. + Restituisce .Codice di avviso specifico. + + + Ottiene l'indicatore di data e ora dell'avviso. + Restituisce .L'indicatore di data e ora dell'avviso. + + + Consente di determinare se l'oggetto specificato è uguale all'oggetto corrente. + Restituisce .true se l'oggetto specificato è uguale all'oggetto corrente; in caso contrario, false. + Oggetto da confrontare con l'oggetto corrente. + + + Funge da funzione hash per un oggetto . + Restituisce .Codice hash per l'oggetto corrente. + + + Converte una stringa in un'istanza di . + Restituisce un'istanza di . + Stringa che rappresenta le informazioni sul valore intestazione di autenticazione. + + è un riferimento null. + + non contiene informazioni sul valore dell'intestazione di autenticazione valide. + + + Ottiene una stringa tra virgolette contenente il testo di avviso. + Restituisce .Una stringa tra virgolette contenente il testo di avviso. + + + Restituisce una stringa che rappresenta l'oggetto corrente. + Restituisce .Stringa che rappresenta l'oggetto corrente. + + + Determina se una stringa rappresenta informazioni valide. + Restituisce .true se è valido ; in caso contrario, false. + Stringa da convalidare. + Versione della stringa. + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ja/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ja/a new file mode 100644 index 00000000000..10214bda61e --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ja/a @@ -0,0 +1,2852 @@ + + + + System.Net.Http + + + + バイト配列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + パラメーターが null です。 + + + + クラスの新しいインスタンスを初期化します。 + + の初期化に使用されるコンテンツ。 + + の初期化に使用される パラメーターのオフセット (バイト単位)。 + + を初期化するために使用される パラメーターから始まる のバイト数。 + + パラメーターが null です。 + + パラメーターが 0 未満です。または パラメーターが パラメーターで指定されたコンテンツの長さを超えています。またはパラメーターが 0 未満です。または パラメーターが、 パラメーターで指定されたコンテンツの長さから パラメーターを引いた値を超えています。 + + + バッキング ストアが からのメモリである読み取り用 HTTP コンテンツ ストリームを非同期操作として作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として HTTP コンテンツ ストリームにコンストラクターで提供されるバイト配列をシリアル化して記述します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + バイト配列が有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + バイト配列の長さ (バイト単位)。 + + + クライアント証明書がどのように提供されるかを指定します。 + + + + は、使用できるすべてのクライアント証明書を自動的に提供しようと試みます。 + + + アプリケーションは に、クライアント証明書を手動で提供します。この値が既定値です。 + + + 内部ハンドラーと呼ばれる、別のハンドラーへ HTTP 応答メッセージの処理をデリゲートする HTTP ハンドラーの型。 + + + + クラスの新しいインスタンスを作成します。 + + + 特定の内部ハンドラーを使用して、 クラスの新しいインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答メッセージを処理する内部ハンドラーを取得または設定します。 + + を返します。HTTP 応答メッセージ用の内部ハンドラー。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + application/x-www-form-urlencoded MIME 型を使用してエンコードされた名前と値の組のコンテナー。 + + + 指定した名前と値のペアのコレクションを使用して、 クラスの新しいインスタンスを初期化します。 + 名前と値のペアのコレクション。 + + + URI で識別されるリソースに HTTP 要求を送信し、そのリソースから HTTP 応答を受信するための基本クラスを提供します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + 要求の送信に使用する HTTP ハンドラー スタック。 + + + 指定したハンドラーを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() で破棄する場合は true。内部ハンドラーを再利用する場合は false。 + + + 要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレスを取得または設定します。 + + を返します。要求を送信するときに使用する、インターネット リソースの Uniform Resource Identifier (URI) のベース アドレス。 + + + このインスタンスの保留中の要求をすべてキャンセルします。 + + + 各要求と一緒に送信する必要があるヘッダーを取得します。 + + を返します。各要求と一緒に送信する必要があるヘッダー。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 指定された URI に DELETE 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作としてキャンセル トークンを使用して削除要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + + が使用しているアンマネージ リソースを解放します。オプションとして、マネージ リソースを破棄することもできます。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に GET 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 非同期操作としてHTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + + が null でした。 + + + 非同期操作としてキャンセル トークンおよび HTTP 完了オプションを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + 操作が完了したものと見なすタイミングを示す HTTP 完了オプション値。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作としてキャンセル トークンを使用して GET 要求を指定された Uri に送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をバイト配列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体をストリームとして返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 指定 URI に GET 要求を送信し、非同期操作で応答本体を文字列として返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + + が null でした。 + + + 応答の内容を読み取るときにバッファーに格納できる最大バイト数を取得または設定します。 + + を返します。応答コンテンツを読み取るときに、バッファーに格納できる最大バイト数。このプロパティの既定値は 2 GB です。 + 指定されたサイズがゼロ以下です。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に POST 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + POST 要求をキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 指定された URI に PUT 要求を非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + + が null でした。 + + + PUT 要求をとキャンセル トークンと共に非同期操作として送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 要求の送信先 URI。 + サーバーに送信される HTTP 要求の内容。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作が完了したとき (応答が使用できる状態になった後か、応答コンテンツ全体が読み取られた後)。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + 要求メッセージは既に インスタンスによって送信されました。 + + + 要求がタイムアウトするまで待機する期間を取得または設定します。 + + を返します。要求がタイムアウトするまで待機する期間。 + 指定したタイムアウトが 0 以下のため ではありません。 + 操作は現在のインスタンス上で既に開始されています。 + 現在のインスタンスは破棄されています。 + + + + が使用する既定のメッセージ ハンドラー。 + + + + クラスのインスタンスを作成します。 + + + ハンドラーがリダイレクト応答に従うかどうかを示す値を取得または設定します。 + + を返します。ハンドラーがリダイレクト応答に従う場合は true。それ以外の場合は false。既定値は true です。 + + + HTTP コンテンツ応答の自動圧縮解除のハンドラーが使用する圧縮解除メソッドの種類を取得または設定します。 + + を返します。ハンドラーが使用する自動圧縮解除のメソッド。既定値は です。 + + + このハンドラーに関連付けられるセキュリティ証明書のコレクションを取得または設定します。 + + を返します。このハンドラーに関連付けられているセキュリティ証明書のコレクション。 + + + ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナーを取得または設定します。 + + を返します。ハンドラーがサーバー クッキーを格納するために使用するクッキー コンテナー。 + + + このハンドラーによって使用される認証情報を取得または設定します。 + + を返します。ハンドラーに関連付けられる認証資格情報。既定値は、null です。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + ハンドラーが従うリダイレクトの最大数を取得または設定します。 + + を返します。ハンドラーによって実行されるリダイレクト応答の最大数。既定値は 50 です。 + + + ハンドラーが使用する要求コンテンツ バッファーの最大サイズを取得または設定します。 + + を返します。要求コンテンツ バッファーの最大サイズ (バイト単位)。既定値は 2 GB です。 + + + ハンドラーが要求と共に認証ヘッダーを送信するかどうかを示す値を取得または設定します。 + + を返します。認証が行われた後で、要求と共に HTTP 認証ヘッダーを送信するハンドラーの場合は true。それ以外の場合は false。既定値は、false です。 + + + ハンドラーが使用するプロキシ情報を取得または設定します。 + + を返します。ハンドラーにより使用されるプロキシ情報。既定値は null です。 + + + + で提供される情報に基づいて、ブロックされない操作として のインスタンスを作成します。 + + を返します。非同期操作を表すタスク オブジェクト。 + HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + ハンドラーが自動的な応答内容の圧縮解除をサポートするかどうかを示す値を取得します。 + + を返します。ハンドラーが自動応答の内容の圧縮解除をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーがプロキシ設定をサポートしているかどうかを示す値を取得します。 + + を返します。ハンドラーがプロキシ設定をサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが および プロパティの構成設定をサポートするかどうかを示す値を取得します。 + + を返します。 プロパティと プロパティの構成設定をハンドラーがサポートする場合は true。それ以外の場合は false。既定値は true です。 + + + ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが プロパティを使用してサーバー クッキーを格納し、要求を送信するときにこれらのクッキーを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 既定の資格情報がハンドラーによって要求と共に送信されるかどうかを制御する値を取得または設定します。 + + を返します。既定の資格情報を使用する場合は true。それ以外の場合は false。既定値は false です。 + + + ハンドラーが要求のプロキシを使用するかどうかを示す値を取得または設定します。 + + を返します。ハンドラーが要求に対してプロキシを使用する場合は true。それ以外の場合は false。既定値は true です。 + + + 応答が使用できるようになった場合に 操作が完了したと見なすか、内容を含む応答メッセージ全体を読み取った後に完了したと見なすかを示します。 + + + 操作は、コンテンツを含む全体の応答を読んだ後に完了する必要があります。 + + + 操作は、応答が使用できる状態になった後か、ヘッダーが読み取られた後すぐに完了する必要があります。コンテンツがまだ読み取られていません。 + + + HTTP のエンティティ本体とコンテンツ ヘッダーを表す基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + + + HTTP コンテンツをバイト ストリームにシリアル化し、 パラメーターとして指定されたストリーム オブジェクトにコピーします。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + 非同期操作としてメモリ ストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + RFC 2616 で定義されている HTTP コンテンツ ヘッダーを取得します。 + + を返します。RFC 2616 で定義されているコンテンツ ヘッダー。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてメモリ バッファーに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 使用するバッファーの最大サイズ (バイト単位)。 + + + 非同期操作としてバイト配列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + HTTP コンテンツをシリアル化して、非同期操作としてコンテンツを表すストリームを返します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作として文字列に HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + HTTP コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + HTTP メッセージ ハンドラーの基本型。 + + + + クラスの新しいインスタンスを初期化します。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + アプリケーションが HTTP ハンドラー チェーンに対して メソッドを呼び出せるようにする専用クラス。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + + + 指定した を使用して、 クラスのインスタンスを初期化します。 + HTTP 応答メッセージの処理を行う 。 + 内部ハンドラーを Dispose() が破棄する場合は true、内部ハンドラーを再利用する場合は false。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作として HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 送信する HTTP 要求メッセージ。 + 操作をキャンセルするキャンセル トークン。 + + が null でした。 + + + 標準的な HTTP メソッドの取得と比較を行い、新しい HTTP メソッドを作成するためのヘルパー クラス。 + + + 指定した HTTP メソッドを使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + + + HTTP DELETE プロトコル メソッドを表します。 + + を返します。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較する HTTP メソッド。 + + + 指定した が、現在の と等しいかどうかを判断します。 + + を返します。指定したオブジェクトが現在のオブジェクトと等しい場合は true。それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + HTTP GET プロトコル メソッドを表します。 + + を返します。 + + + この型のハッシュ関数として機能します。 + + を返します。現在の のハッシュ コード。 + + + HTTP HEAD プロトコル メソッドを表します。HEAD メソッドは、サーバーが応答でメッセージ本文は返さずにメッセージ ヘッダーだけを返すこと以外、GET と同じです。 + + を返します。 + + + HTTP メソッド。 + + を返します。 として表される HTTP メソッド。 + + + 2 つの オブジェクトを比較するための等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しい場合は true。それ以外の場合は false。 + 等値演算子の左辺にある 。 + 等値演算子の右辺の 。 + + + 2 つの オブジェクトを比較するための非等値演算子。 + + を返します。指定された パラメーターと パラメーターが等しくない場合は true。それ以外の場合は false。 + 非等値演算子の左辺にある 。 + 非等値演算子の右辺の 。 + + + HTTP OPTIONS プロトコル メソッドを表します。 + + を返します。 + + + URI への追加として新しいエントリをポストするために使用される HTTP POST プロトコル メソッドを表します。 + + を返します。 + + + URI で識別されるエントリを置き換えるために使用される HTTP PUT プロトコル メソッドを表します。 + + を返します。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + HTTP TRACE プロトコル メソッドを表します。 + + を返します。 + + + + クラスによってスローされる例外の基本クラス。 + + + + クラスの新しいインスタンスを初期化します。 + + + 現在の例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + + + 現在の例外と内部例外を記述するメッセージを指定して、 クラスの新しいインスタンスを初期化します。 + 現在の例外を説明するメッセージ。 + 内部例外。 + + + HTTP 要求メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求 を表す文字列。 + + + HTTP メソッドと要求 を使用して、 クラスの新しいインスタンスを初期化します。 + HTTP メソッド。 + 要求する 。 + + + HTTP メッセージの内容を取得または設定します。 + + を返します。メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、マネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 要求ヘッダーのコレクションを取得します。 + + を返します。HTTP 要求ヘッダーのコレクション。 + + + HTTP 要求メッセージで使用される HTTP メソッドを取得または設定します。 + + を返します。要求メッセージによって使用される HTTP メソッド。既定では、GET メソッドです。 + + + HTTP 要求のプロパティのセットを取得します。 + + を返します。 + + + HTTP 要求で使用する を取得または設定します。 + + を返します。HTTP 要求に使用される + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + ステータス コードとデータを含む HTTP 応答メッセージを表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + を指定して、 クラスの新しいインスタンスを初期化します。 + HTTP 応答のステータス コード。 + + + HTTP 応答メッセージの内容を取得または設定します。 + + を返します。HTTP 応答メッセージの内容。 + + + + が使用しているアンマネージ リソースを解放し、アンマネージ リソースを破棄します。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + HTTP 応答の のプロパティが false である場合、例外がスローされます。 + + を返します。呼び出しが成功した場合は HTTP 応答メッセージ。 + + + HTTP 応答ヘッダーのコレクションを取得します。 + + を返します。HTTP 応答ヘッダーのコレクション。 + + + HTTP 応答が成功したかどうかを示す値を取得します。 + + を返します。HTTP 応答が成功したかどうかを示す値。 が 200 ~ 299 の範囲内にあった場合は true。それ以外の場合は false。 + + + 通常はステータス コードと共にサーバーによって送信される理由句を取得または設定します。 + + を返します。サーバーから送信される理由語句。 + + + この応答メッセージの原因となった要求メッセージを取得または設定します。 + + を返します。この応答メッセージの原因となった要求メッセージ。 + + + HTTP 応答のステータス コードを取得または設定します。 + + を返します。HTTP 応答のステータス コード。 + + + 現在のオブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトの文字列形式。 + + + HTTP メッセージ セキュリティのバージョンを取得または設定します。 + + を返します。HTTP メッセージのバージョン。既定値は 1.1 です。 + + + 要求と応答メッセージの小規模な処理のみをするハンドラーの基本型。 + + + + クラスのインスタンスを作成します。 + + + 指定した内部ハンドラーを使用して、 クラスのインスタンスを作成します。 + HTTP 応答メッセージ処理用の内部ハンドラー。 + + + サーバーに送信された各要求の処理を実行します。 + + を返します。処理された HTTP 要求メッセージ。 + 処理する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + サーバーからの各応答の処理を実行します。 + + を返します。処理された HTTP 応答メッセージ。 + 処理する HTTP 応答メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + + 非同期操作としてサーバーに送信する内部ハンドラーに HTTP 要求を送信します。 + + を返します。非同期操作を表すタスク オブジェクト。 + サーバーに送信する HTTP 要求メッセージ。 + キャンセル通知を受け取るために他のオブジェクトまたはスレッドで使用できるキャンセル トークン。 + + が null でした。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + + が null であるか、空白文字だけで構成されています。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート コンテンツのサブタイプ。 + マルチパート コンテンツの境界の文字列。 + + は null か空の文字列でした。 が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + multipart/* のコンテンツ タイプの指定を使用してシリアル化される オブジェクトのコレクションにマルチパート HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + multipart/* のコンテンツ タイプ仕様を使用してシリアル化する オブジェクトのコレクション全体を反復処理する列挙子を返します。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + 非同期操作としてストリームにマルチパート HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + + メソッドの明示的な実装。 + + を返します。コレクションを反復処理するために使用できるオブジェクト。 + + + HTTP マルチパート コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + HTTP コンテンツの長さ (バイト単位)。 + + + マルチパート/フォーム データの MIME タイプを使用してエンコードされたコンテンツのコンテナーを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + + + クラスの新しいインスタンスを作成します。 + マルチパート フォーム データ コンテンツの境界の文字列。 + + が null であるか、空白文字だけで構成されています。または が空白文字で終了します。 + + の長さが 70 を超えていました。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + + が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + マルチパート/フォーム データの MIME の種類にシリアル化される オブジェクトのコレクションに HTTP コンテンツを追加します。 + コレクションに追加する HTTP コンテンツ。 + 追加する HTTP コンテンツの名前。 + コレクションに追加する HTTP コンテンツのファイル名。 + + が null であるか、空白文字だけで構成されています。または が null であるか、空白文字だけで構成されています。 + + が null でした。 + + + ストリームに基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + のバッファーのサイズ (バイト単位)。 + + が null でした。 + + の値が 0 以下です。 + + + 非同期操作としてメモリ ストリームに HTTP ストリーム コンテンツを書き込みます。 + + を返します。非同期操作を表すタスク オブジェクト。 + + + + が使用しているアンマネージ リソースを解放します。オプションでマネージ リソースも破棄します。 + マネージ リソースとアンマネージ リソースの両方を解放する場合は true。アンマネージ リソースだけを解放する場合は false。 + + + 非同期操作としてストリームに HTTP コンテンツをシリアル化します。 + + を返します。非同期操作を表すタスク オブジェクト。 + 対象のストリーム。 + トランスポートに関する情報 (チャネル バインディング トークンなど)。このパラメーターは、null の場合もあります。 + + + ストリーム コンテンツが有効な長さ (バイト単位) かどうかを判断します。 + + を返します。 が有効な長さである場合は true。それ以外の場合は false。 + ストリーム コンテンツの長さ (バイト単位)。 + + + 文字列に基づいて HTTP コンテンツを提供します。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + + + + クラスの新しいインスタンスを作成します。 + + の初期化に使用されるコンテンツ。 + コンテンツに使用するエンコード。 + コンテンツに使用するメディア タイプ。 + + + Authorization、ProxyAuthorization、WWW-Authenticate、および Proxy-Authenticate のヘッダー値の認証情報を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + + + + クラスの新しいインスタンスを初期化します。 + 承認のために使用するスキーム。 + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 要求されたリソースのユーザー エージェントの認証情報を含む資格情報を取得します。 + + を返します。認証情報を格納する資格情報。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 承認のために使用するメソッドを取得します。 + + を返します。承認のために使用するスキーム。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Cache-Control ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + それぞれが省略可能な代入値を持つキャッシュ拡張トークン。 + + を返します。それぞれが省略可能な代入値を持つキャッシュ拡張トークンのコレクション。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + HTTP クライアントが応答を受け入れる最大期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが有効期限を過ぎた応答を受け入れるかどうか。 + + を返します。HTTP クライアントが有効期限を過ぎた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP クライアントが、有効期限を過ぎた応答を受け入れる最長時間 (秒単位)。 + + を返します。時間 (秒) です。 + + + HTTP クライアントが応答を受け入れる鮮度有効期間 (秒単位)。 + + を返します。時間 (秒) です。 + + + キャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなった場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + HTTP クライアントがキャッシュされた応答を受け入れるかどうか。 + + を返します。HTTP クライアントがキャッシュされた応答を受け入れる場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "no-cache" ディレクティブにあるフィールド名のコレクション。 + + を返します。フィールド名のコレクション。 + + + HTTP 要求メッセージまたは応答の一部をキャッシュに保存できないかどうか。 + + を返します。HTTP 要求メッセージおよびあらゆる応答のどの部分もキャッシュに保存できない場合は true。それ以外の場合は false。 + + + キャッシュまたはプロキシがエンティティ本体の側面を変更できないかどうか。 + + を返します。キャッシュまたはプロキシがエンティティ本体のどの側面も変更できない場合は true。それ以外の場合は false。 + + + キャッシュが HTTP 要求の他の制約に準拠しているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答するか。 + + を返します。キャッシュが、HTTP 要求の他の制約に従っているキャッシュ エントリを使用して応答するか、または 504 (ゲートウェイ タイムアウト) ステータスを使用して応答する場合は true。それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + キャッシュ コントロールのヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なキャッシュ コントロール ヘッダー値の情報です。 + + + HTTP 応答メッセージの全体または一部が 1 人のユーザーを対象にしており、共有キャッシュでキャッシュできないかどうか。 + + を返します。HTTP 応答メッセージが 1 名のユーザーを対象にしており、共有キャッシュでキャッシュできない場合は true。それ以外の場合は false。 + + + HTTP 応答のキャッシュ制御ヘッダー フィールドの "private" ディレクティブにあるコレクション フィールド名。 + + を返します。フィールド名のコレクション。 + + + 共有ユーザー エージェント キャッシュのキャッシュ エントリが古くなった場合に、元のサーバーが後で使用するときにキャッシュ エントリの再認証を必要とするかどうか。 + + を返します。キャッシュ エントリが古くなり、共有ユーザー エージェント キャッシュに適切でない場合に、元のサーバーが次の使用時にキャッシュ エントリの再認証を必要とする場合は true。それ以外の場合は false。 + + + 通常、キャッシュ不可である場合や、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答をすべてのキャッシュでキャッシュできるかどうか。 + + を返します。通常はキャッシュ不可であるか、非共有キャッシュ内でのみキャッシュ可能である場合でも、HTTP 応答を任意のキャッシュでキャッシュできる場合は true。それ以外の場合は false。 + + + 共有キャッシュのキャッシュ制御ヘッダーまたは expires ヘッダーに対する "最大年齢" ディレクティブをオーバーライドする HTTP 応答における、共有最大期間 (秒単位で指定)。 + + を返します。時間 (秒) です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Disposition ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + ファイルが作成された日付。 + + を返します。ファイルの作成日。 + + + コンテンツ本体の配置タイプ。 + + を返します。配置タイプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。推奨ファイル名。 + + + エンティティがデタッチされ別のファイルに格納される場合に使用されるメッセージ ペイロードを格納するためのファイル名の構成方法の提案。 + + を返します。フォームの filename* の推奨ファイル名。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ファイルが最後に変更された日付。 + + を返します。ファイルの変更日。 + + + コンテンツ本体の名前。 + + を返します。コンテンツ本体の名前。 + + + パラメーター セットには、Content-Disposition ヘッダーが含まれていました。 + + を返します。パラメーターのコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ配置ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ配置ヘッダー値の情報です。 + + + ファイルの読み取りが行われた最後の日付。 + + を返します。最後に読み取った日付。 + + + ファイルのおおよそのサイズ (バイト単位)。 + + を返します。おおよそのサイズ (バイト単位)。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Content-Range ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 範囲の開始点または終了点 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置 (バイト単位)。 + データの送信を終了する位置 (バイト単位)。 + 範囲の開始点または終了点 (バイト単位)。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置 (バイト単位)。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + Content-Range ヘッダーが指定された長さかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された長さである場合は true、それ以外の場合は false。 + + + Content-Range に指定された範囲があるかどうかを取得します。 + + を返します。Content-Range ヘッダーが指定された範囲である場合は true、それ以外の場合は false。 + + + 完全なエンティティ本体の長さを取得します。 + + を返します。フル エンティティ本体の長さ。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + コンテンツ範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なコンテンツ範囲ヘッダー値の情報です。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 使用する範囲の単位。 + + を返します。範囲の単位を含む + + + エンティティ タグのヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + + + + クラスの新しいインスタンスを初期化します。 + + を含む文字列。 + このエンティティ タグ ヘッダーが弱い検証コントロールかどうかを示す値。エンティティ タグ ヘッダーが弱い検証コントロールの場合は、 を true に設定します。エンティティ タグ ヘッダーが強い検証コントロールの場合は、 を false に設定します。 + + + エンティティ タグのヘッダー値を取得します。 + + を返します。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + エンティティ タグの前に脆弱性インジケーターが付いているかどうかを取得します。 + + を返します。エンティティ タグの前に脆弱性インジケーターが付いている場合は true、それ以外の場合は false。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + エンティティ タグ ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なエンティティ タグ ヘッダー値の情報です。 + + + opaque 引用符で囲まれた文字列を取得します。 + + を返します。不透明な引用符で囲まれた文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義されているコンテンツ ヘッダーのコレクションを表します。 + + + HTTP 応答の Allow コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Allow ヘッダーの値。 + + + HTTP 応答の Content-Disposition コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Disposition コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Encoding コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Encoding コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Language コンテンツ ヘッダーの値を取得します。 + + を返します。HTTP 応答の Content-Language コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Length コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Length コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Location コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Location コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-MD5 コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-MD5 コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Range コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Range コンテンツ ヘッダーの値。 + + + HTTP 応答の Content-Type コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Content-Type コンテンツ ヘッダーの値。 + + + HTTP 応答の Expires コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Expires コンテンツ ヘッダーの値。 + + + HTTP 応答の Last-Modified コンテンツ ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Last-Modified コンテンツ ヘッダーの値。 + + + RFC 2616 で定義されているヘッダーおよび値のコレクション。 + + + + クラスの新しいインスタンスを初期化します。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + コレクションに追加するヘッダー値のリスト。 + + + + コレクションに指定のヘッダーと値を追加します。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + + コレクションからすべてのヘッダーを削除します。 + + + 特定のヘッダーが コレクションに存在するかどうかを返します。 + + を返します。指定したヘッダーがコレクション内に存在する場合は true、それ以外の場合は false。 + 特定のヘッダー。 + + + + インスタンスを反復処理できる列挙子を返します。 + + を返します。 の列挙子。 + + + + コレクションに格納されている指定したヘッダーのすべてのヘッダー値を返します。 + + を返します。ヘッダー文字列の配列。 + 値を返す指定されたヘッダー。 + + + 指定したヘッダーを コレクションから削除します。 + + を返します。 + コレクションから削除するヘッダーの名前。 + + + + を反復処理できる列挙子を取得します。 + + を返します。 を反復処理できる を実装するインスタンス。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの値。 + + + 提供された情報を検証せずに コレクションに指定されたヘッダーとその値が追加されたかどうかを示す値を返します。 + + を返します。指定したヘッダーの をコレクションに追加できた場合は true。それ以外の場合は false。 + コレクションに追加するヘッダー。 + ヘッダーの内容。 + + + 指定されたヘッダーと指定された値が コレクションに格納されているかどうかを返します。 + + を返します。指定されたヘッダー および values がコレクションに格納されている場合は true。それ以外の場合は false。 + 指定されたヘッダー。 + 指定したヘッダー値。 + + + ヘッダー値のコレクションを表します。 + ヘッダー コレクションの型。 + + + + にエントリを追加します。 + ヘッダー コレクションに追加する項目。 + + + + からすべてのエントリを削除します。 + + + + に項目が格納されているかどうかを確認します。 + + を返します。エントリが インスタンスに含まれている場合は true。それ以外の場合は false。 + ヘッダー コレクションから検索する項目。 + + + + 全体を互換性のある 1 次元の にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 + + から要素をコピーする、1 次元の です。 には、0 から始まるインデックス番号が必要です。 + コピーの開始位置となる、 内の 0 から始まるインデックス。 + + + + 内のヘッダーの数を取得します。 + + を返します。コレクション内のヘッダーの数。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + + インスタンスが読み取り専用かどうかを示す値を取得します。 + + を返します。 インスタンスが読み取り専用の場合は true。それ以外の場合は false。 + + + + にエントリを解析して追加します。 + 追加するエントリ。 + + + 指定した項目を から削除します。 + + を返します。 インスタンスから削除された場合は true。それ以外の場合は false。 + 削除する項目。 + + + + を反復処理する列挙子を返します。 + + を返します。 インスタンスの列挙子。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 入力を解析して に追加できるかどうかを判断します。 + + を返します。 を解析して インスタンスに追加できる場合は true。それ以外の場合は false + 検証するエントリ。 + + + RFC 2616 で定義されている要求ヘッダーのコレクションを表します。 + + + HTTP 要求の Accept ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept ヘッダーの値。 + + + HTTP 要求の Accept-Charset ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Charset ヘッダーの値。 + + + HTTP 要求の Accept-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Encoding ヘッダーの値。 + + + HTTP 要求の Accept-Language ヘッダーの値を取得します。 + + を返します。HTTP 要求の Accept-Language ヘッダーの値。 + + + HTTP 要求の Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Authorization ヘッダーの値。 + + + HTTP 要求の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Cache-Control ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーの値を取得します。 + + を返します。HTTP 要求の Connection ヘッダーの値。 + + + HTTP 要求の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Date ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーの値を取得します。 + + を返します。HTTP 要求の Expect ヘッダーの値。 + + + HTTP 要求の Expect ヘッダーに Continue が含まれるかどうかを示す値を取得または設定します。 + + を返します。Expect ヘッダーに Continue が含まれる場合は true。それ以外の場合は false。 + + + HTTP 要求の From ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の From ヘッダーの値。 + + + HTTP 要求の Host ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Host ヘッダーの値。 + + + HTTP 要求の If-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-Match ヘッダーの値。 + + + HTTP 要求の If-Modified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Modified-Since ヘッダーの値。 + + + HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + を返します。HTTP 要求の If-None-Match ヘッダーの値を取得します。 + + + HTTP 要求の If-Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Range ヘッダーの値。 + + + HTTP 要求の If-Unmodified-Since ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の If-Unmodified-Since ヘッダーの値。 + + + HTTP 要求の Max-Forwards ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Max-Forwards ヘッダーの値。 + + + HTTP 要求の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 要求の Pragma ヘッダーの値。 + + + HTTP 要求の Proxy-Authorization ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Proxy-Authorization ヘッダーの値。 + + + HTTP 要求の Range ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Range ヘッダーの値。 + + + HTTP 要求の Referer ヘッダーの値を取得または設定します。 + + を返します。HTTP 要求の Referer ヘッダーの値。 + + + HTTP 要求の TE ヘッダーの値を取得します。 + + を返します。HTTP 要求の TE ヘッダーの値。 + + + HTTP 要求の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 要求の Trailer ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 要求の Transfer-Encoding ヘッダーの値。 + + + HTTP 要求の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 要求の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 要求の Upgrade ヘッダーの値。 + + + HTTP 要求の User-Agent ヘッダーの値を取得します。 + + を返します。HTTP 要求の User-Agent ヘッダーの値。 + + + HTTP 要求の Via ヘッダーの値を取得します。 + + を返します。HTTP 要求の Via ヘッダーの値。 + + + HTTP 要求の Warning ヘッダーの値を取得します。 + + を返します。HTTP 要求の Warning ヘッダーの値。 + + + RFC 2616 で定義されている応答ヘッダーのコレクションを表します。 + + + HTTP 応答の Accept-Ranges ヘッダーの値を取得します。 + + を返します。HTTP 応答の Accept-Ranges ヘッダーの値。 + + + HTTP 応答の Age ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Age ヘッダーの値。 + + + HTTP 応答の Cache-Control ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Cache-Control ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーの値を取得します。 + + を返します。HTTP 応答の Connection ヘッダーの値。 + + + HTTP 応答の Connection ヘッダーに Close が含まれるかどうかを示す値を取得または設定します。 + + を返します。Connection ヘッダーに Close が含まれる場合は true。それ以外の場合は false。 + + + HTTP 応答の Date ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Date ヘッダーの値。 + + + HTTP 応答の ETag ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の ETag ヘッダーの値。 + + + HTTP 応答の Location ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Location ヘッダーの値。 + + + HTTP 応答の Pragma ヘッダーの値を取得します。 + + を返します。HTTP 応答の Pragma ヘッダーの値。 + + + HTTP 応答の Proxy-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の Proxy-Authenticate ヘッダーの値。 + + + HTTP 応答の Retry-After ヘッダーの値を取得または設定します。 + + を返します。HTTP 応答の Retry-After ヘッダーの値。 + + + HTTP 応答の Server ヘッダーの値を取得します。 + + を返します。HTTP 応答の Server ヘッダーの値。 + + + HTTP 応答の Trailer ヘッダーの値を取得します。 + + を返します。HTTP 応答の Trailer ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーの値を取得します。 + + を返します。HTTP 応答の Transfer-Encoding ヘッダーの値。 + + + HTTP 応答の Transfer-Encoding ヘッダーに chunked が含まれるかどうかを示す値を取得または設定します。 + + を返します。Transfer-Encoding ヘッダーに chunked が含まれている場合は true。それ以外の場合は false。 + + + HTTP 応答の Upgrade ヘッダーの値を取得します。 + + を返します。HTTP 応答の Upgrade ヘッダーの値。 + + + HTTP 応答の Vary ヘッダーの値を取得します。 + + を返します。HTTP 応答の Vary ヘッダーの値。 + + + HTTP 応答の Via ヘッダーの値を取得します。 + + を返します。HTTP 応答の Via ヘッダーの値。 + + + HTTP 応答の Warning ヘッダーの値を取得します。 + + を返します。HTTP 応答の Warning ヘッダーの値。 + + + HTTP 応答の WWW-Authenticate ヘッダーの値を取得します。 + + を返します。HTTP 応答の WWW-Authenticate ヘッダーの値。 + + + RFC 2616 に定義され、コンテンツ タイプのヘッダーに使用されるメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化する文字列を表すソースです。 + + + 文字セットを取得または設定します。 + + を返します。文字セット。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + メディア種類のヘッダー値を取得または設定します。 + + を返します。メディア タイプ ヘッダー値。 + + + メディア種類のヘッダー値のパラメーターを取得または設定します。 + + を返します。メディア タイプ ヘッダー値パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + メディア種類のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効なメディア タイプ ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + コンテンツ タイプ ヘッダーで使用される追加の品質ファクターとメディア タイプを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するための文字列として表現された 。 + このヘッダー値に関連付けられた品質です。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を含むメディア種類を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効なメディア タイプではありません。 + + + + の品質評価の値を取得または設定します。 + + を返します。 オブジェクトの品質評価の値。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用される名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + ヘッダー名を取得します。 + + を返します。ヘッダーの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 名前の値のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な名前の値のヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ヘッダー値を取得します。 + + を返します。ヘッダー値。 + + + RFC 2616 で定義され、さまざまなヘッダーで使用されるパラメーター付きの名前と値のペアを表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + + + + クラスの新しいインスタンスを初期化します。 + ヘッダーの名前。 + ヘッダー値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + + オブジェクトからパラメーターを取得します。 + + を返します。パラメーターを含むコレクション。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + パラメーター ヘッダー値の情報を含む、名前の値を表す文字列。 + + が null 参照です。 + + はパラメーター ヘッダー値の情報を含む有効な名前の値ではありません。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + ユーザー エージェント ヘッダー内の製品トークン値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 製品トークンの名前を取得します。 + + を返します。製品トークンの名前。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 製品のヘッダー値の情報を表す文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 製品トークンのバージョンを取得します。 + + を返します。製品トークンのバージョン。 + + + User-Agent ヘッダー内の製品またはコメントのいずれかになる値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + コメント値。 + + + + クラスの新しいインスタンスを初期化します。 + 製品名の値。 + 製品バージョンの値。 + + + + オブジェクトからコメントを取得します。 + + を返します。この のコメントの値です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 情報のヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な製品情報ヘッダー値の情報です。 + + + + オブジェクトから製品を取得します。 + + を返します。この からの製品の値です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 日付/時刻またはエンティティ タグ値のいずれかとなる If-Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される日付の値。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される文字列として表現されたエンティティ タグ。 + + + + オブジェクトから日付を取得します。 + + を返します。 オブジェクトからのデータです。 + + + + オブジェクトからエンティティ タグを取得します。 + + を返します。 オブジェクトのエンティティ タグです。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + + + バイト範囲を使用して、 クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 範囲ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な範囲ヘッダー値の情報です。 + + + + オブジェクトから指定した範囲を取得します。 + + を返します。 オブジェクトからの範囲です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから単位を取得します。 + + を返します。 オブジェクトからの単位です。 + + + バイト範囲の Range ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + データの送信を開始する位置。 + データの送信を終了する位置。 + + より大または または が 0 未満です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + データの送信を開始する位置を取得します。 + + を返します。データの送信を開始する位置。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + データの送信を終了する位置を取得します。 + + を返します。データの送信を終了する位置。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 日付/時刻または期間値のいずれかとなる Retry-After ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する日付と時刻のオフセット。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用される、秒単位の差分です。 + + + + オブジェクトから日付と時刻のオフセットを取得します。 + + を返します。 オブジェクトからの日付と時刻のオフセット。 + + + + オブジェクトから秒単位の差分を取得します。 + + を返します。 オブジェクトの秒単位の差分です。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 再試行条件ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な再試行条件ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + オプションの品質と文字列ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 新しいインスタンスを初期化するために使用される品質要素。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 品質ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な文字列ではありません。 + + + + オブジェクトから品質係数を取得します。 + + を返します。 オブジェクトからの品質係数です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + + オブジェクトから文字列値を取得します。 + + を返します。 オブジェクトから取得された文字列値。 + + + Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する オブジェクト。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + 指定のオブジェクトが現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 転送コーディング パラメーターを取得します。 + + を返します。転送コーディング パラメーター。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な転送コーディング ヘッダー値の情報です。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 転送コーディング値を取得します。 + + を返します。転送コーディング値。 + + + オプションの品質要素と Accept-Encoding ヘッダー値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 新しいインスタンスを初期化するために使用する文字列。 + 品質係数の値。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + 転送コーディング値の情報を表す文字列。 + + が null 参照です。 + + は品質ヘッダー値の情報を含む有効な転送コーディングではありません。 + + + + から品質係数を取得します。 + + を返します。 からの品質係数です。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + Via ヘッダーの値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + + + + クラスの新しいインスタンスを初期化します。 + 受信したプロトコルのプロトコル バージョン。 + 要求または応答が受信されたホストとポート。 + 受信したプロトコルのプロトコル名。 + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールドを取得します。 + + を返します。受信者プロキシまたはゲートウェイのソフトウェアを識別するために使用されるコメント フィールド。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コードを返します。 + + + 文字列を インスタンスに変換します。 + + を返します。 のインスタンス。 + Via ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な Via ヘッダー値の情報です。 + + + 受信したプロトコルのプロトコル名を取得します。 + + を返します。プロトコル名。 + + + 受信したプロトコルのプロトコル バージョンを取得します。 + + を返します。プロトコル バージョン。 + + + 要求または応答が受信されたホストとポートを取得します。 + + を返します。要求または応答が受信されたホストとポート。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + 警告ヘッダーで使用される警告値を表します。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + + + + クラスの新しいインスタンスを初期化します。 + 特定の警告コード。 + 警告をアタッチしたホスト。 + 警告テキストを含む引用文字列。 + 警告の日付およびタイムスタンプ。 + + + 警告をアタッチしたホストを取得します。 + + を返します。警告をアタッチしたホスト。 + + + 特定の警告コードを取得します。 + + を返します。特定の警告コード。 + + + 警告の日付/タイム スタンプを取得します。 + + を返します。警告の日付およびタイムスタンプ。 + + + 指定した が、現在の オブジェクトと等しいかどうかを判断します。 + + を返します。指定した が現在のオブジェクトと等しい場合は true、それ以外の場合は false。 + 現在のオブジェクトと比較するオブジェクト。 + + + + オブジェクトのハッシュ関数として機能します。 + + を返します。現在のオブジェクトのハッシュ コード。 + + + 文字列を インスタンスに変換します。 + + のインスタンスを返します。 + 認証ヘッダー値の情報を表す文字列。 + + が null 参照です。 + + は無効な認証ヘッダー値の情報です。 + + + 警告テキストを含む引用文字列を取得します。 + + を返します。警告テキストを含む引用文字列。 + + + 現在の オブジェクトを表す文字列を返します。 + + を返します。現在のオブジェクトを表す文字列。 + + + 文字列が有効な 情報かどうかを判断します。 + + を返します。 が有効な 情報である場合は true。それ以外の場合は false。 + 検証対象の文字列。 + 文字列の バージョン。 + + + \ No newline at end of file diff --git a/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ko/a b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ko/a new file mode 100644 index 00000000000..3034f4eded7 --- /dev/null +++ b/src/packages/System.Net.Http.4.3.1/ref/netstandard1.3/ko/a @@ -0,0 +1,2846 @@ + + + + System.Net.Http + + + + 바이트 배열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 매개 변수가 null입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 를 초기화하는 데 사용되는 매개 변수의 오프셋(바이트)입니다. + + 를 초기화하기 위해 사용되는 매개 변수에서 시작하는 의 바이트 수입니다. + + 매개 변수가 null입니다. + + 매개 변수가 0 미만인 경우또는 매개 변수의 값이 매개 변수가 지정한 콘텐츠 길이보다 큽니다.또는 매개 변수가 0보다 작은 경우또는 매개 변수가 매개 변수에서 지정한 콘텐츠 길이에서 매개 변수를 뺀 값보다 큽니다. + + + 백업 저장소가 의 메모리인 HTTP 콘텐츠 스트림을 읽기 위한 비동기 작업으로 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 생성자가 제공한 바이트 배열을 HTTP 콘텐츠 스트림에 비동기 작업으로 serialize하고 씁니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 채널 바인딩 토큰과 같은 전송에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 바이트 배열의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 바이트 배열의 길이(바이트)입니다. + + + 클라이언트 인증서 제공 방식을 지정합니다. + + + 사용 가능한 모든 클라이언트 인증서를 자동으로 제공하려는 입니다. + + + 응용 프로그램은 클라이언트 인증서를 에 수동으로 제공합니다.이 값이 기본값입니다. + + + HTTP 응답 메시지의 처리를 내부 처리기라는 다른 처리기로 위임하는 HTTP 처리기의 형식입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 새 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 필요에 따라 관리되는 리소스를 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답 메시지를 처리하는 내부 처리기를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지에 대한 내부 처리기입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다. 비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + application/x-www-form-urlencoded MIME 형식을 사용하여 인코딩된 이름/값 튜플의 컨테이너입니다. + + + 이름/값 쌍의 특정 컬렉션을 사용하여 클래스의 새 인스턴스를 초기화합니다. + 이름/값 쌍으로 된 컬렉션입니다. + + + URI로 식별되는 리소스에서 HTTP 요청을 보내고 HTTP 응답을 받기 위한 기본 클래스를 제공합니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 요청을 보내는 데 사용할 HTTP 처리기 스택입니다. + + + 특정 처리기를 사용하여 클래스의 새 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소를 가져오거나 설정합니다. + + 를 반환합니다.요청을 보낼 때 사용된 인터넷 리소스의 URI(Uniform Resource Identifier)의 기준 주소입니다. + + + 이 인스턴스에서 보류 중인 모든 요청을 취소합니다. + + + 각 요청과 함께 보내야 하는 헤더를 가져옵니다. + + 를 반환합니다.각 요청과 함께 보내야 하는 헤더입니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + DELETE 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 취소 토큰이 포함된 지정한 URI에 DELETE 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 삭제할 수 있습니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true, 관리되지 않는 리소스만 해제하려면 false입니다. + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + HTTP 완료 옵션이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + + 이 null인 경우 + + + HTTP 완료 옵션 및 취소 토큰을 사용하여 지정한 URL에 비동기 작업으로 GET 요청을 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 작업이 완료된 것으로 간주해야 할 때를 나타내는 HTTP 완료 옵션 값입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 지정한 URI에 GET 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 바이트 배열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 스트림으로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + GET 요청을 지정된 URI에 보내고 비동기 작업에서 문자열로 응답 본문을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + + 이 null인 경우 + + + 응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수를 가져오거나 설정합니다. + + 를 반환합니다.응답 콘텐츠를 읽을 경우 버퍼링할 최대 바이트 수입니다.이 속성의 기본값은 2GB입니다. + 지정한 크기가 0보다 작거나 같습니다. + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + POST 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 POST 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + PUT 요청을 지정된 URI에 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + + 이 null인 경우 + + + 취소 토큰이 포함된 PUT 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 요청이 전송되는 URI입니다. + 서버로 전송된 HTTP 요청 콘텐츠입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 완료해야 할 경우(응답을 사용할 수 있게 된 즉시 또는 전체 응답 내용을 읽은 후). + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + 요청 메시지를 인스턴스에서 이미 보냈습니다. + + + 요청 시간 제한 범위 내에서 대기할 기간을 가져오거나 설정합니다. + + 를 반환합니다.요청 시간 제한 범위 내에서 대기할 기간입니다. + 지정된 제한 시간이 0보다 작거나 같고 가 아닌 경우 + 현재 인스턴스에서 이미 작업이 시작되었습니다. + 현재 인스턴스가 삭제된 경우 + + + + 에 사용되는 기본 메시지 처리기입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 처리기가 리디렉션 응답을 따르는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기가 리디렉션 응답을 따라야 하는 경우 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + HTTP 콘텐츠 응답의 자동 압축 해체를 위한 처리기에서 사용되는 압축 해제 메서드의 형식을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 사용되는 자동 압축 풀기 방법입니다.기본값은 입니다. + + + 이 처리기와 관련된 보안 인증서의 컬렉션을 가져오거나 설정합니다. + + 를 반환합니다.이 처리기에 연결된 보안 인증서의 컬렉션입니다. + + + 처리기에서 서버 쿠키를 저장하는 데 사용하는 쿠키 컨테이너를 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 서버 쿠키를 저장하는 데 사용되는 쿠키 컨테이너입니다. + + + 이 처리기가 사용하는 인증 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기와 연결된 인증 자격 증명입니다.기본값은 null입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + 처리기가 따르는 최대 리디렉션 수를 가져오거나 설정합니다. + + 를 반환합니다.처리기가 따르는 최대 리디렉션 응답 수입니다.기본값은 50입니다. + + + 처리기에 사용되는 최대 요청 콘텐츠 버퍼 크기를 가져오거나 설정합니다. + + 를 반환합니다.최대 요청 콘텐츠 버퍼 크기(바이트)입니다.기본값은 2GB입니다. + + + 요청과 함께 처리기가 인증 헤더를 보낼 것인지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.인증을 수행한 이후 처리기가 요청과 함께 HTTP 권한 부여 헤더를 함께 보내는 경우 true 이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 사용하는 프록시 정보를 가져오거나 설정합니다. + + 를 반환합니다.처리기에 사용되는 프록시 정보입니다.기본값은 null입니다. + + + 차단되지 않을 작업으로 에서 제공된 정보를 기반으로 의 인스턴스를 만듭니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 처리기가 자동 응답 콘텐츠 압축 해제를 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기가 자동 응답 콘텐츠 압축 풀기를 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 프록시 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 프록시 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성에 대한 구성 설정을 지원하는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.처리기에서 속성에 대한 구성 설정을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 처리기가 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다. 속성을 사용하여 서버 쿠키를 저장하고 요청을 보낼 때 이러한 쿠키를 사용하는 것을 지원하면 true이고, 그렇지 않으면 false입니다.기본값은 true입니다. + + + 기본 자격 증명을 처리기의 요청과 함께 보내는지 여부를 제어하는 값을 가져오거나 설정합니다. + + 를 반환합니다.기본 자격 증명이 사용되면 true이고, 그렇지 않으면 false입니다.기본값은 false입니다. + + + 처리기가 요청에 대해 프록시를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.처리기에서 요청에 대해 프록시를 사용해야 하는 경우 true이고, otherwise false.기본값은 true입니다. + + + + 작업이 응답이 가능하면 즉시 완료된 것으로 간주되어야 하는지, 아니면 콘텐츠가 담긴 전체 응답 메시지를 읽은 후 완료된 것으로 간주되어야 하는지 여부를 나타냅니다. + + + 콘텐츠를 포함하여 전체 응답을 읽은 후 작업을 완료 해야 합니다. + + + 응답이 가능하고 헤더를 읽는 즉시 작업을 완료해야 합니다.콘텐츠를 아직 읽지 않았습니다. + + + HTTP 엔터티 본문과 콘텐츠 헤더를 나타내는 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + + + HTTP 콘텐츠를 바이트 스트림으로 serialize하고 매개 변수로 제공된 스트림 개체로 복사합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠를 메모리 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + RFC 2616에 정의된 HTTP 콘텐츠 헤더를 가져옵니다. + + 를 반환합니다.RFC 2616에 정의된 콘텐츠 헤더입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 메모리 버퍼에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 사용할 버퍼의 최대 크기(바이트)입니다. + + + HTTP 콘텐츠를 바이트 배열에 비동기 작업으로 Serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 serialize하고 콘텐츠를 비동기 작업으로 나타내는 스트림을 반환합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 문자열에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + HTTP 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HTTP 콘텐츠의 길이(바이트)입니다. + + + HTTP 메시지 처리기의 기본 형식입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 응용 프로그램이 Http 처리기 체인에서 메서드를 호출할 수 있는 특수 클래스입니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + + + 특정 를 사용하여 클래스의 인스턴스를 초기화합니다. + + 는 HTTP 응답 메시지의 처리를 담당합니다. + Dispose()가 내부 처리기를 삭제해야 하는 경우 true이고, 내부 처리기를 다시 사용하려고 하는 경우 false입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청을 비동기 작업으로 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 보낼 HTTP 요청 메시지입니다. + 작업을 취소할 취소 토큰입니다. + + 이 null인 경우 + + + 표준 HTTP 메서드를 검색 및 비교하고 새 HTTP 메서드를 만들기 위한 도우미 클래스입니다. + + + 특정 HTTP 메서드를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + + + HTTP DELETE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 HTTP 메서드입니다. + + + 지정한 가 현재 와 같은지 여부를 확인합니다. + + 를 반환합니다.지정한 개체가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + HTTP GET 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 이 형식에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 의 해시 코드입니다. + + + HTTP HEAD 프로토콜 메서드를 나타냅니다.HEAD 메서드는 서버에서 응답의 메시지 본문 없이 메시지 헤더만 반환한다는 점을 제외하고는 GET 메서드와 동일합니다. + + 를 반환합니다. + + + HTTP 메서드입니다. + + 를 반환합니다.으로 표시되는 HTTP 메서드입니다. + + + 개체를 비교하는 같음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같으면 true이고, 그렇지 않으면 false입니다. + 같음 연산자의 왼쪽에 있는 입니다. + 같음 연산자의 오른쪽에 있는 입니다. + + + 개체를 비교하는 같지 않음 연산자입니다. + + 를 반환합니다.지정된 매개 변수가 같지 않으면 true이고, 그렇지 않으면 false입니다. + 같지 않음 연산자의 왼쪽에 있는 입니다. + 같지 않음 연산자의 오른쪽에 있는 입니다. + + + HTTP OPTIONS 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 새 엔터티를 URI에 추가할 항목으로 게시하는 데 사용되는 HTTP POST 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + URI로 식별된 엔터티를 바꾸는 데 사용되는 HTTP PUT 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + HTTP TRACE 프로토콜 메서드를 나타냅니다. + + 를 반환합니다. + + + + 클래스가 throw하는 예외의 기본 클래스입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 현재 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + + + 현재 예외 및 내부 예외를 설명하는 특정 메시지를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 현재 예외를 설명하는 메시지입니다. + 내부 예외입니다. + + + HTTP 요청 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청 를 나타내는 문자열입니다. + + + HTTP 메서드 및 요청 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 메서드입니다. + 요청할 입니다. + + + HTTP 메시지의 내용을 가져오거나 설정합니다. + + 를 반환합니다.메시지 내용 + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 요청 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 요청 헤더의 컬렉션입니다. + + + HTTP 요청 메서드에서 사용하는 HTTP 메서드를 가져오거나 설정합니다. + + 를 반환합니다.요청 메시지에서 사용하는 HTTP 메서드입니다.기본값은 GET 메서드입니다. + + + HTTP 요청의 속성 집합을 가져옵니다. + + 를 반환합니다. + + + HTTP 요청에 대한 를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청에 사용되는 입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 상태 코드와 데이터가 포함된 HTTP 응답 메시지를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 특정 를 사용하여 클래스의 새 인스턴스를 초기화합니다. + HTTP 응답의 상태 코드입니다. + + + HTTP 응답 메시지의 텍스트 콘텐츠를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답 메시지의 내용입니다. + + + 관리되지 않는 리소스를 해제하고, 에서 사용하는 관리되지 않는 리소스를 삭제합니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 응답의 속성이 false이면 예외를 throw합니다. + + 를 반환합니다.호출이 성공할 경우 HTTP 응답 메시지입니다. + + + HTTP 응답 헤더의 컬렉션을 가져옵니다. + + 를 반환합니다.HTTP 응답 헤더의 컬렉션입니다. + + + HTTP 응답이 성공했는지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다.HTTP 응답이 성공했는지 여부를 나타내는 값입니다.가 200-299 범위에 있으면 true이고, 그렇지 않으면 false입니다. + + + 일반적으로 서버에서 상태 코드와 함께 보내는 원인 문구를 가져오거나 설정합니다. + + 를 반환합니다.서버에서 보낸 원인 문구입니다. + + + 이 응답 메시지를 유도하는 요청 메시지를 가져오거나 설정합니다. + + 를 반환합니다.이 응답 메시지를 유도하는 요청 메시지입니다. + + + HTTP 응답의 상태 코드를 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 상태 코드입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체의 문자열 표현입니다. + + + HTTP 메시지 버전을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 메시지 버전입니다.기본값은 1.1입니다. + + + 요청 및/또는 응답 메시지의 적은 처리만 수행하는 처리기의 기본 형식입니다. + + + + 클래스의 인스턴스를 만듭니다. + + + 특정 내부 처리기를 사용하여 클래스의 인스턴스를 만듭니다. + HTTP 응답 메시지 처리를 담당하는 내부 처리기입니다. + + + 서버에 보낸 각 요청에서 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 요청 메시지입니다. + 처리할 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 서버에서 각 응답에 처리를 수행합니다. + + 를 반환합니다.처리된 HTTP 응답 메시지입니다. + 처리할 HTTP 응답 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + + 비동기 작업으로 서버에 보내기 위해 HTTP 요청을 내부 처리기에 보냅니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 서버에 보낼 HTTP 요청 메시지입니다. + 취소의 통지를 받기 위해 다른 개체나 스레드에서 사용할 수 있는 취소 토큰입니다. + + 이 null인 경우 + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션을 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + + 이 null이거나 공백 문자만 있는 경우 + + + + 클래스의 새 인스턴스를 만듭니다. + 여러 부분으로 구성된 콘텐츠의 하위 형식입니다. + 여러 부분으로 구성된 콘텐츠에 대한 경계 문자열입니다. + + 이 null이거나 빈 문자열인 경우가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/* 콘텐츠 형식 지정을 사용하여 serialize된 개체의 컬렉션에 multipart HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + multipart/* 콘텐츠 형식 사양을 통해 serialize된 개체의 컬렉션 사이를 이동하는 열거자를 반환합니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + multipart HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + + 메서드의 명시적 구현입니다. + + 를 반환합니다.컬렉션을 반복하는 데 사용할 수 있는 개체입니다. + + + HTTP multipart 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + HHTP 콘텐츠의 길이(바이트)입니다. + + + multipart/form-data MIME 형식을 사용하여 인코딩된 콘텐츠에 대한 컨테이너를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + + + 클래스의 새 인스턴스를 만듭니다. + 데이터 콘텐츠에서 여러 부분으로 구성된 경계 문자열입니다. + + 가 null이거나 공백 문자만 있는 경우또는가 공백 문자로 끝나는 경우 + + 의 길이가 70보다 큽니다. + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + + 이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + multipart/form-data MIME 형식으로 serialize되는 개체의 컬렉션에 HTTP 콘텐츠를 추가합니다. + 컬렉션에 추가할 HTTP 콘텐츠입니다. + 추가할 HTTP 콘텐츠의 이름입니다. + 컬렉션에 추가할 HTTP 콘텐츠의 파일 이름입니다. + + 이 null이거나 공백 문자만 있는 경우또는이 null이거나 공백 문자만 있는 경우 + + 이 null인 경우 + + + 스트림에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + 에 대한 버퍼의 크기(바이트)입니다. + + 이 null인 경우 + + 가 0보다 작거나 같은 경우 + + + HTTP 스트림을 메모리 스트림에 비동기 작업으로 씁니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + + + + 에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 삭제합니다. + 관리되는 리소스와 관리되지 않는 리소스를 모두 해제하려면 true로 설정하고, 관리되지 않는 리소스만 해제하려면 false로 설정합니다. + + + HTTP 콘텐츠를 스트림에 비동기 작업으로 serialize합니다. + + 를 반환합니다.비동기 작업(operation)을 나타내는 작업(task) 개체입니다. + 대상 스트림입니다. + 전송(예를 들어, 채널 바인딩 토큰)에 대한 정보입니다.이 매개 변수는 null일 수 있습니다. + + + 스트림 콘텐츠의 바이트 길이가 유효한지 여부를 확인합니다. + + 를 반환합니다.가 유효한 길이이면 true이고, 그렇지 않으면 false입니다. + 스트림 콘텐츠의 길이(바이트)입니다. + + + 문자열에 따라 HTTP 콘텐츠를 제공합니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + + + + 클래스의 새 인스턴스를 만듭니다. + + 를 초기화하는 데 사용되는 콘텐츠입니다. + 콘텐츠에 사용할 인코딩입니다. + 콘텐츠에 사용할 미디어 형식입니다. + + + 권한 부여, ProxyAuthorization, WWW-Authneticate 및 Proxy-Authenticate 헤더 값의 인증 정보를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 권한 부여에 사용할 스키마입니다. + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 요청되는 리소스에 대한 사용자 에이전트의 인증 정보를 포함하는 자격 증명을 가져옵니다. + + 를 반환합니다.인증 정보가 들어 있는 자격 증명입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 권한 부여에 사용할 스키마를 가져옵니다. + + 를 반환합니다.권한 부여에 사용할 스키마입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Cache-Control 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 할당된 선택적 값이 각각 있는 캐시 확장 토큰입니다. + + 를 반환합니다.할당된 선택적 값이 각각 있는 캐시 확장 토큰의 컬렉션입니다. + + + + 개체에 대한 해시 함수 역할을 합니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + HTTP 클라이언트가 응답을 허용하는 최대 보관 기간(초로 지정)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트에서 만료 시간을 초과한 응답을 수락하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 만료 시간을 초과한 응답을 수락하기까지의 최대 시간(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + HTTP 클라이언트가 응답을 허용하는 새로 고침 수명(초)입니다. + + 를 반환합니다.초 단위 시간입니다. + + + 원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는 경우 true이고, 그렇지 않으면 false입니다. + + + HTTP 클라이언트가 캐시된 응답을 수용할지 여부입니다. + + 를 반환합니다.HTTP 클라이언트가 캐시된 응답을 허용하면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "no-cache" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는지 여부입니다. + + 를 반환합니다.캐시가 HTTP 요청 메시지나 응답 중 어느 부분도 저장하면 안 되는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 캐시 또는 프록시가 엔터티 본문을 변경해서는 안 되는지 여부입니다. + + 를 반환합니다.캐시나 프록시가 전체 본문의 어떤 부분도 변경하지 않아야 하는 경우 true이고, 그렇지 않으면 false입니다. + + + 캐시가 다른 HTTP 요청의 제약 조건과 일치하는 캐시 엔트리를 사용하여 반응하는지, 또는 504(게이트웨이 제한 시간) 상태로 반응하는지 여부 + + 를 반환합니다.캐시에서 HTTP 요청의 다른 제약 조건과 일관된 캐시된 엔트리를 사용하여 응답하거나 504(게이트웨이 시간 초과) 상태로 응답해야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 캐시 제어 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 캐시 제어 헤더 값 정보가 아닙니다. + + + HTTP 응답 메시지의 전체 또는 일부가 단일 사용자만 사용하기 위한 것이며 공유 캐시에서 캐시되지 않아야 하는지 여부 + + 를 반환합니다.HTTP 응답 메시지가 단일 사용자용이므로 공유 캐시에 캐시되지 않아야 하는 경우에는 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 cache-control 헤더 필드에서 "private" 지시문에 있는 필드 이름의 컬렉션입니다. + + 를 반환합니다.필드 이름의 컬렉션입니다. + + + 원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하는지 여부 + + 를 반환합니다.원래 서버에서 공유 사용자 에이전트 캐시에 대한 캐시 엔트리가 오래되면 이후에 사용하는 모든 캐시 엔트리에 대해 유효성 재검사를 필요로 하면 true이고, 그렇지 않으면 false입니다. + + + 대게 HTTP 응답이 공유되지 않는 캐시 내에서만 캐시할 수 있는지 여부도 포함하여 모든 캐시에서 캐시될 수 있는지 여부 + + 를 반환합니다.일반적으로 캐시할 수 없거나 비공유 캐시 내에서만 캐시할 수 있더라도, HTTP 응답을 캐시에서 캐시할 수 있으면 true이고, 그렇지 않으면 false입니다. + + + 초 단위로 지정된 공유된 최대 보관 기간으로, 공유 캐시의 경우 캐시 컨트롤 헤더나 Expires 헤더에서 "max-age" 지시문을 재정의하는 HTTP 응답에 사용됩니다. + + 를 반환합니다.초 단위 시간입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Disposition 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + 파일을 만든 날짜입니다. + + 를 반환합니다.파일 작성 날짜입니다. + + + 콘텐츠 본문 부분에 대한 처리 형식입니다. + + 를 반환합니다.처리 형식입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.제안된 파일 이름입니다. + + + 엔터티가 분리되고 별도 파일에 저장되는 경우 사용할 메시지 페이로드를 저장하기 위한 파일 이름을 생성하는 방법에 대한 제안입니다. + + 를 반환합니다.폼 파일 이름*의 제안된 파일 이름입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 마지막으로 파일을 수정한 날짜입니다. + + 를 반환합니다.파일 수정 날짜입니다. + + + 콘텐츠 본문 부분에 대한 이름입니다. + + 를 반환합니다.콘텐츠 본문 부분에 대한 이름입니다. + + + Content-Disposition 헤더를 포함하는 매개 변수의 집합입니다. + + 를 반환합니다.매개 변수 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 처리 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 처리 헤더 값 정보가 아닙니다. + + + 파일에 마지막으로 읽은 날짜입니다. + + 를 반환합니다.마지막으로 읽은 날짜입니다. + + + 파일의 대략적인 크기(바이트)입니다. + + 를 반환합니다.대략적인 크기(바이트)입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치(바이트 단위)입니다. + 데이터 보내기를 중지하는 위치(바이트 단위)입니다. + 범위의 시작점이나 끝점(바이트 단위)입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치(바이트 단위)입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 콘텐츠 범위 헤더에 길이가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 길이가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 콘텐츠 범위에 범위가 지정되어 있는지 여부를 가져옵니다. + + 를 반환합니다.Content-Range에 범위가 지정되어 있으면 true이고, 그렇지 않으면 false입니다. + + + 전체 엔티티 본문의 길이를 가져옵니다. + + 를 반환합니다.전체 엔티티 본문의 길이입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 콘텐츠 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 콘텐츠 범위 헤더 값 정보가 아닙니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 사용된 범위의 단위입니다. + + 를 반환합니다.단위 범위를 포함하는 + + + 엔터티 태그 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + 를 포함하는 문자열입니다. + 이 엔터티 태그 헤더가 약한 유효성 검사기인지 여부를 나타내는 값입니다.엔터티 태그 헤더가 약한 유효성 검사기이면 를 true로 설정해야 합니다.엔터티 태그 헤더가 강한 유효성 검사기이면 를 false로 설정해야 합니다. + + + 엔터티 태그 헤더 값을 가져옵니다. + + 를 반환합니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 엔터티 태그가 약점 표시로 시작하는지 여부를 가져옵니다. + + 를 반환합니다.취약성 표시기에 의해 엔터티 태그가 앞에 오면 true이고, 그렇지 않으면 false입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 엔터티 태그 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 엔터티 태그 헤더 값 정보가 아닙니다. + + + 불투명한 따옴표가 붙은 문자열을 가져옵니다. + + 를 반환합니다.불투명한 따옴표가 붙은 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 콘텐츠 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Allow 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Allow 헤더 값입니다. + + + HTTP 응답의 Content-Disposition 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Disposition 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Encoding 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Encoding 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Language 콘텐츠 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Content-Language 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Length 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Length 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Location 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Location 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-MD5 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-MD5 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Range 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Range 콘텐츠 헤더입니다. + + + HTTP 응답의 Content-Type 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Content-Type 콘텐츠 헤더입니다. + + + HTTP 응답의 Expires 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Expires 콘텐츠 헤더입니다. + + + HTTP 응답의 Last-Modified 콘텐츠 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Last-Modified 콘텐츠 헤더입니다. + + + RFC 2616에 정의된 헤더와 값의 컬렉션입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 컬렉션에 추가할 헤드 값의 목록입니다. + + + 지정된 헤더 및 헤더 값을 컬렉션에 추가합니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + + 컬렉션에서 헤더를 모두 제거합니다. + + + 특정 헤더가 컬렉션에 있는 경우 반환합니다. + + 를 반환합니다.지정된 헤더가 컬렉션에 있으면 true이고, 그렇지 않으면 false입니다. + 특정 헤더입니다. + + + + 인스턴스에서 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.에 대한 열거자입니다. + + + + 컬렉션에 저장된 지정된 헤더에 대한 모든 헤더 값을 반환합니다. + + 를 반환합니다.헤더 문자열의 배열입니다. + 값을 반환할 지정된 헤더입니다. + + + + 컬렉션에서 지정된 헤더를 제거합니다. + + 를 반환합니다. + 컬렉션에서 제거할 헤더의 이름입니다. + + + + 을 반복할 수 있는 열거자를 반환합니다. + + 를 반환합니다.을 반복할 수 있는 인터페이스 구현의 인스턴스입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 지정된 헤더 및 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 값입니다. + + + 지정된 헤더 및 해당 값이 제공된 정보의 유효성을 검사하지 않고 컬렉션에 추가되었는지 여부를 나타내는 값을 반환합니다. + + 를 반환합니다.지정된 헤더 를 컬렉션에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 컬렉션에 추가할 헤더입니다. + 헤더의 내용입니다. + + + 지정된 헤더와 지정된 값이 컬렉션에 저장되는 경우 반환합니다. + + 를 반환합니다.true는 지정된 헤더 이고 values는 컬렉션에 저장됩니다. 그렇지 않으면 false입니다. + 지정된 헤더입니다. + 지정된 헤더 값입니다. + + + 헤더 값의 컬렉션을 나타냅니다. + 헤더 컬렉션 형식입니다. + + + + 에 엔트리를 추가합니다. + 헤더 컬렉션에 추가할 항목입니다. + + + + 에서 모든 엔트리를 제거합니다. + + + + 에 항목이 포함되어 있는지 여부를 확인합니다. + + 를 반환합니다.엔트리가 인스턴스에 포함되어 있으면 true이고, 그렇지 않으면 false입니다. + 헤더 컬렉션을 찾을 항목입니다. + + + 대상 배열의 지정된 인덱스에서 시작하여 전체 을 호환되는 1차원 에 복사합니다. + + 에서 복사한 요소의 대상인 일차원 입니다.에는 0부터 시작하는 인덱스가 있어야 합니다. + + 에서 복사가 시작되는 인덱스(0부터 시작)입니다. + + + + 의 헤더 수를 가져옵니다. + + 를 반환합니다.컬렉션의 헤더 수입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + + 인스턴스가 읽기 전용인지 여부를 나타내는 값을 가져옵니다. + + 를 반환합니다. 인스턴스가 읽기 전용이면 true이고, 그렇지 않으면 false입니다. + + + 엔트리를 구문 분석하고 에 추가합니다. + 추가할 엔트리입니다. + + + 지정된 항목을 에서 제거합니다. + + 를 반환합니다. 인스턴스에서 제거되면 true이고, 그렇지 않으면 false입니다. + 제거할 항목입니다. + + + + 을 반복하는 열거자를 반환합니다. + + 를 반환합니다. 인스턴스에 대한 열거자입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 입력을 구문 분석하고 에 추가할 수 있는지 여부를 결정합니다. + + 를 반환합니다.을 구문 분석하고 인스턴스에 추가할 수 있으면 true이고, 그렇지 않으면 false입니다. + 유효성을 검사할 엔트리입니다. + + + RFC 2616에 정의된 요청 헤더의 컬렉션을 나타냅니다. + + + HTTP 요청의 Accept 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept 헤더 값입니다. + + + HTTP 요청의 Accept-Charset 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Charset 헤더 값입니다. + + + HTTP 요청의 Accept-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Encoding 헤더 값입니다. + + + HTTP 요청의 Accept-Language 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Accept-Language 헤더 값입니다. + + + HTTP 요청의 Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Authorization 헤더 값입니다. + + + HTTP 요청의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Cache-Control 헤더 값입니다. + + + HTTP 요청의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Connection 헤더 값입니다. + + + HTTP 요청에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 요청의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Date 헤더 값입니다. + + + HTTP 요청의 Expect 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Expect 헤더 값입니다. + + + HTTP 요청에 대한 Expect 헤더에 Continue가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Expect 헤더에 계속이 들어 있으면 true이고, otherwise false. + + + HTTP 요청의 From 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 From 헤더 값입니다. + + + HTTP 요청의 Host 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Host 헤더 값입니다. + + + HTTP 요청의 If-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-Match 헤더 값입니다. + + + HTTP 요청의 If-Modified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Modified-Since 헤더 값입니다. + + + HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 If-None-Match 헤더 값을 가져옵니다. + + + HTTP 요청의 If-Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Range 헤더 값입니다. + + + HTTP 요청의 If-Unmodified-Since 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 If-Unmodified-Since 헤더 값입니다. + + + HTTP 요청의 Max-Forwards 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Max-Forwards 헤더 값입니다. + + + HTTP 요청의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Pragma 헤더 값입니다. + + + HTTP 요청의 Proxy-Authorization 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Proxy-Authorization 헤더 값입니다. + + + HTTP 요청의 Range 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Range 헤더 값입니다. + + + HTTP 요청의 Referer 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 요청의 Referer 헤더 값입니다. + + + HTTP 요청의 TE 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 TE 헤더 값입니다. + + + HTTP 요청의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Trailer 헤더 값입니다. + + + HTTP 요청의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Transfer-Encoding 헤더 값입니다. + + + HTTP 요청에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 요청의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Upgrade 헤더 값입니다. + + + HTTP 요청의 User-Agent 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 User-Agent 헤더 값입니다. + + + HTTP 요청의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Via 헤더 값입니다. + + + HTTP 요청의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 요청의 Warning 헤더 값입니다. + + + RFC 2616에 정의된 응답 헤더의 컬렉션을 나타냅니다. + + + HTTP 응답의 Accept-Ranges 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Accept-Ranges 헤더 값입니다. + + + HTTP 응답의 Age 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Age 헤더 값입니다. + + + HTTP 응답의 Cache-Control 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Cache-Control 헤더 값입니다. + + + HTTP 응답의 Connection 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Connection 헤더 값입니다. + + + HTTP 응답에 대한 Connection 헤더에 Close가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Connection 헤더에 닫기가 들어 있으면 true 이고, otherwise false. + + + HTTP 응답의 Date 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Date 헤더 값입니다. + + + HTTP 응답의 ETag 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 ETag 헤더 값입니다. + + + HTTP 응답의 Location 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Location 헤더 값입니다. + + + HTTP 응답의 Pragma 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Pragma 헤더 값입니다. + + + HTTP 응답의 Proxy-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Proxy-Authenticate 헤더 값입니다. + + + HTTP 응답의 Retry-After 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.HTTP 응답의 Retry-After 헤더 값입니다. + + + HTTP 응답의 Server 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Server 헤더 값입니다. + + + HTTP 응답의 Trailer 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Trailer 헤더 값입니다. + + + HTTP 응답의 Transfer-Encoding 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Transfer-Encoding 헤더 값입니다. + + + HTTP 응답에 대한 Transfer-Encoding 헤더에 chunked가 포함되는지 여부를 나타내는 값을 가져오거나 설정합니다. + + 를 반환합니다.Transfer-Encoding 헤더에 청크가 들어 있으면 true이고, 그렇지 않으면 false입니다. + + + HTTP 응답의 Upgrade 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Upgrade 헤더 값입니다. + + + HTTP 응답의 Vary 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Vary 헤더 값입니다. + + + HTTP 응답의 Via 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Via 헤더 값입니다. + + + HTTP 응답의 Warning 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 Warning 헤더 값입니다. + + + HTTP 응답의 WWW-Authenticate 헤더 값을 가져옵니다. + + 를 반환합니다.HTTP 응답의 WWW-Authenticate 헤더 값입니다. + + + RFC 2616에 정의된 대로 Content-Type 헤더에 사용된 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타낸 소스입니다. + + + 문자 집합을 가져오거나 설정합니다. + + 를 반환합니다.문자 집합입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 미디어 형식의 헤더 값을 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값입니다. + + + 미디어 형식의 헤더 값 매개 변수를 가져오거나 설정합니다. + + 를 반환합니다.미디어 형식의 헤더 값 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 유형 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 미디어 형식 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Content-Type 헤더에 사용된 추가 품질 요소를 가진 미디어 형식을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 문자열로 나타내는 입니다. + 이 헤더 값과 연결된 품질입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 미디어 형식과 품질 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 미디어 형식이 아닙니다. + + + + 에 대한 품질 값을 가져오거나 설정합니다. + + 를 반환합니다. 개체의 품질 값입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 헤더 이름을 가져옵니다. + + 를 반환합니다.헤더 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 이름 값 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 헤더 값을 가져옵니다. + + 를 반환합니다.헤더 값입니다. + + + RFC 2616에 정의된 대로 다양한 헤더에 사용된 매개 변수를 가진 이름/값 쌍을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 헤더 이름입니다. + 헤더 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + + 개체에서 매개 변수를 가져옵니다. + + 를 반환합니다.매개 변수를 포함하는 컬렉션입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 이름 값과 매개 변수 헤더 값 정보를 나타내는 문자열 + + 이 null 참조인 경우 + + 은 매개 변수 헤더 값 정보가 포함된 유효한 이름 값이 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + User-Agent 헤더의 제품 토큰 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 제품 토큰의 이름을 가져옵니다. + + 를 반환합니다.제품 토큰의 이름입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 헤더 값 정보를 나타내는 문자열입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 제품 토큰의 버전을 가져옵니다. + + 를 반환합니다.제품 토큰의 버전입니다. + + + User-Agent 헤더에서 제품 또는 메모일 수 있는 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 주석 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 제품 이름 값입니다. + 제품 버전 값입니다. + + + + 개체에서 주석을 가져옵니다. + + 를 반환합니다.이 의 주석 값입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 제품 정보 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 제품 정보 헤더 값 정보가 아닙니다. + + + + 개체에서 제품을 가져옵니다. + + 를 반환합니다.이 의 제품 값입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 날짜/시간 또는 엔터티 태그 값일 수 있는 If-Range 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜 값입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 문자열로 나타내는 엔터티 태그입니다. + + + + 개체에서 날짜를 가져옵니다. + + 를 반환합니다. 개체의 날짜입니다. + + + + 개체에서 엔터티 태그를 가져옵니다. + + 를 반환합니다. 개체의 엔터티 태그입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 범위 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + + + 바이트 범위를 사용하여 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 범위 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 범위 헤더 값 정보가 아닙니다. + + + + 개체에서 지정된 범위를 가져옵니다. + + 를 반환합니다. 개체의 범위입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체에서 단위를 가져옵니다. + + 를 반환합니다. 개체의 단위입니다. + + + 범위 헤더 값에서 바이트 범위를 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 데이터를 보내기 시작하는 위치입니다. + 데이터 보내기를 중지하는 위치입니다. + + 보다 큽니다.또는 또는 가 0 미만인 경우 + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + 데이터를 보내기 시작하는 위치를 가져옵니다. + + 를 반환합니다.데이터를 보내기 시작하는 위치입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 데이터 보내기를 중지하는 위치를 가져옵니다. + + 를 반환합니다.데이터 보내기를 중지하는 위치입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 날짜/시간 또는 timespan 값일 수 있는 Retry-After 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 날짜와 시간 오프셋입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용하는 델타(초)입니다. + + + + 개체의 날짜와 시간 오프셋을 가져옵니다. + + 를 반환합니다. 개체의 날짜와 시간 오프셋입니다. + + + + 개체에서 델타(초)를 가져옵니다. + + 를 반환합니다. 개체의 델타(초)입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 다시 시도 조건 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 다시 시도 조건 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 선택적 품질의 문자열 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 새 인스턴스를 초기화하는 데 사용되는 품질 요소입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 품질 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 문자열이 아닙니다. + + + + 개체에서 품질 요소를 가져옵니다. + + 를 반환합니다. 개체의 품질 요소입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + + 개체의 문자열 값을 가져옵니다. + + 를 반환합니다. 개체의 문자열 값입니다. + + + accept-encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 개체입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + 지정한 개체가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 전송 코딩 매개 변수를 가져옵니다. + + 를 반환합니다.전송 코딩 매개 변수입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 전송 코딩 헤더 값 정보가 아닙니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 전송 코딩 값을 가져옵니다. + + 를 반환합니다.전송 코딩 값입니다. + + + 선택적 품질 요소의 Accept-Encoding 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 새 인스턴스를 초기화하는 데 사용되는 문자열입니다. + 품질 요소의 값입니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 전송 코딩 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 품질 헤더 값 정보가 포함된 유효한 전송 코딩이 아닙니다. + + + + 에서 품질 요소를 가져옵니다. + + 를 반환합니다.의 품질 요소입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + Via 헤더 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 받은 프로토콜의 프로토콜 버전입니다. + 요청 또는 응답을 받은 호스트 및 포트입니다. + 받은 프로토콜의 프로토콜 이름입니다. + 수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 수취 프록시 또는 게이트웨이의 소프트웨어를 식별하는데 사용되는 설명 필드를 가져옵니다. + + 를 반환합니다.수신자 프록시 또는 게이트웨이의 소프트웨어를 식별하는 데 사용되는 설명 필드입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드를 반환합니다. + + + 문자열을 인스턴스로 변환합니다. + + 를 반환합니다. 인스턴스입니다. + 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 Via 헤더 값 정보가 아닙니다. + + + 받은 프로토콜의 프로토콜 이름을 가져옵니다. + + 를 반환합니다.프로토콜 이름입니다. + + + 받은 프로토콜의 프로토콜 버전을 가져옵니다. + + 를 반환합니다.프로토콜 버전입니다. + + + 요청 또는 응답을 받은 호스트 및 포트를 가져옵니다. + + 를 반환합니다.요청 또는 응답을 받은 호스트 및 포트입니다. + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + 경고 헤더에서 사용하는 경고 값을 나타냅니다. + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + + 클래스의 새 인스턴스를 초기화합니다. + 특정 경고 코드입니다. + 경고를 연결하는 호스트입니다. + 경고 텍스트를 포함하는 따옴표 붙은 문자열 + 경고의 날짜/시간 스탬프입니다. + + + 경고를 연결하는 호스트를 가져옵니다. + + 를 반환합니다.경고를 연결하는 호스트입니다. + + + 특정 경고 코드를 가져옵니다. + + 를 반환합니다.특정 경고 코드입니다. + + + 경고의 날짜/타임 스탬프를 가져옵니다. + + 를 반환합니다.경고의 날짜/시간 스탬프입니다. + + + 지정한 가 현재 개체와 같은지 여부를 확인합니다. + + 를 반환합니다.지정된 가 현재 개체와 같으면 true이고, 그렇지 않으면 false입니다. + 현재 개체와 비교할 개체입니다. + + + + 개체에 대한 해시 함수로 사용됩니다. + + 를 반환합니다.현재 개체의 해시 코드입니다. + + + 문자열을 인스턴스로 변환합니다. + + 인스턴스를 반환합니다. + 인증 헤더 값 정보를 나타내는 문자열입니다. + + 이 null 참조인 경우 + + 은 유효한 인증 헤더 값 정보가 아닙니다. + + + 경고 텍스트가 포함된 따옴표 붙은 문자열을 가져옵니다. + + 를 반환합니다.경고 텍스트를 포함하는 따옴표 붙은 문자열 + + + 현재 개체를 나타내는 문자열을 반환합니다. + + 를 반환합니다.현재 개체를 나타내는 문자열입니다. + + + 문자열이 유효한 정보인지 여부를 확인합니다. + + 를 반환합니다.이 유효한 정보이면 true이고, 그렇지 않으면 false입니다. + 유효성을 확인할 문자열입니다. + 문자열의 버전입니다. + + + \ No newline at end of file diff --git a/src/packages/itext7.7.0.1/LICENSE.md b/src/packages/itext7.7.0.1/LICENSE.md new file mode 100644 index 00000000000..482d6c91c20 --- /dev/null +++ b/src/packages/itext7.7.0.1/LICENSE.md @@ -0,0 +1,36 @@ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License version 3 + as published by the Free Software Foundation with the addition of the + following permission added to Section 15 as permitted in Section 7(a): + FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY + ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT + OF THIRD PARTY RIGHTS + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + You should have received a copy of the GNU Affero General Public License + along with this program; if not, see http://www.gnu.org/licenses or write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA, 02110-1301 USA, or download the license from the following URL: + http://itextpdf.com/terms-of-use/ + + The interactive user interfaces in modified source and object code versions + of this program must display Appropriate Legal Notices, as required under + Section 5 of the GNU Affero General Public License. + + In accordance with Section 7(b) of the GNU Affero General Public License, + a covered work must retain the producer line in every PDF that is created + or manipulated using iText. + + You can be released from the requirements of the license by purchasing + a commercial license. Buying such a license is mandatory as soon as you + develop commercial activities involving the iText software without + disclosing the source code of your own applications. + These activities include: offering paid services to customers as an ASP, + serving PDFs on the fly in a web application, shipping iText with a closed + source product. + + For more information, please contact iText Software Corp. at this + address: sales@itextpdf.com diff --git a/src/packages/itext7.7.0.1/gnu-agpl-v3.0.md b/src/packages/itext7.7.0.1/gnu-agpl-v3.0.md new file mode 100644 index 00000000000..4ef32f08339 --- /dev/null +++ b/src/packages/itext7.7.0.1/gnu-agpl-v3.0.md @@ -0,0 +1,651 @@ +GNU Affero General Public License +================================= + +_Version 3, 19 November 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +## Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: **(1)** assert copyright on the software, and **(2)** offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions + +“This License” refers to version 3 of the GNU Affero General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that **(1)** displays an appropriate copyright notice, and **(2)** +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that **(a)** is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and **(b)** serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified +it, and giving a relevant date. +* **b)** The work must carry prominent notices stating that it is +released under this License and any conditions added under section 7. +This requirement modifies the requirement in section 4 to +“keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +* **d)** If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either **(1)** a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or **(2)** access to copy the +Corresponding Source from a network server at no charge. +* **c)** Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +* **d)** Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either **(1)** a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or **(2)** anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or +authors of the material; or +* **e)** Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated **(a)** +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and **(b)** permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either **(1)** cause the Corresponding Source to be so +available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license **(a)** in connection with copies of the covered work +conveyed by you (or copies made from those copies), or **(b)** primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +_END OF TERMS AND CONDITIONS_ + +## How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a “Source” link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +<>. diff --git a/src/packages/itext7.7.0.1/itext7.7.0.1.nupkg b/src/packages/itext7.7.0.1/itext7.7.0.1.nupkg new file mode 100644 index 00000000000..abfa19a6483 Binary files /dev/null and b/src/packages/itext7.7.0.1/itext7.7.0.1.nupkg differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.dll b/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.dll new file mode 100644 index 00000000000..526ad3a7e02 Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.xml b/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.xml new file mode 100644 index 00000000000..7d1489f3ddd --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.barcodes.xml @@ -0,0 +1,1660 @@ + + + + itext.barcodes + + + + The minimum bar width. + + + + The bar multiplier for wide bars or the distance between + bars for Postnet and Planet. + + + + The text font. + The text font. null if no text. + + + + The size of the text or the height of the shorter bar + in Postnet. + + + + If positive, the text distance under the bars. + + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + + + The height of the bars. + + + The text alignment. + + + The optional checksum generation. + + + Shows the generated checksum in the the text. + + + + Show the start and stop character '*' in the text for + the barcode 39 or 'ABCD' for codabar. + + + + Generates extended barcode 39. + + + The code to generate. + + + Show the guard bars for barcode EAN. + + + The code type. + + + The ink spreading. + + + The alternate text to be used, if present. + + + Gets the minimum bar width. + the minimum bar width + + + Sets the minimum bar width. + the minimum bar width + + + Gets the bar multiplier for wide bars. + the bar multiplier for wide bars + + + Sets the bar multiplier for wide bars. + the bar multiplier for wide bars + + + Gets the text font. + Gets the text font. null if no text. + the text font. null if no text + + + Sets the text font. + the text font. Set to null to suppress any text + + + Sets the size of the text. + the size of the text + + + Gets the text baseline. + + Gets the text baseline. + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + the baseline. + + + Sets the text baseline. + + Sets the text baseline. + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + the baseline. + + + Gets the height of the bars. + the height of the bars + + + Sets the height of the bars. + the height of the bars + + + Gets the text alignment. + the text alignment + + + Sets the text alignment. + the text alignment + + + Gets the optional checksum generation. + the optional checksum generation + + + Setter for property generateChecksum. + New value of property generateChecksum. + + + Gets the property to show the generated checksum in the the text. + value of property checksumText + + + Sets the property to show the generated checksum in the the text. + new value of property checksumText + + + + Sets the property to show the start and stop character '*' in the text for + the barcode 39. + + value of property startStopText + + + + Gets the property to show the start and stop character '*' in the text for + the barcode 39. + + new value of property startStopText + + + Gets the property to generate extended barcode 39. + value of property extended. + + + Sets the property to generate extended barcode 39. + new value of property extended + + + Gets the code to generate. + the code to generate + + + Sets the code to generate. + the code to generate + + + Gets the property to show the guard bars for barcode EAN. + value of property guardBars + + + Sets the property to show the guard bars for barcode EAN. + new value of property guardBars + + + Gets the code type. + the code type + + + Sets the code type. + the code type + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Gets the amount of ink spreading. + the ink spreading + + + Sets the amount of ink spreading. + + Sets the amount of ink spreading. This value will be subtracted + to the width of each bar. The actual value will depend on the ink + and the printing medium. + + the ink spreading + + + Gets the alternate text. + the alternate text + + + Sets the alternate text. + + Sets the alternate text. If present, this text will be used instead of the + text derived from the supplied code. + + the alternate text + + + Creates a PdfFormXObject with the barcode. + Creates a PdfFormXObject with the barcode. Default bar color and text color will be used. + the XObject + + + + Creates a PdfFormXObject with the barcode. + the color of the bars. It can be null + the color of the text. It can be null + the XObject + + + + Make the barcode occupy the specified width. + + Make the barcode occupy the specified width. + Usually this is achieved by adjusting bar widths. + + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + The charset code change. + + + The charset code change. + + + The charset code change. + + + The code for UCC/EAN-128. + + + The start code. + + + The start code. + + + The start code. + + + The bars to generate the code. + + + The stop bars. + + + Creates new Barcode128 + + + Removes the FNC1 codes in the text. + the text to clean + the cleaned text + + + Gets the human readable text of a sequence of AI. + the text + the human readable text + + + + Converts the human readable text to the characters needed to + create a barcode using the specified code set. + + the text to convert + + true if it is an UCC/EAN-128. In this case + the character FNC1 is added + + forced code set, or AUTO for optimized barcode. + the code ready to be fed to getBarsCode128Raw() + + + + Converts the human readable text to the characters needed to + create a barcode. + + + Converts the human readable text to the characters needed to + create a barcode. Some optimization is done to get the shortest code. + + the text to convert + + true if it is an UCC/EAN-128. In this case + the character FNC1 is added + + the code ready to be fed to getBarsCode128Raw() + + + Generates the bars. + + Generates the bars. The input has the actual barcodes, not + the human readable text. + + the barcode + the bars + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Sets the code to generate. + + Sets the code to generate. If it's an UCC code and starts with '(' it will + be split by the AI. This code in UCC mode is valid: +

+ (01)00000090311314(10)ABC123(15)060916 + + the code to generate + + +

+ Returns true if the next numDigits + starting from index textIndex are numeric skipping any FNC1. + + the text to check + where to check from + the number of digits to check + the check result +
+ + Packs the digits for charset C also considering FNC1. + + Packs the digits for charset C also considering FNC1. It assumes that all the parameters + are valid. + + the text to pack + where to pack from + the number of digits to pack. It is always an even number + the packed digits, two digits per character + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + Places the barcode in a PdfCanvas. + + Places the barcode in a PdfCanvas. The + barcode is always placed at coordinates (0, 0). Use the + translation matrix to move it elsewhere. + + the PdfCanvas where the barcode will be placed + the foreground color. It can be null + the dimensions the barcode occupies + + + Creates a PdfFormXObject with the barcode. + + Creates a PdfFormXObject with the barcode. + Default foreground color will be used. + + the XObject. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + + The index chars to BARS, symbol * use only start and stop characters, + the * character will not appear in the input data. + + + + The character combinations to make the code 39 extended. + + + The bars to generate the code. + + + Creates a new Barcode39. + + + Creates the bars. + + the text to create the bars. This text does not include the start and + stop characters + + the bars + + + + Converts the extended text into a normal, escaped text, + ready to generate bars. + + the extended text + the escaped text + + + Calculates the checksum. + the text + the checksum + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + The index chars to BARS. + + + The bars to generate the code. + + + Creates a new BarcodeCodabar. + + + Creates the bars. + the text to create the bars + the bars + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + No error. + + + The text is too big for the symbology capabilities. + + + The dimensions given for the symbol are illegal. + + + An error while parsing an extension. + + + The best encodation will be used. + + + ASCII encodation. + + + C40 encodation. + + + TEXT encodation. + + + Binary encodation. + + + X21 encodation. + + + EDIFACT encodation. + + + No encodation needed. + No encodation needed. The bytes provided are already encoded. + + + Allows extensions to be embedded at the start of the text. + + + Doesn't generate the image but returns all the other information. + + + Creates an instance of this class. + + + Creates a PdfFormXObject with the barcode with given module width and module height. + the color of the pixels. It can be null + the side (width and height) of the pixels. + the XObject. + + + Gets the barcode size + + + Creates a barcode. + Creates a barcode. The String is interpreted with the ISO-8859-1 encoding + the text + + the status of the generation. It can be one of this values: +

+ DM_NO_ERROR - no error.
+ DM_ERROR_TEXT_TOO_BIG - the text is too big for the symbology capabilities.
+ DM_ERROR_INVALID_SQUARE - the dimensions given for the symbol are illegal.
+ DM_ERROR_EXTENSION - an error was while parsing an extension. + + + +

Creates a barcode. + the text + the offset to the start of the text + the text size + + the status of the generation. It can be one of this values: +

+ DM_NO_ERROR - no error.
+ DM_ERROR_TEXT_TOO_BIG - the text is too big for the symbology capabilities.
+ DM_ERROR_INVALID_SQUARE - the dimensions given for the symbol are illegal.
+ DM_ERROR_EXTENSION - an error was while parsing an extension. + + + +

Gets the height of the barcode. + + Gets the height of the barcode. Will contain the real height used after a successful call + to generate(). This height doesn't include the whitespace border, if any. + + the height of the barcode +
+ + + Gets the width of the barcode. + + Gets the width of the barcode. Will contain the real width used after a successful call + to generate(). This width doesn't include the whitespace border, if any. + + the width of the barcode + + + + Gets the whitespace border around the barcode. + the whitespace border around the barcode + + + Sets the whitespace border around the barcode. + the whitespace border around the barcode + + + Gets the barcode options. + the barcode options + + + + setting encoding for data matrix code ( default encoding iso-8859-1) + encoding for data matrix code + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + The total number of bars for EAN13. + + + The total number of bars for EAN8. + + + The total number of bars for UPCE. + + + The total number of bars for supplemental 2. + + + The total number of bars for supplemental 5. + + + Marker for odd parity. + + + Marker for even parity. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The x coordinates to place the text. + + + The x coordinates to place the text. + + + The basic bar widths. + + + Sequence of parities to be used with EAN13. + + + Sequence of parities to be used with supplemental 2. + + + Sequence of parities to be used with supplemental 2. + + + Sequence of parities to be used with UPCE. + + + Creates new BarcodeEAN + + + Calculates the EAN parity character. + the code + the parity character + + + Converts an UPCA code into an UPCE code. + + Converts an UPCA code into an UPCE code. If the code can not + be converted a null is returned. + + the code to convert. It must have 12 numeric characters + + the 8 converted digits or null if the + code could not be converted + + + + Creates the bars for the barcode EAN13 and UPCA. + the text with 13 digits + the barcode + + + Creates the bars for the barcode EAN8. + the text with 8 digits + the barcode + + + Creates the bars for the barcode UPCE. + the text with 8 digits + the barcode + + + Creates the bars for the barcode supplemental 2. + the text with 2 digits + the barcode + + + Creates the bars for the barcode supplemental 5. + the text with 5 digits + the barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + The barcode with the EAN/UPC. + + + The barcode with the supplemental. + + + Creates new combined barcode. + the EAN/UPC barcode + the supplemental barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Implements the code interleaved 2 of 5. + + Implements the code interleaved 2 of 5. The text can include + non numeric characters that are printed but do not generate bars. + The default parameters are: +
+            x = 0.8f;
+            n = 2;
+            font = new PdfType1Font(document, new TYPE_1_FONT(FontConstants.HELVETICA, PdfEncodings.WINANSI));
+            size = 8;
+            baseline = size;
+            barHeight = size * 3;
+            textAlignment = ALIGN_CENTER;
+            generateChecksum = false;
+            checksumText = false;
+            
+
+
+ + The bars to generate the code. + + + Creates new BarcodeInter25 + + + Deletes all the non numeric characters from text. + the text + a String with only numeric characters + + + Calculates the checksum. + the numeric text + the checksum + + + Creates the bars for the barcode. + the text. It can contain non numeric characters + the barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Auto-size is made based on aspectRatio and yHeight. + + + The size of the barcode will be at least codeColumns*codeRows. + + + + The size will be at least codeColumns + with a variable number of codeRows. + + + + + The size will be at least codeRows + with a variable number of codeColumns. + + + + + The error level correction is set automatically according + to ISO 15438 recommendations. + + + + The error level correction is set by the user. + The error level correction is set by the user. It can be 0 to 8. + + + One single binary segment is used + + + + No text interpretation is done and the content of codewords + is used directly. + + + + + Inverts the output bits of the raw bitmap that is normally + bit one for black. + + + Inverts the output bits of the raw bitmap that is normally + bit one for black. It has only effect for the raw bitmap. + + + + Use Macro PDF417 Encoding + + + + + + Holds value of property outBits. + + + Holds value of property bitColumns. + + + Holds value of property codeRows. + + + Holds value of property codeColumns. + + + Holds value of property codewords. + + + Holds value of property lenCodewords. + + + Holds value of property errorLevel. + + + Holds value of property code. + + + Holds value of property options. + + + Holds value of property aspectRatio. + + + Holds value of property yHeight. + + + Creates a new BarcodePDF417 with the default settings. + + + Sets the segment id for macro PDF417 encoding + the id (starting at 0) + + + + Sets the segment count for macro PDF417 encoding + the number of macro segments + + + + Sets the File ID for macro PDF417 encoding + the file id + + + + Set the default settings that correspond to PDF417_USE_ASPECT_RATIO + and PDF417_AUTO_ERROR_LEVEL. + + + + Paints the barcode. + Paints the barcode. If no exception was thrown a valid barcode is available. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + Creates a PdfFormXObject with the barcode with given module width and module height. + the color of the pixels. It can be null + the width of the pixels. + the height of the pixels. + the XObject. + + + Gets the raw image bits of the barcode. + + Gets the raw image bits of the barcode. The image will have to + be scaled in the Y direction by yHeight. + + The raw barcode image + + + Gets the number of X pixels of outBits. + the number of X pixels of outBits + + + Gets the number of Y pixels of outBits. + + Gets the number of Y pixels of outBits. + It is also the number of rows in the barcode. + + the number of Y pixels of outBits + + + Sets the number of barcode rows. + + Sets the number of barcode rows. This number may be changed + to keep the barcode valid. + + the number of barcode rows + + + Gets the number of barcode data columns. + he number of barcode data columns + + + Sets the number of barcode data columns. + + Sets the number of barcode data columns. + This number may be changed to keep the barcode valid. + + the number of barcode data columns + + + Gets the codeword array. + + Gets the codeword array. This array is always 928 elements long. + It can be written to if the option PDF417_USE_RAW_CODEWORDS + is set. + + the codeword array + + + Gets the length of the codewords. + the length of the codewords + + + Sets the length of the codewords. + the length of the codewords + + + Gets the error level correction used for the barcode. + + Gets the error level correction used for the barcode. It may different + from the previously set value. + + the error level correction used for the barcode + + + Sets the error level correction for the barcode. + the error level correction for the barcode + + + Gets the bytes that form the barcode. + + Gets the bytes that form the barcode. This bytes should + be interpreted in the codepage Cp437. + + the bytes that form the barcode + + + Sets the bytes that form the barcode. + + Sets the bytes that form the barcode. This bytes should + be interpreted in the codepage Cp437. + + the bytes that form the barcode + + + Sets the code that will form the barcode. + + Sets the code that will form the barcode. This text is converted + to bytes using the encoding Cp437. + + the text that will form the barcode + + + Gets the options to generate the barcode. + the options to generate the barcode + + + Sets the options to generate the barcode. + + Sets the options to generate the barcode. This can be all + the PDF417_* constants. + + the options to generate the barcode + + + Gets the barcode aspect ratio. + the barcode aspect ratio + + + Sets the barcode aspect ratio. + + Sets the barcode aspect ratio. A ratio or 0.5 will make the + barcode width twice as large as the height. + + the barcode aspect ratio + + + Gets the Y pixel height relative to X. + the Y pixel height relative to X + + + Sets the Y pixel height relative to X. + Sets the Y pixel height relative to X. It is usually 3. + the Y pixel height relative to X + + + The bars for each character. + + + Creates the bars for Postnet. + the code to be created without checksum + the bars + + + A QRCode implementation based on the zxing code. + + + modifiers to change the way the barcode is create. + + + Creates the QR barcode. + the text to be encoded + barcode hints. See #setHints for description. + + + + Creates the QR barcode with default error correction level (ErrorCorrectionLevel.L) + and default character set (ISO-8859-1). + + the text to be encoded + + + Gets the current data. + + + Sets the data to be encoded by the barcode. + Sets the data to be encoded by the barcode. If not specified in hints otherwise, the character set should be ISO-8859-1. + + + + modifiers to change the way the barcode is created. + + + + modifiers to change the way the barcode is created. They can be EncodeHintType.ERROR_CORRECTION + and EncodeHintType.CHARACTER_SET. For EncodeHintType.ERROR_CORRECTION the values can be ErrorCorrectionLevel.L, M, Q, H. + For EncodeHintType.CHARACTER_SET the values are strings and can be Cp437, Shift_JIS and ISO-8859-1 to ISO-8859-16. + You can also use UTF-8, but correct behaviour is not guaranteed as Unicode is not supported in QRCodes. + The default value is ISO-8859-1. + + + + Regenerates barcode after changes in hints or code. + + + Gets the size of the barcode grid + + + Gets the barcode size + + + * Places the barcode in a PdfCanvas. + + * Places the barcode in a PdfCanvas. The + barcode is always placed at coordinates (0, 0). Use the + translation matrix to move it elsewhere. + + the PdfCanvas where the barcode will be placed + the foreground color. It can be null + the size of the square grid cell + the dimensions the barcode occupies + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the size of the pixels. + the XObject. + + +

A simple, fast array of bits, represented compactly by an array of ints internally.

+ Sean Owen +
+ + bit to get + true iff bit i is set + + + Sets bit i. + bit to set + + + Flips bit i. + bit to set + + + Sets a block of 32 bits, starting at bit i. + first bit to set + + the new value of the next 32 bits. Note again that the least-significant bit + corresponds to bit i, the next-least-significant to i+1, and so on. + + + + Clears all bits (sets to false). + + + Efficient method to check if a range of bits is set, or not set. + start of range, inclusive. + end of range, exclusive + if true, checks that bits in range are set, otherwise checks that they are not set + true iff all bits are set or not set in range, according to value argument + if end is less than or equal to start + + + + underlying array of ints. The first element holds the first 32 bits, and the least + significant bit is bit 0. + + + + Reverses all bits in the array. + + + +

Gets the requested bit, where true means black.

+ The horizontal component (i.e. which column) + The vertical component (i.e. which row) + value of given bit in matrix +
+ +

Sets the given bit to true.

+ The horizontal component (i.e. which column) + The vertical component (i.e. which row) +
+ +

Flips the given bit.

+ The horizontal component (i.e. which column) + The vertical component (i.e. which row) +
+ + Clears all bits (sets to false). + + +

Sets a square region of the bit matrix to true.

+ The horizontal position to begin at (inclusive) + The vertical position to begin at (inclusive) + The width of the region + The height of the region +
+ + A fast method to retrieve one row of data from the matrix as a BitArray. + The row to retrieve + An optional caller-allocated BitArray, will be allocated if null or too small + + The resulting BitArray - this reference should always be used even when passing + your own row + + + + The width of the matrix + + + The height of the matrix + + + This method is for compatibility with older code. + + This method is for compatibility with older code. It's only logical to call if the matrix + is square, so I'm throwing if that's not the case. + + row/column dimension of this matrix + + + + JAVAPORT: This should be combined with BitArray in the future, although that class is not yet + dynamically resizeable. + + + JAVAPORT: This should be combined with BitArray in the future, although that class is not yet + dynamically resizeable. This implementation is reasonable but there is a lot of function calling + in loops I'd like to get rid of. + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + This class implements an array of unsigned bytes. + dswitkin@google.com (Daniel Switkin) + + + Creates a new ByteArray instance with size 0. + + + Creates a new ByteArray instance of the specified size. + size of the array + + + Creates a new ByteArray instance based on an existing byte[]. + the byte[] + + + Access an unsigned byte at location index. + The index in the array to access. + The unsigned value of the byte as an int. + + + + + Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1 + of ISO 18004. + + Sean Owen + + + character set ECI encoding name + + + + representing ECI for character encoding, or null if it is legal + but unsupported + + + + These are a set of hints that you may pass to Writers to specify their behavior. + dswitkin@google.com (Daniel Switkin) + + + Specifies what degree of error correction to use, for example in QR Codes (type Integer). + + + Specifies what character encoding to use where applicable (type String) + + + Specifies the minimal version level to use, for example in QR Codes (type Integer). + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + Encode "bytes" with the error correction level "ecLevel". + + Encode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen + internally by chooseMode(). On success, store the result in "qrCode". + We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for + "getECLevel" since our primary use is to show QR code on desktop screens. We don't need very + strong error correction for this purpose. + Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode() + with which clients can specify the encoding mode. For now, we don't need the functionality. + + + + + + + + + the code point of the table used in alphanumeric mode or + -1 if there is no corresponding code in the table. + + + + Choose the best mode by examining the content. + + Choose the best mode by examining the content. Note that 'encoding' is used as a hint; + if it is Shift_JIS, and the input is only double-byte Kanji, then we return + + . + + + + + + + Initialize "qrCode" according to "numInputBytes", "ecLevel", and "mode". + + Initialize "qrCode" according to "numInputBytes", "ecLevel", and "mode". On success, + modify "qrCode". + + + + + Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24). + + + + Get number of data bytes and number of error correction bytes for block id "blockID". + + Get number of data bytes and number of error correction bytes for block id "blockID". Store + the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of + JISX0510:2004 (p.30) + + + + + Interleave "bits" with corresponding error correction bytes. + + Interleave "bits" with corresponding error correction bytes. On success, store the result in + "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details. + + + + + Append mode info. + Append mode info. On success, store the result in "bits". + + + Append length info. + Append length info. On success, store the result in "bits". + + + + Append "bytes" in "mode" mode (encoding) into "bits". + Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits". + + + + + + + + + + + + + + L = ~7% correction + + + M = ~15% correction + + + Q = ~25% correction + + + H = ~30% correction + + + Gets the ordinal value. + the ordinal + + + int containing the two bits encoding a QR Code's error correction level + + + + representing the encoded error correction level + + + + +

Encapsulates a QR Code's format information, including the data mask used and + error correction level.

+
+ Sean Owen + +
+ + See ISO 18004:2006, Annex C, Table C.1 + + + Offset i holds the number of 1 bits in the binary representation of i + + + format info indicator, with mask still applied + + second copy of same info; both are checked at the same time + to establish best match + + + information about the format it specifies, or null + if doesn't seem to match any known pattern + + + + + Create a representation of GF(256) using the given primitive polynomial. + + irreducible polynomial whose coefficients are represented by + the bits of an int, where the least-significant bit represents the constant + coefficient + + + + the monomial representing coefficient * x^degree + + + Implements both addition and subtraction -- they are the same in GF(256). + sum/difference of a and b + + + 2 to the power of a in GF(256) + + + base 2 log of a in GF(256) + + + multiplicative inverse of a + + + + + product of a and b in GF(256) + + + + + the + + instance representing the field to use + to perform computations + + + coefficients as ints representing elements of GF(256), arranged + from most significant (highest-power term) coefficient to least significant + + + if argument is null or empty, + or if leading coefficient is 0 and this is not a + constant polynomial (that is, it is not the monomial "0") + + + + degree of this polynomial + + + true iff this polynomial is the monomial "0" + + + coefficient of x^degree term in this polynomial + + + evaluation of this polynomial at a given point + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + four bits encoding a QR Code data mode + + + + encoded by these bits + + if bits do not correspond to a known mode + + + version in question + + number of bits used, in this QR Code symbol + + , to encode the + count of characters that will follow encoded in this + + + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + This object renders a QR Code as a ByteMatrix 2D array of greyscale values. + dswitkin@google.com (Daniel Switkin) + + + + + + + + +

Implements Reed-Solomon encoding, as the name implies.

+ Sean Owen + William Rucklidge +
+ + + Creates a SolomonEncoder object based on a + + object. + Only QR codes are supported at the moment. + + the galois field + + + Encodes the provided data. + data to encode + error correction bytes + + + +

Thrown when an exception occurs during Reed-Solomon decoding, such as when + there are too many errors to correct.

+
+ Sean Owen +
+ + Creates a ReedSolomonException with a message. + the message of the exception + + + See ISO 18004:2006 Annex D + Sean Owen + + + See ISO 18004:2006 Annex D. + + See ISO 18004:2006 Annex D. + Element i represents the raw version bits that specify version i + 7 + + + +

Deduces version information purely from QR Code dimensions.

+ dimension in modules + + + + for a QR Code of that dimension + +
+ + See ISO 18004:2006 Annex E + + + See ISO 18004:2006 6.5.1 Table 9 + + + + + + A base class which covers the range of exceptions which may occur when encoding a barcode using + the Writer framework. + + dswitkin@google.com (Daniel Switkin) + + + Creates a WriterException. + + + Creates a WriterException with a message. + message of the exception + +
+
diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.forms.dll b/src/packages/itext7.7.0.1/lib/net40/itext.forms.dll new file mode 100644 index 00000000000..af3d4fd389f Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.forms.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.forms.xml b/src/packages/itext7.7.0.1/lib/net40/itext.forms.xml new file mode 100644 index 00000000000..417b34c6677 --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.forms.xml @@ -0,0 +1,2938 @@ + + + + itext.forms + + + + An interactive control on the screen that raises events and/or can retain data. + + + + Size of text in form fields when font size is not explicitly set. + + + A field with the symbol check + + + A field with the symbol circle + + + A field with the symbol cross + + + A field with the symbol diamond + + + A field with the symbol square + + + A field with the symbol star + + + + Flag that designates, if set, that the field can contain multiple lines + of text. + + + + Flag that designates, if set, that the field's contents must be obfuscated. + + + + Creates a form field as a wrapper object around a + + . + This + + must be an indirect object. + + the dictionary to be wrapped, must have an indirect reference. + + + + Creates a minimal + + . + + + + + Creates a form field as a parent of a + + . + + + the widget which will be a kid of the + + + + + Makes a field flag by bit position. + + Makes a field flag by bit position. Bit positions are numbered 1 to 32. + But position 0 corresponds to flag 1, position 3 corresponds to flag 4 etc. + + bit position of a flag in range 1 to 32 from the pdf specification. + corresponding field flag. + + + + Creates an empty form field without a predefined set of layout or + behavior. + + + the + + to create the field in + + + a new + + + + + + Creates an empty + button form field + with custom + behavior and layout, on a specified location. + + + the + + to create the button field in + + the location on the page for the button + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + button form field + with custom + behavior and layout. + + + the + + to create the button field in + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + text form field + . + + + the + + to create the text field in + + + a new + + + + + + Creates an empty + text form field + . + + + the + + to create the text field in + + the location on the page for the text field + + a new + + + + + + Creates a named + text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + + a new + + + + + + Creates a named + text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + true for multiline text field + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + true for multiline text field + + a new + + + + + + Creates a named + multilined text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + multilined text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + multiline text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a new + + + + + + Creates an empty + choice form field + . + + + the + + to create the choice field in + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a + + + the size of the font + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a + + + the size of the font + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + signature form field + . + + + the + + to create the signature field in + + + a new + + + + + + Creates an empty + signature form field + . + + + the + + to create the signature field in + + the location on the page for the signature field + + a new + + + + + + Creates a + radio group form field + . + + + the + + to create the radio group in + + the name of the form field + the initial value + + a new + radio group + + + + + Creates a generic + + that is added to a radio group. + + + the + + to create the radio group in + + the location on the page for the field + the radio button group that this field should belong to + the initial value + + a new + + + + + + + Creates a generic + + that is added to a radio group. + + + the + + to create the radio group in + + the location on the page for the field + the radio button group that this field should belong to + the initial value + + the + + of the document. + + null if it's no PDF/A document + + + a new + + + + + + + Creates a + + as a push button without data. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a new + + + + + + Creates a + + as a push button without data, with + its caption in a custom font. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a + + + the size of the font + + a new + + + + + + Creates a + + as a push button without data, with + its caption in a custom font. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a + + + the size of the font + + a new + + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + + a new + checkbox + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + the type of checkbox graphic to use. + + a new + checkbox + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + the type of checkbox graphic to use. + + the + + of the document. + + null if it's no PDF/A document + + + a new + checkbox + + + + + Creates a + combobox + with custom + behavior and layout, on a specified location. + + + the + + to create the combobox in + + the location on the page for the combobox + the name of the form field + the initial value + + a two-dimensional array of Strings which will be converted + to a PdfArray. + + + a new + + as a combobox + + + + + Creates a + combobox + with custom + behavior and layout, on a specified location. + + + the + + to create the combobox in + + the location on the page for the combobox + the name of the form field + the initial value + an array of Strings which will be converted to a PdfArray. + + a new + + as a combobox + + + + + Creates a + list field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a two-dimensional array of Strings which will be converted + to a PdfArray. + + + a new + + as a list field + + + + + Creates a + list field + with custom + behavior and layout, on a specified location. + + + the + + to create the list field in + + the location on the page for the list field + the name of the form field + the initial value + an array of Strings which will be converted to a PdfArray. + + a new + + as a list field + + + + + Creates a (subtype of) + + object. The type of the object + depends on the FT entry in the pdfObject parameter. + + + assumed to be either a + + , or a + + to a + + + + the + + to create the field in + + + a new + + , or null if + pdfObject does not contain a FT entry + + + + + Returns the type of the

Parent

form field, or of the wrapped + <PdfDictionary> object. +
+ + the form type, as a + + +
+ + Sets a value to the field and generating field appearance if needed. + of the field + the field + + + Sets a value to the field and generating field appearance if needed. + of the field + set this flat to false if you want to keep the appearance of the field generated before + + the field + + + Set text field value with given font and size + text value + + a + + + the size of the font + the edited field + + + Set text field value with given font and size + text value + + a + + + the size of the font + the edited field + + + Sets the field value and the display string. + + Sets the field value and the display string. The display string + is used to build the appearance. + + the field value + + the string that is used for the appearance. If null + the value parameter will be used + + the edited field + + + + Sets a parent + + for the current object. + + another form field that this field belongs to, usually a group field + the edited field + + + Gets the parent dictionary. + another form field that this field belongs to, usually a group field + + + Gets the kids of this object. + + contents of the dictionary's Kids property, as a + + + + + + Adds a new kid to the Kids array property from a + + . Also sets the kid's Parent property to this object. + + + a new + + entry for the field's Kids array property + + the edited field + + + + Adds a new kid to the Kids array property from a + + . Also sets the kid's Parent property to this object. + + + a new + + entry for the field's Kids array property + + the edited field + + + Changes the name of the field to the specified value. + the new field name, as a String + the edited field + + + Gets the current field name. + + the current field name, as a + + + + + Changes the alternate name of the field to the specified value. + + Changes the alternate name of the field to the specified value. The + alternate is a descriptive name to be used by status messages etc. + + the new alternate name, as a String + the edited field + + + Gets the current alternate name. + + Gets the current alternate name. The alternate is a descriptive name to + be used by status messages etc. + + + the current alternate name, as a + + + + + Changes the mapping name of the field to the specified value. + + Changes the mapping name of the field to the specified value. The + mapping name can be used when exporting the form data in the document. + + the new alternate name, as a String + the edited field + + + Gets the current mapping name. + + Gets the current mapping name. The mapping name can be used when + exporting the form data in the document. + + + the current mapping name, as a + + + + + + Checks whether a certain flag, or any of a combination of flags, is set + for this form field. + + an int interpreted as a series of a binary flags + + true if any of the flags specified in the parameter is also set + in the form field. + + + + Adds a flag, or combination of flags, for the form field. + + Adds a flag, or combination of flags, for the form field. This method is + intended to be used one flag at a time, but this is not technically + enforced. To replace the current value, use + + . + + an int interpreted as a series of a binary flags + the edited field + + + Adds or removes a flag, or combination of flags, for the form field. + + Adds or removes a flag, or combination of flags, for the form field. This + method is intended to be used one flag at a time, but this is not + technically enforced. To replace the current value, use + + . + + an int interpreted as a series of a binary flags + + if true, adds the flag(s). if false, + removes the flag(s). + + the edited field + + + If true, the field can contain multiple lines of text; if false, the field's text is restricted to a single line. + + whether the field can span over multiple lines. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters. + + whether or not the contents of the field must be obfuscated + + + Sets a flag, or combination of flags, for the form field. + + Sets a flag, or combination of flags, for the form field. This method + replaces the previous value. Compare with + + which adds a flag to the existing flags. + + an int interpreted as a series of a binary flags + the edited field + + + Gets the current list of PDF form field flags. + the current list of flags, encoded as an int + + + Gets the current value contained in the form field. + + the current value, as a + + + + + Gets the current value contained in the form field. + + the current value, as a + + + + + Sets the default fallback value for the form field. + the default value + the edited field + + + Gets the default fallback value for the form field. + the default value + + + Sets an additional action for the form field. + the dictionary key to use for storing the action + the action + the edited field + + + Gets the currently additional action dictionary for the form field. + the additional action dictionary + + + Sets options for the form field. + Sets options for the form field. Only to be used for checkboxes and radio buttons. + + an array of + + objects that each represent + the 'on' state of one of the choices. + + the edited field + + + Gets options for the form field. + + Gets options for the form field. Should only return usable values for + checkboxes and radio buttons. + + + the options, as an + + of + + objects + + + + + Gets all + + that this form field and its + kids + refer to. + + + a list of + + + + + + Gets default appearance string containing a sequence of valid page-content graphics or text state operators that + define such properties as the field's text size and color. + + + the default appearance graphics, as a + + + + + + Sets default appearance string containing a sequence of valid page-content graphics or text state operators that + define such properties as the field's text size and color. + + a valid sequence of PDF content stream syntax + the edited field + + + + Gets a code specifying the form of quadding (justification) to be used in displaying the text: + 0 Left-justified + 1 Centered + 2 Right-justified + + the current justification attribute + + + + Sets a code specifying the form of quadding (justification) to be used in displaying the text: + 0 Left-justified + 1 Centered + 2 Right-justified + + the value to set the justification attribute to + the edited field + + + Gets a default style string, as described in "Rich Text Strings" section of Pdf spec. + + the default style, as a + + + + + Sets a default style string, as described in "Rich Text Strings" section of Pdf spec. + a new default style for the form field + the edited field + + + Gets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + + Gets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + May be either + + or + + . + + the current rich text value + + + Sets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + + Sets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + May be either + + or + + . + + a new rich text value + the edited field + + + Gets the current font of the form field. + + the current + font + + + + Basic setter for the font property. + + Basic setter for the font property. Regenerates the field + appearance after setting the new value. + + the new font to be set + + + Basic setter for the fontSize property. + + Basic setter for the fontSize property. Regenerates the + field appearance after setting the new value. + + the new font size to be set + + + Basic setter for the fontSize property. + + Basic setter for the fontSize property. Regenerates the + field appearance after setting the new value. + + the new font size to be set + + + + Combined setter for the font and fontSize + properties. + + + Combined setter for the font and fontSize + properties. Regenerates the field appearance after setting the new value. + + the new font to be set + the new font size to be set + + + Basic setter for the backgroundColor property. + + Basic setter for the backgroundColor property. Regenerates + the field appearance after setting the new value. + + the new color to be set + + + Basic setter for the degRotation property. + + Basic setter for the degRotation property. Regenerates + the field appearance after setting the new value. + + the new degRotation to be set + + + + Sets the action on all + widgets + of this form field. + + the action + the edited field + + + Changes the type of graphical marker used to mark a checkbox as 'on'. + + Changes the type of graphical marker used to mark a checkbox as 'on'. + Notice that in order to complete the change one should call + regenerateField + method + + the new checkbox marker + + + + the edited field + + + This method regenerates appearance stream of the field. + + This method regenerates appearance stream of the field. Use it if you + changed any field parameters and didn't use setValue method which + generates appearance by itself. + + whether or not the regeneration was successful. + + + + Calculate the necessary height offset after applying field rotation + so that the origin of the bounding box is the lower left corner with respect to the field text. + + bounding box rectangle before rotation + rotation of the page + rotation of the field relative to the page + translation value for height + + + + Calculate the necessary width offset after applying field rotation + so that the origin of the bounding box is the lower left corner with respect to the field text. + + bounding box rectangle before rotation + rotation of the page + rotation of the field relative to the page + translation value for width + + + Gets the border width for the field. + the current border width. + + + Sets the border width for the field. + the new border width. + + + Sets the Border Color. + the new value for the Border Color + the edited field + + + Sets the text color. + the new value for the Color + the edited field + + + Sets the ReadOnly flag, specifying whether or not the field can be changed. + if true, then the field cannot be changed. + the edited field + + + Gets the ReadOnly flag, specifying whether or not the field can be changed. + true if the field cannot be changed. + + + Sets the Required flag, specifying whether or not the field must be filled in. + if true, then the field must be filled in. + the edited field + + + Gets the Required flag, specifying whether or not the field must be filled in. + true if the field must be filled in. + + + Sets the NoExport flag, specifying whether or not exporting is forbidden. + if true, then exporting is forbidden + the edited field + + + Gets the NoExport attribute. + whether exporting the value following a form action is forbidden. + + + Specifies on which page the form field's widget must be shown. + the page number + the edited field + + + Gets the appearance state names. + an array of Strings containing the names of the appearance states + + + Sets an appearance for (the widgets related to) the form field. + + the type of appearance stream to be added +
    +
  • PdfName.N: normal appearance
  • +
  • PdfName.R: rollover appearance
  • +
  • PdfName.D: down appearance
  • +
+ + + the state of the form field that needs to be true + for the appearance to be used. Differentiates between several streams + of the same type. + + + the appearance instructions, as a + + + the edited field +
+ + Releases underlying pdf object and other pdf entities used by wrapper. + + Releases underlying pdf object and other pdf entities used by wrapper. + This method should be called instead of direct call to + + if the wrapper is used. + + + + + + + Draws the visual appearance of text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of multiline text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of multiline text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws a border using the borderWidth and borderColor of the form field. + + the + + on which to draw + + the width of the rectangle to draw + the height of the rectangle to draw + + + Draws the appearance of a radio button with a specified value. + the width of the radio button to draw + the height of the radio button to draw + the value of the button + + + Draws the appearance of a radio button with a specified value. + the width of the radio button to draw + the height of the radio button to draw + the value of the button + + + Draws a radio button. + + the + + on which to draw + + the width of the radio button to draw + the height of the radio button to draw + required to be true for fulfilling the drawing operation + + + Draws the appearance of a checkbox with a specified state value. + the width of the checkbox to draw + the height of the checkbox to draw + the state of the form field that will be drawn + + + Draws the appearance for a push button. + the width of the pushbutton + the width of the pushbutton + the text to display on the button + + a + + + the size of the font + + a new + + + + + Draws the appearance for a push button. + the width of the pushbutton + the width of the pushbutton + the text to display on the button + + a + + + the size of the font + + a new + + + + + Performs the low-level drawing operations to draw a button object. + + the + + of the page to draw on. + + the x coordinate of the lower left corner of the button rectangle + the y coordinate of the lower left corner of the button rectangle + the width of the button + the width of the button + the text to display on the button + + a + + + the size of the font + + + Performs the low-level drawing operations to draw a button object. + + the + + of the page to draw on. + + the x coordinate of the lower left corner of the button rectangle + the y coordinate of the lower left corner of the button rectangle + the width of the button + the width of the button + the text to display on the button + + a + + + the size of the font + + + Performs the low-level drawing operations to draw a checkbox object. + + the + + of the page to draw on. + + the width of the button + the width of the button + the size of the font + the boolean value of the checkbox + + + Performs the low-level drawing operations to draw a checkbox object. + + the + + of the page to draw on. + + the width of the button + the width of the button + the size of the font + the boolean value of the checkbox + + + Button field flags + + + Returns Btn, the form type for choice form fields. + + the form type, as a + + + + + + If true, the field is a set of radio buttons; if false, the field is a + check box. + + + If true, the field is a set of radio buttons; if false, the field is a + check box. This flag only works if the Pushbutton flag is set to false. + + whether the field is currently radio buttons or a checkbox + + + + If true, the field is a set of radio buttons; if false, the field is a + check box. + + + If true, the field is a set of radio buttons; if false, the field is a + check box. This flag should be set only if the Pushbutton flag is set to false. + + whether the field should be radio buttons or a checkbox + + current + + + + + + If true, clicking the selected button deselects it, leaving no button + selected. + + + If true, clicking the selected button deselects it, leaving no button + selected. If false, exactly one radio button shall be selected at all + times. Only valid for radio buttons. + + whether a radio button currently allows to choose no options + + + If true, clicking the selected button deselects it, leaving no button selected. + + If true, clicking the selected button deselects it, leaving no button selected. + If false, exactly one radio button shall be selected at all times. + + whether a radio button may allow to choose no options + + current + + + + + If true, the field is a pushbutton that does not retain a permanent value. + whether or not the field is currently a pushbutton + + + If true, the field is a pushbutton that does not retain a permanent value. + whether or not to set the field to a pushbutton + + current + + + + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; + that is if one is checked, they are all checked. + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; + that is if one is checked, they are all checked. + If false, the buttons are mutually exclusive + + whether or not buttons are turned off in unison + + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; that is + if one is checked, they are all checked. + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; that is + if one is checked, they are all checked. + If false, the buttons are mutually exclusive + + whether or not buttons should turn off in unison + + current + + + + + + + + An AcroForm field type representing any type of choice field. + + An AcroForm field type representing any type of choice field. Choice fields + are to be represented by a viewer as a list box or a combo box. + + + + Choice field flags + + + Returns Ch, the form type for choice form fields. + + the form type, as a + + + + + Sets the index of the first visible option in a scrollable list. + the index of the first option + + current + + + + + Gets the current index of the first option in a scrollable list. + + the index of the first option, as a + + + + + Sets the selected items in the field. + a sorted array of indices representing selected items in the field + + current + + + + + Highlights the options. + + Highlights the options. If this method is used for Combo box, the first value in input array + will be the field value + + Array of options to be highlighted + + current + + + + + Highlights the options. + + Highlights the options. Is this method is used for Combo box, the first value in input array + will be the field value + + + + current + + + + + Gets the currently selected items in the field + a sorted array of indices representing the currently selected items in the field + + + If true, the field is a combo box; if false, the field is a list box. + whether or not the field should be a combo box + + current + + + + + If true, the field is a combo box; if false, the field is a list box. + whether or not the field is now a combo box. + + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + This flag shall be used only if the Combo flag is true. + + whether or not to add an editable text box + + current + + + + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + This flag shall be used only if the Combo flag is true. + + whether or not there is currently an editable text box + + + If true, the field???s option items shall be sorted alphabetically. + + If true, the field???s option items shall be sorted alphabetically. + This flag is intended for use by writers, not by readers. + + whether or not to sort the items + + current + + + + + If true, the field???s option items shall be sorted alphabetically. + + If true, the field???s option items shall be sorted alphabetically. + This flag is intended for use by writers, not by readers. + + whether or not the items are currently sorted + + + + If true, more than one of the field???s option items may be selected + simultaneously; if false, at most one item shall be selected. + + whether or not to allow multiple selection + + current + + + + + If true, more than one of the field???s option items may be selected simultaneously; if false, at most one item shall be selected. + + whether or not multiple selection is currently allowed + + + If true, text entered in the field shall be spell-checked.. + whether or not to require the PDF viewer to perform a spell check + + current + + + + + If true, text entered in the field shall be spell-checked.. + whether or not PDF viewer must perform a spell check + + + If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device). + + whether or not to save changes immediately + + current + + + + + If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device). + + whether or not to save changes immediately + + + An AcroForm field containing signature data. + + + Returns Sig, the form type for signature form fields. + + the form type, as a + + + + + Adds the signature to the signature field. + the signature to be contained in the signature field, or an indirect reference to it + the edited field + + + + Gets the + + , which contains fields that + must be locked if the document is signed. + + a dictionary containing locked fields. + + + + An AcroForm field containing textual data. + + + Returns Tx, the form type for textual form fields. + + the form type, as a + + + + + If true, the field can contain multiple lines of text; if false, the field?s text is restricted to a single line. + + whether or not the file can contain multiple lines of text + + current + + + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters. + + whether or not to obscure the typed characters + + current + + + + + + If true, the text entered in the field represents the pathname of a file + whose contents are to be submitted as the value of the field. + + whether or not this field currently represents a path + + + + If true, the text entered in the field represents the pathname of a file + whose contents are to be submitted as the value of the field. + + whether or not this field should represent a path + + current + + + + + If true, text entered in the field is spell-checked. + whether or not spell-checking is currently enabled + + + If true, text entered in the field is spell-checked. + whether or not to spell-check + + current + + + + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + Once the field is full, no further text is accepted. + + whether or not longer texts are currently allowed + + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + Once the field is full, no further text is accepted. + + whether or not to allow longer texts + + current + + + + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + If true, the field is automatically divided into as many equally spaced positions, + or combs, as the value of MaxLen, and the text is laid out into those combs. + + whether or not combing is enabled + + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + If true, the field is automatically divided into as many equally spaced positions, + or combs, as the value of MaxLen, and the text is laid out into those combs. + + whether or not to enable combing + + current + + + + + If true, the value of this field should be represented as a rich text string. + + If true, the value of this field should be represented as a rich text string. + If the field has a value, the RV entry of the field dictionary specifies the rich text string. + + whether or not text is currently represented as rich text + + + If true, the value of this field should be represented as a rich text string. + + If true, the value of this field should be represented as a rich text string. + If the field has a value, the RV entry of the field dictionary specifies the rich text string. + + whether or not to represent text as rich text + + current + + + + + Gets the maximum length of the field's text, in characters. + + Gets the maximum length of the field's text, in characters. + This is an optional parameter, so if it is not specified, null will be returned. + + the current maximum text length + + + Sets the maximum length of the field?s text, in characters. + the maximum text length + current + + + This class represents the static form technology AcroForm on a PDF file. + + + + + + Keeps track of whether or not appearances must be generated by the form + fields themselves, or by the PDF viewer application. + + + Keeps track of whether or not appearances must be generated by the form + fields themselves, or by the PDF viewer application. Default is + true. + + + + + A map of field names and their associated + form field + objects. + + + + The PdfDocument to which the PdfAcroForm belongs. + + + Creates a PdfAcroForm as a wrapper of a dictionary. + + Creates a PdfAcroForm as a wrapper of a dictionary. + Also initializes an XFA form if an /XFA entry is present in + the dictionary. + + the PdfDictionary to be wrapped + + + + Creates a PdfAcroForm from a + + of fields. + Also initializes an empty XFA form. + + + a + + of + + objects + + + + Retrieves AcroForm from the document. + + Retrieves AcroForm from the document. If there is no AcroForm in the + document Catalog and createIfNotExist flag is true then the AcroForm + dictionary will be created and added to the document. + + + the document to retrieve the + + from + + + when true, this method will create a + + if none exists for this document + + + the + document + 's AcroForm, or a new one + + + + This method adds the field to the last page in the document. + + This method adds the field to the last page in the document. + If there's no pages, creates a new one. + + + the + + to be added to the form + + + + This method adds the field to a specific page. + + the + + to be added to the form + + + the + + on which to add the field + + + + + This method merges field with its annotation and place it on the given + page. + + + This method merges field with its annotation and place it on the given + page. This method won't work if the field has no or more than one widget + annotations. + + + the + + to be added to the form + + + the + + on which to add the field + + + + + Gets the + form field + s as a + + . + + + a map of field names and their associated + form field + objects + + + + + + + + + + + + + + + + + + + Gets the XFA property on the AcroForm. + + an object representing the entire XDP. It can either be a + + or a + + . + + + + + Gets a + form field + by its name. + + + the name of the + form field + to retrieve + + + the + form field + , or null if it + isn't present + + + + + Gets the attribute generateAppearance, which tells + + to generate an appearance Stream for all + form field + s + that don't have one. + + bolean value indicating if the appearances need to be generated + + + + + Flattens interactive + form field + s in the document. If + no fields have been explicitly included via {#link #partialFormFlattening}, + then all fields are flattened. Otherwise only the included fields are + flattened. + + + + + Tries to remove the + form field + with the specified + name from the document. + + + the name of the + form field + to remove + + a boolean representing whether or not the removal succeeded. + + + + Adds a + form field + , identified by name, to the list of fields to be flattened. + Does not perform a flattening operation in itself. + + + the name of the + form field + to be flattened + + + + + Changes the identifier of a + form field + . + + the current name of the field + the new name of the field. Must not be used currently. + + + + Creates an in-memory copy of a + + . This new field is + not added to the document. + + + the name of the + form field + to be copied + + + a clone of the original + + + + + + Replaces the + + of a certain name with another + + . + + + the name of the + form field + to be replaced + + + the new + + + + + Gets all AcroForm fields in the document. + + a + + of field dictionaries + + + + Merges two dictionaries. + + Merges two dictionaries. When both dictionaries contain the same key, + the value from the first dictionary is kept. + + + the + + which may get extra entries from source + + + the + + whose entries may be merged into result + + + + Determines whether the AcroForm contains XFA data. + a boolean + + + + Gets the + + atribute. + + the XFA form object + + + Removes the XFA stream from the document. + + + Releases underlying pdf object and other pdf entities used by wrapper. + + Releases underlying pdf object and other pdf entities used by wrapper. + This method should be called instead of direct call to + + if the wrapper is used. + + + + + A sample implementation of the {#link IPdfPageExtraCopier} interface which + copies only AcroForm fields to a new page. + + + A sample implementation of the {#link IPdfPageExtraCopier} interface which + copies only AcroForm fields to a new page. +

+ NOTE: While it's absolutely not necessary to use the same PdfPageFormCopier instance for copying operations, + it is still worth to know that PdfPageFormCopier uses some caching logic which can potentially improve performance + in case of the reusing of the same instance. +
+
+ + A signature field lock dictionary. + + A signature field lock dictionary. Specifies a set of form + fields that shall be locked when this signature field is + signed. + + + + + Creates an instance of + + . + + + + + Creates an instance of + + . + + + The dictionary whose entries should be added to + the signature field lock dictionary. + + + + + Sets the permissions granted for the document when the corresponding signature + field is signed. + + + Sets the permissions granted for the document when the corresponding signature + field is signed. See + + for getting more info. + + The permissions granted for the document. + + This + + object. + + + + Sets signature lock for specific fields in the document. + + Indicates the set of fields that should be locked after the actual + signing of the corresponding signature takes place. + + Names indicating the fields. + + This + + object. + + + + Enumerates the different actions of a signature field lock. + + Enumerates the different actions of a signature field lock. + Indicates the set of fields that should be locked when the + corresponding signature field is signed: +
    +
  • all the fields in the document,
  • +
  • all the fields specified in the /Fields array,
  • +
  • all the fields except those specified in the /Fields array.
  • +
+
+
+ + + Enumerates the different levels of access permissions granted for + the document when the corresponding signature field is signed: +
    +
  • + + - no changes to the document are + permitted; any change to the document invalidates the signature,
  • +
  • + + - permitted changes are filling in forms, + instantiating page templates, and signing; other changes invalidate + the signature,
  • +
  • + + - permitted changes are the + same as for the previous, as well as annotation creation, deletion, + and modification; other changes invalidate the signature.
  • +
+
+
+ + A class to process "classic" fields. + + + A class for some basic SOM processing. + + + The order the names appear in the XML, depth first. + + + The mapping of full names to nodes. + + + The data to do a search from the bottom hierarchy. + + + A stack to be used when parsing. + + + A temporary store for the repetition count. + + + Escapes a SOM string fragment replacing "." with "\.". + the unescaped string + the escaped string + + + Unescapes a SOM string fragment replacing "\." with ".". + the escaped string + the unescaped string + + + + Outputs the stack as the sequence of elements separated + by '.'. + + the stack as the sequence of elements separated by '.' + + + Gets the name with the #subform removed. + the long name + the short name + + + Adds a SOM name to the search node chain. + the SOM name + + + Adds a SOM name to the search node chain. + the start point + the stack with the separated SOM parts + the full name + + + Searches the SOM hierarchy from the bottom. + the SOM parts + the full name or null if not found + + + Splits a SOM name in the individual parts. + the full SOM name + the split name + + + Gets the order the names appear in the XML, depth first. + the order the names appear in the XML, depth first + + + Sets the order the names appear in the XML, depth first + the order the names appear in the XML, depth first + + + Gets the mapping of full names to nodes. + the mapping of full names to nodes + + + Sets the mapping of full names to nodes. + the mapping of full names to nodes + + + Gets the data to do a search from the bottom hierarchy. + the data to do a search from the bottom hierarchy + + + Sets the data to do a search from the bottom hierarchy. + the data to do a search from the bottom hierarchy + + + Creates a new instance from a Collection with the full names. + the Collection + + + Gets the mapping from short names to long names. + + Gets the mapping from short names to long names. A long + name may contain the #subform name part. + + the mapping from short names to long names + + + Sets the mapping from short names to long names. + + Sets the mapping from short names to long names. A long + name may contain the #subform name part. + + the mapping from short names to long names + + + + A structure to store each part of a SOM name and link it to the next part + beginning from the lower hierarchy. + + + + + Gets the full name by traversing the hierarchy using only the + index 0. + + the full name + + + Search the current node for a similar name. + + Search the current node for a similar name. A similar name starts + with the same name but has a different index. For example, "detail[3]" + is similar to "detail[9]". The main use is to discard names that + correspond to out of bounds records. + + the name to search + true if a similitude was found + + + Processes XFA forms. + + + The URI for the XFA Data schema. + + + An empty constructor to build on. + + + Creates an XFA form by the stream containing all xml information + + + + Creates an XFA form by the + + containing all xml information + + + + + A constructor from a + + . It is assumed, but not + necessary for correct initialization, that the dictionary is actually a + + . An entry in the dictionary with the XFA + key must contain correct XFA syntax. If the XFA key is + absent, then the constructor essentially does nothing. + + the dictionary object to initialize from + + + A constructor from a PdfDocument. + + A constructor from a PdfDocument. It basically does everything + from finding the XFA stream to the XML parsing. + + the PdfDocument instance + + + Sets the XFA key from a byte array. + Sets the XFA key from a byte array. The old XFA is erased. + the data + pdfDocument + on IO error + + + Extracts DOM nodes from an XFA document. + + an XFA file as a + + DOM + document + + + + a + + of XFA packet names and their associated + DOM nodes + + + + Write the XfaForm to the provided PdfDocument. + the PdfDocument to write the XFA Form to + + + + Changes a field value in the XFA form. + the name of the field to be changed + the new value + + + Gets the xfa field value. + the fully qualified field name + the field value + + + Returns true if it is a XFA form. + true if it is a XFA form + + + Finds the complete field name from a partial name. + the complete or partial name + the complete name or null if not found + + + + Finds the complete SOM name contained in the datasets section from a + possibly partial name. + + the complete or partial name + the complete name or null if not found + + + + Finds the Node contained in the datasets section from a + possibly partial name. + + the complete or partial name + the Node or null if not found + + + Gets all the text contained in the child nodes of this node. + the Node + the text found or "" if no text was found + + + Sets the text of this node. + + Sets the text of this node. All the child's node are deleted and a new + child text node is created. + + the Node to add the text to + the text to add + + + Gets the top level DOM document. + the top level DOM document + + + Sets the top DOM document. + the top DOM document + + + Gets the Node that corresponds to the datasets part. + the Node that corresponds to the datasets part + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + + file + object + + to fill this object with XFA data. The resulting DOM document may + be modified. + + + the + + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + + file + object + + to fill this object with XFA data. + + + the + + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts an + + to fill this object with XFA data. The resulting DOM document may be + modified. + + + the + + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts an + + to fill this object with XFA data. + + + the + + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + SAX input source + to fill this object with XFA data. The resulting DOM + document may be modified. + + + the + SAX input source + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + SAX input source + to fill this object with XFA data. + + + the + SAX input source + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + the input + + + + + Replaces the XFA data under datasets/data. + + the input + + + whether or not the resulting DOM document may be modified + + + Return the XFA Object, could be an array, could be a Stream. + + Return the XFA Object, could be an array, could be a Stream. + Returns null f no XFA Object is present. + + a PdfDocument instance + the XFA object + + + Serializes a XML document to a byte array. + the XML document + the serialized XML document + on error + + + + + + + + + + + + + Extracts the nodes from the domDocument. + + + Some XFA forms don't have a datasets node. + + Some XFA forms don't have a datasets node. + If this is the case, we have to add one. + + + + Processes the datasets section in the XFA form. + + + Creates a new instance from the datasets node. + + Creates a new instance from the datasets node. This expects + not the datasets but the data node that comes below. + + the datasets node + + + Inserts a new Node that will match the short name. + the datasets top Node + the short name + the new Node of the inserted name + +
+
diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.io.dll b/src/packages/itext7.7.0.1/lib/net40/itext.io.dll new file mode 100644 index 00000000000..32fcb2ff3c7 Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.io.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.io.xml b/src/packages/itext7.7.0.1/lib/net40/itext.io.xml new file mode 100644 index 00000000000..95fb84b52c8 --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.io.xml @@ -0,0 +1,6205 @@ + + + + itext.io + + + + Came from GIFEncoder initially. + + Came from GIFEncoder initially. + Modified - to allow for output compressed data without the block counts + which breakup the compressed data stream for GIF. + + + + note this also indicates gif format BITFile. + + + destination for output data + GIF LZW requires block counts for output data + + + + + + + + + Encodes data in the CCITT G4 FAX format. + + + Creates a new encoder. + the line width + + + Encodes a number of lines. + the data to be encoded + the offset into the data + the size of the data to be encoded + + + Encodes a full image. + the data to encode + the image width + the image height + the encoded image + + + Encodes a number of lines. + the data to be encoded + the number of lines to encode + + + Closes the encoder and returns the encoded data. + the encoded data + + + + Class to read a JBIG2 file at a basic level: understand all the segments, + understand what segments belong to which pages, how many pages there are, + what the width and height of each page is, and global segments if there + are any. + + + Class to read a JBIG2 file at a basic level: understand all the segments, + understand what segments belong to which pages, how many pages there are, + what the width and height of each page is, and global segments if there + are any. Or: the minimum required to be able to take a normal sequential + or random-access organized file, and be able to embed JBIG2 pages as images + in a PDF. + TODO: the indeterminate-segment-size value of dataLength, else? + + + + + + + + + + + + + + + + + + + Inner class that holds information about a JBIG2 segment. + + + Inner class that holds information about a JBIG2 page. + + + + return as a single byte array the header-data for each segment in segment number + order, EMBEDDED organization, but i am putting the needed segments in SEQUENTIAL organization. + + + return as a single byte array the header-data for each segment in segment number + order, EMBEDDED organization, but i am putting the needed segments in SEQUENTIAL organization. + if for_embedding, skip the segment types that are known to be not for acrobat. + + + + a byte array + + + + Modified from original LZWCompressor to change interface to passing a + buffer of data to be compressed. + + + + base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF + + + reserved clear code based on code size + + + reserved end of data code based on code size + + + current number bits output for each code + + + limit at which current number of bits code size has to be increased + + + the prefix code which represents the predecessor string to current input point + + + output destination for bit codes + + + general purpose LZW string table + + + modify the limits of the code values in LZW encoding due to TIFF bug / feature + + + destination for compressed data + the initial code size for the LZW compressor + flag indicating that TIFF lzw fudge needs to be applied + if underlying output stream error + + + data to be compressed to output stream + if underlying output stream error + + + + Indicate to compressor that no more data to go so write out + any remaining buffered data. + + if underlying output stream error + + + General purpose LZW String Table. + + General purpose LZW String Table. + Extracted from GIFEncoder by Adam Doppelt + Comments added by Robin Luiten + expandCode added by Robin Luiten + The strLen_ table to give quick access to the lenght of an expanded + code for use by the expandCode method added by Robin. + + + + codesize + Reserved Codes + + + + each entry corresponds to a code and contains the length of data + that the code expands to when decoded. + + + + Constructor allocate memory for string store data + + + value of -1 indicates no predecessor [used in initialization] + + the byte [character] to add to the string store which follows + the predecessor string specified the index. + + + 0xFFFF if no space in table left for addition of predecessor + index and byte b. Else return the code allocated for combination index + b. + + + + index to prefix string + the character that follws the index prefix + + b if param index is HASH_FREE. Else return the code + for this prefix and byte successor + + + + + the size of code to be preallocated for the + string store. + + + + + If expanded data doesn't fit into array only what will fit is written + to buf and the return value indicates how much of the expanded code has + been written to the buf. + + + If expanded data doesn't fit into array only what will fit is written + to buf and the return value indicates how much of the expanded code has + been written to the buf. The next call to expandCode() should be with + the same code and have the skip parameter set the negated value of the + previous return. Successive negative return values should be negated and + added together for next skip parameter value with same code. + + buffer to place expanded data into + offset to place expanded data + + the code to expand to the byte array it represents. + PRECONDITION This code must already be in the LZSS + + + is the number of bytes at the start of the expanded code to + be skipped before data is written to buf. It is possible that skipHead is + equal to codeLen. + + + the length of data expanded into buf. If the expanded code is longer + than space left in buf then the value returned is a negative number which when + negated is equal to the number of bytes that were used of the code being expanded. + This negative value also indicates the buffer is full. + + + + Writes a PNG image. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A list of constants used in class TIFFImage. + + + subfile data descriptor + + + reduced resolution version + + + one page of many + + + transparency mask + + + +kind of data in subfile + + + full resolution image data + + + reduced size image data + + + one page of many + + + image width in pixels + + + image height in pixels + + + bits per channel (sample) + + + data compression technique + + + dump mode + + + CCITT modified Huffman RLE + + + CCITT Group 3 fax encoding + + + CCITT Group 4 fax encoding + + + + !6.0 JPEG + + + %JPEG DCT compression + + + NeXT 2-bit RLE + + + #1 w/ word alignment + + + Macintosh RLE + + + ThunderScan RLE + + + IT8 CT w/padding + + + IT8 Linework RLE + + + IT8 Monochrome picture + + + IT8 Binary line art + + + Pixar companded 10bit LZW + + + Pixar companded 11bit ZIP + + + Deflate compression + + + Deflate compression, as recognized by Adobe + + + Kodak DCS encoding + + + ISO JBIG + + + SGI Log Luminance RLE + + + SGI Log 24-bit packed + + + photometric interpretation + + + min value is white + + + min value is black + + + RGB color model + + + color map indexed + + + $holdout mask + + + !color separations + + + !CCIR 601 + + + !1976 CIE L*a*b + + + CIE Log2(L) + + + CIE Log2(L) (u',v') + + + +thresholding used on data + + + + or dithered scan + + + usually floyd-steinberg + + + +dithering matrix width + + + +dithering matrix height + + + data order within a byte + + + most significant -> least + + + least significant -> most + + + name of doc. + name of doc. image is from + + + info about image + + + scanner manufacturer name + + + scanner model name/number + + + offsets to data strips + + + +image orientation + + + row 0 top, col 0 lhs + + + row 0 top, col 0 rhs + + + row 0 bottom, col 0 rhs + + + row 0 bottom, col 0 lhs + + + row 0 lhs, col 0 top + + + row 0 rhs, col 0 top + + + row 0 rhs, col 0 bottom + + + row 0 lhs, col 0 bottom + + + samples per pixel + + + rows per strip of data + + + bytes counts for strips + + + +minimum sample value + + + +maximum sample value + + + pixels/resolution in x + + + pixels/resolution in y + + + storage organization + + + single image plane + + + separate planes of data + + + page name image is from + + + x page offset of image lhs + + + y page offset of image lhs + + + +byte offset to free block + + + +sizes of free blocks + + + $gray scale curve accuracy + + + tenths of a unit + + + hundredths of a unit + + + thousandths of a unit + + + ten-thousandths of a unit + + + hundred-thousandths + + + $gray scale response curve + + + 32 flag bits + + + 2-dimensional coding + + + data not compressed + + + fill to byte boundary + + + 32 flag bits + + + data not compressed + + + units of resolutions + + + no meaningful units + + + english + + + metric + + + page numbers of multi-page + + + $color curve accuracy + + + tenths of a unit + + + hundredths of a unit + + + thousandths of a unit + + + ten-thousandths of a unit + + + hundred-thousandths + + + !colorimetry info + + + + creation date and time + + + creator of image + + + machine where created + + + prediction scheme w/ LZW + + + no predictor + + + horizontal differencing + + + image white point + + + !primary chromaticities + + + RGB map for pallette image + + + !highlight+shadow info + + + !rows/data tile + + + !cols/data tile + + + !offsets to data tiles + + + !byte counts for tiles + + + lines w/ wrong pixel count + + + regenerated line info + + + no errors detected + + + receiver regenerated lines + + + uncorrected errors exist + + + max consecutive bad lines + + + subimage descriptors + + + !inks in separated image + + + !cyan-magenta-yellow-black + + + !ascii names of inks + + + !number of inks + + + !0% and 100% dot codes + + + !separation target + + + !info about extra samples + + + !unspecified data + + + !associated alpha data + + + !unassociated alpha data + + + !data sample format + + + !unsigned integer data + + + !signed integer data + + + !IEEE floating point data + + + !untyped data + + + !complex signed int + + + !complex ieee floating + + + !variable MinSampleValue + + + !variable MaxSampleValue + + + %JPEG table stream + + + !JPEG processing algorithm + + + !baseline sequential + + + !Huffman coded lossless + + + !pointer to SOI marker + + + !JFIF stream length + + + !restart interval length + + + !lossless proc predictor + + + !lossless point transform + + + !Q matrice offsets + + + !DCT table offsets + + + !AC coefficient offsets + + + !RGB -> YCbCr transform + + + !YCbCr subsampling factors + + + !subsample positioning + + + !as in PostScript Level 2 + + + !as in CCIR 601-1 + + + !colorimetry info + + + image reference points + + + region-xform tack point + + + warp quadrilateral + + + affine transformation mat + + + $use ExtraSamples + + + $use SampleFormat + + + z depth of image + + + z depth/data tile + + + full image size in x + + + full image size in y + + + texture map format + + + + cotan(fov) for env. + cotan(fov) for env. maps + + + W2S + + + W2C + + + + device serial number + tag 33405 is a private tag registered to Eastman Kodak + + + + tag 33432 is listed in the 6.0 spec w/ unknown ownership + + + IPTC TAG from RichTIFF specifications + + + site name + + + color seq. + color seq. [RGB,CMYK,etc] + + + DDES Header + + + raster scanline padding + + + # of bits in short run + + + # of bits in long run + + + LW colortable + + + BP/BL image color switch + + + BP/BL bg color switch + + + BP/BL image color value + + + BP/BL bg color value + + + MP pixel intensity value + + + HC transparency switch + + + color character. + color character. table + + + Sequence Frame Count + + + + ICC profile data + tag 34750 is a private tag registered to Adobe? + + + + tag 34377 is private tag registered to Adobe for PhotoShop + + + + JBIG options + tag 34750 is a private tag registered to Pixel Magic + + + + encoded Class 2 ses. + encoded Class 2 ses. parms + + + received SubAddr string + + + receive time (secs) + + + Sample value to Nits + + + + unknown use + tag 34929 is a private tag registered to FedEx + + + + + hue shift correction data + tag 65535 is an undefined tag used by Eastman Kodak + + + + + A boolean storing the endianness of the stream. + + + The number of entries in the IFD. + + + An array of TIFFFields. + + + A Hashtable indexing the fields by tag number. + + + The offset of this IFD. + + + The offset of the next IFD. + + + The default constructor. + + + Constructs a TIFFDirectory from a SeekableStream. + + Constructs a TIFFDirectory from a SeekableStream. + The directory parameter specifies which directory to read from + the linked list present in the stream; directory 0 is normally + read but it is possible to store multiple images in a single + TIFF file by maintaining multiple directories. + + a SeekableStream to read from. + the index of the directory to read. + + + + Constructs a TIFFDirectory by reading a SeekableStream. + + Constructs a TIFFDirectory by reading a SeekableStream. + The ifd_offset parameter specifies the stream offset from which + to begin reading; this mechanism is sometimes used to store + private IFDs within a TIFF file that are not part of the normal + sequence of IFDs. + + a SeekableStream to read from. + the long byte offset of the directory. + + the index of the directory to read beyond the + one at the current stream offset; zero indicates the IFD + at the current offset. + + + + + + + + Returns the number of directory entries. + + + + Returns the value of a given tag as a TIFFField, + or null if the tag is not present. + + + + Returns true if a tag appears in the directory. + + + + Returns an ordered array of ints indicating the tag + values. + + + + + Returns an array of TIFFFields containing all the fields + in this directory. + + + + + Returns the value of a particular index of a given tag as a + byte. + + + Returns the value of a particular index of a given tag as a + byte. The caller is responsible for ensuring that the tag is + present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or + TIFF_UNDEFINED. + + + + + Returns the value of index 0 of a given tag as a + byte. + + + Returns the value of index 0 of a given tag as a + byte. The caller is responsible for ensuring that the tag is + present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or + TIFF_UNDEFINED. + + + + + Returns the value of a particular index of a given tag as a + long. + + + Returns the value of a particular index of a given tag as a + long. The caller is responsible for ensuring that the tag is + present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, + TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. + + + + + Returns the value of index 0 of a given tag as a + long. + + + Returns the value of index 0 of a given tag as a + long. The caller is responsible for ensuring that the tag is + present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, + TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. + + + + + Returns the value of a particular index of a given tag as a + float. + + + Returns the value of a particular index of a given tag as a + float. The caller is responsible for ensuring that the tag is + present and has numeric type (all but TIFF_UNDEFINED and + TIFF_ASCII). + + + + Returns the value of index 0 of a given tag as a float. + + Returns the value of index 0 of a given tag as a float. The + caller is responsible for ensuring that the tag is present and + has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII). + + + + + Returns the value of a particular index of a given tag as a + double. + + + Returns the value of a particular index of a given tag as a + double. The caller is responsible for ensuring that the tag is + present and has numeric type (all but TIFF_UNDEFINED and + TIFF_ASCII). + + + + Returns the value of index 0 of a given tag as a double. + + Returns the value of index 0 of a given tag as a double. The + caller is responsible for ensuring that the tag is present and + has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the number of image directories (subimages) stored in a + given TIFF file, represented by a SeekableStream. + + + + + + Returns a boolean indicating whether the byte order used in the + the TIFF file is big-endian (i.e. + + + Returns a boolean indicating whether the byte order used in the + the TIFF file is big-endian (i.e. whether the byte order is from + the most significant to the least significant) + + + + + Returns the offset of the IFD corresponding to this + TIFFDirectory. + + + + + Returns the offset of the next IFD after the IFD corresponding to this + TIFFDirectory. + + + + Class that can decode TIFF files. + + + The fill order of the compressed data bytes. + + + + + Reverses the bits in the array + the bits to reverse + + + Class that can decompress TIFF files. + + + The logical order of bits within a byte. + + The logical order of bits within a byte. +
+            1 = MSB-to-LSB
+            2 = LSB-to-MSB (flipped)
+            
+
+
+ + Uncompressed mode flag: 1 if uncompressed, 0 if not. + + + + EOL padding flag: 1 if fill bits have been added before an EOL such + that the EOL ends on a byte boundary, 0 otherwise. + + + + Coding dimensionality: 1 for 2-dimensional, 0 for 1-dimensional. + + + + Invokes the superclass method and then sets instance variables on + the basis of the metadata set on this decompressor. + + + + + Flag for 8 bit unsigned integers. + + + Flag for null-terminated ASCII strings. + + + Flag for 16 bit unsigned integers. + + + Flag for 32 bit unsigned integers. + + + Flag for pairs of 32 bit unsigned integers. + + + Flag for 8 bit signed integers. + + + Flag for 8 bit uninterpreted bytes. + + + Flag for 16 bit signed integers. + + + Flag for 32 bit signed integers. + + + Flag for pairs of 32 bit signed integers. + + + Flag for 32 bit IEEE floats. + + + Flag for 64 bit IEEE doubles. + + + The tag number. + + + The tag type. + + + The number of data items present in the field. + + + The field data. + + + The default constructor. + + + + Returns the tag number, between 0 and 65535. + + + Returns the type of the data stored in the IFD. + + Returns the type of the data stored in the IFD. + For a TIFF6.0 file, the value will equal one of the + TIFF_ constants defined in this class. For future + revisions of TIFF, higher values are possible. + + + + Returns the number of elements in the IFD. + + + + + + + + + + + + + + + + + + + + A class for performing LZW decoding. + + + Method to decode LZW compressed data. + The compressed data. + Array to return the uncompressed data in. + The number of rows the compressed data contains. + + + Initialize the string table. + + + Write out the string just uncompressed. + + + Add a new string to the string table. + + + Add a new string to the string table. + + + Append newString to the end of oldString. + + + Exports images as TIFF. + + + + + + + + + + + + + + + Inner class class containing information about a field. + + + + + + + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about an ASCII field. + + + a utility that creates a range item for an entire index + where the index is + a range item representing the entire index + + + get a single CID font. + + get a single CID font. The PDF architecture (1.4) + supports 16-bit strings only with CID CFF fonts, not + in Type-1 CFF fonts, so we convert the font to CID if + it is in the Type-1 format. + Two other tasks that we need to do are to select + only a single font from the CFF package (this again is + a PDF restriction) and to subset the CharStrings glyph + description. + + + + A random Access File or an array + + + List items for the linked list that builds the new CID font. + + + remember the current offset and increment by item's size in bytes. + + + Emit the byte stream for this item. + + + Fix up cross references to this item (applies only to markers). + + + set the value of an offset item that was initially unknown. + + set the value of an offset item that was initially unknown. + It will be fixed up latex by a call to xref on some marker. + + + + A range item. + + + An index-offset item for the list. + + An index-offset item for the list. + The size denotes the required size in the CFF. A positive + value means that we need a specific size in bytes (for offset arrays) + and a negative value means that this is a dict item that uses a + variable-size representation. + + + + + TODO To change the template for this generated type comment go to + Window - Preferences - Java - Code Generation - Code and Comments + + + + an unknown offset in a dictionary for the list. + + an unknown offset in a dictionary for the list. + We will fix up the offset later; for now, assume it's large. + + + + Card24 item. + + + Card32 item. + + + A SID or Card16 item. + + + A Card8 item. + + + A dictionary number on the list. + + A dictionary number on the list. + This implementation is inefficient: it doesn't use the variable-length + representation. + + + + An offset-marker item for the list. + + An offset-marker item for the list. + It is used to mark an offset and to set the offset list item. + + + + This Class subsets a CFF Type Font. + + This Class subsets a CFF Type Font. The subset is preformed for CID fonts and NON CID fonts. + The Charstring is subsetted for both types. For CID fonts only the FDArray which are used are embedded. + The Lsubroutines of the FDArrays used are subsetted as well. The Subroutine subset supports both Type1 and Type2 + formatting although only tested on Type2 Format. + For Non CID the Lsubroutines are subsetted. On both types the Gsubroutines is subsetted. + A font which was not of CID type is transformed into CID as a part of the subset process. + The CID synthetic creation was written by Sivan Toledo (sivan@math.tau.ac.il) + + Oren Manor (manorore@post.tau.ac.il) and Ygal Blum (blumygal@post.tau.ac.il) + + + Operator codes for unused CharStrings and unused local and global Subrs + + + The Strings in this array represent Type1/Type2 operator names + + + The Strings in this array represent Type1/Type2 escape operator names + + + + A Map containing the glyphs used in the text after being converted + to glyph number by the CMap + + + + The GlyphsUsed keys as an list + + + A Set for keeping the FDArrays being used by the font + + + A Maps array for keeping the subroutines used in each FontDict + + + The SubroutinesUsed Maps as lists + + + A Map for keeping the Global subroutines used in the font + + + The Global SubroutinesUsed Maps as lists + + + A Map for keeping the subroutines used in a non-cid font + + + The SubroutinesUsed Map as list + + + An array of the new Indexes for the local Subr. + An array of the new Indexes for the local Subr. One index for each FontDict + + + The new subroutines index for a non-cid font + + + The new global subroutines index of the font + + + The new CharString of the font + + + The bias for the global subroutines + + + The linked list for generating the new font stream + + + Number of arguments to the stem operators in a subroutine calculated recursively + + + C'tor for CFFFontSubset + - The font file + - a Map that contains the glyph used in the subset + + + Calculates the length of the charset according to its format + The Charset Offset + Number of glyphs in the font + the length of the Charset + + + Function calculates the number of ranges in the Charset + The number of glyphs in the font + The format of the Charset + The number of ranges in the Charset data structure + + + Read the FDSelect of the font and compute the array and its length + The index of the font being processed + + + Function reads the FDSelect and builds the FDArrayUsed Map According to the glyphs used + the Number of font being processed + + + Read the FDArray count, offsize and Offset array + + + + + The Process function extracts one font out of the CFF file and returns a + subset version of the original. + + - The name of the font to be taken out of the CFF + The new font stream + + + + Function calcs bias according to the CharString type and the count + of the subrs + + The offset to the relevant subrs index + the font + The calculated Bias + + + Function uses BuildNewIndex to create the new index of the subset charstrings + the font + + + + + + The function finds for the FD array processed the local subr offset and its + offset array. + + the font + The FDARRAY processed + + + + + The function reads a subrs (glyph info) between begin and end. + + The function reads a subrs (glyph info) between begin and end. + Adds calls to a Lsubr to the hSubr and lSubrs. + Adds calls to a Gsubr to the hGSubr and lGSubrs. + + the start point of the subr + the end point of the subr + the bias of the Global Subrs + the bias of the Local Subrs + the Map for the lSubrs + the list for the lSubrs + + + + Function Checks how the current operator effects the run time stack after being run + An operator may increase or decrease the stack size + + + + Function checks the key and return the change to the stack after the operator + The change in the stack. 2-> flush the stack + + + Empty the Type2 Stack + + + Pop one element from the stack + + + Add an item to the stack + + + The function reads the next command after the file pointer is set + + + The function reads the subroutine and returns the number of the hint in it. + + The function reads the subroutine and returns the number of the hint in it. + If a call to another subroutine is found the function calls recursively. + + the start point of the subr + the end point of the subr + the bias of the Local Subrs + the bias of the Global Subrs + The Offsets array of the subroutines + The number of hints in the subroutine read. + + + Function builds the new offset array, object array and assembles the index. + + Function builds the new offset array, object array and assembles the index. + used for creating the glyph and subrs subsetted index + + the offset array of the original index + the Map of the used objects + the operator inserted into the data stream for unused entries + the new index subset version + + + + + Function creates the new index, inserting the count,offsetsize,offset array + and object array. + + the subsetted offset array + the subsetted object array + the new index created + + + The function builds the new output stream according to the subset process + the font + the subsetted font stream + + + Function Copies the header from the original fileto the output list + + + Function Build the header of an index + the count field of the index + the offsize field of the index + the first offset of the index + + + Function adds the keys into the TopDict + OffsetItem for the FDArray + OffsetItem for the FDSelect + OffsetItem for the CharSet + OffsetItem for the CharString + + + + Function takes the original string item and adds the new strings + to accommodate the CID rules + + the font + + + Function creates new FDSelect for non-CID fonts. + + Function creates new FDSelect for non-CID fonts. + The FDSelect built uses a single range for all glyphs + + OffsetItem for the FDSelect + the number of glyphs in the font + + + Function creates new CharSet for non-CID fonts. + + Function creates new CharSet for non-CID fonts. + The CharSet built uses a single range for all glyphs + + OffsetItem for the CharSet + the number of glyphs in the font + + + Function creates new FDArray for non-CID fonts. + + Function creates new FDArray for non-CID fonts. + The FDArray built has only the "Private" operator that points to the font's + original private dict + + OffsetItem for the FDArray + OffsetItem for the Private Dict + the font + + + Function reconstructs the FDArray, PrivateDict and LSubr for CID fonts + the font + + + Function subsets the FDArray and builds the new one with new offsets + The font + OffsetItem Array (one for each FDArray) + + + Function Adds the new private dicts (only for the FDs used) to the list + the font + OffsetItem array one element for each private + IndexBaseItem array one element for each private + OffsetItem array one element for each private + + + Function Adds the new LSubrs dicts (only for the FDs used) to the list + The index of the font + The IndexBaseItem array for the linked list + OffsetItem array for the linked list + + + + Calculates how many byte it took to write the offset for the subrs in a specific + private dict. + + The Offset for the private dict + The size of the private dict + The size of the offset of the subrs in the private dict + + + Function computes the size of an index + The offset for the computed index + The size of the index + + + + The function creates a private dict for a font that was not CID + All the keys are copied as is except for the subrs key + + the font + The OffsetItem for the subrs of the private + + + + the function marks the beginning of the subrs index and adds the subsetted subrs + index to the output list. + + the font + IndexBaseItem for the private that's referencing to the subrs + OffsetItem for the subrs + + + The font's encoding name. + + The font's encoding name. This encoding is 'StandardEncoding' or 'AdobeStandardEncoding' for a font + that can be totally encoded according to the characters names. For all other names the font is treated as symbolic. + + + + Get glyph's width. + a unicode symbol or FontSpecif code. + Gets width in normalized 1000 units. + + + Get glyph's bbox. + a unicode symbol or FontSpecif code. + Gets bbox in normalized 1000 units. + + + Gets the kerning between two glyphs. + the first unicode value + the second unicode value + the kerning to be applied + + + Gets the kerning between two glyphs. + the first glyph + the second glyph + the kerning to be applied + + + Gets the name without the modifiers Bold, Italic or BoldItalic. + the full name of the font + the name without the modifiers Bold, Italic or BoldItalic + + + The path to the font resources. + + + Checks if its a valid CJKFont font. + the font name. + the encoding. + + + + if it is CJKFont. + + + + + + + + + + CMap name. + + + CMap name. + CMap to convert Unicode value to CID. + + + psoares + + + psoares + + + + + + + + + psoares + + + psoares + + + Commands have this type. + + + Holds value of property tokeniser. + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + + Parses a single command from the content. + + Parses a single command from the content. Each command is output as an array of arguments + having the command itself as the last element. The returned array will be empty if the + end of content was reached. + + + an + ArrayList + to use. It will be cleared before using. + + on error + + + Reads a dictionary. + + Reads a dictionary. The tokeniser must be positioned past the + "<<" + token. + + the dictionary + on error + + + Reads an array. + Reads an array. The tokeniser must be positioned past the "[" token. + an array + on error + + + Reads a pdf object. + the pdf object + on error + + + Reads the next token skipping over the comments. + + + + if a token was read, + + if the end of content was reached. + + on error. + + + Gets an hex string in the format "<HHHH>". + the number + the hex string + + + psoares + + + psoares + + + + + + + + + psoares + + + + + + + Return String representation of + value + field. + + + + + + + + + + This class represents a CMap file. + Ben Litchfield (ben@benlitchfield.com) + + + Creates a new instance of CMap. + + + This will tell if this cmap has any two byte mappings. + true If there are any two byte mappings, false otherwise. + + + This will perform a lookup into the map. + The code used to lookup. + The offset into the byte array. + The length of the data we are getting. + The string that matches the lookup. + + + + + + + + + + + + psoares + + + The path to the font resources. + + + + Checks if the font with the given name and encoding is one + of the predefined CID fonts. + + the font name. + + + + if it is CJKFont. + + + + + + + + + + + Font constants for + + and PdfFontFactory. + + + + The path to the font resources. + + + Undefined font style. + + + Normal font style. + + + Bold font style. + + + Italic font style. + + + Underline font style. + + + Strikethru font style. + + + Bold-Italic font style. + + + Type 1 PostScript font. + + + Compact Font Format PostScript font. + + + TrueType or OpenType with TrueType outlines font. + + + CIDFont Type0 (Type1 outlines). + + + CIDFont Type2 (TrueType outlines). + + + OpenType with Type1 outlines. + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + + The maximum height above the baseline reached by glyphs in this + font, excluding the height of glyphs for accented characters. + + + + + The y coordinate of the top of flat capital letters, measured from + the baseline. + + + + + The maximum depth below the baseline reached by glyphs in this + font. + + + The maximum depth below the baseline reached by glyphs in this + font. The value is a negative number. + + + + + The angle, expressed in degrees counterclockwise from the vertical, + of the dominant vertical strokes of the font. + + + The angle, expressed in degrees counterclockwise from the vertical, + of the dominant vertical strokes of the font. The value is + negative for fonts that slope to the right, as almost all italic fonts do. + + + + The lower left x glyph coordinate. + + + The lower left y glyph coordinate. + + + The upper right x glyph coordinate. + + + The upper right y glyph coordinate. + + + AWT Font property. + + + AWT Font property. + + + AWT Font property. + + + AWT Font property. + + + The underline position. + The underline position. Usually a negative value. + + + The underline thickness. + + + The strikethrough position. + + + The strikethrough thickness. + + + The recommended vertical size for subscripts for this font. + + + The recommended vertical offset from the baseline for subscripts for this font. + The recommended vertical offset from the baseline for subscripts for this font. Usually a negative value. + + + + The recommended vertical size for superscripts for this font. + + + The recommended vertical offset from the baseline for superscripts for this font. + + + The weight class of the font, as defined by the font author. + + + The width class of the font, as defined by the font author. + + + The entry of PDF FontDescriptor dictionary. + + The entry of PDF FontDescriptor dictionary. + (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) + The weight (thickness) component of the fully-qualified font name or font specifier. + A value larger than 500 indicates bold font-weight. + + + + A not defined character in a custom PDF encoding. + + + The code pages possible for a True Type font. + + + Base font encoding. + + + + + if the font must use its built in encoding. In that case + the + encoding + is only used to map a char to the position inside the font, not to the expected char name. + + + + Mapping map from unicode to simple code according to the encoding. + + + Encoding names. + + + Encodings unicode differences + + + This encoding will base on font encoding (FontSpecific encoding in Type 1 terminology) + + + Gets unicode value for corresponding font's char code. + font's char code + -1, if the char code unsupported or valid unicode. + + + + Converts a + String + to a + byte + array according to the encoding. + String could contain a unicode symbols or font specific codes. + + + the + String + to be converted. + + + an array of + byte + representing the conversion according to the encoding + + + + + Converts a unicode symbol or font specific code + to + byte + according to the encoding. + + a unicode symbol or FontSpecif code to be converted. + + a + byte + representing the conversion according to the encoding + + + + + Check whether a unicode symbol or font specific code can be converted + to + byte + according to the encoding. + + a unicode symbol or font specific code to be checked. + + + + if + ch + could be encoded. + + + + + Check whether a + byte + code can be converted + to unicode symbol according to the encoding. + + a byte code to be checked. + + + + if + + could be decoded. + + + + Normalize the encoding names. + + Normalize the encoding names. "winansi" is changed to "Cp1252" and + "macroman" is changed to "MacRoman". + + the encoding to be normalized + the normalized encoding + + + Extracts the names of the font in all the languages available. + the name id to retrieve in OpenType notation + + not empty + String[][] + if any names exists, otherwise + + . + + + + Provides methods for creating various types of fonts. + + + This is the default value of the cached variable. + + + Creates a new font. + + Creates a new font. This will always be the default Helvetica font (not embedded). + This method is introduced because Helvetica is used in many examples. + + a BaseFont object (Helvetica, Winansi, not embedded) + + + + Creates a new font. + + Creates a new font. This font can be one of the 14 built in types, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the + Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

+ The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+

+ This method calls:
+

+            createFont(name, null, true);
+            
+
+ the name of the font or its location on file + returns a new font. This font may come from the cache + +
+ + Creates a new font. + + Creates a new font. This font can be one of the 14 built in types, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the + Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

+ The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+

+ This method calls:
+

+            createFont(name, encoding, embedded, true, null, null);
+            
+
+ the name of the font or its location on file + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + returns a new font. This font may come from the cache + +
+ + Creates a new font. + + Creates a new font. This font can be one of the 14 built in types, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the + Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+
+ + the true type font or the afm in a byte array + an exception if the font is not recognized. Note that even if true an exception may be thrown in some circumstances. + This parameter is useful for FontProgramFactory that may have to check many invalid font names before finding the right one + + + returns a new font. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + +
+ + Creates a new font. + + Creates a new font. This font can be one of the 14 built in types, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the + Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

+ The fonts may or may not be cached depending on the flag cached. + If the byte arrays are present the font will be + read from them instead of the name. A name is still required to identify + the font type. +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+
+ the name of the font or its location on file + the true type font or the afm in a byte array + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + + returns a new font. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + +
+ + Creates a new font. + + Creates a new font. This font can be one of the 14 built in types, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the + Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

+ The fonts may or may not be cached depending on the flag cached. + If the byte arrays are present the font will be + read from them instead of the name. A name is still required to identify + the font type. +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+
+ the name of the font or its location on file + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + the afm or pfm metrics file in a byte array + the pfb in a byte array + + returns a new font. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + +
+ + + + + + + + + + + + Creates a new True Type font from ttc file, +

+ The fonts may or may not be cached depending on the flag cached. +

+ + Creates a new True Type font from ttc file, +

+ The fonts may or may not be cached depending on the flag cached. + If the byte arrays are present the font will be + read from them instead of the name. A name is still required to identify + the font type. +

+ Besides the common encodings described by name, custom encodings + can also be made. These encodings will only work for the single byte fonts + Type1 and TrueType. The encoding string starts with a '#' + followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list + of hex values representing the Unicode codes that compose that encoding.
+ The "simple" encoding is recommended for TrueType fonts + as the "full" encoding risks not matching the character with the right glyph + if not done with care.
+ The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be + described by non standard names like the Tex math fonts. Each group of three elements + compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character + used to access the glyph. The space must be assigned to character position 32 otherwise + text justification will not work. +

+ Example for a "simple" encoding that includes the Unicode + character space, A, B and ecyrillic: +

+            "# simple 32 0020 0041 0042 0454"
+            
+

+ Example for a "full" encoding for a Type1 Tex font: +

+            "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
+            
+
+ location of true type collection file (*.ttc) + the encoding to be applied to this font + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + + returns a new font. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + +
+ + + + + + + + + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Register a ttf- or a ttc-file. + the path to a ttf- or ttc-file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Register all the fonts in a directory. + the directory + the number of fonts registered + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font names. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found + + + + If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files + to this class first and then create fonts in your code using one of the getFont method + without having to enter a path as parameter. + + + + This is a map of postscriptfontnames of fonts and the path of their font file. + + + This is a map of fontfamilies. + + + Creates new FontRegisterProvider + + + Constructs a Font-object. + the name of the font + the style of this font + the Font constructed based on the parameters + + + + Constructs a Font-object. + the name of the font + the style of this font + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + the Font constructed based on the parameters + + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Register a ttf- or a ttc-file. + the path to a ttf- or ttc-file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Register all the fonts in a directory. + the directory + the number of fonts registered + + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font names. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found + + + + Classes implementing this interface can create custom encodings or + replace existing ones. + + + Classes implementing this interface can create custom encodings or + replace existing ones. It is used in the context of PdfEncoding. + + Paulo Soares + + + Converts an Unicode string to a byte array according to some encoding. + the Unicode string + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + Converts an Unicode char to a byte array according to some encoding. + the Unicode char + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + Converts a byte array to an Unicode string according to some encoding. + the input byte array + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + The file name. + + + The file in use. + + + The index for the TTC font. + + The index for the TTC font. It is -1 + int + for a TTF file. + + + + The offset from the start of the file to the table directory. + + The offset from the start of the file to the table directory. + It is 0 for TTF and may vary for TTC depending on the chosen font. + + + + The font name. + The font name. This name is usually extracted from the table 'name' with the 'Name ID' 6. + + + All the names of the Names-Table. + + + Indicate, that the font contains 'CFF ' table. + + + Offset to 'CFF ' table. + + + Length of 'CFF ' table. + + + Contains the location of the several tables. + + Contains the location of the several tables. The key is the name of + the table and the value is an int[2] where position 0 + is the offset from the start of the file and position 1 is the length + of the table. + + + + + + + + + + + + + + + + Gets the Postscript font name. + + + + + + + If this font file is using the Compact Font File Format, then this method + will return the raw bytes needed for the font stream. + + + If this font file is using the Compact Font File Format, then this method + will return the raw bytes needed for the font stream. If this method is + ever made public: make sure to add a test if (cff == true). + + a byte array + + + + + + + Reads the font data. + + + + Gets the name from a composed TTC file name. + + Gets the name from a composed TTC file name. + If I have for input "myfont.ttc,2" the return will + be "myfont.ttc". + + the full name + the simple file name + + + Reads the glyphs widths. + + Reads the glyphs widths. The widths are extracted from the table 'hmtx'. + The glyphs are normalized to 1000 units (TrueTypeFont.UNITS_NORMALIZATION). + Depends from + hhea.numberOfHMetrics + property, + HorizontalHeader + and + head.unitsPerEm + property, + HeaderTable + . + + the font file could not be read. + + + Reads the kerning information from the 'kern' table. + + + head.unitsPerEm + property, + HeaderTable + . + + the font file could not be read + + + Read the glyf bboxes from 'glyf' table. + + + head.unitsPerEm + property, + HeaderTable + . + + the font is invalid. + the font file could not be read. + + + + + + Extracts the names of the font in all the languages available. + on error + on error + + + Read horizontal header, table 'hhea'. + the font is invalid. + the font file could not be read. + + + Read font header, table 'head'. + the font is invalid. + the font file could not be read. + + + Reads the windows metrics table. + + Reads the windows metrics table. The metrics are extracted from the table 'OS/2'. + Depends from + head.unitsPerEm + property, + HeaderTable + . + + the font is invalid. + the font file could not be read. + + + + + + Reads the several maps from the table 'cmap'. + + Reads the several maps from the table 'cmap'. The maps of interest are 1.0 for symbolic + fonts and 3.1 for all others. A symbolic font is defined as having the map 3.0. + Depends from + readGlyphWidths() + . + + the font file could not be read + + + + Reads a String from the font file as bytes using the Cp1252 + encoding. + + the length of bytes to read + the String read + the font file could not be read + + + Reads a Unicode String from the font file. + Reads a Unicode String from the font file. Each character is represented by two bytes. + + the length of bytes to read. The String will have length/2 characters. + + the String read. + the font file could not be read. + + + Gets a glyph width. + the glyph to get the width of + the width of the glyph in normalized 1000 units (TrueTypeFont.UNITS_NORMALIZATION) + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 0 is the Apple standard character to glyph index mapping table. + + a HashMap representing this map + the font file could not be read + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 4 is the Microsoft standard character to glyph index mapping table. + + a HashMap representing this map + the font file could not be read + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 6 is a trimmed table mapping. It is similar to format 0 but can have + less than 256 entries. + + a HashMap representing this map + the font file could not be read + + + + + + The components of table 'head'. + + + The components of table 'hhea'. + + + The components of table 'OS/2'. + + + The italic angle. + + The italic angle. It is usually extracted from the 'post' table or in it's + absence with the code: +
+            -Math.atan2(hhea.caretSlopeRun, hhea.caretSlopeRise) * 180 / Math.PI
+            
+
+
+ + true if all the glyphs have the same width. + + + The map containing the code information for the table 'cmap', encoding 1.0. + + The map containing the code information for the table 'cmap', encoding 1.0. + The key is the code and the value is an + int[2] + where position 0 + is the glyph number and position 1 is the glyph width normalized to 1000 units. + TrueTypeFont.UNITS_NORMALIZATION + . + + + + The map containing the code information for the table 'cmap', encoding 3.1 in Unicode. + + The map containing the code information for the table 'cmap', encoding 3.1 in Unicode. + The key is the code and the value is an + int[2] + where position 0 + is the glyph number and position 1 is the glyph width normalized to 1000 units. + TrueTypeFont.UNITS_NORMALIZATION + . + + + + length of the context glyph sequence defined by this rule. + + + + an array of SubstLookupRecord. Each record specifies a position in the context glyph + sequence and a LookupListIndex to the substitution lookup that is applied at that position. + + + + Checks if glyph line element matches element from input sequence of the rule. + + Checks if glyph line element matches element from input sequence of the rule. +

+ NOTE: rules do not contain the first element of the input sequence, the first element is defined by rule + position in substitution table. Therefore atIdx shall not be 0. +
+ index in the rule sequence. Shall be: 0 < atIdx < ContextualSubstRule.getContextLength(). + +
+ + length of the lookahead context glyph sequence defined by this rule. + + + length of the backtrack context glyph sequence defined by this rule. + + + Checks if glyph line element matches element from lookahead sequence of the rule. + index in rule sequence. Shall be: 0 <= atIdx < ContextualSubstRule.getLookaheadContextLength(). + + + + Checks if glyph line element matches element from backtrack sequence of the rule. + index in rule sequence. Shall be: 0 <= atIdx < ContextualSubstRule.getBacktrackContextLength(). + + + + Gets a most preferable context rule that matches the line at current position. + + Gets a most preferable context rule that matches the line at current position. If no matching context rule is found, + it returns null. +

+ NOTE: if matching context rule is found, the GlyphLine.start and GlyphLine.end will be + changed in such way, that they will point at start and end of the matching context glyph sequence inside the glyph line. +
+ a line, which is to be checked if it matches some context. + matching context rule or null, if none was found. +
+ + Gets a set of rules, which start with given glyph id. + id of the first glyph in the sequence. + + + Checks if given glyph line at the given position matches given rule. + + either index which corresponds to the last glyph of the matching context inside the glyph line if context matches, + or -1 if context doesn't match. + + + + psoares + + + Palash Ray + + + + Palash Ray + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the starting point of the class. + + This is the starting point of the class. A sub-class must call this + method to start getting call backs to the + + method. + + + + + + + + + + + + + + + + + + + + + + + + + + Lookup Type 2: + Pair Adjustment Positioning Subtable + + + + psoares + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lookup Type 4: + MarkToBase Attachment Positioning Subtable + + + + + + + + + + + Lookup Type 5: + MarkToLigature Attachment Positioning Subtable + + + + + + + + + + + Lookup Type 6: + MarkToMark Attachment Positioning Subtable + + + + + + + + + + LookupType 1: Single Substitution Subtable + psoares + + + + + + + + + LookupType 2: Multiple Substitution Subtable + + + + + + + + + LookupType 3: Alternate Substitution Subtable + psoares + + + + + + + + + LookupType 4: Ligature Substitution Subtable + psoares + + + The key is the first character. + + The key is the first character. The first element in the int array is the + output ligature + + + + + + + + + + LookupType 5: Contextual Substitution Subtable + + + + + + + + + + + + + + + + + + LookupType 6: Chaining Contextual Substitution Subtable + + + + + + + + + + + + + + + Contextual Substitution Subtable: Simple context glyph substitution + + + Contextual Substitution Subtable: Class-based context glyph substitution + + + Contextual Substitution Subtable: Coverage-based context glyph substitution + + + Checks if given glyph line at the given position matches given rule. + + + Checks if given glyph line at the given position matches given rule. + + + Chaining Contextual Substitution Subtable: Simple Chaining Context Glyph Substitution + + + Chaining Contextual Substitution Subtable: Class-based Chaining Context Glyph Substitution + + + Chaining Contextual Substitution Subtable: Coverage-based Chaining Context Glyph Substitution + + + psoares + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Unicode encoding with horizontal writing. + + + The Unicode encoding with vertical writing. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + This is the encoding to be used to output text in Unicode. + + + This is the encoding to be used to output text for Identity-H/V CMaps. + + + + This is the default encoding to be used for converting Strings into + bytes and vice versa. + + + This is the default encoding to be used for converting Strings into + bytes and vice versa. The default encoding is PDF_DOC_ENCODING. + + + + + Converts a + String + to a + byte + array according + to the font's encoding. + + the encoding + + the + String + to be converted + + + an array of + byte + representing the conversion according to the font's encoding + + + + + Converts a + String + to a + byte + array according + to the font's encoding. + + the encoding + + the + char + to be converted + + + an array of + byte + representing the conversion according to the font's encoding + + + + + Converts a + byte + array to a + String + according + to the some encoding. + + the bytes to convert + the encoding + + the converted + String + + + + + Checks is + + only has PDF_DOC_ENCODING characters. + + + the + String + to test + + + + + if only PDF_DOC_ENCODING characters are present + + + + Adds an extra encoding. + the name of the encoding. The encoding recognition is case insensitive + the conversion class + + + Converts a PFM file into an AFM file. + + + Creates a new instance of Pfm2afm + + + + Converts a PFM file into an AFM file. + the PFM file + the AFM file + on error + + + + + + + + + + + + + + + + + + + + + Translate table from 1004 to psstd. + + Translate table from 1004 to psstd. 1004 is an extension of the + Windows translate table used in PM. + + + + Windows character names. + + Windows character names. Give a name to the used locations + for when the all flag is specified. + + + + Use this class for working with true type collection font (*.ttc) + + + + + + + Creates a new + + instance by its bytes. + + the byte contents of the collection + in case the input in mal-formatted + + + + + + + Creates a new + + instance by its file path. + + the path of the collection + in case the input in mal-formatted + + + method return TrueTypeFont by ttc index + the index for the TTC font + TrueTypeFont + + + + returns the number of fonts in True Type Collection (file or bytes array) + returns the number of fonts + + + + Indicates if fonts created by the call to + + will be cached or not. + + true if the created fonts will be cached, false otherwise + + + + Sets if fonts created by the call to + + will be cached or not. + + true if the created fonts will be cached, false otherwise + + + + + + The map containing the kerning information. + + The map containing the kerning information. It represents the content of + table 'kern'. The key is an Integer where the top 16 bits + are the glyph number for the first character and the lower 16 bits are the + glyph number for the second character. The value is the amount of kerning in + normalized 1000 units as an Integer. This value is usually negative. + + + + + + + + + + + + + + + + Gets the kerning between two glyphs. + the first glyph + the second glyph + the kerning to be applied + + + The offset from the start of the file to the table directory. + + The offset from the start of the file to the table directory. + It is 0 for TTF and may vary for TTC depending on the chosen font. + + + + + + + + + + + + + + + + Gets the code pages supported by the font. + the code pages supported by the font + + + Subsets a True Type font by removing the unneeded glyphs from the font. + Paulo Soares + + + Contains the location of the several tables. + + Contains the location of the several tables. The key is the name of + the table and the value is an + int[3] + where position 0 + is the checksum, position 1 is the offset from the start of the file + and position 2 is the length of the table. + + + + The file in use. + + + The file name. + + + Creates a new TrueTypeFontSubSet + The offset from the start of the file to the table directory + the file name of the font + the glyphs used + + + + if the table cmap is to be included in the generated font + + + + Does the actual work of subsetting the font. + on error + error + the subset font + + + + + + + + + + + + + + + + + + + + + + Reads a + String + from the font file as bytes using the Cp1252 encoding. + + the length of bytes to read + + the + String + read + + the font file could not be read + + + Represents the section KernPairs in the AFM file. + + Represents the section KernPairs in the AFM file. + Key is uni1<<32 + uni2. Value is kerning value. + + + + Types of records in a PFB file. + Types of records in a PFB file. ASCII is 1 and BINARY is 2. They have to appear in the PFB file in this sequence. + + + + + + + + + + Checks if the font has any kerning pairs. + + + + if the font has any kerning pairs. + + + + Sets the kerning between two Unicode chars. + the first unicode char. + the second unicode char. + the kerning to apply in normalized 1000 units. + + + + if the kerning was applied, + + otherwise. + + + + Find glyph by glyph name. + Glyph name + Glyph instance if found, otherwise null. + + + + + + Creates a new Type1 font file. + the AFM file if the input is made with a byte array + the PFB file if the input is made with a byte array + the name of one of the 14 built-in fonts or the location of an AFM file. The file must end in '.afm' + + AFM file is invalid + the AFM file could not be read + + + + + + + + + + + + Checks if image can be inline + if the image can be inline + + + Load data from URL. + + Load data from URL. url must be not null. + Note, this method doesn't check if data or url is null. + + + + + a static that is used for attributing a unique id to each image. + + + Creates a new serial id. + the new serialId + + + Pure two-dimensional encoding (Group 4) + + + Pure one-dimensional encoding (Group 3, 1-D) + + + Mixed one- and two-dimensional encoding (Group 3, 2-D) + + + + A flag indicating whether 1-bits are to be interpreted as black pixels + and 0-bits as white pixels, + + + + + A flag indicating whether the filter expects extra 0-bits before each + encoded line so that the line begins on a byte boundary. + + + + + A flag indicating whether end-of-line bit patterns are required to be + present in the encoding. + + + + + A flag indicating whether the filter expects the encoded data to be + terminated by an end-of-block pattern, overriding the Rows parameter. + + + A flag indicating whether the filter expects the encoded data to be + terminated by an end-of-block pattern, overriding the Rows parameter. The + use of this flag will set the key /EndOfBlock to false. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets an instance of an Image from a java.awt.Image + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + RawImage + + + + + Gets an instance of an Image from a System.Drwaing.Image. + + the System.Drawing.Image to convert + + if different from null the transparency + pixels are replaced by this color + + if true the image is treated as black and white + an object of type ImgRaw + + + + Converts a .NET image to a Native(PNG, JPG, GIF, WMF) image + + + + + + + Load data by URL. + + Load data by URL. url must be not null. + Note, this method doesn't check if data or url is null. + + + + + Reads image source and fills GifImage object with parameters (frames, width, height) + GifImage + + + Reads image source and fills GifImage object with parameters (frames, width, height) + GifImage + the last frame of the gif image should be read + + + + + + Reads GIF file header information. + + + + Reads Logical Screen Descriptor + + + + Reads next 16-bit value, LSB first + + + + Reads next variable length block from input. + number of bytes stored in "buffer" + + + + + + + + + + Reads next frame image + + + + + + + Reads Graphics Control Extension values + + + + + Skips variable length blocks up to and including + next zero length block. + + + + + + + + + + + Gets an instance of an Image from a java.awt.Image + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + RawImage + + + + Gets an instance of an Image from a java.awt.Image. + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + if true the image is treated as black and white + RawImage + + + + Return a GifImage object. + Return a GifImage object. This object cannot be added to a document + + + + + Returns a specified frame of the gif image + url of gif image + number of frame to be returned + + + + Returns a specified frame of the gif image + byte array of gif image + number of frame to be returned + + + + Returns List of gif image frames + byte array of gif image + array of frame numbers of gif image + + + + Returns List of gif image frames + url of gif image + array of frame numbers of gif image + + + + Returns List of gif image frames + byte array of gif image + all frames of gif image + + + Returns List of gif image frames + url of gif image + all frames of gif image + + + Gets the number of pages in a JBIG2 image. + a byte array containing a JBIG2 image + the number of pages + + + Gets the number of pages in a JBIG2 image. + + a + RandomAccessFileOrArray + containing a JBIG2 image + + the number of pages + + + + Gets a byte array that can be used as a /JBIG2Globals, + or null if not applicable to the given jbig2. + + an random access file or array + a byte array + + + This method checks if the image is a valid JPEG and processes some parameters. + + + + + + + + + + + + This is a type of marker. + + + This is a type of marker. + + + This is a type of marker. + + + This is a type of marker. + + + Marker value + + + Marker value + + + Marker value + + + Marker value for Photoshop IRB + + + Acceptable Jpeg markers. + + + Unsupported Jpeg markers. + + + Jpeg markers without additional parameters. + + + sequence that is used in all Jpeg files + + + sequence preceding Photoshop resolution data + + + This method checks if the image is a valid JPEG and processes some parameters. + + + + + Reads a short from the InputStream. + the InputStream + an int + + + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + Some PNG specific values. + + + + + + + + + Gets an int from an InputStream. + an InputStream + the value of an int + + + + Gets a word from an InputStream. + an InputStream + the value of an int + + + + Gets a String from an InputStream. + an InputStream + the value of an int + + + + Update original image with Raw Image parameters. + the exact width of the image + the exact height of the image + 1,3 or 4 for GrayScale, RGB and CMYK + bits per component. Must be 1,2,4 or 8 + the image data + on error + + + Gets the number of pages the TIFF document has. + + a + RandomAccessFileOrArray + containing a TIFF image. + + the number of pages. + + + Gets the number of pages the TIFF document has. + a byte array containing a TIFF image. + the number of pages. + + + + + + Exception class for exceptions in io module. + + + Object for more details + + + Creates a new IOException. + the detail message. + + + Creates a new IOException. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new IOException. + the detail message. + an object for more details. + + + Creates a new IOException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of IOException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + an object for more details. + + + Sets additional params for Exception message. + additional params. + object itself. + + + Gets additional params for Exception message. + + + + + + Class containing constants to be used in logging. + + + + LoggerFactory can be used to set a logger. The logger should be created by + implementing . In the implementation users can choose how they + log received messages. Added for developers. For some cases it can be handy + to receive logging statements while developing applications with iText + + redlab_b + + + + The no-operation logger, it does nothing with the received logging + statements. And returns false by default for , + , , and + . + + redlab_b + + + A RandomAccessSource that is based on an underlying byte array + + + Represents an abstract source that bytes can be read from. + + Represents an abstract source that bytes can be read from. This class forms the foundation for all byte input in iText. + Implementations do not keep track of a current 'position', but rather provide absolute get methods. Tracking position + should be handled in classes that use RandomAccessSource internally (via composition). + + + + Gets a byte at the specified position + byte position + the byte, or -1 if EOF is reached + + + + Gets an array at the specified position. + + Gets an array at the specified position. If the number of bytes requested cannot be read, the bytes that can be + read will be placed in bytes and the number actually read will be returned. + + the position in the RandomAccessSource to read from + output buffer + offset into the output buffer where results will be placed + the number of bytes to read + the number of bytes actually read, or -1 if the file is at EOF + + + + the length of this source + + + Closes this source. + Closes this source. The underlying data structure or source (if any) will also be closed + + + + + + + + Fill + ByteBuffer + from the end. + Set byte at + capacity() - size() - 1 + position. + + + + byte + . + + + + ByteBuffer + . + + + + + Fill + ByteBuffer + from the end. + Set bytes from + capacity() - size() - b.length + position. + + + + byte + . + + + + ByteBuffer + . + + + + + Summary description for DeflaterOutputStream. + + + + + + + Constructs a new OffsetRandomAccessSource + the source + + + + + + + + + + + + + + Does nothing - the underlying source is not closed + + + + + A RandomAccessSource that is based on a set of underlying sources, + treating the sources as if they were a contiguous block of data. + + + + The underlying sources (along with some meta data to quickly determine where each source begins and ends) + + + + Cached value to make multiple reads from the same underlying source more efficient + + + Cached size of the underlying channel + + + + Constructs a new + + based on the specified set of sources + + the sources used to build this group + + + + For a given offset, return the index of the source that contains the specified offset. + + For a given offset, return the index of the source that contains the specified offset. + This is an optimization feature to help optimize the access of the correct source without having to iterate + through every single source each time. It is safe to always return 0, in which case the full set of sources + will be searched. + Subclasses should override this method if they are able to compute the source index more efficiently + (for example + + takes advantage of fixed size page buffers to compute the index) + + the offset + the index of the input source that contains the specified offset, or 0 if unknown + + + + Returns the SourceEntry that contains the byte at the specified offset + sourceReleased is called as a notification callback so subclasses can take care of cleanup + when the source is no longer the active source + + the offset of the byte to look for + the SourceEntry that contains the byte at the specified offset + if there is a problem with IO (usually the result of the sourceReleased() call) + + + + Called when a given source is no longer the active source. + Called when a given source is no longer the active source. This gives subclasses the abilty to release resources, if appropriate. + + the source that is no longer the active source + if there are any problems + + + Called when a given source is about to become the active source. + Called when a given source is about to become the active source. This gives subclasses the abilty to retrieve resources, if appropriate. + + the source that is about to become the active source + if there are any problems + + + + + The source that contains the byte at position is retrieved, the correct offset into that source computed, then the value + from that offset in the underlying source is returned. + + + + + + + + + + + + + +
+ Closes all of the underlying sources. +
+ +
+ + Used to track each source, along with useful meta data + + + The underlying source + + + The first byte (in the coordinates of the GroupedRandomAccessSource) that this source contains + + + The last byte (in the coordinates of the GroupedRandomAccessSource) that this source contains + + + The index of this source in the GroupedRandomAccessSource + + + Standard constructor + the index + the source + the offset of the source in the GroupedRandomAccessSource + + + Given an absolute offset (in the GroupedRandomAccessSource coordinates), calculate the effective offset in the underlying source + + the offset in the parent GroupedRandomAccessSource + the effective offset in the underlying source + + + A RandomAccessSource that is wraps another RandomAccessSource but does not propagate close(). + + A RandomAccessSource that is wraps another RandomAccessSource but does not propagate close(). This is useful when + passing a RandomAccessSource to a method that would normally close the source. + + + + The source + + + Constructs a new OffsetRandomAccessSource + the source + + + + + + + + + + + + + + Does nothing - the underlying source is not closed + + + + + + + + + + + + + + + + + + + Streams are closed automatically. + + + + Creates a PdfTokenizer for the specified + + . + The beginning of the file is read to determine the location of the header, and the data source is adjusted + as necessary to account for any junk that occurs in the byte source before the header + + the source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resolve escape symbols or hexadecimal symbols. + + Resolve escape symbols or hexadecimal symbols. +

+ NOTE Due to PdfReference 1.7 part 3.2.3 String value contain ASCII characters, + so we can convert it directly to byte array. + + + byte[] for decrypting or for creating + + . + + + +

Resolve escape symbols or hexadecimal symbols. + + Resolve escape symbols or hexadecimal symbols. +

+ NOTE Due to PdfReference 1.7 part 3.2.3 String value contain ASCII characters, + so we can convert it directly to byte array. + + + byte[] for decrypting or for creating + + . + + + +

Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'. + + + Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'. +
The same as calling + isWhiteSpace(ch, true) + . +
+ int + boolean +
+ + Checks whether a character is a whitespace. + Checks whether a character is a whitespace. Currently checks on the following: '0', '9', '10', '12', '13', '32'. + + int + boolean + boolean + + + Helper method to handle content errors. + + Helper method to handle content errors. Add file position to + PdfRuntimeException + . + + message. + error params. + + error message into + PdfRuntimeException + and add position in file. + + + + + Checks whether + + equals to 'trailer'. + + for check. + true, if line is equals tio 'trailer', otherwise false. + + + Reads data into the provided byte[]. + + Reads data into the provided byte[]. Checks on leading whitespace. + See + isWhiteSpace(int) + or + isWhiteSpace(int, boolean) + for a list of whitespace characters. +
The same as calling + readLineSegment(input, true) + . +
+ @see ByteBuffer + boolean + +
+ + Reads data into the provided byte[]. + + Reads data into the provided byte[]. Checks on leading whitespace. + See + isWhiteSpace(int) + or + isWhiteSpace(int, boolean) + for a list of whitespace characters. + + @see ByteBuffer + + boolean to indicate whether '0' is whitespace or not. + If in doubt, use true or overloaded method + readLineSegment(input) + + boolean + + + + Check whether line starts with object declaration. + tokenizer, built by single line. + object number and generation if check is successful, otherwise - null. + + + + + + + A RandomAccessSource that uses a + + as it's source + Note: Unlike most of the RandomAccessSource implementations, this class is not thread safe + + + + The source + + + The length of the underling RAF. + + The length of the underling RAF. Note that the length is cached at construction time to avoid the possibility + of java.io.IOExceptions when reading the length. + + + + Creates this object + the source for this RandomAccessSource + if the RAF can't be read + + + + + + + + + + + + + Note: the length is determined when the + + is constructed. If the file length changes + after construction, that change will not be reflected in this call. + + + + Closes the underlying RandomAccessFile + + + + When true the file access is not done through a memory mapped file. + + When true the file access is not done through a memory mapped file. Use it if the file + is too big to be mapped in your address space. + + + + The source that backs this object + + + The physical location in the underlying byte source. + + + the pushed back byte, if any + + + Whether there is a pushed back byte + + + Creates an independent view of this object (with it's own file pointer and push back queue). + + Creates an independent view of this object (with it's own file pointer and push back queue). Closing the new object will not close this object. + Closing this object will have adverse effect on the view. + + the new view + + + Creates a RandomAccessFileOrArray that wraps the specified byte source. + + Creates a RandomAccessFileOrArray that wraps the specified byte source. The byte source will be closed when + this RandomAccessFileOrArray is closed. + + the byte source to wrap + + + Pushes a byte back. + Pushes a byte back. The next get() will return this byte instead of the value from the underlying data source + + the byte to push + + + Reads a single byte + the byte, or -1 if EOF is reached + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a + String + from the font file as bytes using the given + encoding. + + the length of bytes to read + the given encoding + + the + String + read + + the font file could not be read + + + + Factory to create + + objects based on various types of sources + + + + Whether the full content of the source should be read into memory at construction + + + + + Whether + + should be used instead of a + + , where applicable + + + + Whether the underlying file should have a RW lock on it or just an R lock + + + + Creates a factory that will give preference to accessing the underling data source using memory mapped files + + + + Determines whether the full content of the source will be read into memory + + true if the full content will be read, false otherwise + this object (this allows chaining of method calls) + + + + Determines whether + + should be used as the primary data access mechanism + + + whether + + should be used as the primary data access mechanism + + this object (this allows chaining of method calls) + + + + Creates a + + based on a byte array + + the byte array + + the newly created + + + + + + + + + Creates a + + based on a URL. The data available at the URL is read into memory and used + as the source for the + + + the url to read from + + the newly created + + + + + + + Creates a + + based on an + + . The full content of the InputStream is read into memory and used + as the source for the + + + the stream to read from + + the newly created + + + + + + + Creates a + + based on a filename string. + If the filename describes a URL, a URL based source is created + If the filename describes a file on disk, the contents may be read into memory (if + forceRead + is true), + opened using memory mapped file channel (if usePlainRandomAccess is false), or + opened using + + access (if usePlainRandomAccess is true) + This call will automatically fail over to using + + if the memory map operation fails + + + the name of the file or resource to create the + + for + + + the newly created + + + + + + + + + + Creates a new + + by reading the specified file/resource into memory + + the name of the resource to read + + the newly created + + + if reading the underling file or stream fails + + + + + Creates a new + + by reading the specified file/resource into memory + + the name of the resource to read + + the newly created + + + if reading the underling file or stream fails + + + + + An input stream that uses a + + as + its underlying source. + + + + The source. + + + The current position in the source. + + + Creates an input stream based on the source. + The source. + + + + + + + + + + + + A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over + a specific length. + + + A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over + a specific length. Position 0 becomes the offset position in the underlying source. + + + + The source + + + The amount to offset the source by + + + The length + + + Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source + the source + the amount of the offset to use + + + Constructs a new OffsetRandomAccessSource with an explicit length + the source + the amount of the offset to use + the number of bytes to be included in this RAS + + + + + Note that the position will be adjusted to read from the corrected location in the underlying source + + + + + + + Note that the position will be adjusted to read from the corrected location in the underlying source + + + + + + + Note that the length will be adjusted to read from the corrected location in the underlying source + + + + + + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + Abstract class for reading filtered character streams. + The abstract class FilterReader itself + provides default methods that pass all requests to + the contained stream. Subclasses of FilterReader + should override some of these methods and may also provide + additional methods and fields. + + @author Mark Reinhold + @since JDK1.1 + + + + + Reads a single character. + + + + + Reads characters into a portion of an array. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + A helper to FlateDecode. + the input data + + true to read a correct stream. false + to try to read a corrupted stream + + the decoded data + + + Decodes a stream that has the FlateDecode filter. + the input data + the decoded data + + + + This method provides support for general purpose decompression using the + popular ZLIB compression library. + + the input data bytes + the buffer for the uncompressed data + + + + The hashCode value before any data is appended, equals to 1. + + + + Returns accumulated hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Translates a IANA encoding name to a Java encoding. + + + The object that maps IANA to Java encodings. + + + + The hash table data. + + + The total number of entries in the hash table. + + + The table is rehashed when its size exceeds this threshold. + + The table is rehashed when its size exceeds this threshold. (The + value of this field is (int)(capacity * loadFactor).) + + + + + The load factor for the hashtable. + + + + +

Constructs a new, empty hashtable with a default capacity and load + factor, which is 20 and 0.75 respectively.

+
+
+ + +

Constructs a new, empty hashtable with the specified initial capacity + and default load factor, which is 0.75.

+
+ the initial capacity of the hashtable. + + if the initial capacity is less + than zero. + +
+ + +

Constructs a new, empty hashtable with the specified initial + capacity and the specified load factor.

+
+ the initial capacity of the hashtable. + the load factor of the hashtable. + + if the initial capacity is less + than zero, or if the load factor is nonpositive. + +
+ +

Returns the number of keys in this hashtable.

+ the number of keys in this hashtable. +
+ +

Tests if this hashtable maps no keys to values.

+ + true if this hashtable maps no keys to values; + false otherwise. + +
+ + + +

Returns true if this HashMap maps one or more keys + to this value.

+

Note that this method is identical in functionality to contains + (which predates the Map interface).

+
+ value whose presence in this HashMap is to be tested. + boolean true if the value is contained + +
+ +

Tests if the specified int is a key in this hashtable.

+ possible key. + + true if and only if the specified int is a + key in this hashtable, as determined by the equals + method; false otherwise. + + +
+ +

Returns the value to which the specified key is mapped in this map.

+ a key in the hashtable. + + the value to which the key is mapped in this hashtable; + 0 if the key is not mapped to any value in + this hashtable. + + +
+ + +

Increases the capacity of and internally reorganizes this + hashtable, in order to accommodate and access its entries more + efficiently.

+

This method is called automatically when the number of keys + in the hashtable exceeds this hashtable's capacity and load + factor.

+
+
+ + + +

Removes the key (and its corresponding value) from this + hashtable.

+

This method does nothing if the key is not present in the + hashtable.

+
+ the key that needs to be removed. + + the value to which the key had been mapped in this hashtable, + or null if the key did not have a mapping. + +
+ +

Clears this hashtable so that it contains no keys.

+
+ + + + + +

Innerclass that acts as a datastructure to create a new entry in the + table.

+
+
+ +

Create a new entry with the given values.

+ The key used to enter this in the table + The value for this key + A reference to the next entry in the table +
+ + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Summary description for Properties. + + + + + A character-stream reader that allows characters to be pushed back into the + stream. + + @author Mark Reinhold + @since JDK1.1 + + + + + Pushback buffer + + + + Current position in buffer + + + + + Creates a new pushback reader with a one-character pushback buffer. + + The reader from which characters will be read + + + + Checks to make sure that the stream has not been closed. + + + + Reads a single character. + + The character read, or -1 if the end of the stream has been + reached + + If an I/O error occurs + + + + Reads characters into a portion of an array. + + Destination buffer + Offset at which to start writing characters + Maximum number of characters to read + + The number of characters read, or -1 if the end of the + stream has been reached + + If an I/O error occurs + + + + Pushes back a single character by copying it to the front of the + pushback buffer. After this method returns, the next character to be read + will have the value (char)c. + + The int value representing a character to be pushed back + + If the pushback buffer is full, + or if some other I/O error occurs + + + + Pushes back a portion of an array of characters by copying it to the + front of the pushback buffer. After this method returns, the next + character to be read will have the value cbuf[off], the + character after that will have the value cbuf[off+1], and + so forth. + + Character array + Offset of first character to push back + Number of characters to push back + + If there is insufficient room in the pushback + buffer, or if some other I/O error occurs + + + + Pushes back an array of characters by copying it to the front of the + pushback buffer. After this method returns, the next character to be + read will have the value cbuf[0], the character after that + will have the value cbuf[1], and so forth. + + Character array to push back + + If there is insufficient room in the pushback + buffer, or if some other I/O error occurs + + + + Closes the stream and releases any system resources associated with + it. Once the stream has been closed, further read(), + unread(), ready(), or skip() invocations will throw an IOException. + Closing a previously closed stream has no effect. + + If an I/O error occurs + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + Gets the resource's inputstream. + the full name of the resource. + + the + InputStream + to get the resource or + + if not found. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + the index of the first element, inclusive, to be sorted + the index of the last element, exclusive, to be sorted + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This method is an alternative for the + InputStream.skip() + -method that doesn't seem to work properly for big values of + + . + + + the + InputStream + + the number of bytes to skip + + + + + Escapes a + byte + array according to the PDF conventions. + + + the + byte + array to escape + + + an escaped + byte + array + + + + + Escapes a + byte + array according to the PDF conventions. + + + the + OutputStream + an escaped + byte + array write to. + + + the + byte + > array to escape. + + + + + + + + + + Reads the full content of a stream and returns them in a byte array + the stream to read + a byte array containing all of the bytes from the stream + if there is a problem reading from the input stream + + + + Copy bytes from the + RandomAccessSource + to + OutputStream + . + + + the + RandomAccessSource + copy from. + + start position of source copy from. + length copy to. + + the + OutputStream + copy to. + + on error. + + + + Reads + + bytes from an input stream. + + the buffer into which the data is read. + an int specifying the offset into the data. + an int specifying the number of bytes to read. + + EOFException + if this stream reaches the end before reading all the bytes. + + + IOException + if an I/O error occurs. + + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Gets environment variable with given name. + + the name of environment variable. + variable value or null if there is no such. + + + + + + + + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Check if the value of a character belongs to a certain interval + that indicates it's the higher part of a surrogate pair. + + the character + true if the character belongs to the interval + + + + Check if the value of a character belongs to a certain interval + that indicates it's the lower part of a surrogate pair. + + the character + true if the character belongs to the interval + + + + Checks if two subsequent characters in a String are + are the higher and the lower character in a surrogate + pair (and therefore eligible for conversion to a UTF 32 character). + + the String with the high and low surrogate characters + the index of the 'high' character in the pair + true if the characters are surrogate pairs + + + + Checks if two subsequent characters in a character array are + are the higher and the lower character in a surrogate + pair (and therefore eligible for conversion to a UTF 32 character). + + the character array with the high and low surrogate characters + the index of the 'high' character in the pair + true if the characters are surrogate pairs + + + + Returns the code point of a UTF32 character corresponding with + a high and a low surrogate value. + + the high surrogate value + the low surrogate value + a code point value + + + Converts a unicode character in a character array to a UTF 32 code point value. + a character array that has the unicode character(s) + the index of the 'high' character + the code point value + + + Converts a unicode character in a String to a UTF32 code point value + a String that has the unicode character(s) + the index of the 'high' character + the codepoint value + + + Converts a UTF32 code point value to a String with the corresponding character(s). + a Unicode value + the corresponding characters in a String + + + + / + Converts a UTF32 code point sequence to a String with the corresponding character(s). + + a Unicode text sequence + start position of text to convert, inclusive + end position of txt to convert, exclusive + the corresponding characters in a String + + + Converts a UTF32 code point value to a char array with the corresponding character(s). + a Unicode value + the corresponding characters in a char arrat + + + Unicode script "Common". + + + Unicode script "Latin". + + + Unicode script "Greek". + + + Unicode script "Cyrillic". + + + Unicode script "Armenian". + + + Unicode script "Hebrew". + + + Unicode script "Arabic". + + + Unicode script "Syriac". + + + Unicode script "Thaana". + + + Unicode script "Devanagari". + + + Unicode script "Bengali". + + + Unicode script "Gurmukhi". + + + Unicode script "Gujarati". + + + Unicode script "Oriya". + + + Unicode script "Tamil". + + + Unicode script "Telugu". + + + Unicode script "Kannada". + + + Unicode script "Malayalam". + + + Unicode script "Sinhala". + + + Unicode script "Thai". + + + Unicode script "Lao". + + + Unicode script "Tibetan". + + + Unicode script "Myanmar". + + + Unicode script "Georgian". + + + Unicode script "Hangul". + + + Unicode script "Ethiopic". + + + Unicode script "Cherokee". + + + Unicode script "Canadian_Aboriginal". + + + Unicode script "Ogham". + + + Unicode script "Runic". + + + Unicode script "Khmer". + + + Unicode script "Mongolian". + + + Unicode script "Hiragana". + + + Unicode script "Katakana". + + + Unicode script "Bopomofo". + + + Unicode script "Han". + + + Unicode script "Yi". + + + Unicode script "Old_Italic". + + + Unicode script "Gothic". + + + Unicode script "Deseret". + + + Unicode script "Inherited". + + + Unicode script "Tagalog". + + + Unicode script "Hanunoo". + + + Unicode script "Buhid". + + + Unicode script "Tagbanwa". + + + Unicode script "Limbu". + + + Unicode script "Tai_Le". + + + Unicode script "Linear_B". + + + Unicode script "Ugaritic". + + + Unicode script "Shavian". + + + Unicode script "Osmanya". + + + Unicode script "Cypriot". + + + Unicode script "Braille". + + + Unicode script "Buginese". + + + Unicode script "Coptic". + + + Unicode script "New_Tai_Lue". + + + Unicode script "Glagolitic". + + + Unicode script "Tifinagh". + + + Unicode script "Syloti_Nagri". + + + Unicode script "Old_Persian". + + + Unicode script "Kharoshthi". + + + Unicode script "Balinese". + + + Unicode script "Cuneiform". + + + Unicode script "Phoenician". + + + Unicode script "Phags_Pa". + + + Unicode script "Nko". + + + Unicode script "Sundanese". + + + Unicode script "Batak". + + + Unicode script "Lepcha". + + + Unicode script "Ol_Chiki". + + + Unicode script "Vai". + + + Unicode script "Saurashtra". + + + Unicode script "Kayah_Li". + + + Unicode script "Rejang". + + + Unicode script "Lycian". + + + Unicode script "Carian". + + + Unicode script "Lydian". + + + Unicode script "Cham". + + + Unicode script "Tai_Tham". + + + Unicode script "Tai_Viet". + + + Unicode script "Avestan". + + + Unicode script "Egyptian_Hieroglyphs". + + + Unicode script "Samaritan". + + + Unicode script "Mandaic". + + + Unicode script "Lisu". + + + Unicode script "Bamum". + + + Unicode script "Javanese". + + + Unicode script "Meetei_Mayek". + + + Unicode script "Imperial_Aramaic". + + + Unicode script "Old_South_Arabian". + + + Unicode script "Inscriptional_Parthian". + + + Unicode script "Inscriptional_Pahlavi". + + + Unicode script "Old_Turkic". + + + Unicode script "Brahmi". + + + Unicode script "Kaithi". + + + Unicode script "Meroitic Hieroglyphs". + + + Unicode script "Meroitic Cursive". + + + Unicode script "Sora Sompeng". + + + Unicode script "Chakma". + + + Unicode script "Sharada". + + + Unicode script "Takri". + + + Unicode script "Miao". + + + Unicode script "Unknown". + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + * Returns the enum constant representing the Unicode script of which + * the given character (Unicode code point) is assigned to. + * + * @param codePoint the character (Unicode code point) in question. + * @return The {@code UnicodeScript} constant representing the + * Unicode script of which this character is assigned to. + * + * @exception IllegalArgumentException if the specified + * {@code codePoint} is an invalid Unicode code point. + * @see Character#isValidCodePoint(int) + * + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + This method makes a valid URL from a given filename. + a given filename + a valid URL + + + + + + + Summary description for DeflaterOutputStream. + + +
+
diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.kernel.dll b/src/packages/itext7.7.0.1/lib/net40/itext.kernel.dll new file mode 100644 index 00000000000..4196e3caf23 Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.kernel.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.kernel.xml b/src/packages/itext7.7.0.1/lib/net40/itext.kernel.xml new file mode 100644 index 00000000000..55771730f09 --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.kernel.xml @@ -0,0 +1,50386 @@ + + + + itext.kernel + + + + Represents a color + + + Predefined black DeviceRgb color + + + Predefined blue DeviceRgb color + + + Predefined cyan DeviceRgb color + + + Predefined dark gray DeviceRgb color + + + Predefined gray DeviceRgb color + + + Predefined green DeviceRgb color + + + Predefined light gray DeviceRgb color + + + Predefined magenta DeviceRgb color + + + Predefined orange DeviceRgb color + + + Predefined pink DeviceRgb color + + + Predefined red DeviceRgb color + + + Predefined white DeviceRgb color + + + Predefined yellow DeviceRgb color + + + The color space of the color + + + The color value of the color + + + Creates a Color of certain color space and color value. + + Creates a Color of certain color space and color value. + If color value is set in null, all value components will be initialised with zeroes. + + the color space to which the created Color object relates + the color value of the created Color object + + + Makes a Color of certain color space. + + Makes a Color of certain color space. + All color value components will be initialised with zeroes. + + the color space to which the returned Color object relates + + + Makes a Color of certain color space and color value. + + Makes a Color of certain color space and color value. + If color value is set in null, all value components will be initialised with zeroes. + + the color space to which the returned Color object relates + the color value of the returned Color object + + + + Converts + DeviceCmyk + color to + DeviceRgb + color + + the DeviceCmyk color which will be converted to DeviceRgb color + converted color + + + + Converts + DeviceRgb + color to + DeviceCmyk + color + + the DeviceRgb color which will be converted to DeviceCmyk color + converted color + + + Returns the number of color value components + the number of color value components + + + + Returns the + color space + to which the color is related. + + the color space of the color + + + Returns the color value of the color + the color value + + + Sets the color value of the color + new color value + + + Indicates whether the color is equal to the given color. + + Indicates whether the color is equal to the given color. + The + color space + and + color value + are considered during the comparison. + + + + + + + Color space to specify colors according to CMYK color model. + + + Predefined cyan DeviceCmyk color + + + Predefined magenta DeviceCmyk color + + + Predefined yellow DeviceCmyk color + + + Predefined black DeviceCmyk color + + + Creates DeviceCmyk color with all colorants intensities initialised as zeroes. + + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + The intensities are considered to be in [0, 100] gap, if not, + the intensity will be considered as 100 (when colorant's value is bigger than 100) + or 0 (when colorant's value is less than 0). + + the intensity of cyan colorant + the intensity of magenta colorant + the intensity of yellow colorant + the intensity of black colorant + + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + The intensities are considered to be in [0, 1] interval, if not, + the intensity will be considered as 1 (when colorant's value is bigger than 1) + or 0 (when colorant's value is less than 0). + + the intensity of cyan colorant + the intensity of magenta colorant + the intensity of yellow colorant + the intensity of black colorant + + + + Returns + DeviceCmyk + color which is lighter than given one + + the DeviceCmyk color to be made lighter + lighter color + + + + Returns + DeviceCmyk + color which is darker than given one + + the DeviceCmyk color to be made darker + darker color + + + Color space to specify shades of gray color. + + + Predefined white DeviceGray color. + + + Predefined gray DeviceGray color. + + + Predefined black DeviceGray color. + + + Creates DeviceGray color by given grayscale. + + Creates DeviceGray color by given grayscale. + The grayscale is considered to be in [0, 1] interval, if not, + the grayscale will be considered as 1 (when grayscale's value is bigger than 1) + or 0 (when grayscale's value is less than 0). + + the grayscale value + + + Creates DeviceGray color with grayscale value initialised as zero. + + + + Returns + DeviceGray + color which is lighter than given one + + the DeviceGray color to be made lighter + lighter color + + + + Returns + DeviceGray + color which is darker than given one + + the DeviceGray color to be made darker + darker color + + + Color space to specify colors according to RGB color model. + + + Creates DeviceRgb color by intensities of red, green and blue colorants. + + Creates DeviceRgb color by intensities of red, green and blue colorants. + The intensities are considered to be in [0, 255] gap, if not, + the intensity will be considered as 255 (when colorant's value is bigger than 255) + or 0 (when colorant's value is less than 0). + + the intensity of red colorant + the intensity of green colorant + the intensity of blue colorant + + + Creates DeviceRgb color by intensities of red, green and blue colorants. + + Creates DeviceRgb color by intensities of red, green and blue colorants. + The intensities are considered to be in [0, 1] interval, if not, + the intensity will be considered as 1 (when colorant's value is bigger than 1) + or 0 (when colorant's value is less than 0). + + the intensity of red colorant + the intensity of green colorant + the intensity of blue colorant + + + Creates DeviceRgb color with all colorants intensities initialised as zeroes. + + + + Returns + DeviceRgb + color which is lighter than given one + + the DeviceRgb color to be made lighter + lighter color + + + + Returns + DeviceRgb + color which is darker than given one + + the DeviceRgb color to be made darker + darker color + + + Creates IccBased color. + ICC profile stream. User is responsible for closing the stream. + + + Creates IccBased color. + ICC profile stream. User is responsible for closing the stream. + color value. + + + + This class is a HashMap that contains the names of colors as a key and the + corresponding BaseColor as value. + + + This class is a HashMap that contains the names of colors as a key and the + corresponding BaseColor as value. (Source: Wikipedia + http://en.wikipedia.org/wiki/Web_colors ) + + + + HashMap containing all the names and corresponding color values. + + + + A web color string without the leading # will be 3 or 6 characters long + and all those characters will be hex digits. + + + A web color string without the leading # will be 3 or 6 characters long + and all those characters will be hex digits. NOTE: colStr must be all + lower case or the current hex letter test will fail. + + + A non-null, lower case string that might describe an RGB color + in hex. + + Is this a web color hex string without the leading #? + + + Gives you a BaseColor based on a name. + + a name such as black, violet, cornflowerblue or #RGB or + #RRGGBB or RGB or RRGGBB or rgb(R,G,B) + + the corresponding BaseColor object. Never returns null. + if the String isn't a know representation of a color. + + + Creates an AES Cipher with CBC and padding PKCS5/7. + Paulo Soares + + + Creates a new instance of AESCipher + + + Creates an AES Cipher with CBC and no padding. + Paulo Soares + + + Creates a new instance of AESCipher + + + Creates a new instance of AesDecryption + + + Creates a new instance of ARCFOUREncryption + + + Bad password exception. + + + Exception class for exceptions in kernel module. + + + Object for more details + + + Creates a new instance of PdfException. + the detail message. + + + Creates a new instance of PdfException. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of PdfException. + the detail message. + an object for more details. + + + Creates a new instance of PdfException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of PdfException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + an object for more details. + + + Sets additional params for Exception message. + additional params. + object itself. + + + Gets additional params for Exception message. + + + Creates a new BadPasswordException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new BadPasswordException. + the detail message. + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + An initialization vector generator for a CBC block encryption. + An initialization vector generator for a CBC block encryption. It's a random generator based on ARCFOUR. + + Paulo Soares + + + Creates a new instance of IVGenerator + + + Gets a 16 byte random initialization vector. + a 16 byte random initialization vector + + + Gets a random initialization vector. + the length of the initialization vector + a random initialization vector + + + Creates a new instance of OutputStreamCounter + + + + Closes this output stream and releases any system resources + associated with this stream. + + + Closes this output stream and releases any system resources + associated with this stream. The general contract of + close + is that it closes the output stream. A closed stream cannot perform + output operations and cannot be reopened. +

+ The + close + method of + OutputStream + does nothing. + + if an I/O error occurs. + + +

+ Flushes this output stream and forces any buffered output bytes + to be written out. + + + Flushes this output stream and forces any buffered output bytes + to be written out. The general contract of + flush + is + that calling it is an indication that, if any bytes previously + written have been buffered by the implementation of the output + stream, such bytes should immediately be written to their + intended destination. +

+ The + flush + method of + OutputStream + does nothing. + + if an I/O error occurs. + + +

+ Writes + b.length + bytes from the specified byte array + to this output stream. The general contract for + write(b) + is that it should have exactly the same effect as the call + write(b, 0, b.length) + . + + the data. + if an I/O error occurs. + +
+ + Writes the specified byte to this output stream. + + Writes the specified byte to this output stream. The general + contract for + write + is that one byte is written + to the output stream. The byte to be written is the eight + low-order bits of the argument + + . The 24 + high-order bits of + + are ignored. +

+ Subclasses of + OutputStream + must provide an + implementation for this method. + + + the + byte + . + + + if an I/O error occurs. In particular, an + IOException + may be thrown if the + output stream has been closed. + + + +

+ Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

+ The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

+ If + + is + + , a + NullPointerException + is thrown. +

+ If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

+ the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
+ + Creates a new instance of OutputStreamCounter + + + + Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

+ The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

+ If + + is + + , a + NullPointerException + is thrown. +

+ If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

+ the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
+ + Creates a new instance of OutputStreamStandardEncryption + + + + Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

+ The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

+ If + + is + + , a + NullPointerException + is thrown. +

+ If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

+ the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
+ + + + + + + + + + Aiken Sam (aikensam@ieee.org) + + + The global encryption key + + + The encryption key for a particular object/generation. + + The encryption key for a particular object/generation. + It is recalculated with + + for every object individually based in its object/generation. + + + + + The encryption key length for a particular object/generation + It is recalculated with + + for every object individually based in its object/generation. + + + + Work area to prepare the object/generation bytes + + + + Note: For most of the supported security handlers algorithm to calculate encryption key for particular object + is the same. + + + + + + + + + + + + + + + + + + + + + + Gets bytes of String-value without considering encoding. + byte array + + + Creates a new instance of StandardDecryption + + + Describes abstract event. + + + A type of event. + + + Creates an event of the specified type. + type of event + + + Returns the type of this event. + type of this event + + + + IEventDispatcher implementation that forwards Events to registered + + implementations. + + + + Event dispatcher interface. + + + Adds new event handler. + a type of event to be handled. + event handler. + + + Dispatches an event. + + + + Dispatches a delayed event. + + Dispatches a delayed event. + Sometimes event cannot be handled immediately because event handler has not been set yet. + In this case event is placed into event ques of dispatcher and is waiting until handler is assigned. + + + + + + Checks if event dispatcher as an event handler assigned for a certain event type. + + + + + Removes event handler. + + + + + Remove all event handlers. + + + Interface for handling events. + + Interface for handling events. EventHandlers are added to the + + . + + + + Hook for handling events. + + Hook for handling events. Implementations can access the PdfDocument instance + associated to the specified Event or, if available, the PdfPage instance. + + the Event that needs to be processed + + + Event dispatched by PdfDocument. + + + Dispatched after page is created. + + + Dispatched after page is inserted/added into document. + + + Dispatched after page is removed from document. + + + Dispatched before page is closed and written. + + + The PdfPage associated with this event. + + + The PdfDocument associated with this event. + + + Creates a PdfDocumentEvent. + type of the event that fired this event + document that fired this event + + + Creates a PdfDocumentEvent. + type of the event that fired this event + page that fired this event + + + Returns the PdfDocument associated with this event. + the PdfDocument associated with this event + + + Returns the PdfPage associated with this event. + Returns the PdfPage associated with this event. Warning: this can be null. + the PdfPage associated with this event + + + This class allow to parse document font's encoding. + + + Marks object behind wrapper to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object behind wrapper to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + + Defines if the object behind this wrapper must be an indirect object in the + resultant document. + + + Defines if the object behind this wrapper must be an indirect object in the + resultant document. +

+ If this method returns true it doesn't necessarily mean that object + must be in the indirect state at any moment, but rather defines that + when the object will be written to the document it will be transformed into + indirect object if it's not indirect yet. +

+ Return value of this method shouldn't depend on any logic, it should return + always true or false. +
+ + true if in the resultant document the object behind the wrapper + must be indirect, otherwise false. + +
+ + + Some wrappers use object's indirect reference to obtain the + PdfDocument + to which the object belongs to. For this matter, for these wrappers it is implicitly defined + that they work with indirect objects only. Commonly these wrappers have two constructors: one with + PdfDocument + as parameter to create a new object, and the other one which + wraps around the given + PdfObject + . This method should be used in the second + type of constructors to ensure that wrapper will able to obtain the + PdfDocument + instance. + + + the + PdfObject + to be checked if it is indirect. + + + + false, if the font comes from PdfDocument. + + + true if the font is to be embedded in the PDF. + + + Indicates if all the glyphs and widths for that particular encoding should be included in the document. + + + + Get glyph by unicode + a unicode code point + + + Glyph + if it exists or .NOTDEF if supported, otherwise + + . + + + + Check whether font contains glyph with specified unicode. + a unicode code point + + true if font contains glyph, represented with the unicode code point, + otherwise false. + + + + Check whether font contains glyph with specified unicode. + a unicode code point + + true if font contains glyph, represented with the unicode code point, + otherwise false. + + + + Converts the text into bytes to be placed in the document. + + Converts the text into bytes to be placed in the document. + The conversion is done according to the font and the encoding and the characters + used are stored. + + the text to convert + the conversion + + + Returns the width of a certain character of this font in 1000 normalized units. + a certain character. + a width in Text Space. + + + Returns the width of a certain character of this font in points. + a certain character. + the font size. + a width in points. + + + Returns the width of a string of this font in 1000 normalized units. + a string content. + a width of string in Text Space. + + + + Gets the width of a + String + in points. + + + the + String + to get the width of + + the font size + the width in points + + + + Gets the descent of a + String + in points. The descent will always be + less than or equal to zero even if all the characters have an higher descent. + + + the + String + to get the descent of + + the font size + the descent in points + + + Gets the descent of a char code in points. + + Gets the descent of a char code in points. The descent will always be + less than or equal to zero even if all the characters have an higher descent. + + the char code to get the descent of + the font size + the descent in points + + + + Gets the ascent of a + String + in points. The ascent will always be + greater than or equal to zero even if all the characters have a lower ascent. + + + the + String + to get the ascent of + + the font size + the ascent in points + + + Gets the ascent of a char code in normalized 1000 units. + + Gets the ascent of a char code in normalized 1000 units. The ascent will always be + greater than or equal to zero even if all the characters have a lower ascent. + + the char code to get the ascent of + the font size + the ascent in points + + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. + + false to include all the glyphs and widths. + + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. When set to true + only the glyphs used will be included in the font. When set to false + and + + was not called the full font will be included + otherwise just the characters ranges will be included. + + new value of property subset + + + Adds a character range when subsetting. + + Adds a character range when subsetting. The range is an int array + where the first element is the start range inclusive and the second element is the + end range inclusive. Several ranges are allowed in the same array. + + the character range + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + Creates a unique subset prefix to be added to the font name when the font is embedded and subset. + + the subset prefix + + + + Create + PdfStream + based on + + . + + original font data, must be not null. + + array to generate + Length* + keys, must be not null. + + + the PdfStream containing the font or + + , if there is an error reading the font. + + + Method will throw exception if + + is + + . + + + + Helper method for making an object indirect, if the object already is indirect. + + Helper method for making an object indirect, if the object already is indirect. + Useful for FontDescriptor and FontFile to make possible immediate flushing. + If there is no PdfDocument, mark the object as + MUST_BE_INDIRECT + . + + an object to make indirect. + + if current object isn't indirect, returns + + , otherwise + tree + + + + + This class provides helpful methods for creating fonts ready to be used in a + + + + + This is the default encoding to use. + + + This is the default value of the embedded variable. + + + This is the default value of the cached variable. + + + + Creates a default font, namely + + standard font with + + encoding. + + created font + if error occurred while creating the font, e.g. metrics loading failure + + + + + Creates a + + by existing font dictionary. + + the font dictionary to create the font from + + created + + instance + + + + + Creates a + + instance by the path of the font program file + + the path of the font program file + + created + + instance + + exception is thrown in case an I/O error occurs when reading the file + + + + + Creates a + + instance by the path of the font program file and given encoding. + + the path of the font program file + + the font encoding. See + + + + created + + instance + + exception is thrown in case an I/O error occurs when reading the file + + + + + Creates a + + instance from the TrueTypeCollection represented by its byte contents. + + the byte contents of the TrueTypeCollection + the index of the font in the collection, zero-based + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + in case the contents of the TrueTypeCollection is mal-formed or an error occurred during reading the font + + + + + Creates a + + instance from the TrueTypeCollection given by the path to the .ttc file. + + the path of the .ttc file + the index of the font in the collection, zero-based + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + + in case the file is not found, contents of the TrueTypeCollection is mal-formed + or an error occurred during reading the font + + + + + Created a + + instance given the path to the font file. + + the font program file + indicates whether the font is to be embedded into the target document + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the path to the font file. + + the font program file + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the path to the font file. + + the font program file + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + the encoding of the font to be created. See + + + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Creates a new instance of + + + the target document of the new font + indicates whether the font will be colorized + created font + actually this exception is never thrown. This will be removed in 7.1. + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + In case if TrueTypeCollection (.ttc), an additional parameter may be specified defining the index of the font + to be registered, e.g. "path/to/font/collection.ttc,0". The index is zero-based. + + the path to a font file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Registers all the fonts in a directory. + the directory path to be registered as a font directory path + the number of fonts registered + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font families. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found, false otherwise + + + Checks if the provided dictionary is a valid font dictionary of the provided font type. + true if the passed dictionary is a valid dictionary, false otherwise + + + Forces the output of the width array. + Forces the output of the width array. Only matters for the 14 built-in fonts. + + + The array used with single byte encodings. + + + Gets the state of the property. + value of property forceWidthsOutput + + + + Set to + + to force the generation of the widths array. + + + + + to force the generation of the widths array + + + + + Generates the font descriptor for this font or + + if it is one of the 14 built in fonts. + + + the PdfDictionary containing the font descriptor or + + . + + + + Note. + Note. For TrueType FontNames.getStyle() is the same to Subfamily(). So, we shouldn't add style to /BaseFont. + + + + Generates the CIDFontTyte2 dictionary. + the indirect reference to the font descriptor + a name of the font + the horizontal width metrics + fully initialized CIDFont + + + Creates a ToUnicode CMap to allow copy and paste from Acrobat. + + metrics[0] contains the glyph index and metrics[2] + contains the Unicode code + + the stream representing this CMap or null + + + The method used to sort the metrics array. + the first element + the second element + the comparison + + + + If the embedded flag is + + or if the font is one of the 14 built in types, it returns + + , + otherwise the font is read and output in a PdfStream object. + + + + Low-level API class for Type 3 fonts. + + Low-level API class for Type 3 fonts. +

+ In Type 3 fonts, glyphs are defined by streams of PDF graphics operators. + These streams are associated with character names. A separate encoding entry + maps character codes to the appropriate character names for the glyphs. +

+ To be able to be wrapped with this + + the + + must be indirect. + + + +

Creates a Type3 font. + defines whether the glyph color is specified in the glyph descriptions in the font. + +
+ + Creates a Type3 font based on an existing font dictionary, which must be an indirect object. + a dictionary of type /Font, must have an indirect reference. + + + Defines a glyph. + Defines a glyph. If the character was already defined it will return the same content + the character to match this glyph. + the advance this character will have + + the X lower left corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the Y lower left corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the X upper right corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the Y upper right corner of the glyph bounding box. If the colorize option is + true the value is ignored + + a content where the glyph can be defined + + + + Gets first empty code, that could use with + addSymbol() + + code from 1 to 255 or -1 if all slots are busy. + + + The content where Type3 glyphs are written to. + + + PdfCanvas class represents an algorithm for writing data into content stream. + + PdfCanvas class represents an algorithm for writing data into content stream. + To write into page content, create PdfCanvas from a page instance. + To write into form XObject, create PdfCanvas from a form XObject instance. + Make sure to call PdfCanvas.release() after you finished writing to the canvas. + It will save some memory. + + + + a LIFO stack of graphics state saved states. + + + the current graphics state. + + + the content stream for this canvas object. + + + the resources for the page that this canvas belongs to. + + + + the document that the resulting content stream of this canvas will be written to. + + + a counter variable for the marked content stack. + + + The list where we save/restore the layer depth. + + + Creates PdfCanvas from content stream of page, form XObject, pattern etc. + @see PdfStream. + the resources, a specialized dictionary that can be used by PDF instructions in the content stream + + the document that the resulting content stream will be written to + + + Convenience method for fast PdfCanvas creation by a certain page. + page to create canvas from. + + + Convenience method for fast PdfCanvas creation by a certain page. + page to create canvas from. + + true to wrap all old content streams into q/Q operators so that the state of old + content streams would not affect the new one + + + + Creates a PdfCanvas from a PdfFormXObject. + the PdfFormXObject used to create the PdfCanvas + the document to which the resulting content stream will be written + + + Convenience method for fast PdfCanvas creation by a certain page. + @see PdfDocument. + page number. + + + Get the resources of the page that this canvas belongs to.. + PdfResources of the page that this canvas belongs to.. + + + Attaches new content stream to the canvas. + + Attaches new content stream to the canvas. + This method is supposed to be used when you want to write in different PdfStream keeping context (gsStack, currentGs, ...) the same. + + a content stream to attach. + + + + Gets current + + . + + container containing properties for the current state of the canvas. + + + Releases the canvas. + + Releases the canvas. + Use this method after you finished working with canvas. + + + + Saves graphics state. + current canvas. + + + Restores graphics state. + current canvas. + + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + Contrast with + PdfCanvas#setTextMatrix + + operand 1,1 in the matrix. + operand 1,2 in the matrix. + operand 2,1 in the matrix. + operand 2,2 in the matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas + + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + If an array not containing the 6 values of the matrix is passed, + The current canvas is returned unchanged. + + affine transformation stored as a PdfArray with 6 values + current canvas + + + + Concatenates the affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + See also + + + current canvas + + + Begins text block (PDF BT operator). + current canvas. + + + Ends text block (PDF ET operator). + current canvas. + + + Begins variable text block + current canvas + + + Ends variable text block + current canvas + + + Sets font and size (PDF Tf operator). + @see PdfFont. + Font size. + current canvas. + + + Moves text by shifting text line matrix (PDF Td operator). + x coordinate. + y coordinate. + current canvas. + + + + + Moves to the start of the next line. + current canvas. + + + + Moves to the next line and shows + + . + + the text to write + current canvas. + + + Moves to the next line and shows text string, using the given values of the character and word spacing parameters. + + a parameter + a parameter + the text to write + current canvas. + + + Sets text rendering mode. + text rendering mode @see PdfCanvasConstants. + current canvas. + + + + Sets the word spacing parameter. + a parameter + current canvas. + + + Sets the character spacing parameter. + a parameter + current canvas. + + + Sets the horizontal scaling parameter. + a parameter. + current canvas. + + + Replaces the text matrix. + + Replaces the text matrix. Contrast with + PdfCanvas#concatMatrix + + operand 1,1 in the matrix. + operand 1,2 in the matrix. + operand 2,1 in the matrix. + operand 2,2 in the matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas. + + + Changes the text matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas. + + + Shows text (operator Tj). + text to show. + current canvas. + + + Shows text (operator Tj). + text to show. + current canvas. + + + Shows text (operator TJ) + + the text array. Each element of array can be a string or a number. + If the element is a string, this operator shows the string. + If it is a number, the operator adjusts the text position by that amount. + The number is expressed in thousandths of a unit of text space. + This amount is subtracted from the current horizontal or vertical coordinate, depending on the writing mode. + + current canvas. + + + Move the current point (x, y), omitting any connecting line segment. + x coordinate. + y coordinate. + current canvas. + + + Appends a straight line segment from the current point (x, y). + + Appends a straight line segment from the current point (x, y). The new current + point is (x, y). + + x coordinate. + y coordinate. + current canvas. + + + Appends a Bêzier curve to the path, starting from the current point. + x coordinate of the first control point. + y coordinate of the first control point. + x coordinate of the second control point. + y coordinate of the second control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + Appends a B??zier curve to the path, starting from the current point. + x coordinate of the second control point. + y coordinate of the second control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + Appends a B??zier curve to the path, starting from the current point. + x coordinate of the first control point. + y coordinate of the first control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + + Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, + starting at startAng degrees and covering extent degrees. + + + Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, + starting at startAng degrees and covering extent degrees. Angles + start with 0 to the right (+x) and increase counter-clockwise. + + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + starting angle in degrees. + angle extent in degrees. + current canvas. + + + Draws an ellipse inscribed within the rectangle x1,y1,x2,y2. + a corner of the enclosing rectangle + a corner of the enclosing rectangle + a corner of the enclosing rectangle + a corner of the enclosing rectangle + current canvas. + + + Generates an array of bezier curves to draw an arc. + + Generates an array of bezier curves to draw an arc. +

+ (x1, y1) and (x2, y2) are the corners of the enclosing rectangle. + Angles, measured in degrees, start with 0 to the right (the positive X + axis) and increase counter-clockwise. The arc extends from startAng + to startAng+extent. i.e. startAng=0 and extent=180 yields an openside-down + semi-circle. +

+ The resulting coordinates are of the form double[]{x1,y1,x2,y2,x3,y3, x4,y4} + such that the curve goes from (x1, y1) to (x4, y4) with (x2, y2) and + (x3, y3) as their respective Bezier control points. +

+ Note: this code was taken from ReportLab (www.reportlab.org), an excellent + PDF generator for Python (BSD license: http://www.reportlab.org/devfaq.html#1.3 ). + + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + starting angle in degrees. + angle extent in degrees. + a list of double[] with the bezier curves. + + +

Draws a rectangle. + x coordinate of the starting point. + y coordinate of the starting point. + width. + height. + current canvas. +
+ + Draws a rectangle. + a rectangle to be drawn + current canvas. + + + Draws rounded rectangle. + x coordinate of the starting point. + y coordinate of the starting point. + width. + height. + radius of the arc corner. + current canvas. + + + Draws a circle. + Draws a circle. The endpoint will (x+r, y). + x center of circle. + y center of circle. + radius of circle. + current canvas. + + + Paints a shading object and adds it to the resources of this canvas + + current canvas. + + + + Closes the current subpath by appending a straight line segment from the current point + to the starting point of the subpath. + + current canvas. + + + Closes the path, fills it using the even-odd rule to determine the region to fill and strokes it. + + current canvas. + + + Closes the path, fills it using the non-zero winding number rule to determine the region to fill and strokes it. + + current canvas. + + + Ends the path without filling or stroking it. + current canvas. + + + Strokes the path. + current canvas. + + + + Modify the current clipping path by intersecting it with the current path, using the + nonzero winding rule to determine which regions lie inside the clipping path. + + current canvas. + + + + Modify the current clipping path by intersecting it with the current path, using the + even-odd rule to determine which regions lie inside the clipping path. + + current canvas. + + + Closes the path and strokes it. + current canvas. + + + Fills current path. + current canvas. + + + Fills the path using the non-zero winding number rule to determine the region to fill and strokes it. + + current canvas. + + + EOFills current path. + current canvas. + + + Fills the path, using the even-odd rule to determine the region to fill and strokes it. + current canvas. + + + Sets line width. + line width. + current canvas. + + + + Sets the line cap style, the shape to be used at the ends of open subpaths + when they are stroked. + + + current canvas. + for possible values. + + + + Sets the line join style, the shape to be used at the corners of paths + when they are stroked. + + + current canvas. + for possible values. + + + + Sets the miter limit, a parameter specifying the maximum length a miter join + may extend beyond the join point, relative to the angle of the line segments. + + + current canvas. + + + Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

+ The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + current canvas. + + +

Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

+ The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + the number of units that must be 'on' (equals the number of units that must be 'off'). + + current canvas. + + +

Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

+ The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + the number of units that must be 'on' + the number of units that must be 'off' + current canvas. + + +

Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

+ The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + length of the alternating dashes and gaps + the value of the phase + current canvas. + + +

Set the rendering intent. + + Set the rendering intent. possible values are: PdfName.AbsoluteColorimetric, + PdfName.RelativeColorimetric, PdfName.Saturation, PdfName.Perceptual. + + a PdfName containing a color metric + current canvas. +
+ + + Changes the current color for filling paths. + fill color. + current canvas. + + + Changes the current color for stroking paths. + stroke color. + current canvas. + + + Changes the current color for paths. + the new color. + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for paths. + the color space of the new color + a list of numerical values with a length corresponding to the specs of the color space. Values should be in the range [0,1] + + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for paths with an explicitly defined pattern. + the color space of the new color + a list of numerical values with a length corresponding to the specs of the color space. Values should be in the range [0,1] + + a pattern for the colored line or area + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for filling paths to a grayscale value. + a grayscale value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to a grayscale value. + a grayscale value in the range [0,1] + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + Changes the current color for filling paths to an RGB value. + a red value in the range [0,1] + a green value in the range [0,1] + a blue value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to an RGB value. + a red value in the range [0,1] + a green value in the range [0,1] + a blue value in the range [0,1] + current canvas. + + + Adds or changes the shading of the current fill color path. + the shading + current canvas. + + + Adds or changes the shading of the current stroke color path. + the shading + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + Changes the current color for filling paths to a CMYK value. + a cyan value in the range [0,1] + a magenta value in the range [0,1] + a yellow value in the range [0,1] + a key (black) value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to a CMYK value. + a cyan value in the range [0,1] + a magenta value in the range [0,1] + a yellow value in the range [0,1] + a key (black) value in the range [0,1] + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + + Ends OCG layer. + current canvas. + + + Creates Image XObject from image and adds it to canvas (as Image XObject). + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + created Image XObject. + + + Creates Image XObject from image and adds it to canvas. + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + true if to add image as in-line. + created Image XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to canvas. + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to canvas. + + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to the specified position with specified width preserving aspect ratio. + + + + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to the specified position with specified width preserving aspect ratio. + + + + + + true if to add image as in-line. + + created XObject or null in case of in-line image (asInline = true). + + + + Adds + PdfXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + current canvas. + + + + Adds + PdfXObject + to the specified position. + + + + + current canvas. + + + + Adds + PdfXObject + to specified rectangle on canvas. + + + + current canvas. + + + + Adds + PdfXObject + to the specified position with specified width preserving aspect ratio. + + + + + + current canvas. + + + + Adds + PdfXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + current canvas. + + + Sets the ExtGState dictionary for the current graphics state + a dictionary that maps resource names to graphics state parameter dictionaries + current canvas. + + + Sets the ExtGState dictionary for the current graphics state + a dictionary that maps resource names to graphics state parameter dictionaries + current canvas. + + + Manually start a Marked Content sequence. + Manually start a Marked Content sequence. Used primarily for Tagged PDF + the type of content contained + current canvas + + + Manually start a Marked Content sequence with properties. + Manually start a Marked Content sequence with properties. Used primarily for Tagged PDF + the type of content that will be contained + the properties of the content, including Marked Content ID. If null, the PDF marker is BMC, else it is BDC + + current canvas + + + Manually end a Marked Content sequence. + Manually end a Marked Content sequence. Used primarily for Tagged PDF + current canvas + + + Manually open a canvas tag, beginning a Marked Content sequence. + Manually open a canvas tag, beginning a Marked Content sequence. Used primarily for Tagged PDF + the type of content that will be contained + current canvas + + + Open a tag, beginning a Marked Content sequence. + + Open a tag, beginning a Marked Content sequence. This MC sequence will belong to the tag from the document + logical structure. +
+ CanvasTag will be automatically created with assigned mcid(Marked Content id) to it. Mcid serves as a reference + between Marked Content sequence and logical structure element. +
+ reference to the tag from the document logical structure + current canvas +
+ + Manually close a tag, ending a Marked Content sequence. + Manually close a tag, ending a Marked Content sequence. Used primarily for Tagged PDF + current canvas + + + + Outputs a + String + directly to the content. + + + the + String + + current canvas. + + + + Outputs a + char + directly to the content. + + + the + char + + current canvas. + + + + Outputs a + float + directly to the content. + + + the + float + + current canvas. + + + Please, use this method with caution and only if you know what you are doing. + + Please, use this method with caution and only if you know what you are doing. + Manipulating with underlying stream object of canvas could lead to corruption of it's data. + + the content stream to which this canvas object writes. + + + + Adds + PdfImageXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + + + + Adds + PdfFormXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + current canvas. + + + + Adds + PdfFormXObject + to the specified position. + + + + + current canvas. + + + + Adds + PdfFormXObject + to specified rectangle on canvas. + + + + current canvas. + + + + Adds I + PdfFormXObject + to the specified position with specified width preserving aspect ratio. + + + + + + current canvas. + + + + Adds + PdfFormXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + + + + + Adds + PdfImageXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + canvas a reference to this object. + + + + Adds + PdfImageXObject + to the specified position. + + + + + + + + + Adds + PdfImageXObject + to specified rectangle on canvas. + + + + + + + + Adds + PdfImageXObject + to the specified position with specified width preserving aspect ratio. + + + + + + + + + + Adds + PdfImageXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + current canvas. + + + + A helper to insert into the content stream the + + converted to bytes according to the font's encoding. + + the text to write. + + + Creates a Type3Glyph canvas with a new Content Stream. + the document that this canvas is created for + + + Creates a Type3Glyph canvas with a non-empty Content Stream. + + + PdfStream + from existed document. + + + document to which + PdfStream + belongs. + + + + Indicates if the glyph color specified in the glyph description or not. + whether the glyph color is specified in the glyph description or not + + + Writes the width and optionally the bounding box parameters for a glyph + the advance this character will have + + the X lower left corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the Y lower left corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the X upper right corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the Y upper right corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + defines whether the glyph color is specified in the glyph description in the font. + The consequence of value true is that the bounding box parameters are ignored. + + + + Creates Image XObject from image and adds it to canvas. + + Creates Image XObject from image and adds it to canvas. Performs additional checks to make + sure that we only add mask images to not colorized type 3 fonts. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + true if to add image as in-line. + created Image XObject or null in case of in-line image (asInline = true). + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The TYPE_UNKNOWN is an initial type value. + + + The min value equivalent to zero. + The min value equivalent to zero. If absolute value less then ZERO it considered as zero. + + + The values of transformation matrix + + + The transformation type + + + Method returns type of affine transformation. + + Method returns type of affine transformation. + Transform matrix is + m00 m01 m02 + m10 m11 m12 + According analytic geometry new basis vectors are (m00, m01) and (m10, m11), + translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1). + Type transformations classification: +
    +
  • + + - new basis equals original one and zero translation
  • +
  • + + - translation vector isn't zero
  • +
  • + + - vectors length of new basis equals
  • +
  • + + - vectors length of new basis doesn't equal
  • +
  • + + - new basis vector orientation differ from original one
  • +
  • + + - new basis is rotated by 90, 180, 270, or 360 degrees
  • +
  • + + - new basis is rotated by arbitrary angle
  • +
  • + + - transformation can't be inversed
  • +
+
+
+ + Multiply matrix of two AffineTransform objects + - the AffineTransform object is a multiplicand + - the AffineTransform object is a multiplier + an AffineTransform object that is a result of t1 multiplied by matrix t2. + + + + + + + + + + + + + + + + + + Represents a Bezier curve. + + + Represents segment from a PDF path. + + + Treat base points as the points which are enough to construct a shape. + + Treat base points as the points which are enough to construct a shape. + E.g. for a bezier curve they are control points, for a line segment - the start and the end points + of the segment. + + + Ordered + + consisting of shape's base points. + + + + + If the distance between a point and a line is less than + this constant, then we consider the point lies on the line. + + + + + In the case when neither the line ((x1, y1), (x4, y4)) passes + through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we + use the square of the sum of the distances mentioned below in + compare to this field as the criterion of good approximation. + + + In the case when neither the line ((x1, y1), (x4, y4)) passes + through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we + use the square of the sum of the distances mentioned below in + compare to this field as the criterion of good approximation. + 1. The distance between the line and (x2, y2) + 2. The distance between the line and (x3, y3) + + + + + The Manhattan distance is used in the case when either the line + ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) + or (x1, y1) = (x4, y4). + + + The Manhattan distance is used in the case when either the line + ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) + or (x1, y1) = (x4, y4). The essential observation is that when + the curve is a uniform speed straight line from end to end, the + control points are evenly spaced from beginning to end. Our measure + of how far we deviate from that ideal uses distance of the middle + controls: point 2 should be halfway between points 1 and 3; point 3 + should be halfway between points 2 and 4. + + + + Constructs new bezier curve. + Curve's control points. + + + + + + + You can adjust precision of the approximation by varying the following + parameters: + + , + + , + + + + + + containing points of piecewise linear approximation + for this bezier curve. + + + + Represents a line. + + + Constructs a new zero-length line starting at zero. + + + Constructs a new line based on the given coordinates. + + + Constructs a new line based on the given coordinates. + + + Represents a line segment in a particular coordinate system. + Represents a line segment in a particular coordinate system. This class is immutable. + + + Start vector of the segment. + + + End vector of the segment. + + + Creates a new line segment. + the start point of a line segment. + the end point of a line segment. + + + the start point + + + the end point + + + the length of this line segment + + + Computes the bounding rectangle for this line segment. + + Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees + with respect to the coordinate system that the line system is in. For example, if a line segment + is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have + origin of the lower left hand end point of the segment, with width = 4 and height = 3. + + the bounding rectangle + + + Computes the bounding rectangle for this line segment. + + Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees + with respect to the coordinate system that the line system is in. For example, if a line segment + is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have + origin of the lower left hand end point of the segment, with width = 4 and height = 3. + + the bounding rectangle + + + Transforms the segment by the specified matrix + the matrix for the transformation + the transformed segment + + + Checks if a segment contains another segment in itself + a segment to be checked + true if this segment contains other one, false otherwise + + + Checks if a segment contains a given point in itself + a point to be checked + true if this segment contains given point, false otherwise + + + + Keeps all the values of a 3 by 3 matrix and allows you to + do some math with matrices. + + + + the row=1, col=1 position ('a') in the matrix. + + + the row=1, col=2 position ('b') in the matrix. + + + the row=1, col=3 position (always 0 for 2-D) in the matrix. + + + the row=2, col=1 position ('c') in the matrix. + + + the row=2, col=2 position ('d') in the matrix. + + + the row=2, col=3 position (always 0 for 2-D) in the matrix. + + + the row=3, col=1 ('e', or X translation) position in the matrix. + + + the row=3, col=2 ('f', or Y translation) position in the matrix. + + + the row=3, col=3 position (always 1 for 2-D) in the matrix. + + + + constructs a new Matrix with identity. + + + Constructs a matrix that represents translation + + + + + Creates a Matrix with 6 specified entries + + + + + + + + + + + multiplies this matrix by 'b' and returns the result + See http://en.wikipedia.org/wiki/Matrix_multiplication + + The matrix to multiply by + the resulting matrix + + + Subtracts a matrix from this matrix and returns the results + the matrix to subtract from this matrix + a Matrix object + + + Computes the determinant of the matrix. + the determinant of the matrix + + + Checks equality of matrices. + the other Matrix that needs to be compared with this matrix. + true if both matrices are equal + + + + Generates a hash code for this object. + the hash code of this object + + + + Generates a String representation of the matrix. + the values, delimited with tabs and newlines. + + + + NoninvertibleTransformException + Denis M. Kishenko + + + Creates a new NoninvertibleTransformException. + the detail message. + + + Calculates the common rectangle which includes all the input rectangles. + list of input rectangles. + common rectangle. + + + Sets the rectangle by the coordinates, specifying its lower left and upper right points. + + Sets the rectangle by the coordinates, specifying its lower left and upper right points. May be used in chain. +
+
+ Note: this method will normalize coordinates, so the rectangle will have non negative width and height, + and its x and y coordinates specified lower left point. +
+ the X coordinate of lower left point + the Y coordinate of lower left point + the X coordinate of upper right point + the Y coordinate of upper right point + + this + + instance. + +
+ + Gets the X coordinate of lower left point. + the X coordinate of lower left point. + + + Sets the X coordinate of lower left point. + Sets the X coordinate of lower left point. May be used in chain. + the X coordinate of lower left point to be set. + + this + + instance. + + + + Gets the Y coordinate of lower left point. + the Y coordinate of lower left point. + + + Sets the Y coordinate of lower left point. + Sets the Y coordinate of lower left point. May be used in chain. + the Y coordinate of lower left point to be set. + + this + + instance. + + + + Gets the width of rectangle. + the width of rectangle. + + + Sets the width of rectangle. + Sets the width of rectangle. May be used in chain. + the the width of rectangle to be set. + + this + + instance. + + + + Gets the height of rectangle. + the height of rectangle. + + + Sets the height of rectangle. + Sets the height of rectangle. May be used in chain. + the the width of rectangle to be set. + + this + + instance. + + + + Increases the height of rectangle by the given value. + Increases the height of rectangle by the given value. May be used in chain. + the value of the extra height to be added. + + this + + instance. + + + + Decreases the height of rectangle by the given value. + Decreases the height of rectangle by the given value. May be used in chain. + the value of the extra height to be subtracted. + + this + + instance. + + + + Gets the X coordinate of the left edge of the rectangle. + + Gets the X coordinate of the left edge of the rectangle. Same as: + getX() + . + + the X coordinate of the left edge of the rectangle. + + + Gets the X coordinate of the right edge of the rectangle. + + Gets the X coordinate of the right edge of the rectangle. Same as: + getX() + getWidth() + . + + the X coordinate of the right edge of the rectangle. + + + Gets the Y coordinate of the upper edge of the rectangle. + + Gets the Y coordinate of the upper edge of the rectangle. Same as: + getY() + getHeight() + . + + the Y coordinate of the upper edge of the rectangle. + + + Gets the Y coordinate of the lower edge of the rectangle. + + Gets the Y coordinate of the lower edge of the rectangle. Same as: + getY() + . + + the Y coordinate of the lower edge of the rectangle. + + + Gets the copy of this rectangle. + the copied rectangle. + + + Rotates PageSize clockwise. + + + Paths define shapes, trajectories, and regions of all sorts. + + Paths define shapes, trajectories, and regions of all sorts. They shall be used + to draw lines, define the shapes of filled areas, and specify boundaries for clipping + other graphics. A path shall be composed of straight and curved line segments, which + may connect to one another or may be disconnected. + + + + + A + + of subpaths forming this path. + + + + Adds the subpath to this path. + The subpath to be added to this path. + + + Adds the subpaths to this path. + + + + of subpaths to be added to this path. + + + + The current point is the trailing endpoint of the segment most recently added to the current path. + + The current point. + + + Begins a new subpath by moving the current point to coordinates (x, y). + + + Appends a straight line segment from the current point to the point (x, y). + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3). + + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3) with the note that the current + point represents two control points. + + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3) with the note that the (x3, y3) + point represents two control points. + + + + Appends a rectangle to the current path as a complete subpath. + + + Appends a rectangle to the current path as a complete subpath. + + + Closes the current subpath. + + + Closes all subpathes contained in this path. + + + Adds additional line to each closed subpath and makes the subpath unclosed. + + Adds additional line to each closed subpath and makes the subpath unclosed. + The line connects the last and the first points of the subpaths. + + Indices of modified subpaths. + + + Path is empty if it contains no subpaths. + + + As subpath is a part of a path comprising a sequence of connected segments. + + + Creates a new SubPath instance. + + + Copy constuctor. + + + + Constructs a new subpath starting at the given point. + + + Constructs a new subpath starting at the given point. + + + Sets the start point of the subpath. + + + + Sets the start point of the subpath. + + + + + The point this subpath starts at. + + + The last point of the subpath. + + + Adds a segment to the subpath. + + Adds a segment to the subpath. + Note: each new segment shall start at the end of the previous segment. + + new segment. + + + + + + comprising all the segments + the subpath made on. + + + + Checks whether subpath is empty or not. + true if the subpath is empty, false otherwise. + + + + true if this subpath contains only one point and it is not closed, + false otherwise + + + + + true if this subpath contains only one point and it is closed, + false otherwise + + + + Returns a boolean value indicating whether the subpath must be closed or not. + + Returns a boolean value indicating whether the subpath must be closed or not. + Ignore this value if the subpath is a rectangle because in this case it is already closed + (of course if you paint the path using re operator) + + boolean value indicating whether the path must be closed or not. + + + + See + + + + + Returns a boolean indicating whether the subpath is degenerate or not. + + Returns a boolean indicating whether the subpath is degenerate or not. + A degenerate subpath is the subpath consisting of a single-point closed path or of + two or more points at the same coordinates. + + boolean value indicating whether the path is degenerate or not. + + + + + + containing points of piecewise linear approximation + for this subpath. + + + + Represents a vector (i.e. + + Represents a vector (i.e. a point in space). This class is completely + unrelated to the + + class in the standard JRE. +

+ For many PDF related operations, the z coordinate is specified as 1 + This is to support the coordinate transformation calculations. If it + helps, just think of all PDF drawing operations as occurring in a single plane + with z=1. +
+
+ + index of the X coordinate + + + index of the Y coordinate + + + index of the Z coordinate + + + the values inside the vector + + + Creates a new Vector + the X coordinate + the Y coordinate + the Z coordinate + + + Gets the value from a coordinate of the vector + the index of the value to get (I1, I2 or I3) + a coordinate value + + + Computes the cross product of this vector and the specified matrix + the matrix to cross this vector with + the result of the cross product + + + Computes the difference between this vector and the specified vector + the vector to subtract from this one + the results of the subtraction + + + Computes the cross product of this vector and the specified vector + the vector to cross this vector with + the cross product + + + Normalizes the vector (i.e. + Normalizes the vector (i.e. returns the unit vector in the same orientation as this vector) + the unit vector + + + Multiplies the vector by a scalar + the scalar to multiply by + the result of the scalar multiplication + + + Computes the dot product of this vector with the specified vector + the vector to dot product this vector with + the dot product + + + + Computes the length of this vector +
+ Note: If you are working with raw vectors from PDF, be careful - + the Z axis will generally be set to 1. +
+ + Computes the length of this vector +
+ Note: If you are working with raw vectors from PDF, be careful - + the Z axis will generally be set to 1. If you want to compute the + length of a vector, subtract it from the origin first (this will set + the Z axis to 0). +
+ For example: + aVector.subtract(originVector).length(); +
+ the length of this vector +
+ + Computes the length squared of this vector. + + Computes the length squared of this vector. +

+ The square of the length is less expensive to compute, and is often + useful without taking the square root. +

+ Note: See the important note under + + + the square of the length of the vector + + + + + +

Calculates the hashcode using the values. +
+ + + + + + IMPORTANT: USE THIS METHOD CAREFULLY. + This method serves as replacement for the java method MessageDigest#digest(byte[] buf, int offset, int len). + However for now, we simply omit len parameter, because it doesn't affect anything for all current usages + (there are two of them at the moment of the method addition which are in StandardHandlerUsingAes256 class). + This may be not true for future possible usages, so be aware. + + + + + Gets a Counter instance for a specific class. + + + This method gets triggered if a document is read. + the length of the document that was read + + + This method gets triggered if a document is written. + the length of the document that was written + + + + The singleton instance. + + + The current counter implementation. + + + The empty constructor. + + + Returns the singleton instance of the factory. + + + Returns a counter factory. + + + Getter for the counter. + + + Setter for the counter. + + + Default implementation of the Counter interface that essentially doesn't do anything. + + + Implementation of the Counter interface that doesn't do anything. + + + + A + + implementation that outputs information about read and written documents to + + + + + + The name of the class for which the Counter was created + (or iText if no name is available) + + + + This is a general class for alphabet numbering. + + This is a general class for alphabet numbering. + You can specify an alphabet and convert an integer into the corresponding + alphabet number representation. + E.g.: if the alphabet is English letters 'a' to 'z', then + 1 is represented as "a", ..., 26 is represented as "z", + 27 is represented as "aa" and so on. + + + + + Translates a positive integer (not equal to zero) + into an alphabet number using the letters from the specified alphabet. + + the number + the array containing all possible letters from the alphabet + a translated number representation + + + + This class is responsible for converting integer numbers to their + English alphabet letter representations. + + + + Converts the given number to its English alphabet lowercase string representation. + + Converts the given number to its English alphabet lowercase string representation. + E.g. 1 will be converted to "a", 2 to "b", ..., 27 to "aa", and so on. + + the number to be converted + + + Converts the given number to its English alphabet lowercase string representation. + + Converts the given number to its English alphabet lowercase string representation. + E.g. 1 will be converted to "A", 2 to "B", ..., 27 to "AA", and so on. + + the number to be converted + + + Converts the given number to its English alphabet string representation. + + Converts the given number to its English alphabet string representation. + E.g. for upperCase set to false, + 1 will be converted to "a", 2 to "b", ..., 27 to "aa", and so on. + + the number to be converted + whether to use uppercase or lowercase alphabet + + + + This class is responsible for converting integer numbers to their + Greek alphabet letter representations. + + + This class is responsible for converting integer numbers to their + Greek alphabet letter representations. + We are aware of the fact that the original Greek numbering is different. + See http://www.cogsci.indiana.edu/farg/harry/lan/grknum.htm#ancient + but this isn't implemented yet; the main reason being the fact that we + need a font that has the obsolete Greek characters qoppa and sampi. + So we use standard 24 letter Greek alphabet + + + + Converts the given number to its Greek alphabet lowercase string representation. + + Converts the given number to its Greek alphabet lowercase string representation. + E.g. 1 will be converted to "?", 2 to "?", and so on. + + the number to be converted + + + Converts the given number to its Greek alphabet lowercase string representation. + + Converts the given number to its Greek alphabet lowercase string representation. + E.g. 1 will be converted to "A", 2 to "B", and so on. + + the number to be converted + + + Converts the given number to its Greek alphabet string representation. + + Converts the given number to its Greek alphabet string representation. + E.g. for upperCase set to false, + 1 will be converted to "?", 2 to "?", and so on. + + the number to be converted + whether to use uppercase or lowercase alphabet + + + Converts a given greek unicode character code into the code of the corresponding char Symbol font. + + original unicode char + the corresponding symbol code in Symbol standard font + + + This class can produce String combinations representing a roman number. + + This class can produce String combinations representing a roman number. + The first roman numbers are: I, II, III, IV, V, VI, VII, VIII, IX, X + See http://en.wikipedia.org/wiki/Roman_numerals + + + + Array with Roman digits. + + + Returns a lower case roman representation of an integer. + a number to be converted to roman notation. + + + Returns an upper case roman representation of an integer. + a number to be converted to roman notation. + + + Returns a roman representation of an integer. + a number to be converted to roman notation. + + true for upper case representation, + false for lower case one. + + + + Returns a roman representation of an integer. + the original number + the roman number representation (lower case) + + + Helper class for Roman Digits + + + part of a roman number + + + value of the roman digit + + + can the digit be used as a prefix + + + Constructs a roman digit + the roman digit + the value + can it be used as a prefix + + + A wrapper for action dictionaries (ISO 32000-1 section 12.6). + + A wrapper for action dictionaries (ISO 32000-1 section 12.6). + An action dictionary defines the characteristics and behaviour of an action. + + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + Constructs an empty action that can be further modified. + + + + Constructs a + + instance with a given dictionary. It can be used for handy + property reading in reading mode or modifying in stamping mode. + + the dictionary to construct the wrapper around + + + Creates a GoTo action (section 12.6.4.2 of ISO 32000-1) via a given destination. + the desired destination of the action + created action + + + + Creates a GoTo action (section 12.6.4.2 of ISO 32000-1) via a given + + name. + + + + + name + + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the file in which the destination shall be located + the destination in the remote document to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the file in which the destination shall be located + the destination in the remote document to jump to + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the remote destination document page to jump to + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the remote destination document page to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the string destination in the remote document to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the string destination in the remote document to jump to + created action + + + Creates a GoToE action, or embedded file action (section 12.6.4.4 of ISO 32000-1). + the destination in the target to jump to + + if true, the destination document should be opened in a new window; + if false, the destination document should replace the current document in the same window + + + A target dictionary specifying path information to the target document. + Each target dictionary specifies one element in the full path to the target and + may have nested target dictionaries specifying additional elements + + created action + + + Creates a GoToE action, or embedded file action (section 12.6.4.4 of ISO 32000-1). + The root document of the target relative to the root document of the source + the destination in the target to jump to + + if true, the destination document should be opened in a new window; + if false, the destination document should replace the current document in the same window + + + A target dictionary specifying path information to the target document. + Each target dictionary specifies one element in the full path to the target and + may have nested target dictionaries specifying additional elements + + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + a flag specifying whether to open the destination document in a new window + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + A dictionary containing Windows-specific launch parameters + a flag specifying whether to open the destination document in a new window + created action + + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + A thread action jumps to a specified bead on an article thread (see 12.4.3, “Articles”), + in either the current document or a different one. Table 205 shows the action dictionary + entries specific to this type of action. + + the file containing the thread. If this entry is absent, the thread is in the current file + + the destination thread + the bead in the destination thread + created action + + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + A thread action jumps to a specified bead on an article thread (see 12.4.3, “Articles”), + in either the current document or a different one. Table 205 shows the action dictionary + entries specific to this type of action. + + the file containing the thread. If this entry is absent, the thread is in the current file + + created action + + + Creates a URI action (section 12.6.4.7 of ISO 32000-1). + the uniform resource identifier to resolve + created action + + + Creates a URI action (section 12.6.4.7 of ISO 32000-1). + the uniform resource identifier to resolve + a flag specifying whether to track the mouse position when the URI is resolved + created action + + + Creates a Sound action (section 12.6.4.8 of ISO 32000-1). + a sound object defining the sound that shall be played (see section 13.3 of ISO 32000-1) + + created action + + + Creates a Sound action (section 12.6.4.8 of ISO 32000-1). + a sound object defining the sound that shall be played (see section 13.3 of ISO 32000-1) + + the volume at which to play the sound, in the range -1.0 to 1.0. Default value: 1.0 + + a flag specifying whether to play the sound synchronously or asynchronously. + If this flag is true, the conforming reader retains control, allowing no further user + interaction other than canceling the sound, until the sound has been completely played. + Default value: false + + + a flag specifying whether to repeat the sound indefinitely + If this entry is present, the Synchronous entry shall be ignored. Default value: false + + a flag specifying whether to mix this sound with any other sound already playing + created action + + + Creates a Movie annotation (section 12.6.4.9 of ISO 32000-1). + a movie annotation identifying the movie that shall be played + the title of a movie annotation identifying the movie that shall be played + + the operation that shall be performed on the movie. Shall be one of the following: + + , + + , + + , + + + created annotation + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + the annotation to be hidden or shown + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + the annotations to be hidden or shown + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + + a text string giving the fully qualified field name of an interactive form field whose + associated widget annotation or annotations are to be affected + + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + + a text string array giving the fully qualified field names of interactive form fields whose + associated widget annotation or annotations are to be affected + + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Named action (section 12.6.4.11 of ISO 32000-1). + + the name of the action that shall be performed. Shall be one of the following: + + , + + , + + , + + + created action + + + Creates a Set-OCG-State action (section 12.6.4.12 of ISO 32000-1). + + a list of + + state descriptions + + created action + + + Creates a Set-OCG-State action (section 12.6.4.12 of ISO 32000-1). + + states a list of + + state descriptions + + + If true, indicates that radio-button state relationships between optional content groups + should be preserved when the states are applied + + created action + + + Creates a Rendition action (section 12.6.4.13 of ISO 32000-1). + the name of the media clip, for use in the user interface. + a full file specification or form XObject that specifies the actual media data + an ASCII string identifying the type of data + a screen annotation + created action + + + Creates a JavaScript action (section 12.6.4.16 of ISO 32000-1). + a text string containing the JavaScript script to be executed. + created action + + + Creates a Submit-Form Action (section 12.7.5.2 of ISO 32000-1). + a uniform resource locator, as described in 7.11.5, "URL Specifications" + + an array identifying which fields to include in the submission or which to exclude, + depending on the setting of the Include/Exclude flag in the Flags entry. + This is an optional parameter and can be null + + + a set of flags specifying various characteristics of the action (see Table 237 of ISO 32000-1). + Default value to be passed: 0. + + created action + + + Creates a Reset-Form Action (section 12.7.5.3 of ISO 32000-1). + + an array identifying which fields to reset or which to exclude from resetting, + depending on the setting of the Include/Exclude flag in the Flags entry (see Table 239 of ISO 32000-1). + + + a set of flags specifying various characteristics of the action (see Table 239 of ISO 32000-1). + Default value to be passed: 0. + + created action + + + + Adds a chained action. + the next action or sequence of actions that shall be performed after the current action + + + + + Inserts the value into the underlying object of this + + and associates it with the specified key. + If the key is already present in this + + , this method will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + + this + + instance + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + This is a helper class for optional content states use in Set-OCG-State actions. + + This is a helper class for optional content states use in Set-OCG-State actions. + See + + . + + + + + Can be: + + , + + , + + + + + Optional content group dictionaries + + + Constructs an optional content state object. + + a + + describing the state. Shall be one of the following: + + , + + , + + + a list of the OCG dictionaries + + + Gets the state the optional content groups should be switched to + + the state, one of the following: + + , + + , + + + + + Gets a list of optional content groups that shall have the state changed + the list of optional content groups + + + + Gets a list of + + that is describing this particular optional content group states. + + + a list of + + for construction of a + + + + + This class is a wrapper of media clip data dictionary that defines the data for a media object that can be played. + + + + + Constructs a new + + wrapper using an existing dictionary. + + the dictionary to construct the wrapper from + + + + Constructs a new + + wrapper around a newly created dictionary. + + the name of the file to create a media clip for + a file specification that specifies the actual media data + an ASCII string identifying the type of data + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + This a wrapper around a rendition dictionary. + This a wrapper around a rendition dictionary. See ISO 32000-1 sections 13.2.3.2, 13.2.3.3. + + + + Creates a new wrapper around an existing + + + a rendition object to create a wrapper for + + + Creates a new wrapper around a newly created media rendition dictionary object. + a text string specifying the name of the file to display + a file specification that specifies the actual media data + an ASCII string identifying the type of data + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + + A target dictionary locates the target in relation to the source, + in much the same way that a relative path describes the physical + relationship between two files in a file system. + + + A target dictionary locates the target in relation to the source, + in much the same way that a relative path describes the physical + relationship between two files in a file system. Target dictionaries may be + nested recursively to specify one or more intermediate targets before reaching the final one. + + + + + Creates a new + + object by the underlying dictionary. + + the underlying dictionary object + + + + Creates a new + + object given its type. The type must be either + + , or + + . If it is + + , additional entries must be specified + according to the spec. + + the relationship between the current document and the target + + + + Creates a new + + object. + + the relationship between the current document and the target + the name of the file in the EmbeddedFiles name tree + + if the value is an integer, it specifies the page number (zero-based) in the current + document containing the file attachment annotation. If the value is a string, + it specifies a named destination in the current document that provides the page + number of the file attachment annotation + + + If the value is an integer, it specifies the index (zero-based) of the annotation in the + Annots array of the page specified by P. If the value is a text string, + it specifies the value of NM in the annotation dictionary + + + A target dictionary specifying additional path information to the target document. + If this entry is absent, the current document is the target file containing the destination + + + + Creates a new target object pointing to the parent of the current document. + + created + + + + + Creates a new target object pointing to a file in the EmbeddedFiles name tree. + the name of the file in the EmbeddedFiles name tree + created object + + + Creates a new target object pointing to a file attachment annotation. + + a named destination in the current document that + provides the page number of the file attachment annotation + + + a unique annotation identifier ( + + entry) of the annotation + + created object + + + Creates a new target object pointing to a file attachment annotation. + the number of the page in the current document, one-based + the index of the annotation in the Annots entry of the page, zero-based + created object + + + + Sets the name of the file in the EmbeddedFiles name tree for the child target located + in the EmbeddedFiles. + + the name of the file + this object wrapper + + + + Gets name of the file in the EmbeddedFiles name tree for the child target located + in the EmbeddedFiles. + + the name of the child file for this target + + + + Sets the page number in the current document containing the file attachment annotation for the + child target associates with a file attachment annotation. + + + the page number (one-based) in the current document containing + the file attachment annotation + + this object wrapper + + + + Sets a named destination in the current document that provides the page number of the file + attachment annotation for the child target associated with a file attachment annotation. + + + a named destination in the current document that provides the page + number of the file attachment annotation + + this object wrapper + + + Get the contents of the /P entry of this target object. + + Get the contents of the /P entry of this target object. + If the value is an integer, it specifies the page number (zero-based) + in the current document containing the file attachment annotation. + If the value is a string, it specifies a named destination in the current + document that provides the page number of the file attachment annotation. + + the /P entry of target object + + + + Sets the index of the annotation in Annots array of the page specified by /P entry + for the child target associated with a file attachment annotation. + + the index (zero-based) of the annotation in the Annots array + this object wrapper + + + + Sets the text value, which uniquely identifies an annotation (/NM entry) in an annotation dictionary + for the child target associated with a file attachment annotation. + + specifies the value of NM in the annotation dictionary of the target annotation + + this object wrapper + + + Gets the object in the /A entry of the underlying object. + + Gets the object in the /A entry of the underlying object. If the value is an integer, + it specifies the index (zero-based) of the annotation in the Annots array of the page specified by P. + If the value is a text string, it specifies the value of NM in the annotation dictionary. + + the /A entry in the target object + + + Sets a target dictionary specifying additional path information to the target document. + + Sets a target dictionary specifying additional path information to the target document. + If this entry is absent, the current document is the target file containing the destination. + + the additional path target dictionary + this object wrapper + + + Get a target dictionary specifying additional path information to the target document. + + Get a target dictionary specifying additional path information to the target document. + If the current target object is the final node in the target path, null is returned. + + a target dictionary specifying additional path information to the target document + + + + This is a convenient method to put key-value pairs to the underlying + + . + + + the key, a + + instance + + the value + this object wrapper + + + + + + This class is a wrapper around a Windows launch parameter dictionary. + + + Creates a new wrapper around an existing Windows launch parameter dictionary. + the dictionary to create a wrapper for + + + Creates a new wrapper around a newly created Windows launch parameter dictionary. + + the file name of the application that shall be launched or the document that shall be opened or printed, + in standard Windows pathname format. If the name string includes a backslash character (\), + the backslash shall itself be preceded by a backslash. + + + + Creates a new wrapper around a newly created Windows launch parameter dictionary. + + the file name of the application that shall be launched or the document that shall be opened or printed, + in standard Windows pathname format. If the name string includes a backslash character (\), + the backslash shall itself be preceded by a backslash + + a bye string specifying the default directory in standard DOS syntax + + an ASCII string specifying the operation to perform on the file. Shall be one of the following: + "open", "print" + + + a parameter string that shall be passed to the application. + This entry shall be omitted if a document is abound to be opened + + + + + + + This is a super class for the annotation dictionary wrappers. + + This is a super class for the annotation dictionary wrappers. Derived classes represent + different standard types of annotations. See ISO-320001 12.5.6, “Annotation Types.” + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state model. + + Annotation state model. See ISO-320001, Table 172 (StateModel key). + Also see + + . + + + + Annotation state model. + + Annotation state model. See ISO-320001, Table 172 (StateModel key). + Also see + + . + + + + + Factory method that creates the type specific + + from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. See derived classes of this class to see possible specific annotation types + created. + + + a + + that represents annotation in the document. + + + created + + . + + + + + Factory method that creates the type specific + + from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. + + + a + + that represents annotation in the document. + + + parent annotation of the + + to be created. This parameter is + only needed if passed + + represents a pop-up annotation in the document. + + + created + + . + + + + + Gets a + + which value is a subtype of this annotation. + See ISO-320001 12.5.6, “Annotation Types” for the reference to the possible types. + + subtype of this annotation. + + + Sets the layer this annotation belongs to. + the layer this annotation belongs to + + + + Sets a + + to this annotation which will be performed when the annotation is activated. + + + + + to set to this annotation. + + + this + + instance. + + + + + Sets an additional + + to this annotation which will be performed in response to + the specific trigger event defined by + + . See ISO-320001 12.6.3, "Trigger Events". + + + a + + that denotes a type of the additional action to set. + + + + + to set as additional to this annotation. + + + this + + instance. + + + + + Gets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + annotation text content. + + + + Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + + a + + containing text content to be set to the annotation. + + + this + + instance. + + + + + Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + + a java + + containing text content to be set to the annotation. + + + this + + instance. + + + + + Gets a + + that represents a page of the document on which annotation is placed, + i.e. which has this annotation in it's /Annots array. + + + + + that is a page pdf object or null if annotation is not added to the page yet. + + + + + Gets a + + on which annotation is placed. + + + + + on which annotation is placed or null if annotation is not placed yet. + + + + Method that modifies annotation page property, which defines to which page annotation belongs. + + Method that modifies annotation page property, which defines to which page annotation belongs. + Keep in mind that this doesn't actually add an annotation to the page, + it should be done via + + . + Also you don't need to set this property manually, this is done automatically on addition to the page. + + + the + + to which annotation will be added. + + + this + + instance. + + + + + Gets the annotation name, a text string uniquely identifying it among all the + annotations on its page. + + + a + + with annotation name as it's value or null if name + is not specified. + + + + + Sets the annotation name, a text string uniquely identifying it among all the + annotations on its page. + + + a + + to be set as annotation name. + + + this + + instance. + + + + The date and time when the annotation was most recently modified. + + The date and time when the annotation was most recently modified. + This is an optional property of the annotation. + + + a + + with the modification date as it's value or null if date is not specified. + + + + The date and time when the annotation was most recently modified. + + a + + with date. The format should be a date string as described + in ISO-320001 7.9.4, “Dates”. + + + this + + instance. + + + + A set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + + + A set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + For specific annotation flag constants see + + . + Default value: 0. + + an integer interpreted as one-bit flags specifying various characteristics of the annotation. + + + Sets a set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + + + Sets a set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + On the contrary from + + , this method sets a complete set of enabled and disabled flags at once. + If not set specifically the default value is 0. + + an integer interpreted as set of one-bit flags specifying various characteristics of the annotation. + + + this + + instance. + + + + Sets a flag that specifies a characteristic of the annotation to enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + + Sets a flag that specifies a characteristic of the annotation to enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + On the contrary from + + , this method sets only specified flags to enabled state, + but doesn't disable other flags. + Possible flags: +
    +
  • + + - If set, do not display the annotation if it does not belong to one of the + standard annotation types and no annotation handler is available. If clear, display such unknown annotation + using an appearance stream specified by its appearance dictionary, if any. +
  • +
  • + + - If set, do not display or print the annotation or allow it to interact with + the user, regardless of its annotation type or whether an annotation handler is available. +
  • +
  • + + - If set, print the annotation when the page is printed. If clear, never print + the annotation, regardless of whether it is displayed on the screen. +
  • +
  • + + - If set, do not scale the annotation’s appearance to match the magnification of + the page. The location of the annotation on the page (defined by the upper-left corner of its annotation + rectangle) shall remain fixed, regardless of the page magnification.} +
  • +
  • + + - If set, do not rotate the annotation’s appearance to match the rotation + of the page. The upper-left corner of the annotation rectangle shall remain in a fixed location on the page, + regardless of the page rotation. +
  • +
  • + + - If set, do not display the annotation on the screen or allow it to interact + with the user. The annotation may be printed (depending on the setting of the Print flag) but should be considered + hidden for purposes of on-screen display and user interaction. +
  • +
  • + + - If set, do not allow the annotation to interact with the user. The annotation + may be displayed or printed (depending on the settings of the NoView and Print flags) but should not respond to mouse + clicks or change its appearance in response to mouse motions. +
  • +
  • + + - If set, do not allow the annotation to be deleted or its properties + (including position and size) to be modified by the user. However, this flag does not restrict changes to + the annotation’s contents, such as the value of a form field. +
  • +
  • + + - If set, invert the interpretation of the NoView flag for certain events. +
  • +
  • + + - If set, do not allow the contents of the annotation to be modified + by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, + such as position and size. +
  • +
+
+ - an integer interpreted as set of one-bit flags which will be enabled for this annotation. + + + this + + instance. + +
+ + Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + an integer interpreted as set of one-bit flags which will be reset to disabled state. + + this + + instance. + + + + + Checks if the certain flag that specifies a characteristic of the annotation + is in enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + + Checks if the certain flag that specifies a characteristic of the annotation + is in enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + This method allows only one flag to be checked at once, use constants listed in + + . + + + an integer interpreted as set of one-bit flags. Only one bit must be set in this integer, otherwise + exception is thrown. + + true if the given flag is in enabled state. + + + + An appearance dictionary specifying how the annotation shall be presented visually on the page during its + interactions with the user (see ISO-320001 12.5.5, “Appearance Streams”). + + + An appearance dictionary specifying how the annotation shall be presented visually on the page during its + interactions with the user (see ISO-320001 12.5.5, “Appearance Streams”). An appearance dictionary is a dictionary + containing one or several appearance streams or subdictionaries. + + + an appearance + + or null if it is not specified. + + + + Specific appearance object corresponding to the specific appearance type. + + Specific appearance object corresponding to the specific appearance type. This object might be either an appearance + stream or an appearance subdictionary. In the latter case, the subdictionary defines multiple appearance streams + corresponding to different appearance states of the annotation. See ISO-320001 12.5.5, “Appearance Streams”. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + + null if their is no such appearance type or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + The normal appearance is used when the annotation is not interacting with the user. + + The normal appearance is used when the annotation is not interacting with the user. + This appearance is also used for printing the annotation. + See also + + . + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + + The rollover appearance is used when the user moves the cursor into the annotation’s active area + without pressing the mouse button. + + + The rollover appearance is used when the user moves the cursor into the annotation’s active area + without pressing the mouse button. If not specified normal appearance is used. + See also + + . + + + null if rollover appearance is not specified or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + The down appearance is used when the mouse button is pressed or held down within the annotation’s active area. + + + The down appearance is used when the mouse button is pressed or held down within the annotation’s active area. + If not specified normal appearance is used. + See also + + . + + + null if down appearance is not specified or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + Sets a specific type of the appearance. + + Sets a specific type of the appearance. See + + and + + for more info. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets normal appearance. + + Sets normal appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets rollover appearance. + + Sets rollover appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets down appearance. + + Sets down appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + + Sets a specific type of the appearance using + + wrapper. + This method is used to set only an appearance subdictionary. See + + and + + for more info. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets normal appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets rollover appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets down appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + The annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary if there is such. + + + The annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary if there is such. See + + for more info. + + + a + + which defines selected appearance state. + + + + + Sets the annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary. + + + Sets the annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary. See + + for more info. + + + a + + which defines appearance state to be selected. + + + this + + instance. + + + + + Sets the characteristics of the annotation’s border. + + an + + specifying the characteristics of the annotation’s border. + See + + for more detailes. + + + this + + instance. + + + + + An array of numbers in the range 0.0 to 1.0, representing a colour used for the following purposes: +
    +
  • The background of the annotation’s icon when closed
  • +
  • The title bar of the annotation’s pop-up window
  • +
  • The border of a link annotation
  • +
+ The number of array elements determines the colour space in which the colour shall be defined: +
    +
  • 0 - No colour; transparent
  • +
  • 1 - DeviceGray
  • +
  • 3 - DeviceRGB
  • +
  • 4 - DeviceCMYK
  • +
+
+ An array of numbers in the range 0.0 to 1.0, representing an annotation colour. +
+ + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes and the format + of the passing + + see + + . + + an array of numbers in the range 0.0 to 1.0, specifying color. + + this + + instance. + + + + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes and the format + of the passing array see + + . + + an array of numbers in the range 0.0 to 1.0, specifying color. + + this + + instance. + + + + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes + see + + . + + + + + object of the either + + , + + or + + type. + + + this + + instance. + + + + + The integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + + integer key in structural parent tree or -1 if annotation is not tagged. + + + + Sets he integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + + + Sets he integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + Note: Normally, there is no need to take care of this manually, struct parent index is set automatically + if annotation is added to the tagged document's page. + + + integer which is to be the key of the annotation's entry + in structural parent tree. + + + this + + instance. + + + + A flag specifying whether the annotation shall initially be displayed open. + + A flag specifying whether the annotation shall initially be displayed open. + This flag has affect to not all kinds of annotations. + + true if annotation is initially open, false - if closed. + + + Sets a flag specifying whether the annotation shall initially be displayed open. + + Sets a flag specifying whether the annotation shall initially be displayed open. + This flag has affect to not all kinds of annotations. + + true if annotation shall initially be open, false - if closed. + + this + + instance. + + + + + + + Sets border style dictionary that has more settings than the array specified for the Border entry ( + + ). + See ISO-320001, Table 166 and + + for more info. + + + a border style dictionary specifying the line width and dash pattern that shall be used + in drawing the annotation’s border. + + + this + + instance. + + + + Setter for the annotation's preset border style. + + Setter for the annotation's preset border style. Possible values are +
    +
  • + + - A solid rectangle surrounding the annotation.
  • +
  • + + - A dashed rectangle surrounding the annotation.
  • +
  • + + - A simulated embossed rectangle that appears to be raised above the surface of the page.
  • +
  • + + - A simulated engraved rectangle that appears to be recessed below the surface of the page.
  • +
  • + + - A single line along the bottom of the annotation rectangle.
  • +
+ See also ISO-320001, Table 166. +
+ The new value for the annotation's border style. + The annotation which this method was called on. + +
+ + Setter for the annotation's preset dashed border style. + + Setter for the annotation's preset dashed border style. This property has affect only if + + style was used for the annotation border style (see + + . + See ISO-320001 8.4.3.6, “Line Dash Pattern” for the format in which dash pattern shall be specified. + + + a dash array defining a pattern of dashes and gaps that + shall be used in drawing a dashed border. + + + this + + instance. + + + + The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. + + + The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. + That entry specifies a border style dictionary that has more settings than the array specified for the Border + entry (see + + ). If an annotation dictionary includes the BS entry, then the Border + entry is ignored. If annotation includes AP (see + + ) it takes + precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. + + + + + which is a border style dictionary or null if it is not specified. + + + + Sets annotation title. + Sets annotation title. This property affects not all annotation types. + + a + + which value is to be annotation title. + + + this + + instance. + + + + Annotation title. + + Annotation title. For example for markup annotations, the title is the text label that shall be displayed in the + title bar of the annotation’s pop-up window when open and active. For movie annotation Movie actions + (ISO-320001 12.6.4.9, “Movie Actions”) may use this title to reference the movie annotation. + + + + + which value is an annotation title or null if it isn't specifed. + + + + + Sets an appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. + + + Sets an appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. See ISO-320001, Table 189. + This property affects + + and + + . + + + the + + with additional information for appearance stream. + + + this + + instance. + + + + + An appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. + + + An appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. See ISO-320001, Table 189. + This property affects + + and + + . + + an appearance characteristics dictionary or null if it isn't specified. + + + + An + + to perform, such as launching an application, playing a sound, + changing an annotation’s appearance state etc, when the annotation is activated. + + + + + which defines the characteristics and behaviour of an action. + + + + An additional actions dictionary that extends the set of events that can trigger the execution of an action. + + + An additional actions dictionary that extends the set of events that can trigger the execution of an action. + See ISO-320001 12.6.3 Trigger Events. + + + an additional actions + + . + + + + + The annotation rectangle, defining the location of the annotation on the page in default user space units. + + + a + + which specifies a rectangle by two diagonally opposite corners. + Typically, the array is of form [llx lly urx ury]. + + + this + + instance. + + + + The annotation rectangle, defining the location of the annotation on the page in default user space units. + + + a + + which specifies a rectangle by two diagonally opposite corners. + Typically, the array is of form [llx lly urx ury]. + + + + + Inserts the value into into the underlying + + of this + + and associates it + with the specified key. If the key is already present in this + + , this method will override + the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + + this + + instance. + + + + + Removes the specified key from the underlying + + of this + + . + + key to be removed + + this + + instance. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This is a super class for the annotations which are defined as markup annotations + because they are used primarily to mark up PDF documents. + + + This is a super class for the annotations which are defined as markup annotations + because they are used primarily to mark up PDF documents. These annotations have + text that appears as part of the annotation and may be displayed in other ways + by a conforming reader, such as in a Comments pane. + See also ISO-320001 12.5.6.2 "Markup Annotations". + + + + + The text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. + + + The text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. This entry shall identify the user who added the annotation. + + + + + which value is an annotation text label content + or null if text is not specified. + + + + + Sets the text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. + + + Sets the text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. This entry shall identify the user who added the annotation. + + + + + which value is an annotation text label content. + + + this + + instance. + + + + The constant opacity value that will be used in painting the annotation. + + The constant opacity value that will be used in painting the annotation. + This value is applied to all visible elements of the annotation in its closed state + (including its background and border) but not to the pop-up window that appears when + the annotation is opened. Default value: 1.0. + + + a + + which value is in range between 0 and 1, which specifies the + level of opacity. This method returns null if opacity is not specified; in this case default + value is used, which is 1. + + + + Sets the constant opacity value that will be used in painting the annotation. + + a + + which value is in range between 0 and 1, which specifies the + level of opacity. + + + this + + instance. + + + + + + A rich text string (see ISO-320001 12.7.3.4, “Rich Text Strings”) that + shall be displayed in the pop-up window when the annotation is opened. + + + text string or text stream that specifies rich text or null if + rich text is not specified. + + + + + Sets a rich text string (see ISO-320001 12.7.3.4, “Rich Text Strings”) that + shall be displayed in the pop-up window when the annotation is opened. + + text string or text stream that specifies rich text. + + this + + instance. + + + + The date and time when the annotation was created. + + a + + which value should be in the date format specified in (ISO-320001 7.9.4, “Dates”). + + + + Sets the date and time when the annotation was created. + + + + which value should be in the date format + specified in (ISO-320001 7.9.4, “Dates”). + + + this + + instance. + + + + + An annotation object that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + An annotation object that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that represents an annotation that this annotation is “in reply to.” + + + + + An annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + An annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that this annotation is “in reply to.” + + + + + Sets an annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + Sets an annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that this annotation is “in reply to.” + + + this + + instance. + + + + Sets a pop-up annotation for entering or editing the text associated with this annotation. + + Sets a pop-up annotation for entering or editing the text associated with this annotation. + Pop-up annotation defines an associated with this annotation pop-up window that may contain text. + The Contents (see + + ) entry of the annotation that has + an associated popup specifies the text that shall be displayed when the pop-up window is opened. + + + an + + that will be associated with this annotation. + + + this + + instance. + + + + An associated pop-up annotation object. + + An associated pop-up annotation object. See + + for more info. + + + a + + that represents an associated pop-up annotation, + or null if popup annotation is not specified. + + + + An associated pop-up annotation for entering or editing the text associated with this annotation. + + + An associated pop-up annotation for entering or editing the text associated with this annotation. + Pop-up annotation defines an associated with this annotation pop-up window that may contain text. + The Contents (see + + ) entry of the annotation that has + an associated popup specifies the text that shall be displayed when the pop-up window is opened. + + + an + + that is associated with this annotation, or null if there is none. + + + + Text representing a short description of the subject being addressed by the annotation. + + a + + which value is a annotation subject. + + + + Sets the text representing a short description of the subject being addressed by the annotation. + + a + + which value is a annotation subject. + + + this + + instance. + + + + + A name specifying the relationship (the “reply type”) between this annotation and one specified by IRT entry + (see + + ). Valid values are: +
    +
  • + + - The annotation shall be considered a reply to the annotation specified by IRT. + Conforming readers shall not display replies to an annotation individually but together in the form of + threaded comments.
  • +
  • + + - The annotation shall be grouped with the annotation specified by IRT.
  • +
+
+ + a + + specifying relationship with the specified by the IRT entry; or null if reply + type is not specified, in this case the default value is + + . + +
+ + + Sets the relationship (the “reply type”) between this annotation and one specified by IRT entry + (see + + ). For valid values see + + . + + + a + + specifying relationship with the specified by the IRT entry. + + + this + + instance. + + + + A name describing the intent of the markup annotation. + + A name describing the intent of the markup annotation. + See + + for more info. + + + a + + describing the intent of the markup annotation, or null if not specified. + + + + Sets a name describing the intent of the markup annotation. + + Sets a name describing the intent of the markup annotation. + Intents allow conforming readers to distinguish between different uses and behaviors + of a single markup annotation type. If this entry is not present or its value is the same as the annotation type, + the annotation shall have no explicit intent and should behave in a generic manner in a conforming reader. +

+ See ISO-320001, free text annotations (Table 174), line annotations (Table 175), polygon annotations (Table 178), + and polyline annotations (Table 178) for the specific intent values for those types. +

+
+ + a + + describing the intent of the markup annotation. + + + this + + instance. + +
+ + An external data dictionary specifying data that shall be associated with the annotation. + + An external data dictionary specifying data that shall be associated with the annotation. + This dictionary contains the following entries: +
    +
  • + + - (optional) If present, shall be + + .
  • +
  • + + - (required) a name specifying the type of data that the markup annotation + shall be associated with. The only defined value is + + . Table 298 (ISO-320001) + lists the values that correspond to a subtype of Markup3D (See also + + ).
  • +
+
+ + An external data + + , or null if not specified. + +
+ + Sets an external data dictionary specifying data that shall be associated with the annotation. + + Sets an external data dictionary specifying data that shall be associated with the annotation. + This dictionary should contain the following entries: +
    +
  • + + - (optional) If present, shall be + + .
  • +
  • + + - (required) a name specifying the type of data that the markup annotation + shall be associated with. The only defined value is + + . Table 298 (ISO-320001) + lists the values that correspond to a subtype of Markup3D (See also + + ).
  • +
+
+ + this + + instance. + +
+ + + A set of four numbers describing the numerical differences between two rectangles: + the Rect entry of the annotation and another rectangle within that one, which + meaning depends on the type of the annotation: +
    +
  • for + + the inner rectangle is where the annotation's text should be displayed;
  • +
  • + for + + and + + the inner rectangle is the actual boundaries + of the underlying square or circle; +
  • +
  • for + + the inner rectangle is the actual boundaries of the underlying caret.
  • +
+
+ + a + + with four numbers which correspond to the differences in default user space between + the left, top, right, and bottom coordinates of Rect and those of the inner rectangle, respectively. + Each value shall be greater than or equal to 0. The sum of the top and bottom differences shall be + less than the height of Rect, and the sum of the left and right differences shall be less than + the width of Rect. + + + this + + instance. + +
+ + + A set of four numbers describing the numerical differences between two rectangles: + the Rect entry of the annotation and another rectangle within that one, which + meaning depends on the type of the annotation (see + + ). + + + null if not specified, otherwise a + + with four numbers which correspond to the + differences in default user space between the left, top, right, and bottom coordinates of Rect and those + of the inner rectangle, respectively. + + + + + Some annotations types ( + + , + + , + + and + + ) may have a + + entry, which is a border effect dictionary that specifies + an effect that shall be applied to the border of the annotations. + + + a + + which contents shall be specified in accordance to ISO-320001, Table 167. + + + this + + instance. + + + + A border effect dictionary that specifies an effect that shall be applied to the border of the annotations. + + + a + + , which is a border effect dictionary (see ISO-320001, Table 167). + + + + The interior color which is used to fill areas specific for different types of annotation. + + The interior color which is used to fill areas specific for different types of annotation. For + + and polyline annotation ( + + - the annotation's line endings, for + + and + + - the annotation's rectangle or ellipse, for + + - the redacted + region after the affected content has been removed. + + + + + of either + + , + + or + + type which defines + interior color of the annotation, or null if interior color is not specified. + + + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. For + + and polyline annotation ( + + - + the annotation's line endings, for + + and + + - the annotation's + rectangle or ellipse, for + + - the redacted region after the affected content has been removed. + + + a + + of numbers in the range 0.0 to 1.0. The number of array elements determines + the colour space in which the colour is defined: 0 - No colour, transparent; 1 - DeviceGray, + 3 - DeviceRGB, 4 - DeviceCMYK. For the + + number of elements shall be + equal to 3 (which defines DeviceRGB colour space). + + + this + + instance. + + + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. See + + for more info. + + an array of floats in the range 0.0 to 1.0. + + this + + instance. + + + + The name of an icon that is used in displaying the annotation. + + The name of an icon that is used in displaying the annotation. Possible values are different for different + annotation types. See + + . + + + a + + that specifies the icon for displaying annotation, or null if icon name is not specified. + + + + The name of an icon that is used in displaying the annotation. + + a + + that specifies the icon for displaying annotation. Possible values are different + for different annotation types: +
    +
  • + + - Comment, Key, Note, Help, NewParagraph, Paragraph, Insert;
  • +
  • + + - Approved, Experimental, NotApproved, AsIs, Expired, NotForPublicRelease, + Confidential, Final, Sold, Departmental, ForComment, TopSecret, Draft, ForPublicRelease.
  • +
  • + + - GraphPushPin, PaperclipTag. Additional names may be supported as well.
  • +
  • + + - Speaker and Mic. Additional names may be supported as well.
  • +
+ + + this + + instance. + +
+ + The default appearance string that shall be used in formatting the text. + The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, “Variable Text”. + + + a + + that specifies the default appearance. + + + this + + instance. + + + + The default appearance string that shall be used in formatting the text. + The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, “Variable Text”. + + + a + + that specifies the default appearance, or null if default appereance is not specified. + + + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified). + + a code specifying the form of quadding (justification), returns the default value if not explicitly specified. + + + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified). + + a code specifying the form of quadding (justification). + + this + + instance. + + + + Text justification options. + + + The purpose of a line annotation is to display a single straight line on the page. + + The purpose of a line annotation is to display a single straight line on the page. + When opened, it displays a pop-up window containing the text of the associated note. + See also ISO-320001 12.5.6.7 "Line Annotations". + + + + + Creates a + + instance. + + + the annotation rectangle, defining the location of the annotation on the page + in default user space units. See + + . + + + an array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates + of the line in default user space. See also + + . + + + + + Creates a + + instance from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. + + + a + + that represents existing annotation in the document. + + + + + + + + An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line + in default user space. + + + An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line + in default user space. If the + + (see + + ) entry is present, this value represents + the endpoints of the leader lines rather than the endpoints of the line itself. + + An array of four numbers specifying the starting and ending coordinates of the line in default user space. + + + + An array of two names specifying the line ending styles that is used in drawing the line. + + An array of two names specifying the line ending styles that is used in drawing the line. + The first and second elements of the array shall specify the line ending styles for the endpoints defined, + respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the + + array + (see + + . For possible values see + + . + + + An array of two names specifying the line ending styles that is used in drawing the line; or null if line + endings style is not explicitly defined, default value is [/None /None]. + + + + Sets the line ending styles that are used in drawing the line. + + Sets the line ending styles that are used in drawing the line. + The first and second elements of the array shall specify the line ending styles for the endpoints defined, + respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the + + array + (see + + . Possible values for styles are: +
    +
  • + + - A square filled with the annotation's interior color, if any;
  • +
  • + + - A circle filled with the annotation's interior color, if any;
  • +
  • + + - A diamond shape filled with the annotation's interior color, if any;
  • +
  • + + - Two short lines meeting in an acute angle to form an open arrowhead;
  • +
  • + + - Two short lines meeting in an acute angle as in the + + style and + connected by a third line to form a triangular closed arrowhead filled with the annotation's interior color, if any;
  • +
  • + + - No line ending;
  • +
  • + + - A short line at the endpoint perpendicular to the line itself;
  • +
  • + + - Two short lines in the reverse direction from + + ;
  • +
  • + + - A triangular closed arrowhead in the reverse direction from + + ;
  • +
  • + + - A short line at the endpoint approximately 30 degrees clockwise from perpendicular to the line itself;
  • +
+ see also ISO-320001, Table 176 "Line ending styles". +
+ An array of two names specifying the line ending styles that is used in drawing the line. + + + this + + instance. + +
+ + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + this + + instance. + + + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + this + + instance. + + + + + A non-negative number that represents the length of leader line extensions that extend from the line proper + 180 degrees from the leader lines. + + + a non-negative float that represents the length of leader line extensions; or if the leader line extension + is not explicitly set, returns the default value, which is 0. + + + + Sets the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. + + + Sets the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. + This value shall not be set unless + + (see + + ) is set. + + a non-negative float that represents the length of leader line extensions. + + + this + + instance. + + + + + A non-negative number that represents the length of the leader line offset, which is the amount of empty space + between the endpoints of the annotation and the beginning of the leader lines. + + + a non-negative number that represents the length of the leader line offset, + or null if leader line offset is not set. + + + + + Sets the length of the leader line offset, which is the amount of empty space between the endpoints of the + annotation and the beginning of the leader lines. + + a non-negative number that represents the length of the leader line offset. + + + this + + instance. + + + + + If true, the text specified by the + + or + + entries + (see + + and + + ) + is replicated as a caption in the appearance of the line. + + + true, if the annotation text is replicated as a caption, false otherwise. If this property is + not set, default value is used which is false. + + + + + If set to true, the text specified by the + + or + + entries + (see + + and + + ) + will be replicated as a caption in the appearance of the line. + + true, if the annotation text should be replicated as a caption, false otherwise. + + + this + + instance. + + + + A name describing the annotation's caption positioning. + + A name describing the annotation's caption positioning. Valid values are + + , meaning the caption + is centered inside the line, and + + , meaning the caption is on top of the line. + + + a name describing the annotation's caption positioning, or null if the caption positioning is not + explicitly defined (in this case the default value is used, which is + + ). + + + + Sets annotation's caption positioning. + + Sets annotation's caption positioning. Valid values are + + , meaning the caption + is centered inside the line, and + + , meaning the caption is on top of the line. + + a name describing the annotation's caption positioning. + + this + + instance. + + + + A measure dictionary (see ISO-320001, Table 261) that specifies the scale and units that apply to the line annotation. + + + a + + that represents a measure dictionary. + + + + Sets a measure dictionary that specifies the scale and units that apply to the line annotation. + + a + + that represents a measure dictionary, see ISO-320001, Table 261 for valid + contents specification. + + + this + + instance. + + + + An array of two numbers that specifies the offset of the caption text from its normal position. + + An array of two numbers that specifies the offset of the caption text from its normal position. + The first value is the horizontal offset along the annotation line from its midpoint, with a positive value + indicating offset to the right and a negative value indicating offset to the left. The second value is the vertical + offset perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating + a shift down. + + + a + + of two numbers that specifies the offset of the caption text from its normal position, + or null if caption offset is not explicitly specified (in this case a default value is used, which is [0, 0]). + + + + Sets the offset of the caption text from its normal position. + + a + + of two numbers that specifies the offset of the caption text from its + normal position. The first value defines the horizontal offset along the annotation line from + its midpoint, with a positive value indicating offset to the right and a negative value indicating + offset to the left. The second value defines the vertical offset perpendicular to the annotation line, + with a positive value indicating a shift up and a negative value indicating a shift down. + + + this + + instance. + + + + Sets the offset of the caption text from its normal position. + + an array of two floats that specifies the offset of the caption text from its + normal position. The first value defines the horizontal offset along the annotation line from + its midpoint, with a positive value indicating offset to the right and a negative value indicating + offset to the left. The second value defines the vertical offset perpendicular to the annotation line, + with a positive value indicating a shift up and a negative value indicating a shift down. + + + this + + instance. + + + + Highlight modes. + + + Subtypes + + + + + + Subtypes + + + + + + + Setter for the annotation's highlighting mode. + + Setter for the annotation's highlighting mode. Possible values are +
    +
  • + + - No highlighting.
  • +
  • + + - Invert the contents of the annotation rectangle.
  • +
  • + + - Invert the annotation's border.
  • +
  • + + - Display the annotation?s down appearance, if any.
  • +
  • + + - Same as P.
  • +
+
+ The new value for the annotation's highlighting mode. + The widget annotation which this method was called on. +
+ + Getter for the annotation's highlighting mode. + Current value of the annotation's highlighting mode. + + + This method removes all widget annotation entries from the form field the given annotation merged with. + + + + Acts like a StringBuffer but works with byte arrays. + + + Acts like a StringBuffer but works with byte arrays. + Floating point is converted to a format suitable to the PDF. + + Paulo Soares + + + The count of bytes in the buffer. + + + The buffer where the bytes are stored. + + + If true always output floating point numbers with 6 decimal digits. + + + If true always output floating point numbers with 6 decimal digits. + If false uses the faster, although less precise, representation. + + + + Creates new ByteBufferOutputStream with capacity 128 + + + Creates a byte buffer with a certain capacity. + the initial capacity + + + + You can fill the cache in advance if you want to. + + + + Converts an double (multiplied by 100 and cast to an int) into an array of bytes. + + the int + a byte array + + + Appends an int. + Appends an int. The size of the array will grow by one. + the int to be appended + a reference to this ByteBufferOutputStream object + + + Appends the subarray of the byte array. + + Appends the subarray of the byte array. The buffer will grow by + len bytes. + + the array to be appended + the offset to the start of the array + the length of bytes to append + a reference to this ByteBufferOutputStream object + + + Appends an array of bytes. + the array to be appended + a reference to this ByteBufferOutputStream object + + + Appends a String to the buffer. + + Appends a String to the buffer. The String is + converted according to the encoding ISO-8859-1. + + the String to be appended + a reference to this ByteBufferOutputStream object + + + Appends a char to the buffer. + + Appends a char to the buffer. The char is + converted according to the encoding ISO-8859-1. + + the char to be appended + a reference to this ByteBufferOutputStream object + + + Appends another ByteBufferOutputStream to this buffer. + the ByteBufferOutputStream to be appended + a reference to this ByteBufferOutputStream object + + + Appends the string representation of an int. + the int to be appended + a reference to this ByteBufferOutputStream object + + + Appends the string representation of a long. + the long to be appended + a reference to this ByteBufferOutputStream object + + + + Appends a string representation of a float according + to the Pdf conventions. + + the float to be appended + a reference to this ByteBufferOutputStream object + + + + Appends a string representation of a double according + to the Pdf conventions. + + the double to be appended + a reference to this ByteBufferOutputStream object + + + Outputs a double into a format suitable for the PDF. + a double + the String representation of the double + + + Outputs a double into a format suitable for the PDF. + a double + a ByteBufferOutputStream + + the String representation of the double if + buf is null. If buf is not null, + then the double is appended directly to the buffer and this methods returns null. + + + + Sets the size to zero. + + + Creates a newly allocated byte array. + + Creates a newly allocated byte array. Its size is the current + size of this output stream and the valid contents of the buffer + have been copied into it. + + the current contents of this output stream, as a byte array. + + + Returns the current size of the buffer. + the value of the count field, which is the number of valid bytes in this byte buffer. + + + + + Converts the buffer's contents into a string, translating bytes into + characters according to the platform's default character encoding. + + String translated from the buffer's contents. + + + + Converts the buffer's contents into a string, translating bytes into + characters according to the specified character encoding. + + a character-encoding name. + String translated from the buffer's contents. + If the named encoding is not supported. + + + + + Writes the complete contents of this byte buffer output to + the specified output stream argument, as if by calling the output + stream's write method using out.write(buf, 0, count). + + the output stream to which to write the data. + + java.io.IOException + if an I/O error occurs. + + + + + + + + + A subclass of + + for Artifacts. + In Tagged PDF, an object can be marked as an Artifact in order to signify + that it is more part of the document structure than of the document content. + Examples are page headers, layout features, etc. Screen readers can choose to + ignore Artifacts. + + + + This class represents a single tag on a single piece of marked content. + + This class represents a single tag on a single piece of marked content. +

+ In Tagged PDF, a tag is the basic structure unit for marking content. The tag + structure and hierarchy is largely comparable to HTML. As in HTML, every tag + type has a name, defined here in the role attribute. The tagging + mechanism in Tagged PDF is extensible, so PDF creators can choose to create + custom tags.

+
+
+ + The type of the tag. + + + The properties of the tag. + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + the type of tag + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + the type of tag + marked content id which serves as a reference to the document's logical structure + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + + the + Marked Content Reference + wrapper object + + + + Get the role of the tag. + the role of the tag as a PdfName + + + Get the marked content id of the tag. + marked content id + if there is no MCID + + + Determine if an MCID is available + true if the MCID is available, false otherwise + + + + Adds a dictionary of properties to the + tag + 's properties. + + a dictionary + + current + + + + + + Adds a single property to the + tag + 's properties. + + a key + the value for the key + + current + + + + + + Removes a single property from the + tag + 's properties. + + the key of the key-value pair to be removed + + current + + + + + + Gets a property from the + tag + 's properties dictionary. + + the key of the key-value pair to be retrieved + the value corresponding to the key + + + Get the properties of the tag. + properties of the tag + + + + Creates a CanvasArtifact object, which is a + + with a role + of + Artifact + . + + + + This class is designed for internal usage. + + This class is designed for internal usage.
+ Use PdfExtGState class and PdfCanvas#setExtGState() method for setting extended graphics properties. +
+
+ + The current transformation matrix, which maps positions from user coordinates to device coordinates. + + + The current transformation matrix, which maps positions from user coordinates to device coordinates. + We use an identity matrix as a default value, but in spec a default value is: + "a matrix that transforms default user coordinates to device coordinates". + + + + A description of the dash pattern to be used when paths are stroked. + + A description of the dash pattern to be used when paths are stroked. Default value is solid line. + The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], + where dashArray is itself an array and dashPhase is an integer. + An empty dash array (first element in the array) and zero phase (second element in the array) + can be used to restore the dash pattern to a solid line. + + + + + Copy constructor. + the Graphics State to copy from + + + Updates this object with the values from a dictionary. + the dictionary containing source parameters + + + current transformation matrix. + + + Updates current transformation matrix. + + + Updates current transformation matrix. + new current transformation matrix. + + + Updates current graphic state with values from extended graphic state dictionary. + the wrapper around the extended graphic state dictionary + + + + Implementation of + + which draws a dashed horizontal line over + the middle of the specified rectangle. + + + + + The + + defines a drawing operation on a + +

+ This interface allows to customize the 'empty' space in a + TabStop + through a Strategy design + pattern +

+
+ + + Performs configurable drawing operations related to specific region + coordinates on a canvas. + + the canvas to draw on + + the rectangle in relation to which to fulfill drawing + instructions + + + + Gets the width of the line + width of the line + + + Sets line width in points + new line width + + + Gets the color of the line + color of the line + + + Sets line color + new line color + + + + Creates an instance of + + with the specified line width. + + + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + Implementation of + + which draws a dotted horizontal line along + the bottom edge of the specified rectangle. + + + + the gap between the dots. + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + the width of the line + the gap between the center of the dots of the dotted line. + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + the width of the line + + + Getter for the gap between the center of the dots of the dotted line. + the gap between the center of the dots + + + Setter for the gap between the center of the dots of the dotted line. + the gap between the center of the dots + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + Implementation of + + which draws a solid horizontal line along + the bottom edge of the specified rectangle. + + + + Constructs an instance of solid line drawer + + + Constructs an instance of solid line drawer with the specified line thickness + line width + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + This class contains variety of methods allowing to convert iText + abstractions into the abstractions of the Clipper library and vise versa. + + + This class contains variety of methods allowing to convert iText + abstractions into the abstractions of the Clipper library and vise versa. +

+ For example: +

    +
  • + + to + +
  • +
  • + + to + +
  • +
  • + + to + +
  • +
+

+
+
+ + + Since the clipper library uses integer coordinates, we should convert + our floating point numbers into fixed point numbers by multiplying by + this coefficient. + + + Since the clipper library uses integer coordinates, we should convert + our floating point numbers into fixed point numbers by multiplying by + this coefficient. Vary it to adjust the preciseness of the calculations. + + + + + Converts Clipper library + + abstraction into iText + + object. + + + + + + + Converts list of + + objects into list of + + objects. + + + + + Converts list of + + objects into list of + + objects. + + + + + Converts iText line join style constant into the corresponding constant + of the Clipper library. + + + iText line join style constant. See + + + Clipper line join style constant. + + + + Converts iText line cap style constant into the corresponding constant + of the Clipper library. + + + iText line cap style constant. See + + + Clipper line cap (end type) style constant. + + + + Converts iText filling rule constant into the corresponding constant + of the Clipper library . + + + Either + + or + + . + + Clipper fill type constant. + + + + Marker interface for the set of classes used to combine + parameters required for different types of events. + + + + The path to be rendered. + The path to be rendered. + + + + The + + which represents current clipping path. + + + + Current transformation matrix. + + + Represents image data from a PDF + + + The coordinate transformation matrix that was in effect when the image was rendered + + + the color space dictionary from resources which are associated with the image + + + defines if the encountered image was inline + + + Create an ImageRenderInfo + the coordinate transformation matrix at the time the image is rendered + image stream object + the color space dictionary from resources which are associated with the image + + defines if the encountered image was inline + + + Gets an image wrapped in ImageXObject. + + Gets an image wrapped in ImageXObject. + You can: +
    +
  • get image bytes with + + , these image bytes + represent native image, i.e you can write these bytes to disk and get just an usual image;
  • +
  • obtain PdfStream object which contains image dictionary with + + method;
  • +
  • convert image to + + with + + ;
  • +
+
+
+ + a vector in User space representing the start point of the image + + + The coordinate transformation matrix which was active when this image was rendered. Coordinates are in User space. + + + + the size of the image, in User space units + + + true if image was inlined in original stream. + + + the color space dictionary from resources which are associated with the image + + + Contains information relating to painting current path. + + + End the path object without filling or stroking it. + + End the path object without filling or stroking it. This operator shall be a path-painting no-op, + used primarily for the side effect of changing the current clipping path + + + + Value specifying stroke operation to perform on the current path. + + + Value specifying fill operation to perform on the current path. + + Value specifying fill operation to perform on the current path. When the fill operation + is performed it should use either nonzero winding or even-odd rule. + + + + The path to be rendered. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + . + + True indicates that current path modifies the clipping path, false - if not. + + Either + + or + + . + + The graphics state. + + + + If the operation is + + then the rule is ignored, + otherwise + + is used by default. + With this constructor path is considered as not modifying clipping path. + See + + + + + + The + + to be rendered. + + + + + int value which is either + + or one of possible + combinations of + + and + + + + + + Either + + or + + . + + + + true indicates that current path modifies the clipping path, false - if not. + + + + Either + + or + + . + + + + Current transformation matrix. + + + + Provides information and calculations needed by render listeners + to display/evaluate text render operations. + + + Provides information and calculations needed by render listeners + to display/evaluate text render operations. +

+ This is passed between the + + and + + objects as text rendering operations are + discovered +
+
+ + Hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer. + + + + Creates a new TextRenderInfo object + the PDF string that should be displayed + the graphics state (note: at this time, this is not immutable, so don't cache it) + the text matrix at the time of the render operation + the marked content tags sequence, if available + + + Used for creating sub-TextRenderInfos for each individual character + the parent TextRenderInfo + the content of a TextRenderInfo + the unscaled horizontal offset of the character that this TextRenderInfo represents + + + + the text to render + + + original PDF string + + + + Checks if the text belongs to a marked content sequence + with a given mcid. + + a marked content id + true if the text is marked with this id + + + + Checks if the text belongs to a marked content sequence + with a given mcid. + + a marked content id + indicates whether to check the topmost level of marked content stack only + + true if the text is marked with this id + + + the marked content associated with the TextRenderInfo instance. + + + Gets the baseline for the text (i.e. + + Gets the baseline for the text (i.e. the line that the text 'sits' on) + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the baseline line segment + + + Gets the ascentline for the text (i.e. + + Gets the ascentline for the text (i.e. the line that represents the topmost extent that a string of the current font could have) + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the ascentline line segment + + + Gets the descentline for the text (i.e. + + Gets the descentline for the text (i.e. the line that represents the bottom most extent that a string of the current font could have). + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the descentline line segment + + + Getter for the font + the font + + + The rise represents how far above the nominal baseline the text should be rendered. + + The rise represents how far above the nominal baseline the text should be rendered. The + + , + + and + + methods already include Rise. + This method is exposed to allow listeners to determine if an explicit rise was involved in the computation of the baseline (this might be useful, for example, for identifying superscript rendering) + + The Rise for the text draw operation, in user space units (Ts value, scaled to user space) + + + Provides detail useful if a listener needs access to the position of each individual glyph in the text render operation + + + A list of + + objects that represent each glyph used in the draw operation. The next effect is if there was a separate Tj opertion for each character in the rendered string + + + + The width, in user space units, of a single space character in the current font + + + + the text render mode that should be used for the text. From the + PDF specification, this means: +
    +
  • 0 = Fill text
  • +
  • 1 = Stroke text
  • +
  • 2 = Fill, then stroke text
  • +
  • 3 = Invisible
  • +
  • 4 = Fill text and add to path for clipping
  • +
  • 5 = Stroke text and add to path for clipping
  • +
  • 6 = Fill, then stroke text and add to path for clipping
  • +
  • 7 = Add text to padd for clipping
  • +
+
+
+ + the current fill color. + + + the current stroke color. + + + Gets /ActualText tag entry value if this text chunk is marked content. + /ActualText value + + + Gets hierarchy of the canvas tags that wraps given text. + list of the wrapping canvas tags. The first tag is the innermost (nearest to the text). + + + the unscaled (i.e. in Text space) width of the text + + + the width, in text space + the width in user space + + + the height, in text space + the height in user space + + + Calculates the width of a space character. + + Calculates the width of a space character. If the font does not define + a width for a standard space character \u0020, we also attempt to use + the width of \u00A0 (a non-breaking space in many fonts) + + the width of a single space character in text space units + + + Gets the width of a String in text space units + the string that needs measuring + the width of a String in text space units + + + Gets the width of a PDF string in text space units + the string that needs measuring + the width of a String in text space units + + + Calculates width and word spacing of a single character PDF string. + + Calculates width and word spacing of a single character PDF string. + IMPORTANT: Shall ONLY be used for a single character pdf strings. + + a character to calculate width. + array of 2 items: first item is a character width, second item is a calculated word spacing. + + + Converts a single character string to char code. + single character string to convert to. + char code. + + + Split PDF string into array of single character PDF strings. + PDF string to be splitted. + splitted PDF string. + + + Specifies different types of events where a callback should be notified. + + + This is an interface which helps to filter events. + + + + This method checks an event and decides whether it should be processed further (corresponds to + + return value), or filtered out (corresponds to + + return value). + + event data + event type + true to process event further, false to filter event out + + + + This + + implementation only accepts text render events within the specified + rectangular region. + + + + Constructs a filter instance. + the rectangle to filter text against + + + Root interface for a series of handlers for content stream operators. + + + Called when a content operator should be processed. + The processor that is dealing with the PDF content stream. + The literal PDF syntax of the operator. + The operands that come with the operator. + + + Kevin Day + + + An event listener which filters events on the fly before passing them on to the delegate. + + + + A callback interface that receives notifications from the + + as various events occur (see + + ). + + + + Called when some event occurs during parsing a content stream. + Combines the data required for processing corresponding event type. + Event type. + + + Provides the set of event types this listener supports. + + Provides the set of event types this listener supports. + Returns null if all possible event types are supported. + + + Set of event types supported by this listener or + null if all possible event types are supported. + + + + + Constructs a + + empty instance. + Use + + to add an event listener along with its filters. + + + + + Constructs a + + instance with one delegate. + Use + + to add more + + delegates + along with their filters. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + + + + Attaches another + + delegate with its filters. + When all the filters attached to the delegate for an event accept the event, the event will be passed on to + the delegate. + You can attach multiple delegates to this + + instance. The content stream will + be parsed just once, so it is better for performance than creating multiple + + instances and parsing the content stream multiple times. This is useful, for instance, when you want + to extract content from multiple regions of a page. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + delegate that has been passed to the method, used for convenient call chaining + + + A text event listener which filters events on the fly before passing them on to the delegate. + + A text event listener which filters events on the fly before passing them on to the delegate. + The only difference from + + is that this class conveniently implements + + and can therefore used as a strategy on its own, apart from the inherited + function of filtering event appropriately to its delegates. + + + + + This is a special interface for + + that returns text as result of its work. + + + + Returns the text that has been processed so far. + + + + instance with the current resultant text + + + + + Constructs a + + instance with a + + delegate. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + + + + As an resultant text we use the concatenation of all the resultant text of all the delegates that implement + + . + + the resulting concatenation of the text extracted from the delegates + + + + This class expands each + + for + + event types into + multiple + + instances for each glyph occurred. + + + + + Constructs a + + instance by a delegate to which the expanded text events for each + glyph occurred will be passed on. + + delegate to pass the expanded glyph render events to. + + + + This class expands each + + for + + event types into + multiple + + instances for each glyph occurred. + The only difference from + + is that this class conveniently implements + + and can therefore used as a strategy on its own. + + + + + Constructs a + + instance by a + + delegate to which + the expanded text events for each glyph occurred will be passed on. + + delegate to pass the expanded glyph render events to. + + + + As an resultant text we use the the resultant text of the delegate that implement + + and was passed to this class. + + the resulting text extracted from the delegate + + + set to true for debugging + + + a summary of all found text + + + Creates a new text extraction renderer. + + + + Creates a new text extraction renderer, with a custom strategy for + creating new TextChunkLocation objects based on the input of the + TextRenderInfo. + + the custom strategy + + + + Changes the behavior of text extraction so that if the parameter is set to + + , + /ActualText marked content property will be used instead of raw decoded bytes. + Beware: the logic is not stable yet. + + true to use /ActualText, false otherwise + this object + + + + Gets the value of the property which determines if /ActualText will be used when extracting + the text + + true if /ActualText value is used, false otherwise + + + Determines if a space character should be inserted between a previous chunk and the current chunk. + + + Determines if a space character should be inserted between a previous chunk and the current chunk. + This method is exposed as a callback so subclasses can fine time the algorithm for determining whether a space should be inserted or not. + By default, this method will insert a space if the there is a gap of more than half the font space character width between the end of the + previous chunk and the beginning of the current chunk. It will also indicate that a space is needed if the starting point of the new chunk + appears *before* the end of the previous chunk (i.e. overlapping text). + + the new chunk being evaluated + the chunk that appeared immediately before the current chunk + true if the two chunks represent different words (i.e. should have a space between them). False otherwise. + + + + Checks if the string starts with a space character, false if the string is empty or starts with a non-space character. + + the string to be checked + true if the string starts with a space character, false if the string is empty or starts with a non-space character + + + + Checks if the string ends with a space character, false if the string is empty or ends with a non-space character + + the string to be checked + true if the string ends with a space character, false if the string is empty or ends with a non-space character + + + + Used for debugging only + + + Represents a chunk of text, it's orientation, and location relative to the orientation vector + + + the text of the chunk + + + the text captured by this chunk + + + Compares based on orientation, perpendicular distance, then parallel distance + + + + the starting location of the chunk + + + the ending location of the chunk + + + unit vector in the orientation of the chunk + + + the orientation as a scalar for quick sorting + + + perpendicular distance to the orientation unit vector (i.e. + + perpendicular distance to the orientation unit vector (i.e. the Y position in an unrotated coordinate system) + we round to the nearest integer to handle the fuzziness of comparing floats + + + + distance of the start of the chunk parallel to the orientation unit vector (i.e. + distance of the start of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system) + + + + distance of the end of the chunk parallel to the orientation unit vector (i.e. + distance of the end of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system) + + + + the width of a single space character in the font of the chunk + + + the start location of the text + + + the end location of the text + + + the width of a single space character as rendered by this chunk + + + the location to compare to + true is this location is on the the same line as the other + + + + Computes the distance between the end of 'other' and the beginning of this chunk + in the direction of this chunk's orientation vector. + + + Computes the distance between the end of 'other' and the beginning of this chunk + in the direction of this chunk's orientation vector. Note that it's a bad idea + to call this for chunks that aren't on the same line and orientation, but we don't + explicitly check for that condition for performance reasons. + + + the number of spaces between the end of 'other' and the beginning of this chunk + + + used to store the resulting String. + + + Returns the result so far. + a String with the resulting text. + + + Used to actually append text to the text results. + + Used to actually append text to the text results. Subclasses can use this to insert + text that wouldn't normally be included in text parsing (e.g. result of OCR performed against + image content) + + the text to append to the text results accumulated so far + + + This class allows you to find the rectangle which contains all the text in the given content stream. + + + + + Returns the common text rectangle, containing all the text found in the stream so far, ot + + , if no + text has been found yet. + + common text rectangle + + + + Internal class which is essentially a + + which supports tracking of + clipping path state and changes. + + + + + Copy constructor. + the Graphics State to copy from + + + Sets the current clipping path to the specified path. + + Sets the current clipping path to the specified path. +
+ Note:This method doesn't modify existing clipping path, + it simply replaces it with the new one instead. +
+ New clipping path. +
+ + Intersects the current clipping path with the given path. + + Intersects the current clipping path with the given path. +
+ Note: Coordinates of the given path should be in + the transformed user space. +
+ The path to be intersected with the current clipping path. + + The filling rule which should be applied to the given path. + It should be either + + or + + +
+ + Getter for the current clipping path. + + Getter for the current clipping path. +
+ Note: The returned clipping path is in the transformed user space, so + if you want to get it in default user space, apply transformation matrix ( + + ). +
+ The current clipping path. +
+ + Processor for a PDF content stream. + + + Listener that will be notified of render events + + + + Cache supported events in case the user's + + method is not very efficient + + + + + Indicates whether the current clipping path should be modified by + intersecting it with the current path. + + + + + Specifies the filling rule which should be applied while calculating + new clipping path. + + + + A map with all supported operators (PDF syntax). + + + Resources for the content stream. + + Resources for the content stream. + Current resources are always at the top of the stack. + Stack is needed in case if some "inner" content stream with it's own resources + is encountered (like Form XObject). + + + + Stack keeping track of the graphics state. + + + A map with all supported XObject handlers + + + The font cache + + + A stack containing marked content info. + + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + + + the + + that will receive rendering notifications + + + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + + the + + that will receive rendering notifications + + + an optional map of custom + + s for rendering instructions + + + + Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. + + + Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. +
+ If you register a handler, it is a very good idea to pass the call on to the existing registered handler (returned by this call), otherwise you + may inadvertently change the internal behavior of the processor. +
+ the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler + + the handler that will receive notification when the Do operator for the specified subtype is encountered + + the existing registered handler, if any +
+ + Registers a content operator that will be called when the specified operator string is encountered during content processing. + + + Registers a content operator that will be called when the specified operator string is encountered during content processing. +
+ If you register an operator, it is a very good idea to pass the call on to the existing registered operator (returned by this call), otherwise you + may inadvertently change the internal behavior of the processor. +
+ the operator id, or DEFAULT_OPERATOR for a catch-all operator + the operator that will receive notification when the operator is encountered + the existing registered operator, if any +
+ + + + + containing all the registered operators strings + + + + Resets the graphics state stack, matrices and resources. + + + the current graphics state + + + Processes PDF syntax. + + Processes PDF syntax. + Note: If you re-use a given + + , you must call + + + the bytes of a content stream + the resources of the content stream. Must not be null. + + + Processes PDF syntax. + + Processes PDF syntax. +
+ Note: If you re-use a given + + , you must call + +
+ the page to process +
+ + + Accessor method for the + + object maintained in this class. + Necessary for implementing custom ContentOperator implementations. + + the renderListener + + + Loads all the supported graphics and text state operators in a map. + + + Displays the current path. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + In case it isn't applicable pass any byte value. + + + + Invokes an operator. + the PDF Syntax of the operator + a list with operands + + + Gets the font pointed to by the indirect reference. + Gets the font pointed to by the indirect reference. The font may have been cached. + + the font + + + Add to the marked content stack + the tag of the marked content + the PdfDictionary associated with the marked content + + + Remove the latest marked content from the stack. + Remove the latest marked content from the stack. Keeps track of the BMC, BDC and EMC operators. + + + Used to trigger beginTextBlock on the renderListener + + + Used to trigger endTextBlock on the renderListener + + + This is a proxy to pass only those events to the event listener which are supported by it. + event data + event type + + + Displays text. + the text to display + + + Displays an XObject using the registered handler for this XObject's subtype + the name of the XObject to retrieve from the resource dictionary + + + Adjusts the text matrix for the specified adjustment value (see TJ operator in the PDF spec for information) + + the text adjustment + + + Gets a color based on a list of operands and Color space. + + + Gets a color based on a list of operands. + + + A content operator implementation (unregistered). + + + A content operator implementation (TJ). + + + A content operator implementation ("). + + + A content operator implementation ('). + + + A content operator implementation (Tj). + + + A content operator implementation (T*). + + + A content operator implementation (Tm). + + + A content operator implementation (TD). + + + A content operator implementation (Td). + + + A content operator implementation (Tf). + + + A content operator implementation (Tr). + + + A content operator implementation (Ts). + + + A content operator implementation (TL). + + + A content operator implementation (Tz). + + + A content operator implementation (Tc). + + + A content operator implementation (Tw). + + + A content operator implementation (gs). + + + A content operator implementation (q). + + + A content operator implementation (cm). + + + A content operator implementation (Q). + + + A content operator implementation (g). + + + A content operator implementation (G). + + + A content operator implementation (rg). + + + A content operator implementation (RG). + + + A content operator implementation (k). + + + A content operator implementation (K). + + + A content operator implementation (CS). + + + A content operator implementation (cs). + + + A content operator implementation (sc / scn). + + + A content operator implementation (SC / SCN). + + + A content operator implementation (BT). + + + A content operator implementation (ET). + + + A content operator implementation (BMC). + + + A content operator implementation (BDC). + + + A content operator implementation (EMC). + + + A content operator implementation (Do). + + + A content operator implementation (EI). + + A content operator implementation (EI). BI and ID operators are parsed along with this operator. + This not a usual operator, it will have a single operand, which will be a PdfStream object which + encapsulates inline image dictionary and bytes + + + + A content operator implementation (w). + + + A content operator implementation (J). + + + A content operator implementation (j). + + + A content operator implementation (M). + + + A content operator implementation (d). + + + An XObject subtype handler for FORM + + + An XObject subtype handler for IMAGE + + + An XObject subtype handler that does nothing + + + A content operator implementation (m). + + + A content operator implementation (l). + + + A content operator implementation (c). + + + A content operator implementation (v). + + + A content operator implementation (y). + + + A content operator implementation (h). + + + A content operator implementation (re). + + + A content operator implementation (S, s, f, F, f*, B, B*, b, b*). + + + Constructs PainPath object. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + In case it isn't applicable pass any value. + + Indicates whether the path should be closed or not. + + + A content operator implementation (W, W*) + + + + A utility class that makes it cleaner to process content from pages of a + + through a specified RenderListener. + + + + Processes content from the specified page number using the specified listener. + + Processes content from the specified page number using the specified listener. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + + the page number to process + the listener that will receive render callbacks + an optional map of custom ContentOperators for rendering instructions + + the provided renderListener + + + Processes content from the specified page number using the specified listener + + the page number to process + the listener that will receive render callbacks + the provided renderListener + + + Extract text from a specified page using an extraction strategy. + + Extract text from a specified page using an extraction strategy. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + the page for the text to be extracted from + the strategy to use for extracting text + + an optional map of custom + + s for rendering instructions + + the extracted text + + + Extract text from a specified page using an extraction strategy. + the page for the text to be extracted from + the strategy to use for extracting text + the extracted text + + + Extract text from a specified page using the default strategy. + + Extract text from a specified page using the default strategy. + Node: the default strategy is subject to change. If using a specific strategy + is important, please use + + . + + the page for the text to be extracted from + the extracted text + + + Utility methods to help with processing of inline images + + + + Map between key abbreviations allowed in dictionary of inline images and their + equivalent image dictionary keys + + + + Map between value abbreviations allowed in dictionary of inline images for COLORSPACE + + + Map between value abbreviations allowed in dictionary of inline images for FILTER + + + Parses an inline image from the provided content parser. + + Parses an inline image from the provided content parser. The parser must be positioned immediately following the BI operator in the content stream. + The parser will be left with current position immediately following the EI operator that terminates the inline image + + the content parser to use for reading the image. + a color space dictionary + the parsed image + if anything goes wring with the parsing + if parsing of the inline image failed due to issues specific to inline image processing + + + + Parses the next inline image dictionary from the parser. + + Parses the next inline image dictionary from the parser. The parser must be positioned immediately following the BI operator. + The parser will be left with position immediately following the whitespace character that follows the ID operator that ends the inline image dictionary. + + the parser to extract the embedded image information from + the dictionary for the inline image, with any abbreviations converted to regular image dictionary keys and values + + if the parse fails + + + Transforms value abbreviations into their corresponding real value + the key that the value is for + the value that might be an abbreviation + if value is an allowed abbreviation for the key, the expanded value for that abbreviation. Otherwise, value is returned without modification + + + + the name of the color space. If null, a bi-tonal (black and white) color space is assumed. + + the components per pixel for the specified color space + + + Computes the number of unfiltered bytes that each row of the image will contain. + + Computes the number of unfiltered bytes that each row of the image will contain. + If the number of bytes results in a partial terminating byte, this number is rounded up + per the PDF specification + + the dictionary of the inline image + the number of bytes per row of the image + + + Parses the samples of the image from the underlying content parser, ignoring all filters. + + Parses the samples of the image from the underlying content parser, ignoring all filters. + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + The parser will be left positioned immediately following the EI operator. + This is primarily useful if no filters have been applied. + + the dictionary of the inline image + the content parser + the samples of the image + if anything bad happens during parsing + + + + Parses the samples of the image from the underlying content parser, accounting for filters + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + + + Parses the samples of the image from the underlying content parser, accounting for filters + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + The parser will be left positioned immediately following the EI operator. + Note:This implementation does not actually apply the filters at this time + + the dictionary of the inline image + the content parser + the samples of the image + if anything bad happens during parsing + + + + + Simple class in case users need to differentiate an exception from processing + inline images vs other exceptions + + + + Parses the page or form XObject content. + Paulo Soares + + + Holds value of property tokeniser. + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + current resources of the content stream. + It is optional parameter, which is used for performance improvements of specific cases of + inline images parsing. + + + + Parses a single command from the content. + + Parses a single command from the content. Each command is output as an array of arguments + having the command itself as the last element. The returned array will be empty if the + end of content was reached. +
+ A specific behaviour occurs when inline image is encountered (BI command): + in that case, parser would continue parsing until it meets EI - end of the inline image; + as a result in this case it will return an array with inline image dictionary and image bytes + encapsulated in PdfStream object as first element and EI command as second element. +
+ + an ArrayList to use. It will be cleared before using. If it's + null will create a new ArrayList + + the same ArrayList given as argument or a new one + on error +
+ + Gets the tokeniser. + the tokeniser. + + + Sets the tokeniser. + the tokeniser + + + Reads a dictionary. + Reads a dictionary. The tokeniser must be positioned past the "<<" token. + the dictionary + on error + + + Reads an array. + Reads an array. The tokeniser must be positioned past the "[" token. + an array + on error + + + Reads a pdf object. + the pdf object + on error + + + Reads the next token skipping over the comments. + true if a token was read, false if the end of content was reached + on error + + + A container for constants defined in the PDF specification (ISO 32000-1). + + + + The text rendering mode determines whether showing text causes glyph + outlines to be stroked, filled, used as a clipping boundary, or some + combination of the three. + + + The text rendering mode determines whether showing text causes glyph + outlines to be stroked, filled, used as a clipping boundary, or some + combination of the three. Stroking, filling, and clipping have the same + effects for a text object as they do for a path object, although they are + specified in an entirely different way. + If the text rendering mode calls for filling, the current nonstroking + color in the graphics state is used; if it calls for stroking, the + current stroking color is used. + All documentation for this class is taken from ISO 32000-1, section 9.3.6 + "Text Rendering Mode". + + + + Fill text + + + Stroke text, providing the outline of the glyphs + + + Fill and stroke text + + + Neither fill nor stroke, i.e. + Neither fill nor stroke, i.e. render invisibly + + + Fill text and add to path for clipping + + + Stroke text and add to path for clipping + + + Fill, then stroke text and add to path for clipping + + + Add text to path for clipping + + + + The line cap style specifies the shape to be used at the ends of open + subpaths (and dashes, if any) when they are stroked. + + + The line cap style specifies the shape to be used at the ends of open + subpaths (and dashes, if any) when they are stroked. + All documentation for this class is taken from ISO 32000-1, section + 8.4.3.3 "Line Cap Style". + + + + The stroke is squared of at the endpoint of the path. + + The stroke is squared of at the endpoint of the path. There is no + projection beyond the end of the path. + + + + + A semicircular arc with a diameter equal to the line width is drawn + around the endpoint and filled in. + + + + + The stroke continues beyond the endpoint of the path for a distance + equal to half the line width and is squared off. + + + + + The line join style specifies the shape to be used at the corners of + paths that are stroked. + + + The line join style specifies the shape to be used at the corners of + paths that are stroked. Join styles are significant only at points where + consecutive segments of a path connect at an angle; segments that meet or + intersect fortuitously receive no special treatment. + All documentation for this class is taken from ISO 32000-1, section + 8.4.3.4 "Line Join Style". + + + + + The outer edges of the strokes for the two segments are extended + until they meet at an angle, as in a picture frame. + + + The outer edges of the strokes for the two segments are extended + until they meet at an angle, as in a picture frame. If the segments + meet at too sharp an angle, a bevel join is used instead. + + + + + An arc of a circle with a diameter equal to the line width is drawn + around the point where the two segments meet, connecting the outer + edges of the strokes for the two segments. + + + An arc of a circle with a diameter equal to the line width is drawn + around the point where the two segments meet, connecting the outer + edges of the strokes for the two segments. This pieslice-shaped + figure is filled in, producing a rounded corner. + + + + + The two segments are finished with butt caps (@see LineCapStyle#BUTT) + and the resulting notch beyond the ends of the segments is filled + with a triangle. + + + + A PdfCanvas instance with an inherent tiling pattern. + + + Creates PdfPatternCanvas from content stream of page, form XObject, pattern etc. + @see PdfStream. + the resources, a specialized dictionary that can be used by PDF instructions in the content stream + + the document that the resulting content stream will be written to + + + Creates PdfPatternCanvas for a document from a provided Tiling pattern + @see PdfPattern.Tiling. The Tiling pattern must be colored + the document that the resulting content stream will be written to + + + Helper class to read nt, short, words, etc. + Helper class to read nt, short, words, etc. from an InputStream. + + + Creates an InputMeta object. + InputStream containing the WMF data + + + Read the next word from the InputStream. + the next word or 0 if the end of the stream has been reached + + + + Read the next short from the InputStream. + the next short value + + + + Read the next int from the InputStream. + the next int + + + + Read the next byte from the InputStream. + the next byte + + + + Skips "len" amount of bytes from the InputStream. + Skips "len" amount of bytes from the InputStream. If len is < 0, nothing is skipped. + amount of bytes needed to skip + + + + Get the amount of bytes read and/or skipped from the InputStream. + number of bytes read + + + + Read the next + + from the InputStream. This reads 4 bytes. + + the next Color + + + + + A Brush bject that holds information about the style, the hatch and the color of + the brush. + + + + A meta object. + + + Creates a new MetaObject. + Creates a new MetaObject. This constructor doesn't set the type. + + + Creates a MetaObject with a type. + the type of meta object + + + Get the type of this MetaObject. + type of MetaObject + + + Creates a MetaBrush object. + + + Initializes this MetaBrush object. + the InputMeta + + + + Get the style of the MetaBrush. + style of the brush + + + Get the hatch pattern of the MetaBrush + hatch of the brush + + + Get the color of the MetaBrush. + color of the brush + + + A class to process WMF files. + + A class to process WMF files. Used internally by + + . + + + + PdfCanvas of the MetaDo object. + + + The InputMeta instance containing the data. + + + Creates a MetaDo instance. + inputstream containing the data + PdfCanvas + + + Reads and processes all the data of the InputMeta. + + + + Output Text at a certain x and y coordinate. + Output Text at a certain x and y coordinate. Clipped or opaque text isn't supported as of yet. + x-coordinate + y-coordinate + flag indicating clipped or opaque + x1-coordinate of the rectangle if clipped or opaque + y1-coordinate of the rectangle if clipped or opaque + x2-coordinate of the rectangle if clipped or opaque + y1-coordinate of the rectangle if clipped or opaque + text to output + + + + Return true if the pen style is null and if it isn't a brush. + + value to decide how to change the state. If true state.setLineJoinRectangle(cb) is called, + if false state.setLineJoinPolygon(cb) is called. + + true if the pen style is null and if it isn't a brush + + + Stroke and fill the MetaPen and MetaBrush paths. + + + Wrap a BMP image in an WMF. + the BMP image to be wrapped + the wrapped BMP + + + + Writes the specified value to the specified outputstream as a word. + outputstream to write the word to + value to be written + + + + Writes the specified value to the specified outputstream as a dword. + outputstream to write the dword to + value to be written + + + + A Meta Font. + + + Creates a MetaFont instance. + + + Initializes the MetaFont instance. + InputMeta containing the WMF data + + + + Returns the Font. + the font + + + + Returns the encoding used in the MetaFont. + the font encoding + + + Returns the angle of the MetaFont. + the angle + + + Returns a boolean value indicating if the font is underlined or not. + true if the font is underlined + + + Returns a boolean value indicating if a font has a strikeout. + true if the font set strikeout + + + Returns the font size. + the MetaState + font size + + + A Pen object of the WMF format. + A Pen object of the WMF format. Holds the color, style and width information of the pen. + + + Creates a MetaPen object. + + + Initializes a MetaPen object. + the InputMeta object that holds the inputstream of the WMF image + + + + Get the style of the MetaPen. + style of the pen + + + Get the width of the MetaPen. + width of the pen + + + Get the color of the MetaPen. + color of the pen + + + Class to keep the state. + + + Stack of saved states. + + + List of MetaObjects. + + + Current Point. + + + Current Pen. + + + Current Brush. + + + Current Font. + + + The current background color. + The current background color. Default value is DeviceRgb#WHITE. + + + Current text color. + Current text color. Default value is DeviceRgb#BLACK. + + + The current background mode. + The current background mode. Default value is OPAQUE. + + + Current polygon fill mode. + Current polygon fill mode. Default value is ALTERNATE. + + + Curent line join. + Curent line join. Default value is 1. + + + Current text alignment. + + + Current offset for Wx. + + + Current offset for Wy. + + + Current extent for Wx. + + + Current extent for Wy. + + + Current x value for scaling. + + + Current y value for scaling. + + + Creates new MetaState + + + Clones a new MetaState from the specified MetaState. + the state to clone + + + Sets every field of this MetaState to the values of the fields of the specified MetaState. + state to copy + + + Add a MetaObject to the State. + MetaObject to be added + + + Select the MetaObject at the specified index and prepare the PdfCanvas. + position of the MetaObject + PdfCanvas to prepare + + + Deletes the MetaObject at the specified index. + index of the MetaObject to delete + + + Saves the state of this MetaState object. + PdfCanvas object on which saveState() will be called + + + Restores the state to the next state on the saved states stack. + index of the state to be restored + PdfCanvas object on which restoreState() will be called + + + Restres the state of the specified PdfCanvas object for as many times as there are saved states on the stack. + + PdfCanvas object + + + Transform the specified value. + the value to transform + the transformed value + + + Transform the specified value. + the value to transform + transformed value + + + Sets the x value for scaling. + x value for scaling + + + Sets the y value for scaling. + y value for scaling + + + Sets the Wx offset value. + Wx offset value + + + Sets the Wy offset value. + Wy offset value + + + Sets the Wx extent value. + Wx extent value + + + Sets the Wy extent value. + Wy extent value + + + Transforms the specified angle. + + Transforms the specified angle. If scalingY is less than 0, the angle is multiplied by -1. If scalingX is less + than 0, the angle is subtracted from Math.PI. + + the angle to transform + the transformed angle + + + Sets the current Point to the specified Point. + Point to set + + + Returns the current Point. + current Point + + + Returns the current MetaBrush object. + current MetaBrush + + + Returns the current MetaPen object. + current MetaPen + + + Returns the current MetaFont object. + current MetaFont + + + Getter for property currentBackgroundColor. + Value of property currentBackgroundColor. + + + Setter for property currentBackgroundColor. + New value of property currentBackgroundColor. + + + Getter for property currentTextColor. + Value of property currentTextColor. + + + Setter for property currentTextColor. + New value of property currentTextColor. + + + Getter for property backgroundMode. + Value of property backgroundMode. + + + Setter for property backgroundMode. + New value of property backgroundMode. + + + Getter for property textAlign. + Value of property textAlign. + + + Setter for property textAlign. + New value of property textAlign. + + + Getter for property polyFillMode. + Value of property polyFillMode. + + + Setter for property polyFillMode. + New value of property polyFillMode. + + + + Sets the line join style to + + if lineJoin isn't 0. + + PdfCanvas to set the line join style + + + + Sets the line join style to + + if lineJoin is 0. + + PdfCanvas to set the line join style + + + Returns true if lineJoin is 0. + true if lineJoin is 0 + + + Image implementation for WMF, Windows Metafile. + + + Creates a WmfImage from a file. + pah to the file + + + + Creates a WmfImage from a URL. + URL to the file + + + Creates a WmfImage from a byte[]. + the image bytes + + + Helper class for the WmfImage implementation. + + Helper class for the WmfImage implementation. Assists in the creation of a + + . + + + + Scales the WMF font size. + Scales the WMF font size. The default value is 0.86. + + + Creates a helper instance. + + the + + object + + + + This method checks if the image is a valid WMF and processes some parameters. + + + Create a PdfXObject based on the WMF image. + + Create a PdfXObject based on the WMF image. The PdfXObject will have the dimensions of the + WMF image. + + PdfDocument to add the PdfXObject to + PdfXObject based on the WMF image + + + A type of initial view + + + A type of initial view + + + A type of initial view + + + Constructs a PDF Collection. + + + Sets the Collection schema dictionary. + an overview of the collection fields + + + + + Identifies the document that will be initially presented + in the user interface. + + a string that identifies an entry in the EmbeddedFiles name tree + + + + Sets the initial view. + + + + + Sets the Collection sort dictionary. + + + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + Creates a PdfCollectionField. + the field name + the field subtype + + + The relative order of the field name. + The relative order of the field name. Fields are sorted in ascending order. + a number indicating the order of the field + + + + Sets the initial visibility of the field. + + + + + Indication if the field value should be editable in the viewer. + + + + + Sets the value of the collection item. + + + + + + Sets the value of the collection item. + + + + Sets the value of the collection item. + + + + Adds a prefix for the Collection item. + + Adds a prefix for the Collection item. + You can only use this method after you have set the value of the item. + + + + + + + Creates a Collection Schema dictionary. + + + Adds a Collection field to the Schema. + the name of the collection field + a Collection Field + + + + Constructs a PDF Collection Sort Dictionary. + the key of the field that will be used to sort entries + + + Constructs a PDF Collection Sort Dictionary. + the keys of the fields that will be used to sort entries + + + Defines the sort order of the field (ascending or descending). + true is the default, use false for descending order + + + + Defines the sort order of the field (ascending or descending). + an array with every element corresponding with a name of a field. + + + + Represents the most common properties of color spaces. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + The abstract PdfShading class that represents the Shading Dictionary PDF object. + + + + Creates the + + object from the existing + + with corresponding type. + + + + + from which the + + object will be created. + + + Created + + object. + + + + Gets the shading type. + + int value of + + . + + + + Gets the color space in which colour values shall be expressed. + + + + Color space + + + + + Gets the function PdfObject that represents color transitions + across the shading geometry. + + + + + Function + + + + + Sets the function that represents color transitions + across the shading geometry as one object. + + + The + + to set. + + + + + Sets the function object that represents color transitions + across the shading geometry as an array of functions. + + + The array of + + to be set. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + constants of shading type + ISO-320001 Table 78 + + + + + The int value of function-based shading type + + + The int value of axial shading type + + + The int value of radial shading type + + + The int value of free-form Gouraud-shaded triangle mesh shading type + + + The int value of lattice-form Gouraud-shaded triangle mesh shading type + + + The int value of coons patch meshes shading type + + + The int value of tensor-product patch meshes shading type + + + + The class that extends + + class and is in charge of Shading Dictionary with function-based type, + that defines color at every point in the domain by a specified mathematical function. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + + + the + + , that is used to calculate color transitions. + + + + Creates the new instance of the class. + + the + + , that represents color space in which colour values shall be expressed. + + + the + + , that is used to calculate color transitions. + + + + + Gets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + + + + domain rectangle. + + + + + Sets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + the Xmin coordinate of rectangle. + the Xmax coordinate of rectangle. + the Ymin coordinate of rectangle. + the Ymax coordinate of rectangle. + + + + Sets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + + the + + domain rectangle object to be set. + + + + + Gets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + float[] + of transformation matrix (identical matrix by default). + + + + + Sets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + float[] + of transformation matrix to be set. + + + + + Sets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + + transformation matrix object to be set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with axial type, + that define a colour blend that varies along a linear axis between two endpoints + and extends indefinitely perpendicular to that axis. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + the start coordinate of X axis expressed in the shading's target coordinate space. + the start coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the start point. + + the end coordinate of X axis expressed in the shading's target coordinate space. + the end coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the end point. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + the start coordinate of X axis expressed in the shading's target coordinate space. + the start coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the start point. + + the end coordinate of X axis expressed in the shading's target coordinate space. + the end coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the end point. + + + the array of two booleans that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the + + of four number four numbers [x0 y0 x1 y1] that specified the starting + and the endings coordinates of thew axis, expressed in the shading's target coordinate space. + + + the + + object, that is used to calculate color transitions. + + + + + Gets the Coords object - a + + of four numbers [x0 y0 x1 y1] that specified the starting + and the endings coordinates of thew axis, expressed in the shading's target coordinate space. + + + the + + Coords object. + + + + Sets the Choords object with the four params expressed in the shading's target coordinate space. + the start coordinate of X axis to be set. + the start coordinate of Y axis to be set. + the end coordinate of X axis to be set. + the end coordinate of Y axis to be set. + + + + Sets the Choords object with the + + of four numbers [x0 y0 x1 y1], + that specified the starting and the endings coordinates of thew axis, + expressed in the shading's target coordinate space. + + + the Chords + + to be set. + + + + + Gets the array of two + float + [t0, t1] that represent the limiting values of a parametric + variable t, that becomes an input of color function(s). + + + + float[] + of Domain object ([0.0 1.0] by default) + + + + + Sets the Domain with the array of two + float + [t0, t1] that represent the limiting values + of a parametric variable t, that becomes an input of color function(s). + + first limit of variable t + second limit of variable t + + + + Gets the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + boolean[] + of Extended object ([false false] by default) + + + + + Sets the Extend object with the two + boolean + value. + + if true will extend shading beyond the starting point of Coords + if true will extend shading beyond the ending point of Coords + + + + The class that extends + + class and is in charge of Shading Dictionary with radial type, + that define a colour blend that varies between two circles. + This type of shading shall not be used with an Indexed colour space + + + + + Creates the new instance of the class from the existing + + object. + + + - + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the start circle. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the end circle. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the start circle. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the end circle. + + + the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + + the + + of of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + the + + object, that is used to calculate color transitions. + + + + + Gets the coords + + object - an array of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + the + + coords object. + + + + Sets the coords object. + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + + + Sets the coords + + object - an array of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + - + + choords object to be set. + + + + + Gets the array of two + float + [t0, t1] that represent the limiting values of a parametric + variable t, that becomes an input of color function(s). + + + + float[] + of Domain object ([0.0 1.0] by default) + + + + + Sets the Domain with the array of two + float + [t0, t1] that represent the limiting values + of a parametric variable t, that becomes an input of color function(s). + + first limit of variable t + second limit of variable t + + + + Gets the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending circles of the axis, respectively. + + + + boolean[] + of Extended object ([false false] by default) + + + + + Sets the Extend object with the two + boolean + value. + + if true will extend shading beyond the starting circle of Coords. + if true will extend shading beyond the ending circle of Coords. + + + + The class that extends + + class and is in charge of Shading Dictionary with + free-form Gouraud-shaded triangle mesh type. + The area to be shaded is defined by a path composed entirely of triangles. + The colour at each vertex of the triangles is specified, + and a technique known as Gouraud interpolation is used to colour the interiors. + The object shall be represented as stream containing a sequence of vertex data. + Each vertex is specified by the following values, in the order shown: + f x y c1 … cn where: + f - the vertex’s edge flag, that determines the vertex is connected to other vertices of the triangle mesh. + For full description + ISO-320001 Paragph 8.7.4.5.5 + x, y - vertex’s horizontal and vertical coordinates, expressed in the shading’s target coordinate space. + c1…cn - vertex’s colour components. + If the shading dictionary includes a Function entry, only a single parametric value, t, + shall be specified for each vertex in place of the colour components c1…cn. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, or 2. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, or 2. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1 or 2. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1 or 2. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + lattice-form Gouraud-shaded triangle mesh type. + This type is similar to + + but instead of using free-form geometry, + the vertices are arranged in a pseudorectangular lattice, + which is topologically equivalent to a rectangular grid. + The vertices are organized into rows, which need not be geometrically linear. + The verticals data in stream is similar to + + , + except there is no edge flag. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of vertices in each row of the lattice (shall be > 1). + The number of rows need not be specified. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of vertices in each row of the lattice (shall be > 1). + The number of rows need not be specified. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of vertices in each row of the lattice. + the number of vertices. Can only be greater than 1. + + + Sets the number of vertices in each row of the lattice. + + Sets the number of vertices in each row of the lattice. + The number of rows need not be specified. + + the number of vertices to be set. Shall be greater than 1. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + Coons Patch mesh type. + This type of shading is constructed from one or more colour patches, each bounded by four cubic Bézier curves. + Degenerate Bézier curves are allowed and are useful for certain graphical effects. + At least one complete patch shall be specified. + The shape of patch is defined by 12 control points. + Colours are specified for each corner of the unit square, + and bilinear interpolation is used to fill in colours over the entire unit square. + Coordinates are mapped from the unit square into a four-sided patch whose sides are not necessarily linear. + The mapping is continuous: the corners of the unit square map to corners of the patch + and the sides of the unit square map to sides of the patch. + For the format of data stream, that defines patches + ISO-320001 Table 85 + . + If the shading dictionary contains a Function entry, the colour data for each corner of a patch + shall be specified by a single parametric value t rather than by n separate colour components c1…cn. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + Tensor-Product Patch mesh type. + This type of shading is identical to + + , except that it's based on a + bicubic tensor-product patch defined by 16 control points. + For the format of data stream, that defines patches + ISO-320001 Table 86 + . + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + Compression constants for . + + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + + Encryption constants for + + . + + + + Type of encryption. + + + Type of encryption. + + + Type of encryption. + + + Type of encryption. + + + Mask to separate the encryption type from the encryption mode. + + + Add this to the mode to keep the metadata in clear text. + + + Add this to the mode to keep encrypt only the embedded files. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + StandardEncryption properties + + + PublicKeyEncryption properties + + + Sets the encryption options for the document. + + Sets the encryption options for the document. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + ALLOW_PRINTING, ALLOW_MODIFY_CONTENTS, ALLOW_COPY, ALLOW_MODIFY_ANNOTATIONS, + ALLOW_FILL_IN, ALLOW_SCREENREADERS, ALLOW_ASSEMBLY and ALLOW_DEGRADED_PRINTING. + The permissions can be combined by ORing them. + See + + . + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256 + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + + + Sets the certificate encryption options for the document. + + Sets the certificate encryption options for the document. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ORed to output the metadata in cleartext + See + + . + + the public certificates to be used for the encryption + the user permissions for each of the certificates + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256. + + + + Graphics state parameter dictionary wrapper. + + Graphics state parameter dictionary wrapper. + See ISO-320001, 8.4.5 Graphics State Parameter Dictionaries. + + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + + Create instance of graphics state parameter dictionary wrapper + by existed + PdfDictionary + object + + instance of graphics state parameter dictionary + + + Create default instance of graphics state parameter dictionary + + + + Gets line width value, + LW + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets line width value, + LW + key. + + + a + float + value. + + object itself. + + + + Gets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + + + + Sets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + object itself. + + + + Sets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + object itself. + + + + Gets line join style value, + LJ + key. + + 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. + + + + Sets line join style value, + LJ + key. + + 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. + object itself. + + + + Gets miter limit value, + ML key + . See also line join style. + + + a + float + value if exist, otherwise + + . + + + + + Sets miter limit value, + ML key + . See also line join style. + + + a + float + value. + + object itself. + + + + Gets line dash pattern value, + D + key. + + + a + PdfArray + , that represents line dash pattern. + + + + + Sets line dash pattern value, + D + key. + + + a + PdfArray + , that represents line dash pattern. + + object itself. + + + + Gets rendering intent value, + RI + key. + Valid values are: + AbsoluteColorimetric + , + RelativeColorimetric + , + Saturation + , + Perceptual + . + + + a + PdfName + instance. + + + + + Sets rendering intent value, + RI + key. + + + a + PdfName + instance, Valid values are: + AbsoluteColorimetric + , + RelativeColorimetric + , + Saturation + , + Perceptual + . + + object itself. + + + + Get overprint flag value for stroking operations, + OP + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Set overprint flag value for stroking operations, + OP + key. + + + + + , for applying overprint for stroking operations. + + object itself. + + + + Get overprint flag value for non-stroking operations, + op + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Set overprint flag value for non-stroking operations, + op + key. + + + + + , for applying overprint for non-stroking operations. + + object itself. + + + + Get overprint control mode, + OPM + key. + + + an + int + value if exist, otherwise + + . + + + + + Set overprint control mode, + OPM + key. + + + an + int + value, see ISO-320001, 8.6.7 Overprint Control. + + object itself. + + + + Gets font and size, + Font + key. + + + a + + of the form + [font size] + , where + font + shall be an indirect reference to a font dictionary and + size + shall be a number expressed in text space units. + + + + + Sets font and size, + Font + key. + + + a + + of the form + [font size] + , where + + shall be an indirect reference to a font dictionary and + size + shall be a number expressed in text space units. + + object itself. + + + + Gets the black-generation function value, + BG + . + + + a + + , should be + + . + + + + + Sets the black-generation function value, + BG + . + + + a + + , shall be + + . + + object itself. + + + + Gets the black-generation function value or + Default + , + BG2 + key. + + + a + + value, should be either + + or + + . + + + + + Sets the black-generation function value or + Default + , + BG2 + key. + Note, if both + BG + and + BG2 + are present in the same graphics state parameter dictionary, + BG2 + takes precedence. + + + a + + value, shall be either + + or + Default + . + + object itself. + + + + Gets the undercolor-removal function, + UCR + key. + + + a + + , should be + + . + + + + + Sets the undercolor-removal function, + UCR + key. + + + a + + , shall be + + . + + object itself. + + + + Gets the undercolor-removal function value or + Default + , + UCR2 + key. + + + a + + value, should be either + + or + + . + + + + + Sets the undercolor-removal function value or + Default + , + UCR2 + key. + Note, if both + UCR + and + UCR2 + are present in the same graphics state parameter dictionary, + UCR2 + takes precedence. + + + a + + value, shall be either + + or + Default + . + + object itself. + + + + Gets the transfer function value, + TR + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the transfer function value, + TR + key. + + + a + + , shall be either + + , + + or + + . + + object itself. + + + + Gets the transfer function value or + Default + , + TR2 + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the transfer function value or + Default + , + TR2 + key. + Note, if both + TR + and + TR2 + are present in the same graphics state parameter dictionary, + TR2 + takes precedence. + + + a + + , shall be either + + , + + , + + or + Default + . + + object itself. + + + + Gets the halftone dictionary, stream or + Default + , + HT + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the halftone or + Default + , + HT + key. + + + a + + , shall be either + + , + + or + + . + + object itself. + + + + Gets + HTP + key. + + + + + Sets + HTP + key. + + + a + + . + + object itself. + + + + Gets the flatness tolerance value, + FL + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the flatness tolerance value, + FL + key. + + + a + float + value. + + object itself. + + + + Gets the smoothness tolerance value, + SM + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the smoothness tolerance value, + SM + key. + + + a + float + value. + + object itself. + + + + Gets value of an automatic stroke adjustment flag, + SA + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets value of an automatic stroke adjustment flag, + SA + key. + + + a + boolean + value. + + object itself. + + + + Gets the current blend mode for the transparent imaging model, + BM + key. + + + a + + , should be either + + or + + . + + + + + Sets the current blend mode for the transparent imaging model, + BM + key. + + + a + + , shall be either + + or + + . + + object itself. + + + + Gets the current soft mask, + SMask + key. + + + a + + , should be either + + or + + . + + + + + Sets the current soft mask, + SMask + key. + + + a + + , shall be either + + or + + . + + object itself. + + + + Gets the current alpha constant, specifying the constant shape or constant opacity value + for stroking operations in the transparent imaging model, + CA + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the current alpha constant, specifying the constant shape or constant opacity value + for stroking operations in the transparent imaging model, + CA + key. + + + a + float + value. + + object itself. + + + + Gets the current alpha constant, specifying the constant shape or constant opacity value + for non-stroking operations in the transparent imaging model, + ca + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the current alpha constant, specifying the constant shape or constant opacity value + for non-stroking operations in the transparent imaging model, + ca + key. + + + a + float + value. + + object itself. + + + + Gets the alpha source flag (“alpha is shape”), specifying whether the current soft mask and alpha constant + shall be interpreted as shape values ( + + ) or opacity values ( + + ), + AIS + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets the alpha source flag (“alpha is shape”), specifying whether the current soft mask and alpha constant + shall be interpreted as shape values ( + + ) or opacity values ( + + ), + AIS + key. + + + if + + - alpha as shape values, if + + — as opacity values. + + object itself. + + + + Gets the text knockout flag, which determine the behaviour of overlapping glyphs + within a text object in the transparent imaging model, + TK + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets the text knockout flag, which determine the behaviour of overlapping glyphs + within a text object in the transparent imaging model, + TK + key. + + + + + if enabled. + + object itself. + + + Puts the value into Graphics state parameter dictionary and associates it with the specified key. + + + Puts the value into Graphics state parameter dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + + + + Handles ASCII85Decode filter + + + + The main interface for creating a new + FilterHandler + + + + Decode the byte[] using the provided filterName. + the bytes that need to be decoded + PdfName of the filter + decode parameters + the dictionary of the stream. Can contain additional information needed to decode the byte[]. + + decoded byte array + + + Decodes the input bytes according to ASCII85. + the byte[] to be decoded + the decoded byte[] + + + Handles ASCIIHexDecode filter + + + Decodes a byte[] according to ASCII Hex encoding. + byte[] to be decoded + decoded byte[] + + + Handles CCITTFaxDecode filter + + + A filter that doesn't modify the stream at all + + + Encapsulates filter behavior for PDF streams. + + Encapsulates filter behavior for PDF streams. Classes generally interace with this + using the static getDefaultFilterHandlers() method, then obtain the desired + + via a lookup. + + + + + The default + + s used by iText + + + + + the default + + s used by iText + + + + Handles FlateDecode filter. + + + A helper to flateDecode. + the input data + + + + to read a correct stream. + + to try to read a corrupted stream. + + the decoded data + + + Input byte array. + PdfDictionary of decodeParams. + a byte array + + + Handles LZWDECODE filter + + + Decodes a byte[] according to the LZW encoding. + byte[] to be decoded + decoded byte[] + + + A class for performing LZW decoding. + + + Creates an LZWDecoder instance. + + + Method to decode LZW compressed data. + The compressed data. + Array to return the uncompressed data in. + + + Initialize the string table. + + + Write out the string just uncompressed. + content to write to the uncompressed data + + + Add a new string to the string table. + stored string + string to be appended to the stored string + + + Add a new string to the string table. + byte[] to store in the string table + + + Append newString to the end of oldString. + string be appended to + string that is to be appended to oldString + combined string + + + Attempt to get the next code. + + Attempt to get the next code. Exceptions are caught to make + this robust to cases wherein the EndOfInformation code has been + omitted from a strip. Examples of such cases have been observed + in practice. + + next code + + + Handles RunLengthDecode filter. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This interface defines logic which can be used to perform a custom copying + operation of a + + . + + + + Copies a page. + + Copies a page. + The new page must already be created before calling this, either in a new + + or in the same + + as the old page. + + the source page + the target page in a target document + + + Type of object to conform. + + + The interface generalizing the layer types (PdfLayer, PdfLayerMembership). + + + Gets the object representing the layer. + the object representing the layer + + + Gets the PdfIndirectReference that represents this layer. + the PdfIndirectReference that represents this layer + + + + An optional content group is a dictionary representing a collection of graphics + that can be made visible or invisible dynamically by users of viewer applications. + + + An optional content group is a dictionary representing a collection of graphics + that can be made visible or invisible dynamically by users of viewer applications. + In iText they are referenced as layers. +

+ To be able to be wrapped with this + + the + + must be indirect. +
+
+ + Used for titling group of objects but not actually grouping them. + + + Creates a new layer by existing dictionary, which must be an indirect object. + the layer dictionary, must have an indirect reference. + + + Creates a new layer by its name and document. + the layer name + the PdfDocument which the layer belongs to + + + Creates a title layer. + + Creates a title layer. A title layer is not really a layer but a collection of layers + under the same title heading. + + the title text + the PdfDocument + the title layer + + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + That is, the state of at most one optional content group + in the array should be ON at a time: if one group is turned + ON, all others must be turned OFF. + + the PdfDocument + the radio group + + + Adds a child layer. + Adds a child layer. Nested layers can only have one parent. + the child layer + + + Gets the parent of this layer, be it a title layer, or a usual one. + the parent of the layer, or null if it has no parent + + + Sets the name of the layer to be displayed in the Layers panel. + the name of the layer. + + + Gets the initial visibility of the layer when the document is opened. + the initial visibility of the layer + + + Sets the initial visibility of the layer when the document is opened. + the initial visibility of the layer + + + Gets whether the layer is currently locked or not. + + Gets whether the layer is currently locked or not. If the layer is locked, + it will not be possible to change its state (on/off) in a viewer. + + true of the layer is currently locked, false otherwise. + + + Use this method to lock an optional content group. + + Use this method to lock an optional content group. + The state of a locked group cannot be changed through the user interface + of a viewer application. Producers can use this entry to prevent the visibility + of content that depends on these groups from being changed by users. + + + + Gets the layer visibility in Acrobat's layer panel + the layer visibility in Acrobat's layer panel + + + Sets the visibility of the layer in Acrobat's layer panel. + + Sets the visibility of the layer in Acrobat's layer panel. If false + the layer cannot be directly manipulated by the user. Note that any children layers will + also be absent from the panel. + + the visibility of the layer in Acrobat's layer panel + + + Gets a collection of current intents specified for this layer. + + Gets a collection of current intents specified for this layer. + The default value is PdfName.View, so it will be the only element of the + resultant colletion if no intents are currently specified. + + the collection of intents. + + + Sets the intents of the layer. + the list of intents. + + + + Used by the creating application to store application-specific + data associated with this optional content group. + + a text string specifying the application that created the group + + a string defining the type of content controlled by the group. Suggested + values include but are not limited to Artwork, for graphic-design or publishing + applications, and Technical, for technical designs such as building plans or + schematics + + + + + Specifies the language of the content controlled by this + optional content group + + + a language string which specifies a language and possibly a locale + (for example, es-MX represents Mexican Spanish) + + + used by viewer applications when there is a partial match but no exact + match between the system language and the language strings in all usage dictionaries + + + + + Specifies the recommended state for content in this + group when the document (or part of it) is saved by a viewer application to a format + that does not support optional content (for example, an earlier version of + PDF or a raster image format). + + the export state + + + + Specifies a range of magnifications at which the content + in this optional content group is best viewed. + + + the minimum recommended magnification factors at which the group + should be ON. A negative value will set the default to 0 + + + the maximum recommended magnification factor at which the group + should be ON. A negative value will set the largest possible magnification supported by the + viewer application + + + + + Specifies that the content in this group is intended for + use in printing + + + a name specifying the kind of content controlled by the group; + for example, Trapping, PrintersMarks and Watermark + + + indicates that the group should be + set to that state when the document is printed from a viewer application + + + + + Indicates that the group should be set to that state when the + document is opened in a viewer application. + + the view state + + + + Specifies one or more users for whom this optional content group + is primarily intended. + + a name that can be Ind (individual), Ttl (title), or Org (organization). + + one or more text strings representing + the name(s) of the individual, position or organization + + + + Indicates that the group contains a pagination artifact. + + one of the following names: "HF" (Header Footer), + "FG" (Foreground), "BG" (Background), or "L" (Logo). + + + + + Gets the indirect reference to the current layer object, + making it indirect first if necessary. + + the indirect reference to the object representing the layer + + + Gets the title of the layer if it is a title layer, or null if it is a usual layer. + + + Gets the list of the current child layers of the layer. + + Gets the list of the current child layers of the layer. + BE CAREFUL! Do not try to add a child layer using the resultant child list, + use #addChild method instead. + + the list of the current child layers, null if the layer has no children. + + + Creates a title layer without registering it in PdfOCProperties. + the title of the layer + the document this title layer belongs to + the created layer + + + Gets the /Usage dictionary, creating a new one if necessary. + the /Usage dictionary + + + + Content typically belongs to a single optional content group, + and is visible when the group is ON and invisible when it is OFF. + + + Content typically belongs to a single optional content group, + and is visible when the group is ON and invisible when it is OFF. To express more + complex visibility policies, content should not declare itself to belong to an optional + content group directly, but rather to an optional content membership dictionary + represented by this class. +

+ To be able to be wrapped with this + + the + + must be indirect. +
+
+ + Creates a new, empty membership layer. + + + Creates a new PdfLayerMembership instance by its PdfDictionary, which must be an indirect object. + + the membership dictionary, must have an indirect reference. + + + Gets the collection of the layers this layer membership operates with. + + + Adds a new layer to the current layer membership. + the layer to be added + + + + Sets the visibility policy for content belonging to this + membership dictionary. + + + Sets the visibility policy for content belonging to this + membership dictionary. Possible values are AllOn, AnyOn, AnyOff and AllOff. + AllOn - Visible only if all of the entries are ON. + AnyOn - Visible if any of the entries are ON. + AnyOff - Visible if any of the entries are OFF. + AllOff - Visible only if all of the entries are OFF. + The default value is AnyOn. + + the visibility policy + + + + Gets the visibility policy for content belonging to this + optional content membership dictionary. + + + + + Sets the visibility expression for content belonging to this + membership dictionary. + + + A (nested) array of which the first value is /And, /Or, or /Not + followed by a series of indirect references to OCGs or other visibility + expressions. + + + + + Gets the visibility expression for content belonging to this + optional content membership dictionary. + + + + + This class represents /OCProperties entry if pdf catalog and manages + the layers of the pdf document. + + + This class represents /OCProperties entry if pdf catalog and manages + the layers of the pdf document. +

+ To be able to be wrapped with this + + the + + must be indirect. +
+
+ + Creates a new PdfOCProperties instance. + the document the optional content belongs to + + + + Creates a new PdfOCProperties instance by the dictionary it represents, + the dictionary must be an indirect object. + + the dictionary of optional content properties, must have an indirect reference. + + + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + That is, the state of at most one optional content group + in the array should be ON at a time: if one group is turned + ON, all others must be turned OFF. + + the radio group + + + Fills the underlying PdfDictionary object with the current layers and their settings. + + Fills the underlying PdfDictionary object with the current layers and their settings. + Note that it completely regenerates the dictionary, so your direct changes to the dictionary + will not take any affect. + + the resultant dictionary + + + Gets the list of all the layers currently registered in the OCProperties. + + Gets the list of all the layers currently registered in the OCProperties. + Note that this is just a new list and modifications to it will not affect anything. + + + + This method registers a new layer in the OCProperties. + the new layer + + + + Gets the order of the layers in which they will be displayed in the layer view panel, + including nesting. + + + + Populates the /AS entry in the /D dictionary. + + + Reads the layers from the document to be able to modify them in the future. + + + Reads the /Order in the /D entry and initialized the parent-child hierarchy. + + + + An array specifying a visibility expression, used to compute visibility + of content based on a set of optional content groups. + + + + Constructs a new PdfVisibilityExpression instance by its raw PdfArray. + the array representing the visibility expression + + + Creates a visibility expression. + should be either PdfName#And, PdfName#Or, or PdfName#Not + + + Adds a new operand to the current visibility expression. + the layer operand to be added. + + + Adds a new opeand to the current visibility expression. + the PdfVisibilityExpression instance operand to be added + + + Enumeration of all the PDF/A conformance levels. + + + A representation of an array as described in the PDF specification. + + A representation of an array as described in the PDF specification. A PdfArray can contain any + subclass of + + . + + + + If object is flushed the indirect reference is kept here. + + + Indicate same special states of PdfIndirectObject or PdfObject like @see Free, @see Reading, @see Modified. + + + + Gets object type. + object type. + + + Flushes the object to the document. + + + Flushes the object to the document. + indicates whether object can be placed into object stream. + + + Gets the indirect reference associated with the object. + + Gets the indirect reference associated with the object. + The indirect reference is used when flushing object to the document. + + indirect reference. + + + Checks if object is indirect. + + Checks if object is indirect. +
+ Note: + Return value + + doesn't necessarily mean that indirect reference of this object + is not null at the moment. Object could be marked as indirect and + be transformed to indirect on flushing. +
+ E.g. all PdfStreams are transformed to indirect objects when they are written, but they don't always + have indirect references at any given moment. +
+ + returns + + if object is indirect or is to be indirect in the resultant document. + +
+ + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Indicates is the object has been flushed or not. + true is object has been flushed, otherwise false. + + + Indicates is the object has been set as modified or not. + Indicates is the object has been set as modified or not. Useful for incremental updates (e.g. appendMode). + + true is object has been set as modified, otherwise false. + + + Creates clone of the object which belongs to the same document as original object. + + Creates clone of the object which belongs to the same document as original object. + New object shall not be used in other documents. + + cloned object. + + + Copies object to a specified document. + + Copies object to a specified document. +

+ NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. +
+ document to copy object to. + copied object. +
+ + Copies object to a specified document. + + Copies object to a specified document. +

+ NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. +
+ document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. +
+ + + Checks if this PdfObject is of the type + PdfNull. + + true or false + + + + Checks if this PdfObject is of the type + PdfBoolean. + + true or false + + + + Checks if this PdfObject is of the type + PdfNumber. + + true or false + + + + Checks if this PdfObject is of the type + PdfString. + + true or false + + + + Checks if this PdfObject is of the type + PdfName. + + true or false + + + + Checks if this PdfObject is of the type + PdfArray. + + true or false + + + + Checks if this PdfObject is of the type + PdfDictionary. + + true or false + + + + Checks if this PdfObject is of the type + PdfStream. + + true or false + + + + Checks if this PdfObject is of the type + PdfIndirectReference. + + + true if this is an indirect reference, + otherwise false + + + + + Checks if this PdfObject is of the type + PdfLiteral. + + + true if this is a literal, + otherwise false + + + + Creates new instance of object. + new instance of object. + + + Checks state of the flag of current object. + special flag to check + true if the state was set. + + + Sets special states of current object. + special flag of current object + + + Clear state of the flag of current object. + special flag state to clear + + + Copies object content from object 'from'. + object to copy content from. + document to copy object to. + + + + Create a new, empty PdfArray. + + + + Create a new PdfArray with the provided PdfObject as the first item in the + array. + + first item in the array + + + Create a new PdfArray. + Create a new PdfArray. The array is filled with the items of the provided PdfArray. + + PdfArray containing items that will added to this PdfArray + + + Create a new PdfArray. + + Create a new PdfArray. The array is filled with the four values of the Rectangle in the + follozing order: left, bottom, right, top. + + Rectangle whose 4 values will be added to the PdfArray + + + Create a new PdfArray. + Create a new PdfArray. The PdfObjects in the list will be added to the PdfArray. + + List of PdfObjects to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the float[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the double[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the int[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the boolean[] as + + . + + values to be added to this PdfArray + + + Create a new PdfArray filled with a list of Strings. + + Create a new PdfArray filled with a list of Strings. The boolean value decides if the Strings + should be added as + + (true) or as + + (false). + + list of strings to be added to the list + indicates whether the strings should be added as PdfName (true) or as PdfString (false) + + + + + Returns an iterator over an array of PdfObject elements. +
+ NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get {@link PdfIndirectReference} instances for the indirect objects value, + you shall use {@link #get(int, boolean)} method. +
+ an enumerator. +
+ + + Returns an iterator over an array of PdfObject elements. + + + + Adds the Collection of PdfObjects. + the Collection of PdfObjects to be added + + + + + Adds content of the + PdfArray + . + + + the + PdfArray + to be added + + + + + Gets the (direct) PdfObject at the specified index. + index of the PdfObject in the PdfArray + the PdfObject at the position in the PdfArray + + + Sets the PdfObject at the specified index in the PdfArray. + the position to set the PdfObject + PdfObject to be added + true if the operation changed the PdfArray + + + + Adds the specified PdfObject at the specified index. + Adds the specified PdfObject at the specified index. All objects after this index will be shifted by 1. + + position to insert the PdfObject + PdfObject to be added + + + + Removes the PdfObject at the specified index. + position of the PdfObject to be removed + true if the operation changes the PdfArray + + + + Gets the first index of the specified PdfObject. + PdfObject to find the index of + index of the PdfObject + + + + Returns a sublist of this PdfArray, starting at fromIndex (inclusive) and ending at toIndex (exclusive). + + the position of the first element in the sublist (inclusive) + + the position of the last element in the sublist (exclusive) + + List of PdfObjects + + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + true is to extract direct object always. + + + Returns the element at the specified index as a PdfArray. + Returns the element at the specified index as a PdfArray. If the element isn't a PdfArray, null is returned. + + position of the element to be returned + the element at the index as a PdfArray + + + Returns the element at the specified index as a PdfDictionary. + Returns the element at the specified index as a PdfDictionary. If the element isn't a PdfDictionary, null is returned. + + position of the element to be returned + the element at the index as a PdfDictionary + + + Returns the element at the specified index as a PdfStream. + Returns the element at the specified index as a PdfStream. If the element isn't a PdfStream, null is returned. + + position of the element to be returned + the element at the index as a PdfStream + + + Returns the element at the specified index as a PdfNumber. + Returns the element at the specified index as a PdfNumber. If the element isn't a PdfNumber, null is returned. + + position of the element to be returned + the element at the index as a PdfNumber + + + Returns the element at the specified index as a PdfName. + Returns the element at the specified index as a PdfName. If the element isn't a PdfName, null is returned. + + position of the element to be returned + the element at the index as a PdfName + + + Returns the element at the specified index as a PdfString. + Returns the element at the specified index as a PdfString. If the element isn't a PdfString, null is returned. + + position of the element to be returned + the element at the index as a PdfString + + + Returns the element at the specified index as a PdfBoolean. + Returns the element at the specified index as a PdfBoolean. If the element isn't a PdfBoolean, null is returned. + + position of the element to be returned + the element at the index as a PdfBoolean + + + Returns the first four elements of this array as a PdfArray. + + Returns the first four elements of this array as a PdfArray. The first four values need to be + PdfNumbers, if not a PdfException will be thrown. + + Rectangle of the first four values + if one of the first values isn't a PdfNumber + + + + Release content of PdfArray. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Use this method to get the Optional Content Properties Dictionary. + + Use this method to get the Optional Content Properties Dictionary. + Note that if you call this method, then the PdfDictionary with OCProperties will be + generated from PdfOCProperties object right before closing the PdfDocument, + so if you want to make low-level changes in Pdf structures themselves (PdfArray, PdfDictionary, etc), + then you should address directly those objects, e.g.: + + PdfCatalog pdfCatalog = pdfDoc.getCatalog(); + PdfDictionary ocProps = pdfCatalog.getAsDictionary(PdfName.OCProperties); + // manipulate with ocProps. + + Also note that this method is implicitly called when creating a new PdfLayer instance, + so you should either use hi-level logic of operating with layers, + or manipulate low-level Pdf objects by yourself. + + + true to create new /OCProperties entry in catalog if not exists, + false to return null if /OCProperties entry in catalog is not present. + + the Optional Content Properties Dictionary + + + PdfCatalog will be flushed in PdfDocument.close(). + PdfCatalog will be flushed in PdfDocument.close(). User mustn't flush PdfCatalog! + + + + This method sets a page layout of the document + + + + + + This method sets the document viewer preferences, specifying the way the document shall be displayed on the + screen + + + + + + This method gets Names tree from the catalog. + type of the tree (Dests, AP, EmbeddedFiles etc). + + returns + + + + + This method returns the NumberTree of Page Labels + + returns + + + + + An entry specifying the natural language, and optionally locale. + + An entry specifying the natural language, and optionally locale. Use this + to specify the Language attribute on a Tagged Pdf element. + For the content usage dictionary, use PdfName.Language + + + + + Sets collection dictionary that a conforming reader shall use to enhance the presentation of file attachments + stored in the PDF document. + + + + + + + True indicates that getOCProperties() was called, may have been modified, + and thus its dictionary needs to be reconstructed. + + + + this method return map containing all pages of the document with associated outlines. + + + + This methods adds new name to the Dests NameTree. + This methods adds new name to the Dests NameTree. It throws an exception, if the name already exists. + + Name of the destination. + + An object destination refers to. Must be an array or a dictionary with key /D and array. + See ISO 32000-1 12.3.2.3 for more info. + + + + This methods adds a new name to the specified NameTree. + This methods adds a new name to the specified NameTree. It throws an exception, if the name already exists. + + key in the name tree + value in the name tree + type of the tree (Dests, AP, EmbeddedFiles etc). + + + This method returns a complete outline tree of the whole document. + + if the flag is true, the method read the whole document and creates outline tree. + If false the method gets cached outline tree (if it was cached via calling getOutlines method before). + + + fully initialized + + object. + + + + Indicates if the catalog has any outlines + + + + , if there are outlines and + + otherwise. + + + + This flag determines if Outline tree of the document has been built via calling getOutlines method. + + This flag determines if Outline tree of the document has been built via calling getOutlines method. If this flag is false all outline operations will be ignored + + state of outline mode. + + + This method removes all outlines associated with a given page + + + + This method sets the root outline element in the catalog. + + + + This is the length of a dash. + + + This is the length of a gap. + + + This is the phase. + + + + + Constructs a + PdfDate + -object. + + + the date that has to be turned into a + PdfDate + >-object + + + + + Constructs a + PdfDate + -object, representing the current day and time. + + + + Gives the W3C format of the PdfDate. + a formatted date + + + + Gives the W3C format of the + PdfDate + . + + the date in the format D:YYYYMMDDHHmmSSOHH'mm' + a formatted date + + + + Converts a PDF string representing a date into a + DateTime + . + + the PDF string representing a date + + a + DateTime + representing the date + + + + + Beginning with BaseVersion 1.7, the extensions dictionary lets developers + designate that a given document contains extensions to PDF. + + + Beginning with BaseVersion 1.7, the extensions dictionary lets developers + designate that a given document contains extensions to PDF. The presence + of the extension dictionary in a document indicates that it may contain + developer-specific PDF properties that extend a particular base version + of the PDF specification. + The extensions dictionary enables developers to identify their own extensions + relative to a base version of PDF. Additionally, the convention identifies + extension levels relative to that base version. The intent of this dictionary + is to enable developers of PDF-producing applications to identify company-specific + specifications (such as this one) that PDF-consuming applications use to + interpret the extensions. + + + + An instance of this class for Adobe 1.7 Extension level 3. + + + An instance of this class for ETSI 1.7 Extension level 2. + + + An instance of this class for ETSI 1.7 Extension level 5. + + + The prefix used in the Extensions dictionary added to the Catalog. + + + The base version. + + + The extension level within the base version. + + + Creates a PdfDeveloperExtension object. + the prefix referring to the developer + the number of the base version + the extension level within the baseverion. + + + Gets the prefix name. + a PdfName + + + Gets the baseVersion name. + a PdfName + + + Gets the extension level within the baseVersion. + an integer + + + + Generations the developer extension dictionary corresponding + with the prefix. + + a PdfDictionary + + + A representation of a Dictionary as described by the PDF Specification. + + A representation of a Dictionary as described by the PDF Specification. A Dictionary is a mapping between keys + and values. Keys are + PdfNames + and the values are + PdfObjects + . Each key can only be associated with one value and + adding a new value to an existing key will override the previous value. A value of null should be ignored when + the PdfDocument is closed. + + + + Creates a new PdfDictionary instance. + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified Map into this + PdfDictionary instance. + + Map containing values to be inserted into PdfDictionary + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified Set into this + PdfDictionary instance. + + Set containing Map#Entries to be inserted into PdfDictionary + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified PdfDictionary + into this PdfDictionary instance. + + PdfDictionary containing values to be inserted into PdfDictionary + + + Returns the number of key-value pairs in this PdfDictionary. + number of key-value pairs + + + Returns true if there are no key-value pairs in this PdfDictionary. + true if there are no key-value pairs in this PdfDictionary + + + Returns true if this PdfDictionary contains the specified key. + the key to check + true if key is present in the PdfDictionary + + + Returns true if this PdfDictionary contains the specified value. + the value to check + true if value is present in the PdfDictionary + + + Returns the value associated to this key. + the key of which the associated value needs to be returned + the value associated with this key + + + Returns the value associated to this key as a PdfArray. + Returns the value associated to this key as a PdfArray. If the value isn't a PdfArray, null is returned. + + the key of which the associated value needs to be returned + PdfArray associated with this key + + + Returns the value associated to this key as a PdfDictionary. + Returns the value associated to this key as a PdfDictionary. If the value isn't a PdfDictionary, null is returned. + + the key of which the associated value needs to be returned + PdfDictionary associated with this key + + + Returns the value associated to this key as a PdfStream. + Returns the value associated to this key as a PdfStream. If the value isn't a PdfStream, null is returned. + + the key of which the associated value needs to be returned + PdfStream associated with this key + + + Returns the value associated to this key as a PdfNumber. + Returns the value associated to this key as a PdfNumber. If the value isn't a PdfNumber, null is returned. + + the key of which the associated value needs to be returned + PdfNumber associated with this key + + + Returns the value associated to this key as a PdfName. + Returns the value associated to this key as a PdfName. If the value isn't a PdfName, null is returned. + + the key of which the associated value needs to be returned + PdfName associated with this key + + + Returns the value associated to this key as a PdfString. + Returns the value associated to this key as a PdfString. If the value isn't a PdfString, null is returned. + + the key of which the associated value needs to be returned + PdfString associated with this key + + + Returns the value associated to this key as a PdfBoolean. + Returns the value associated to this key as a PdfBoolean. If the value isn't a PdfBoolean, null is returned. + + the key of which the associated value needs to be returned + PdfBoolean associated with this key + + + Returns the value associated to this key as a Rectangle. + + Returns the value associated to this key as a Rectangle. If the value isn't a PdfArray of which the + firt four elements are PdfNumbers, null is returned. + + the key of which the associated value needs to be returned + PdfArray associated with this key + + + + Returns the value associated to this key as a Float. + Returns the value associated to this key as a Float. If the value isn't a Pdfnumber, null is returned. + + the key of which the associated value needs to be returned + Float associated with this key + + + Returns the value associated to this key as an Integer. + Returns the value associated to this key as an Integer. If the value isn't a Pdfnumber, null is returned. + + the key of which the associated value needs to be returned + Integer associated with this key + + + Returns the value associated to this key as a Boolean. + Returns the value associated to this key as a Boolean. If the value isn't a PdfBoolean, null is returned. + + the key of which the associated value needs to be returned + Boolean associated with this key + + + Inserts the value into this PdfDictionary and associates it with the specified key. + + Inserts the value into this PdfDictionary and associates it with the specified key. If the key is already + present in this PdfDictionary, this method will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + the previous PdfObject associated with this key + + + Removes the specified key from this PdfDictionary. + key to be removed + the removed value associated with the specified key + + + Inserts all the key-value pairs into this PdfDictionary. + PdfDictionary holding the key-value pairs to be copied + + + Removes all key-value pairs from this PdfDictionary. + + + Returns all the keys of this PdfDictionary as a Set. + Set of keys + + + Returns all the values of this map in a Collection. + + if false, collection will contain + + instances + for the indirect objects in dictionary, otherwise it will contain collection of direct objects. + + a Collection holding all the values + + + Returns all the values of this map in a Collection. + + Returns all the values of this map in a Collection. +
+ NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get + + instances for the indirect objects value, + you shall use + + method. +
+ a Collection holding all the values +
+ + Returns all the values of this map in a Collection. + + Returns all the values of this map in a Collection. In opposite to + + method, + this method will resolve all indirect references in the dictionary and return actual objects in collection. + + a Collection holding all the values + + + Returns a Set holding the key-value pairs as Map#Entry objects. + + Returns a Set holding the key-value pairs as Map#Entry objects. +
+ NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get + + instances for the indirect objects value, + you shall use + + method. +
+ a Set of Map.Entry objects +
+ + Returns a Set holding the key-value pairs as Map#Entry objects. + + Returns a Set holding the key-value pairs as Map#Entry objects. In opposite to + + method, this method will resolve all indirect references in the dictionary and return actual objects as values of + entries in the collection. + + a Set of Map.Entry objects + + + Creates clones of the dictionary in the current document. + + Creates clones of the dictionary in the current document. + It's possible to pass a list of keys to exclude when cloning. + + list of objects to exclude when cloning dictionary. + cloned dictionary. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Copies dictionary to specified document. + + Copies dictionary to specified document. + It's possible to pass a list of keys to exclude when copying. + + document to copy dictionary to. + list of objects to exclude when copying dictionary. + + + + + copied dictionary. + + + true is to extract direct object always. + + + This method merges different fields from two dictionaries into the current one + a dictionary whose fields should be merged into the current dictionary. + + + Release content of PdfDictionary. + + + Main enter point to work with PDF document. + + + Currently active page. + + + Default page size. + + Default page size. + New page by default will be created with this size. + + + + PdfWriter associated with the document. + + PdfWriter associated with the document. + Not null if document opened either in writing or stamping mode. + + + + PdfReader associated with the document. + + PdfReader associated with the document. + Not null if document is opened either in reading or stamping mode. + + + + XMP Metadata for the document. + + + Document catalog. + + + Document trailed. + + + Document info. + + + Document version. + + + List of indirect objects used in the document. + + + flag determines whether to write unused objects to result document + + + Yet not copied link annotations from the other documents. + + Yet not copied link annotations from the other documents. + Key - page from the source document, which contains this annotation. + Value - link annotation from the source document. + + + + Open PDF document in reading mode. + PDF reader. + + + Open PDF document in writing mode. + + Open PDF document in writing mode. + Document has no pages when initialized. + + PDF writer + + + Opens PDF document in the stamping mode. + + Opens PDF document in the stamping mode. +
+
+ PDF reader. + PDF writer. +
+ + Open PDF document in stamping mode. + PDF reader. + PDF writer. + properties of the stamping process + + + Use this method to set the XMP Metadata. + The xmpMetadata to set. + + + + + + + + + Gets XMPMetadata. + + + Gets XMPMetadata or create a new one. + if true, create a new empty XMPMetadata if it did not present. + existed or newly created XMPMetadata byte array. + + + Gets PdfObject by object number. + object number. + + + + or + + , if object not found. + + + + Get number of indirect objects in the document. + number of indirect objects. + + + Gets the page by page number. + page number. + page by page number. + + + + Gets the + + instance by + + . + + + + + that present page. + + + page by + + . + + + + Get the first page of the document. + first page of the document. + + + Gets the last page of the document. + last page. + + + Creates and adds new page to the end of document. + added page + + + Creates and adds new page with the specified page size. + page size of the new page + added page + + + Creates and inserts new page to the document. + position to addPage page to + inserted page + + in case + page + is flushed + + + + Creates and inserts new page to the document. + position to addPage page to + page size of the new page + inserted page + + in case + page + is flushed + + + + Adds page to the end of document. + page to add. + added page. + + in case + + is flushed + + + + Inserts page to the document. + position to addPage page to + page to addPage + inserted page + + in case + + is flushed + + + + Gets number of pages of the document. + number of pages. + + + Gets page number by page. + the page. + page number. + + + + Gets page number by + + . + + + + + that present page. + + + page number by + + . + + + + + Removes the first occurrence of the specified page from this document, + if it is present. + + + Removes the first occurrence of the specified page from this document, + if it is present. Returns true if this document + contained the specified element (or equivalently, if this document + changed as a result of the call). + + page to be removed from this document, if present + true if this document contained the specified page + + + Removes page from the document by page number. + the one-based index of the PdfPage to be removed + the page that was removed from the list + + + Gets document information dictionary. + document information dictionary. + + + Gets default page size. + default page size. + + + Sets default page size. + page size to be set as default. + + + + + + + + + + + + + + + + + + + + + + Gets + PdfWriter + associated with the document. + + PdfWriter associated with the document. + + + + Gets + PdfReader + associated with the document. + + PdfReader associated with the document. + + + + Returns + + if the document is opened in append mode, and + + otherwise. + + + + + if the document is opened in append mode, and + + otherwise. + + + + Creates next available indirect reference. + created indirect reference. + + + Gets PDF version. + PDF version. + + + Gets PDF catalog. + PDF catalog. + + + Close PDF document. + + + Gets close status of the document. + true, if the document has already been closed, otherwise false. + + + Gets tagged status of the document. + true, if the document has tag structure, otherwise false. + + + + Gets + + of tagged document. + + + + + in case tagged document, otherwise false. + + + + + + Gets next parent index of tagged document. + -1 if document is not tagged, or >= 0 if tagged. + + + + + + Gets document + TagStructureContext + . + The document must be tagged, otherwise an exception will be thrown. + + + document + TagStructureContext + . + + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + start of the range of pages to be copied. + end of the range of pages to be copied. + a document to copy pages to. + a position where to insert copied pages. + list of copied pages + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + a position where to insert copied pages. + a copier which bears a special copy logic. May be NULL + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + a copier which bears a special copy logic. May be null. + list of new copied pages. + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a position where to insert copied pages. + list of new copied pages + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a position where to insert copied pages. + a copier which bears a special copy logic. May be NULL + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + list of copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a copier which bears a special copy logic + list of copied pages + + + + Checks, whether + + method will close associated PdfReader. + + + true, + + method is going to close associated PdfReader, otherwise false. + + + + + Sets, whether + + method shall close associated PdfReader. + + + true, + + method shall close associated PdfReader, otherwise false. + + + + + Checks, whether + + method will close associated PdfWriter. + + + true, + + method is going to close associated PdfWriter, otherwise false. + + + + + Sets, whether + + method shall close associated PdfWriter. + + + true, + + method shall close associated PdfWriter, otherwise false. + + + + + Checks, whether + + will flush unused objects, + e.g. unreachable from PDF Catalog. By default - false. + + + false, if + + shall not flush unused objects, otherwise true. + + + + + Sets, whether + + shall flush unused objects, + e.g. unreachable from PDF Catalog. + + + false, if + + shall not flush unused objects, otherwise true. + + + + This method returns a complete outline tree of the whole document. + + if the flag is true, the method read the whole document and creates outline tree. + If false the method gets cached outline tree (if it was cached via calling getOutlines method before). + + + fully initialize + + object. + + + + This method initializes an outline tree of the document and sets outline mode to true. + + + This methods adds new name in the Dests NameTree. + This methods adds new name in the Dests NameTree. It throws an exception, if the name already exists. + + Name of the destination. + + An object destination refers to. Must be an array or a dictionary with key /D and array. + See ISO 32000-1 12.3.2.3 for more info. + + + + Gets static copy of cross reference table. + + + Gets document trailer. + document trailer. + + + + Adds + + that shall specify the colour characteristics of output devices + on which the document might be rendered. + + + + + to add. + + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + An object to conform. + type of object to conform. + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + an object to conform. + type of object to conform. + + + + associated with an object to check. + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + + a + + object to conform. + + + + + associated with an object to check. + + + + Adds file attachment at document level. + the file description + an array with the file. + the actual file name stored in the pdf + mime type of the file + the optional extra file parameters such as the creation or modification date + + if + + , + + will be added. Shall be one of: + + , + + , + + , + + or + + . + + + + Adds file attachment at document level. + the file description + the path to the file. + the actual file name stored in the pdf + mime type of the file + + if + + , + + will be added. Shall be one of: + + , + + , + + , + + or + + . + + + + + Adds file attachment at document level. + the file description + + + + object. + + + + This method retrieves the page labels from a document as an array of String objects. + + + + list of page labels if they were found, or + + otherwise + + + + Indicates if the document has any outlines + + + + , if there are outlines and + + otherwise. + + + + Sets the flag indicating the presence of structure elements that contain user properties attributes. + + the user properties flag + + + Gets list of indirect references. + list of indirect references. + + + + Initialize + + . + + + + Save the link annotation in a temporary storage for further copying. + + just copied + + link annotation belongs to. + + + + + itself. + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + + + + Mark an object with + + . + + an object to mark. + + + Flush an object. + object to flush. + indicates whether object can be placed into object stream. + on error. + + + Initializes document. + + new pdf version of the resultant file if stamper is used and the version needs to be changed, + or + + otherwise + + + + Adds custom XMP metadata extension. + Adds custom XMP metadata extension. Useful for PDF/UA, ZUGFeRD, etc. + + + + to add custom metadata to. + + + + Updates XMP metadata. + + Updates XMP metadata. + Shall be override. + + + + + Update XMP metadata values from + + . + + + + + List all newly added or loaded fonts + + List of + PdfFonts + . + + + + Checks page before adding and add. + one-base index of the page. + + + + to add. + + + + Checks page before adding. + + + + to add. + + + + checks whether a method is invoked at the closed document + + + + Gets + + instance. + + + + + instance. + + + + This method removes all annotation entries from form fields associated with a given page. + to remove from. + + + This method copies all given outlines + outlines to be copied + document where outlines should be copied + + + This method gets all outlines to be copied including parent outlines + current outline + a Set of outlines to be copied + + + This method copies create new outlines in the Document to copy. + - Set of outlines to be copied + - new parent outline + - old parent outline + + + + + + Paulo Soares + Kazuya Ujihara + + + Creates the encryption. + + Creates the encryption. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + if the document is already open + + + Creates the certificate encryption. + + Creates the certificate encryption. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + the public certificates to be used for the encryption + the user permissions for each of the certificates + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. + + if the document is already open + + + document id which was used for encryption. Could be null, if encryption doesn't rely on document id. + + + + Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm. + + owner password of the encrypted document. + user password, or null if not a standard encryption handler was used. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This class takes any PDF and returns exactly the same but + encrypted. + + + This class takes any PDF and returns exactly the same but + encrypted. All the content, links, outlines, etc, are kept. + It is also possible to change the info dictionary. + + + + Entry point to encrypt a PDF document. + the read PDF + the output destination + + encryption properties. See + + . + + + an optional + String + map to add or change + the info dictionary. Entries with + + values delete the key in the original info dictionary + + + + Entry point to encrypt a PDF document. + the read PDF + the output destination + + encryption properties. See + + . + + + + Give you a verbose analysis of the permissions. + the permissions value of a PDF file + a String that explains the meaning of the permissions value + + + Tells you if printing is allowed. + the permissions value of a PDF file + true if printing is allowed + + + Tells you if modifying content is allowed. + the permissions value of a PDF file + true if modifying content is allowed + + + Tells you if copying is allowed. + the permissions value of a PDF file + true if copying is allowed + + + Tells you if modifying annotations is allowed. + the permissions value of a PDF file + true if modifying annotations is allowed + + + Tells you if filling in fields is allowed. + the permissions value of a PDF file + true if filling in fields is allowed + + + Tells you if repurposing for screenreaders is allowed. + the permissions value of a PDF file + true if repurposing for screenreaders is allowed + + + Tells you if document assembly is allowed. + the permissions value of a PDF file + true if document assembly is allowed + + + Tells you if degraded printing is allowed. + the permissions value of a PDF file + true if degraded printing is allowed + + + Object number. + + + Object generation. + + + PdfObject that current PdfIndirectReference instance refers to. + + + Indirect reference number of object stream containing refersTo object. + + Indirect reference number of object stream containing refersTo object. + If refersTo is not placed into object stream - objectStreamNumber = 0. + + + + + Offset in a document of the + refersTo + object. + If the object placed into object stream then it is an object index inside object stream. + + + + PdfDocument object belongs to. + PdfDocument object belongs to. For direct objects it is null. + + + Gets direct object and try to resolve indirects chain. + + Gets direct object and try to resolve indirects chain. +

+ Note: If chain of references has length of more than 32, + this method return 31st reference in chain. +

+
+
+ + Gets refersTo object offset in a document. + object offset in a document. If refersTo object is in object stream then -1. + + + Gets refersTo object index in the object stream. + object index in a document. If refersTo object is not in object stream then -1. + + + Releases indirect reference from the document. + + Releases indirect reference from the document. Remove link to the referenced indirect object. +

+ Note: Be careful when using this method. Do not use this method for wrapper objects, + it can be cause of errors. + Free indirect reference could be reused for a new indirect object. +

+
+
+ + Gets a PdfWriter associated with the document object belongs to. + PdfWriter. + + + Gets a PdfReader associated with the document object belongs to. + PdfReader. + + + Sets special states of current object. + special flag of current object + + + PdfName for the abbreviation of FlateDecode. + + PdfName for the abbreviation of FlateDecode. For the Flatness Tolerance PdfName use + + (Uppercase 'L') + + + + PdfName for Flatness Tolerance. + + PdfName for Flatness Tolerance. For the PdfName with the FlateDecode abbreviation use + + (Lowercase 'L') + + + + map strings to all known static names + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Creates the NameTree of current Document + Document catalog + the type of tree. Dests Tree, AP Tree etc. + + + Representation of the null object in the PDF specification. + + + Creates a PdfNull instance. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Creates the NumberTree of current Document + Document catalog + the type of tree. ParentTree or PageLabels. + + + Representation of a stream as described in the PDF Specification. + + + + Constructs a + PdfStream + -object. + + + initial content of + PdfOutputStream + . + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Creates a PdfStream instance. + bytes to write to the PdfStream + + + Creates an efficient stream. + + Creates an efficient stream. No temporary array is ever created. The + InputStream + is totally consumed but is not closed. The general usage is: +

+

+            PdfDocument document = ?;
+            InputStream in = ?;
+            PdfStream stream = new PdfStream(document, in, PdfOutputStream.DEFAULT_COMPRESSION);
+            ?
+            stream.flush();
+            in.close();
+            
+
+ the data to write to this stream + the compression level (0 = best speed, 9 = best compression, -1 is default) + +
+ + Creates an efficient stream. + + Creates an efficient stream. No temporary array is ever created. The + InputStream + is totally consumed but is not closed. The general usage is: +

+

+            PdfDocument document = ?;
+            InputStream in = ?;
+            PdfStream stream = new PdfStream(document, in);
+            stream.flush();
+            in.close();
+            
+
+ the data to write to this stream +
+ + + Constructs a + PdfStream + -object. + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Creates an empty PdfStream instance. + + + Gets output stream. + output stream + + + Gets compression level of this PdfStream. + + Gets compression level of this PdfStream. + For more details @see + + . + + compression level. + + + Sets compression level of this PdfStream. + + Sets compression level of this PdfStream. + For more details @see + + . + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Gets decoded stream bytes. + byte[] + + + Gets stream bytes. + true if to get decoded stream bytes, otherwise false. + + byte content of the + PdfStream + . Byte content will be + + , + if the + PdfStream + was created by + InputStream + . + + + + Sets bytes as stream's content. + + Sets bytes as stream's content. + Could not be used with streams which were created by InputStream. + + new content for stream; if null then stream's content will be discarded + + + Sets or appends bytes to stream content. + + Sets or appends bytes to stream content. + Could not be used with streams which were created by InputStream. + + + new content for stream; if null and append is false then + stream's content will be discarded + + + if set to true then bytes will be appended to the end, + rather then replace original content + + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Update length manually in case its correction. + + Update length manually in case its correction. + PdfReader.checkPdfStreamLength() + method. + + + + Release content of PdfStream. + + + Max number of objects in object stream. + + + Current object stream size (number of objects inside). + + + Stream containing object indices, a heading part of object stream. + + + This constructor is for reusing ByteArrayOutputStreams of indexStream and outputStream. + + This constructor is for reusing ByteArrayOutputStreams of indexStream and outputStream. + NOTE Only for internal use in PdfWriter! + + previous PdfObjectStream. + + + Adds object to the object stream. + object to add. + + + Gets object stream size (number of objects inside). + object stream size. + + + + Document outline object + See ISO-320001, 12.3.3 Document Outline. + + + + A flag for displaying the outline item’s text with italic font. + + + A flag for displaying the outline item’s text with bold font. + + + Create instance of document outline. + the text that shall be displayed on the screen for this item. + Outline dictionary + + + + the outline belongs to. + + + + Create instance of document outline. + the text that shall be displayed on the screen for this item. + Outline dictionary + parent outline. + + + This constructor creates root outline in the document. + + + + + + + Gets title of the outline. + String value. + + + + Sets title of the outline with + + encoding, + Title + key. + + String value. + + + + Sets color for the outline entry’s text, + C + key. + + + + + + + + + Sets text style for the outline entry’s text, + F + key. + + + Could be either + + or + + . Default value is + 0 + . + + + + Gets content dictionary. + + + + . + + + + Gets list of children outlines. + + List of + + . + + + + Gets parent outline. + + + + . + + + + + Gets + + . + + + + + . + + + + + Adds + + for the outline, + Dest + key. + + + instance of + + . + + + + + Adds + + for the outline, + A + key. + + + instance of + + . + + + + Defines if the outline needs to be closed or not. + + Defines if the outline needs to be closed or not. + By default, outlines are open. + + if false, the outline will be closed by default + + + + Adds a new + PdfOutline + with specified parameters as a child to existing + PdfOutline + and put it to specified position in the existing + PdfOutline + children list. + + an outline title + + a position in the current outline child List where a new outline should be added. + If the position equals -1, then the outline will be put in the end of children list. + + just created outline + + + + Adds an + PdfOutline + as a child to existing + PdfOutline + and put it in the end of the existing + PdfOutline + children list. + + an outline title + just created outline + + + + Adds an + PdfOutline + as a child to existing + PdfOutline + and put it to the end of the existing + PdfOutline + children list. + + an outline to add. + just created outline + + + Clear list of children. + + + + Sets + + . + + + instance of + + . + + + + Remove this outline from the document. + + + + Specify the colour characteristics of output devices on which the document might be rendered + See ISO 32000-1 14.11.5: Output Intents. + + + + Creates output intent dictionary. + + Creates output intent dictionary. Null values are allowed to + suppress any key. + By default output intent subtype is GTS_PDFA1, use setter to change it. + + + + Document associated with PdfOutputStream. + + + Contains the business logic for cryptography. + + + Automatically rotate new content if the page has a rotation ( is disabled by default ) + + + + See + + . + + + + Gets page size, defined by media box object. + Gets page size, defined by media box object. This method doesn't take page rotation into account. + + + + + that specify page size. + + + + Gets page size, considering page rotation. + + + + that specify size of rotated page. + + + + Gets the number of degrees by which the page shall be rotated clockwise when displayed or printed. + + + Gets the number of degrees by which the page shall be rotated clockwise when displayed or printed. + Shall be a multiple of 90. + + + + int + number of degrees. Default value: 0 + + + + Sets the page rotation. + + the + int + number of degrees by which the page shall be rotated clockwise + when displayed or printed. Shall be a multiple of 90. + + + this + + instance. + + + + + Gets the content stream at specified 0-based index in the Contents object + + . + The situation when Contents object is a + + is treated like a one element array. + + + the + int + index of returned + + . + + + + + object at specified index. + + if the index is out of range + + + + Gets the size of Contents object + + . + The situation when Contents object is a + + is treated like a one element array. + + + the + int + size of Contents object, or 1 if Contents object is a + + . + + + + + Returns the Contents object if it is + + , or first stream in the array if it is + + . + + + first + + in Contents object, or + + if Contents is empty. + + + + + Returns the Contents object if it is + + , or last stream in the array if it is + + . + + + first + + in Contents object, or + + if Contents is empty. + + + + + Creates new + + object and puts it at the beginning of Contents array + (if Contents object is + + it will be replaced with one-element array). + + + Created + + object. + + + + + Creates new + + object and puts it at the end of Contents array + (if Contents object is + + it will be replaced with one-element array). + + + Created + + object. + + + + + Gets the + + wrapper object for this page resources. + If page doesn't have resource object, then it will be inherited from page's parents. + If neither parents nor page has the resource object, then the new one is created and added to page dictionary. +

+ NOTE: If you'll try to modify the inherited resources, then the new resources object will be created, + so you won't change the parent's resources. + This new object under the wrapper will be added to page dictionary on + + , + or you can add it manually with this line, if needed:
+ getPdfObject().put(PdfName.Resources, getResources().getPdfObject()); +
+ + + + wrapper of the page. + +
+ + + Sets + + object. + + + + + to set. + + + this + + instance. + + + + Sets the XMP Metadata. + + the + byte[] + of XMP Metadata to set. + + in case of writing error. + + + Serializes XMP Metadata to byte array and sets it. + + the + + object to set. + + + the + + used while serialization. + + in case of XMP Metadata serialization error. + in case of writing error. + + + Serializes XMP Metadata to byte array and sets it. + Serializes XMP Metadata to byte array and sets it. Uses padding equals to 2000. + + the + + object to set. + + in case of XMP Metadata serialization error. + in case of writing error. + + + Gets the XMP Metadata object. + + + + object, that represent XMP Metadata. + + + + + Copies page to the specified document. + + Copies page to the specified document. +

+ NOTE: Works only for pages from the document opened in reading mode, otherwise an exception is thrown. +
+ a document to copy page to. + + copied + + . + +
+ + Copies page to the specified document. + + Copies page to the specified document. +

+ NOTE: Works only for pages from the document opened in reading mode, otherwise an exception is thrown. +
+ a document to copy page to. + + a copier which bears a specific copy logic. May be + + + + copied + + . + +
+ + Copies page as FormXObject to the specified document. + a document to copy to. + + copied + + object. + + + + + + Gets the + + that owns that page, or + + if such document isn't exist. + + + + + that owns that page, or + + if such document isn't exist. + + + + Flushes page and it's content stream. + + Flushes page and it's content stream. +
+
+ If the page belongs to the document which is tagged, page flushing also triggers flushing of the tags, + which are considered to belong to the page. The logic that defines if the given tag (structure element) belongs + to the page is the following: if all the marked content references (dictionary or number references), that are the + descenders of the given structure element, belong to the current page - the tag is considered + to belong to the page. If tag has descenders from several pages - it is flushed, if all other pages except the + current one are flushed. +
+
+ + Flushes page and its content stream. + + Flushes page and its content stream. If flushContentStreams is true, all content streams that are + rendered on this page (like FormXObjects, annotation appearance streams, patterns) and also all images associated + with this page will also be flushed. +
+ For notes about tag structure flushing see + PdfPage#flush() method + . +
+
+ If PdfADocument is used, flushing will be applied only if flushContentStreams is true. +
+ + if true all content streams that are rendered on this page (like form xObjects, + annotation appearance streams, patterns) and also all images associated with this page + will be flushed. + +
+ + + Gets + + object specified by page's Media Box, that defines the boundaries of the physical medium + on which the page shall be displayed or printed + + + + + object specified by page Media Box, expressed in default user space units. + + in case of any error while reading MediaBox object. + + + + Sets the Media Box object, that defines the boundaries of the physical medium + on which the page shall be displayed or printed. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + specified by page's CropBox, that defines the visible region of default user space. + When the page is displayed or printed, its contents shall be clipped (cropped) to this rectangle + and then shall be imposed on the output medium in some implementation-defined manner. + + + the + + object specified by pages's CropBox, expressed in default user space units. + MediaBox by default. + + + + Sets the CropBox object, that defines the visible region of default user space. + + Sets the CropBox object, that defines the visible region of default user space. + When the page is displayed or printed, its contents shall be clipped (cropped) to this rectangle + and then shall be imposed on the output medium in some implementation-defined manner. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Sets the ArtBox object, that define the extent of the page’s meaningful content + (including potential white space) as intended by the page’s creator. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + object specified by page's ArtBox, that define the extent of the page’s + meaningful content (including potential white space) as intended by the page’s creator. + + + the + + object specified by page's ArtBox, expressed in default user space units. + CropBox by default. + + + + Sets the TrimBox object, that define the intended dimensions of the finished page after trimming. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + object specified by page's TrimBox object, + that define the intended dimensions of the finished page after trimming. + + + the + + object specified by page's TrimBox, expressed in default user space units. + CropBox by default. + + + + Get decoded bytes for the whole page content. + byte array. + + in case of any + IOException). + + + + Gets decoded bytes of a certain stream of a page content. + index of stream inside Content. + byte array. + + in case of any + IOException). + + + + Calculates and returns next available MCID reference. + calculated MCID reference. + in case of not tagged document. + + + + Gets + + key of the page’s entry in the structural parent tree. + + + + + key of the page’s entry in the structural parent tree. + + + + Helper method to add an additional action to this page. + + Helper method to add an additional action to this page. + May be used in chain. + + + a + + specifying the name of an additional action + + + the + + to add as an additional action + + + this + + instance. + + + + + Checks if page contains the specified annotation. + + the + + to check. + + + + + if page contains specified annotation and + + otherwise. + + + + Adds specified annotation to the end of annotations array and tagged it. + + Adds specified annotation to the end of annotations array and tagged it. + May be used in chain. + + + the + + to add. + + + this + + instance. + + + + + Adds specified + + to specified index in annotations array with or without autotagging. + May be used in chain. + + + the index at which specified annotation will be added. If + -1 + then annotation will be added + to the end of array. + + + the + + to add. + + + if + + the added annotation will be autotagged.
+ (see + + ) + + + this + + instance. + +
+ + Removes an annotation from the page. + + Removes an annotation from the page. +

+ NOTE: If document is tagged, PdfDocument's PdfTagStructure instance will point at annotation tag parent after method call. +
+ an annotation to be removed. + + this + + instance. + +
+ + + Gets the number of + + associated with this page. + + + the + int + number of + + associated with this page. + + + + This method gets outlines of a current page + + return all outlines of a current page + + + + true - if in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. On the rotated page this would look like if new content ignores page rotation. + + + + + If true - defines that in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. + + + If true - defines that in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. On the rotated page this would look like if new content ignores page rotation. + Default value - + + . + + - true to ignore rotation of the new content on the rotated page. + + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + this + + instance. + + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + The value of the numeric portion for the first page label in the range. Must be greater or + equal 1. + + + this + + instance. + + + + + Helper method that associate specified value with specified key in the underlined + + . + May be used in chain. + + + the + + key with which the specified value is to be associated. + + + the + + value to be associated with the specified key. + + + this + + object. + + + + + This flag is meaningful for the case, when page rotation is applied and ignorePageRotationForContent + is set to true. + + + This flag is meaningful for the case, when page rotation is applied and ignorePageRotationForContent + is set to true. NOTE: It is needed for the internal usage. +

+ This flag defines if inverse matrix (which rotates content into the opposite direction from page rotation + direction in order to give the impression of the not rotated text) is already applied to the page content stream. + See + +
+ true, if inverse matrix is already applied, false otherwise. +
+ + NOTE: For internal usage! Use this method only if you know what you are doing. + + NOTE: For internal usage! Use this method only if you know what you are doing. +

+ This method is called when inverse matrix (which rotates content into the opposite direction from page rotation + direction in order to give the impression of the not rotated text) is applied to the page content stream. + See + +
+
+ + + Algorithm for construction + + tree + + + + Create PdfPages tree. + + + PdfCatalog + + + + + Returns the + PdfPage + at the specified position in this list. + + one-based index of the element to return + + the + PdfPage + at the specified position in this list + + + + + Returns the + PdfPage + by page's PdfDictionary. + + page's PdfDictionary + + the + PdfPage + object, that wraps + + . + + + + Gets total number of @see PdfPages. + total number of pages + + + + Returns the index of the first occurrence of the specified page + in this tree, or 0 if this tree does not contain the page. + + + + + Returns the index of the first occurrence of the page in this tree + specified by it's PdfDictionary, or 0 if this tree does not contain the page. + + + + + Appends the specified + PdfPage + to the end of this tree. + + + + PdfPage + + + + + Insert + PdfPage + into specific one-based position. + + one-base index of the page + + + + to insert. + + + + Removes the page at the specified position in this tree. + + Removes the page at the specified position in this tree. + Shifts any subsequent elements to the left (subtracts one from their + indices). + + the one-based index of the PdfPage to be removed + the page that was removed from the list + + + Generate PdfPages tree. + + root + + + in case empty document + + + Constructs a new PdfReader. + source of bytes for the reader + properties of the created reader + + + + Reads and parses a PDF document. + + the + InputStream + containing the document. The stream is read to the + end but is not closed + + properties of the created reader + on error + + + Reads and parses a PDF document. + + the + InputStream + containing the document. Stream is closed automatically, when document is closed, + if user doesn't want to close stream, he should set closeStream=false; + + on error + + + Reads and parses a PDF document. + the file name of the document + properties of the created reader + on error + + + Reads and parses a PDF document. + the file name of the document + on error + + + + + + If any exception generated while reading XRef section, PdfReader will try to rebuild it. + true, if PdfReader rebuilt Cross-Reference section. + + + + Some documents contain hybrid XRef, for more information see "7.5.8.4 Compatibility with Applications + That Do Not Support Compressed Reference Streams" in PDF 32000-1:2008 spec. + + true, if the document has hybrid Cross-Reference section. + + + Indicates whether the document has Cross-Reference Streams. + true, if the document has Cross-Reference Streams. + + + If any exception generated while reading PdfObject, PdfReader will try to fix offsets of all objects. + + true, if PdfReader fixed offsets of PdfObjects. + + + Gets position of the last Cross-Reference table. + -1 if Cross-Reference table has rebuilt, otherwise position of the last Cross-Reference table. + + + Reads and gets stream bytes. + true if to get decoded stream bytes, false if to leave it originally encoded. + byte[] + + + + + + + Gets the input stream associated with PdfStream. + + Gets the input stream associated with PdfStream. + User is responsible for closing returned stream. + + true if to get decoded stream, false if to leave it originally encoded. + InputStream + + + + Decode a byte[] applying the filters specified in the provided dictionary using default filter handlers. + + the bytes to decode + the dictionary that contains filter information + the decoded bytes + if there are any problems decoding the bytes + + + Decode a byte[] applying the filters specified in the provided dictionary using the provided filter handlers. + + the bytes to decode + the dictionary that contains filter information + the map used to look up a handler for each type of filter + the decoded bytes + if there are any problems decoding the bytes + + + + Gets a new file instance of the original PDF + document. + + a new file instance of the original PDF document + + + Provides the size of the opened file. + The size of the opened file. + + + + Gets the declared Pdf/A conformance level of the source document that is being read. + + Gets the declared Pdf/A conformance level of the source document that is being read. + Note that this information is provided via XMP metadata and is not verified by iText. + + + conformance level of the source document, or + + if no Pdf/A + conformance level information is specified. + + + + Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 encryption algorithm. + + user password, or null if not a standard encryption handler was used or if ownerPasswordUsed wasn't use to open the document. + + + + Parses the entire PDF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Utility method that checks the provided byte source to see if it has junk bytes at the beginning. + + + Utility method that checks the provided byte source to see if it has junk bytes at the beginning. If junk bytes + are found, construct a tokeniser that ignores the junk. Otherwise, construct a tokeniser for the byte source as it is + + the source to check + a tokeniser that is guaranteed to start at the PDF header + if there is a problem reading the byte source + + + + + + + + + + Wrapper class that represent resource dictionary - that define named resources + used by content streams operators. + + + Wrapper class that represent resource dictionary - that define named resources + used by content streams operators. (ISO 32000-1, 7.8.3 Resource Dictionaries) + + + + Creates new instance from given dictionary. + + the + + object from which the resource object will be created. + + + + Creates new instance from empty dictionary. + + + Adds font to resources and register PdfFont in the document for further flushing. + added font resource name. + + + + Adds + + object to the resources. + + + the + + to add. + + added image resource name. + + + + Adds + + to the resources as image. + + + the + + to add. + + added image resources name. + + + + Adds + + to the resources as image. + + + the + + to add. Should be + + . + + added image resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added form resource name. + + + + Adds + + to the resources as form. + + + the + + to add. + + added form resources name. + + + + Adds + + to the resources as form. + + + the + + to add. Should be + + . + + added form resources name. + + + + Adds the given Form XObject to the current instance of + + . + + Form XObject. + Preferred name for the given Form XObject. + + the + + of the newly added resource + + + + + Adds + + object to the resources. + + + the + + to add. + + added graphics state parameter dictionary resource name. + + + + Adds + + to the resources as graphics state parameter dictionary. + + + the + + to add. + + added graphics state parameter dictionary resources name. + + + + Adds + + to the resources as graphics state parameter dictionary. + + + the + + to add. Should be + + . + + added graphics state parameter dictionary resources name. + + + + Adds + + to the resources as properties list. + + + the + + to add. + + added properties list resources name. + + + + Adds + + to the resources as properties list. + + + the + + to add. Should be + + . + + added properties list resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added color space resource name. + + + + Adds + + to the resources as color space. + + + the + + to add. + + added color space resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added pattern resource name. + + + + Adds + + to the resources as pattern. + + + the + + to add. + + added pattern resources name. + + + + Adds + + to the resources as pattern. + + + the + + to add. Should be + + or + + . + + added pattern resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added shading resource name. + + + + Adds + + to the resources as shading dictionary. + + + the + + to add. + + added shading dictionary resources name. + + + + Adds + + to the resources as shading dictionary. + + + the + + to add. Should be + + or + + . + + added shading dictionary resources name. + + + Sets the default color space (see ISO-320001 Paragraph 8.6.5.6). + + the name of Default Color Space. Should be + + , + + , or + + . + + the value of the default color space to be set. + + + Sets the value of default Gray Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + Sets the value of default RGB Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + Sets the value of default CMYK Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + + + Gets the names of all the added resources. + the name of all the added resources. + + + Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). + the array of predefined procedure set names. + + + Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). + the array of predefined procedure set names to be set. + + + Gets the names of all resources of specified type. + + the resource type. Should be + + , + + , + + , + + , + + , + + . + + + set of resources name of corresponding type. May be empty. + Will be empty in case of incorrect resource type. + + + + + Get the + + object that that contain resources of specified type. + + + the resource type. Should be + + , + + , + + , + + , + + , + + . + + + the + + object containing all resources of specified type, + or + + in case of incorrect resource type. + + + + Represents a resource name generator. + + Represents a resource name generator. The generator takes into account + the names of already existing resources thus providing us a unique name. + The name consists of the following parts: prefix (literal) and number. + + + + + Constructs an instance of + + class. + + + Type of resource. Should be + + , + + , + + , + + , + + , + + . + + Prefix used for generating names. + + Seed for the value which is appended to the number each time + new name is generated. + + + + + Constructs an instance of + + class. + + + Type of resource. Should be + + , + + , + + , + + , + + , + + . + + Prefix used for generating names. + + + Gets the resource type of generator. + + Type of resource. May be + + , + + , + + , + + , + + , + + . + + + + Generates new (unique) resource name. + + the + + object for which name will be generated. + + new (unique) resource name. + + + + A + PdfString + -class is the PDF-equivalent of a + JAVA- + String + -object. +

+ A string is a sequence of characters delimited by parenthesis. + If a string is too long to be conveniently placed on a single line, it may + be split across multiple lines by using the backslash character (\) at the + end of a line to indicate that the string continues on the following line. + Within a string, the backslash character is used as an escape to specify + unbalanced parenthesis, non-printing ASCII characters, and the backslash + character itself. Use of the \ddd escape sequence is the preferred + way to represent characters outside the printable ASCII character set.
+ This object is described in the 'Portable Document Format Reference Manual + version 1.7' section 3.2.3 (page 53-56). +

+ +

+
+ + Only PdfReader can use this method! + + + Gets the encoding of this string. + + + Sets the encoding of this string. + + Sets the encoding of this string. + NOTE. Byte content will be removed. + + + + + Returns the Unicode + String + value of this + PdfString + -object. + + + + Gets bytes of String-value considering encoding. + byte array + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + + Decrypt content of an encrypted + PdfString + . + + + + + Encrypt content of + value + and set as content. + generateContent() + won't be called. + + @see PdfEncryption + true if value was encrypted, otherwise false. + + + Escape special symbols or convert to hexadecimal string. + + Escape special symbols or convert to hexadecimal string. + This method don't change either + value + or + content + ot the + PdfString + . + + byte array to manipulate with. + Hexadecimal string or string with escaped symbols in byte array view. + + + + + Adds content of the + PdfArray + . + + + the + PdfArray + to be added + + + + + Adds the Collection of PdfObjects. + the Collection of PdfObjects to be added + + + + This class represents all official PDF versions. + + + Creates a PdfVersion class. + major version number + minor version number + + + + Creates a PdfVersion class from a String object if the specified version + can be found. + + version number + PdfVersion of the specified version + + + + Creates a PdfVersion class from a + + object if the specified version + can be found. + + version number + PdfVersion of the specified version + + + This method sets HideToolBar flag to true or false + + + + + This method sets HideMenuBar flag to true or false + + + + + This method sets HideWindowUI flag to true or false + + + + + This method sets FitWindow flag to true or false + + + + + This method sets CenterWindow flag to true or false + + + + + This method sets DisplayDocTitle flag to true or false + + + + + This method sets NonFullScreenPageMode property. + + This method sets NonFullScreenPageMode property. Allowed values are UseNone, UseOutlines, useThumbs, UseOC. + This entry is meaningful only if the value of the PageMode entry in the Catalog dictionary is FullScreen + + + + + + This method sets predominant reading order of text. + + + + + + This method sets the name of the page boundary representing the area of a page that shall be displayed when + viewing the document on the screen. + + + + + + + This method sets the name of the page boundary to which the contents of a page shall be clipped when + viewing the document on the screen. + + + + + + + This method sets the name of the page boundary representing the area of a page that shall be + rendered when printing the document. + + + + + + + This method sets the name of the page boundary to which the contents of a page shall be clipped when + printing the document. + + + + + + + This method sets the page scaling option that shall be selected when a print dialog is displayed for this + document. + + + This method sets the page scaling option that shall be selected when a print dialog is displayed for this + document. Valid values are None and AppDefault. + + + + + + This method sets the paper handling option that shall be used when printing the file from the print dialog. + + + This method sets the paper handling option that shall be used when printing the file from the print dialog. + The following values are valid: Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge. + + + + + + This method sets PickTrayByPDFSize flag to true or false. + + + + + This method sets the page numbers used to initialize the print dialog box when the file is printed. + + + + + + This method sets the number of copies that shall be printed when the print dialog is opened for this file. + + + + + + Currently active object stream. + + Currently active object stream. + Objects are written to the object stream if fullCompression set to true. + + + + Is used to avoid duplications on object copying. + + Is used to avoid duplications on object copying. + It stores hashes of the indirect reference from the source document and the corresponding + indirect references of the copied objects from the new document. + + + + Is used in smart mode to store serialized objects content. + + + + + + + + + Indicates if to use full compression mode. + true if to use full compression, false otherwise. + + + Gets default compression level for @see PdfStream. + + Gets default compression level for @see PdfStream. + For more details @see + + . + + compression level. + + + Sets default compression level for @see PdfStream. + + Sets default compression level for @see PdfStream. + For more details @see + + . + + compression level. + + + Sets the smart mode. + + Sets the smart mode. +

+ In smart mode when resources (such as fonts, images,...) are + encountered, a reference to these resources is saved + in a cache, so that they can be reused. + This requires more memory, but reduces the file size + of the resulting PDF document. + + + + + + + + + + + + + + + +

Gets the current object stream. + object stream. + +
+ + Flushes the object. + Flushes the object. Override this method if you want to define custom behaviour for object flushing. + + object to flush. + indicates whether object can be placed into object stream. + on error. + + + Writes object to body of PDF document. + object to write. + + + + Writes PDF header. + + + Flushes all objects which have not been flushed yet. + + + Flushes all modified objects which have not been flushed yet. + Flushes all modified objects which have not been flushed yet. Used in case incremental updates. + + + Calculates hash code for the indirect reference taking into account the document it belongs to. + object to be hashed. + calculated hash code. + + + Calculates hash code for object to be copied. + + Calculates hash code for object to be copied. + The hash code and the copied object is the stored in @{link copiedObjects} hash map to avoid duplications. + + object to be copied. + calculated hash code. + + + Used in the smart mode. + + Used in the smart mode. + It serializes given object content and tries to find previously copied object with the same content. + If already copied object is not found, it saves current object serialized content into the map. + + an object to check if some other object with the same content was already copied. + indirect reference of the object with the same content, which already has a copy in the new document. + + + + + + + Adds indirect reference to list of indirect objects. + indirect reference to add. + + + Creates next available indirect reference. + created indirect reference. + + + Writes cross reference table and trailer to PDF. + + + + + + + Defines the password which will be used if the document is encrypted with standard encryption. + + Defines the password which will be used if the document is encrypted with standard encryption. + This could be either user or owner password. + + the password to use in order to open the document. + + + Defines the certificate which will be used if the document is encrypted with public key encryption. + + + + Defines the certificate which will be used if the document is encrypted with public key encryption. + + + + Defines if the document will be edited in append mode. + + this + + instance + + + + Defines if the encryption of the original document (if it was encrypted) will be preserved. + + Defines if the encryption of the original document (if it was encrypted) will be preserved. + By default, the resultant document doesn't preserve the original encryption. + + + this + + instance + + + + + Internal helper class which is used to effectively build parent tree and also find marked content references: + for specified page, by MCID or by struct parent index. + + + + Represents parentTree in structTreeRoot. + Represents parentTree in structTreeRoot. It contains only those entries that belong to the already flushed pages. + + + + Contains marked content references for every page. + + Contains marked content references for every page. + If new mcrs are added to the tag structure, these new mcrs are also added to this map. So for each adding or + removing mcr, register/unregister calls must be made (this is done automatically if addKid or removeKid methods + of PdfStructElem are used). + Keys in this map are page references, values - a map which contains all mcrs that belong to the given page. + This inner map of mcrs is of following structure: + * for McrDictionary and McrNumber values the keys are their MCIDs; + * for ObjRef values the keys are struct parent indexes, but with one trick. Struct parent indexes and MCIDs have the + same value domains: the increasing numbers starting from zero. So, in order to store them in one map, for + struct parent indexes simple transformation is applied via + #structParentIndexIntoKey + and + #keyIntoStructParentIndex + . With this we simply store struct parent indexes as negative numbers. + + + + Init ParentTreeHandler. + Init ParentTreeHandler. On init the parent tree is read and stored in this instance. + + + Gets a list of marked content references on page. + + + Creates and flushes parent tree entry for the page. + + Creates and flushes parent tree entry for the page. + Effectively this means that new content mustn't be added to the page. + + + + + for which to create parent tree entry. Typically this page is flushed after this call. + + + + Represents Marked Content Reference (MCR) object wrapper. + + + + To be able to be wrapped with this + + the + + must be indirect. + + + + must be an indirect object. + + + Method to to distinguish struct elements from other elements of the logical tree (like mcr or struct tree root). + + + + Gets attributes object. + + sometimes attributes object may not exist. + Pass + + if you want to create empty dictionary in such case. + The attributes dictionary will be stored inside element. + + attributes dictionary. + + + parent of the current structure element. If parent is already flushed it returns null. + + + Gets list of the direct kids of structure element. + + Gets list of the direct kids of structure element. + If certain kid is flushed, there will be a + + in the list on it's place. + + list of the direct kids of structure element. + + + + To be able to be wrapped with this + + the + + must be indirect. + + + + must be an indirect object. + + + Gets list of the direct kids of StructTreeRoot. + + Gets list of the direct kids of StructTreeRoot. + If certain kid is flushed, there will be a + + in the list on it's place. + + list of the direct kids of StructTreeRoot. + + + Creates and flushes parent tree entry for the page. + + Creates and flushes parent tree entry for the page. + Effectively this means that new content mustn't be added to the page. + + + + + for which to create parent tree entry. Typically this page is flushed after this call. + + + + Gets an unmodifiable collection of marked content references on page. + + Gets an unmodifiable collection of marked content references on page. +

+ NOTE: Do not remove tags when iterating over returned collection, this could + lead to the ConcurrentModificationException, because returned collection is backed by the internal list of the + actual page tags. +
+
+ + + Copies structure to a + + . +

+ NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
+ document to copy structure to. Shall not be current document. + association between original page and copied page. +
+ + + Copies structure to a + + and insert it in a specified position in the document. +

+ NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
+ document to copy structure to. + indicates where the structure to be inserted. + association between original page and copied page. +
+ + Internal helper class which is used to copy tag structure across documents. + + + + Copies structure to a + + . +

+ NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
+ document to copy structure to. Shall not be current document. + association between original page and copied page. +
+ + + Copies structure to a + + and insert it in a specified position in the document. +

+ NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
+ Also, to insert a tagged page into existing tag structure, existing tag structure shouldn't be flushed, otherwise + an exception may be raised. +
+ document to copy structure to. + indicates where the structure to be inserted. + association between original page and copied page. +
+ + + Copies structure to a + + . + + document to cpt structure to. + association between original page and copied page. + + indicates if page2page keys and values represent pages from + + . + + + + the topmost parent added to set. If encountered flushed element - stops and returns this flushed element. + + + + A layout element which can have a role. + + A layout element which can have a role. The name of the role will be + used to tag the element if it is added to a Tagged PDF document. It can also + have + + , metadata for the tag dictionary. + + + + Gets the element's role. + + a + + containing the name of the role + + + + Sets the element's role. + + the new role which the + + should take + + + + + Gets the + accessibility properties + . + + a properties wrapper object specific to a tagged element in Tagged PDF + + + + TagStructureContext + class is used to track necessary information of document's tag structure. + It is also used to make some global modifications of the tag tree like removing or flushing page tags, however + these two methods and also others are called automatically and are for the most part for internal usage. +

+ There shall be only one instance of this class per + PdfDocument + . To obtain instance of this class use + + . +
+
+ + + These two fields define the connections between tags ( + PdfStructElem + ) and + layout model elements ( + IAccessibleElement + ). This connection is used as + a sign that tag is not yet finished and therefore should not be flushed or removed + if page tags are flushed or removed. Also, any + TagTreePointer + could be + immediately moved to the tag with connection via it's connected element + + . + When connection is removed, accessible element role and properties are set to the structure element. + + + + + Do not use this constructor, instead use + + method. +

+ Creates + TagStructureContext + for document. There shall be only one instance of this + class per + PdfDocument + . +
+ the document which tag structure will be manipulated with this class. +
+ + + If forbidUnknownRoles is set to true, then if you would try to add new tag which has not a standard role and + it's role is not mapped through RoleMap, an exception will be raised. + + + If forbidUnknownRoles is set to true, then if you would try to add new tag which has not a standard role and + it's role is not mapped through RoleMap, an exception will be raised. + Default value - true. + + new value of the flag + + current + + instance. + + + + + All document auto tagging logic uses + + returned by this method to manipulate tag structure. + Typically it points at the root tag. This pointer also could be used to tweak auto tagging process + (e.g. move this pointer to the Sect tag, which would result in placing all automatically tagged content + under Sect tag). + + + the + TagTreePointer + which is used for all auto tagging of the document. + + + + + Checks if given + IAccessibleElement + is connected to some tag. + + element to check if it has a connected tag. + true, if there is a tag which retains the connection to the given accessible element. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + + + + IAccessibleElement + which connection to the tag (if there is one) will be removed. + + + current + + instance. + + + + Removes annotation content item from the tag structure. + + Removes annotation content item from the tag structure. + If annotation is not added to the document or is not tagged, nothing will happen. + + + + + instance which points at annotation tag parent if annotation was removed, + otherwise returns null. + + + + Removes content item from the tag structure. + + Removes content item from the tag structure. +
+ Nothing happens if there is no such mcid on given page. +
+ page, which contains this content item + marked content id of this content item + + + TagTreePointer + which points at the parent of the removed content item, or null if there is no + such mcid on given page. + +
+ + Removes all tags that belong only to this page. + + Removes all tags that belong only to this page. The logic which defines if tag belongs to the page is described + at + + . + + page that defines which tags are to be removed + + current + + instance. + + + + + Sets the tag, which is connected with the given accessible element, as a current tag for the given + + . An exception will be thrown, if given accessible element is not connected to any tag. + + an element which has a connection with some tag. + + + + which will be moved to the tag connected to the given accessible element. + + + current + + instance. + + + + Destroys all the retained connections. + + current + + instance. + + + + Flushes the tags which are considered to belong to the given page. + + Flushes the tags which are considered to belong to the given page. + The logic that defines if the given tag (structure element) belongs to the page is the following: + if all the marked content references (dictionary or number references), that are the + descenders of the given structure element, belong to the current page - the tag is considered + to belong to the page. If tag has descenders from several pages - it is flushed, if all other pages except the + current one are flushed. +

+ If some of the page's tags are still connected to the accessible elements, in this case these tags are considered + as not yet finished ones, and they won't be flushed. +
+ a page which tags will be flushed. +
+ + Transforms root tags in a way that complies with the PDF References. + + Transforms root tags in a way that complies with the PDF References. +

+ PDF Reference + 10.7.3 Grouping Elements: +

+ For most content extraction formats, the document must be a tree with a single top-level element; + the structure tree root (identified by the StructTreeRoot entry in the document catalog) must have + only one child in its K (kids) array. If the PDF file contains a complete document, the structure + type Document is recommended for this top-level element in the logical structure hierarchy. If the + file contains a well-formed document fragment, one of the structure types Part, Art, Sect, or Div + may be used instead. +
+
+ + Method for internal usages. + + Method for internal usages. + Essentially, all it does is just making sure that for connected tags properties are + up to date with connected accessible elements properties. + + + + parent of the flushed tag + + + + + Creates + TagTreePointer + instance. After creation + TagTreePointer + points at the root tag. + + the document, at which tag structure this instance will point. + + + A copy constructor. + + the + TagTreePointer + from which current position and page are copied. + + + + + Sets a page which content will be tagged with this instance of + TagTreePointer + . + To tag page content: +
    +
  1. Set pointer position to the tag which will be the parent of the page content item;
  2. +
  3. Call + + to obtain the reference to the current tag;
  4. +
  5. Pass + PdfTagReference + to the + + method of the page's + + to start marked content item;
  6. +
  7. Draw content on + PdfCanvas + ;
  8. +
  9. Use + + to finish marked content item.
  10. +
+
+ + the page which content will be tagged with this instance of + TagTreePointer + . + + + this + + instance. + +
+ + + a page which content will be tagged with this instance of + TagTreePointer + . + + + + + Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, + but rather in the some appearance stream or in the form xObject stream. + + + Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, + but rather in the some appearance stream or in the form xObject stream. In that case, to have a valid tag structure, + one shall set not only the page, on which the content will be rendered, but also the content stream in which + the tagged content will reside. +

+ NOTE: It's important to set a + + for this value, when tagging of this stream content is finished. +
+ + the content stream which content will be tagged with this instance of + TagTreePointer + or + + if content stream tagging is finished. + +
+ + + the content stream which content will be tagged with this instance of + TagTreePointer + . + + + + the document, at which tag structure this instance points. + + + Adds a new tag with given role to the tag structure. + + Adds a new tag with given role to the tag structure. + This method call moves this + TagTreePointer + to the added kid. + + role of the new tag. + + this + + instance. + + + + Adds a new tag with given role to the tag structure. + + Adds a new tag with given role to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
+ This call is equivalent of calling sequentially + + and + + . +
+ zero-based index in kids array of parent tag at which new tag will be added. + role of the new tag. + + this + + instance. + +
+ + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
+ New tag will have a role and attributes defined by the given IAccessibleElement. +
+ accessible element which represents a new tag. + + this + + instance. + +
+ + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
+ New tag will have a role and attributes defined by the given IAccessibleElement. +

+ If keepConnectedToTag is true then a newly created tag will retain the connection with given + accessible element. See + + for more explanations about tag connections concept. +

+ If the same accessible element is connected to the tag and is added twice to the same parent - + this + TagTreePointer + instance would move to connected kid instead of creating tag twice. + But if it is added to some other parent, then connection will be removed. +
+ accessible element which represents a new tag. + defines if to retain the connection between accessible element and the tag. + + + this + + instance. + +
+ + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
+ New tag will have a role and attributes defined by the given IAccessibleElement. + This call is equivalent of calling sequentially + + and + + . +
+ zero-based index in kids array of parent tag at which new tag will be added. + accessible element which represents a new tag. + + this + + instance. + +
+ + + + Adds a new content item for the given + PdfAnnotation + under the current tag. +

+ By default, when annotation is added to the page it is automatically tagged with auto tagging pointer + (see + + ). If you want to add annotation tag manually, be sure to use + + method with false for boolean flag. +
+ + + PdfAnnotation + to be tagged. + + + this + + instance. + +
+ + Sets index of the next added to the current tag kid, which could be another tag or content item. + + Sets index of the next added to the current tag kid, which could be another tag or content item. + By default, new tag is added at the end of the parent kids array. This property affects only the next added tag, + all tags added after will be added with the default behaviour. +

+ This method could be used with any overload of + + method, + with + + and + + . +
+ Keep in mind, that this method set property to the + TagTreePointer + and not to the tag itself, which means + that if you would move the pointer, this property would be applied to the new current tag. +
+ index of the next added kid. + + this + + instance. + +
+ + + Checks if given + IAccessibleElement + is connected to some tag. + See + + for more explanations about tag connections concept. + + element to check if it has a connected tag. + true, if there is a tag which retains the connection to the given accessible element. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + See + + for more explanations about tag connections concept. + + + + IAccessibleElement + which connection to the tag (if there is one) will be removed. + + + this + + instance. + + + + Removes the current tag. + + Removes the current tag. If it has kids, they will become kids of the current tag parent. + This method call moves this + TagTreePointer + to the current tag parent. +

+ You cannot remove root tag, and also you cannot remove any tag if document's tag structure was partially flushed; + in this two cases an exception will be thrown. +
+ + this + + instance. + +
+ + + Moves kid of the current tag to the tag at which given + TagTreePointer + points. + This method doesn't change pointerToNewParent position. + + zero-based index of the current tag's kid to be relocated. + + the + TagTreePointer + which is positioned at the tag which will become kid's new parent. + + + this + + instance. + + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + See + + and + + . + + the reference to the current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + See + + and + + . + + zero-based index in kids array of tag. These indexes define the logical order of the content on the page. + + the reference to the current tag. + + + + Moves this + TagTreePointer + instance to the document root tag. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the parent of the current tag. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + zero-based index of the current tag kid to which pointer will be moved. + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + + role of the current tag kid to which pointer will be moved. + If there is several kids with this role, pointer will be moved to the first kid with such role. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + + if there is several kids with the given role, pointer will be moved to the kid + which is the n'th if you count kids with such role. + + role of the current tag kid to which pointer will be moved. + + this + + instance. + + + + + Gets current element kids roles. + + Gets current element kids roles. + If certain kid is already flushed, at its position there will be a + + . + If kid is content item, at its position there will be "MCR" (Marked Content Reference). + + current element kids roles + + + + Gets connected accessible element for the current tag. + + Gets connected accessible element for the current tag. If tag is not connected to element, behaviour is defined + by the createIfNotExist flag. + See + + for more explanations about tag connections concept. + + + if true, creates an + IAccessibleElement + and connects it to the tag. + + + connected + IAccessibleElement + if there is one (or if it is created), otherwise null. + + + + Gets accessibility properties of the current tag. + accessibility properties of the current tag. + + + Gets current tag role. + current tag role. + + + Sets new role to the current tag. + new role to be set. + + this + + instance. + + + + Indicates if to use full compression (using object streams). + + + Indicates if the writer copy objects in a smart mode. + + Indicates if the writer copy objects in a smart mode. If so PdfDictionary and PdfStream will be hashed + and reused if there's an object with the same content later. + + + + Defines pdf version for the created document. + Defines pdf version for the created document. Default value is PDF_1_7. + version for the document. + + this + WriterProperties + instance + + + + Enables smart mode. + + Enables smart mode. +

+ In smart mode when resources (such as fonts, images,...) are + encountered, a reference to these resources is saved + in a cache, so that they can be reused. + This requires more memory, but reduces the file size + of the resulting PDF document. + + + this + WriterProperties + instance + + + +

+ If true, default XMPMetadata based on + + will be added. + + + this + WriterProperties + instance + +
+ + Defines the level of compression for the document. + + Defines the level of compression for the document. + See + + + + + this + WriterProperties + instance + + + + Defines if full compression mode is enabled. + + Defines if full compression mode is enabled. If enabled, not only the content of the pdf document will be + compressed, but also the pdf document inner structure. + + true - to enable full compression mode, false to disable it + + this + WriterProperties + instance + + + + Sets the encryption options for the document. + + Sets the encryption options for the document. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + See + + . + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256 + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + + this + WriterProperties + instance + + + + Sets the certificate encryption options for the document. + + Sets the certificate encryption options for the document. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + See + + . + + the public certificates to be used for the encryption + the user permissions for each of the certificates + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256. + + + this + WriterProperties + instance + + + + This activates debug mode with pdfDebug tool. + + This activates debug mode with pdfDebug tool. + It causes additional overhead of duplicating document bytes into memory, so use it careful. + NEVER use it in production or in any other cases except pdfDebug. + + + this + WriterProperties + instance + + + + A wrapper for Form XObject. + A wrapper for Form XObject. ISO 32000-1, 8.10 FormXObjects. + + + An abstract wrapper for supported types of XObject. + + + + + + Create + + or + + by + + . + + + + + with either + + or + + + + + + either + + or + + . + + + + Sets the layer this XObject belongs to. + the layer this XObject belongs to. + + + Gets width of XObject. + float value. + + + Gets height of XObject. + float value. + + + + + + Creates a new instance of Form XObject. + the form XObject’s bounding box. + + + + Create + + instance by + + . + Note, this constructor doesn't perform any additional checks + + + + + with Form XObject. + + + + + Creates form XObject from page content. + + Creates form XObject from page content. + The page shall be from the document, to which FormXObject will be added. + + + an instance of + + + + + + Creates a form XObject from + + . + Unlike other images, + + images are represented as + + , not as + + . + + image to create form object from + document instance which is needed for writing form stream contents + + + + Gets + + of the Form XObject. + Note, if there is no resources, a new instance will be created. + + + not null instance of + + . + + + + + Gets Form XObject's BBox, + + key. + + + a + + , that represents + + . + + + + + Sets Form XObject's BBox, + + key. + + + a + + , that represents + + . + + object itself. + + + + Sets a group attributes dictionary indicating that the contents of the form XObject + shall be treated as a group and specifying the attributes of that group. + + + Sets a group attributes dictionary indicating that the contents of the form XObject + shall be treated as a group and specifying the attributes of that group. + + key. + + + instance of + + . + + object itself. + + + + Gets width based on XObject's BBox. + float value. + + + Gets height based on XObject's BBox. + float value. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + Sets process color model for trap network appearance, + + key. + + + shall be one of the valid values: + + , + + , + + , + + , + + , and + + . + + object itself. + + + + Gets process color model of trap network appearance, + + key. + + + a + + instance, possible values: + + , + + , + + , + + , + + , and + + . + + + + + Sets separation color names for the trap network appearance, + + key. + + + an array of names identifying the colorants that were assumed + when the trap network appearance was created. + + object itself. + + + + Gets separation color names of trap network appearance, + + key. + + + an + + of names identifying the colorants. + + + + + Sets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + + Sets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + key. + + + A + + of indirect references to TrapRegion objects. + + object itself. + + + + Gets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + + Gets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + key. + + + A + + of indirect references to TrapRegion objects. + + + + Sets a human-readable text string that described this trap network to the user. + + Sets a human-readable text string that described this trap network to the user. + + key. + + + a + + value. + + object itself. + + + Gets a human-readable text string that described this trap network to the user. + + Gets a human-readable text string that described this trap network to the user. + + key. + + + a + + value. + + + + Sets a text string representing the printer’s mark in human-readable form. + a string value. + object itself. + + + Gets a text string representing the printer’s mark in human-readable form. + a string value. + + + Puts the value into Image XObject dictionary and associates it with the specified key. + + Puts the value into Image XObject dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + A wrapper for Image XObject. + A wrapper for Image XObject. ISO 32000-1, 8.9 Images. + + + Creates Image XObject by image. + + + + with actual image data. + + + + Creates Image XObject by image. + + + + with actual image data. + + + + + with image mask. + + + + + Create + + instance by + + . + Note, this constructor doesn't perform any additional checks + + + + + with Image XObject. + + + + + + Gets width of image, + Width + key. + + float value. + + + + Gets height of image, + Height + key. + + float value. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note, that not every wrapper require this, only those that have such warning in documentation. + + + + Copy Image XObject to the specified document. + target document + + just created instance of + + . + + + + Gets decoded image bytes. + byte array. + + + Gets image bytes. + + Gets image bytes. + Note, + + , + + and + + filters will be ignored. + + + if + + , decodes stream bytes. + + byte array. + + + + Identifies the type of the image that is stored in the bytes of this + + . + Note that this has nothing to do with the original type of the image. For instance, the return value + of this method will never be + + as we loose this information when converting a + PNG image into something that can be put into a PDF file. + The possible values are: + + , + + , + + , + + , + + + the identified type of image + + + + Identifies recommended file extension to store the bytes of this + + . + Possible values are: 'png', 'jpg', 'jp2', 'tif', 'jbig2'. + This extension can later be used together with the result of + + . + + + a + + with recommended file extension + + + + + Puts the value into Image XObject dictionary and associates it with the specified key. + + Puts the value into Image XObject dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + + + + Sets state of this object according to the color space + the colorspace to use + whether indexed color spaces will be resolved (used for recursive call) + if there is a problem with reading from the underlying stream + + + Determining the initial backdrop against which its stack is composited. + + + + Determining whether the objects within the stack are composited with one another or only with the group's backdrop. + + + + + + This class provides means to compare two PDF files both by content and visually + and gives the report of their differences. + + + This class provides means to compare two PDF files both by content and visually + and gives the report of their differences. +

+ For visual comparison it uses external tools: Ghostscript and ImageMagick, which + should be installed on your machine. To allow CompareTool to use them, you need + to pass either java properties or environment variables with names "gsExec" and + "compareExec", which would contain the paths to the executables of correspondingly + Ghostscript and ImageMagick tools. +

+ CompareTool class was mainly designed for the testing purposes of iText in order to + ensure that the same code produces the same PDF document. For this reason you will + often encounter such parameter names as "outDoc" and "cmpDoc" which stand for output + document and document-for-comparison. The first one is viewed as the current result, + and the second one is referred as normal or ideal result. OutDoc is compared to the + ideal cmpDoc. Therefore all reports of the comparison are in the form: "Expected ..., + but was ...". This should be interpreted in the following way: "expected" part stands + for the content of the cmpDoc and "but was" part stands for the content of the outDoc. +
+
+ + Creates an instance of the CompareTool. + + + + Compares two PDF documents by content starting from Catalog dictionary and then recursively comparing + corresponding objects which are referenced from it. + + + Compares two PDF documents by content starting from Catalog dictionary and then recursively comparing + corresponding objects which are referenced from it. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

+ The main difference between this method and the + + methods is the return value. This method returns a + + class instance, which could be used + in code, however compareByContent methods in case of the differences simply return String value, which could + only be printed. Also, keep in mind that this method doesn't perform visual comparison of the documents. +

+ For more explanations about what is outDoc and cmpDoc see last paragraph of the + + class description. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + + the report of comparison of two files in the form of the custom class instance. + See + + for more info. + + +
+ + + Sets the maximum errors count which will be returned as the result of the comparison. + the errors count. + this CompareTool instance. + + + Enables or disables the generation of the comparison report in the form of the xml document. + + Enables or disables the generation of the comparison report in the form of the xml document. +
+ IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! +
+ true to enable xml report generation, false - to disable. + this CompareTool instance. +
+ + Enables the comparison of the encryption properties of the documents. + + Enables the comparison of the encryption properties of the documents. Encryption properties comparison + results are returned along with all other comparison results. +
+ IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! +
+ this CompareTool instance. +
+ + + + Compares two documents visually. + + Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. + For more info about needed configuration for visual comparison process see + + class description. +
+ During comparison for every page of two documents an image file will be created in the folder specified by + outPath absolute path. Then those page images will be compared and if there are any differences for some pages, + another image file will be created with marked differences on it. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked differences if there is any. + + string containing list of the pages that are visually different, or null if there are no visual differences. + + + +
+ + Compares two documents visually. + + Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. + For more info about needed configuration for visual comparison process see + + class description. +
+ During comparison for every page of two documents an image file will be created in the folder specified by + outPath absolute path. Then those page images will be compared and if there are any differences for some pages, + another image file will be created with marked differences on it. +
+ It is possible to ignore certain areas of the document pages during visual comparison. This is useful for example + in case if documents should be the same except certain page area with date on it. In this case, in the folder + specified by the outPath, new pdf documents will be created with the black rectangles at the specified ignored + areas, and visual comparison will be performed on these new documents. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + string containing list of the pages that are visually different, or null if there are no visual differences. + + + +
+ + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

+ Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
+ When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

+ For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
+ + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

+ Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

+ Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
+ When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

+ For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
+ + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

+ Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
+ When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

+ For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
+ + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

+ Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

+ Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
+ When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

+ For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
+ the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
+ + Simple method that compares two given PdfDictionaries by content. + + Simple method that compares two given PdfDictionaries by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + dictionary to compare. + dictionary to compare. + true if dictionaries are equal by content, otherwise false. + + + + Simple method that compares two given PdfStreams by content. + + Simple method that compares two given PdfStreams by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + stream to compare. + stream to compare. + true if stream are equal by content, otherwise false. + + + + Simple method that compares two given PdfArrays by content. + + Simple method that compares two given PdfArrays by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + array to compare. + array to compare. + true if arrays are equal by content, otherwise false. + + + + Simple method that compares two given PdfNames. + name to compare. + name to compare. + true if names are equal, otherwise false. + + + Simple method that compares two given PdfNumbers. + number to compare. + number to compare. + true if numbers are equal, otherwise false. + + + Simple method that compares two given PdfStrings. + string to compare. + string to compare. + true if strings are equal, otherwise false. + + + Simple method that compares two given PdfBooleans. + boolean to compare. + boolean to compare. + true if booleans are equal, otherwise false. + + + Compares xmp metadata of the two given PDF documents. + the absolute path to the output file, which xmp is to be compared to cmp-file. + the absolute path to the cmp-file, which xmp is to be compared to output file. + text report of the xmp differences, or null if there are no differences. + + + Compares xmp metadata of the two given PDF documents. + the absolute path to the output file, which xmp is to be compared to cmp-file. + the absolute path to the cmp-file, which xmp is to be compared to output file. + + true, if to ignore differences in date or producer xmp metadata + properties. + + text report of the xmp differences, or null if there are no differences. + + + Utility method that provides simple comparison of the two xml files stored in byte arrays. + first xml file data to compare. + second xml file data to compare. + true if xml structures are identical, false otherwise. + + + + + + Utility method that provides simple comparison of the two xml files. + absolute path to the first xml file to compare. + absolute path to the second xml file to compare. + true if xml structures are identical, false otherwise. + + + + + + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

+ Compares document info dictionaries of two pdf documents. +
+ the absolute path to the output file, which info is to be compared to cmp-file info. + the absolute path to the cmp-file, which info is to be compared to output file info. + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + text report of the differences in documents infos. + +
+ + Compares document info dictionaries of two pdf documents. + the absolute path to the output file, which info is to be compared to cmp-file info. + the absolute path to the cmp-file, which info is to be compared to output file info. + text report of the differences in documents infos. + + + + Compares if two documents has identical link annotations on corresponding pages. + the absolute path to the output file, which links are to be compared to cmp-file links. + + the absolute path to the cmp-file, which links are to be compared to output file links. + + text report of the differences in documents links. + + + + Compares tag structures of the two PDF documents. + + Compares tag structures of the two PDF documents. +
+ This method creates xml files in the same folder with outPdf file. These xml files contain documents tag structures + converted into the xml structure. These xml files are compared if they are equal. +
+ the absolute path to the output file, which tags are to be compared to cmp-file tags. + + the absolute path to the cmp-file, which tags are to be compared to output file tags. + + text report of the differences in documents tags. + + + +
+ + + + + + + + + + + + + + + + + Runs ghostscript to create images of pdfs. + Path to the output folder. + Returns null if result is successful, else returns error message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Class containing results of the comparison of two documents. + + + Creates new empty instance of CompareResult with given limit of difference messages. + maximum number of difference messages handled by this CompareResult. + + + Is used to define if documents are considered equal after comparison. + true if documents are equal, false otherwise. + + + Returns number of differences between two documents met during comparison. + number of differences. + + + Converts this CompareResult into text form. + text report of the differences between two documents. + + + + Returns map with + + as keys and difference descriptions as values. + + differences map which could be used to find in the document objects that are different. + + + Converts this CompareResult into xml form. + output stream to which xml report will be written. + + + + + + Creates empty ObjectPath. + + + Creates ObjectPath with corresponding base objects in two documents. + base object in cmp document. + base object in out document. + + + + Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base + objects of the current instance of the ObjectPath. + + + Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base + objects of the current instance of the ObjectPath. This method is used to avoid infinite loop in case of + circular references in pdf documents objects structure. +
+ Basically, this method creates copy of the current ObjectPath instance, but resets information of the direct + paths, and also adds current ObjectPath instance base objects to the indirect references chain that denotes + a path to the new base objects. +
+ new base object in cmp document. + new base object in out document. + + new ObjectPath instance, which stores chain of the indirect references which were already met to get + to the new base objects. + +
+ + This method is used to define if given objects were already met in the path to the current base objects. + + + This method is used to define if given objects were already met in the path to the current base objects. + If this method returns true it basically means that we found a loop in the objects structure and that we + already compared these objects. + + cmp object to check if it was already met in base objects path. + out object to check if it was already met in base objects path. + true if given objects are contained in the path and therefore were already compared. + + + Adds array item to the direct path. + + Adds array item to the direct path. See + + . + + index in the array of the direct object to be compared. + + + Adds dictionary item to the direct path. + + Adds dictionary item to the direct path. See + + . + + key in the dictionary to which corresponds direct object to be compared. + + + Adds offset item to the direct path. + + Adds offset item to the direct path. See + + . + + offset to the specific byte in the stream that is compared. + + + Removes the last path item from the direct path. + + + + Gets local (or direct) path that denotes sequence of the path items from base object to the comparing + direct object. + + direct path to the comparing object. + + + + Gets indirect path which denotes sequence of the indirect references that were passed in comparing process + to get to the current base objects. + + indirect path to the current base objects. + + + current base object in the cmp document. + + + current base object in the out document. + + + Creates an xml node that describes a direct path stored in this ObjectPath instance. + xml document, to which this xml node will be added. + an xml node describing direct path. + + + string representation of the direct path stored in this ObjectPath instance. + + + + An item in the indirect path (see + + . It encapsulates two corresponding objects from the two + comparing documents that were met to get to the path base objects during comparing process. + + + + Creates IndirectPathItem instance for two corresponding objects from two comparing documents. + an object from the cmp document. + an object from the out document. + + + an object from the cmp object that was met to get to the path base objects during comparing process. + + + + an object from the out object that was met to get to the path base objects during comparing process. + + + + + An abstract class for the items in the direct path (see + + . + + + + Creates an xml node that describes this direct path item. + xml document, to which this xml node will be added. + an xml node describing direct path item. + + + + Direct path item (see + + , which describes transition to the + + entry which value is now a currently comparing direct object. + + + + + Creates an instance of the + + . + + + the key which defines to which entry of the + + the transition was performed. + + + + + The key which defines to which entry of the + + the transition was performed. + See + + for more info. + + + a + + which is the key which defines to which entry of the dictionary + the transition was performed. + + + + + Direct path item (see + + , which describes transition to the + + element which is now a currently comparing direct object. + + + + + Creates an instance of the + + . + + + the index which defines element of the + + to which + the transition was performed. + + + + + The index which defines element of the + + to which the transition was performed. + See + + for more info. + + the index which defines element of the array to which the transition was performed + + + + Direct path item (see + + , which describes transition to the + specific position in + + . + + + + + Creates an instance of the + + . + + + bytes offset to the specific position in + + . + + + + + The bytes offset of the stream which defines specific position in the + + , to which transition + was performed. + + an integer defining bytes offset to the specific position in stream. + + + + Class representing a page range, for instance a page range can contain + pages 5, then pages 10 through 15, then page 18, then page 21 and so on. + + + + + Constructs an empty + + instance. + + + + + Constructs a + + instance from a range in a string form, for example: "1-12, 15, 45-66". + + the page range + + + Adds a page sequence to the range. + the starting page number of the sequence + the finishing page number of the sequnce + this range, already modified + + + Adds a single page to the range. + the page number to add + this range, already modified + + + Gets the list if pages that have been added to the range so far. + the list containing page numbers added to the range + + + Checks if a given page is present in the range built so far. + the page number to check + true if the page is present in this range, false otherwise + + + + + + + + + This class is used to merge a number of existing documents into one. + + This class is used to merge a number of existing documents into one. By default, if source document + contains tags and outlines, they will be also copied to the destination document. + + the document into which source documents will be merged. + + + This class is used to merge a number of existing documents into one. + the document into which source documents will be merged. + + if true, then tags from the source document are copied even if destination document is not set as + tagged. Note, that if false, tag structure is still could be copied if the destination document + is explicitly marked as tagged with + + . + + + if true, then outlines from the source document are copied even if in destination document + outlines are not initialized. Note, that if false, outlines are still could be copied if the + destination document outlines were explicitly initialized with + + . + + + + + If set to true then passed to the + PdfMerger#merge + method source documents will be closed + immediately after merging specified pages into current document. If false - PdfDocuments are left open. + Default value - false. + + should be true to close pdf documents in merge method. + + this + PdfMerger + instance. + + + + This method merges pages from the source document to the current one. + + This method merges pages from the source document to the current one. +

+ If closeSourceDocuments flag is set to true (see + + ), + passed + PdfDocument + will be closed after pages are merged. +
+ - document, from which pages will be copied. + - start page in the range of pages to be copied. + - end page in the range to be copied. + + this + PdfMerger + instance. + +
+ + This method merges pages from the source document to the current one. + + This method merges pages from the source document to the current one. +

+ If closeSourceDocuments flag is set to true (see + + ), + passed + PdfDocument + will be closed after pages are merged. +
+ - document, from which pages will be copied. + - List of numbers of pages which will be copied. + + this + PdfMerger + instance. + +
+ + Closes the current document. + + Closes the current document. It is a complete equivalent of calling + PdfDocument#close + on the PdfDocument + passed to the constructor of this PdfMerger instance. This means that it is enough to call close either on + passed PdfDocument or on this PdfMerger instance, but there is no need to call them both. + + + + + This class can be used to count the number of bytes needed when copying + pages from an existing PDF into a newly created PDF. + + + + A map of the resources that are already taken into account + + + + Creates a PdfResourceCounter instance to be used to count the resources + needed for either a page (in this case pass a page dictionary) or the + trailer (root and info dictionary) of a PDF file. + + the object we want to examine + + + Processes an object. + + Processes an object. If the object is indirect, it is added to the + list of resources. If not, it is just processed. + + the object to process + + + + In case an object is an array, a dictionary or a stream, + we need to loop over the entries and process them one by one. + + the object to examine + + + Returns a map with the resources. + the resources + + + + Returns the resources needed for the object that was used to create + this PdfResourceCounter. + + + Returns the resources needed for the object that was used to create + this PdfResourceCounter. If you pass a Map with resources that were + already used by other objects, these objects will not be taken into + account. + + The resources that can be excluded when counting the bytes. + The number of bytes needed for an object. + + + Creates a new instance of PdfSplitter class. + the document to be split. + + + If original document is tagged, then by default all resultant document will also be tagged. + + If original document is tagged, then by default all resultant document will also be tagged. + This could be changed with this flag - if set to false, resultant documents will be not tagged, even if + original document is tagged. + + + + If original document has outlines, then by default all resultant document will also have outlines. + + + If original document has outlines, then by default all resultant document will also have outlines. + This could be changed with this flag - if set to false, resultant documents won't contain outlines, even if + original document had them. + + + + Splits the document basing on the given size. + Preferred size for splitting. + + The documents which the source document was split into. + Be warned that these documents are not closed. + + + + Splits the document by page numbers. + + the numbers of pages from which another document is to be started. + If the first element is not 1, then 1 is implied (i.e. the first split document will start from page 1 in any case). + + + the event listener which is called when another document is ready. + You can close this document in this listener, for instance. + + + + Splits the document by page numbers. + + the numbers of pages from which another document is to be started. + If the first element is not 1, then 1 is implied (i.e. the first split document will start from page 1 in any case). + + the list of resultant documents. By warned that they are not closed. + + + Splits a document into smaller documents with no more than @pageCount pages each. + the biggest possible number of pages in a split document. + + the event listener which is called when another document is ready. + You can close this document in this listener, for instance. + + + + Splits a document into smaller documents with no more than @pageCount pages each. + the biggest possible number of pages in a split document. + the list of resultant documents. By warned that they are not closed. + + + Extracts the specified page ranges from a document. + the list of page ranges for each of the resultant document. + + the list of the resultant documents for each of the specified page range. + Be warned that these documents are not closed. + + + + Extracts the specified page ranges from a document. + the page range to be extracted from the document. + + the resultant document containing the pages specified by the provided page range. + Be warned that this document is not closed. + + + + This method is called when another split document is to be created. + + This method is called when another split document is to be created. + You can override this method and return your own + PdfWriter + depending on your needs. + + the page range of the original document to be included in the document being created now. + + the PdfWriter instance for the document which is being created. + + + + Split a document by outline title (bookmark name), find outline by name + and places the entire hierarchy in a separate document ( outlines and pages ) . + + list of outline titles . + + + the next element in the entire hierarchy + + + + Converts a tagged PDF document into an XML file. + + + + Constructs a + + via a given + + . + + the document to read tag structure from + + + Checks if a character value should be escaped/unescaped. + a character value + true if it's OK to escape or unescape this value + + + Converts the current tag structure into an XML file with default encoding (UTF-8). + the output stream to save XML file to + + + + Converts the current tag structure into an XML file with provided encoding. + the output stream to save XML file to + the charset of the resultant XML file + + + + Sets the name of the root tag of the resultant XML file + the name of the root tag + this object + + + + NOTE: copied from itext5 XMLUtils class + Escapes a string with the appropriated XML codes. + + the string to be escaped + codes above 127 will always be escaped with &#nn; if true + the escaped string + + + This class contains version information about iText. + + This class contains version information about iText. + DO NOT CHANGE THE VERSION INFORMATION WITHOUT PERMISSION OF THE COPYRIGHT HOLDERS OF ITEXT. + Changing the version makes it extremely difficult to debug an application. + Also, the nature of open source software is that you honor the copyright of the original creators of the software. + + + + String that will indicate if the AGPL version is used. + + + The iText version instance. + + + This String contains the name of the product. + + This String contains the name of the product. + iText is a registered trademark by iText Group NV. + Please don't change this constant. + + + + This String contains the version number of this iText release. + + This String contains the version number of this iText release. + For debugging purposes, we request you NOT to change this constant. + + + + This String contains the iText version as shown in the producer line. + + This String contains the iText version as shown in the producer line. + iText is a product developed by iText Group NV. + iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + + + The license key. + + + Gets an instance of the iText version that is currently used. + + Gets an instance of the iText version that is currently used. + Note that iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + + + Checks if the AGPL version is used. + returns true if the AGPL version is used. + + + Is the license expired? + true if expired + + + Gets the product name. + + Gets the product name. + iText Group NV requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + the product name + + + Gets the release number. + + Gets the release number. + iText Group NV requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + the release number + + + Returns the iText version as shown in the producer line. + + Returns the iText version as shown in the producer line. + iText is a product developed by iText Group NV. + iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + iText version + + + Returns a license key if one was provided, or null if not. + a license key. + + + + A wrapper for an Encoding to suppress the preamble. + + + + Translates a IANA encoding name to a Java encoding. + + + The object that maps IANA to Java encodings. + + + + A utility class to perform base64 encoding and decoding as specified + in RFC-1521. + + + A utility class to perform base64 encoding and decoding as specified + in RFC-1521. See also RFC 1421. + + $Revision: 1.4 $ + + + marker for invalid bytes + + + marker for accepted whitespace bytes + + + marker for an equal symbol + + + Encode the given byte[]. + the source string. + the base64-encoded data. + + + Encode the given byte[]. + the source string. + + a linefeed is added after linefeed characters; + must be dividable by four; 0 means no linefeeds + + the base64-encoded data. + + + Encode the given string. + the source string. + the base64-encoded string. + + + Decode the given byte[]. + the base64-encoded data. + the decoded data. + + Thrown if the base 64 strings contains non-valid characters, + beside the bas64 chars, LF, CR, tab and space are accepted. + + + + Decode the given string. + the base64-encoded string. + the decoded string. + + + Byte buffer container including length of valid data. + 11.10.2006 + + + the initial capacity for this buffer + + + a byte array that will be wrapped with ByteBuffer. + + + a byte array that will be wrapped with ByteBuffer. + the length of valid bytes in the array + + + Loads the stream into a buffer. + an InputStream + If the stream cannot be read. + + + a byte array that will be wrapped with ByteBuffer. + the offset of the provided buffer. + the length of valid bytes in the array + + + Returns a byte stream that is limited to the valid amount of bytes. + + + + Returns the length, that means the number of valid bytes, of the buffer; + the inner byte array might be bigger than that. + + + + the index to retrieve the byte from + Returns a byte from the buffer + + + the index to retrieve a byte as int or char. + Returns a byte from the buffer + + + Appends a byte to the buffer. + a byte + + + Appends a byte array or part of to the buffer. + a byte array + an offset with + + + + Append a byte array to the buffer + a byte array + + + Append another buffer to this buffer. + another ByteBuffer + + + Detects the encoding of the byte buffer, stores and returns it. + + Detects the encoding of the byte buffer, stores and returns it. + Only UTF-8, UTF-16LE/BE and UTF-32LE/BE are recognized. + Note: UTF-32 flavors are not supported by Java, the XML-parser will complain. + + Returns the encoding string. + + + + Ensures the requested capacity by increasing the buffer size when the + current length is exceeded. + + requested new buffer length + + + + An OutputStream that counts the written bytes. + + @since 08.11.2006 + + + + + the decorated output stream + + + + the byte counter + + + + Constructor with providing the output stream to decorate. + an OutputStream + + + the bytesWritten + + + + + + 22.08.2006 + + + the state of the automaton + + + the result of the escaping sequence + + + count the digits of the sequence + + + The look-ahead size is 6 at maximum (&#xAB;) + + a Reader + + + + + + + Processes numeric escaped chars to find out if they are a control character. + a char + Returns the char directly or as replacement for the escaped sequence. + + + Converts between ISO 8601 Strings and Calendar with millisecond resolution. + + 16.02.2006 + + + Hides public constructor + + + + a date string that is ISO 8601 conform. + an existing XMPDateTime to set with the parsed date + Returns an XMPDateTime-object containing the ISO8601-date. + Is thrown when the string is non-conform. + + + + + 22.08.2006 + + + initializes the parser container + + + Returns the length of the input. + + + Returns whether there are more chars to come. + + + index of char + Returns char at a certain index. + + + Returns the current char or 0x0000 if there are no more chars. + + + Skips the next char. + + + Returns the current position. + + + Parses a integer from the source and sets the pointer after it. + Error message to put in the exception if no number can be found + + the max value of the number to return + Returns the parsed integer. + Thrown if no integer can be found. + + + + 12.10.2006 + + + Private constructor + + + + + Converts a Cp1252 char (contains all Latin-1 chars above 0x80) into a + UTF-8 byte sequence. + + + Converts a Cp1252 char (contains all Latin-1 chars above 0x80) into a + UTF-8 byte sequence. The bytes 0x81, 0x8D, 0x8F, 0x90, and 0x9D are + formally undefined by Windows 1252 and therefore replaced by a space + (0x20). + + an Cp1252 / Latin-1 byte + Returns a byte array containing a UTF-8 byte sequence. + + + 11.08.2006 + + + Common constants for the XMP Toolkit. + 20.01.2006 + + + The XML namespace for XML. + + + The XML namespace for RDF. + + + The XML namespace for the Dublin Core schema. + + + The XML namespace for the IPTC Core schema. + + + The XML namespace for the IPTC Extension schema. + + + The XML namespace for the DICOM medical schema. + + + The XML namespace for the PLUS (Picture Licensing Universal System, http://www.useplus.org) + + + The XML namespace Adobe XMP Metadata. + + + The XML namespace for the XMP "basic" schema. + + + The XML namespace for the XMP copyright schema. + + + The XML namespace for the XMP digital asset management schema. + + + The XML namespace for the job management schema. + + + The XML namespace for the job management schema. + + + The XML namespace for the PDF schema. + + + The XML namespace for the PDF schema. + + + The XML namespace for the Photoshop custom schema. + + + The XML namespace for the Photoshop Album schema. + + + The XML namespace for Adobe's EXIF schema. + + + NS for the CIPA XMP for Exif document v1.1 + + + The XML namespace for Adobe's TIFF schema. + + + BExt Schema + + + RIFF Info Schema + + + Transform XMP + + + Adobe Flash SWF + + + legacy Dublin Core NS, will be converted to NS_DC + + + The XML namespace for qualifiers of the xmp:Identifier property. + + + The XML namespace for fields of the Dimensions type. + + + The XML namespace for fields of a graphical image. + The XML namespace for fields of a graphical image. Used for the Thumbnail type. + + + The XML namespace for fields of the ResourceEvent type. + + + The XML namespace for fields of the ResourceRef type. + + + The XML namespace for fields of the Version type. + + + The XML namespace for fields of the JobRef type. + + + The canonical true string value for Booleans in serialized XMP. + + The canonical true string value for Booleans in serialized XMP. Code that converts from the + string to a bool should be case insensitive, and even allow "1". + + + + The canonical false string value for Booleans in serialized XMP. + + The canonical false string value for Booleans in serialized XMP. Code that converts from the + string to a bool should be case insensitive, and even allow "0". + + + + Index that has the meaning to be always the last item in an array. + + + Node name of an array item. + + + The x-default string for localized properties + + + xml:lang qualfifier + + + rdf:type qualfifier + + + Processing Instruction (PI) for xmp packet + + + XMP meta tag version new + + + XMP meta tag version old + + + Part, 1, 2, or 3 + + + Conformance, A, B, or U. + + + private constructor + + + Asserts that an array name is set. + an array name + Array name is null or empty + + + Asserts that a property name is set. + a property name or path + Property name is null or empty + + + Asserts that a schema namespace is set. + a schema namespace + Schema is null or empty + + + Asserts that a prefix is set. + a prefix + Prefix is null or empty + + + Asserts that a specific language is set. + a specific lang + Specific language is null or empty + + + Asserts that a struct name is set. + a struct name + Struct name is null or empty + + + Asserts that any string parameter is set. + any string parameter + Thrown if the parameter is null or has length 0. + + + + Asserts that the xmp object is of this implemention + ( + + ). + + the XMP object + A wrong implentaion is used. + + + Parser for "normal" XML serialisation of RDF. + 14.07.2006 + + + Start of coreSyntaxTerms. + + + End of coreSyntaxTerms + + + Start of additions for syntax Terms. + + + End of of additions for syntaxTerms. + + + Start of oldTerms. + + + End of oldTerms. + + + ! Yes, the syntax terms include the core terms. + + + this prefix is used for default namespaces + + + The main parsing method. + + The main parsing method. The XML tree is walked through from the root node and and XMP tree + is created. This is a raw parse, the normalisation of the XMP tree happens outside. + + the XML root node + Returns an XMP metadata object (not normalized) + Occurs if the parsing fails for any reason. + + + + + Each of these parsing methods is responsible for recognizing an RDF + syntax production and adding the appropriate structure to the XMP tree. + + + Each of these parsing methods is responsible for recognizing an RDF + syntax production and adding the appropriate structure to the XMP tree. + They simply return for success, failures will throw an exception. + + the xmp metadata object that is generated + the top-level xml node + thown on parsing errors + + + + 7.2.10 nodeElementList
+ ws* ( nodeElement ws* ) + Note: this method is only called from the rdf:RDF-node (top level) +
+ the xmp metadata object that is generated + the parent xmp node + the top-level xml node + thown on parsing errors +
+ + + 7.2.5 nodeElementURIs + anyURI - ( coreSyntaxTerms | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + A node element URI is rdf:Description or anything else that is not an RDF + term. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.7 propertyAttributeURIs + anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + Process the attribute list for an RDF node element. + + + 7.2.7 propertyAttributeURIs + anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + Process the attribute list for an RDF node element. A property attribute URI is + anything other than an RDF term. The rdf:ID and rdf:nodeID attributes are simply ignored, + as are rdf:about attributes on inner nodes. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.13 propertyEltList + ws* ( propertyElt ws* ) + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.14 propertyElt + resourcePropertyElt | literalPropertyElt | parseTypeLiteralPropertyElt | + parseTypeResourcePropertyElt | parseTypeCollectionPropertyElt | + parseTypeOtherPropertyElt | emptyPropertyElt + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + 7.2.16 literalPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + 7.2.17 parseTypeLiteralPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + 7.2.18 parseTypeResourcePropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + 7.2.19 parseTypeCollectionPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + 7.2.21 emptyPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr* ) ) + end-element() + The various property element forms are not distinguished by the XML element name, + but by their attributes for the most part. + + + 7.2.14 propertyElt + resourcePropertyElt | literalPropertyElt | parseTypeLiteralPropertyElt | + parseTypeResourcePropertyElt | parseTypeCollectionPropertyElt | + parseTypeOtherPropertyElt | emptyPropertyElt + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + 7.2.16 literalPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + 7.2.17 parseTypeLiteralPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + 7.2.18 parseTypeResourcePropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + 7.2.19 parseTypeCollectionPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + 7.2.21 emptyPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr* ) ) + end-element() + The various property element forms are not distinguished by the XML element name, + but by their attributes for the most part. The exceptions are resourcePropertyElt and + literalPropertyElt. They are distinguished by their XML element content. + NOTE: The RDF syntax does not explicitly include the xml:lang attribute although it can + appear in many of these. We have to allow for it in the attibute counts below. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + This handles structs using an rdf:Description node, + arrays using rdf:Bag/Seq/Alt, and typedNodes. + + + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + This handles structs using an rdf:Description node, + arrays using rdf:Bag/Seq/Alt, and typedNodes. It also catches and cleans up qualified + properties written with rdf:Description and rdf:value. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.16 literalPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + Add a leaf node with the text value and qualifiers for the attributes. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.17 parseTypeLiteralPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + + thown on parsing errors + + + + 7.2.18 parseTypeResourcePropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + Add a new struct node with a qualifier for the possible rdf:ID attribute. + + + 7.2.18 parseTypeResourcePropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + Add a new struct node with a qualifier for the possible rdf:ID attribute. + Then process the XML child nodes to get the struct fields. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.19 parseTypeCollectionPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + + thown on parsing errors + + + + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + + thown on parsing errors + + + + Adds a child node. + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Node value + Flag if the node is a top-level node + Returns the newly created child node. + thown on parsing errors + + + Adds a qualifier node. + the parent xmp node + + the name of the qualifier which has to be + QName including the default prefix + + the value of the qualifier + Returns the newly created child node. + thown on parsing errors + + + The parent is an RDF pseudo-struct containing an rdf:value field. + + The parent is an RDF pseudo-struct containing an rdf:value field. Fix the + XMP data model. The rdf:value node must be the first child, the other + children are qualifiers. The form, value, and children of the rdf:value + node are the real ones. The rdf:value node's qualifiers must be added to + the others. + + the parent xmp node + thown on parsing errors + + + Checks if the node is a white space. + an XML-node + + Returns whether the node is a whitespace node, + i.e. a text node that contains only whitespaces. + + + + + 7.2.6 propertyElementURIs + anyURI - ( coreSyntaxTerms | rdf:Description | oldTerms ) + + the term id + Return true if the term is a property element name. + + + + 7.2.4 oldTerms
+ rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID +
+ the term id + Returns true if the term is an old term. +
+ + + 7.2.2 coreSyntaxTerms
+ rdf:RDF | rdf:ID | rdf:about | rdf:parseType | rdf:resource | rdf:nodeID | + rdf:datatype +
+ the term id + Return true if the term is a core syntax term +
+ + Determines the ID for a certain RDF Term. + + Determines the ID for a certain RDF Term. + Arranged to hopefully minimize the parse time for large XMP. + + an XML node + Returns the term ID. + + + 09.11.2006 + + + XML namespace prefix + + + XML localname + + + Splits a qname into prefix and localname. + a QName + + + Constructor that initializes the fields + the prefix + the name + + + Returns whether the QName has a prefix. + + + the localName + + + the prefix + + + Utility functions for the XMPToolkit implementation. + 06.06.2006 + + + segments of a UUID + + + length of a UUID + + + table of XML name start chars (<= 0xFF) + + + table of XML name chars (<= 0xFF) + + + Private constructor + + + + + a schema namespace + an XMP Property + + Returns true if the property is defined as "Internal + Property", see XMP Specification. + + + + + Check some requirements for an UUID: +
    +
  • Length of the UUID is 32
  • +
  • The Delimiter count is 4 and all the 4 delimiter are on their right + position (8,13,18,23)
  • +
+
+ uuid to test + true - this is a well formed UUID, false - UUID has not the expected format +
+ + Simple check for valid XMLNames. + + Simple check for valid XMLNames. Within ASCII range
+ ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6]
+ are accepted, above all characters (which is not entirely + correct according to the XML Spec. +
+ an XML Name + Return true if the name is correct. +
+ + + Checks if the value is a legal "unqualified" XML name, as + defined in the XML Namespaces proposed recommendation. + + + Checks if the value is a legal "unqualified" XML name, as + defined in the XML Namespaces proposed recommendation. + These are XML names, except that they must not contain a colon. + + the value to check + Returns true if the name is a valid "unqualified" XML name. + + + a char + Returns true if the char is an ASCII control char. + + + Serializes the node value in XML encoding. + + Serializes the node value in XML encoding. Its used for tag bodies and + attributes.
+ Note: The attribute is always limited by quotes, + thats why &apos; is never serialized.
+ Note: Control chars are written unescaped, but if the user uses others than tab, LF + and CR the resulting XML will become invalid. +
+ a string + flag if string is attribute value (need to additional escape quotes) + Decides if LF, CR and TAB are escaped. + Returns the value ready for XML output. +
+ + Replaces the ASCII control chars with a space. + a node value + Returns the cleaned up value + + + Simple check if a character is a valid XML start name char. + + Simple check if a character is a valid XML start name char. + All characters according to the XML Spec 1.1 are accepted: + http://www.w3.org/TR/xml11/#NT-NameStartChar + + a character + Returns true if the character is a valid first char of an XML name. + + + + Simple check if a character is a valid XML name char + (every char except the first one), according to the XML Spec 1.1: + http://www.w3.org/TR/xml11/#NT-NameChar + + a character + Returns true if the character is a valid char of an XML name. + + + + Initializes the char tables for the chars 0x00-0xFF for later use, + according to the XML 1.1 specification + http://www.w3.org/TR/xml11 + + + + The implementation of XMPDateTime. + + The implementation of XMPDateTime. Internally a calendar is used + plus an additional nano seconds field, because Calendar supports only milli + seconds. The nanoSeconds convers only the resolution beyond a milli second. + + 16.02.2006 + + + + Returns the year, can be negative. + + + Sets the year + + + Returns The month in the range 1..12. + + + Sets the month 1..12 + + + Returns the day of the month in the range 1..31. + + + Sets the day 1..31 + + + Returns hour - The hour in the range 0..23. + + + Sets the hour in the range 0..23. + + + Returns the minute in the range 0..59. + + + Sets the minute in the range 0..59. + + + Returns the second in the range 0..59. + + + Sets the second in the range 0..59. + + + + Returns milli-, micro- and nano seconds. + Nanoseconds within a second, often left as zero? + + + + + Sets the milli-, micro- and nano seconds. + Granularity goes down to milli seconds. + + + + Returns the time zone. + + + a time zone to set + + + This flag is set either by parsing or by setting year, month or day. + Returns true if the XMPDateTime object has a date portion. + + + This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. + + Returns true if the XMPDateTime object has a time portion. + + + This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. + + Returns true if the XMPDateTime object has a defined timezone. + + + + Returns a Calendar (only with milli second precision).
+ Note: the dates before Oct 15th 1585 (which normally fall into validity of + the Julian calendar) are also rendered internally as Gregorian dates. +
+
+ + Returns the ISO 8601 string representation of the date and time. + + + Use NO time zone as default + + + The nano seconds take micro and nano seconds, while the milli seconds are in the calendar. + + + + + Creates an XMPDateTime-instance with the current time in the default time + zone. + + + + + Creates an XMPDateTime-instance from a calendar. + + a Calendar + + + + Creates an XMPDateTime-instance from + a Date and a TimeZone. + + a date describing an absolute point in time + a TimeZone how to interpret the date + + + Creates an XMPDateTime-instance from an ISO 8601 string. + an ISO 8601 string + If the string is a non-conform ISO 8601 string, an exception is thrown + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the ISO string representation. + + + The XMPIterator implementation. + + The XMPIterator implementation. + Iterates the XMP Tree according to a set of options. + During the iteration the XMPMeta-object must not be changed. + Calls to skipSubtree() / skipSiblings() will affect the iteration. + + 29.06.2006 + + + + + Skip the subtree below the current node when next() is + called. + + + + + Skip the subtree below and remaining siblings of the current node when + next() is called. + + + + stores the iterator options + + + the base namespace of the property path, will be changed during the iteration + + + + flag to indicate that skipSiblings() has been called. + + + flag to indicate that skipSiblings() has been called. + + + the node iterator doing the work + + + Constructor with optionsl initial values. + + Constructor with optionsl initial values. If propName is provided, + schemaNS has also be provided. + + the iterated metadata object. + the iteration is reduced to this schema (optional) + the iteration is redurce to this property within the schemaNS + + + advanced iteration options, see + + + If the node defined by the paramters is not existing. + + + + + + + + + + + + + Exposes the options for inner class. + + + Exposes the options for inner class. + + + sets the baseNS from the inner class. + + + + + + The XMPIterator implementation. + + The XMPIterator implementation. + It first returns the node itself, then recursivly the children and qualifier of the node. + + 29.06.2006 + + + + iteration state + + + + iteration state + + + + iteration state + + + + the recursively accumulated path + + + + the currently visited node + + + + the iterator that goes through the children and qualifier list + + + + index of node with parent, only interesting for arrays + + + + the cached PropertyInfo to return + + + + the state of the iteration + + + + the iterator for each child + + + + Constructor for the node iterator. + the currently visited node + the accumulated path of the node + the index within the parent node (only for arrays) + + + the childrenIterator + + + Returns the returnProperty. + + + + + Sets the returnProperty as next item or recurses into hasNext(). + Returns if there is a next item to return. + + + + Handles the iteration of the children or qualfier + an iterator + Returns if there are more elements available. + + + the node that will be added to the path. + the path up to this node. + the current array index if an arrey is traversed + Returns the updated path. + + + + Creates a property info object from an XMPNode. + an XMPNode + the base namespace to report + the full property path + Returns a XMPProperty-object that serves representation of the node. + + + This interface is used to return a property together with its path and namespace. + + This interface is used to return a property together with its path and namespace. + It is returned when properties are iterated with the XMPIterator. + + 06.07.2006 + + + This interface is used to return a text property together with its and options. + 23.01.2006 + + + Returns the value of the property. + + + Returns the options of the property. + + + + Only set by + + . + + Returns the language of the alt-text item. + + + Returns the namespace of the property + + + Returns the path of the property, but only if returned by the iterator. + + + + This iterator is derived from the default NodeIterator, + and is only used for the option . + + @since 02.10.2006 + + + + + Constructor + the node which children shall be iterated. + the full path of the former node without the leaf node. + + + + + Implementation for + + . + + 17.02.2006 + + + This class represents the set of XMP metadata as a DOM representation. + + This class represents the set of XMP metadata as a DOM representation. It has methods to read and + modify all kinds of properties, create an iterator over all properties and serialize the metadata + to a String, byte-array or OutputStream. + + 20.01.2006 + + + + Provides access to items within an array. + + Provides access to items within an array. The index is passed as an integer, you need not + worry about the path string syntax for array items, convert a loop index to a string, etc. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant + + always refers to the last existing array + item. + + + Returns a XMPProperty containing the value and the options or + null if the property does not exist. + + Wraps all errors and exceptions that may occur. + + + + Returns the number of items in the array. + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + Returns the number of items in the array. + Wraps all errors and exceptions that may occur. + + + + + + + + The namespace URI + The name of the property + the value for the property + Wraps all errors and exceptions + + + + Replaces an item within an array. + + Replaces an item within an array. The index is passed as an integer, you need not worry about + the path string syntax for array items, convert a loop index to a string, etc. The array + passed must already exist. In normal usage the selected array item is modified. A new item is + automatically appended if the index is the array size plus 1. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The index of the desired item. Arrays in XMP are indexed from 1. To address + the last existing item, use + + to find + out the length of the array. + + + the new value of the array item. Has the same usage as propValue in + setProperty(). + + the set options for the item. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI + The name of the array + The index to insert the new item + the new value of the array item + Wraps all errors and exceptions + + + + Inserts an item into an array previous to the given index. + + Inserts an item into an array previous to the given index. The index is passed as an integer, + you need not worry about the path string syntax for array items, convert a loop index to a + string, etc. The array passed must already exist. In normal usage the selected array item is + modified. A new item is automatically appended if the index is the array size plus 1. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The index to insert the new item. Arrays in XMP are indexed from 1. Use + XMPConst.ARRAY_LAST_ITEM to append items. + + + the new value of the array item. Has the same usage as + propValue in setProperty(). + + the set options that decide about the kind of the node. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the array + The name of the array + The index to insert the new item + the value of the array item + Wraps all errors and exceptions + + + + + + The namespace URI for the array + The name of the array + the value of the array item + Wraps all errors and exceptions + + + + Provides access to fields within a nested structure. + + Provides access to fields within a nested structure. The namespace for the field is passed as + a URI, you need not worry about the path string syntax. The names of fields should be XML + qualified names, that is within an XML namespace. The path syntax for a qualified name uses + the namespace prefix, which is unreliable because the prefix is never guaranteed. The URI is + the formal name, the prefix is just a local shorthand in a given sequence of XML text. + + The namespace URI for the struct. Has the same usage as in getProperty. + + The name of the struct. May be a general path expression, must not be null + or the empty string. Has the same namespace prefix usage as propName in getProperty. + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be null or the + empty string. Has the same namespace prefix usage as the structName parameter. + + + the value of thefield, if the field has a value. + Has the same usage as propValue in getProperty. + + Option flags describing the field. See the earlier description. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the struct + The name of the struct + The namespace URI for the field + The name of the field + the value of the field + Wraps all errors and exceptions + + + + Provides access to a qualifier attached to a property. + + Provides access to a qualifier attached to a property. The namespace for the qualifier is + passed as a URI, you need not worry about the path string syntax. In many regards qualifiers + are like struct fields. See the introductory discussion of qualified properties for more + information. The names of qualifiers should be XML qualified names, that is within an XML + namespace. The path syntax for a qualified name uses the namespace prefix, which is + unreliable because the prefix is never guaranteed. The URI is the formal name, the prefix is + just a local shorthand in a given sequence of XML text. The property the qualifier + will be attached has to exist. + + The namespace URI for the struct. Has the same usage as in getProperty. + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty. + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + + A pointer to the null terminated UTF-8 string that is the + value of the qualifier, if the qualifier has a value. Has the same usage as propValue + in getProperty. + + Option flags describing the qualifier. See the earlier description. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the struct + The name of the property to which the qualifier is attached + The namespace URI for the qualifier + The name of the qualifier + the value of the qualifier + Wraps all errors and exceptions + + + + Deletes the given XMP subtree rooted at the given property. + + Deletes the given XMP subtree rooted at the given property. It is not an error if the + property does not exist. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + The name of the property. Has the same usage as in getProperty. + + + Deletes the given XMP subtree rooted at the given array item. + + Deletes the given XMP subtree rooted at the given array item. It is not an error if the array + item does not exist. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant XMPConst.ARRAY_LAST_ITEM always refers to the last + existing array item. + + + + Deletes the given XMP subtree rooted at the given struct field. + + Deletes the given XMP subtree rooted at the given struct field. It is not an error if the + field does not exist. + + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the struct. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + structName parameter. + + + + Deletes the given XMP subtree rooted at the given qualifier. + + Deletes the given XMP subtree rooted at the given qualifier. It is not an error if the + qualifier does not exist. + + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty. + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + + + Returns whether the property exists. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + Returns true if the property exists. + + + Tells if the array item exists. + + The namespace URI for the array. Has the same usage as in + getProperty(). + + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant XMPConst.ARRAY_LAST_ITEM always refers to the last + existing array item. + + Returns true if the array exists, false otherwise. + + + DoesStructFieldExist tells if the struct field exists. + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the struct. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + structName parameter. + + Returns true if the field exists. + + + DoesQualifierExist tells if the qualifier exists. + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty(). + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + Returns true if the qualifier exists. + + + + Modifies the value of a selected item in an alt-text array. + + Modifies the value of a selected item in an alt-text array. Creates an appropriate array item + if necessary, and handles special cases for the x-default item. If the selected item is from + a match with the specific language, the value of that item is modified. If the existing value + of that item matches the existing value of the x-default item, the x-default item is also + modified. If the array only has 1 existing item (which is not x-default), an x-default item + is added with the given value. If the selected item is from a match with the generic language + and there are no other generic matches, the value of that item is modified. If the existing + value of that item matches the existing value of the x-default item, the x-default item is + also modified. If the array only has 1 existing item (which is not x-default), an x-default + item is added with the given value. If the selected item is from a partial match with the + generic language and there are other partial matches, a new item is created for the specific + language. The x-default item is not modified. If the selected item is from the last 2 rules + then a new item is created for the specific language. If the array only had an x-default + item, the x-default item is also modified. If the array was empty, items are created for the + specific language and x-default. + Note: In a future version of this API a method + using Java java.lang.Locale will be added. + + + The namespace URI for the alt-text array. Has the same usage as in + getProperty(). + + + The name of the alt-text array. May be a general path expression, must not + be null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The name of the generic language as an RFC 3066 primary subtag. May be + null or the empty string if no generic language is wanted. + + + The name of the specific language as an RFC 3066 tag. Must not be + null or the empty string. + + + A pointer to the null terminated UTF-8 string that is the new + value for the appropriate array item. + + Option flags, none are defined at present. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the alt-text array + The name of the alt-text array + The name of the generic language + The name of the specific language + the new value for the appropriate array item + Wraps all errors and exceptions + + + + + These are very similar to getProperty() and SetProperty() above, + but the value is returned or provided in a literal form instead of as a UTF-8 string. + + + These are very similar to getProperty() and SetProperty() above, + but the value is returned or provided in a literal form instead of as a UTF-8 string. + The path composition functions in XMPPathFactory may be used to compose an path + expression for fields in nested structures, items in arrays, or qualifiers. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Boolean value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns an Integer value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Long value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Double value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a XMPDateTime-object or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Java Calendar-object or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a byte[]-array contained the decoded base64 value + or null if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + Convenience method to retrieve the literal value of a property. + Note: There is no setPropertyString(), + because setProperty() sets a string value. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a String value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to set a property to a literal boolean value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as boolean. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as boolean + Wraps all exceptions + + + + Convenience method to set a property to a literal int value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as int. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as int + Wraps all exceptions + + + + Convenience method to set a property to a literal long value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as long. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as long + Wraps all exceptions + + + + Convenience method to set a property to a literal double value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as double. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as double + Wraps all exceptions + + + + + Convenience method to set a property with an XMPDateTime-object, + which is serialized to an ISO8601 date. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the property value as XMPDateTime. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the property value as XMPDateTime + Wraps all exceptions + + + + + Convenience method to set a property with a Java Calendar-object, + which is serialized to an ISO8601 date. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the property value as Java Calendar. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the property value as Calendar + Wraps all exceptions + + + + + Convenience method to set a property from a binary byte[]-array, + which is serialized as base64-string. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as byte array. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as byte array + Wraps all exceptions + + + + Constructs an iterator for the properties within this XMP object. + Returns an XMPIterator. + + Wraps all errors and exceptions that may occur. + + + + Constructs an iterator for the properties within this XMP object using some options. + Option flags to control the iteration. + Returns an XMPIterator. + + Wraps all errors and exceptions that may occur. + + + + Construct an iterator for the properties within an XMP object. + + Construct an iterator for the properties within an XMP object. According to the parameters it iterates the entire data tree, + properties within a specific schema, or a subtree rooted at a specific node. + + + Optional schema namespace URI to restrict the iteration. Omitted (visit all + schema) by passing null or empty String. + + + Optional property name to restrict the iteration. May be an arbitrary path + expression. Omitted (visit all properties) by passing null or empty + String. If no schema URI is given, it is ignored. + + + Option flags to control the iteration. See + + for + details. + + + Returns an XMPIterator for this XMPMeta-object + considering the given options. + + Wraps all errors and exceptions that may occur. + + + + + This correlates to the about-attribute, + returns the empty String if no name is set. + + Returns the name of the XMP object. + + + Sets the name of the XMP object. + + + + Returns the unparsed content of the <?xpacket> processing instruction. + This contains normally the attribute-like elements 'begin="<BOM>" + id="W5M0MpCehiHzreSzNTczkc9d"' and possibly the deprecated elements 'bytes="1234"' or + 'encoding="XXX"'. If the parsed packet has not been wrapped into an xpacket, + null is returned. + + + + Clones the complete metadata tree. + Returns a deep copy of this instance. + + + + Perform the normalization as a separate parsing step. + + Perform the normalization as a separate parsing step. + Normally it is done during parsing, unless the parsing option + + is set to true. + Note: It does no harm to call this method to an already normalized xmp object. + It was a PDF/A requirement to get hand on the unnormalized XMPMeta object. + + optional parsing options. + Wraps all errors and exceptions that may occur. + + + + Renders this node and the tree unter this node in a human readable form. + Returns a multiline string containing the dump. + + + Property values are Strings by default + + + root of the metadata tree + + + the xpacket processing instructions content + + + Constructor for an empty metadata object. + + + Constructor for a cloned metadata tree. + + an prefilled metadata tree which fulfills all + XMPNode contracts. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a property, but the result value can be requested. + + Returns a property, but the result value can be requested. It can be one + of + + , + + , + + , + + , + + , + + , + + , + + . + + + a schema namespace + a property name or path + the type of the value, see VALUE_... + Returns an XMPProperty + Collects any exception that occurs. + + + + Returns a property, but the result value can be requested. + + a schema namespace + a property name or path + the type of the value, see VALUE_... + + Returns the node value as an object according to the + valueType. + + Collects any exception that occurs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the packetHeader attributes, only used by the parser. + the processing instruction content + + + Performs a deep clone of the XMPMeta-object + + + + + + + + + + + + + + Returns the root node of the XMP tree. + + + Locate or create the item node and set the value. + + Locate or create the item node and set the value. Note the index + parameter is one-based! The index can be in the range [1..size + 1] or + "last()", normalize it and check the insert flags. The order of the + normalization checks is important. If the array is empty we end up with + an index and location to set item size + 1. + + an array node + the index where to insert the item + the item value + the options for the new item + insert oder overwrite at index position? + + + + + The internals for setProperty() and related calls, used after the node is + found or created. + + the newly created node + the node value, can be null + options for the new node, must not be null. + + flag if the existing value is to be overwritten + thrown if options and value do not correspond + + + + + Evaluates a raw node value to the given value type, apply special + conversions for defined types in XMP. + + an int indicating the value type + the node containing the value + Returns a literal value for the node. + + + + + This class replaces the ExpatAdapter.cpp and does the + XML-parsing and fixes the prefix. + + + This class replaces the ExpatAdapter.cpp and does the + XML-parsing and fixes the prefix. After the parsing several normalisations + are applied to the XMPTree. + + 01.02.2006 + + + Hidden constructor, initialises the SAX parser handler. + + + + Parses the input source into an XMP metadata object, including + de-aliasing and normalisation. + + + the input can be an InputStream, a String or + a byte buffer containing the XMP packet. + + the parse options + Returns the resulting XMP metadata object + Thrown if parsing or normalisation fails. + + + + + + Parses XML from an , + fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally. + + an InputStream + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + Parses XML from a byte buffer, + fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally. + + a byte buffer containing the XMP packet + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + + Parses XML from a + + , + fixing the illegal control character optionally. + + a String containing the XMP packet + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + + + A node in the internally XMP tree, which can be a schema node, a property node, an array node, + an array item, a struct node or a qualifier node (without '?'). + + + A node in the internally XMP tree, which can be a schema node, a property node, an array node, + an array item, a struct node or a qualifier node (without '?'). + Possible improvements: + 1. The kind Node of node might be better represented by a class-hierarchy of different nodes. + 2. The array type should be an enum + 3. isImplicitNode should be removed completely and replaced by return values of fi. + 4. hasLanguage, hasType should be automatically maintained by XMPNode + + 21.02.2006 + + + name of the node, contains different information depending of the node kind + + + + value of the node, contains different information depending of the node kind + + + + link to the parent node + + + list of child nodes, lazy initialized + + + list of qualifier of the node, lazy initialized + + + options describing the kind of the node + + + flag if the node is implicitly created + + + flag if the node has aliases + + + flag if the node is an alias + + + flag if the node has an "rdf:value" child node. + + + Creates an XMPNode with initial values. + the name of the node + the value of the node + the options of the node + + + Constructor for the node without value. + the name of the node + the options of the node + + + Resets the node. + + + Returns the parent node. + + + an index [1..size] + Returns the child with the requested index. + + + Adds a node as child to this node. + an XMPNode + + + + Adds a node as child to this node. + + the index of the node before which the new one is inserted. + Note: The node children are indexed from [1..size]! + An index of size + 1 appends a node. + + an XMPNode + + + + Replaces a node with another one. + + the index of the node that will be replaced. + Note: The node children are indexed from [1..size]! + + the replacement XMPNode + + + Removes a child at the requested index. + the index to remove [1..size] + + + Removes a child node. + + Removes a child node. + If its a schema node and doesn't have any children anymore, its deleted. + + the child node to delete. + + + + Removes the children list if this node has no children anymore; + checks if the provided node is a schema node and doesn't have any children anymore, + its deleted. + + + + Removes all children from the node. + + + Returns the number of children without neccessarily creating a list. + + + child node name to look for + Returns an XMPNode if node has been found, null otherwise. + + + + an index [1..size] + Returns the qualifier with the requested index. + + + Returns the number of qualifier without neccessarily creating a list. + + + Appends a qualifier to the qualifier list and sets respective options. + a qualifier node. + + + + Removes one qualifier node and fixes the options. + qualifier to remove + + + Removes all qualifiers from the node and sets the options appropriate. + + + qualifier node name to look for + + Returns a qualifier XMPNode if node has been found, + null otherwise. + + + + Returns whether the node has children. + + + + Returns an iterator for the children. + Note: take care to use it.remove(), as the flag are not adjusted in that case. + + + + Returns whether the node has qualifier attached. + + + + Returns an iterator for the qualifier. + Note: take care to use it.remove(), as the flag are not adjusted in that case. + + + + Performs a deep clone of the node and the complete subtree. + + + + + Performs a deep clone of the complete subtree (children and + qualifier )into and add it to the destination node. + + the node to add the cloned subtree + + + Renders this node and the tree unter this node in a human readable form. + + Flag is qualifier and child nodes shall be rendered too + Returns a multiline string containing the dump. + + + + + + Returns the name. + + + The name to set. + + + Returns the value. + + + The value to set. + + + Returns the options. + + + Updates the options of the node. + the options to set. + + + Returns the implicit flag + + + Sets the implicit node flag + + + Returns if the node contains aliases (applies only to schema nodes) + + + sets the flag that the node contains aliases + + + Returns if the node contains aliases (applies only to schema nodes) + + + sets the flag that the node is an alias + + + the hasValueChild + + + the hasValueChild to set + + + + Dumps this node and its qualifier and children recursively. + + Dumps this node and its qualifier and children recursively. + Note: It creats empty options on every node. + + the buffer to append the dump. + Flag is qualifier and child nodes shall be rendered too + the current indent level. + the index within the parent node (important for arrays) + + + Returns whether this node is a language qualifier. + + + Returns whether this node is a type qualifier. + + + + Note: This method should always be called when accessing 'children' to be sure + that its initialized. + + Returns list of children that is lazy initialized. + + + Returns a read-only copy of child nodes list. + + + Returns list of qualifier that is lazy initialized. + + + + Sets the parent node, this is solely done by addChild(...) + and addQualifier(). + + Sets the parent node. + + + Internal find. + the list to search in + the search expression + Returns the found node or nulls. + + + Checks that a node name is not existing on the same level, except for array items. + + the node name to check + Thrown if a node with the same name is existing. + + + + Checks that a qualifier name is not existing on the same level. + the new qualifier name + Thrown if a node with the same name is existing. + + + + Utilities for XMPNode. + Aug 28, 2006 + + + Private Constructor + + + Find or create a schema node if createNodes is false and + the root of the xmp tree. + a namespace + + a flag indicating if the node shall be created if not found. + Note: The namespace must be registered prior to this call. + + + Returns the schema node if found, null otherwise. + Note: If createNodes is true, it is always + returned a valid node. + + + An exception is only thrown if an error occurred, not if a + node was not found. + + + + Find or create a schema node if createNodes is true. + the root of the xmp tree. + a namespace + If a prefix is suggested, the namespace is allowed to be registered. + + + a flag indicating if the node shall be created if not found. + Note: The namespace must be registered prior to this call. + + + Returns the schema node if found, null otherwise. + Note: If createNodes is true, it is always + returned a valid node. + + + An exception is only thrown if an error occurred, not if a + node was not found. + + + + Find or create a child node under a given parent node. + + Find or create a child node under a given parent node. If the parent node is no + Returns the found or created child node. + + the parent node + the node name to find + flag, if new nodes shall be created. + Returns the found or created node or null. + Thrown if + + + Follow an expanded path expression to find or create a node. + the node to begin the search. + the complete xpath + + flag if nodes shall be created + (when called by setProperty()) + + + the options for the created leaf nodes (only when + createNodes == true). + + Returns the node if found or created or null. + + An exception is only thrown if an error occurred, + not if a node was not found. + + + + Deletes the the given node and its children from its parent. + + Deletes the the given node and its children from its parent. + Takes care about adjusting the flags. + + the top-most node to delete. + + + This is setting the value of a leaf node. + an XMPNode + a value + + + Verifies the PropertyOptions for consistancy and updates them as needed. + + + Verifies the PropertyOptions for consistancy and updates them as needed. + If options are null they are created with default values. + + the PropertyOptions + the node value to set + Returns the updated options. + If the options are not consistant. + + + + + Converts the node value to String, apply special conversions for defined + types in XMP. + + the node value to set + Returns the String representation of the node value. + + + + Find or create a qualifier node under a given parent node. + + Find or create a qualifier node under a given parent node. Returns a pointer to the + qualifier node, and optionally an iterator for the node's position in + the parent's vector of qualifiers. The iterator is unchanged if no qualifier node (null) + is returned. + Note: On entry, the qualName parameter must not have the leading '?' from the + XMPPath step. + + the parent XMPNode + the qualifier name + flag if nodes shall be created + Returns the qualifier node if found or created, null otherwise. + + + + + an array node + the segment containing the array index + flag if new nodes are allowed to be created. + Returns the index or index = -1 if not found + Throws Exceptions + + + + Searches for a field selector in a node: + [fieldName="value] - an element in an array of structs, chosen by a field value. + + + Searches for a field selector in a node: + [fieldName="value] - an element in an array of structs, chosen by a field value. + No implicit nodes are created by field selectors. + + + + + Returns the index of the field if found, otherwise -1. + + + + + Searches for a qualifier selector in a node: + [?qualName="value"] - an element in an array, chosen by a qualifier value. + + + Searches for a qualifier selector in a node: + [?qualName="value"] - an element in an array, chosen by a qualifier value. + No implicit nodes are created for qualifier selectors, + except for an alias to an x-default item. + + an array node + the qualifier name + the qualifier value + + in case the qual selector results from an alias, + an x-default node is created if there has not been one. + + Returns the index of th + + + + Make sure the x-default item is first. + + Make sure the x-default item is first. Touch up "single value" + arrays that have a default plus one real language. This case should have + the same value for both items. Older Adobe apps were hardwired to only + use the "x-default" item, so we copy that value to the other + item. + + an alt text array node + + + See if an array is an alt-text array. + + See if an array is an alt-text array. If so, make sure the x-default item + is first. + + the array node to check if its an alt-text array + + + Appends a language item to an alt text array. + the language array + the language of the item + the content of the item + Thrown if a duplicate property is added + + + + + Looks for the appropriate language item in a text alternative array.item + + an array node + the requested language + Returns the index if the language has been found, -1 otherwise. + + + + Aug 18, 2006 + + + caches the correct dc-property array forms + + + Hidden constructor + + + Normalizes a raw parsed XMPMeta-Object + the raw metadata object + the parsing options + Returns the normalized metadata object + Collects all severe processing errors. + + + + + Tweak old XMP: Move an instance ID from rdf:about to the + xmpMM:InstanceID property. + + + Tweak old XMP: Move an instance ID from rdf:about to the + xmpMM:InstanceID property. An old instance ID usually looks + like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign + 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If + the name looks like a UUID simply move it to xmpMM:InstanceID, + don't worry about any existing xmpMM:InstanceID. Both will + only be present when a newer file with the xmpMM:InstanceID + property is updated by an old app that uses rdf:about. + + the root of the metadata tree + Thrown if tweaking fails. + + + Visit all schemas to do general fixes and handle special cases. + the metadata object implementation + Thrown if the normalisation fails. + + + + + Undo the denormalization performed by the XMP used in Acrobat 5.
+ If a Dublin Core array had only one item, it was serialized as a simple + property. +
+ + Undo the denormalization performed by the XMP used in Acrobat 5.
+ If a Dublin Core array had only one item, it was serialized as a simple + property.
+ The xml:lang attribute was dropped from an + alt-text item if the language was x-default. +
+ the DC schema node + Thrown if normalization fails + +
+ + Make sure that the array is well-formed AltText. + + Make sure that the array is well-formed AltText. Each item must be simple + and have an "xml:lang" qualifier. If repairs are needed, keep simple + non-empty items by adding the "xml:lang" with value "x-repair". + + the property node of the array to repair. + Forwards unexpected exceptions. + + + + Visit all of the top level nodes looking for aliases. + + Visit all of the top level nodes looking for aliases. If there is + no base, transplant the alias subtree. If there is a base and strict + aliasing is on, make sure the alias and base subtrees match. + + the root of the metadata tree + th parsing options + Forwards XMP errors + + + + Moves an alias node of array form to another schema into an array + the node to be moved + the base array for the array item + Forwards XMP errors + + + Fixes the GPS Timestamp in EXIF. + the EXIF schema node + Thrown if the date conversion fails. + + + + Remove all empty schemas from the metadata tree that were generated during the rdf parsing. + + the root of the metadata tree + + + The outermost call is special. + + The outermost call is special. The names almost certainly differ. The + qualifiers (and hence options) will differ for an alias to the x-default + item of a langAlt array. + + the alias node + the base node of the alias + marks the outer call of the recursion + Forwards XMP errors + + + + The initial support for WAV files mapped a legacy ID3 audio copyright + into a new xmpDM:copyright property. + + + The initial support for WAV files mapped a legacy ID3 audio copyright + into a new xmpDM:copyright property. This is special case code to migrate + that into dc:rights['x-default']. The rules: +
+            1. If there is no dc:rights array, or an empty array -
+            Create one with dc:rights['x-default'] set from double linefeed and xmpDM:copyright.
+            2. If there is a dc:rights array but it has no x-default item -
+            Create an x-default item as a copy of the first item then apply rule #3.
+            3. If there is a dc:rights array with an x-default item,
+            Look for a double linefeed in the value.
+            A. If no double linefeed, compare the x-default value to the xmpDM:copyright value.
+            A1. If they match then leave the x-default value alone.
+            A2. Otherwise, append a double linefeed and
+            the xmpDM:copyright value to the x-default value.
+            B. If there is a double linefeed, compare the trailing text to the xmpDM:copyright value.
+            B1. If they match then leave the x-default value alone.
+            B2. Otherwise, replace the trailing x-default text with the xmpDM:copyright value.
+            4. In all cases, delete the xmpDM:copyright property.
+            
+
+ the metadata object + the "dm:copyright"-property +
+ + + Initializes the map that contains the known arrays, that are fixed by + + . + + + + The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. + + + The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. There + is only one single instance used by the toolkit. + + 27.01.2006 + + + + + + + + Returns the registered prefix/namespace-pairs as map, where the keys are the + namespaces and the values are the prefixes. + + + + + Returns the registered namespace/prefix-pairs as map, where the keys are the + prefixes and the values are the namespaces. + + + + + Determines if a name is an alias, and what it is aliased to. + + The namespace URI of the alias. Must not be null or the empty + string. + + + The name of the alias. May be an arbitrary path expression + path, must not be null or the empty string. + + + Returns the XMPAliasInfo for the given alias namespace and property or + null if there is no such alias. + + + + Collects all aliases that are contained in the provided namespace. + + Collects all aliases that are contained in the provided namespace. + If nothing is found, an empty array is returned. + + a schema namespace URI + Returns all alias infos from aliases that are contained in the provided namespace. + + + Searches for registered aliases. + an XML conform qname + + Returns if an alias definition for the given qname to another + schema and property is registered. + + + + + Returns the registered aliases as map, where the key is the "qname" (prefix and name) + and the value an XMPAliasInfo-object. + + + + a map from a namespace URI to its registered prefix + + + a map from a prefix to the associated namespace URI + + + a map of all registered aliases. + + a map of all registered aliases. + The map is a relationship from a qname to an XMPAliasInfo-object. + + + + The pattern that must not be contained in simple properties + + + + Performs the initialisation of the registry with the default namespaces, aliases and global + options. + + + + + + + + + + + + + + + + + + + + + + + + Register the standard namespaces of schemas and types that are included in the XMP + Specification and some other Adobe private namespaces. + + + Register the standard namespaces of schemas and types that are included in the XMP + Specification and some other Adobe private namespaces. + Note: This method is not lock because only called by the constructor. + + Forwards processing exceptions + + + + + + + + + + + + + + + Register the standard aliases. + + Register the standard aliases. + Note: This method is not lock because only called by the constructor. + + If the registrations of at least one alias fails. + + + + This interface is used to return info about an alias. + 27.01.2006 + + + Returns Returns the namespace URI for the base property. + + + Returns the default prefix for the given base property. + + + Returns the path of the base property. + + + + Returns the kind of the alias. This can be a direct alias + (ARRAY), a simple property to an ordered array + (ARRAY_ORDERED), to an alternate array + (ARRAY_ALTERNATE) or to an alternate text array + (ARRAY_ALT_TEXT). + + + + + + + + + + + + + + + + + + Serializes the XMPMeta-object to an OutputStream according to the + SerializeOptions. + + 11.07.2006 + + + Static method to serialize the metadata object. + + Static method to serialize the metadata object. For each serialisation, a new XMPSerializer + instance is created, either XMPSerializerRDF or XMPSerializerPlain so thats its possible to + serialialize the same XMPMeta objects in two threads. + + a metadata implementation object + the output stream to serialize to + serialization options, can be null for default. + + + + + Serializes an XMPMeta-object as RDF into a string. + + Serializes an XMPMeta-object as RDF into a string. + Note: Encoding is forced to UTF-16 when serializing to a + string to ensure the correctness of "exact packet size". + + a metadata implementation object + + Options to control the serialization (see + + ). + + Returns a string containing the serialized RDF. + on serializsation errors. + + + Serializes an XMPMeta-object as RDF into a byte buffer. + a metadata implementation object + + Options to control the serialization (see + + ). + + Returns a byte buffer containing the serialized RDF. + on serializsation errors. + + + Serializes the XMPMeta-object using the standard RDF serialization format. + + + Serializes the XMPMeta-object using the standard RDF serialization format. + The output is written to an OutputStream + according to the SerializeOptions. + + 11.07.2006 + + + default padding + + + The w/r is missing inbetween + + + a set of all rdf attribute qualifier + + + the metadata object to be serialized. + + + the output stream to serialize to + + + this writer is used to do the actual serialization + + + the stored serialization options + + + + the size of one unicode char, for UTF-8 set to 1 + (Note: only valid for ASCII chars lower than 0x80), + set to 2 in case of UTF-16 + + + + + the padding in the XMP Packet, or the length of the complete packet in + case of option exactPacketLength. + + + + The actual serialization. + the metadata object to be serialized + outputStream the output stream to serialize to + the serialization options + If case of wrong options or any other serialization error. + + + + Calculates the padding according to the options and write it to the stream. + + the length of the tail string + thrown if packet size is to small to fit the padding + + forwards writer errors + + + Checks if the supplied options are consistent. + Thrown if options are conflicting + + + + Writes the (optional) packet header and the outer rdf-tags. + Returns the packet end processing instraction to be written after the padding. + + Forwarded writer exceptions. + + + + Serializes the metadata in pretty-printed manner. + indent level + Forwarded writer exceptions + + + + + + + Serializes the metadata in compact manner. + indent level to start with + Forwarded writer exceptions + + + + Write each of the parent's simple unqualified properties as an attribute. + + + Write each of the parent's simple unqualified properties as an attribute. Returns true if all + of the properties are written as attributes. + + the parent property node + the current indent level + Returns true if all properties can be rendered as RDF attribute. + + + + + Recursively handles the "value" for a node that must be written as an RDF + property element. + + + Recursively handles the "value" for a node that must be written as an RDF + property element. It does not matter if it is a top level property, a + field of a struct, or an item of an array. The indent is that for the + property element. The patterns bwlow ignore attribute qualifiers such as + xml:lang, they don't affect the output form. +
+
+            <ns:UnqualifiedStructProperty-1
+            ... The fields as attributes, if all are simple and unqualified
+            />
+            <ns:UnqualifiedStructProperty-2 rdf:parseType="Resource">
+            ... The fields as elements, if none are simple and unqualified
+            </ns:UnqualifiedStructProperty-2>
+            <ns:UnqualifiedStructProperty-3>
+            <rdf:Description
+            ... The simple and unqualified fields as attributes
+            >
+            ... The compound or qualified fields as elements
+            </rdf:Description>
+            </ns:UnqualifiedStructProperty-3>
+            <ns:UnqualifiedArrayProperty>
+            <rdf:Bag> or Seq or Alt
+            ... Array items as rdf:li elements, same forms as top level properties
+            </rdf:Bag>
+            </ns:UnqualifiedArrayProperty>
+            <ns:QualifiedProperty rdf:parseType="Resource">
+            <rdf:value> ... Property "value"
+            following the unqualified forms ... </rdf:value>
+            ... Qualifiers looking like named struct fields
+            </ns:QualifiedProperty>
+            
+
+ *** Consider numbered array items, but has compatibility problems. + Consider qualified form with rdf:Description and attributes. +
+ the parent node + the current indent level + Forwards writer exceptions + If qualifier and element fields are mixed. + +
+ + Serializes a simple property. + an XMPNode + Returns an array containing the flags emitEndTag and indentEndTag. + Forwards the writer exceptions. + + + Serializes an array property. + an XMPNode + the current indent level + Forwards the writer exceptions. + If qualifier and element fields are mixed. + + + + Serializes a struct property. + an XMPNode + the current indent level + Flag if the element has resource qualifier + Returns true if an end flag shall be emitted. + Forwards the writer exceptions. + If qualifier and element fields are mixed. + + + + Serializes the general qualifier. + the root node of the subtree + the current indent level + Forwards all writer exceptions. + If qualifier and element fields are mixed. + + + + + Serializes one schema with all contained properties in pretty-printed + manner.
+ Each schema's properties are written to a single + rdf:Description element. +
+ + Serializes one schema with all contained properties in pretty-printed + manner.
+ Each schema's properties are written to a single + rdf:Description element. All of the necessary namespaces are declared in + the rdf:Description element. The baseIndent is the base level for the + entire serialization, that of the x:xmpmeta element. An xml:lang + qualifier is written as an attribute of the property start tag, not by + itself forcing the qualified property form. +
+
+            <rdf:Description rdf:about="TreeName" xmlns:ns="URI" ... >
+            ... The actual properties of the schema, see SerializePrettyRDFProperty
+            <!-- ns1:Alias is aliased to ns2:Actual -->  ... If alias comments are wanted
+            </rdf:Description>
+            
+
+
+ a schema node + + Forwarded writer exceptions + +
+ + Writes all used namespaces of the subtree in node to the output. + + Writes all used namespaces of the subtree in node to the output. + The subtree is recursivly traversed. + + the root node of the subtree + a set containing currently used prefixes + the current indent level + Forwards all writer exceptions. + + + Writes one namespace declaration to the output. + a namespace prefix (without colon) or a complete qname (when namespace == null) + + the a namespace + a set containing currently used prefixes + the current indent level + Forwards all writer exceptions. + + + Start the outer rdf:Description element, including all needed xmlns attributes. + + + Start the outer rdf:Description element, including all needed xmlns attributes. + Leave the element open so that the compact form can add property attributes. + + If the writing to + + + + Recursively handles the "value" for a node. + + Recursively handles the "value" for a node. It does not matter if it is a + top level property, a field of a struct, or an item of an array. The + indent is that for the property element. An xml:lang qualifier is written + as an attribute of the property start tag, not by itself forcing the + qualified property form. The patterns below mostly ignore attribute + qualifiers like xml:lang. Except for the one struct case, attribute + qualifiers don't affect the output form. +
+
+            <ns:UnqualifiedSimpleProperty>value</ns:UnqualifiedSimpleProperty>
+            <ns:UnqualifiedStructProperty> (If no rdf:resource qualifier)
+            <rdf:Description>
+            ... Fields, same forms as top level properties
+            </rdf:Description>
+            </ns:UnqualifiedStructProperty>
+            <ns:ResourceStructProperty rdf:resource="URI"
+            ... Fields as attributes
+            >
+            <ns:UnqualifiedArrayProperty>
+            <rdf:Bag> or Seq or Alt
+            ... Array items as rdf:li elements, same forms as top level properties
+            </rdf:Bag>
+            </ns:UnqualifiedArrayProperty>
+            <ns:QualifiedProperty>
+            <rdf:Description>
+            <rdf:value> ... Property "value" following the unqualified
+            forms ... </rdf:value>
+            ... Qualifiers looking like named struct fields
+            </rdf:Description>
+            </ns:QualifiedProperty>
+            
+
+
+ the property node + property shall be rendered as attribute rather than tag + + + use canonical form with inner description tag or + the compact form with rdf:ParseType="resource" attribute. + + the current indent level + Forwards all writer exceptions. + If "rdf:resource" and general qualifiers are mixed. + +
+ + Writes the array start and end tags. + an array node + flag if its the start or end tag + the current indent level + forwards writer exceptions + + + Serializes the node value in XML encoding. + + Serializes the node value in XML encoding. Its used for tag bodies and + attributes. Note: The attribute is always limited by quotes, + thats why &apos; is never serialized. Note: + Control chars are written unescaped, but if the user uses others than tab, LF + and CR the resulting XML will become invalid. + + the value of the node + flag if value is an attribute value + + + + + Writes indents and automatically includes the baseindend from the options. + + number of indents to write + forwards exception + + + Writes a char to the output. + a char + forwards writer exceptions + + + Writes a String to the output. + a String + forwards writer exceptions + + + Writes an amount of chars, mostly spaces + number of chars + a char + + + + Writes a newline according to the options. + Forwards exception + + + 11.08.2006 + + + + U+0022 ASCII space
+ U+3000, ideographic space
+ U+303F, ideographic half fill space
+ U+2000..U+200B, en quad through zero width space +
+
+ + + U+002C, ASCII comma
+ U+FF0C, full width comma
+ U+FF64, half width ideographic comma
+ U+FE50, small comma
+ U+FE51, small ideographic comma
+ U+3001, ideographic comma
+ U+060C, Arabic comma
+ U+055D, Armenian comma +
+
+ + + U+003B, ASCII semicolon
+ U+FF1B, full width semicolon
+ U+FE54, small semicolon
+ U+061B, Arabic semicolon
+ U+037E, Greek "semicolon" (really a question mark) +
+
+ + + U+0022 ASCII quote
+ The square brackets are not interpreted as quotes anymore (bug #2674672) + (ASCII '[' (0x5B) and ']' (0x5D) are used as quotes in Chinese and + Korean.)
+ U+00AB and U+00BB, guillemet quotes
+ U+3008..U+300F, various quotes.
+ U+301D..U+301F, double prime quotes.
+ U+2015, dash quote.
+ U+2018..U+201F, various quotes.
+ U+2039 and U+203A, guillemet quotes. +
+
+ + + U+0000..U+001F ASCII controls
+ U+2028, line separator.
+ U+2029, paragraph separator. +
+
+ + Private constructor, as + + + + The XMP object containing the array to be catenated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + + The string to be used to separate the items in the catenated + string. Defaults to "; ", ASCII semicolon and space + (U+003B, U+0020). + + + The characters to be used as quotes around array items that + contain a separator. Defaults to '"' + + Option flag to control the catenation. + Returns the string containing the catenated array items. + Forwards the Exceptions from the metadata processing + + + + + see + + + The XMP object containing the array to be updated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + The string to be separated into the array items. + Option flags to control the separation. + Flag if commas shall be preserved + Forwards the Exceptions from the metadata processing + + + + Utility to find or create the array used by separateArrayItems(). + + a the namespace fo the array + the name of the array + the options for the array if newly created + the xmp object + Returns the array node. + Forwards exceptions + + + + The XMP object containing the properties to be removed. + + Optional schema namespace URI for the properties to be + removed. + + Optional path expression for the property to be removed. + + Option flag to control the deletion: do internal properties in + addition to external properties. + + + Option flag to control the deletion: Include aliases in the + "named schema" case above. + + If metadata processing fails + + + + + The source XMP object. + The destination XMP object. + Do internal properties in addition to external properties. + + Replace the values of existing properties. + Delete destination values if source property is empty. + + Forwards the Exceptions from the metadata processing + + + + + Remove all schema children according to the flag + doAllProperties. + + + Remove all schema children according to the flag + doAllProperties. Empty schemas are automatically remove + by XMPNode + + a schema node + flag if all properties or only externals shall be removed. + + Returns true if the schema is empty after the operation. + + + + The destination XMP object. + the source node + the parent of the destination node + Replace the values of existing properties. + + flag if properties with empty values should be deleted + in the destination object. + + + + + Compares two nodes including its children and qualifier. + an XMPNode + an XMPNode + Returns true if the nodes are equal, false otherwise. + Forwards exceptions to the calling method. + + + + Make sure the separator is OK. + + Make sure the separator is OK. It must be one semicolon surrounded by + zero or more spaces. Any of the recognized semicolons or spaces are + allowed. + + + + + + + Make sure the open and close quotes are a legitimate pair and return the + correct closing quote or an exception. + + opened and closing quote in a string + the open quote + Returns a corresponding closing quote. + + + + + Classifies the character into normal chars, spaces, semicola, quotes, + control chars. + + a char + Return the character kind. + + + the open quote char + Returns the matching closing quote for an open quote. + + + Add quotes to the item. + the array item + the open quote character + the closing quote character + flag if commas are allowed + Returns the value in quotes. + + + a character + the opening quote char + the closing quote char + Return it the character is a surrounding quote. + + + a character + the opening quote char + the closing quote char + Returns true if the character is a closing quote. + + + Representates an XMP XMPPath with segment accessor methods. + 28.02.2006 + + + Marks a struct field step , also for top level nodes (schema "fields"). + + + Marks a qualifier step. + + Marks a qualifier step. + Note: Order is significant to separate struct/qual from array kinds! + + + + Marks an array index step + + + stores the segments of an XMPPath + + + Append a path segment + the segment to add + + + the index of the segment to return + Returns a path segment. + + + Returns the size of the xmp path. + + + Return a single String explaining which certificate was verified, how and why. + + + + Parser for XMP XPaths. + 01.03.2006 + + + Private constructor + + + + + + + + + Parses a struct segment + the current position in the path + Retusn the segment or an errror + If the sement is empty + + + Parses an array index segment. + the xmp path + Returns the segment or an error + thrown on xmp path errors + + + + Parses the root node of an XMP Path, checks if namespace and prefix fit together + and resolve the property to the base property if it is an alias. + + the root namespace + the parsing position helper + the path to contribute to + If the path is not valid. + + + + Verifies whether the qualifier name is not XML conformant or the + namespace prefix has not been registered. + + a qualifier name + If the name is not conformant + + + Verify if an XML name is conformant. + an XML name + When the name is not XML conformant + + + + This objects contains all needed char positions to parse. + + + the complete path + + + the start of a segment name + + + the end of a segment name + + + the begin of a step + + + the end of a step + + + A segment of a parsed XMPPath. + 23.06.2006 + + + name of the path segment + + + kind of the path segment + + + flag if segment is an alias + + + alias form if applicable + + + Constructor with initial values. + the name of the segment + + + Constructor with initial values. + the name of the segment + the kind of the segment + + + Returns the kind. + + + The kind to set. + + + Returns the name. + + + The name to set. + + + the flag to set + + + Returns the alias. + + + Returns the aliasForm if this segment has been created by an alias. + + + the aliasForm to set + + + + + + Options for XMPSchemaRegistryImpl#registerAlias. + 20.02.2006 + + + The base class for a collection of 32 flag bits. + + The base class for a collection of 32 flag bits. Individual flags are defined as enum value bit + masks. Inheriting classes add convenience accessor methods. + + 24.01.2006 + + + the internal int containing all options + + + a map containing the bit names + + + The default constructor. + + + Constructor with the options bit mask. + the options bit mask + If the options are not correct + + + Resets the options. + + + an option bitmask + Returns true, if this object is equal to the given options. + + + an option bitmask + Returns true, if this object contains all given options. + + + an option bitmask + Returns true, if this object contain at least one of the given options. + + + the binary bit or bits that are requested + Returns if all of the requested bits are set or not. + + + the binary bit or bits that shall be set to the given value + the boolean value to set + + + Is friendly to access it during the tests. + Returns the options. + + + The options to set. + + + + + + + + + + Creates a human readable string from the set options. + + Creates a human readable string from the set options. Note: This method is quite + expensive and should only be used within tests or as + + + Returns a String listing all options that are set to true by their name, + like "option1 | option4". + + + + Returns the options as hex bitmask. + + + To be implemeted by inheritants. + Returns a bit mask where all valid option bits are set. + + + To be implemeted by inheritants. + a single, valid option bit. + Returns a human readable name for an option bit. + + + The inheriting option class can do additional checks on the options. + + The inheriting option class can do additional checks on the options. + Note: For performance reasons this method is only called + when setting bitmasks directly. + When get- and set-methods are used, this method must be called manually, + normally only when the Options-object has been created from a client + (it has to be made public therefore). + + the bitmask to check. + Thrown if the options are not consistent. + + + Checks options before they are set. + + Checks options before they are set. + First it is checked if only defined options are used, + second the additional + + -method is called. + + the options to check + Thrown if the options are invalid. + + + Looks up or asks the inherited class for the name of an option bit. + + Looks up or asks the inherited class for the name of an option bit. + Its save that there is only one valid option handed into the method. + + a single option bit + Returns the option name or undefined. + + + Returns the optionNames map and creates it if required. + + + This is a direct mapping. + This is a direct mapping. The actual data type does not matter. + + + The actual is an unordered array, the alias is to the first element of the array. + + + The actual is an ordered array, the alias is to the first element of the array. + + + The actual is an alternate array, the alias is to the first element of the array. + + + The actual is an alternate text array, the alias is to the 'x-default' element of the array. + + + + + + the options to init with + If options are not consistant + + + Returns if the alias is of the simple form. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + + returns a + + s object + + If the options are not consistant. + + + + + + + + + Options for XMPIterator construction. + 24.01.2006 + + + Just do the immediate children of the root, default is subtree. + + + Just do the leaf nodes, default is all nodes in the subtree. + + Just do the leaf nodes, default is all nodes in the subtree. + Bugfix #2658965: If this option is set the Iterator returns the namespace + of the leaf instead of the namespace of the base property. + + + + Return just the leaf part of the path, default is the full path. + + + Omit all qualifiers. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + + + + + + + + Options for + + . + + 24.01.2006 + + + Require a surrounding "x:xmpmeta" element in the xml-document. + + + Do not reconcile alias differences, throw an exception instead. + + + Convert ASCII control characters 0x01 - 0x1F (except tab, cr, and lf) to spaces. + + + If the input is not unicode, try to parse it as ISO-8859-1. + + + Do not carry run the XMPNormalizer on a packet, leave it as it is. + + + Sets the options to the default values. + + + Returns the requireXMPMeta. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option "omit normalization". + + + the value to set + Returns the instance to call more set-methods. + + + + + + + + + + The property flags are used when properties are fetched from the XMPMeta-object + and provide more detailed information about the property. + + 03.07.2006 + + + may be used in the future + + + Updated by iText. + Updated by iText. Indicates if the property should be writted as a separate node + + + Default constructor + + + Intialization constructor + the initialization options + If the options are not valid + + + + Return whether the property value is a URI. It is serialized to RDF using the + rdf:resource attribute. Not mandatory for URIs, but considered RDF-savvy. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether the property has qualifiers. These could be an xml:lang + attribute, an rdf:type property, or a general qualifier. See the + introductory discussion of qualified properties for more information. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is a qualifier for some other property. Note that if the + qualifier itself has a structured value, this flag is only set for the top node of + the qualifier's subtree. Qualifiers may have arbitrary structure, and may even have + qualifiers. + + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property has an xml:lang qualifier. + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property has an rdf:type qualifier. + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property contains nested fields. + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an array. By itself this indicates a general + unordered array. It is serialized using an rdf:Bag container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an ordered array. Appears in conjunction with + getPropValueIsArray(). It is serialized using an rdf:Seq container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an alternative array. Appears in conjunction with + getPropValueIsArray(). It is serialized using an rdf:Alt container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an alt-text array. Appears in conjunction with + getPropArrayIsAlternate(). It is serialized using an rdf:Alt container. + Each array element is a simple property with an xml:lang attribute. + + + + the value to set + Returns this to enable cascaded options. + + + Returns whether the SCHEMA_NODE option is set. + + + the option DELETE_EXISTING to set + Returns this to enable cascaded options. + + + Returns whether the property is of composite type - an array or a struct. + + + Returns whether the property is of composite type - an array or a struct. + + + Compares two options set for array compatibility. + other options + Returns true if the array options of the sets are equal. + + + Merges the set options of a another options object with this. + + Merges the set options of a another options object with this. + If the other options set is null, this objects stays the same. + + other options + If illegal options are provided + + + Returns true if only array options are set. + + + + + + + + + + Checks that a node not a struct and array at the same time; + and URI cannot be a struct. + + the bitmask to check. + Thrown if the options are not consistent. + + + + Omit the XML packet wrapper. + + + Mark packet as read-only. + Mark packet as read-only. Default is a writeable packet. + + + Use a compact form of RDF. + + Use a compact form of RDF. + The compact form is the default serialization format (this flag is technically ignored). + To serialize to the canonical form, set the flag USE_CANONICAL_FORMAT. + If both flags "compact" and "canonical" are set, canonical is used. + + + + Use the canonical form of RDF if set. + Use the canonical form of RDF if set. By default the compact form is used + + + Include a padding allowance for a thumbnail image. + + Include a padding allowance for a thumbnail image. If no xmp:Thumbnails property + is present, the typical space for a JPEG thumbnail is used. + + + + The padding parameter provides the overall packet length. + + The padding parameter provides the overall packet length. The actual amount of padding is + computed. An exception is thrown if the packet exceeds this length with no padding. + + + + + Sort the struct properties and qualifier before serializing + + + Bit indicating little endian encoding, unset is big endian + + + Bit indication UTF16 encoding. + + + UTF8 encoding; this is the default + + + UTF16BE encoding + + + UTF16LE encoding + + + The amount of padding to be added if a writeable XML packet is created. + + The amount of padding to be added if a writeable XML packet is created. If zero is passed + (the default) an appropriate amount of padding is computed. + + + + The string to be used as a line terminator. + + The string to be used as a line terminator. If empty it defaults to; linefeed, U+000A, the + standard XML newline. + + + + + The string to be used for each level of indentation in the serialized + RDF. + + + The string to be used for each level of indentation in the serialized + RDF. If empty it defaults to two ASCII spaces, U+0020. + + + + + The number of levels of indentation to be used for the outermost XML element in the + serialized RDF. + + + The number of levels of indentation to be used for the outermost XML element in the + serialized RDF. This is convenient when embedding the RDF in other text, defaults to 0. + + + + Omits the Toolkit version attribute, not published, only used for Unit tests. + + + Default constructor. + + + Constructor using inital options + the inital options + Thrown if options are not consistant. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the baseIndent. + + + The baseIndent to set. + Returns the instance to call more set-methods. + + + Returns the indent. + + + The indent to set. + Returns the instance to call more set-methods. + + + Returns the newline. + + + The newline to set. + Returns the instance to call more set-methods. + + + Returns the padding. + + + The padding to set. + Returns the instance to call more set-methods. + + + + Returns whether the Toolkit version attribute shall be omitted. + Note: This options can only be set by unit tests. + + + + Returns the encoding as Java encoding String. + + + Returns clone of this SerializeOptions-object with the same options set. + Cannot happen in this place. + + + + + + + + + Class that contains several constants. + + + External Contributors to the resource (other than the authors). + + + The extent or scope of the resource. + + + The authors of the resource (listed in order of precedence, if significant). + + + Date(s) that something interesting happened to the resource. + + + A textual description of the content of the resource. + A textual description of the content of the resource. Multiple values may be present for different languages. + + + + The file format used when saving the resource. + The file format used when saving the resource. Tools and applications should set this property to the save format of the data. It may include appropriate qualifiers. + + + + An unordered array of text strings that unambiguously identify the resource within a given context. + + + + An unordered array specifying the languages used in the resource. + + + Publishers. + + + Relationships to other documents. + + + Informal rights statement, selected by language. + + + Unique identifier of the work from which this resource was derived. + + + An unordered array of descriptive phrases or keywords that specify the topic of the content of the resource. + + + + The title of the document, or the name given to the resource. + The title of the document, or the name given to the resource. Typically, it will be a name by which the resource is formally known. + + + + A document type; for example, novel, poem, or working paper. + + + Keywords. + + + The PDF file version (for example: 1.0, 1.3, and so on). + + + The Producer. + + + The part + + + An unordered array specifying properties that were edited outside the authoring application. + An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single namespace and XPath separated by one ASCII space (U+0020). + + + + The base URL for relative URLs in the document content. + The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. Web authoring tools should set the value based on their notion of where URLs will be interpreted. + + + + The date and time the resource was originally created. + + + The name of the first known tool used to create the resource. + The name of the first known tool used to create the resource. If history is present in the metadata, this value should be equivalent to that of xmpMM:History's softwareAgent property. + + + + The date and time that any metadata for this resource was last changed. + + + The date and time the resource was last modified. + + + A short informal name for the resource. + + + An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding. + + + + This class writes the DOM structure of the XML to the specified output. + + + Print writer. + + + Canonical output. + + + Processing XML 1.1 document. + + + Default constructor. + + + Creates an XmlDomWriter. + should the writer write canonical output or not + + + Sets whether output is canonical. + + + Sets the output stream for printing. + + + + Writes the specified node, recursively. + + + + Returns a sorted list of attributes. + + + Normalizes and prints the given string. + + + + Normalizes and print the given character. + + + + + A factory to create XMPDateTime-instances from a Calendar or an + ISO 8601 string or for the current time. + + 16.02.2006 + + + Private constructor + + + Creates an XMPDateTime from a Calendar-object. + + a Calendar-object. + An XMPDateTime-object. + + + Creates an empty XMPDateTime-object. + Returns an XMPDateTime-object. + + + Creates an XMPDateTime-object from initial values. + years + + months from 1 to 12
+ Note: Remember that the month in + + is defined from 0 to 11. + + days + Returns an XMPDateTime-object. +
+ + Creates an XMPDateTime-object from initial values. + years + + months from 1 to 12
+ Note: Remember that the month in + + is defined from 0 to 11. + + days + hours + minutes + seconds + nanoseconds + Returns an XMPDateTime-object. +
+ + Creates an XMPDateTime from an ISO 8601 string. + The ISO 8601 string representation of the date/time. + An XMPDateTime-object. + When the ISO 8601 string is non-conform + + + + Obtain the current date and time. + + Returns The returned time is UTC, properly adjusted for the local time zone. The + resolution of the time is not guaranteed to be finer than seconds. + + + + + Sets the local time zone without touching any other Any existing time zone value is replaced, + the other date/time fields are not adjusted in any way. + + the XMPDateTime variable containing the value to be modified. + + Returns an updated XMPDateTime-object. + + + Make sure a time is UTC. + + Make sure a time is UTC. If the time zone is not UTC, the time is + adjusted and the time zone set to be UTC. + + + the XMPDateTime variable containing the time to + be modified. + + Returns an updated XMPDateTime-object. + + + Make sure a time is local. + + Make sure a time is local. If the time zone is not the local zone, the time is adjusted and + the time zone set to be local. + + the XMPDateTime variable containing the time to be modified. + + Returns an updated XMPDateTime-object. + + + 21.09.2006 + + + Note: This is an error code introduced by Java. + + + This exception wraps all errors that occur in the XMP Toolkit. + 16.02.2006 + + + the errorCode of the XMP toolkit + + + Constructs an exception with a message and an error code. + the message + the error code + + + Constructs an exception with a message, an error code and a Throwable + the error message. + the error code + the exception source + + + Returns the errorCode. + + + Creates XMPMeta-instances from an InputStream + 30.01.2006 + + + The singleton instance of the XMPSchemaRegistry. + + + cache for version info + + + Hides public constructor + + + Returns the singleton instance of the XMPSchemaRegistry. + + + Returns an empty XMPMeta-object. + + + Parsing with default options. + an InputStream + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + + Parsing with default options. + a String contain an XMP-file. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Creates an XMPMeta-object from a string. + a String contain an XMP-file. + Options controlling the parsing. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Parsing with default options. + a String contain an XMP-file. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Creates an XMPMeta-object from a byte-buffer. + a String contain an XMP-file. + Options controlling the parsing. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + + Serializes an XMPMeta-object as RDF into an OutputStream + with default options. + + a metadata object + an OutputStream to write the serialized RDF to. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into an OutputStream. + a metadata object + + Options to control the serialization (see + + ). + + an OutputStream to write the serialized RDF to. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into a byte buffer. + a metadata object + + Options to control the serialization (see + + ). + + Returns a byte buffer containing the serialized RDF. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into a string. + + Serializes an XMPMeta-object as RDF into a string. Note: Encoding + is ignored when serializing to a string. + + a metadata object + + Options to control the serialization (see + + ). + + Returns a string containing the serialized RDF. + on serializsation errors. + + + + Asserts that xmp is compatible to XMPMetaImpl.s + + + Resets the schema registry to its original state (creates a new one). + + Resets the schema registry to its original state (creates a new one). + Be careful this might break all existing XMPMeta-objects and should be used + only for testing purpurses. + + + + Obtain version information. + + Obtain version information. The XMPVersionInfo singleton is created the first time + its requested. + + Returns the version information. + + + + Returns the primary release number, the "1" in version "1.2.3". + + + Returns the secondary release number, the "2" in version "1.2.3". + + + Returns the tertiary release number, the "3" in version "1.2.3". + + + Returns a rolling build number, monotonically increasing in a release. + + + Returns true if this is a debug build. + + + Returns a comprehensive version information string. + + + + Private constructor + + + Compose the path expression for an item in an array. + + The name of the array. May be a general path expression, must not be + null or the empty string. + + + The index of the desired item. Arrays in XMP are indexed from 1. + 0 and below means last array item and renders as [last()]. + + + Returns the composed path basing on fullPath. This will be of the form + ns:arrayName[i], where "ns" is the prefix for schemaNS and + "i" is the decimal representation of itemIndex. + + Throws exeption if index zero is used. + + + + Compose the path expression for a field in a struct. + + Compose the path expression for a field in a struct. The result can be added to the + path of + + + The namespace URI for the field. Must not be null or the empty + string. + + + The name of the field. Must be a simple XML name, must not be + null or the empty string. + + + Returns the composed path. This will be of the form + ns:structName/fNS:fieldName, where "ns" is the prefix for + schemaNS and "fNS" is the prefix for fieldNS. + + Thrown if the path to create is not valid. + + + + Compose the path expression for a qualifier. + + The namespace URI for the qualifier. May be null or the empty + string if the qualifier is in the XML empty namespace. + + + The name of the qualifier. Must be a simple XML name, must not be + null or the empty string. + + + Returns the composed path. This will be of the form + ns:propName/?qNS:qualName, where "ns" is the prefix for + schemaNS and "qNS" is the prefix for qualNS. + + Thrown if the path to create is not valid. + + + + Compose the path expression to select an alternate item by language. + + Compose the path expression to select an alternate item by language. The + path syntax allows two forms of "content addressing" that may + be used to select an item in an array of alternatives. The form used in + ComposeLangSelector lets you select an item in an alt-text array based on + the value of its xml:lang qualifier. The other form of content + addressing is shown in ComposeFieldSelector. \note ComposeLangSelector + does not supplant SetLocalizedText or GetLocalizedText. They should + generally be used, as they provide extra logic to choose the appropriate + language and maintain consistency with the 'x-default' value. + ComposeLangSelector gives you an path expression that is explicitly and + only for the language given in the langName parameter. + + + The name of the array. May be a general path expression, must + not be null or the empty string. + + The RFC 3066 code for the desired language. + + Returns the composed path. This will be of the form + ns:arrayName[@xml:lang='langName'], where + "ns" is the prefix for schemaNS. + + + + + ParameterAsserts that a qualifier namespace is set. + a qualifier namespace + Qualifier schema is null or empty + + + + ParameterAsserts that a qualifier name is set. + a qualifier name or path + Qualifier name is null or empty + + + + ParameterAsserts that a struct field namespace is set. + a struct field namespace + Struct field schema is null or empty + + + + ParameterAsserts that a struct field name is set. + a struct field name or path + Struct field name is null or empty + + + + Utility methods for XMP. + + Utility methods for XMP. I included only those that are different from the + Java default conversion utilities. + + 21.02.2006 + + + Private constructor + + + Create a single edit string from an array of strings. + The XMP object containing the array to be catenated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + + The string to be used to separate the items in the catenated + string. Defaults to "; ", ASCII semicolon and space + (U+003B, U+0020). + + + The characters to be used as quotes around array items that + contain a separator. Defaults to '"' + + Option flag to control the catenation. + Returns the string containing the catenated array items. + Forwards the Exceptions from the metadata processing + + + + Separate a single edit string into an array of strings. + The XMP object containing the array to be updated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + The string to be separated into the array items. + Option flags to control the separation. + Flag if commas shall be preserved + Forwards the Exceptions from the metadata processing + + + + + Alias without the new option deleteEmptyValues. + The source XMP object. + The destination XMP object. + Do internal properties in addition to external properties. + Replace the values of existing properties. + Forwards the Exceptions from the metadata processing + + + + + + Convert from boolean to string. + a boolean value + + The XMP string representation of the boolean. The values used are + given by the constnts + + and + + . + + + + Converts a string value to an int. + the string value + Returns an int. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from int to string. + an int value + The string representation of the int. + + + Converts a string value to a long. + the string value + Returns a long. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from long to string. + a long value + The string representation of the long. + + + Converts a string value to a double. + the string value + Returns a double. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from long to string. + a long value + The string representation of the long. + + + Converts a string value to an XMPDateTime. + the string value + Returns an XMPDateTime-object. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from XMPDateTime to string. + an XMPDateTime + The string representation of the long. + + + Convert from a byte array to a base64 encoded string. + the byte array to be converted + Returns the base64 string. + + + Decode from Base64 encoded string to raw data. + a base64 encoded string + Returns a byte array containg the decoded string. + Thrown if the given string is not property base64 encoded + + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + Return the DER encoding of the object, null if the DER encoding can not be made. + + @return a DER byte array, null otherwise. + + + a general purpose ASN.1 decoder - note: this class differs from the + others in that it returns null after it has read the last object in + the stream. If an ASN.1 Null is encountered a Der/BER Null object is + returned. + + + Create an ASN1InputStream where no DER object will be longer than limit. + + @param input stream containing ASN.1 encoded data. + @param limit maximum size of a DER encoded object. + + + Create an ASN1InputStream based on the input byte array. The length of DER objects in + the stream is automatically limited to the length of the input array. + + @param input array containing ASN.1 encoded data. + + + build an object given its tag and the number of bytes to construct it from. + + + A Null object. + + + Create a base ASN.1 object from a byte array. + The byte array to parse. + The base ASN.1 object represented by the byte array. + If there is a problem parsing the data. + + + Read a base ASN.1 object from a stream. + The stream to parse. + The base ASN.1 object represented by the byte array. + If there is a problem parsing the data. + + + return an Octet string from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return an Octet string from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + @param string the octets making up the octet string. + + + return an Asn1Sequence from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Return an ASN1 sequence from a tagged object. There is a special + case here, if an object appears to have been explicitly tagged on + reading but we were expecting it to be implicitly tagged in the + normal course of events it indicates that we lost the surrounding + sequence - so we need to add it back (this will happen if the tagged + object is a sequence that contains other sequences). If you are + dealing with implicitly tagged sequences you really should + be using this method. + + @param obj the tagged object. + @param explicitly true if the object is meant to be explicitly tagged, + false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return the object at the sequence position indicated by index. + + @param index the sequence number (starting at zero) of the object + @return the object at the sequence position indicated by index. + + + return an ASN1Set from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Return an ASN1 set from a tagged object. There is a special + case here, if an object appears to have been explicitly tagged on + reading but we were expecting it to be implicitly tagged in the + normal course of events it indicates that we lost the surrounding + set - so we need to add it back (this will happen if the tagged + object is a sequence that contains other sequences). If you are + dealing with implicitly tagged sets you really should + be using this method. + + @param obj the tagged object. + @param explicitly true if the object is meant to be explicitly tagged + false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return the object at the set position indicated by index. + + @param index the set number (starting at zero) of the object + @return the object at the set position indicated by index. + + + ASN.1 TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if the object is explicitly tagged. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + return whether or not the object may be explicitly tagged. +

+ Note: if the object has been read from an input stream, the only + time you can be sure if isExplicit is returning the true state of + affairs is if it returns false. An implicitly tagged object may appear + to be explicitly tagged, so you need to understand the context under + which the reading was done as well, see GetObject below.

+
+ + return whatever was following the tag. +

+ Note: tagged objects are generally context dependent if you're + trying to extract a tagged object you should be going via the + appropriate GetInstance method.

+
+ + Return the object held in this tagged object as a parser assuming it has + the type of the passed in tag. If the object doesn't have a parser + associated with it, the base object is returned. + + + Base class for an application specific object + + + Return the enclosed object assuming explicit tagging. + + @return the resulting object + @throws IOException if reconstruction fails. + + + Return the enclosed object assuming implicit tagging. + + @param derTagNo the type tag that should be applied to the object's contents. + @return the resulting object + @throws IOException if reconstruction fails. + + + basic interface for Der string objects. + + + return a Bit string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return a Bit string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + @param data the octets making up the bit string. + @param padBits the number of extra bits at the end of the string. + + + Return the octets contained in this BIT STRING, checking that this BIT STRING really + does represent an octet aligned string. Only use this method when the standard you are + following dictates that the BIT STRING will be octet aligned. + + @return a copy of the octet aligned data. + + + @return the value of the bit string as an int (truncating if necessary) + + + A BER Null object. + + + A Null object. + + + The octets making up the octet string. + + + convert a vector of octet strings into a single byte string + + + The octets making up the octet string. + + + return the DER octets that make up this string. + + + create an empty sequence + + + create a sequence containing one object + + + create a sequence containing a vector of objects. + + + create an empty sequence + + + create a sequence containing one object + + + create a sequence containing a vector of objects. + + + A Der encoded set object + + + create an empty set + + + @param obj - a single object that makes up the set. + + + @param v - a vector of objects making up the set. + + + create an empty sequence + + + create a set containing one object + + + create a set containing a vector of objects. + + + BER TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + DER TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if an explicitly tagged object. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + create an implicitly tagged object that contains a zero + length sequence. + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if an explicitly tagged object. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + create an implicitly tagged object that contains a zero + length sequence. + + +
+            CAKeyUpdAnnContent ::= SEQUENCE {
+                                        oldWithNew   CmpCertificate, -- old pub signed with new priv
+                                        newWithOld   CmpCertificate, -- new pub signed with old priv
+                                        newWithNew   CmpCertificate  -- new pub signed with new priv
+             }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertConfirmContent ::= SEQUENCE OF CertStatus
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertifiedKeyPair ::= SEQUENCE {
+                                             certOrEncCert       CertOrEncCert,
+                                             privateKey      [0] EncryptedValue      OPTIONAL,
+                                             -- see [CRMF] for comment on encoding
+                                             publicationInfo [1] PKIPublicationInfo  OPTIONAL
+                  }
+            
+ @return a basic ASN.1 object representation. +
+ + Marker interface for CHOICE objects - if you implement this in a roll-your-own + object, any attempt to tag the object implicitly will convert the tag to an + explicit one as the encoding rules require. +

+ If you use this interface your class should also implement the getInstance + pattern which takes a tag object and the tagging mode used. +

+
+ +
+            CertOrEncCert ::= CHOICE {
+                                 certificate     [0] CMPCertificate,
+                                 encryptedCert   [1] EncryptedValue
+                      }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertRepMessage ::= SEQUENCE {
+                                     caPubs       [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
+                                                                                        OPTIONAL,
+                                     response         SEQUENCE OF CertResponse
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertResponse ::= SEQUENCE {
+                                       certReqId           INTEGER,
+                                       -- to match this response with corresponding request (a value
+                                       -- of -1 is to be used if certReqId is not specified in the
+                                       -- corresponding request)
+                                       status              PKIStatusInfo,
+                                       certifiedKeyPair    CertifiedKeyPair    OPTIONAL,
+                                       rspInfo             OCTET STRING        OPTIONAL
+                                       -- analogous to the id-regInfo-utf8Pairs string defined
+                                       -- for regInfo in CertReqMsg [CRMF]
+                        }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertStatus ::= SEQUENCE {
+                              certHash    OCTET STRING,
+                              -- the hash of the certificate, using the same hash algorithm
+                              -- as is used to create and verify the certificate signature
+                              certReqId   INTEGER,
+                              -- to match this confirmation with the corresponding req/rep
+                              statusInfo  PKIStatusInfo OPTIONAL
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+             Challenge ::= SEQUENCE {
+                             owf                 AlgorithmIdentifier  OPTIONAL,
+            
+                             -- MUST be present in the first Challenge; MAY be omitted in
+                             -- any subsequent Challenge in POPODecKeyChallContent (if
+                             -- omitted, then the owf used in the immediately preceding
+                             -- Challenge is to be used).
+            
+                             witness             OCTET STRING,
+                             -- the result of applying the one-way function (owf) to a
+                             -- randomly-generated INTEGER, A.  [Note that a different
+                             -- INTEGER MUST be used for each Challenge.]
+                             challenge           OCTET STRING
+                             -- the encryption (under the public key for which the cert.
+                             -- request is being made) of Rand, where Rand is specified as
+                             --   Rand ::= SEQUENCE {
+                             --      int      INTEGER,
+                             --       - the randomly-generated INTEGER A (above)
+                             --      sender   GeneralName
+                             --       - the sender's name (as included in PKIHeader)
+                             --   }
+                  }
+             
+ @return a basic ASN.1 object representation. +
+ + Note: the addition of attribute certificates is a BC extension. + + +
+             CMPCertificate ::= CHOICE {
+                        x509v3PKCert        Certificate
+                        x509v2AttrCert      [1] AttributeCertificate
+              }
+             
+ Note: the addition of attribute certificates is a BC extension. + + @return a basic ASN.1 object representation. +
+ +
+            CrlAnnContent ::= SEQUENCE OF CertificateList
+            
+ @return a basic ASN.1 object representation. +
+ +
+            ErrorMsgContent ::= SEQUENCE {
+                                   pKIStatusInfo          PKIStatusInfo,
+                                   errorCode              INTEGER           OPTIONAL,
+                                   -- implementation-specific error codes
+                                   errorDetails           PKIFreeText       OPTIONAL
+                                   -- implementation-specific error details
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
+            
+ @return a basic ASN.1 object representation. +
+ +
+            GenRepContent ::= SEQUENCE OF InfoTypeAndValue
+            
+ @return a basic ASN.1 object representation. +
+ + Example InfoTypeAndValue contents include, but are not limited + to, the following (un-comment in this ASN.1 module and use as + appropriate for a given environment): +
+               id-it-caProtEncCert    OBJECT IDENTIFIER ::= {id-it 1}
+                  CAProtEncCertValue      ::= CMPCertificate
+               id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2}
+                 SignKeyPairTypesValue   ::= SEQUENCE OF AlgorithmIdentifier
+               id-it-encKeyPairTypes  OBJECT IDENTIFIER ::= {id-it 3}
+                 EncKeyPairTypesValue    ::= SEQUENCE OF AlgorithmIdentifier
+               id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4}
+                  PreferredSymmAlgValue   ::= AlgorithmIdentifier
+               id-it-caKeyUpdateInfo  OBJECT IDENTIFIER ::= {id-it 5}
+                  CAKeyUpdateInfoValue    ::= CAKeyUpdAnnContent
+               id-it-currentCRL       OBJECT IDENTIFIER ::= {id-it 6}
+                  CurrentCRLValue         ::= CertificateList
+               id-it-unsupportedOIDs  OBJECT IDENTIFIER ::= {id-it 7}
+                  UnsupportedOIDsValue    ::= SEQUENCE OF OBJECT IDENTIFIER
+               id-it-keyPairParamReq  OBJECT IDENTIFIER ::= {id-it 10}
+                  KeyPairParamReqValue    ::= OBJECT IDENTIFIER
+               id-it-keyPairParamRep  OBJECT IDENTIFIER ::= {id-it 11}
+                  KeyPairParamRepValue    ::= AlgorithmIdentifer
+               id-it-revPassphrase    OBJECT IDENTIFIER ::= {id-it 12}
+                  RevPassphraseValue      ::= EncryptedValue
+               id-it-implicitConfirm  OBJECT IDENTIFIER ::= {id-it 13}
+                  ImplicitConfirmValue    ::= NULL
+               id-it-confirmWaitTime  OBJECT IDENTIFIER ::= {id-it 14}
+                  ConfirmWaitTimeValue    ::= GeneralizedTime
+               id-it-origPKIMessage   OBJECT IDENTIFIER ::= {id-it 15}
+                  OrigPKIMessageValue     ::= PKIMessages
+               id-it-suppLangTags     OBJECT IDENTIFIER ::= {id-it 16}
+                  SuppLangTagsValue       ::= SEQUENCE OF UTF8String
+            
+             where
+            
+               id-pkix OBJECT IDENTIFIER ::= {
+                  iso(1) identified-organization(3)
+                  dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
+             and
+                  id-it   OBJECT IDENTIFIER ::= {id-pkix 4}
+             
+
+ +
+            InfoTypeAndValue ::= SEQUENCE {
+                                    infoType               OBJECT IDENTIFIER,
+                                    infoValue              ANY DEFINED BY infoType  OPTIONAL
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            KeyRecRepContent ::= SEQUENCE {
+                                    status                  PKIStatusInfo,
+                                    newSigCert          [0] CMPCertificate OPTIONAL,
+                                    caCerts             [1] SEQUENCE SIZE (1..MAX) OF
+                                                                      CMPCertificate OPTIONAL,
+                                    keyPairHist         [2] SEQUENCE SIZE (1..MAX) OF
+                                                                      CertifiedKeyPair OPTIONAL
+                         }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            OobCertHash ::= SEQUENCE {
+                                 hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
+                                 certId      [1] CertId                  OPTIONAL,
+                                 hashVal         BIT STRING
+                                 -- hashVal is calculated over the Der encoding of the
+                                 -- self-signed certificate with the identifier certID.
+                  }
+            
+ @return a basic ASN.1 object representation. +
+ +
+             PbmParameter ::= SEQUENCE {
+                                   salt                OCTET STRING,
+                                   -- note:  implementations MAY wish to limit acceptable sizes
+                                   -- of this string to values appropriate for their environment
+                                   -- in order to reduce the risk of denial-of-service attacks
+                                   owf                 AlgorithmIdentifier,
+                                   -- AlgId for a One-Way Function (SHA-1 recommended)
+                                   iterationCount      INTEGER,
+                                   -- number of times the OWF is applied
+                                   -- note:  implementations MAY wish to limit acceptable sizes
+                                   -- of this integer to values appropriate for their environment
+                                   -- in order to reduce the risk of denial-of-service attacks
+                                   mac                 AlgorithmIdentifier
+                                   -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
+               }   -- or HMAC [RFC2104, RFC2202])
+            
+ @return a basic ASN.1 object representation. +
+ + Creates a new PkiBody. + @param type one of the TYPE_* constants + @param content message content + + +
+            PkiBody ::= CHOICE {       -- message-specific body elements
+                   ir       [0]  CertReqMessages,        --Initialization Request
+                   ip       [1]  CertRepMessage,         --Initialization Response
+                   cr       [2]  CertReqMessages,        --Certification Request
+                   cp       [3]  CertRepMessage,         --Certification Response
+                   p10cr    [4]  CertificationRequest,   --imported from [PKCS10]
+                   popdecc  [5]  POPODecKeyChallContent, --pop Challenge
+                   popdecr  [6]  POPODecKeyRespContent,  --pop Response
+                   kur      [7]  CertReqMessages,        --Key Update Request
+                   kup      [8]  CertRepMessage,         --Key Update Response
+                   krr      [9]  CertReqMessages,        --Key Recovery Request
+                   krp      [10] KeyRecRepContent,       --Key Recovery Response
+                   rr       [11] RevReqContent,          --Revocation Request
+                   rp       [12] RevRepContent,          --Revocation Response
+                   ccr      [13] CertReqMessages,        --Cross-Cert. Request
+                   ccp      [14] CertRepMessage,         --Cross-Cert. Response
+                   ckuann   [15] CAKeyUpdAnnContent,     --CA Key Update Ann.
+                   cann     [16] CertAnnContent,         --Certificate Ann.
+                   rann     [17] RevAnnContent,          --Revocation Ann.
+                   crlann   [18] CRLAnnContent,          --CRL Announcement
+                   pkiconf  [19] PKIConfirmContent,      --Confirmation
+                   nested   [20] NestedMessageContent,   --Nested Message
+                   genm     [21] GenMsgContent,          --General Message
+                   genp     [22] GenRepContent,          --General Response
+                   error    [23] ErrorMsgContent,        --Error Message
+                   certConf [24] CertConfirmContent,     --Certificate confirm
+                   pollReq  [25] PollReqContent,         --Polling request
+                   pollRep  [26] PollRepContent          --Polling response
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PkiConfirmContent ::= NULL
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PKIFailureInfo ::= BIT STRING {
+            badAlg               (0),
+              -- unrecognized or unsupported Algorithm Identifier
+            badMessageCheck      (1), -- integrity check failed (e.g., signature did not verify)
+            badRequest           (2),
+              -- transaction not permitted or supported
+            badTime              (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
+            badCertId            (4), -- no certificate could be found matching the provided criteria
+            badDataFormat        (5),
+              -- the data submitted has the wrong format
+            wrongAuthority       (6), -- the authority indicated in the request is different from the one creating the response token
+            incorrectData        (7), -- the requester's data is incorrect (for notary services)
+            missingTimeStamp     (8), -- when the timestamp is missing but should be there (by policy)
+            badPOP               (9)  -- the proof-of-possession failed
+            certRevoked         (10),
+            certConfirmed       (11),
+            wrongIntegrity      (12),
+            badRecipientNonce   (13), 
+            timeNotAvailable    (14),
+              -- the TSA's time source is not available
+            unacceptedPolicy    (15),
+              -- the requested TSA policy is not supported by the TSA
+            unacceptedExtension (16),
+              -- the requested extension is not supported by the TSA
+            addInfoNotAvailable (17)
+              -- the additional information requested could not be understood
+              -- or is not available
+            badSenderNonce      (18),
+            badCertTemplate     (19),
+            signerNotTrusted    (20),
+            transactionIdInUse  (21),
+            unsupportedVersion  (22),
+            notAuthorized       (23),
+            systemUnavail       (24),    
+            systemFailure       (25),
+              -- the request cannot be handled due to system failure
+            duplicateCertReq    (26) 
+            
+
+ + Basic constructor. + + +
+            PkiFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
+            
+
+ + Return the number of string elements present. + + @return number of elements present. + + + Return the UTF8STRING at index. + + @param index index of the string of interest + @return the string at index. + + + Value for a "null" recipient or sender. + + +
+             PkiHeader ::= SEQUENCE {
+                       pvno                INTEGER     { cmp1999(1), cmp2000(2) },
+                       sender              GeneralName,
+                       -- identifies the sender
+                       recipient           GeneralName,
+                       -- identifies the intended recipient
+                       messageTime     [0] GeneralizedTime         OPTIONAL,
+                       -- time of production of this message (used when sender
+                       -- believes that the transport will be "suitable"; i.e.,
+                       -- that the time will still be meaningful upon receipt)
+                       protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
+                       -- algorithm used for calculation of protection bits
+                       senderKID       [2] KeyIdentifier           OPTIONAL,
+                       recipKID        [3] KeyIdentifier           OPTIONAL,
+                       -- to identify specific keys used for protection
+                       transactionID   [4] OCTET STRING            OPTIONAL,
+                       -- identifies the transaction; i.e., this will be the same in
+                       -- corresponding request, response, certConf, and PKIConf
+                       -- messages
+                       senderNonce     [5] OCTET STRING            OPTIONAL,
+                       recipNonce      [6] OCTET STRING            OPTIONAL,
+                       -- nonces used to provide replay protection, senderNonce
+                       -- is inserted by the creator of this message; recipNonce
+                       -- is a nonce previously inserted in a related message by
+                       -- the intended recipient of this message
+                       freeText        [7] PKIFreeText             OPTIONAL,
+                       -- this may be used to indicate context-specific instructions
+                       -- (this field is intended for human consumption)
+                       generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
+                                            InfoTypeAndValue     OPTIONAL
+                       -- this may be used to convey context-specific information
+                       -- (this field not primarily intended for human consumption)
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+             PKIHeader ::= SEQUENCE {
+                       pvno                INTEGER     { cmp1999(1), cmp2000(2) },
+                       sender              GeneralName,
+                       -- identifies the sender
+                       recipient           GeneralName,
+                       -- identifies the intended recipient
+                       messageTime     [0] GeneralizedTime         OPTIONAL,
+                       -- time of production of this message (used when sender
+                       -- believes that the transport will be "suitable"; i.e.,
+                       -- that the time will still be meaningful upon receipt)
+                       protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
+                       -- algorithm used for calculation of protection bits
+                       senderKID       [2] KeyIdentifier           OPTIONAL,
+                       recipKID        [3] KeyIdentifier           OPTIONAL,
+                       -- to identify specific keys used for protection
+                       transactionID   [4] OCTET STRING            OPTIONAL,
+                       -- identifies the transaction; i.e., this will be the same in
+                       -- corresponding request, response, certConf, and PKIConf
+                       -- messages
+                       senderNonce     [5] OCTET STRING            OPTIONAL,
+                       recipNonce      [6] OCTET STRING            OPTIONAL,
+                       -- nonces used to provide replay protection, senderNonce
+                       -- is inserted by the creator of this message; recipNonce
+                       -- is a nonce previously inserted in a related message by
+                       -- the intended recipient of this message
+                       freeText        [7] PKIFreeText             OPTIONAL,
+                       -- this may be used to indicate context-specific instructions
+                       -- (this field is intended for human consumption)
+                       generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
+                                            InfoTypeAndValue     OPTIONAL
+                       -- this may be used to convey context-specific information
+                       -- (this field not primarily intended for human consumption)
+            }
+            
+ @return a basic ASN.1 object representation. +
+ + Creates a new PkiMessage. + + @param header message header + @param body message body + @param protection message protection (may be null) + @param extraCerts extra certificates (may be null) + + +
+            PkiMessage ::= SEQUENCE {
+                             header           PKIHeader,
+                             body             PKIBody,
+                             protection   [0] PKIProtection OPTIONAL,
+                             extraCerts   [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
+                                                                                OPTIONAL
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PkiMessages ::= SEQUENCE SIZE (1..MAX) OF PkiMessage
+            
+ @return a basic ASN.1 object representation. +
+ + @param status + + + @param status + @param statusString + + +
+             PkiStatusInfo ::= SEQUENCE {
+                 status        PKIStatus,                (INTEGER)
+                 statusString  PkiFreeText     OPTIONAL,
+                 failInfo      PkiFailureInfo  OPTIONAL  (BIT STRING)
+             }
+            
+             PKIStatus:
+               granted                (0), -- you got exactly what you asked for
+               grantedWithMods        (1), -- you got something like what you asked for
+               rejection              (2), -- you don't get it, more information elsewhere in the message
+               waiting                (3), -- the request body part has not yet been processed, expect to hear more later
+               revocationWarning      (4), -- this message contains a warning that a revocation is imminent
+               revocationNotification (5), -- notification that a revocation has occurred
+               keyUpdateWarning       (6)  -- update already done for the oldCertId specified in CertReqMsg
+            
+             PkiFailureInfo:
+               badAlg           (0), -- unrecognized or unsupported Algorithm Identifier
+               badMessageCheck  (1), -- integrity check failed (e.g., signature did not verify)
+               badRequest       (2), -- transaction not permitted or supported
+               badTime          (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
+               badCertId        (4), -- no certificate could be found matching the provided criteria
+               badDataFormat    (5), -- the data submitted has the wrong format
+               wrongAuthority   (6), -- the authority indicated in the request is different from the one creating the response token
+               incorrectData    (7), -- the requester's data is incorrect (for notary services)
+               missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
+               badPOP           (9)  -- the proof-of-possession failed
+            
+             
+
+ +
+            PollRepContent ::= SEQUENCE OF SEQUENCE {
+                    certReqId              INTEGER,
+                    checkAfter             INTEGER,  -- time in seconds
+                    reason                 PKIFreeText OPTIONAL
+                }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PollReqContent ::= SEQUENCE OF SEQUENCE {
+                                   certReqId              INTEGER
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PopoDecKeyChallContent ::= SEQUENCE OF Challenge
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PopoDecKeyRespContent ::= SEQUENCE OF INTEGER
+            
+ @return a basic ASN.1 object representation. +
+ +
+            ProtectedPart ::= SEQUENCE {
+                               header    PKIHeader,
+                               body      PKIBody
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            RevAnnContent ::= SEQUENCE {
+                  status              PKIStatus,
+                  certId              CertId,
+                  willBeRevokedAt     GeneralizedTime,
+                  badSinceDate        GeneralizedTime,
+                  crlDetails          Extensions  OPTIONAL
+                   -- extra CRL details (e.g., crl number, reason, location, etc.)
+            }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            RevDetails ::= SEQUENCE {
+                             certDetails         CertTemplate,
+                              -- allows requester to specify as much as they can about
+                              -- the cert. for which revocation is requested
+                              -- (e.g., for cases in which serialNumber is not available)
+                              crlEntryDetails     Extensions       OPTIONAL
+                              -- requested crlEntryExtensions
+                        }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            RevRepContent ::= SEQUENCE {
+                   status       SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
+                   -- in same order as was sent in RevReqContent
+                   revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
+                   -- IDs for which revocation was requested
+                   -- (same order as status)
+                   crls     [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
+                   -- the resulting CRLs (there may be more than one)
+              }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            RevReqContent ::= SEQUENCE OF RevDetails
+            
+ @return a basic ASN.1 object representation. +
+ + return an Attribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            Attribute ::= SEQUENCE {
+                attrType OBJECT IDENTIFIER,
+                attrValues SET OF AttributeValue
+            }
+            
+
+ +
+            Attributes ::=
+              SET SIZE(1..MAX) OF Attribute -- according to RFC 5652
+            
+ @return +
+ + Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be + empty if there are no attributes of the required type present. + + @param oid type of attribute required. + @return a vector of all the attributes found of type oid. + + + Return a new table with the passed in attribute added. + + @param attrType + @param attrValue + @return + + + Return the first attribute matching the given OBJECT IDENTIFIER + + + return an AuthenticatedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthenticatedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+             AuthenticatedData ::= SEQUENCE {
+                   version CMSVersion,
+                   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+                   recipientInfos RecipientInfos,
+                   macAlgorithm MessageAuthenticationCodeAlgorithm,
+                   digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
+                   encapContentInfo EncapsulatedContentInfo,
+                   authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
+                   mac MessageAuthenticationCode,
+                   unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
+            
+             AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
+            
+             UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
+            
+             MessageAuthenticationCode ::= OCTET STRING
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+             AuthenticatedData ::= SEQUENCE {
+                   version CMSVersion,
+                   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+                   recipientInfos RecipientInfos,
+                   macAlgorithm MessageAuthenticationCodeAlgorithm,
+                   digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
+                   encapContentInfo EncapsulatedContentInfo,
+                   authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
+                   mac MessageAuthenticationCode,
+                   unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
+            
+             AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
+            
+             UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
+            
+             MessageAuthenticationCode ::= OCTET STRING
+             
+
+ + return an AuthEnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthEnvelopedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            AuthEnvelopedData ::= SEQUENCE {
+              version CMSVersion,
+              originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+              recipientInfos RecipientInfos,
+              authEncryptedContentInfo EncryptedContentInfo,
+              authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
+              mac MessageAuthenticationCode,
+              unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. + +
+            AuthEnvelopedData ::= SEQUENCE {
+              version CMSVersion,
+              originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+              recipientInfos RecipientInfos,
+              authEncryptedContentInfo EncryptedContentInfo,
+              authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
+              mac MessageAuthenticationCode,
+              unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
+            
+
+ + The other Revocation Info arc + id-ri OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) + dod(6) internet(1) security(5) mechanisms(5) pkix(7) ri(16) } + + + RFC 3274 - CMS Compressed Data. +
+            CompressedData ::= Sequence {
+             version CMSVersion,
+             compressionAlgorithm CompressionAlgorithmIdentifier,
+             encapContentInfo EncapsulatedContentInfo
+            }
+            
+
+ + return a CompressedData object from a tagged object. + + @param ato the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a CompressedData object from the given object. + + @param _obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + RFC 3274 - CMS Compressed Data. +
+            CompressedData ::= SEQUENCE {
+             version CMSVersion,
+             compressionAlgorithm CompressionAlgorithmIdentifier,
+             encapContentInfo EncapsulatedContentInfo
+            }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ContentInfo ::= Sequence {
+                     contentType ContentType,
+                     content
+                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ContentInfo ::= SEQUENCE {
+                     contentType ContentType,
+                     content
+                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+            
+
+ + return an AuthEnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthEnvelopedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            MQVuserKeyingMaterial ::= SEQUENCE {
+              ephemeralPublicKey OriginatorPublicKey,
+              addedukm [0] EXPLICIT UserKeyingMaterial OPTIONAL  }
+            
+
+ + return an EncryptedContentInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            EncryptedContentInfo ::= Sequence {
+                contentType ContentType,
+                contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
+                encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+            }
+            
+
+ +
+            EncryptedContentInfo ::= SEQUENCE {
+                contentType ContentType,
+                contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
+                encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+            }
+            
+
+ +
+                  EncryptedData ::= SEQUENCE {
+                                version CMSVersion,
+                                encryptedContentInfo EncryptedContentInfo,
+                                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
+            
+ @return a basic ASN.1 object representation. +
+ + return an EnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an EnvelopedData object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            EnvelopedData ::= Sequence {
+                version CMSVersion,
+                originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+                recipientInfos RecipientInfos,
+                encryptedContentInfo EncryptedContentInfo,
+                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
+            }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            EnvelopedData ::= SEQUENCE {
+                version CMSVersion,
+                originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+                recipientInfos RecipientInfos,
+                encryptedContentInfo EncryptedContentInfo,
+                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
+            }
+            
+
+ + return a KekIdentifier object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KekIdentifier object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            KekIdentifier ::= Sequence {
+                keyIdentifier OCTET STRING,
+                date GeneralizedTime OPTIONAL,
+                other OtherKeyAttribute OPTIONAL
+            }
+            
+
+ + return a KekRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KekRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            KekRecipientInfo ::= Sequence {
+                version CMSVersion,  -- always set to 4
+                kekID KekIdentifier,
+                keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+                encryptedKey EncryptedKey
+            }
+            
+
+ + return an KeyAgreeRecipientIdentifier object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an KeyAgreeRecipientIdentifier object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            KeyAgreeRecipientIdentifier ::= CHOICE {
+                issuerAndSerialNumber IssuerAndSerialNumber,
+                rKeyId [0] IMPLICIT RecipientKeyIdentifier
+            }
+            
+
+ + return a KeyAgreeRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KeyAgreeRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + * Produce an object suitable for an Asn1OutputStream. + *
+                     * KeyAgreeRecipientInfo ::= Sequence {
+                     *     version CMSVersion,  -- always set to 3
+                     *     originator [0] EXPLICIT OriginatorIdentifierOrKey,
+                     *     ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
+                     *     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+                     *     recipientEncryptedKeys RecipientEncryptedKeys
+                     * }
+            		 *
+            		 * UserKeyingMaterial ::= OCTET STRING
+                     * 
+
+ + return a KeyTransRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            KeyTransRecipientInfo ::= Sequence {
+                version CMSVersion,  -- always set to 0 or 2
+                rid RecipientIdentifier,
+                keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+                encryptedKey EncryptedKey
+            }
+            
+
+ +
+            MetaData ::= SEQUENCE {
+              hashProtected        BOOLEAN,
+              fileName             UTF8String OPTIONAL,
+              mediaType            IA5String OPTIONAL,
+              otherMetaData        Attributes OPTIONAL
+            }
+            
+ @return +
+ + return an OriginatorIdentifierOrKey object from a tagged object. + + @param o the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorIdentifierOrKey object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+             OriginatorIdentifierOrKey ::= CHOICE {
+                 issuerAndSerialNumber IssuerAndSerialNumber,
+                 subjectKeyIdentifier [0] SubjectKeyIdentifier,
+                 originatorKey [1] OriginatorPublicKey
+             }
+            
+             SubjectKeyIdentifier ::= OCTET STRING
+             
+
+ + return an OriginatorInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            OriginatorInfo ::= Sequence {
+                certs [0] IMPLICIT CertificateSet OPTIONAL,
+                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL
+            }
+            
+
+ + return an OriginatorPublicKey object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorPublicKey object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            OriginatorPublicKey ::= Sequence {
+                algorithm AlgorithmIdentifier,
+                publicKey BIT STRING
+            }
+            
+
+ + return an OtherKeyAttribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            OtherKeyAttribute ::= Sequence {
+                keyAttrId OBJECT IDENTIFIER,
+                keyAttr ANY DEFINED BY keyAttrId OPTIONAL
+            }
+            
+
+ + return a OtherRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a OtherRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            OtherRecipientInfo ::= Sequence {
+               oriType OBJECT IDENTIFIER,
+               oriValue ANY DEFINED BY oriType }
+            
+
+ + return a OtherRevocationInfoFormat object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the object held by the + tagged object cannot be converted. + + + return a OtherRevocationInfoFormat object from the given object. + + @param obj the object we want converted. + @exception IllegalArgumentException if the object cannot be converted. + + + Produce an object suitable for an ASN1OutputStream. +
+            OtherRevocationInfoFormat ::= SEQUENCE {
+                 otherRevInfoFormat OBJECT IDENTIFIER,
+                 otherRevInfo ANY DEFINED BY otherRevInfoFormat }
+            
+
+ + return a PasswordRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a PasswordRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            PasswordRecipientInfo ::= Sequence {
+              version CMSVersion,   -- Always set to 0
+              keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier
+                                        OPTIONAL,
+             keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+             encryptedKey EncryptedKey }
+            
+
+ + return an RecipientEncryptedKey object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a RecipientEncryptedKey object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            RecipientEncryptedKey ::= SEQUENCE {
+                rid KeyAgreeRecipientIdentifier,
+                encryptedKey EncryptedKey
+            }
+            
+
+ + return a RecipientIdentifier object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+             RecipientIdentifier ::= CHOICE {
+                 issuerAndSerialNumber IssuerAndSerialNumber,
+                 subjectKeyIdentifier [0] SubjectKeyIdentifier
+             }
+            
+             SubjectKeyIdentifier ::= OCTET STRING
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            RecipientInfo ::= CHOICE {
+                ktri KeyTransRecipientInfo,
+                kari [1] KeyAgreeRecipientInfo,
+                kekri [2] KekRecipientInfo,
+                pwri [3] PasswordRecipientInfo,
+                ori [4] OtherRecipientInfo }
+            
+
+ + return a RecipientKeyIdentifier object from a tagged object. + + @param _ato the tagged object holding the object we want. + @param _explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a RecipientKeyIdentifier object from the given object. + + @param _obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+             RecipientKeyIdentifier ::= Sequence {
+                 subjectKeyIdentifier SubjectKeyIdentifier,
+                 date GeneralizedTime OPTIONAL,
+                 other OtherKeyAttribute OPTIONAL
+             }
+            
+             SubjectKeyIdentifier ::= OCTET STRING
+             
+
+ +
+               ScvpReqRes ::= SEQUENCE {
+               request  [0] EXPLICIT ContentInfo OPTIONAL,
+               response     ContentInfo }
+            
+ @return the ASN.1 primitive representation. +
+ + a signed data object. + + + Produce an object suitable for an Asn1OutputStream. +
+            SignedData ::= Sequence {
+                version CMSVersion,
+                digestAlgorithms DigestAlgorithmIdentifiers,
+                encapContentInfo EncapsulatedContentInfo,
+                certificates [0] IMPLICIT CertificateSet OPTIONAL,
+                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+                signerInfos SignerInfos
+              }
+            
+
+ +
+            SignedData ::= SEQUENCE {
+                version CMSVersion,
+                digestAlgorithms DigestAlgorithmIdentifiers,
+                encapContentInfo EncapsulatedContentInfo,
+                certificates [0] IMPLICIT CertificateSet OPTIONAL,
+                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+                signerInfos SignerInfos
+              }
+            
+
+ + return a SignerIdentifier object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+             SignerIdentifier ::= CHOICE {
+                 issuerAndSerialNumber IssuerAndSerialNumber,
+                 subjectKeyIdentifier [0] SubjectKeyIdentifier
+             }
+            
+             SubjectKeyIdentifier ::= OCTET STRING
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+              SignerInfo ::= Sequence {
+                  version Version,
+                  SignerIdentifier sid,
+                  digestAlgorithm DigestAlgorithmIdentifier,
+                  authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
+                  digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
+                  encryptedDigest EncryptedDigest,
+                  unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
+              }
+            
+              EncryptedDigest ::= OCTET STRING
+            
+              DigestAlgorithmIdentifier ::= AlgorithmIdentifier
+            
+              DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
+             
+
+ + creates a time object from a given date - if the date is between 1950 + and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + is used. + + + Produce an object suitable for an Asn1OutputStream. +
+            Time ::= CHOICE {
+                        utcTime        UTCTime,
+                        generalTime    GeneralizedTime }
+            
+
+ +
+            TimeStampAndCRL ::= SEQUENCE {
+                timeStamp   TimeStampToken,          -- according to RFC 3161
+                crl         CertificateList OPTIONAL -- according to RFC 5280
+             }
+            
+ @return +
+ +
+            TimeStampedData ::= SEQUENCE {
+              version              INTEGER { v1(1) },
+              dataUri              IA5String OPTIONAL,
+              metaData             MetaData OPTIONAL,
+              content              OCTET STRING OPTIONAL,
+              temporalEvidence     Evidence
+            }
+            
+ @return +
+ +
+            TimeStampTokenEvidence ::=
+               SEQUENCE SIZE(1..MAX) OF TimeStampAndCrl
+            
+ @return +
+ +
+            AttributeTypeAndValue ::= SEQUENCE {
+                      type         OBJECT IDENTIFIER,
+                      value        ANY DEFINED BY type }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertId ::= SEQUENCE {
+                            issuer           GeneralName,
+                            serialNumber     INTEGER }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertReqMessages ::= SEQUENCE SIZE (1..MAX) OF CertReqMsg
+            
+ @return a basic ASN.1 object representation. +
+ + Creates a new CertReqMsg. + @param certReq CertRequest + @param popo may be null + @param regInfo may be null + + +
+            CertReqMsg ::= SEQUENCE {
+                               certReq   CertRequest,
+                               pop       ProofOfPossession  OPTIONAL,
+                               -- content depends upon key type
+                               regInfo   SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue OPTIONAL }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            CertRequest ::= SEQUENCE {
+                                 certReqId     INTEGER,          -- ID for matching request and reply
+                                 certTemplate  CertTemplate,  -- Selected fields of cert to be issued
+                                 controls      Controls OPTIONAL }   -- Attributes affecting issuance
+            
+ @return a basic ASN.1 object representation. +
+ +
+             CertTemplate ::= SEQUENCE {
+                 version      [0] Version               OPTIONAL,
+                 serialNumber [1] INTEGER               OPTIONAL,
+                 signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
+                 issuer       [3] Name                  OPTIONAL,
+                 validity     [4] OptionalValidity      OPTIONAL,
+                 subject      [5] Name                  OPTIONAL,
+                 publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
+                 issuerUID    [7] UniqueIdentifier      OPTIONAL,
+                 subjectUID   [8] UniqueIdentifier      OPTIONAL,
+                 extensions   [9] Extensions            OPTIONAL }
+            
+ @return a basic ASN.1 object representation. +
+ + Sets the X.509 version. Note: for X509v3, use 2 here. + + + Sets the issuer unique ID (deprecated in X.509v3) + + + Sets the subject unique ID (deprecated in X.509v3) + + +
+             CertTemplate ::= SEQUENCE {
+                 version      [0] Version               OPTIONAL,
+                 serialNumber [1] INTEGER               OPTIONAL,
+                 signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
+                 issuer       [3] Name                  OPTIONAL,
+                 validity     [4] OptionalValidity      OPTIONAL,
+                 subject      [5] Name                  OPTIONAL,
+                 publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
+                 issuerUID    [7] UniqueIdentifier      OPTIONAL,
+                 subjectUID   [8] UniqueIdentifier      OPTIONAL,
+                 extensions   [9] Extensions            OPTIONAL }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            Controls  ::= SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue
+            
+ @return a basic ASN.1 object representation. +
+ +
+            EncKeyWithID ::= SEQUENCE {
+                 privateKey           PrivateKeyInfo,
+                 identifier CHOICE {
+                    string               UTF8String,
+                    generalName          GeneralName
+                } OPTIONAL
+            }
+            
+ @return +
+ +
+               EncryptedKey ::= CHOICE {
+                   encryptedValue        EncryptedValue, -- deprecated
+                   envelopedData     [0] EnvelopedData }
+                   -- The encrypted private key MUST be placed in the envelopedData
+                   -- encryptedContentInfo encryptedContent OCTET STRING.
+            
+
+ +
+            EncryptedValue ::= SEQUENCE {
+                                intendedAlg   [0] AlgorithmIdentifier  OPTIONAL,
+                                -- the intended algorithm for which the value will be used
+                                symmAlg       [1] AlgorithmIdentifier  OPTIONAL,
+                                -- the symmetric algorithm used to encrypt the value
+                                encSymmKey    [2] BIT STRING           OPTIONAL,
+                                -- the (encrypted) symmetric key used to encrypt the value
+                                keyAlg        [3] AlgorithmIdentifier  OPTIONAL,
+                                -- algorithm used to encrypt the symmetric key
+                                valueHint     [4] OCTET STRING         OPTIONAL,
+                                -- a brief description or identifier of the encValue content
+                                -- (may be meaningful only to the sending entity, and used only
+                                -- if EncryptedValue might be re-examined by the sending entity
+                                -- in the future)
+                                encValue       BIT STRING }
+                                -- the encrypted value itself
+            
+ @return a basic ASN.1 object representation. +
+ +
+            OptionalValidity ::= SEQUENCE {
+                                   notBefore  [0] Time OPTIONAL,
+                                   notAfter   [1] Time OPTIONAL } --at least one MUST be present
+            
+ @return a basic ASN.1 object representation. +
+ +
+             PkiArchiveOptions ::= CHOICE {
+                 encryptedPrivKey     [0] EncryptedKey,
+                 -- the actual value of the private key
+                 keyGenParameters     [1] KeyGenParameters,
+                 -- parameters which allow the private key to be re-generated
+                 archiveRemGenPrivKey [2] BOOLEAN }
+                 -- set to TRUE if sender wishes receiver to archive the private
+                 -- key of a key pair that the receiver generates in response to
+                 -- this request; set to FALSE if no archival is desired.
+            
+
+ +
+            PkiPublicationInfo ::= SEQUENCE {
+                             action     INTEGER {
+                                            dontPublish (0),
+                                            pleasePublish (1) },
+                             pubInfos  SEQUENCE SIZE (1..MAX) OF SinglePubInfo OPTIONAL }
+            -- pubInfos MUST NOT be present if action is "dontPublish"
+            -- (if action is "pleasePublish" and pubInfos is omitted,
+            -- "dontCare" is assumed)
+            
+ @return a basic ASN.1 object representation. +
+ + Password-based MAC value for use with POPOSigningKeyInput. + + + Creates a new PKMACValue. + @param params parameters for password-based MAC + @param value MAC of the DER-encoded SubjectPublicKeyInfo + + + Creates a new PKMACValue. + @param aid CMPObjectIdentifiers.passwordBasedMAC, with PBMParameter + @param value MAC of the DER-encoded SubjectPublicKeyInfo + + +
+            PKMACValue ::= SEQUENCE {
+                 algId  AlgorithmIdentifier,
+                 -- algorithm value shall be PasswordBasedMac 1.2.840.113533.7.66.13
+                 -- parameter value is PBMParameter
+                 value  BIT STRING }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            PopoPrivKey ::= CHOICE {
+                   thisMessage       [0] BIT STRING,         -- Deprecated
+                    -- possession is proven in this message (which contains the private
+                    -- key itself (encrypted for the CA))
+                   subsequentMessage [1] SubsequentMessage,
+                    -- possession will be proven in a subsequent message
+                   dhMAC             [2] BIT STRING,         -- Deprecated
+                   agreeMAC          [3] PKMACValue,
+                   encryptedKey      [4] EnvelopedData }
+            
+
+ + Creates a new Proof of Possession object for a signing key. + @param poposkIn the PopoSigningKeyInput structure, or null if the + CertTemplate includes both subject and publicKey values. + @param aid the AlgorithmIdentifier used to sign the proof of possession. + @param signature a signature over the DER-encoded value of poposkIn, + or the DER-encoded value of certReq if poposkIn is null. + + +
+            PopoSigningKey ::= SEQUENCE {
+                                 poposkInput           [0] PopoSigningKeyInput OPTIONAL,
+                                 algorithmIdentifier   AlgorithmIdentifier,
+                                 signature             BIT STRING }
+             -- The signature (using "algorithmIdentifier") is on the
+             -- DER-encoded value of poposkInput.  NOTE: If the CertReqMsg
+             -- certReq CertTemplate contains the subject and publicKey values,
+             -- then poposkInput MUST be omitted and the signature MUST be
+             -- computed on the DER-encoded value of CertReqMsg certReq.  If
+             -- the CertReqMsg certReq CertTemplate does not contain the public
+             -- key and subject values, then poposkInput MUST be present and
+             -- MUST be signed.  This strategy ensures that the public key is
+             -- not present in both the poposkInput and CertReqMsg certReq
+             -- CertTemplate fields.
+            
+ @return a basic ASN.1 object representation. +
+ + Creates a new PopoSigningKeyInput with sender name as authInfo. + + + Creates a new PopoSigningKeyInput using password-based MAC. + + +
+            PopoSigningKeyInput ::= SEQUENCE {
+                   authInfo             CHOICE {
+                                            sender              [0] GeneralName,
+                                            -- used only if an authenticated identity has been
+                                            -- established for the sender (e.g., a DN from a
+                                            -- previously-issued and currently-valid certificate
+                                            publicKeyMac        PKMacValue },
+                                            -- used if no authenticated GeneralName currently exists for
+                                            -- the sender; publicKeyMac contains a password-based MAC
+                                            -- on the DER-encoded value of publicKey
+                   publicKey           SubjectPublicKeyInfo }  -- from CertTemplate
+            
+ @return a basic ASN.1 object representation. +
+ + Returns the sender field, or null if authInfo is publicKeyMac + + + Returns the publicKeyMac field, or null if authInfo is sender + + + Creates a ProofOfPossession with type raVerified. + + + Creates a ProofOfPossession for a signing key. + + + Creates a ProofOfPossession for key encipherment or agreement. + @param type one of TYPE_KEY_ENCIPHERMENT or TYPE_KEY_AGREEMENT + + +
+            ProofOfPossession ::= CHOICE {
+                                      raVerified        [0] NULL,
+                                      -- used if the RA has already verified that the requester is in
+                                      -- possession of the private key
+                                      signature         [1] PopoSigningKey,
+                                      keyEncipherment   [2] PopoPrivKey,
+                                      keyAgreement      [3] PopoPrivKey }
+            
+ @return a basic ASN.1 object representation. +
+ +
+            SinglePubInfo ::= SEQUENCE {
+                   pubMethod    INTEGER {
+                      dontCare    (0),
+                      x500        (1),
+                      web         (2),
+                      ldap        (3) },
+                  pubLocation  GeneralName OPTIONAL }
+            
+ @return a basic ASN.1 object representation. +
+ + return an integer from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Integer from a tagged object. + + @param obj the tagged object holding the object we want + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + in some cases positive values Get crammed into a space, + that's not quite big enough... + + + table of the available named parameters for GOST 3410-2001. + + + return the ECDomainParameters object for the given OID, null if it + isn't present. + + @param oid an object identifier representing a named parameters, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + +
+             Gost28147-89-Parameters ::=
+                           SEQUENCE {
+                                   iv                   Gost28147-89-IV,
+                                   encryptionParamSet   OBJECT IDENTIFIER
+                            }
+            
+               Gost28147-89-IV ::= OCTET STRING (SIZE (8))
+             
+
+ + table of the available named parameters for GOST 3410-94. + + + return the GOST3410ParamSetParameters object for the given OID, null if it + isn't present. + + @param oid an object identifier representing a named parameters, if present. + + + returns an enumeration containing the name strings for parameters + contained in this structure. + + + Der BMPString object. + + + return a BMP string from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + return a BMP string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + return a bool from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a DerBoolean from the passed in bool. + + + return a Boolean from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return an integer from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Enumerated from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + Class representing the DER-type External + + + Creates a new instance of DerExternal + See X.690 for more informations about the meaning of these parameters + @param directReference The direct reference or null if not set. + @param indirectReference The indirect reference or null if not set. + @param dataValueDescriptor The data value descriptor or null if not set. + @param externalData The external data in its encoded form. + + + Creates a new instance of DerExternal. + See X.690 for more informations about the meaning of these parameters + @param directReference The direct reference or null if not set. + @param indirectReference The indirect reference or null if not set. + @param dataValueDescriptor The data value descriptor or null if not set. + @param encoding The encoding to be used for the external data + @param externalData The external data + + + The encoding of the content. Valid values are +
    +
  • 0 single-ASN1-type
  • +
  • 1 OCTET STRING
  • +
  • 2 BIT STRING
  • +
+
+ + Generalized time object. + + + return a generalized time from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return a Generalized Time object from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z + for local time, or Z+-HHMM on the end, for difference between local + time and UTC time. The fractional second amount f must consist of at + least one number with trailing zeroes removed. + + @param time the time string. + @exception ArgumentException if string is an illegal format. + + + base constructor from a local time object + + + return the time - always in the form of + YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). +

+ Normally in a certificate we would expect "Z" rather than "GMT", + however adding the "GMT" means we can just use: +

+                dateF = new SimpleDateFormat("yyyyMMddHHmmssz");
+            
+ To read in the time and Get a date which is compatible with our local + time zone.

+
+ + Return the time. + @return The time string as it appeared in the encoded object. + + + return a Graphic String from the passed in object + + @param obj a DerGraphicString or an object that can be converted into one. + @exception IllegalArgumentException if the object cannot be converted. + @return a DerGraphicString instance, or null. + + + return a Graphic String from a tagged object. + + @param obj the tagged object holding the object we want + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the tagged object cannot + be converted. + @return a DerGraphicString instance, or null. + + + basic constructor - with bytes. + @param string the byte encoding of the characters making up the string. + + + Der IA5String object - this is an ascii string. + + + return a IA5 string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an IA5 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - without validation. + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in an IA5String. + + + return true if the passed in String can be represented without + loss as an IA5String, false otherwise. + + @return true if in printable set, false otherwise. + + + Der NumericString object - this is an ascii string of characters {0,1,2,3,4,5,6,7,8,9, }. + + + return a Numeric string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Numeric string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - without validation.. + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in a NumericString. + + + Return true if the string can be represented as a NumericString ('0'..'9', ' ') + + @param str string to validate. + @return true if numeric, fale otherwise. + + + return an Oid from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an object Identifier from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + Return true if this oid is an extension of the passed in branch, stem. + @param stem the arc or branch that is a possible parent. + @return true if the branch is on the passed in stem, false otherwise. + + + Der PrintableString object. + + + return a printable string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Printable string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor - this does not validate the string + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in a PrintableString. + + + return true if the passed in String can be represented without + loss as a PrintableString, false otherwise. + + @return true if in printable set, false otherwise. + + + Der T61String (also the teletex string) - 8-bit characters + + + return a T61 string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an T61 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - with string. + + + Der UniversalString object. + + + return a Universal string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Universal string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + UTC time object. + + + return an UTC Time from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an UTC Time from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + The correct format for this is YYMMDDHHMMSSZ (it used to be that seconds were + never encoded. When you're creating one of these objects from scratch, that's + what you want to use, otherwise we'll try to deal with whatever Gets read from + the input stream... (this is why the input format is different from the GetTime() + method output). +

+ @param time the time string.

+
+ + base constructor from a DateTime object + + + return the time as a date based on whatever a 2 digit year will return. For + standardised processing use ToAdjustedDateTime(). + + @return the resulting date + @exception ParseException if the date string cannot be parsed. + + + return the time as an adjusted date + in the range of 1950 - 2049. + + @return a date in the range of 1950 to 2049. + @exception ParseException if the date string cannot be parsed. + + + return the time - always in the form of + YYMMDDhhmmssGMT(+hh:mm|-hh:mm). +

+ Normally in a certificate we would expect "Z" rather than "GMT", + however adding the "GMT" means we can just use: +

+                dateF = new SimpleDateFormat("yyMMddHHmmssz");
+            
+ To read in the time and Get a date which is compatible with our local + time zone.

+

+ Note: In some cases, due to the local date processing, this + may lead to unexpected results. If you want to stick the normal + convention of 1950 to 2049 use the GetAdjustedTime() method.

+
+ + + Return a time string as an adjusted date with a 4 digit year. + This goes in the range of 1950 - 2049. + + + + Der UTF8String object. + + + return an UTF8 string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an UTF8 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + return a Videotex String from the passed in object + + @param obj a DERVideotexString or an object that can be converted into one. + @exception IllegalArgumentException if the object cannot be converted. + @return a DERVideotexString instance, or null. + + + return a Videotex String from a tagged object. + + @param obj the tagged object holding the object we want + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the tagged object cannot + be converted. + @return a DERVideotexString instance, or null. + + + basic constructor - with bytes. + @param string the byte encoding of the characters making up the string. + + + Der VisibleString object. + + + return a Visible string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Visible string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + + RFC 3126: 4.3.1 Certificate Values Attribute Definition + + CertificateValues ::= SEQUENCE OF Certificate + + + + +
+            CommitmentTypeIndication ::= SEQUENCE {
+                 commitmentTypeId   CommitmentTypeIdentifier,
+                 commitmentTypeQualifier   SEQUENCE SIZE (1..MAX) OF
+                         CommitmentTypeQualifier OPTIONAL }
+            
+
+ + Commitment type qualifiers, used in the Commitment-Type-Indication attribute (RFC3126). + +
+               CommitmentTypeQualifier ::= SEQUENCE {
+                   commitmentTypeIdentifier  CommitmentTypeIdentifier,
+                   qualifier          ANY DEFINED BY commitmentTypeIdentifier OPTIONAL }
+             
+
+ + Creates a new CommitmentTypeQualifier instance. + + @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + + + Creates a new CommitmentTypeQualifier instance. + + @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + @param qualifier the qualifier, defined by the above field. + + + Creates a new CommitmentTypeQualifier instance. + + @param as CommitmentTypeQualifier structure + encoded as an Asn1Sequence. + + + Returns a DER-encodable representation of this instance. + + @return a Asn1Object value + + + + RFC 3126: 4.2.1 Complete Certificate Refs Attribute Definition + + CompleteCertificateRefs ::= SEQUENCE OF OtherCertID + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CompleteRevocationRefs ::= SEQUENCE OF CrlOcspRef + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlIdentifier ::= SEQUENCE + { + crlissuer Name, + crlIssuedTime UTCTime, + crlNumber INTEGER OPTIONAL + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CRLListID ::= SEQUENCE + { + crls SEQUENCE OF CrlValidatedID + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlOcspRef ::= SEQUENCE { + crlids [0] CRLListID OPTIONAL, + ocspids [1] OcspListID OPTIONAL, + otherRev [2] OtherRevRefs OPTIONAL + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlValidatedID ::= SEQUENCE { + crlHash OtherHash, + crlIdentifier CrlIdentifier OPTIONAL} + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspIdentifier ::= SEQUENCE { + ocspResponderID ResponderID, + -- As in OCSP response data + producedAt GeneralizedTime + -- As in OCSP response data + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspListID ::= SEQUENCE { + ocspResponses SEQUENCE OF OcspResponsesID + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspResponsesID ::= SEQUENCE { + ocspIdentifier OcspIdentifier, + ocspRepHash OtherHash OPTIONAL + } + + + + + + + OtherCertID ::= SEQUENCE { + otherCertHash OtherHash, + issuerSerial IssuerSerial OPTIONAL + } + + + + + + + OtherHash ::= CHOICE { + sha1Hash OtherHashValue, -- This contains a SHA-1 hash + otherHash OtherHashAlgAndValue + } + + OtherHashValue ::= OCTET STRING + + + + + + Summary description for OtherHashAlgAndValue. + + + + OtherHashAlgAndValue ::= SEQUENCE { + hashAlgorithm AlgorithmIdentifier, + hashValue OtherHashValue + } + + OtherHashValue ::= OCTET STRING + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OtherRevRefs ::= SEQUENCE + { + otherRevRefType OtherRevRefType, + otherRevRefs ANY DEFINED BY otherRevRefType + } + + OtherRevRefType ::= OBJECT IDENTIFIER + + + + + + RFC 3126: 4.3.2 Revocation Values Attribute Definition + + OtherRevVals ::= SEQUENCE + { + otherRevValType OtherRevValType, + otherRevVals ANY DEFINED BY otherRevValType + } + + OtherRevValType ::= OBJECT IDENTIFIER + + + + + + + OtherSigningCertificate ::= SEQUENCE { + certs SEQUENCE OF OtherCertID, + policies SEQUENCE OF PolicyInformation OPTIONAL + } + + + + + + RFC 5126: 6.3.4. revocation-values Attribute Definition + + RevocationValues ::= SEQUENCE { + crlVals [0] SEQUENCE OF CertificateList OPTIONAL, + ocspVals [1] SEQUENCE OF BasicOCSPResponse OPTIONAL, + otherRevVals [2] OtherRevVals OPTIONAL + } + + + + + + + SignaturePolicyId ::= SEQUENCE { + sigPolicyIdentifier SigPolicyId, + sigPolicyHash SigPolicyHash, + sigPolicyQualifiers SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo OPTIONAL + } + + SigPolicyId ::= OBJECT IDENTIFIER + + SigPolicyHash ::= OtherHashAlgAndValue + + + + + + + SignaturePolicyIdentifier ::= CHOICE { + SignaturePolicyId SignaturePolicyId, + SignaturePolicyImplied SignaturePolicyImplied + } + + SignaturePolicyImplied ::= NULL + + + + + +
+              SignerAttribute ::= SEQUENCE OF CHOICE {
+                  claimedAttributes   [0] ClaimedAttributes,
+                  certifiedAttributes [1] CertifiedAttributes }
+            
+              ClaimedAttributes ::= SEQUENCE OF Attribute
+              CertifiedAttributes ::= AttributeCertificate -- as defined in RFC 3281: see clause 4.1.
+             
+
+ + Signer-Location attribute (RFC3126). + +
+               SignerLocation ::= SEQUENCE {
+                   countryName        [0] DirectoryString OPTIONAL,
+                   localityName       [1] DirectoryString OPTIONAL,
+                   postalAddress      [2] PostalAddress OPTIONAL }
+            
+               PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
+             
+
+ +
+               SignerLocation ::= SEQUENCE {
+                   countryName        [0] DirectoryString OPTIONAL,
+                   localityName       [1] DirectoryString OPTIONAL,
+                   postalAddress      [2] PostalAddress OPTIONAL }
+            
+               PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
+            
+               DirectoryString ::= CHOICE {
+                     teletexString           TeletexString (SIZE (1..MAX)),
+                     printableString         PrintableString (SIZE (1..MAX)),
+                     universalString         UniversalString (SIZE (1..MAX)),
+                     utf8String              UTF8String (SIZE (1.. MAX)),
+                     bmpString               BMPString (SIZE (1..MAX)) }
+             
+
+ + + + SigPolicyQualifierInfo ::= SEQUENCE { + sigPolicyQualifierId SigPolicyQualifierId, + sigQualifier ANY DEFINED BY sigPolicyQualifierId + } + + SigPolicyQualifierId ::= OBJECT IDENTIFIER + + + + + constructor + + +
+            ContentHints ::= SEQUENCE {
+              contentDescription UTF8String (SIZE (1..MAX)) OPTIONAL,
+              contentType ContentType }
+            
+
+ + Create from OCTET STRING whose octets represent the identifier. + + + Create from byte array representing the identifier. + + + The definition of ContentIdentifier is +
+            ContentIdentifier ::=  OCTET STRING
+            
+ id-aa-contentIdentifier OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 7 } +
+ + constructor + + +
+            EssCertID ::= SEQUENCE {
+                certHash Hash,
+                issuerSerial IssuerSerial OPTIONAL }
+            
+
+ +
+             EssCertIDv2 ::=  SEQUENCE {
+                 hashAlgorithm     AlgorithmIdentifier
+                          DEFAULT {algorithm id-sha256},
+                 certHash          Hash,
+                 issuerSerial      IssuerSerial OPTIONAL
+             }
+            
+             Hash ::= OCTET STRING
+            
+             IssuerSerial ::= SEQUENCE {
+                 issuer         GeneralNames,
+                 serialNumber   CertificateSerialNumber
+             }
+             
+
+ + constructor + + +
+             OtherCertID ::= SEQUENCE {
+                 otherCertHash    OtherHash,
+                 issuerSerial     IssuerSerial OPTIONAL }
+            
+             OtherHash ::= CHOICE {
+                 sha1Hash     OCTET STRING,
+                 otherHash    OtherHashAlgAndValue }
+            
+             OtherHashAlgAndValue ::= SEQUENCE {
+                 hashAlgorithm    AlgorithmIdentifier,
+                 hashValue        OCTET STRING }
+            
+             
+
+ + constructors + + + The definition of OtherSigningCertificate is +
+            OtherSigningCertificate ::=  SEQUENCE {
+                 certs        SEQUENCE OF OtherCertID,
+                 policies     SEQUENCE OF PolicyInformation OPTIONAL
+            }
+            
+ id-aa-ets-otherSigCert OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 19 } +
+ + constructors + + + The definition of SigningCertificate is +
+            SigningCertificate ::=  SEQUENCE {
+                 certs        SEQUENCE OF EssCertID,
+                 policies     SEQUENCE OF PolicyInformation OPTIONAL
+            }
+            
+ id-aa-signingCertificate OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 12 } +
+ + The definition of SigningCertificateV2 is +
+            SigningCertificateV2 ::=  SEQUENCE {
+                 certs        SEQUENCE OF EssCertIDv2,
+                 policies     SEQUENCE OF PolicyInformation OPTIONAL
+            }
+            
+ id-aa-signingCertificateV2 OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 47 } +
+ + The CscaMasterList object. This object can be wrapped in a + CMSSignedData to be published in LDAP. + +
+             CscaMasterList ::= SEQUENCE {
+               version                CscaMasterListVersion,
+               certList               SET OF Certificate }
+               
+             CscaMasterListVersion :: INTEGER {v0(0)}
+             
+
+ + The DataGroupHash object. +
+             DataGroupHash  ::=  SEQUENCE {
+                  dataGroupNumber         DataGroupNumber,
+                  dataGroupHashValue     OCTET STRING }
+            
+             DataGroupNumber ::= INTEGER {
+                     dataGroup1    (1),
+                     dataGroup1    (2),
+                     dataGroup1    (3),
+                     dataGroup1    (4),
+                     dataGroup1    (5),
+                     dataGroup1    (6),
+                     dataGroup1    (7),
+                     dataGroup1    (8),
+                     dataGroup1    (9),
+                     dataGroup1    (10),
+                     dataGroup1    (11),
+                     dataGroup1    (12),
+                     dataGroup1    (13),
+                     dataGroup1    (14),
+                     dataGroup1    (15),
+                     dataGroup1    (16) }
+            
+             
+
+ + The LDSSecurityObject object (V1.8). +
+             LDSSecurityObject ::= SEQUENCE {
+               version                LDSSecurityObjectVersion,
+               hashAlgorithm          DigestAlgorithmIdentifier,
+               dataGroupHashValues    SEQUENCE SIZE (2..ub-DataGroups) OF DataHashGroup,
+               ldsVersionInfo         LDSVersionInfo OPTIONAL
+                 -- if present, version MUST be v1 }
+            
+             DigestAlgorithmIdentifier ::= AlgorithmIdentifier,
+            
+             LDSSecurityObjectVersion :: INTEGER {V0(0)}
+             
+
+ +
+            LDSVersionInfo ::= SEQUENCE {
+               ldsVersion PRINTABLE STRING
+               unicodeVersion PRINTABLE STRING
+             }
+            
+ @return +
+ + The id-isismtt-cp-accredited OID indicates that the certificate is a + qualified certificate according to Directive 1999/93/EC of the European + Parliament and of the Council of 13 December 1999 on a Community + Framework for Electronic Signatures, which additionally conforms the + special requirements of the SigG and has been issued by an accredited CA. + + + Certificate extensionDate of certificate generation + +
+            		DateOfCertGenSyntax ::= GeneralizedTime
+             
+
+ + Attribute to indicate that the certificate holder may sign in the name of + a third person. May also be used as extension in a certificate. + + + Attribute to indicate admissions to certain professions. May be used as + attribute in attribute certificate or as extension in a certificate + + + Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST + be used in new certificates in place of the extension/attribute + MonetaryLimit since January 1, 2004. For the sake of backward + compatibility with certificates already in use, SigG conforming + components MUST support MonetaryLimit (as well as QcEuLimitValue). + + + A declaration of majority. May be used as attribute in attribute + certificate or as extension in a certificate + + + + Serial number of the smart card containing the corresponding private key + +
+            		ICCSNSyntax ::= OCTET STRING (SIZE(8..20))
+             
+
+ + + Reference for a file of a smartcard that stores the public key of this + certificate and that is used as �security anchor�. + +
+            		PKReferenceSyntax ::= OCTET STRING (SIZE(20))
+             
+
+ + Some other restriction regarding the usage of this certificate. May be + used as attribute in attribute certificate or as extension in a + certificate. + +
+            		RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+             
+ + @see Org.BouncyCastle.Asn1.IsisMtt.X509.Restriction +
+ + + (Single)Request extension: Clients may include this extension in a + (single) Request to request the responder to send the certificate in the + response message along with the status information. Besides the LDAP + service, this extension provides another mechanism for the distribution + of certificates, which MAY optionally be provided by certificate + repositories. + +
+            		RetrieveIfAllowed ::= BOOLEAN
+             
+
+ + SingleOCSPResponse extension: The certificate requested by the client by + inserting the RetrieveIfAllowed extension in the request, will be + returned in this extension. + + @see Org.BouncyCastle.Asn1.IsisMtt.Ocsp.RequestedCertificate + + + Base ObjectIdentifier for naming authorities + + + SingleOCSPResponse extension: Date, when certificate has been published + in the directory and status information has become available. Currently, + accrediting authorities enforce that SigG-conforming OCSP servers include + this extension in the responses. + +
+            		CertInDirSince ::= GeneralizedTime
+             
+
+ + Hash of a certificate in OCSP. + + @see Org.BouncyCastle.Asn1.IsisMtt.Ocsp.CertHash + + +
+            		NameAtBirth ::= DirectoryString(SIZE(1..64)
+             
+ + Used in + {@link Org.BouncyCastle.Asn1.X509.SubjectDirectoryAttributes SubjectDirectoryAttributes} +
+ + Some other information of non-restrictive nature regarding the usage of + this certificate. May be used as attribute in atribute certificate or as + extension in a certificate. + +
+                          AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+            
+ + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdditionalInformationSyntax +
+ + Indicates that an attribute certificate exists, which limits the + usability of this public key certificate. Whenever verifying a signature + with the help of this certificate, the content of the corresponding + attribute certificate should be concerned. This extension MUST be + included in a PKC, if a corresponding attribute certificate (having the + PKC as base certificate) contains some attribute that restricts the + usability of the PKC too. Attribute certificates with restricting content + MUST always be included in the signed document. + +
+            		LiabilityLimitationFlagSyntax ::= BOOLEAN
+             
+
+ + ISIS-MTT PROFILE: The responder may include this extension in a response to + send the hash of the requested certificate to the responder. This hash is + cryptographically bound to the certificate and serves as evidence that the + certificate is known to the responder (i.e. it has been issued and is present + in the directory). Hence, this extension is a means to provide a positive + statement of availability as described in T8.[8]. As explained in T13.[1], + clients may rely on this information to be able to validate signatures after + the expiry of the corresponding certificate. Hence, clients MUST support this + extension. If a positive statement of availability is to be delivered, this + extension syntax and OID MUST be used. +

+

+

+                CertHash ::= SEQUENCE {
+                  hashAlgorithm AlgorithmIdentifier,
+                  certificateHash OCTET STRING
+                }
+            
+
+ + Constructor from Asn1Sequence. +

+ The sequence is of type CertHash: +

+

+                 CertHash ::= SEQUENCE {
+                   hashAlgorithm AlgorithmIdentifier,
+                   certificateHash OCTET STRING
+                 }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. + + @param hashAlgorithm The hash algorithm identifier. + @param certificateHash The hash of the whole DER encoding of the certificate. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                 CertHash ::= SEQUENCE {
+                   hashAlgorithm AlgorithmIdentifier,
+                   certificateHash OCTET STRING
+                 }
+             
+ + @return an Asn1Object +
+ + ISIS-MTT-Optional: The certificate requested by the client by inserting the + RetrieveIfAllowed extension in the request, will be returned in this + extension. +

+ ISIS-MTT-SigG: The signature act allows publishing certificates only then, + when the certificate owner gives his isExplicit permission. Accordingly, there + may be �nondownloadable� certificates, about which the responder must provide + status information, but MUST NOT include them in the response. Clients may + get therefore the following three kind of answers on a single request + including the RetrieveIfAllowed extension: +

    +
  • a) the responder supports the extension and is allowed to publish the + certificate: RequestedCertificate returned including the requested + certificate
  • +
  • b) the responder supports the extension but is NOT allowed to publish + the certificate: RequestedCertificate returned including an empty OCTET + STRING
  • +
  • c) the responder does not support the extension: RequestedCertificate is + not included in the response
  • +
+ Clients requesting RetrieveIfAllowed MUST be able to handle these cases. If + any of the OCTET STRING options is used, it MUST contain the DER encoding of + the requested certificate. +

+

+                       RequestedCertificate ::= CHOICE {
+                         Certificate Certificate,
+                         publicKeyCertificate [0] EXPLICIT OCTET STRING,
+                         attributeCertificate [1] EXPLICIT OCTET STRING
+                       }
+            
+
+ + Constructor from a given details. +

+ Only one parameter can be given. All other must be null. + + @param certificate Given as Certificate + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                        RequestedCertificate ::= CHOICE {
+                          Certificate Certificate,
+                          publicKeyCertificate [0] EXPLICIT OCTET STRING,
+                          attributeCertificate [1] EXPLICIT OCTET STRING
+                        }
+             
+ + @return an Asn1Object +
+ + Some other information of non-restrictive nature regarding the usage of this + certificate. + +
+               AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+            
+
+ + Constructor from a given details. + + @param information The describtion of the information. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+               AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+             
+ + @return an Asn1Object +
+ + An Admissions structure. +

+

+                        Admissions ::= SEQUENCE
+                        {
+                          admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+                          namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+                          professionInfos SEQUENCE OF ProfessionInfo
+                        }
+             

+

+ + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority +
+ + Constructor from Asn1Sequence. +

+ The sequence is of type ProcurationSyntax: +

+

+                        Admissions ::= SEQUENCE
+                        {
+                          admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+                          namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+                          professionInfos SEQUENCE OF ProfessionInfo
+                        }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. +

+ Parameter professionInfos is mandatory. + + @param admissionAuthority The admission authority. + @param namingAuthority The naming authority. + @param professionInfos The profession infos. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                   Admissions ::= SEQUENCE
+                   {
+                     admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+                     namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+                     professionInfos SEQUENCE OF ProfessionInfo
+                   }
+             

+

+ + @return an Asn1Object +
+ + Attribute to indicate admissions to certain professions. +

+

+                 AdmissionSyntax ::= SEQUENCE
+                 {
+                   admissionAuthority GeneralName OPTIONAL,
+                   contentsOfAdmissions SEQUENCE OF Admissions
+                 }
+             

+ Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

+ NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

+ ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

+

+

+ ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax + supports the following concepts and requirements: +

    +
  • External institutions (e.g. professional associations, chambers, unions, + administrative bodies, companies, etc.), which are responsible for granting + and verifying professional admissions, are indicated by means of the data + field admissionAuthority. An admission authority is indicated by a + GeneralName object. Here an X.501 directory name (distinguished name) can be + indicated in the field directoryName, a URL address can be indicated in the + field uniformResourceIdentifier, and an object identifier can be indicated in + the field registeredId.
  • +
  • The names of authorities which are responsible for the administration of + title registers are indicated in the data field namingAuthority. The name of + the authority can be identified by an object identifier in the field + namingAuthorityId, by means of a text string in the field + namingAuthorityText, by means of a URL address in the field + namingAuthorityUrl, or by a combination of them. For example, the text string + can contain the name of the authority, the country and the name of the title + register. The URL-option refers to a web page which contains lists with + officially registered professions (text and possibly OID) as well as + further information on these professions. Object identifiers for the + component namingAuthorityId are grouped under the OID-branch + id-isis-at-namingAuthorities and must be applied for.
  • +
  • See http://www.teletrust.de/anwend.asp?Id=30200&Sprache=E_&HomePG=0 + for an application form and http://www.teletrust.de/links.asp?id=30220,11 + for an overview of registered naming authorities.
  • +
  • By means of the data type ProfessionInfo certain professions, + specializations, disciplines, fields of activity, etc. are identified. A + profession is represented by one or more text strings, resp. profession OIDs + in the fields professionItems and professionOIDs and by a registration number + in the field registrationNumber. An indication in text form must always be + present, whereas the other indications are optional. The component + addProfessionInfo may contain additional applicationspecific information in + DER-encoded form.
  • +
+

+ By means of different namingAuthority-OIDs or profession OIDs hierarchies of + professions, specializations, disciplines, fields of activity, etc. can be + expressed. The issuing admission authority should always be indicated (field + admissionAuthority), whenever a registration number is presented. Still, + information on admissions can be given without indicating an admission or a + naming authority by the exclusive use of the component professionItems. In + this case the certification authority is responsible for the verification of + the admission information. +

+

+

+ This attribute is single-valued. Still, several admissions can be captured in + the sequence structure of the component contentsOfAdmissions of + AdmissionSyntax or in the component professionInfos of Admissions. The + component admissionAuthority of AdmissionSyntax serves as default value for + the component admissionAuthority of Admissions. Within the latter component + the default value can be overwritten, in case that another authority is + responsible. The component namingAuthority of Admissions serves as a default + value for the component namingAuthority of ProfessionInfo. Within the latter + component the default value can be overwritten, in case that another naming + authority needs to be recorded. +

+ The length of the string objects is limited to 128 characters. It is + recommended to indicate a namingAuthorityURL in all issued attribute + certificates. If a namingAuthorityURL is indicated, the field professionItems + of ProfessionInfo should contain only registered titles. If the field + professionOIDs exists, it has to contain the OIDs of the professions listed + in professionItems in the same order. In general, the field professionInfos + should contain only one entry, unless the admissions that are to be listed + are logically connected (e.g. they have been issued under the same admission + number). + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions + @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority + + + Constructor from Asn1Sequence. +

+ The sequence is of type ProcurationSyntax: +

+

+                 AdmissionSyntax ::= SEQUENCE
+                 {
+                   admissionAuthority GeneralName OPTIONAL,
+                   contentsOfAdmissions SEQUENCE OF Admissions
+                 }
+             

+ Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

+ NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

+ ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

+ + @param seq The ASN.1 sequence. +
+ + Constructor from given details. + + @param admissionAuthority The admission authority. + @param contentsOfAdmissions The admissions. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                 AdmissionSyntax ::= SEQUENCE
+                 {
+                   admissionAuthority GeneralName OPTIONAL,
+                   contentsOfAdmissions SEQUENCE OF Admissions
+                 }
+             

+ Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

+ NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

+ ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

+ + @return an Asn1Object +
+ + @return Returns the contentsOfAdmissions. + + + @return Returns the admissionAuthority if present, null otherwise. + + + A declaration of majority. +

+

+                      DeclarationOfMajoritySyntax ::= CHOICE
+                      {
+                        notYoungerThan [0] IMPLICIT INTEGER,
+                        fullAgeAtCountry [1] IMPLICIT SEQUENCE
+                        {
+                          fullAge BOOLEAN DEFAULT TRUE,
+                          country PrintableString (SIZE(2))
+                        }
+                        dateOfBirth [2] IMPLICIT GeneralizedTime
+                      }
+            
+

+ fullAgeAtCountry indicates the majority of the owner with respect to the laws + of a specific country. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                       DeclarationOfMajoritySyntax ::= CHOICE
+                       {
+                         notYoungerThan [0] IMPLICIT INTEGER,
+                         fullAgeAtCountry [1] IMPLICIT SEQUENCE
+                         {
+                           fullAge BOOLEAN DEFAULT TRUE,
+                           country PrintableString (SIZE(2))
+                         }
+                         dateOfBirth [2] IMPLICIT GeneralizedTime
+                       }
+             
+ + @return an Asn1Object +
+ + @return notYoungerThan if that's what we are, -1 otherwise + + + Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST be + used in new certificates in place of the extension/attribute MonetaryLimit + since January 1, 2004. For the sake of backward compatibility with + certificates already in use, components SHOULD support MonetaryLimit (as well + as QcEuLimitValue). +

+ Indicates a monetary limit within which the certificate holder is authorized + to act. (This value DOES NOT express a limit on the liability of the + certification authority). +

+

+               MonetaryLimitSyntax ::= SEQUENCE
+               {
+                 currency PrintableString (SIZE(3)),
+                 amount INTEGER,
+                 exponent INTEGER
+               }
+            
+

+ currency must be the ISO code. +

+ value = amount�10*exponent + + + Constructor from a given details. +

+

+ value = amount�10^exponent + + @param currency The currency. Must be the ISO code. + @param amount The amount + @param exponent The exponent + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                MonetaryLimitSyntax ::= SEQUENCE
+                {
+                  currency PrintableString (SIZE(3)),
+                  amount INTEGER,
+                  exponent INTEGER
+                }
+             
+ + @return an Asn1Object +
+ + Names of authorities which are responsible for the administration of title + registers. + +
+                        NamingAuthority ::= SEQUENCE 
+                        {
+                          namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+                          namingAuthorityUrl IA5String OPTIONAL,
+                          namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+                        }
+            
+ @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + +
+ + Profession OIDs should always be defined under the OID branch of the + responsible naming authority. At the time of this writing, the work group + �Recht, Wirtschaft, Steuern� (�Law, Economy, Taxes�) is registered as the + first naming authority under the OID id-isismtt-at-namingAuthorities. + + + Constructor from Asn1Sequence. +

+

+

+                         NamingAuthority ::= SEQUENCE
+                         {
+                           namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+                           namingAuthorityUrl IA5String OPTIONAL,
+                           namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+                         }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from given details. +

+ All parameters can be combined. + + @param namingAuthorityID ObjectIdentifier for naming authority. + @param namingAuthorityUrl URL for naming authority. + @param namingAuthorityText Textual representation of naming authority. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                         NamingAuthority ::= SEQUENCE
+                         {
+                           namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+                           namingAuthorityUrl IA5String OPTIONAL,
+                           namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+                         }
+             
+ + @return an Asn1Object +
+ + @return Returns the namingAuthorityID. + + + @return Returns the namingAuthorityText. + + + @return Returns the namingAuthorityUrl. + + + Attribute to indicate that the certificate holder may sign in the name of a + third person. +

+ ISIS-MTT PROFILE: The corresponding ProcurationSyntax contains either the + name of the person who is represented (subcomponent thirdPerson) or a + reference to his/her base certificate (in the component signingFor, + subcomponent certRef), furthermore the optional components country and + typeSubstitution to indicate the country whose laws apply, and respectively + the type of procuration (e.g. manager, procuration, custody). +

+

+ ISIS-MTT PROFILE: The GeneralName MUST be of type directoryName and MAY only + contain: - RFC3039 attributes, except pseudonym (countryName, commonName, + surname, givenName, serialNumber, organizationName, organizationalUnitName, + stateOrProvincename, localityName, postalAddress) and - SubjectDirectoryName + attributes (title, dateOfBirth, placeOfBirth, gender, countryOfCitizenship, + countryOfResidence and NameAtBirth). +

+
+                          ProcurationSyntax ::= SEQUENCE {
+                            country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+                            typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+                            signingFor [3] EXPLICIT SigningFor 
+                          }
+                          
+                          SigningFor ::= CHOICE 
+                          { 
+                            thirdPerson GeneralName,
+                            certRef IssuerSerial 
+                          }
+            
+ +
+ + Constructor from Asn1Sequence. +

+ The sequence is of type ProcurationSyntax: +

+

+                           ProcurationSyntax ::= SEQUENCE {
+                             country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+                             typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+                             signingFor [3] EXPLICIT SigningFor
+                           }
+             

+ SigningFor ::= CHOICE + { + thirdPerson GeneralName, + certRef IssuerSerial + } +

+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. +

+

+ Either generalName or certRef MUST be + null. + + @param country The country code whose laws apply. + @param typeOfSubstitution The type of procuration. + @param certRef Reference to certificate of the person who is represented. + + + Constructor from a given details. +

+

+ Either generalName or certRef MUST be + null. + + @param country The country code whose laws apply. + @param typeOfSubstitution The type of procuration. + @param thirdPerson The GeneralName of the person who is represented. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                           ProcurationSyntax ::= SEQUENCE {
+                             country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+                             typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+                             signingFor [3] EXPLICIT SigningFor
+                           }
+             

+ SigningFor ::= CHOICE + { + thirdPerson GeneralName, + certRef IssuerSerial + } +

+ + @return an Asn1Object +
+ + Professions, specializations, disciplines, fields of activity, etc. + +
+                          ProfessionInfo ::= SEQUENCE 
+                          {
+                            namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+                            professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+                            professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+                            registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+                            addProfessionInfo OCTET STRING OPTIONAL 
+                          }
+            
+ + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax +
+ + Rechtsanw�ltin + + + Rechtsanwalt + + + Rechtsbeistand + + + Steuerberaterin + + + Steuerberater + + + Steuerbevollm�chtigte + + + Steuerbevollm�chtigter + + + Notarin + + + Notar + + + Notarvertreterin + + + Notarvertreter + + + Notariatsverwalterin + + + Notariatsverwalter + + + Wirtschaftspr�ferin + + + Wirtschaftspr�fer + + + Vereidigte Buchpr�ferin + + + Vereidigter Buchpr�fer + + + Patentanw�ltin + + + Patentanwalt + + + Constructor from Asn1Sequence. +

+

+

+                           ProfessionInfo ::= SEQUENCE
+                           {
+                             namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+                             professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+                             professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+                             registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+                             addProfessionInfo OCTET STRING OPTIONAL
+                           }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from given details. +

+ professionItems is mandatory, all other parameters are + optional. + + @param namingAuthority The naming authority. + @param professionItems Directory strings of the profession. + @param professionOids DERObjectIdentfier objects for the + profession. + @param registrationNumber Registration number. + @param addProfessionInfo Additional infos in encoded form. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                           ProfessionInfo ::= SEQUENCE
+                           {
+                             namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+                             professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+                             professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+                             registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+                             addProfessionInfo OCTET STRING OPTIONAL
+                           }
+             
+ + @return an Asn1Object +
+ + @return Returns the professionItems. + + + @return Returns the professionOids. + + + @return Returns the addProfessionInfo. + + + @return Returns the namingAuthority. + + + @return Returns the registrationNumber. + + + Some other restriction regarding the usage of this certificate. +

+

+             RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+            
+
+ + Constructor from DirectoryString. +

+ The DirectoryString is of type RestrictionSyntax: +

+

+                  RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+             
+ + @param restriction A IAsn1String. +
+ + Constructor from a given details. + + @param restriction The description of the restriction. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                  RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+             

+

+ + @return an Asn1Object +
+ + Produce an object suitable for an Asn1OutputStream. +
+            cast5CBCParameters ::= Sequence {
+                                      iv         OCTET STRING DEFAULT 0,
+                                             -- Initialization vector
+                                      keyLength  Integer
+                                             -- Key length, in bits
+                                 }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            IDEA-CBCPar ::= Sequence {
+                                 iv    OCTET STRING OPTIONAL -- exactly 8 octets
+                             }
+            
+
+ + The NetscapeCertType object. +
+               NetscapeCertType ::= BIT STRING {
+                    SSLClient               (0),
+                    SSLServer               (1),
+                    S/MIME                  (2),
+                    Object Signing          (3),
+                    Reserved                (4),
+                    SSL CA                  (5),
+                    S/MIME CA               (6),
+                    Object Signing CA       (7) }
+            
+
+ + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (X509NetscapeCertType.sslCA | X509NetscapeCertType.smimeCA) + + + This is designed to parse + the PublicKeyAndChallenge created by the KEYGEN tag included by + Mozilla based browsers. +
+              PublicKeyAndChallenge ::= SEQUENCE {
+                spki SubjectPublicKeyInfo,
+                challenge IA5STRING
+              }
+            
+              
+
+ + Utility class for fetching curves using their NIST names as published in FIPS-PUB 186-3 + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + From RFC 3657 + + + Produce an object suitable for an Asn1OutputStream. +
+            BasicOcspResponse       ::= Sequence {
+                 tbsResponseData      ResponseData,
+                 signatureAlgorithm   AlgorithmIdentifier,
+                 signature            BIT STRING,
+                 certs                [0] EXPLICIT Sequence OF Certificate OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            CertID          ::=     Sequence {
+                hashAlgorithm       AlgorithmIdentifier,
+                issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
+                issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
+                serialNumber        CertificateSerialNumber }
+            
+
+ + create a CertStatus object with a tag of zero. + + + Produce an object suitable for an Asn1OutputStream. +
+             CertStatus ::= CHOICE {
+                             good        [0]     IMPLICIT Null,
+                             revoked     [1]     IMPLICIT RevokedInfo,
+                             unknown     [2]     IMPLICIT UnknownInfo }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            CrlID ::= Sequence {
+                crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
+                crlNum               [1]     EXPLICIT Integer OPTIONAL,
+                crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            OcspRequest     ::=     Sequence {
+                tbsRequest                  TBSRequest,
+                optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            OcspResponse ::= Sequence {
+                responseStatus         OcspResponseStatus,
+                responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
+            
+
+ + The OcspResponseStatus enumeration. +
+            OcspResponseStatus ::= Enumerated {
+                successful            (0),  --Response has valid confirmations
+                malformedRequest      (1),  --Illegal confirmation request
+                internalError         (2),  --Internal error in issuer
+                tryLater              (3),  --Try again later
+                                            --(4) is not used
+                sigRequired           (5),  --Must sign the request
+                unauthorized          (6)   --Request unauthorized
+            }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            Request         ::=     Sequence {
+                reqCert                     CertID,
+                singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ResponderID ::= CHOICE {
+                 byName          [1] Name,
+                 byKey           [2] KeyHash }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ResponseBytes ::=       Sequence {
+                responseType   OBJECT IDENTIFIER,
+                response       OCTET STRING }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ResponseData ::= Sequence {
+                version              [0] EXPLICIT Version DEFAULT v1,
+                responderID              ResponderID,
+                producedAt               GeneralizedTime,
+                responses                Sequence OF SingleResponse,
+                responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            RevokedInfo ::= Sequence {
+                 revocationTime              GeneralizedTime,
+                 revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ServiceLocator ::= Sequence {
+                issuer    Name,
+                locator   AuthorityInfoAccessSyntax OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            Signature       ::=     Sequence {
+                signatureAlgorithm      AlgorithmIdentifier,
+                signature               BIT STRING,
+                certs               [0] EXPLICIT Sequence OF Certificate OPTIONAL}
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+             SingleResponse ::= Sequence {
+                     certID                       CertID,
+                     certStatus                   CertStatus,
+                     thisUpdate                   GeneralizedTime,
+                     nextUpdate         [0]       EXPLICIT GeneralizedTime OPTIONAL,
+                     singleExtensions   [1]       EXPLICIT Extensions OPTIONAL }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            TBSRequest      ::=     Sequence {
+                version             [0]     EXPLICIT Version DEFAULT v1,
+                requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
+                requestList                 Sequence OF Request,
+                requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
+            
+
+ + class for breaking up an Oid into it's component tokens, ala + java.util.StringTokenizer. We need this class as some of the + lightweight Java environment don't support classes like + StringTokenizer. + + + return an Attribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            Attr ::= Sequence {
+                attrType OBJECT IDENTIFIER,
+                attrValues Set OF AttributeValue
+            }
+            
+
+ + Pkcs10 Certfication request object. +
+            CertificationRequest ::= Sequence {
+              certificationRequestInfo  CertificationRequestInfo,
+              signatureAlgorithm        AlgorithmIdentifier{{ SignatureAlgorithms }},
+              signature                 BIT STRING
+            }
+            
+
+ + Pkcs10 CertificationRequestInfo object. +
+              CertificationRequestInfo ::= Sequence {
+               version             Integer { v1(0) } (v1,...),
+               subject             Name,
+               subjectPKInfo   SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
+               attributes          [0] Attributes{{ CRIAttributes }}
+              }
+            
+              Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }}
+            
+              Attr { ATTRIBUTE:IOSet } ::= Sequence {
+                type    ATTRIBUTE.&id({IOSet}),
+                values  Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type})
+              }
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+            ContentInfo ::= Sequence {
+                     contentType ContentType,
+                     content
+                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+            
+
+ + The EncryptedData object. +
+                  EncryptedData ::= Sequence {
+                       version Version,
+                       encryptedContentInfo EncryptedContentInfo
+                  }
+            
+            
+                  EncryptedContentInfo ::= Sequence {
+                      contentType ContentType,
+                      contentEncryptionAlgorithm  ContentEncryptionAlgorithmIdentifier,
+                      encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+                }
+            
+                EncryptedContent ::= OCTET STRING
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+             EncryptedPrivateKeyInfo ::= Sequence {
+                  encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
+                  encryptedData EncryptedData
+             }
+            
+             EncryptedData ::= OCTET STRING
+            
+             KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
+                      ... -- For local profiles
+             }
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+                 AlgorithmIdentifier ::= Sequence {
+                                       algorithm OBJECT IDENTIFIER,
+                                       parameters ANY DEFINED BY algorithm OPTIONAL }
+            
+
+ + + Return the OID in the Algorithm entry of this identifier. + + + + + Return the parameters structure in the Parameters entry of this identifier. + + + +
+            MacData ::= SEQUENCE {
+                mac      DigestInfo,
+                macSalt  OCTET STRING,
+                iterations INTEGER DEFAULT 1
+                -- Note: The default is for historic reasons and its use is deprecated. A
+                -- higher value, like 1024 is recommended.
+            
+ @return the basic DERObject construction. +
+ + the infamous Pfx from Pkcs12 + + + write out an RSA private key with its associated information + as described in Pkcs8. +
+                  PrivateKeyInfo ::= Sequence {
+                                          version Version,
+                                          privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
+                                          privateKey PrivateKey,
+                                          attributes [0] IMPLICIT Attributes OPTIONAL
+                                      }
+                  Version ::= Integer {v1(0)} (v1,...)
+            
+                  PrivateKey ::= OCTET STRING
+            
+                  Attributes ::= Set OF Attr
+             
+
+ + The default version + + +
+              RSAES-OAEP-params ::= SEQUENCE {
+                 hashAlgorithm      [0] OAEP-PSSDigestAlgorithms     DEFAULT sha1,
+                 maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
+                 pSourceAlgorithm   [2] PKCS1PSourceAlgorithms  DEFAULT pSpecifiedEmpty
+               }
+            
+               OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
+                 { OID id-sha1 PARAMETERS NULL   }|
+                 { OID id-sha256 PARAMETERS NULL }|
+                 { OID id-sha384 PARAMETERS NULL }|
+                 { OID id-sha512 PARAMETERS NULL },
+                 ...  -- Allows for future expansion --
+               }
+               PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
+                 { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
+                ...  -- Allows for future expansion --
+               }
+               PKCS1PSourceAlgorithms    ALGORITHM-IDENTIFIER ::= {
+                 { OID id-pSpecified PARAMETERS OCTET STRING },
+                 ...  -- Allows for future expansion --
+              }
+             
+ @return the asn1 primitive representing the parameters. +
+ + This outputs the key in Pkcs1v2 format. +
+                  RsaPrivateKey ::= Sequence {
+                                      version Version,
+                                      modulus Integer, -- n
+                                      publicExponent Integer, -- e
+                                      privateExponent Integer, -- d
+                                      prime1 Integer, -- p
+                                      prime2 Integer, -- q
+                                      exponent1 Integer, -- d mod (p-1)
+                                      exponent2 Integer, -- d mod (q-1)
+                                      coefficient Integer -- (inverse of q) mod p
+                                  }
+            
+                  Version ::= Integer
+             
+

This routine is written to output Pkcs1 version 0, private keys.

+
+ + The default version + + +
+             RSASSA-PSS-params ::= SEQUENCE {
+               hashAlgorithm      [0] OAEP-PSSDigestAlgorithms  DEFAULT sha1,
+                maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
+                saltLength         [2] INTEGER  DEFAULT 20,
+                trailerField       [3] TrailerField  DEFAULT trailerFieldBC
+              }
+            
+             OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
+                { OID id-sha1 PARAMETERS NULL   }|
+                { OID id-sha256 PARAMETERS NULL }|
+                { OID id-sha384 PARAMETERS NULL }|
+                { OID id-sha512 PARAMETERS NULL },
+                ...  -- Allows for future expansion --
+             }
+            
+             PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
+               { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
+                ...  -- Allows for future expansion --
+             }
+            
+             TrailerField ::= INTEGER { trailerFieldBC(1) }
+             
+ @return the asn1 primitive representing the parameters. +
+ + a Pkcs#7 signed data object. + + + Produce an object suitable for an Asn1OutputStream. +
+             SignedData ::= Sequence {
+                 version Version,
+                 digestAlgorithms DigestAlgorithmIdentifiers,
+                 contentInfo ContentInfo,
+                 certificates
+                     [0] IMPLICIT ExtendedCertificatesAndCertificates
+                              OPTIONAL,
+                 crls
+                     [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+                 signerInfos SignerInfos }
+            
+
+ + a Pkcs#7 signer info object. + + + Produce an object suitable for an Asn1OutputStream. +
+              SignerInfo ::= Sequence {
+                  version Version,
+                  issuerAndSerialNumber IssuerAndSerialNumber,
+                  digestAlgorithm DigestAlgorithmIdentifier,
+                  authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
+                  digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
+                  encryptedDigest EncryptedDigest,
+                  unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
+              }
+            
+              EncryptedDigest ::= OCTET STRING
+            
+              DigestAlgorithmIdentifier ::= AlgorithmIdentifier
+            
+              DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
+             
+
+ + the elliptic curve private key object from SEC 1 + + + ECPrivateKey ::= SEQUENCE { + version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), + privateKey OCTET STRING, + parameters [0] Parameters OPTIONAL, + publicKey [1] BIT STRING OPTIONAL } + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + EllipticCurve OBJECT IDENTIFIER ::= { + iso(1) identified-organization(3) certicom(132) curve(0) + } + + + Handler class for dealing with S/MIME Capabilities + + + general preferences + + + encryption algorithms preferences + + + return an Attr object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + returns an ArrayList with 0 or more objects of all the capabilities + matching the passed in capability Oid. If the Oid passed is null the + entire set is returned. + + + Produce an object suitable for an Asn1OutputStream. +
+            SMIMECapabilities ::= Sequence OF SMIMECapability
+            
+
+ + return an Attr object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
+            Attr ::= Sequence {
+                attrType OBJECT IDENTIFIER,
+                attrValues Set OF AttributeValue
+            }
+            
+
+ + general preferences + + + encryption algorithms preferences + + + Produce an object suitable for an Asn1OutputStream. +
+            SMIMECapability ::= Sequence {
+                capabilityID OBJECT IDENTIFIER,
+                parameters ANY DEFINED BY capabilityID OPTIONAL
+            }
+            
+
+ + Handler for creating a vector S/MIME Capabilities + + + The SmimeEncryptionKeyPreference object. +
+            SmimeEncryptionKeyPreference ::= CHOICE {
+                issuerAndSerialNumber   [0] IssuerAndSerialNumber,
+                receipentKeyId          [1] RecipientKeyIdentifier,
+                subjectAltKeyIdentifier [2] SubjectKeyIdentifier
+            }
+            
+
+ + @param sKeyId the subjectKeyIdentifier value (normally the X.509 one) + + + elliptic curves defined in "ECC Brainpool Standard Curves and Curve Generation" + http://www.ecc-brainpool.org/download/draft_pkix_additional_ecc_dp.txt + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + +
+            Accuracy ::= SEQUENCE {
+                        seconds        INTEGER              OPTIONAL,
+                        millis     [0] INTEGER  (1..999)    OPTIONAL,
+                        micros     [1] INTEGER  (1..999)    OPTIONAL
+                        }
+            
+
+ + @param o + @return a MessageImprint object. + + +
+               MessageImprint ::= SEQUENCE  {
+                  hashAlgorithm                AlgorithmIdentifier,
+                  hashedMessage                OCTET STRING  }
+            
+
+ +
+            TimeStampReq ::= SEQUENCE  {
+             version                      INTEGER  { v1(1) },
+             messageImprint               MessageImprint,
+               --a hash algorithm OID and the hash value of the data to be
+               --time-stamped
+             reqPolicy             TSAPolicyId              OPTIONAL,
+             nonce                 INTEGER                  OPTIONAL,
+             certReq               BOOLEAN                  DEFAULT FALSE,
+             extensions            [0] IMPLICIT Extensions  OPTIONAL
+            }
+            
+
+ +
+            TimeStampResp ::= SEQUENCE  {
+              status                  PkiStatusInfo,
+              timeStampToken          TimeStampToken     OPTIONAL  }
+            
+
+ +
+            
+                 TstInfo ::= SEQUENCE  {
+                    version                      INTEGER  { v1(1) },
+                    policy                       TSAPolicyId,
+                    messageImprint               MessageImprint,
+                      -- MUST have the same value as the similar field in
+                      -- TimeStampReq
+                    serialNumber                 INTEGER,
+                     -- Time-Stamping users MUST be ready to accommodate integers
+                     -- up to 160 bits.
+                    genTime                      GeneralizedTime,
+                    accuracy                     Accuracy                 OPTIONAL,
+                    ordering                     BOOLEAN             DEFAULT FALSE,
+                    nonce                        INTEGER                  OPTIONAL,
+                      -- MUST be present if the similar field was present
+                      -- in TimeStampReq.  In that case it MUST have the same value.
+                    tsa                          [0] GeneralName          OPTIONAL,
+                    extensions                   [1] IMPLICIT Extensions   OPTIONAL  }
+            
+             
+
+ + dump a Der object as a formatted string with indentation + + @param obj the Asn1Object to be dumped out. + + + dump out a DER object as a formatted string, in non-verbose mode + + @param obj the Asn1Encodable to be dumped out. + @return the resulting string. + + + Dump out the object as a string + + @param obj the Asn1Encodable to be dumped out. + @param verbose if true, dump out the contents of octet and bit strings. + @return the resulting string. + + +
+             DirectoryString ::= CHOICE {
+               teletexString               TeletexString (SIZE (1..MAX)),
+               printableString             PrintableString (SIZE (1..MAX)),
+               universalString             UniversalString (SIZE (1..MAX)),
+               utf8String                  UTF8String (SIZE (1..MAX)),
+               bmpString                   BMPString (SIZE (1..MAX))  }
+            
+
+ + The AccessDescription object. +
+            AccessDescription  ::=  SEQUENCE {
+                  accessMethod          OBJECT IDENTIFIER,
+                  accessLocation        GeneralName  }
+            
+
+ + create an AccessDescription with the oid and location provided. + + + + @return the access method. + + + + @return the access location + + + + Don't use this one if you are trying to be RFC 3281 compliant. + Use it for v1 attribute certificates only. + + Our GeneralNames structure + + + Produce an object suitable for an Asn1OutputStream. +
+             AttCertIssuer ::= CHOICE {
+                  v1Form   GeneralNames,  -- MUST NOT be used in this
+                                          -- profile
+                  v2Form   [0] V2Form     -- v2 only
+             }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+             AttCertValidityPeriod  ::= Sequence {
+                  notBeforeTime  GeneralizedTime,
+                  notAfterTime   GeneralizedTime
+             }
+            
+
+ + @param obj + @return + + + Produce an object suitable for an Asn1OutputStream. +
+             AttributeCertificate ::= Sequence {
+                  acinfo               AttributeCertificateInfo,
+                  signatureAlgorithm   AlgorithmIdentifier,
+                  signatureValue       BIT STRING
+             }
+            
+
+ + Produce an object suitable for an Asn1OutputStream. +
+              AttributeCertificateInfo ::= Sequence {
+                   version              AttCertVersion -- version is v2,
+                   holder               Holder,
+                   issuer               AttCertIssuer,
+                   signature            AlgorithmIdentifier,
+                   serialNumber         CertificateSerialNumber,
+                   attrCertValidityPeriod   AttCertValidityPeriod,
+                   attributes           Sequence OF Attr,
+                   issuerUniqueID       UniqueIdentifier OPTIONAL,
+                   extensions           Extensions OPTIONAL
+              }
+            
+              AttCertVersion ::= Integer { v2(1) }
+             
+
+ + The AuthorityInformationAccess object. +
+             id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
+            
+             AuthorityInfoAccessSyntax  ::=
+                  Sequence SIZE (1..MAX) OF AccessDescription
+             AccessDescription  ::=  Sequence {
+                   accessMethod          OBJECT IDENTIFIER,
+                   accessLocation        GeneralName  }
+            
+             id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
+             id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
+             id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
+             
+
+ + create an AuthorityInformationAccess with the oid and location provided. + + + The AuthorityKeyIdentifier object. +
+             id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
+            
+               AuthorityKeyIdentifier ::= Sequence {
+                  keyIdentifier             [0] IMPLICIT KeyIdentifier           OPTIONAL,
+                  authorityCertIssuer       [1] IMPLICIT GeneralNames            OPTIONAL,
+                  authorityCertSerialNumber [2] IMPLICIT CertificateSerialNumber OPTIONAL  }
+            
+               KeyIdentifier ::= OCTET STRING
+             
+ +
+ + * + * Calulates the keyidentifier using a SHA1 hash over the BIT STRING + * from SubjectPublicKeyInfo as defined in RFC2459. + * + * Example of making a AuthorityKeyIdentifier: + *
+            	     *   SubjectPublicKeyInfo apki = new SubjectPublicKeyInfo((ASN1Sequence)new ASN1InputStream(
+            		 *       publicKey.getEncoded()).readObject());
+                     *   AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(apki);
+                     * 
+ * + * +
+ + create an AuthorityKeyIdentifier with the GeneralNames tag and + the serial number provided as well. + + + create an AuthorityKeyIdentifier with the GeneralNames tag and + the serial number provided. + + + create an AuthorityKeyIdentifier with a precomputed key identifier + + + create an AuthorityKeyIdentifier with a precomupted key identifier + and the GeneralNames tag and the serial number provided as well. + + + Produce an object suitable for an Asn1OutputStream. + + + create a cA=true object for the given path length constraint. + + @param pathLenConstraint + + + Produce an object suitable for an Asn1OutputStream. +
+            BasicConstraints := Sequence {
+               cA                  Boolean DEFAULT FALSE,
+               pathLenConstraint   Integer (0..MAX) OPTIONAL
+            }
+            
+
+ + PKIX RFC-2459 + + The X.509 v2 CRL syntax is as follows. For signature calculation, + the data that is to be signed is ASN.1 Der encoded. + +
+             CertificateList  ::=  Sequence  {
+                  tbsCertList          TbsCertList,
+                  signatureAlgorithm   AlgorithmIdentifier,
+                  signatureValue       BIT STRING  }
+             
+
+ + This class helps to support crossCerfificatePairs in a LDAP directory + according RFC 2587 + +
+                 crossCertificatePairATTRIBUTE::={
+                   WITH SYNTAX   CertificatePair
+                   EQUALITY MATCHING RULE certificatePairExactMatch
+                   ID joint-iso-ccitt(2) ds(5) attributeType(4) crossCertificatePair(40)}
+             
+ +
The forward elements of the crossCertificatePair attribute of a + CA's directory entry shall be used to store all, except self-issued + certificates issued to this CA. Optionally, the reverse elements of the + crossCertificatePair attribute, of a CA's directory entry may contain a + subset of certificates issued by this CA to other CAs. When both the forward + and the reverse elements are present in a single attribute value, issuer name + in one certificate shall match the subject name in the other and vice versa, + and the subject public key in one certificate shall be capable of verifying + the digital signature on the other certificate and vice versa. + + When a reverse element is present, the forward element value and the reverse + element value need not be stored in the same attribute value; in other words, + they can be stored in either a single attribute value or two attribute + values.
+ +
+                   CertificatePair ::= SEQUENCE {
+                     forward		[0]	Certificate OPTIONAL,
+                     reverse		[1]	Certificate OPTIONAL,
+                     -- at least one of the pair shall be present -- }
+             
+
+ + Constructor from Asn1Sequence. +

+ The sequence is of type CertificatePair: +

+

+                   CertificatePair ::= SEQUENCE {
+                     forward		[0]	Certificate OPTIONAL,
+                     reverse		[1]	Certificate OPTIONAL,
+                     -- at least one of the pair shall be present -- }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. + + @param forward Certificates issued to this CA. + @param reverse Certificates issued by this CA to other CAs. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                   CertificatePair ::= SEQUENCE {
+                     forward		[0]	Certificate OPTIONAL,
+                     reverse		[1]	Certificate OPTIONAL,
+                     -- at least one of the pair shall be present -- }
+             
+ + @return a DERObject +
+ + @return Returns the forward. + + + @return Returns the reverse. + + + Construct a CertificatePolicies object containing one PolicyInformation. + + @param name the name to be contained. + + + Produce an object suitable for an ASN1OutputStream. +
+            CertificatePolicies ::= SEQUENCE SIZE {1..MAX} OF PolicyInformation
+            
+
+ + CertPolicyId, used in the CertificatePolicies and PolicyMappings + X509V3 Extensions. + +
+                 CertPolicyId ::= OBJECT IDENTIFIER
+             
+
+ + Return the distribution points making up the sequence. + + @return DistributionPoint[] + + + Produce an object suitable for an Asn1OutputStream. +
+            CrlDistPoint ::= Sequence SIZE {1..MAX} OF DistributionPoint
+            
+
+ + The CRLNumber object. +
+            CRLNumber::= Integer(0..MAX)
+            
+
+ + The CRLReason enumeration. +
+            CRLReason ::= Enumerated {
+             unspecified             (0),
+             keyCompromise           (1),
+             cACompromise            (2),
+             affiliationChanged      (3),
+             superseded              (4),
+             cessationOfOperation    (5),
+             certificateHold         (6),
+             removeFromCRL           (8),
+             privilegeWithdrawn      (9),
+             aACompromise           (10)
+            }
+            
+
+ + The DigestInfo object. +
+            DigestInfo::=Sequence{
+                     digestAlgorithm  AlgorithmIdentifier,
+                     digest OCTET STRING }
+            
+
+ + DisplayText class, used in + CertificatePolicies X509 V3 extensions (in policy qualifiers). + +

It stores a string in a chosen encoding. +

+             DisplayText ::= CHOICE {
+                  ia5String        IA5String      (SIZE (1..200)),
+                  visibleString    VisibleString  (SIZE (1..200)),
+                  bmpString        BMPString      (SIZE (1..200)),
+                  utf8String       UTF8String     (SIZE (1..200)) }
+             

+ @see PolicyQualifierInfo + @see PolicyInformation +
+ + Constant corresponding to ia5String encoding. + + + + Constant corresponding to bmpString encoding. + + + + Constant corresponding to utf8String encoding. + + + + Constant corresponding to visibleString encoding. + + + + Describe constant DisplayTextMaximumSize here. + + + + Creates a new DisplayText instance. + + @param type the desired encoding type for the text. + @param text the text to store. Strings longer than 200 + characters are truncated. + + + Creates a new DisplayText instance. + + @param text the text to encapsulate. Strings longer than 200 + characters are truncated. + + + Creates a new DisplayText instance. +

Useful when reading back a DisplayText class + from it's Asn1Encodable form.

+ + @param contents an Asn1Encodable instance. +
+ + Returns the stored string object. + + @return the stored text as a string. + + + The DistributionPoint object. +
+            DistributionPoint ::= Sequence {
+                 distributionPoint [0] DistributionPointName OPTIONAL,
+                 reasons           [1] ReasonFlags OPTIONAL,
+                 cRLIssuer         [2] GeneralNames OPTIONAL
+            }
+            
+
+ + The DistributionPointName object. +
+            DistributionPointName ::= CHOICE {
+                fullName                 [0] GeneralNames,
+                nameRelativeToCRLIssuer  [1] RDN
+            }
+            
+
+ + The extendedKeyUsage object. +
+                 extendedKeyUsage ::= Sequence SIZE (1..MAX) OF KeyPurposeId
+            
+
+ + Returns all extended key usages. + The returned ArrayList contains DerObjectIdentifier instances. + @return An ArrayList with all key purposes. + + + The GeneralName object. +
+             GeneralName ::= CHOICE {
+                  otherName                       [0]     OtherName,
+                  rfc822Name                      [1]     IA5String,
+                  dNSName                         [2]     IA5String,
+                  x400Address                     [3]     ORAddress,
+                  directoryName                   [4]     Name,
+                  ediPartyName                    [5]     EDIPartyName,
+                  uniformResourceIdentifier       [6]     IA5String,
+                  iPAddress                       [7]     OCTET STRING,
+                  registeredID                    [8]     OBJECT IDENTIFIER}
+            
+             OtherName ::= Sequence {
+                  type-id    OBJECT IDENTIFIER,
+                  value      [0] EXPLICIT ANY DEFINED BY type-id }
+            
+             EDIPartyName ::= Sequence {
+                  nameAssigner            [0]     DirectoryString OPTIONAL,
+                  partyName               [1]     DirectoryString }
+             
+
+ + When the subjectAltName extension contains an Internet mail address, + the address MUST be included as an rfc822Name. The format of an + rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. + + When the subjectAltName extension contains a domain name service + label, the domain name MUST be stored in the dNSName (an IA5String). + The name MUST be in the "preferred name syntax," as specified by RFC + 1034 [RFC 1034]. + + When the subjectAltName extension contains a URI, the name MUST be + stored in the uniformResourceIdentifier (an IA5String). The name MUST + be a non-relative URL, and MUST follow the URL syntax and encoding + rules specified in [RFC 1738]. The name must include both a scheme + (e.g., "http" or "ftp") and a scheme-specific-part. The scheme- + specific-part must include a fully qualified domain name or IP + address as the host. + + When the subjectAltName extension contains a iPAddress, the address + MUST be stored in the octet string in "network byte order," as + specified in RFC 791 [RFC 791]. The least significant bit (LSB) of + each octet is the LSB of the corresponding byte in the network + address. For IP Version 4, as specified in RFC 791, the octet string + MUST contain exactly four octets. For IP Version 6, as specified in + RFC 1883, the octet string MUST contain exactly sixteen octets [RFC + 1883]. + + + Create a GeneralName for the given tag from the passed in string. +

+ This constructor can handle: +

    +
  • rfc822Name
  • +
  • iPAddress
  • +
  • directoryName
  • +
  • dNSName
  • +
  • uniformResourceIdentifier
  • +
  • registeredID
  • +
+ For x400Address, otherName and ediPartyName there is no common string + format defined. +

+ Note: A directory name can be encoded in different ways into a byte + representation. Be aware of this if the byte representation is used for + comparing results. +

+ + @param tag tag number + @param name string representation of name + @throws ArgumentException if the string encoding is not correct or + not supported. +
+ + Construct a GeneralNames object containing one GeneralName. + The name to be contained. + + + Produce an object suitable for an Asn1OutputStream. +
+            GeneralNames ::= Sequence SIZE {1..MAX} OF GeneralName
+            
+
+ + Class for containing a restriction object subtrees in NameConstraints. See + RFC 3280. + +
+            
+                   GeneralSubtree ::= SEQUENCE
+                   {
+                     baseName                    GeneralName,
+                     minimum         [0]     BaseDistance DEFAULT 0,
+                     maximum         [1]     BaseDistance OPTIONAL
+                   }
+             
+ + @see org.bouncycastle.asn1.x509.NameConstraints + +
+ + Constructor from a given details. + + According RFC 3280, the minimum and maximum fields are not used with any + name forms, thus minimum MUST be zero, and maximum MUST be absent. +

+ If minimum is null, zero is assumed, if + maximum is null, maximum is absent.

+ + @param baseName + A restriction. + @param minimum + Minimum + + @param maximum + Maximum +
+ + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
+                   GeneralSubtree ::= SEQUENCE
+                   {
+                     baseName                    GeneralName,
+                     minimum         [0]     BaseDistance DEFAULT 0,
+                     maximum         [1]     BaseDistance OPTIONAL
+                   }
+             
+ + @return a DERObject +
+ + The Holder object. +

+ For an v2 attribute certificate this is: + +

+                       Holder ::= SEQUENCE {
+                             baseCertificateID   [0] IssuerSerial OPTIONAL,
+                                      -- the issuer and serial number of
+                                      -- the holder's Public Key Certificate
+                             entityName          [1] GeneralNames OPTIONAL,
+                                      -- the name of the claimant or role
+                             objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
+                                      -- used to directly authenticate the holder,
+                                      -- for example, an executable
+                       }
+            
+

+

+ For an v1 attribute certificate this is: + +

+                    subject CHOICE {
+                     baseCertificateID [0] IssuerSerial,
+                     -- associated with a Public Key Certificate
+                     subjectName [1] GeneralNames },
+                     -- associated with a name
+            
+

+
+ + Constructor for a holder for an v1 attribute certificate. + + @param tagObj The ASN.1 tagged holder object. + + + Constructor for a holder for an v2 attribute certificate. * + + @param seq The ASN.1 sequence. + + + Constructs a holder from a IssuerSerial. + @param baseCertificateID The IssuerSerial. + @param version The version of the attribute certificate. + + + Constructs a holder with an entityName for v2 attribute certificates or + with a subjectName for v1 attribute certificates. + + @param entityName The entity or subject name. + + + Constructs a holder with an entityName for v2 attribute certificates or + with a subjectName for v1 attribute certificates. + + @param entityName The entity or subject name. + @param version The version of the attribute certificate. + + + Constructs a holder from an object digest info. + + @param objectDigestInfo The object digest info object. + + + The Holder object. +
+             Holder ::= Sequence {
+                   baseCertificateID   [0] IssuerSerial OPTIONAL,
+                            -- the issuer and serial number of
+                            -- the holder's Public Key Certificate
+                   entityName          [1] GeneralNames OPTIONAL,
+                            -- the name of the claimant or role
+                   objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
+                            -- used to directly authenticate the holder,
+                            -- for example, an executable
+             }
+            
+
+ + Returns 1 for v2 attribute certificates or 0 for v1 attribute + certificates. + @return The version of the attribute certificate. + + + Returns the entityName for an v2 attribute certificate or the subjectName + for an v1 attribute certificate. + + @return The entityname or subjectname. + + + Implementation of IetfAttrSyntax as specified by RFC3281. + + + + + + +
+            
+              IetfAttrSyntax ::= Sequence {
+                policyAuthority [0] GeneralNames OPTIONAL,
+                values Sequence OF CHOICE {
+                  octets OCTET STRING,
+                  oid OBJECT IDENTIFIER,
+                  string UTF8String
+                }
+              }
+            
+             
+
+ + Produce an object suitable for an Asn1OutputStream. +
+             IssuerSerial  ::=  Sequence {
+                  issuer         GeneralNames,
+                  serial         CertificateSerialNumber,
+                  issuerUid      UniqueIdentifier OPTIONAL
+             }
+            
+
+ +
+            IssuingDistributionPoint ::= SEQUENCE { 
+              distributionPoint          [0] DistributionPointName OPTIONAL, 
+              onlyContainsUserCerts      [1] BOOLEAN DEFAULT FALSE, 
+              onlyContainsCACerts        [2] BOOLEAN DEFAULT FALSE, 
+              onlySomeReasons            [3] ReasonFlags OPTIONAL, 
+              indirectCRL                [4] BOOLEAN DEFAULT FALSE,
+              onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
+            
+
+ + Constructor from given details. + + @param distributionPoint + May contain an URI as pointer to most current CRL. + @param onlyContainsUserCerts Covers revocation information for end certificates. + @param onlyContainsCACerts Covers revocation information for CA certificates. + + @param onlySomeReasons + Which revocation reasons does this point cover. + @param indirectCRL + If true then the CRL contains revocation + information about certificates ssued by other CAs. + @param onlyContainsAttributeCerts Covers revocation information for attribute certificates. + + + Constructor from Asn1Sequence + + + @return Returns the distributionPoint. + + + @return Returns the onlySomeReasons. + + + The KeyPurposeID object. +
+                KeyPurposeID ::= OBJECT IDENTIFIER
+            
+
+ + The KeyUsage object. +
+                id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
+            
+                KeyUsage ::= BIT STRING {
+                     digitalSignature        (0),
+                     nonRepudiation          (1),
+                     keyEncipherment         (2),
+                     dataEncipherment        (3),
+                     keyAgreement            (4),
+                     keyCertSign             (5),
+                     cRLSign                 (6),
+                     encipherOnly            (7),
+                     decipherOnly            (8) }
+             
+
+ + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment) + + + Constructor from a given details. + +

permitted and excluded are Vectors of GeneralSubtree objects.

+ + @param permitted Permitted subtrees + @param excluded Excluded subtrees +
+ + NoticeReference class, used in + CertificatePolicies X509 V3 extensions + (in policy qualifiers). + +
+              NoticeReference ::= Sequence {
+                  organization     DisplayText,
+                  noticeNumbers    Sequence OF Integer }
+            
+             
+ + @see PolicyQualifierInfo + @see PolicyInformation +
+ + Creates a new NoticeReference instance. + + @param organization a String value + @param numbers a Vector value + + + Creates a new NoticeReference instance. + + @param organization a String value + @param noticeNumbers an ASN1EncodableVector value + + + Creates a new NoticeReference instance. + + @param organization displayText + @param noticeNumbers an ASN1EncodableVector value + + + Creates a new NoticeReference instance. +

Useful for reconstructing a NoticeReference + instance from its encodable/encoded form.

+ + @param as an Asn1Sequence value obtained from either + calling @{link ToAsn1Object()} for a NoticeReference + instance or from parsing it from a Der-encoded stream. +
+ + Describe ToAsn1Object method here. + + @return a Asn1Object value + + + ObjectDigestInfo ASN.1 structure used in v2 attribute certificates. + +
+             
+               ObjectDigestInfo ::= SEQUENCE {
+                    digestedObjectType  ENUMERATED {
+                            publicKey            (0),
+                            publicKeyCert        (1),
+                            otherObjectTypes     (2) },
+                                    -- otherObjectTypes MUST NOT
+                                    -- be used in this profile
+                    otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
+                    digestAlgorithm     AlgorithmIdentifier,
+                    objectDigest        BIT STRING
+               }
+              
+            
+ +
+ + The public key is hashed. + + + The public key certificate is hashed. + + + An other object is hashed. + + + Constructor from given details. +

+ If digestedObjectType is not {@link #publicKeyCert} or + {@link #publicKey} otherObjectTypeID must be given, + otherwise it is ignored.

+ + @param digestedObjectType The digest object type. + @param otherObjectTypeID The object type ID for + otherObjectDigest. + @param digestAlgorithm The algorithm identifier for the hash. + @param objectDigest The hash value. +
+ + Produce an object suitable for an Asn1OutputStream. + +
+             
+               ObjectDigestInfo ::= SEQUENCE {
+                    digestedObjectType  ENUMERATED {
+                            publicKey            (0),
+                            publicKeyCert        (1),
+                            otherObjectTypes     (2) },
+                                    -- otherObjectTypes MUST NOT
+                                    -- be used in this profile
+                    otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
+                    digestAlgorithm     AlgorithmIdentifier,
+                    objectDigest        BIT STRING
+               }
+              
+            
+
+ + PolicyMappings V3 extension, described in RFC3280. +
+                PolicyMappings ::= Sequence SIZE (1..MAX) OF Sequence {
+                  issuerDomainPolicy      CertPolicyId,
+                  subjectDomainPolicy     CertPolicyId }
+             
+ + @see RFC 3280, section 4.2.1.6 +
+ + Creates a new PolicyMappings instance. + + @param seq an Asn1Sequence constructed as specified + in RFC 3280 + + + Creates a new PolicyMappings instance. + + @param mappings a HashMap value that maps + string oids + to other string oids. + + + PolicyQualifierId, used in the CertificatePolicies + X509V3 extension. + +
+                id-qt          OBJECT IDENTIFIER ::=  { id-pkix 2 }
+                id-qt-cps      OBJECT IDENTIFIER ::=  { id-qt 1 }
+                id-qt-unotice  OBJECT IDENTIFIER ::=  { id-qt 2 }
+              PolicyQualifierId ::=
+                   OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
+             
+
+ + Policy qualifiers, used in the X509V3 CertificatePolicies + extension. + +
+               PolicyQualifierInfo ::= Sequence {
+                   policyQualifierId  PolicyQualifierId,
+                   qualifier          ANY DEFINED BY policyQualifierId }
+             
+
+ + Creates a new PolicyQualifierInfo instance. + + @param policyQualifierId a PolicyQualifierId value + @param qualifier the qualifier, defined by the above field. + + + Creates a new PolicyQualifierInfo containing a + cPSuri qualifier. + + @param cps the CPS (certification practice statement) uri as a + string. + + + Creates a new PolicyQualifierInfo instance. + + @param as PolicyQualifierInfo X509 structure + encoded as an Asn1Sequence. + + + Returns a Der-encodable representation of this instance. + + @return a Asn1Object value + + + +
+            PrivateKeyUsagePeriod ::= SEQUENCE
+            {
+            notBefore       [0]     GeneralizedTime OPTIONAL,
+            notAfter        [1]     GeneralizedTime OPTIONAL }
+            
+
+
+ + The BiometricData object. +
+            BiometricData  ::=  SEQUENCE {
+                  typeOfBiometricData  TypeOfBiometricData,
+                  hashAlgorithm        AlgorithmIdentifier,
+                  biometricDataHash    OCTET STRING,
+                  sourceDataUri        IA5String OPTIONAL  }
+            
+
+ + The Iso4217CurrencyCode object. +
+            Iso4217CurrencyCode  ::=  CHOICE {
+                  alphabetic              PrintableString (SIZE 3), --Recommended
+                  numeric              INTEGER (1..999) }
+            -- Alphabetic or numeric currency code as defined in ISO 4217
+            -- It is recommended that the Alphabetic form is used
+            
+
+ + The MonetaryValue object. +
+            MonetaryValue  ::=  SEQUENCE {
+                  currency              Iso4217CurrencyCode,
+                  amount               INTEGER,
+                  exponent             INTEGER }
+            -- value = amount * 10^exponent
+            
+
+ + The QCStatement object. +
+            QCStatement ::= SEQUENCE {
+              statementId        OBJECT IDENTIFIER,
+              statementInfo      ANY DEFINED BY statementId OPTIONAL}
+            
+
+ + The SemanticsInformation object. +
+                   SemanticsInformation ::= SEQUENCE {
+                     semanticsIdentifier        OBJECT IDENTIFIER   OPTIONAL,
+                     nameRegistrationAuthorities NameRegistrationAuthorities
+                                                                     OPTIONAL }
+                     (WITH COMPONENTS {..., semanticsIdentifier PRESENT}|
+                      WITH COMPONENTS {..., nameRegistrationAuthorities PRESENT})
+            
+                 NameRegistrationAuthorities ::=  SEQUENCE SIZE (1..MAX) OF
+                     GeneralName
+             
+
+ + The TypeOfBiometricData object. +
+             TypeOfBiometricData ::= CHOICE {
+               predefinedBiometricType   PredefinedBiometricType,
+               biometricDataOid          OBJECT IDENTIFIER }
+            
+             PredefinedBiometricType ::= INTEGER {
+               picture(0),handwritten-signature(1)}
+               (picture|handwritten-signature)
+             
+
+ + The ReasonFlags object. +
+            ReasonFlags ::= BIT STRING {
+               unused(0),
+               keyCompromise(1),
+               cACompromise(2),
+               affiliationChanged(3),
+               superseded(4),
+               cessationOfOperation(5),
+               certficateHold(6)
+            }
+            
+
+ + @param reasons - the bitwise OR of the Key Reason flags giving the + allowed uses for the key. + + + Implementation of the RoleSyntax object as specified by the RFC3281. + +
+             RoleSyntax ::= SEQUENCE {
+                             roleAuthority  [0] GeneralNames OPTIONAL,
+                             roleName       [1] GeneralName
+                       }
+             
+
+ + RoleSyntax factory method. + @param obj the object used to construct an instance of + RoleSyntax. It must be an instance of RoleSyntax + or Asn1Sequence. + @return the instance of RoleSyntax built from the + supplied object. + @throws java.lang.ArgumentException if the object passed + to the factory is not an instance of RoleSyntax or + Asn1Sequence. + + + Constructor. + @param roleAuthority the role authority of this RoleSyntax. + @param roleName the role name of this RoleSyntax. + + + Constructor. Invoking this constructor is the same as invoking + new RoleSyntax(null, roleName). + @param roleName the role name of this RoleSyntax. + + + Utility constructor. Takes a string argument representing + the role name, builds a GeneralName to hold the role name + and calls the constructor that takes a GeneralName. + @param roleName + + + Constructor that builds an instance of RoleSyntax by + extracting the encoded elements from the Asn1Sequence + object supplied. + @param seq an instance of Asn1Sequence that holds + the encoded elements used to build this RoleSyntax. + + + Gets the role name as a java.lang.string object. + @return the role name of this RoleSyntax represented as a + string object. + + + Gets the role authority as a string[] object. + @return the role authority of this RoleSyntax represented as a + string[] array. + + + Implementation of the method ToAsn1Object as + required by the superclass ASN1Encodable. + +
+             RoleSyntax ::= SEQUENCE {
+                             roleAuthority  [0] GeneralNames OPTIONAL,
+                             roleName       [1] GeneralName
+                       }
+             
+
+ + Gets the role authority of this RoleSyntax. + @return an instance of GeneralNames holding the + role authority of this RoleSyntax. + + + Gets the role name of this RoleSyntax. + @return an instance of GeneralName holding the + role name of this RoleSyntax. + + + This outputs the key in Pkcs1v2 format. +
+                 RSAPublicKey ::= Sequence {
+                                     modulus Integer, -- n
+                                     publicExponent Integer, -- e
+                                 }
+            
+
+ + Structure for a name or pseudonym. + +
+                  NameOrPseudonym ::= CHOICE {
+                	   surAndGivenName SEQUENCE {
+                	     surName DirectoryString,
+                	     givenName SEQUENCE OF DirectoryString 
+                    },
+                	   pseudonym DirectoryString 
+                  }
+            
+ + @see org.bouncycastle.asn1.x509.sigi.PersonalData + +
+ + Constructor from DERString. +

+ The sequence is of type NameOrPseudonym: +

+

+                  NameOrPseudonym ::= CHOICE {
+                	   surAndGivenName SEQUENCE {
+                	     surName DirectoryString,
+                	     givenName SEQUENCE OF DirectoryString
+                    },
+                	   pseudonym DirectoryString
+                  }
+            
+ @param pseudonym pseudonym value to use. +
+ + Constructor from Asn1Sequence. +

+ The sequence is of type NameOrPseudonym: +

+

+                   NameOrPseudonym ::= CHOICE {
+                 	   surAndGivenName SEQUENCE {
+                 	     surName DirectoryString,
+                 	     givenName SEQUENCE OF DirectoryString
+                     },
+                 	   pseudonym DirectoryString
+                   }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. + + @param pseudonym The pseudonym. + + + Constructor from a given details. + + @param surname The surname. + @param givenName A sequence of directory strings making up the givenName + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                   NameOrPseudonym ::= CHOICE {
+                 	   surAndGivenName SEQUENCE {
+                 	     surName DirectoryString,
+                 	     givenName SEQUENCE OF DirectoryString
+                     },
+                 	   pseudonym DirectoryString
+                   }
+             
+ + @return an Asn1Object +
+ + Contains personal data for the otherName field in the subjectAltNames + extension. +

+

+                 PersonalData ::= SEQUENCE {
+                   nameOrPseudonym NameOrPseudonym,
+                   nameDistinguisher [0] INTEGER OPTIONAL,
+                   dateOfBirth [1] GeneralizedTime OPTIONAL,
+                   placeOfBirth [2] DirectoryString OPTIONAL,
+                   gender [3] PrintableString OPTIONAL,
+                   postalAddress [4] DirectoryString OPTIONAL
+                   }
+             
+ + @see org.bouncycastle.asn1.x509.sigi.NameOrPseudonym + @see org.bouncycastle.asn1.x509.sigi.SigIObjectIdentifiers +
+ + Constructor from Asn1Sequence. +

+ The sequence is of type NameOrPseudonym: +

+

+                 PersonalData ::= SEQUENCE {
+                   nameOrPseudonym NameOrPseudonym,
+                   nameDistinguisher [0] INTEGER OPTIONAL,
+                   dateOfBirth [1] GeneralizedTime OPTIONAL,
+                   placeOfBirth [2] DirectoryString OPTIONAL,
+                   gender [3] PrintableString OPTIONAL,
+                   postalAddress [4] DirectoryString OPTIONAL
+                   }
+             
+ + @param seq The ASN.1 sequence. +
+ + Constructor from a given details. + + @param nameOrPseudonym Name or pseudonym. + @param nameDistinguisher Name distinguisher. + @param dateOfBirth Date of birth. + @param placeOfBirth Place of birth. + @param gender Gender. + @param postalAddress Postal Address. + + + Produce an object suitable for an Asn1OutputStream. +

+ Returns: +

+

+                 PersonalData ::= SEQUENCE {
+                   nameOrPseudonym NameOrPseudonym,
+                   nameDistinguisher [0] INTEGER OPTIONAL,
+                   dateOfBirth [1] GeneralizedTime OPTIONAL,
+                   placeOfBirth [2] DirectoryString OPTIONAL,
+                   gender [3] PrintableString OPTIONAL,
+                   postalAddress [4] DirectoryString OPTIONAL
+                   }
+             
+ + @return an Asn1Object +
+ + Object Identifiers of SigI specifciation (German Signature Law + Interoperability specification). + + + Key purpose IDs for German SigI (Signature Interoperability + Specification) + + + Certificate policy IDs for German SigI (Signature Interoperability + Specification) + + + Other Name IDs for German SigI (Signature Interoperability Specification) + + + To be used for for the generation of directory service certificates. + + + ID for PersonalData + + + Certificate is conform to german signature law. + + + This extension may contain further X.500 attributes of the subject. See also + RFC 3039. + +
+                 SubjectDirectoryAttributes ::= Attributes
+                 Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+                 Attribute ::= SEQUENCE
+                 {
+                   type AttributeType
+                   values SET OF AttributeValue
+                 }
+            
+                 AttributeType ::= OBJECT IDENTIFIER
+                 AttributeValue ::= ANY DEFINED BY AttributeType
+             
+ + @see org.bouncycastle.asn1.x509.X509Name for AttributeType ObjectIdentifiers. +
+ + Constructor from Asn1Sequence. + + The sequence is of type SubjectDirectoryAttributes: + +
+                  SubjectDirectoryAttributes ::= Attributes
+                  Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+                  Attribute ::= SEQUENCE
+                  {
+                    type AttributeType
+                    values SET OF AttributeValue
+                  }
+            
+                  AttributeType ::= OBJECT IDENTIFIER
+                  AttributeValue ::= ANY DEFINED BY AttributeType
+             
+ + @param seq + The ASN.1 sequence. +
+ + Constructor from an ArrayList of attributes. + + The ArrayList consists of attributes of type {@link Attribute Attribute} + + @param attributes The attributes. + + + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
+                  SubjectDirectoryAttributes ::= Attributes
+                  Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+                  Attribute ::= SEQUENCE
+                  {
+                    type AttributeType
+                    values SET OF AttributeValue
+                  }
+            
+                  AttributeType ::= OBJECT IDENTIFIER
+                  AttributeValue ::= ANY DEFINED BY AttributeType
+             
+ + @return a DERObject +
+ + @return Returns the attributes. + + + The SubjectKeyIdentifier object. +
+            SubjectKeyIdentifier::= OCTET STRING
+            
+
+ + Calculates the keyIdentifier using a SHA1 hash over the BIT STRING + from SubjectPublicKeyInfo as defined in RFC3280. + + @param spki the subject public key info. + + + Return a RFC 3280 type 1 key identifier. As in: +
+            (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the
+            value of the BIT STRING subjectPublicKey (excluding the tag,
+            length, and number of unused bits).
+            
+ @param keyInfo the key info object containing the subjectPublicKey field. + @return the key identifier. +
+ + Return a RFC 3280 type 2 key identifier. As in: +
+            (2) The keyIdentifier is composed of a four bit type field with
+            the value 0100 followed by the least significant 60 bits of the
+            SHA-1 hash of the value of the BIT STRING subjectPublicKey.
+            
+ @param keyInfo the key info object containing the subjectPublicKey field. + @return the key identifier. +
+ + The object that contains the public key stored in a certficate. +

+ The GetEncoded() method in the public keys in the JCE produces a DER + encoded one of these.

+
+ + for when the public key is an encoded object - if the bitstring + can't be decoded this routine raises an IOException. + + @exception IOException - if the bit string doesn't represent a Der + encoded object. + + + Produce an object suitable for an Asn1OutputStream. +
+            SubjectPublicKeyInfo ::= Sequence {
+                                     algorithm AlgorithmIdentifier,
+                                     publicKey BIT STRING }
+            
+
+ + for when the public key is raw bits... + + + Target structure used in target information extension for attribute + certificates from RFC 3281. + +
+                Target  ::= CHOICE {
+                  targetName          [0] GeneralName,
+                  targetGroup         [1] GeneralName,
+                  targetCert          [2] TargetCert
+                }
+            
+ +

+ The targetCert field is currently not supported and must not be used + according to RFC 3281.

+
+ + Creates an instance of a Target from the given object. +

+ obj can be a Target or a {@link Asn1TaggedObject}

+ + @param obj The object. + @return A Target instance. + @throws ArgumentException if the given object cannot be + interpreted as Target. +
+ + Constructor from Asn1TaggedObject. + + @param tagObj The tagged object. + @throws ArgumentException if the encoding is wrong. + + + Constructor from given details. +

+ Exactly one of the parameters must be not null.

+ + @param type the choice type to apply to the name. + @param name the general name. + @throws ArgumentException if type is invalid. +
+ + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
+                Target  ::= CHOICE {
+                  targetName          [0] GeneralName,
+                  targetGroup         [1] GeneralName,
+                  targetCert          [2] TargetCert
+                }
+            
+ + @return an Asn1Object +
+ + @return Returns the targetGroup. + + + @return Returns the targetName. + + + Target information extension for attributes certificates according to RFC + 3281. + +
+                      SEQUENCE OF Targets
+            
+ +
+ + Creates an instance of a TargetInformation from the given object. +

+ obj can be a TargetInformation or a {@link Asn1Sequence}

+ + @param obj The object. + @return A TargetInformation instance. + @throws ArgumentException if the given object cannot be interpreted as TargetInformation. +
+ + Constructor from a Asn1Sequence. + + @param seq The Asn1Sequence. + @throws ArgumentException if the sequence does not contain + correctly encoded Targets elements. + + + Returns the targets in this target information extension. +

+ The ArrayList is cloned before it is returned.

+ + @return Returns the targets. +
+ + Constructs a target information from a single targets element. + According to RFC 3281 only one targets element must be produced. + + @param targets A Targets instance. + + + According to RFC 3281 only one targets element must be produced. If + multiple targets are given they must be merged in + into one targets element. + + @param targets An array with {@link Targets}. + + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
+                     SEQUENCE OF Targets
+            
+ +

+ According to RFC 3281 only one targets element must be produced. If + multiple targets are given in the constructor they are merged into one + targets element. If this was produced from a + {@link Org.BouncyCastle.Asn1.Asn1Sequence} the encoding is kept.

+ + @return an Asn1Object +
+ + Targets structure used in target information extension for attribute + certificates from RFC 3281. + +
+                       Targets ::= SEQUENCE OF Target
+                      
+                       Target  ::= CHOICE {
+                         targetName          [0] GeneralName,
+                         targetGroup         [1] GeneralName,
+                         targetCert          [2] TargetCert
+                       }
+                      
+                       TargetCert  ::= SEQUENCE {
+                         targetCertificate    IssuerSerial,
+                         targetName           GeneralName OPTIONAL,
+                         certDigestInfo       ObjectDigestInfo OPTIONAL
+                       }
+            
+ + @see org.bouncycastle.asn1.x509.Target + @see org.bouncycastle.asn1.x509.TargetInformation +
+ + Creates an instance of a Targets from the given object. +

+ obj can be a Targets or a {@link Asn1Sequence}

+ + @param obj The object. + @return A Targets instance. + @throws ArgumentException if the given object cannot be interpreted as Target. +
+ + Constructor from Asn1Sequence. + + @param targets The ASN.1 SEQUENCE. + @throws ArgumentException if the contents of the sequence are + invalid. + + + Constructor from given targets. +

+ The ArrayList is copied.

+ + @param targets An ArrayList of {@link Target}s. + @see Target + @throws ArgumentException if the ArrayList contains not only Targets. +
+ + Returns the targets in an ArrayList. +

+ The ArrayList is cloned before it is returned.

+ + @return Returns the targets. +
+ + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
+                       Targets ::= SEQUENCE OF Target
+            
+ + @return an Asn1Object +
+ + The TbsCertificate object. +
+            TbsCertificate ::= Sequence {
+                 version          [ 0 ]  Version DEFAULT v1(0),
+                 serialNumber            CertificateSerialNumber,
+                 signature               AlgorithmIdentifier,
+                 issuer                  Name,
+                 validity                Validity,
+                 subject                 Name,
+                 subjectPublicKeyInfo    SubjectPublicKeyInfo,
+                 issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
+                 subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
+                 extensions        [ 3 ] Extensions OPTIONAL
+                 }
+            
+

+ Note: issuerUniqueID and subjectUniqueID are both deprecated by the IETF. This class + will parse them, but you really shouldn't be creating new ones.

+
+ + PKIX RFC-2459 - TbsCertList object. +
+            TbsCertList  ::=  Sequence  {
+                 version                 Version OPTIONAL,
+                                              -- if present, shall be v2
+                 signature               AlgorithmIdentifier,
+                 issuer                  Name,
+                 thisUpdate              Time,
+                 nextUpdate              Time OPTIONAL,
+                 revokedCertificates     Sequence OF Sequence  {
+                      userCertificate         CertificateSerialNumber,
+                      revocationDate          Time,
+                      crlEntryExtensions      Extensions OPTIONAL
+                                                    -- if present, shall be v2
+                                           }  OPTIONAL,
+                 crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
+                                                    -- if present, shall be v2
+                                           }
+            
+
+ + creates a time object from a given date - if the date is between 1950 + and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + is used. + + + + Return our time as DateTime. + + A date time. + + + Produce an object suitable for an Asn1OutputStream. +
+            Time ::= CHOICE {
+                        utcTime        UTCTime,
+                        generalTime    GeneralizedTime }
+            
+
+ + UserNotice class, used in + CertificatePolicies X509 extensions (in policy + qualifiers). +
+             UserNotice ::= Sequence {
+                  noticeRef        NoticeReference OPTIONAL,
+                  explicitText     DisplayText OPTIONAL}
+            
+             
+ + @see PolicyQualifierId + @see PolicyInformation +
+ + Creates a new UserNotice instance. + + @param noticeRef a NoticeReference value + @param explicitText a DisplayText value + + + Creates a new UserNotice instance. + + @param noticeRef a NoticeReference value + @param str the explicitText field as a string. + + + Creates a new UserNotice instance. +

Useful from reconstructing a UserNotice instance + from its encodable/encoded form. + + @param as an ASN1Sequence value obtained from either + calling @{link toASN1Object()} for a UserNotice + instance or from parsing it from a DER-encoded stream.

+
+ + Generator for Version 1 TbsCertificateStructures. +
+             TbsCertificate ::= Sequence {
+                  version          [ 0 ]  Version DEFAULT v1(0),
+                  serialNumber            CertificateSerialNumber,
+                  signature               AlgorithmIdentifier,
+                  issuer                  Name,
+                  validity                Validity,
+                  subject                 Name,
+                  subjectPublicKeyInfo    SubjectPublicKeyInfo,
+                  }
+             
+ +
+ + Generator for Version 2 AttributeCertificateInfo +
+             AttributeCertificateInfo ::= Sequence {
+                   version              AttCertVersion -- version is v2,
+                   holder               Holder,
+                   issuer               AttCertIssuer,
+                   signature            AlgorithmIdentifier,
+                   serialNumber         CertificateSerialNumber,
+                   attrCertValidityPeriod   AttCertValidityPeriod,
+                   attributes           Sequence OF Attr,
+                   issuerUniqueID       UniqueIdentifier OPTIONAL,
+                   extensions           Extensions OPTIONAL
+             }
+             
+ +
+ + @param attribute + + + Produce an object suitable for an Asn1OutputStream. +
+             V2Form ::= Sequence {
+                  issuerName            GeneralNames  OPTIONAL,
+                  baseCertificateID     [0] IssuerSerial  OPTIONAL,
+                  objectDigestInfo      [1] ObjectDigestInfo  OPTIONAL
+                    -- issuerName MUST be present in this profile
+                    -- baseCertificateID and objectDigestInfo MUST NOT
+                    -- be present in this profile
+             }
+            
+
+ + Generator for Version 2 TbsCertList structures. +
+              TbsCertList  ::=  Sequence  {
+                   version                 Version OPTIONAL,
+                                                -- if present, shall be v2
+                   signature               AlgorithmIdentifier,
+                   issuer                  Name,
+                   thisUpdate              Time,
+                   nextUpdate              Time OPTIONAL,
+                   revokedCertificates     Sequence OF Sequence  {
+                        userCertificate         CertificateSerialNumber,
+                        revocationDate          Time,
+                        crlEntryExtensions      Extensions OPTIONAL
+                                                      -- if present, shall be v2
+                                             }  OPTIONAL,
+                   crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
+                                                      -- if present, shall be v2
+                                             }
+             
+ + Note: This class may be subject to change +
+ + Generator for Version 3 TbsCertificateStructures. +
+             TbsCertificate ::= Sequence {
+                  version          [ 0 ]  Version DEFAULT v1(0),
+                  serialNumber            CertificateSerialNumber,
+                  signature               AlgorithmIdentifier,
+                  issuer                  Name,
+                  validity                Validity,
+                  subject                 Name,
+                  subjectPublicKeyInfo    SubjectPublicKeyInfo,
+                  issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
+                  subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
+                  extensions        [ 3 ] Extensions OPTIONAL
+                  }
+             
+ +
+ + an X509Certificate structure. +
+             Certificate ::= Sequence {
+                 tbsCertificate          TbsCertificate,
+                 signatureAlgorithm      AlgorithmIdentifier,
+                 signature               BIT STRING
+             }
+            
+
+ + The default converter for X509 DN entries when going from their + string value to ASN.1 strings. + + + * It turns out that the number of standard ways the fields in a DN should be + * encoded into their ASN.1 counterparts is rapidly approaching the + * number of machines on the internet. By default the X509Name class + * will produce UTF8Strings in line with the current recommendations (RFC 3280). + *

+ * An example of an encoder look like below: + *

+                 * public class X509DirEntryConverter
+                 *     : X509NameEntryConverter
+                 * {
+                 *     public Asn1Object GetConvertedValue(
+                 *         DerObjectIdentifier  oid,
+                 *         string               value)
+                 *     {
+                 *         if (str.Length() != 0 && str.charAt(0) == '#')
+                 *         {
+                 *             return ConvertHexEncoded(str, 1);
+                 *         }
+                 *         if (oid.Equals(EmailAddress))
+                 *         {
+                 *             return new DerIA5String(str);
+                 *         }
+                 *         else if (CanBePrintable(str))
+                 *         {
+                 *             return new DerPrintableString(str);
+                 *         }
+                 *         else if (CanBeUTF8(str))
+                 *         {
+                 *             return new DerUtf8String(str);
+                 *         }
+                 *         else
+                 *         {
+                 *             return new DerBmpString(str);
+                 *         }
+                 *     }
+                 * }
+            	 * 
+ *

+
+ + Convert an inline encoded hex string rendition of an ASN.1 + object back into its corresponding ASN.1 object. + + @param str the hex encoded object + @param off the index at which the encoding starts + @return the decoded object + + + return true if the passed in string can be represented without + loss as a PrintableString, false otherwise. + + + Convert the passed in string value into the appropriate ASN.1 + encoded object. + + @param oid the oid associated with the value in the DN. + @param value the value of the particular DN component. + @return the ASN.1 equivalent for the value. + + + Apply default conversion for the given value depending on the oid + and the character range of the value. + + @param oid the object identifier for the DN entry + @param value the value associated with it + @return the ASN.1 equivalent for the string value. + + + an object for the elements in the X.509 V3 extension block. + + + Convert the value of the passed in extension to an object. + The extension to parse. + The object the value string contains. + If conversion is not possible. + + + Subject Directory Attributes + + + Subject Key Identifier + + + Key Usage + + + Private Key Usage Period + + + Subject Alternative Name + + + Issuer Alternative Name + + + Basic Constraints + + + CRL Number + + + Reason code + + + Hold Instruction Code + + + Invalidity Date + + + Delta CRL indicator + + + Issuing Distribution Point + + + Certificate Issuer + + + Name Constraints + + + CRL Distribution Points + + + Certificate Policies + + + Policy Mappings + + + Authority Key Identifier + + + Policy Constraints + + + Extended Key Usage + + + Freshest CRL + + + Inhibit Any Policy + + + Authority Info Access + + + Subject Info Access + + + Logo Type + + + BiometricInfo + + + QCStatements + + + Audit identity extension in attribute certificates. + + + NoRevAvail extension in attribute certificates. + + + TargetInformation extension in attribute certificates. + + + Constructor from Asn1Sequence. + + the extensions are a list of constructed sequences, either with (Oid, OctetString) or (Oid, Boolean, OctetString) + + + constructor from a table of extensions. +

+ it's is assumed the table contains Oid/string pairs.

+
+ + Constructor from a table of extensions with ordering. +

+ It's is assumed the table contains Oid/string pairs.

+
+ + Constructor from two vectors + + @param objectIDs an ArrayList of the object identifiers. + @param values an ArrayList of the extension values. + + + constructor from a table of extensions. +

+ it's is assumed the table contains Oid/string pairs.

+
+ + Constructor from a table of extensions with ordering. +

+ It's is assumed the table contains Oid/string pairs.

+
+ + Constructor from two vectors + + @param objectIDs an ArrayList of the object identifiers. + @param values an ArrayList of the extension values. + + + return the extension represented by the object identifier + passed in. + + @return the extension if it's present, null otherwise. + + +
+                 Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
+            
+                 Extension         ::=   SEQUENCE {
+                    extnId            EXTENSION.&id ({ExtensionSet}),
+                    critical          BOOLEAN DEFAULT FALSE,
+                    extnValue         OCTET STRING }
+             
+
+ + return an Enumeration of the extension field's object ids. + + + Generator for X.509 extensions + + + Reset the generator + + + + Add an extension with the given oid and the passed in value to be included + in the OCTET STRING associated with the extension. + + OID for the extension. + True if critical, false otherwise. + The ASN.1 object to be included in the extension. + + + + Add an extension with the given oid and the passed in byte array to be wrapped + in the OCTET STRING associated with the extension. + + OID for the extension. + True if critical, false otherwise. + The byte array to be wrapped. + + + Generate an X509Extensions object based on the current state of the generator. + An X509Extensions object + + + Return true if there are no extension present in this generator. + True if empty, false otherwise + + +
+                 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
+            
+                 RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
+            
+                 AttributeTypeAndValue ::= SEQUENCE {
+                                               type  OBJECT IDENTIFIER,
+                                               value ANY }
+             
+
+ + country code - StringType(SIZE(2)) + + + organization - StringType(SIZE(1..64)) + + + organizational unit name - StringType(SIZE(1..64)) + + + Title + + + common name - StringType(SIZE(1..64)) + + + street - StringType(SIZE(1..64)) + + + device serial number name - StringType(SIZE(1..64)) + + + locality name - StringType(SIZE(1..64)) + + + state, or province name - StringType(SIZE(1..64)) + + + Naming attributes of type X520name + + + businessCategory - DirectoryString(SIZE(1..128) + + + postalCode - DirectoryString(SIZE(1..40) + + + dnQualifier - DirectoryString(SIZE(1..64) + + + RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) + + + RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z + + + RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) + + + RFC 3039 DateOfBirth - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" + + + RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + codes only + + + RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + codes only + + + ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) + + + RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF + DirectoryString(SIZE(1..30)) + + + RFC 2256 dmdName + + + id-at-telephoneNumber + + + id-at-name + + + Email address (RSA PKCS#9 extension) - IA5String. +

Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.

+
+ + more from PKCS#9 + + + email address in Verisign certificates + + + LDAP User id. + + + default look up table translating OID values into their common symbols following + the convention in RFC 2253 with a few extras + + + look up table translating OID values into their common symbols following the convention in RFC 2253 + + + look up table translating OID values into their common symbols following the convention in RFC 1779 + + + + look up table translating common symbols into their OIDS. + + + Return a X509Name based on the passed in tagged object. + + @param obj tag object holding name. + @param explicitly true if explicitly tagged false otherwise. + @return the X509Name + + + Constructor from Asn1Sequence + + the principal will be a list of constructed sets, each containing an (OID, string) pair. + + + Constructor from a table of attributes with ordering. +

+ it's is assumed the table contains OID/string pairs, and the contents + of the table are copied into an internal table as part of the + construction process. The ordering ArrayList should contain the OIDs + in the order they are meant to be encoded or printed in ToString.

+
+ + Constructor from a table of attributes with ordering. +

+ it's is assumed the table contains OID/string pairs, and the contents + of the table are copied into an internal table as part of the + construction process. The ordering ArrayList should contain the OIDs + in the order they are meant to be encoded or printed in ToString.

+

+ The passed in converter will be used to convert the strings into their + ASN.1 counterparts.

+
+ + Takes two vectors one of the oids and the other of the values. + + + Takes two vectors one of the oids and the other of the values. +

+ The passed in converter will be used to convert the strings into their + ASN.1 counterparts.

+
+ + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes with each + string value being converted to its associated ASN.1 type using the passed + in converter. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. If reverse + is true, create the encoded version of the sequence starting from the + last element in the string. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes with each + string value being converted to its associated ASN.1 type using the passed + in converter. If reverse is true the ASN.1 sequence representing the DN will + be built by starting at the end of the string, rather than the start. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. lookUp + should provide a table of lookups, indexed by lowercase only strings and + yielding a DerObjectIdentifier, other than that OID. and numeric oids + will be processed automatically. +
+ If reverse is true, create the encoded version of the sequence + starting from the last element in the string. + @param reverse true if we should start scanning from the end (RFC 2553). + @param lookUp table of names and their oids. + @param dirName the X.500 string to be parsed. +
+ + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. lookUp + should provide a table of lookups, indexed by lowercase only strings and + yielding a DerObjectIdentifier, other than that OID. and numeric oids + will be processed automatically. The passed in converter is used to convert the + string values to the right of each equals sign to their ASN.1 counterparts. +
+ @param reverse true if we should start scanning from the end, false otherwise. + @param lookUp table of names and oids. + @param dirName the string dirName + @param converter the converter to convert string values into their ASN.1 equivalents +
+ + return an IList of the oids in the name, in the order they were found. + + + return an IList of the values found in the name, in the order they + were found. + + + return an IList of the values found in the name, in the order they + were found, with the DN label corresponding to passed in oid. + + + The X509Name object to test equivalency against. + If true, the order of elements must be the same, + as well as the values associated with each element. + + + test for equivalence - note: case is ignored. + + + convert the structure to a string - if reverse is true the + oids and values are listed out starting with the last element + in the sequence (ala RFC 2253), otherwise the string will begin + with the first element of the structure. If no string definition + for the oid is found in oidSymbols the string value of the oid is + added. Two standard symbol tables are provided DefaultSymbols, and + RFC2253Symbols as part of this class. + + @param reverse if true start at the end of the sequence and work back. + @param oidSymbols look up table strings for oids. + + + determines whether or not strings should be processed and printed + from back to front. + + + class for breaking up an X500 Name into it's component tokens, ala + java.util.StringTokenizer. We need this class as some of the + lightweight Java environment don't support classes like + StringTokenizer. + + + A general class that reads all X9.62 style EC curve tables. + + + return a X9ECParameters object representing the passed in named + curve. The routine returns null if the curve is not present. + + @param name the name of the curve requested + @return an X9ECParameters object or null if the curve is not available. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return a X9ECParameters object representing the passed in named + curve. + + @param oid the object id of the curve requested + @return an X9ECParameters object or null if the curve is not available. + + + return an enumeration of the names of the available curves. + + @return an enumeration of the names of the available curves. + + + ASN.1 def for Diffie-Hellman key exchange KeySpecificInfo structure. See + RFC 2631, or X9.42, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
+             KeySpecificInfo ::= Sequence {
+                 algorithm OBJECT IDENTIFIER,
+                 counter OCTET STRING SIZE (4..4)
+             }
+            
+
+ + ANS.1 def for Diffie-Hellman key exchange OtherInfo structure. See + RFC 2631, or X9.42, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
+             OtherInfo ::= Sequence {
+                 keyInfo KeySpecificInfo,
+                 partyAInfo [0] OCTET STRING OPTIONAL,
+                 suppPubInfo [2] OCTET STRING
+             }
+            
+
+ + table of the current named curves defined in X.962 EC-DSA. + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + Produce an object suitable for an Asn1OutputStream. +
+            Parameters ::= CHOICE {
+               ecParameters ECParameters,
+               namedCurve   CURVES.&id({CurveNames}),
+               implicitlyCA Null
+            }
+            
+
+ + ASN.1 def for Elliptic-Curve Curve structure. See + X9.62, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
+             Curve ::= Sequence {
+                 a               FieldElement,
+                 b               FieldElement,
+                 seed            BIT STRING      OPTIONAL
+             }
+            
+
+ + ASN.1 def for Elliptic-Curve ECParameters structure. See + X9.62, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
+             ECParameters ::= Sequence {
+                 version         Integer { ecpVer1(1) } (ecpVer1),
+                 fieldID         FieldID {{FieldTypes}},
+                 curve           X9Curve,
+                 base            X9ECPoint,
+                 order           Integer,
+                 cofactor        Integer OPTIONAL
+             }
+            
+
+ + Return the ASN.1 entry representing the Curve. + + @return the X9Curve for the curve in these parameters. + + + Return the ASN.1 entry representing the FieldID. + + @return the X9FieldID for the FieldID in these parameters. + + + Return the ASN.1 entry representing the base point G. + + @return the X9ECPoint for the base point in these parameters. + + + class for describing an ECPoint as a Der object. + + + Produce an object suitable for an Asn1OutputStream. +
+             ECPoint ::= OCTET STRING
+            
+

+ Octet string produced using ECPoint.GetEncoded().

+
+ + Class for processing an ECFieldElement as a DER object. + + + Produce an object suitable for an Asn1OutputStream. +
+             FieldElement ::= OCTET STRING
+            
+

+

    +
  1. if q is an odd prime then the field element is + processed as an Integer and converted to an octet string + according to x 9.62 4.3.1.
  2. +
  3. if q is 2m then the bit string + contained in the field element is converted into an octet + string with the same ordering padded at the front if necessary. +
  4. +
+

+
+ + ASN.1 def for Elliptic-Curve Field ID structure. See + X9.62, for further details. + + + Constructor for elliptic curves over prime fields + F2. + @param primeP The prime p defining the prime field. + + + Constructor for elliptic curves over binary fields + F2m. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk1 + 1 + represents the reduction polynomial f(z). + + + Constructor for elliptic curves over binary fields + F2m. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).. + + + Produce a Der encoding of the following structure. +
+             FieldID ::= Sequence {
+                 fieldType       FIELD-ID.&id({IOSet}),
+                 parameters      FIELD-ID.&Type({IOSet}{@fieldType})
+             }
+            
+
+ + id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) + us(840) x9-57 (10040) x9cm(4) 3 } + + + X9.63 + + + X9.42 + + + reader for Base64 armored objects - read the headers and then start returning + bytes when the data is reached. An IOException is thrown if the CRC check + fails. + + + decode the base 64 encoded input data. + + @return the offset the data starts in out. + + + Create a stream for reading a PGP armoured message, parsing up to a header + and then reading the data that follows. + + @param input + + + Create an armoured input stream which will assume the data starts + straight away, or parse for headers first depending on the value of + hasHeaders. + + @param input + @param hasHeaders true if headers are to be looked for, false otherwise. + + + @return true if we are inside the clear text section of a PGP + signed message. + + + @return true if the stream is actually at end of file. + + + Return the armor header line (if there is one) + @return the armor header line, null if none present. + + + Return the armor headers (the lines after the armor header line), + @return an array of armor headers, null if there aren't any. + + + Basic output stream. + + + encode the input data producing a base 64 encoded byte array. + + + Set an additional header entry. + + @param name the name of the header entry. + @param v the value of the header entry. + + + Reset the headers to only contain a Version string. + + + Start a clear text signed message. + @param hashAlgorithm + + + Note: Close() does not close the underlying stream. So it is possible to write + multiple objects using armoring to a single stream. + + + Basic type for a image attribute packet. + + + Basic type for a user attribute sub-packet. + + + return the generic data making up the packet. + + + Reader for PGP objects. + + + Returns the next packet tag in the stream. + + + + A stream that overlays our input stream, allowing the user to only read a segment of it. + NB: dataLength will be negative if the segment length is in the upper range above 2**31. + + + + Base class for a PGP object. + + + Basic output stream. + + + Create a stream representing a general packet. + Output stream to write to. + + + Create a stream representing an old style partial object. + Output stream to write to. + The packet tag for the object. + + + Create a stream representing a general packet. + Output stream to write to. + Packet tag. + Size of chunks making up the packet. + If true, the header is written out in old format. + + + Create a new style partial input stream buffered into chunks. + Output stream to write to. + Packet tag. + Size of chunks making up the packet. + + + Create a new style partial input stream buffered into chunks. + Output stream to write to. + Packet tag. + Buffer to use for collecting chunks. + + + Flush the underlying stream. + + + Finish writing out the current packet without closing the underlying stream. + + + Generic compressed data object. + + + Note: you can only read from this once... + + + The algorithm tag value. + + + Basic tags for compression algorithms. + + + Basic type for a PGP packet. + + + Base class for a DSA public key. + + + Base interface for a PGP key. + + + + The base format for this key - in the case of the symmetric keys it will generally + be raw indicating that the key is just a straight byte representation, for an asymmetric + key the format will be PGP, indicating the key is a string of MPIs encoded in PGP format. + + "RAW" or "PGP". + + + The stream to read the packet from. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for a DSA secret key. + + + @param in + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + @return x + + + Base class for an ECDH Public Key. + + + Base class for an EC Public Key. + + + The stream to read the packet from. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + The stream to read the packet from. + + + Base class for an ECDSA Public Key. + + + The stream to read the packet from. + + + Base class for an EC Secret Key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an ElGamal public key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an ElGamal secret key. + + + @param in + + + @param x + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Basic packet for an experimental packet. + + + Basic tags for hash algorithms. + + + Generic literal data packet. + + + The format tag value. + + + The modification time of the file in milli-seconds (since Jan 1, 1970 UTC) + + + Basic type for a marker packet. + + + Basic packet for a modification detection code packet. + + + A multiple precision integer + + + Generic signature object + + + The encryption algorithm tag. + + + The hash algorithm tag. + + + Basic PGP packet tag types. + + + Public Key Algorithm tag numbers. + + + Basic packet for a PGP public key. + + + Basic packet for a PGP public key. + + + Construct a version 4 public key packet. + + + Basic packet for a PGP public subkey + + + Construct a version 4 public subkey packet. + + + Base class for an RSA public key. + + + Construct an RSA public key from the passed in stream. + + + The modulus. + The public exponent. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an RSA secret (or priate) key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + The string to key specifier class. + + + The IV for the key generation algorithm. + + + The hash algorithm. + + + The iteration count + + + The protection mode - only if GnuDummyS2K + + + Basic packet for a PGP secret key. + + + Basic packet for a PGP secret key. + + + Generic signature packet. + + + Generate a version 4 signature packet. + + @param signatureType + @param keyAlgorithm + @param hashAlgorithm + @param hashedData + @param unhashedData + @param fingerprint + @param signature + + + Generate a version 2/3 signature packet. + + @param signatureType + @param keyAlgorithm + @param hashAlgorithm + @param fingerprint + @param signature + + + return the signature trailer that must be included with the data + to reconstruct the signature + + @return byte[] + + + * return the signature as a set of integers - note this is normalised to be the + * ASN.1 encoding of what appears in the signature packet. + + + Return the byte encoding of the signature section. + @return uninterpreted signature bytes. + + + return the keyId + @return the keyId that created the signature. + + + Return the creation time in milliseconds since 1 Jan., 1970 UTC. + + + Basic type for a PGP Signature sub-packet. + + + Return the generic data making up the packet. + + + reader for signature sub-packets + + + Basic PGP signature sub-packet tag types. + + + Packet embedded signature + + + packet giving signature creation time. + + + packet giving signature expiration time. + + + Identifier for the modification detection feature + + + Returns if a particular feature is supported. + + + Sets support for a particular feature. + + + Returns if modification detection is supported. + + + packet giving signature creation time. + + + packet giving time after creation at which the key expires. + + + Return the number of seconds after creation time a key is valid for. + + @return second count for key validity. + + + Packet holding the key flag values. + + + + Return the flag values contained in the first 4 octets (note: at the moment + the standard only uses the first one). + + + + Class provided a NotationData object according to + RFC2440, Chapter 5.2.3.15. Notation Data + + + packet giving signature creation time. + + + packet giving whether or not the signature is signed using the primary user ID for the key. + + + packet giving whether or not is revocable. + + + + Represents revocation key OpenPGP signature sub packet. + + + + + Represents revocation reason OpenPGP signature sub packet. + + + + packet giving signature creation time. + + + packet giving signature expiration time. + + + return time in seconds before signature expires after creation time. + + + packet giving the User ID of the signer. + + + packet giving trust. + + + Basic type for a symmetric key encrypted packet. + + + Basic tags for symmetric key algorithms + + + Basic type for a symmetric encrypted session key packet + + + @return byte[] + + + @return int + + + @return S2k + + + @return int + + + Basic type for a trust packet. + + + Basic type for a user attribute packet. + + + reader for user attribute sub-packets + + + Basic PGP user attribute sub-packet tag types. + + + Basic type for a user ID packet. + + + Base class for both the compress and decompress classes. + Holds common arrays, and static data. + + @author Keiron Liddle + + + An input stream that decompresses from the BZip2 format (with the file + header chars) to be read as any other stream. + + @author Keiron Liddle + + NB: note this class has been modified to read the leading BZ from the + start of the BZIP2 stream to make it compatible with other PGP programs. + + + An output stream that compresses into the BZip2 format (with the file + header chars) into another stream. + + @author Keiron Liddle + + TODO: Update to BZip2 1.0.1 + NB: note this class has been modified to add a leading BZ to the + start of the BZIP2 stream to make it compatible with other PGP programs. + + + + modified by Oliver Merkel, 010128 + + + + A simple class the hold and calculate the CRC for sanity checking + of the data. + + @author Keiron Liddle + + + + The 'Signature' parameter is only available when generating unsigned attributes. + + + + containing class for an CMS Authenticated Data object + + + return a store of the intended recipients for this message + + + return a table of the digested attributes indexed by + the OID of the attribute. + + + return a table of the undigested attributes indexed by + the OID of the attribute. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier for the content MAC algorithm. + + + return the ContentInfo + + + General class for generating a CMS authenticated-data message. + + A simple example of usage. + +
+                  CMSAuthenticatedDataGenerator  fact = new CMSAuthenticatedDataGenerator();
+            
+                  fact.addKeyTransRecipient(cert);
+            
+                  CMSAuthenticatedData         data = fact.generate(content, algorithm, "BC");
+             
+
+ + General class for generating a CMS enveloped-data message. + + A simple example of usage. + +
+                  CMSEnvelopedDataGenerator  fact = new CMSEnvelopedDataGenerator();
+            
+                  fact.addKeyTransRecipient(cert);
+            
+                  CMSEnvelopedData         data = fact.generate(content, algorithm, "BC");
+             
+
+ + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + add a recipient. + + @param cert recipient's public key certificate + @exception ArgumentException if there is a problem with the certificate + + + add a recipient + + @param key the public key used by the recipient + @param subKeyId the identifier for the recipient's public key + @exception ArgumentException if there is a problem with the key + + + add a KEK recipient. + @param key the secret key to use for wrapping + @param keyIdentifier the byte string that identifies the key + + + add a KEK recipient. + @param key the secret key to use for wrapping + @param keyIdentifier the byte string that identifies the key + + + Add a key agreement based recipient. + + @param agreementAlgorithm key agreement algorithm to use. + @param senderPrivateKey private key to initialise sender side of agreement with. + @param senderPublicKey sender public key to include with message. + @param recipientCert recipient's public key certificate. + @param cekWrapAlgorithm OID for key wrapping algorithm to use. + @exception SecurityUtilityException if the algorithm requested cannot be found + @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + + + Add multiple key agreement based recipients (sharing a single KeyAgreeRecipientInfo structure). + + @param agreementAlgorithm key agreement algorithm to use. + @param senderPrivateKey private key to initialise sender side of agreement with. + @param senderPublicKey sender public key to include with message. + @param recipientCerts recipients' public key certificates. + @param cekWrapAlgorithm OID for key wrapping algorithm to use. + @exception SecurityUtilityException if the algorithm requested cannot be found + @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + + + base constructor + + + constructor allowing specific source of randomness + + @param rand instance of SecureRandom to use + + + base constructor + + + constructor allowing specific source of randomness + @param rand instance of SecureRandom to use + + + generate an enveloped object that contains an CMS Enveloped Data + object using the given provider and the passed in key generator. + + + generate an authenticated object that contains an CMS Authenticated Data object + + + Parsing class for an CMS Authenticated Data object from an input stream. +

+ Note: that because we are in a streaming mode only one recipient can be tried and it is important + that the methods on the parser are called in the appropriate order. +

+

+ Example of use - assuming the first recipient matches the private key we have. +

+                  CMSAuthenticatedDataParser     ad = new CMSAuthenticatedDataParser(inputStream);
+            
+                  RecipientInformationStore  recipients = ad.getRecipientInfos();
+            
+                  Collection  c = recipients.getRecipients();
+                  Iterator    it = c.iterator();
+            
+                  if (it.hasNext())
+                  {
+                      RecipientInformation   recipient = (RecipientInformation)it.next();
+            
+                      CMSTypedStream recData = recipient.getContentStream(privateKey, "BC");
+            
+                      processDataStream(recData.getContentStream());
+            
+                      if (!Arrays.equals(ad.getMac(), recipient.getMac())
+                      {
+                          System.err.println("Data corrupted!!!!");
+                      }
+                  }
+              
+ Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
+                      CMSAuthenticatedDataParser     ep = new CMSAuthenticatedDataParser(new BufferedInputStream(inputStream, bufSize));
+              
+ where bufSize is a suitably large buffer size. +

+
+ + Close the underlying data stream. + @throws IOException if the close fails. + + + return a store of the intended recipients for this message + + + return a table of the unauthenticated attributes indexed by + the OID of the attribute. + @exception java.io.IOException + + + return a table of the unauthenticated attributes indexed by + the OID of the attribute. + @exception java.io.IOException + + + return the object identifier for the mac algorithm. + + + return the ASN.1 encoded encryption algorithm parameters, or null if + there aren't any. + + + General class for generating a CMS authenticated-data message stream. +

+ A simple example of usage. +

+                  CMSAuthenticatedDataStreamGenerator edGen = new CMSAuthenticatedDataStreamGenerator();
+            
+                  edGen.addKeyTransRecipient(cert);
+            
+                  ByteArrayOutputStream  bOut = new ByteArrayOutputStream();
+            
+                  OutputStream out = edGen.open(
+                                          bOut, CMSAuthenticatedDataGenerator.AES128_CBC, "BC");*
+                  out.write(data);
+            
+                  out.close();
+             
+

+
+ + base constructor + + + constructor allowing specific source of randomness + @param rand instance of SecureRandom to use + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + Use a BER Set to store the recipient information + + + generate an enveloped object that contains an CMS Enveloped Data + object using the given provider and the passed in key generator. + @throws java.io.IOException + + + generate an enveloped object that contains an CMS Enveloped Data object + + + generate an enveloped object that contains an CMS Enveloped Data object + + + containing class for an CMS AuthEnveloped Data object + + + containing class for an CMS Compressed Data object + + + Return the uncompressed content. + + @return the uncompressed content + @throws CmsException if there is an exception uncompressing the data. + + + Return the uncompressed content, throwing an exception if the data size + is greater than the passed in limit. If the content is exceeded getCause() + on the CMSException will contain a StreamOverflowException + + @param limit maximum number of bytes to read + @return the content read + @throws CMSException if there is an exception uncompressing the data. + + + return the ASN.1 encoded representation of this object. + + + return the ContentInfo + + + * General class for generating a compressed CMS message. + *

+ * A simple example of usage.

+ *

+ *

+                *      CMSCompressedDataGenerator fact = new CMSCompressedDataGenerator();
+                *      CMSCompressedData data = fact.Generate(content, algorithm);
+                * 
+ *

+
+ + Generate an object that contains an CMS Compressed Data + + + Class for reading a CMS Compressed Data stream. +
+                 CMSCompressedDataParser cp = new CMSCompressedDataParser(inputStream);
+            
+                 process(cp.GetContent().GetContentStream());
+             
+ Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
+                  CMSCompressedDataParser     ep = new CMSCompressedDataParser(new BufferedInputStream(inputStream, bufSize));
+              
+ where bufSize is a suitably large buffer size. +
+ + General class for generating a compressed CMS message stream. +

+ A simple example of usage. +

+
+                  CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator();
+            
+                  Stream cOut = gen.Open(outputStream, CMSCompressedDataStreamGenerator.ZLIB);
+            
+                  cOut.Write(data);
+            
+                  cOut.Close();
+             
+
+ + base constructor + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + containing class for an CMS Enveloped Data object + + + return a store of the intended recipients for this message + + + return a table of the unprotected attributes indexed by + the OID of the attribute. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier for the content encryption algorithm. + + + return the ContentInfo + + + + General class for generating a CMS enveloped-data message. + + A simple example of usage. + +
+                  CmsEnvelopedDataGenerator  fact = new CmsEnvelopedDataGenerator();
+            
+                  fact.AddKeyTransRecipient(cert);
+            
+                  CmsEnvelopedData         data = fact.Generate(content, algorithm);
+             
+
+
+ + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + + Generate an enveloped object that contains a CMS Enveloped Data + object using the passed in key generator. + + + + Generate an enveloped object that contains an CMS Enveloped Data object. + + + Generate an enveloped object that contains an CMS Enveloped Data object. + + + Parsing class for an CMS Enveloped Data object from an input stream. +

+ Note: that because we are in a streaming mode only one recipient can be tried and it is important + that the methods on the parser are called in the appropriate order. +

+

+ Example of use - assuming the first recipient matches the private key we have. +

+                  CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(inputStream);
+            
+                  RecipientInformationStore  recipients = ep.GetRecipientInfos();
+            
+                  Collection  c = recipients.getRecipients();
+                  Iterator    it = c.iterator();
+            
+                  if (it.hasNext())
+                  {
+                      RecipientInformation   recipient = (RecipientInformation)it.next();
+            
+                      CMSTypedStream recData = recipient.getContentStream(privateKey);
+            
+                      processDataStream(recData.getContentStream());
+                  }
+              
+ Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
+                      CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(new BufferedInputStream(inputStream, bufSize));
+              
+ where bufSize is a suitably large buffer size. +

+
+ + return a store of the intended recipients for this message + + + return a table of the unprotected attributes indexed by + the OID of the attribute. + @throws IOException + + + return the object identifier for the content encryption algorithm. + + + return the ASN.1 encoded encryption algorithm parameters, or null if + there aren't any. + + + General class for generating a CMS enveloped-data message stream. +

+ A simple example of usage. +

+                  CmsEnvelopedDataStreamGenerator edGen = new CmsEnvelopedDataStreamGenerator();
+            
+                  edGen.AddKeyTransRecipient(cert);
+            
+                  MemoryStream  bOut = new MemoryStream();
+            
+                  Stream out = edGen.Open(
+                                          bOut, CMSEnvelopedDataGenerator.AES128_CBC);*
+                  out.Write(data);
+            
+                  out.Close();
+             
+

+
+ + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Set the underlying string size for encapsulated data. + Length of octet strings to buffer the data. + + + Use a BER Set to store the recipient information. + + + + Generate an enveloped object that contains an CMS Enveloped Data + object using the passed in key generator. + + + + generate an enveloped object that contains an CMS Enveloped Data object + @throws IOException + + + generate an enveloped object that contains an CMS Enveloped Data object + @throws IOException + + + all parameter classes implement this. + + + + Generic routine to copy out the data we want processed. + + + This routine may be called multiple times. + + + + a holding class for a byte array of data to be processed. + + + A clone of the byte array + + + a holding class for a file of data to be processed. + + + The file handle + + + general class for handling a pkcs7-signature message. + + A simple example of usage - note, in the example below the validity of + the certificate isn't verified, just the fact that one of the certs + matches the given signer... + +
+              IX509Store              certs = s.GetCertificates();
+              SignerInformationStore  signers = s.GetSignerInfos();
+            
+              foreach (SignerInformation signer in signers.GetSigners())
+              {
+                  ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
+                  X509Certificate cert = (X509Certificate) certList[0];
+            
+                  if (signer.Verify(cert.GetPublicKey()))
+                  {
+                      verified++;
+                  }
+              }
+             
+
+ + Content with detached signature, digests precomputed + + @param hashes a map of precomputed digests for content indexed by name of hash. + @param sigBlock the signature object. + + + base constructor - content with detached signature. + + @param signedContent the content that was signed. + @param sigData the signature object. + + + base constructor - with encapsulated content + + + return the collection of signers that are associated with the + signatures for the message. + + + return a X509Store containing the attribute certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of attribute certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing the public key certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of public key certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing CRLs, if any, contained + in this message. + + @param type type of store to create + @return a store of CRLs + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return the ASN.1 encoded representation of this object. + + + Replace the signerinformation store associated with this + CmsSignedData object with the new one passed in. You would + probably only want to do this if you wanted to change the unsigned + attributes associated with a signer, or perhaps delete one. + + @param signedData the signed data object to be used as a base. + @param signerInformationStore the new signer information store to use. + @return a new signed data object. + + + Replace the certificate and CRL information associated with this + CmsSignedData object with the new one passed in. + + @param signedData the signed data object to be used as a base. + @param x509Certs the new certificates to be used. + @param x509Crls the new CRLs to be used. + @return a new signed data object. + @exception CmsException if there is an error processing the stores + + + Return the version number for this object. + + + + Return the DerObjectIdentifier associated with the encapsulated + content info structure carried in the signed data. + + + + return the ContentInfo + + + * general class for generating a pkcs7-signature message. + *

+ * A simple example of usage. + * + *

+                 *      IX509Store certs...
+                 *      IX509Store crls...
+                 *      CmsSignedDataGenerator gen = new CmsSignedDataGenerator();
+                 *
+                 *      gen.AddSigner(privKey, cert, CmsSignedGenerator.DigestSha1);
+                 *      gen.AddCertificates(certs);
+                 *      gen.AddCrls(crls);
+                 *
+                 *      CmsSignedData data = gen.Generate(content);
+                 * 
+ *

+
+ + Default type for the signed data. + + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Add the attribute certificates contained in the passed in store to the + generator. + + @param store a store of Version 2 attribute certificates + @throws CmsException if an error occurse processing the store. + + + Add a store of precalculated signers to the generator. + + @param signerStore store of signers + + + Return a map of oids and byte arrays representing the digests calculated on the content during + the last generate. + + @return a map of oids (as String objects) and byte[] representing digests. + + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + * add a signer - no attributes other than the default ones will be + * provided here. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + + + add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + provided here. + + @param key signing key to use + @param cert certificate containing corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + + + add a signer - no attributes other than the default ones will be + provided here. + + + add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + provided here. + + + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + + @param key signing key to use + @param cert certificate containing corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + @param signedAttr table of attributes to be included in signature + @param unsignedAttr table of attributes to be included as unsigned + + + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param subjectKeyID subjectKeyID of corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + + @param key signing key to use + @param subjectKeyID subjectKeyID of corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + @param signedAttr table of attributes to be included in signature + @param unsignedAttr table of attributes to be included as unsigned + + + add a signer with extra signed/unsigned attributes based on generators. + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes based on generators. + + + add a signer with extra signed/unsigned attributes based on generators. + + + add a signer, including digest encryption algorithm, with extra signed/unsigned attributes based on generators. + + + generate a signed object that for a CMS Signed Data object + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". + + + generate a set of one or more SignerInformation objects representing counter signatures on + the passed in SignerInformation object. + + @param signer the signer to be countersigned + @param sigProvider the provider to be used for counter signing. + @return a store containing the signers. + + + Parsing class for an CMS Signed Data object from an input stream. +

+ Note: that because we are in a streaming mode only one signer can be tried and it is important + that the methods on the parser are called in the appropriate order. +

+

+ A simple example of usage for an encapsulated signature. +

+

+ Two notes: first, in the example below the validity of + the certificate isn't verified, just the fact that one of the certs + matches the given signer, and, second, because we are in a streaming + mode the order of the operations is important. +

+
+                  CmsSignedDataParser     sp = new CmsSignedDataParser(encapSigData);
+            
+                  sp.GetSignedContent().Drain();
+            
+                  IX509Store              certs = sp.GetCertificates();
+                  SignerInformationStore  signers = sp.GetSignerInfos();
+            
+                  foreach (SignerInformation signer in signers.GetSigners())
+                  {
+                      ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
+                      X509Certificate cert = (X509Certificate) certList[0];
+            
+                      Console.WriteLine("verify returns: " + signer.Verify(cert));
+                  }
+             
+ Note also: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
+                      CmsSignedDataParser     ep = new CmsSignedDataParser(new BufferedInputStream(encapSigData, bufSize));
+              
+ where bufSize is a suitably large buffer size. +
+ + base constructor - with encapsulated content + + + base constructor + + @param signedContent the content that was signed. + @param sigData the signature object. + + + return the collection of signers that are associated with the + signatures for the message. + @throws CmsException + + + return a X509Store containing the attribute certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of attribute certificates + @exception org.bouncycastle.x509.NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing the public key certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of public key certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing CRLs, if any, contained + in this message. + + @param type type of store to create + @return a store of CRLs + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + Replace the signerinformation store associated with the passed + in message contained in the stream original with the new one passed in. + You would probably only want to do this if you wanted to change the unsigned + attributes associated with a signer, or perhaps delete one. +

+ The output stream is returned unclosed. +

+ @param original the signed data stream to be used as a base. + @param signerInformationStore the new signer information store to use. + @param out the stream to Write the new signed data object to. + @return out. +
+ + Replace the certificate and CRL information associated with this + CMSSignedData object with the new one passed in. +

+ The output stream is returned unclosed. +

+ @param original the signed data stream to be used as a base. + @param certsAndCrls the new certificates and CRLs to be used. + @param out the stream to Write the new signed data object to. + @return out. + @exception CmsException if there is an error processing the CertStore +
+ + Return the version number for the SignedData object + + @return the version number + + + + Return the DerObjectIdentifier associated with the encapsulated + content info structure carried in the signed data. + + + + General class for generating a pkcs7-signature message stream. +

+ A simple example of usage. +

+
+                  IX509Store                   certs...
+                  CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator();
+            
+                  gen.AddSigner(privateKey, cert, CmsSignedDataStreamGenerator.DIGEST_SHA1);
+            
+                  gen.AddCertificates(certs);
+            
+                  Stream sigOut = gen.Open(bOut);
+            
+                  sigOut.Write(Encoding.UTF8.GetBytes("Hello World!"));
+            
+                  sigOut.Close();
+             
+
+ + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer, specifying the digest encryption algorithm - no attributes other than the default ones will be + provided here. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes - specifying digest + encryption algorithm. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + generate a signed object that for a CMS Signed Data object + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". + + + generate a signed object that for a CMS Signed Data + object using the given provider - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". If dataOutputStream is non null the data + being signed will be written to the stream as it is processed. + @param out stream the CMS object is to be written to. + @param encapsulate true if data should be encapsulated. + @param dataOutputStream output stream to copy the data being signed to. + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + + + generate a signed object that for a CMS Signed Data + object using the given provider - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + @param out stream the CMS object is to be written to. + @param signedContentType OID for data to be signed. + @param encapsulate true if data should be encapsulated. + @param dataOutputStream output stream to copy the data being signed to. + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + Return the digest encryption algorithm using one of the standard + JCA string representations rather than the algorithm identifier (if + possible). + + + Default authenticated attributes generator. + + + Initialise to use all defaults + + + Initialise with some extra attributes or overrides. + + @param attributeTable initial attribute table to use. + + + Create a standard attribute table from the passed in parameters - this will + normally include contentType and messageDigest. If the constructor + using an AttributeTable was used, entries in it for contentType and + messageDigest will override the generated ones. + + @param parameters source parameters for table generation. + + @return a filled in IDictionary of attributes. + + + @param parameters source parameters + @return the populated attribute table + + + Default signed attributes generator. + + + Initialise to use all defaults + + + Initialise with some extra attributes or overrides. + + @param attributeTable initial attribute table to use. + + + Create a standard attribute table from the passed in parameters - this will + normally include contentType, signingTime, and messageDigest. If the constructor + using an AttributeTable was used, entries in it for contentType, signingTime, and + messageDigest will override the generated ones. + + @param parameters source parameters for table generation. + + @return a filled in Hashtable of attributes. + + + @param parameters source parameters + @return the populated attribute table + + + + Generate a RecipientInfo object for the given key. + + + A + + + A + + + A + + + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using a secret key known to the other side. + + + Return the MAC calculated for the content stream. Note: this call is only meaningful once all + the content has been read. + + @return byte array containing the mac. + + + * return the object identifier for the key encryption algorithm. + * + * @return OID for key encryption algorithm. + + + * return the ASN.1 encoded key encryption algorithm parameters, or null if + * there aren't any. + * + * @return ASN.1 encoding of key encryption algorithm parameters. + + + decrypt the content and return an input stream. + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using key agreement. + + + decrypt the content and return an input stream. + + + the KeyTransRecipientInformation class for a recipient who has been sent a secret + key encrypted using their public key that needs to be used to + extract the message. + + + decrypt the content and return it as a byte array. + + + a basic index for an originator. + + + + An ISet of DerObjectIdentifier objects. + + + + Return the certificates stored in the underlying OriginatorInfo object. + + @return a Store of X509CertificateHolder objects. + + + Return the CRLs stored in the underlying OriginatorInfo object. + + @return a Store of X509CRLHolder objects. + + + Return the underlying ASN.1 object defining this SignerInformation object. + + @return a OriginatorInfo. + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using a password. + + + decrypt the content and return an input stream. + + + return the object identifier for the key derivation algorithm, or null + if there is none present. + + @return OID for key derivation algorithm, if present. + + + + PKCS5 scheme-2 - password converted to bytes assuming ASCII. + + + + PKCS5 scheme-2 - password converted to bytes using UTF-8. + + + Return the first RecipientInformation object that matches the + passed in selector. Null if there are no matches. + + @param selector to identify a recipient + @return a single RecipientInformation object. Null if none matches. + + + Return all recipients in the collection + + @return a collection of recipients. + + + Return possible empty collection with recipients matching the passed in RecipientID + + @param selector a recipient id to select against. + @return a collection of RecipientInformation objects. + + + Return the number of recipients in the collection. + + @return number of recipients identified. + + + a basic index for a signer. + + + If the passed in flag is true, the signer signature will be based on the data, not + a collection of signed attributes, and no signed attributes will be included. + + @return the builder object + + + Provide a custom signed attribute generator. + + @param signedGen a generator of signed attributes. + @return the builder object + + + Provide a generator of unsigned attributes. + + @param unsignedGen a generator for signed attributes. + @return the builder object + + + Build a generator with the passed in certHolder issuer and serial number as the signerIdentifier. + + @param contentSigner operator for generating the final signature in the SignerInfo with. + @param certHolder carrier for the X.509 certificate related to the contentSigner. + @return a SignerInfoGenerator + @throws OperatorCreationException if the generator cannot be built. + + + Build a generator with the passed in subjectKeyIdentifier as the signerIdentifier. If used you should + try to follow the calculation described in RFC 5280 section 4.2.1.2. + + @param signerFactory operator factory for generating the final signature in the SignerInfo with. + @param subjectKeyIdentifier key identifier to identify the public key for verifying the signature. + @return a SignerInfoGenerator + + + an expanded SignerInfo block from a CMS Signed message + + + return the content digest that was calculated during verification. + + + return the encoded signature + + + Return a SignerInformationStore containing the counter signatures attached to this + signer. If no counter signatures are present an empty store is returned. + + + return the DER encoding of the signed attributes. + @throws IOException if an encoding error occurs. + + + verify that the given public key successfully handles and confirms the + signature associated with this signer. + + + verify that the given certificate successfully handles and confirms + the signature associated with this signer and, if a signingTime + attribute is available, that the certificate was valid at the time the + signature was generated. + + + Return the base ASN.1 CMS structure that this object contains. + + @return an object containing a CMS SignerInfo structure. + + + Return a signer information object with the passed in unsigned + attributes replacing the ones that are current associated with + the object passed in. + + @param signerInformation the signerInfo to be used as the basis. + @param unsignedAttributes the unsigned attributes to add. + @return a copy of the original SignerInformationObject with the changed attributes. + + + Return a signer information object with passed in SignerInformationStore representing counter + signatures attached as an unsigned attribute. + + @param signerInformation the signerInfo to be used as the basis. + @param counterSigners signer info objects carrying counter signature. + @return a copy of the original SignerInformationObject with the changed attributes. + + + return the version number for this objects underlying SignerInfo structure. + + + return the object identifier for the signature. + + + return the signature parameters, or null if there aren't any. + + + return the object identifier for the signature. + + + return the signature/encryption algorithm parameters, or null if + there aren't any. + + + return a table of the signed attributes - indexed by + the OID of the attribute. + + + return a table of the unsigned attributes indexed by + the OID of the attribute. + + + Create a store containing a single SignerInformation object. + + @param signerInfo the signer information to contain. + + + Create a store containing a collection of SignerInformation objects. + + @param signerInfos a collection signer information objects to contain. + + + Return the first SignerInformation object that matches the + passed in selector. Null if there are no matches. + + @param selector to identify a signer + @return a single SignerInformation object. Null if none matches. + + + An ICollection of all signers in the collection + + + Return possible empty collection with signers matching the passed in SignerID + + @param selector a signer id to select against. + @return a collection of SignerInformation objects. + + + The number of signers in the collection. + + + Basic generator that just returns a preconstructed attribute table + + + a Diffie-Hellman key exchange engine. +

+ note: This uses MTI/A0 key agreement in order to make the key agreement + secure against passive attacks. If you're doing Diffie-Hellman and both + parties have long term public keys you should look at using this. For + further information have a look at RFC 2631.

+

+ It's possible to extend this to more than two parties as well, for the moment + that is left as an exercise for the reader.

+
+ + calculate our initial message. + + + given a message from a given party and the corresponding public key + calculate the next message in the agreement sequence. In this case + this will represent the shared secret. + + + a Diffie-Hellman key agreement class. +

+ note: This is only the basic algorithm, it doesn't take advantage of + long term public keys if they are available. See the DHAgreement class + for a "better" implementation.

+
+ + The basic interface that basic Diffie-Hellman implementations + conforms to. + + + initialise the agreement engine. + + + return the field size for the agreement algorithm in bytes. + + + given a public key from a given party calculate the next + message in the agreement sequence. + + + given a short term public key from a given party calculate the next + message in the agreement sequence. + + + Standard Diffie-Hellman groups from various IETF specifications. + + + P1363 7.2.1 ECSVDP-DH + + ECSVDP-DH is Elliptic Curve Secret Value Derivation Primitive, + Diffie-Hellman version. It is based on the work of [DH76], [Mil86], + and [Kob87]. This primitive derives a shared secret value from one + party's private key and another party's public key, where both have + the same set of EC domain parameters. If two parties correctly + execute this primitive, they will produce the same output. This + primitive can be invoked by a scheme to derive a shared secret key; + specifically, it may be used with the schemes ECKAS-DH1 and + DL/ECKAS-DH2. It assumes that the input keys are valid (see also + Section 7.2.2). + + + P1363 7.2.2 ECSVDP-DHC + + ECSVDP-DHC is Elliptic Curve Secret Value Derivation Primitive, + Diffie-Hellman version with cofactor multiplication. It is based on + the work of [DH76], [Mil86], [Kob87], [LMQ98] and [Kal98a]. This + primitive derives a shared secret value from one party's private key + and another party's public key, where both have the same set of EC + domain parameters. If two parties correctly execute this primitive, + they will produce the same output. This primitive can be invoked by a + scheme to derive a shared secret key; specifically, it may be used + with the schemes ECKAS-DH1 and DL/ECKAS-DH2. It does not assume the + validity of the input public key (see also Section 7.2.1). +

+ Note: As stated P1363 compatibility mode with ECDH can be preset, and + in this case the implementation doesn't have a ECDH compatibility mode + (if you want that just use ECDHBasicAgreement and note they both implement + BasicAgreement!).

+
+ + + A participant in a Password Authenticated Key Exchange by Juggling (J-PAKE) exchange. + + The J-PAKE exchange is defined by Feng Hao and Peter Ryan in the paper + + "Password Authenticated Key Exchange by Juggling, 2008." + + The J-PAKE protocol is symmetric. + There is no notion of a client or server, but rather just two participants. + An instance of JPakeParticipant represents one participant, and + is the primary interface for executing the exchange. + + To execute an exchange, construct a JPakeParticipant on each end, + and call the following 7 methods + (once and only once, in the given order, for each participant, sending messages between them as described): + + CreateRound1PayloadToSend() - and send the payload to the other participant + ValidateRound1PayloadReceived(JPakeRound1Payload) - use the payload received from the other participant + CreateRound2PayloadToSend() - and send the payload to the other participant + ValidateRound2PayloadReceived(JPakeRound2Payload) - use the payload received from the other participant + CalculateKeyingMaterial() + CreateRound3PayloadToSend(BigInteger) - and send the payload to the other participant + ValidateRound3PayloadReceived(JPakeRound3Payload, BigInteger) - use the payload received from the other participant + + Each side should derive a session key from the keying material returned by CalculateKeyingMaterial(). + The caller is responsible for deriving the session key using a secure key derivation function (KDF). + + Round 3 is an optional key confirmation process. + If you do not execute round 3, then there is no assurance that both participants are using the same key. + (i.e. if the participants used different passwords, then their session keys will differ.) + + If the round 3 validation succeeds, then the keys are guaranteed to be the same on both sides. + + The symmetric design can easily support the asymmetric cases when one party initiates the communication. + e.g. Sometimes the round1 payload and round2 payload may be sent in one pass. + Also, in some cases, the key confirmation payload can be sent together with the round2 payload. + These are the trivial techniques to optimize the communication. + + The key confirmation process is implemented as specified in + NIST SP 800-56A Revision 1, + Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + + This class is stateful and NOT threadsafe. + Each instance should only be used for ONE complete J-PAKE exchange + (i.e. a new JPakeParticipant should be constructed for each new J-PAKE exchange). + + + + + Convenience constructor for a new JPakeParticipant that uses + the JPakePrimeOrderGroups#NIST_3072 prime order group, + a SHA-256 digest, and a default SecureRandom implementation. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + + + + Convenience constructor for a new JPakeParticipant that uses + a SHA-256 digest, and a default SecureRandom implementation. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + Prime order group. See JPakePrimeOrderGroups for standard groups. + + + + Constructor for a new JPakeParticipant. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + Prime order group. See JPakePrimeOrderGroups for standard groups. + Digest to use during zero knowledge proofs and key confirmation + (SHA-256 or stronger preferred). + Source of secure random data for x1 and x2, and for the zero knowledge proofs. + + + + Creates and returns the payload to send to the other participant during round 1. + + After execution, the State state} will be STATE_ROUND_1_CREATED}. + + + + + Validates the payload received from the other participant during round 1. + + Must be called prior to CreateRound2PayloadToSend(). + + After execution, the State state will be STATE_ROUND_1_VALIDATED. + + Throws CryptoException if validation fails. Throws InvalidOperationException + if called multiple times. + + + + + Creates and returns the payload to send to the other participant during round 2. + + ValidateRound1PayloadReceived(JPakeRound1Payload) must be called prior to this method. + + After execution, the State state will be STATE_ROUND_2_CREATED. + + Throws InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + + + + + Validates the payload received from the other participant during round 2. + Note that this DOES NOT detect a non-common password. + The only indication of a non-common password is through derivation + of different keys (which can be detected explicitly by executing round 3 and round 4) + + Must be called prior to CalculateKeyingMaterial(). + + After execution, the State state will be STATE_ROUND_2_VALIDATED. + + Throws CryptoException if validation fails. Throws + InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + + + + + Calculates and returns the key material. + A session key must be derived from this key material using a secure key derivation function (KDF). + The KDF used to derive the key is handled externally (i.e. not by JPakeParticipant). + + The keying material will be identical for each participant if and only if + each participant's password is the same. i.e. If the participants do not + share the same password, then each participant will derive a different key. + Therefore, if you immediately start using a key derived from + the keying material, then you must handle detection of incorrect keys. + If you want to handle this detection explicitly, you can optionally perform + rounds 3 and 4. See JPakeParticipant for details on how to execute + rounds 3 and 4. + + The keying material will be in the range [0, p-1]. + + ValidateRound2PayloadReceived(JPakeRound2Payload) must be called prior to this method. + + As a side effect, the internal password array is cleared, since it is no longer needed. + + After execution, the State state will be STATE_KEY_CALCULATED. + + Throws InvalidOperationException if called prior to ValidateRound2PayloadReceived(JPakeRound2Payload), + or if called multiple times. + + + + + Creates and returns the payload to send to the other participant during round 3. + + See JPakeParticipant for more details on round 3. + + After execution, the State state} will be STATE_ROUND_3_CREATED. + Throws InvalidOperationException if called prior to CalculateKeyingMaterial, or multiple + times. + + The keying material as returned from CalculateKeyingMaterial(). + + + + Validates the payload received from the other participant during round 3. + + See JPakeParticipant for more details on round 3. + + After execution, the State state will be STATE_ROUND_3_VALIDATED. + + Throws CryptoException if validation fails. Throws InvalidOperationException if called prior to + CalculateKeyingMaterial or multiple times + + The round 3 payload received from the other participant. + The keying material as returned from CalculateKeyingMaterial(). + + + + Gets the current state of this participant. + See the STATE_* constants for possible values. + + + + + A pre-computed prime order group for use during a J-PAKE exchange. + + Typically a Schnorr group is used. In general, J-PAKE can use any prime order group + that is suitable for public key cryptography, including elliptic curve cryptography. + + See JPakePrimeOrderGroups for convenient standard groups. + + NIST publishes + many groups that can be used for the desired level of security. + + + + + Constructs a new JPakePrimeOrderGroup. + + In general, you should use one of the pre-approved groups from + JPakePrimeOrderGroups, rather than manually constructing one. + + The following basic checks are performed: + + p-1 must be evenly divisible by q + g must be in [2, p-1] + g^q mod p must equal 1 + p must be prime (within reasonably certainty) + q must be prime (within reasonably certainty) + + The prime checks are performed using BigInteger#isProbablePrime(int), + and are therefore subject to the same probability guarantees. + + These checks prevent trivial mistakes. + However, due to the small uncertainties if p and q are not prime, + advanced attacks are not prevented. + Use it at your own risk. + + Throws NullReferenceException if any argument is null. Throws + InvalidOperationException is any of the above validations fail. + + + + + Constructor used by the pre-approved groups in JPakePrimeOrderGroups. + These pre-approved groups can avoid the expensive checks. + User-specified groups should not use this constructor. + + + + + Standard pre-computed prime order groups for use by J-PAKE. + (J-PAKE can use pre-computed prime order groups, same as DSA and Diffie-Hellman.) +

+ This class contains some convenient constants for use as input for + constructing {@link JPAKEParticipant}s. +

+ The prime order groups below are taken from Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB), + and from the prime order groups + published by NIST. +

+
+ + + From Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB) + 1024-bit p, 160-bit q and 1024-bit g for 80-bit security. + + + + + From NIST. + 2048-bit p, 224-bit q and 2048-bit g for 112-bit security. + + + + + From NIST. + 3072-bit p, 256-bit q and 3072-bit g for 128-bit security. + + + + + The payload sent/received during the first round of a J-PAKE exchange. + + Each JPAKEParticipant creates and sends an instance of this payload to + the other. The payload to send should be created via + JPAKEParticipant.CreateRound1PayloadToSend(). + + Each participant must also validate the payload received from the other. + The received payload should be validated via + JPAKEParticipant.ValidateRound1PayloadReceived(JPakeRound1Payload). + + + + + The id of the JPAKEParticipant who created/sent this payload. + + + + + The value of g^x1 + + + + + The value of g^x2 + + + + + The zero knowledge proof for x1. + + This is a two element array, containing {g^v, r} for x1. + + + + + The zero knowledge proof for x2. + + This is a two element array, containing {g^v, r} for x2. + + + + + The payload sent/received during the second round of a J-PAKE exchange. + + Each JPAKEParticipant creates and sends an instance + of this payload to the other JPAKEParticipant. + The payload to send should be created via + JPAKEParticipant#createRound2PayloadToSend() + + Each JPAKEParticipant must also validate the payload + received from the other JPAKEParticipant. + The received payload should be validated via + JPAKEParticipant#validateRound2PayloadReceived(JPakeRound2Payload) + + + + + The id of the JPAKEParticipant who created/sent this payload. + + + + + The value of A, as computed during round 2. + + + + + The zero knowledge proof for x2 * s. + + This is a two element array, containing {g^v, r} for x2 * s. + + + + + The payload sent/received during the optional third round of a J-PAKE exchange, + which is for explicit key confirmation. + + Each JPAKEParticipant creates and sends an instance + of this payload to the other JPAKEParticipant. + The payload to send should be created via + JPAKEParticipant#createRound3PayloadToSend(BigInteger) + + Eeach JPAKEParticipant must also validate the payload + received from the other JPAKEParticipant. + The received payload should be validated via + JPAKEParticipant#validateRound3PayloadReceived(JPakeRound3Payload, BigInteger) + + + + + The id of the {@link JPAKEParticipant} who created/sent this payload. + + + + + The value of MacTag, as computed by round 3. + + See JPAKEUtil#calculateMacTag(string, string, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, org.bouncycastle.crypto.Digest) + + + + + Primitives needed for a J-PAKE exchange. + + The recommended way to perform a J-PAKE exchange is by using + two JPAKEParticipants. Internally, those participants + call these primitive operations in JPakeUtilities. + + The primitives, however, can be used without a JPAKEParticipant if needed. + + + + + Return a value that can be used as x1 or x3 during round 1. + The returned value is a random value in the range [0, q-1]. + + + + + Return a value that can be used as x2 or x4 during round 1. + The returned value is a random value in the range [1, q-1]. + + + + + Converts the given password to a BigInteger + for use in arithmetic calculations. + + + + + Calculate g^x mod p as done in round 1. + + + + + Calculate ga as done in round 2. + + + + + Calculate x2 * s as done in round 2. + + + + + Calculate A as done in round 2. + + + + + Calculate a zero knowledge proof of x using Schnorr's signature. + The returned array has two elements {g^v, r = v-x*h} for x. + + + + + Validates that g^x4 is not 1. + throws CryptoException if g^x4 is 1 + + + + + Validates that ga is not 1. + + As described by Feng Hao... + Alice could simply check ga != 1 to ensure it is a generator. + In fact, as we will explain in Section 3, (x1 + x3 + x4 ) is random over Zq even in the face of active attacks. + Hence, the probability for ga = 1 is extremely small - on the order of 2^160 for 160-bit q. + + throws CryptoException if ga is 1 + + + + + Validates the zero knowledge proof (generated by + calculateZeroKnowledgeProof(BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, string, Digest, SecureRandom) + is correct. + + throws CryptoException if the zero knowledge proof is not correct + + + + + Calculates the keying material, which can be done after round 2 has completed. + A session key must be derived from this key material using a secure key derivation function (KDF). + The KDF used to derive the key is handled externally (i.e. not by JPAKEParticipant). + + KeyingMaterial = (B/g^{x2*x4*s})^x2 + + + + + Validates that the given participant ids are not equal. + (For the J-PAKE exchange, each participant must use a unique id.) + + Throws CryptoException if the participantId strings are equal. + + + + + Validates that the given participant ids are equal. + This is used to ensure that the payloads received from + each round all come from the same participant. + + + + + Validates that the given object is not null. + throws NullReferenceException if the object is null. + + object in question + name of the object (to be used in exception message) + + + + Calculates the MacTag (to be used for key confirmation), as defined by + NIST SP 800-56A Revision 1, + Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + + MacTag = HMAC(MacKey, MacLen, MacData) + MacKey = H(K || "JPAKE_KC") + MacData = "KC_1_U" || participantId || partnerParticipantId || gx1 || gx2 || gx3 || gx4 + + Note that both participants use "KC_1_U" because the sender of the round 3 message + is always the initiator for key confirmation. + + HMAC = {@link HMac} used with the given {@link Digest} + H = The given {@link Digest} + MacLen = length of MacTag + + + + + Calculates the MacKey (i.e. the key to use when calculating the MagTag for key confirmation). + + MacKey = H(K || "JPAKE_KC") + + + + + Validates the MacTag received from the partner participant. + + throws CryptoException if the participantId strings are equal. + + + + Parameters for key/byte stream derivation classes + + + RFC 2631 Diffie-hellman KEK derivation function. + + + base interface for general purpose byte derivation functions. + + + return the message digest used as the basis for the function + + + X9.63 based key derivation function for ECDH CMS. + + + Implements the client side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + + + Initialises the client to begin new authentication attempt + @param N The safe prime associated with the client's verifier + @param g The group parameter associated with the client's verifier + @param digest The digest algorithm associated with the client's verifier + @param random For key generation + + + Generates client's credentials given the client's salt, identity and password + @param salt The salt used in the client's verifier. + @param identity The user's identity (eg. username) + @param password The user's password + @return Client's public value to send to server + + + Generates client's verification message given the server's credentials + @param serverB The server's credentials + @return Client's verification message for the server + @throws CryptoException If server's credentials are invalid + + + Computes the client evidence message M1 using the previously received values. + To be called after calculating the secret S. + @return M1: the client side generated evidence message + @throws CryptoException + + + Authenticates the server evidence message M2 received and saves it only if correct. + @param M2: the server side generated evidence message + @return A boolean indicating if the server message M2 was the expected one. + @throws CryptoException + + + Computes the final session key as a result of the SRP successful mutual authentication + To be called after verifying the server evidence message M2. + @return Key: the mutually authenticated symmetric session key + @throws CryptoException + + + Implements the server side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + + + Initialises the server to accept a new client authentication attempt + @param N The safe prime associated with the client's verifier + @param g The group parameter associated with the client's verifier + @param v The client's verifier + @param digest The digest algorithm associated with the client's verifier + @param random For key generation + + + Generates the server's credentials that are to be sent to the client. + @return The server's public value to the client + + + Processes the client's credentials. If valid the shared secret is generated and returned. + @param clientA The client's credentials + @return A shared secret BigInteger + @throws CryptoException If client's credentials are invalid + + + Authenticates the received client evidence message M1 and saves it only if correct. + To be called after calculating the secret S. + @param M1: the client side generated evidence message + @return A boolean indicating if the client message M1 was the expected one. + @throws CryptoException + + + Computes the server evidence message M2 using the previously verified values. + To be called after successfully verifying the client evidence message M1. + @return M2: the server side generated evidence message + @throws CryptoException + + + Computes the final session key as a result of the SRP successful mutual authentication + To be called after calculating the server evidence message M2. + @return Key: the mutual authenticated symmetric session key + @throws CryptoException + + + Computes the client evidence message (M1) according to the standard routine: + M1 = H( A | B | S ) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param A The public client value + @param B The public server value + @param S The secret calculated by both sides + @return M1 The calculated client evidence message + + + Computes the server evidence message (M2) according to the standard routine: + M2 = H( A | M1 | S ) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param A The public client value + @param M1 The client evidence message + @param S The secret calculated by both sides + @return M2 The calculated server evidence message + + + Computes the final Key according to the standard routine: Key = H(S) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param S The secret calculated by both sides + @return + + + Generates new SRP verifier for user + + + Initialises generator to create new verifiers + @param N The safe prime to use (see DHParametersGenerator) + @param g The group parameter to use (see DHParametersGenerator) + @param digest The digest to use. The same digest type will need to be used later for the actual authentication + attempt. Also note that the final session key size is dependent on the chosen digest. + + + Creates a new SRP verifier + @param salt The salt to use, generally should be large and random + @param identity The user's identifying information (eg. username) + @param password The user's password + @return A new verifier for use in future SRP authentication + + + a holding class for public/private parameter pairs. + + + basic constructor. + + @param publicParam a public key parameters object. + @param privateParam the corresponding private key parameters. + + + return the public key parameters. + + @return the public key parameters. + + + return the private key parameters. + + @return the private key parameters. + + + The AEAD block ciphers already handle buffering internally, so this class + just takes care of implementing IBufferedCipher methods. + + + Block cipher engines are expected to conform to this interface. + + + Initialise the cipher. + If true the cipher is initialised for encryption, + if false for decryption. + The key and other data required by the cipher. + + + + Reset the cipher. After resetting the cipher is in the same state + as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the blocksize for the underlying cipher. + + @return the blocksize for the underlying cipher. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output, or the input is not block size aligned and should be. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + @exception DataLengthException if the input is not block size + aligned. + + + Reset the buffer and cipher. After resetting the object is in the same + state as it was after the last init (if there was one). + + + a buffer wrapper for an asymmetric block cipher, allowing input + to be accumulated in a piecemeal fashion until final processing. + + + base constructor. + + @param cipher the cipher this buffering object wraps. + + + return the amount of data sitting in the buffer. + + @return the amount of data sitting in the buffer. + + + initialise the buffer and the underlying cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + + + process the contents of the buffer using the underlying + cipher. + + @return the result of the encryption/decryption process on the + buffer. + @exception InvalidCipherTextException if we are given a garbage block. + + + Reset the buffer + + + A wrapper class that allows block ciphers to be used to process data in + a piecemeal fashion. The BufferedBlockCipher outputs a block only when the + buffer is full and more data is being added, or on a doFinal. +

+ Note: in the case where the underlying cipher is either a CFB cipher or an + OFB one the last block may not be a multiple of the block size. +

+
+ + constructor for subclasses + + + Create a buffered block cipher without padding. + + @param cipher the underlying block cipher this buffering object wraps. + false otherwise. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the blocksize for the underlying cipher. + + @return the blocksize for the underlying cipher. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output, or the input is not block size aligned and should be. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + @exception DataLengthException if the input is not block size + aligned. + + + Reset the buffer and cipher. After resetting the object is in the same + state as it was after the last init (if there was one). + + + The base class for symmetric, or secret, cipher key generators. + + + initialise the key generator. + + @param param the parameters to be used for key generation + + + Generate a secret key. + + @return a byte array containing the key value. + + + this exception is thrown if a buffer that is meant to have output + copied into it turns out to be too short, or if we've been given + insufficient input. In general this exception will Get thrown rather + than an ArrayOutOfBounds exception. + + + base constructor. + + + create a DataLengthException with the given message. + + @param message the message to be carried with the exception. + + + base implementation of MD4 family style digest as outlined in + "Handbook of Applied Cryptography", pages 344 - 347. + + + interface that a message digest conforms to. + + + return the size, in bytes, of the digest produced by this message digest. + + @return the size, in bytes, of the digest produced by this message digest. + + + return the size, in bytes, of the internal buffer used by this digest. + + @return the size, in bytes, of the internal buffer used by this digest. + + + update the message digest with a single byte. + + @param inByte the input byte to be entered. + + + update the message digest with a block of bytes. + + @param input the byte array containing the data. + @param inOff the offset into the byte array where the data starts. + @param len the length of the data. + + + Close the digest, producing the final digest value. The doFinal + call leaves the digest reset. + + @param output the array the digest is to be copied into. + @param outOff the offset into the out array the digest is to start at. + + + reset the digest back to it's initial state. + + + return the algorithm name + + @return the algorithm name + + + + Produce a copy of this object with its configuration and in its current state. + + + The returned object may be used simply to store the state, or may be used as a similar object + starting from the copied state. + + + + + Restore a copied object state into this object. + + + Implementations of this method should try to avoid or minimise memory allocation to perform the reset. + + an object originally {@link #copy() copied} from an object of the same type as this instance. + if the provided object is not of the correct type. + if the other parameter is in some other way invalid. + + + implementation of GOST R 34.11-94 + + + Standard constructor + + + Constructor to allow use of a particular sbox with GOST28147 + @see GOST28147Engine#getSBox(String) + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + + Implementation of Keccak based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + Return the size of block that the compression function is applied to in bytes. + + @return internal byte length of a block. + + + Base class for SHA-384 and SHA-512. + + + Constructor for variable length word + + + Copy constructor. We are using copy constructors in place + of the object.Clone() interface as this interface is not + supported by J2ME. + + + adjust the byte counts so that byteCount2 represents the + upper long (less 3 bits) word of the byte count. + + + implementation of MD2 + as outlined in RFC1319 by B.Kaliski from RSA Laboratories April 1992 + + + Close the digest, producing the final digest value. The doFinal + call leaves the digest reset. + + @param out the array the digest is to be copied into. + @param outOff the offset into the out array the digest is to start at. + + + reset the digest back to it's initial state. + + + update the message digest with a single byte. + + @param in the input byte to be entered. + + + update the message digest with a block of bytes. + + @param in the byte array containing the data. + @param inOff the offset into the byte array where the data starts. + @param len the length of the data. + + + return the algorithm name + + @return the algorithm name + + + implementation of MD4 as RFC 1320 by R. Rivest, MIT Laboratory for + Computer Science and RSA Data Security, Inc. +

+ NOTE: This algorithm is only included for backwards compatibility + with legacy applications, it's not secure, don't use it for anything new!

+
+ + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + implementation of MD5 as outlined in "Handbook of Applied Cryptography", pages 346 - 347. + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + Wrapper removes exposure to the IMemoable interface on an IDigest implementation. + + + Base constructor. + + @param baseDigest underlying digest to use. + @exception IllegalArgumentException if baseDigest is null + + + implementation of RipeMD128 + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + implementation of RipeMD see, + http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + +

Implementation of RipeMD256.

+

Note: this algorithm offers the same level of security as RipeMD128.

+
+
+ + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + + reset the chaining variables to the IV values. + + + +

Implementation of RipeMD 320.

+

Note: this algorithm offers the same level of security as RipeMD160.

+
+
+ + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + + reset the chaining variables to the IV values. + + + implementation of SHA-1 as outlined in "Handbook of Applied Cryptography", pages 346 - 349. + + It is interesting to ponder why the, apart from the extra IV, the other difference here from MD5 + is the "endianness" of the word processing! + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + SHA-224 as described in RFC 3874 +
+                    block  word  digest
+            SHA-1   512    32    160
+            SHA-224 512    32    224
+            SHA-256 512    32    256
+            SHA-384 1024   64    384
+            SHA-512 1024   64    512
+            
+
+ + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Draft FIPS 180-2 implementation of SHA-256. Note: As this is + based on a draft this implementation is subject to change. + +
+                     block  word  digest
+             SHA-1   512    32    160
+             SHA-256 512    32    256
+             SHA-384 1024   64    384
+             SHA-512 1024   64    512
+             
+
+ + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Draft FIPS 180-2 implementation of SHA-384. Note: As this is + based on a draft this implementation is subject to change. + +
+                     block  word  digest
+             SHA-1   512    32    160
+             SHA-256 512    32    256
+             SHA-384 1024   64    384
+             SHA-512 1024   64    512
+             
+
+ + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + + Implementation of SHA-3 based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + Draft FIPS 180-2 implementation of SHA-512. Note: As this is + based on a draft this implementation is subject to change. + +
+                     block  word  digest
+             SHA-1   512    32    160
+             SHA-256 512    32    256
+             SHA-384 1024   64    384
+             SHA-512 1024   64    512
+             
+
+ + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + FIPS 180-4 implementation of SHA-512/t + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + + Implementation of SHAKE based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + + With FIPS PUB 202 a new kind of message digest was announced which supported extendable output, or variable digest sizes. + This interface provides the extra method required to support variable output on a digest implementation. + + + + + Output the results of the final calculation for this digest to outLen number of bytes. + + output array to write the output bytes to. + offset to start writing the bytes at. + the number of output bytes requested. + the number of bytes written + + + + Start outputting the results of the final calculation for this digest. Unlike DoFinal, this method + will continue producing output until the Xof is explicitly reset, or signals otherwise. + + output array to write the output bytes to. + offset to start writing the bytes at. + the number of output bytes requested. + the number of bytes written + + + Wrapper class that reduces the output length of a particular digest to + only the first n bytes of the digest function. + + + Base constructor. + + @param baseDigest underlying digest to use. + @param length length in bytes of the output of doFinal. + @exception ArgumentException if baseDigest is null, or length is greater than baseDigest.GetDigestSize(). + + + + Implementation of the Skein parameterised hash function in 256, 512 and 1024 bit block sizes, + based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

+ Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + + + + + +

+ 256 bit block size - Skein-256 + +
+ + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + + Constructs a Skein digest with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/digest size to produce in bits, which must be an integral number of + bytes. + + + + Optionally initialises the Skein digest with the provided parameters. + + See for details on the parameterisation of the Skein hash function. + the parameters to apply to this engine, or null to use no parameters. + + + + Implementation of the Skein family of parameterised hash functions in 256, 512 and 1024 bit block + sizes, based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

+ Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. +

+ This implementation is the basis for and , implementing the + parameter based configuration system that allows Skein to be adapted to multiple applications.
+ Initialising the engine with allows standard and arbitrary parameters to + be applied during the Skein hash function. +

+ Implemented: +

    +
  • 256, 512 and 1024 bit internal states.
  • +
  • Full 96 bit input length.
  • +
  • Parameters defined in the Skein specification, and arbitrary other pre and post message + parameters.
  • +
  • Arbitrary output size in 1 byte intervals.
  • +
+

+ Not implemented: +

    +
  • Sub-byte length input (bit padding).
  • +
  • Tree hashing.
  • +
+
+ +
+ + + 256 bit block size - Skein-256 + + + + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + The parameter type for the Skein key. + + + The parameter type for the Skein configuration block. + + + The parameter type for the message. + + + The parameter type for the output transformation. + + + Precalculated UBI(CFG) states for common state/output combinations without key or other + pre-message params. + + + Underlying Threefish tweakable block cipher + + + Size of the digest output, in bytes + + + The current chaining/state value + + + The initial state value + + + The (optional) key parameter + + + Parameters to apply prior to the message + + + Parameters to apply after the message, but prior to output + + + The current UBI operation + + + Buffer for single byte update method + + + + Constructs a Skein digest with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/digest size to produce in bits, which must be an integral number of + bytes. + + + + Creates a SkeinEngine as an exact copy of an existing instance. + + + + + Initialises the Skein engine with the provided parameters. See for + details on the parameterisation of the Skein hash function. + + the parameters to apply to this engine, or null to use no parameters. + + + Calculate the initial (pre message block) chaining state. + + + + Reset the engine to the initial state (with the key and any pre-message parameters , ready to + accept message input. + + + + Point at which position might overflow long, so switch to add with carry logic + + + Bit 127 = final + + + Bit 126 = first + + + UBI uses a 128 bit tweak + + + Whether 64 bit position exceeded + + + Advances the position in the tweak by the specified value. + + + The Unique Block Iteration chaining mode. + + + Buffer for the current block of message data + + + Offset into the current message block + + + Buffer for message words for feedback into encrypted block + + + + Implementation of Chinese SM3 digest as described at + http://tools.ietf.org/html/draft-shen-sm3-hash-00 + and at .... ( Chinese PDF ) + + + The specification says "process a bit stream", + but this is written to process bytes in blocks of 4, + meaning this will process 32-bit word groups. + But so do also most other digest specifications, + including the SHA-256 which was a origin for + this specification. + + + + + Standard constructor + + + + + Copy constructor. This will copy the state of the provided + message digest. + + + + + reset the chaining variables + + + + implementation of Tiger based on: + + http://www.cs.technion.ac.il/~biham/Reports/Tiger + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Implementation of WhirlpoolDigest, based on Java source published by Barreto + and Rijmen. + + + + Copy constructor. This will copy the state of the provided message + digest. + + + Reset the chaining variables + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + ISO 9796-1 padding. Note in the light of recent results you should + only use this with RSA (rather than the "simpler" Rabin keys) and you + should never use it with anything other than a hash (ie. even if the + message is small don't sign the message, sign it's hash) or some "random" + value. See your favorite search engine for details. + + + Base interface for a public/private key block cipher. + + + Initialise the cipher. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The maximum size, in bytes, an input block may be. + + + The maximum size, in bytes, an output block will be. + + + Process a block. + The input buffer. + The offset into inBuf that the input block begins. + The length of the input block. + Input decrypts improperly. + Input is too large for the cipher. + + + The name of the algorithm this cipher implements. + + + return the input block size. The largest message we can process + is (key_size_in_bits + 3)/16, which in our world comes to + key_size_in_bytes / 2. + + + return the maximum possible size for the output. + + + set the number of bits in the next message to be treated as + pad bits. + + + retrieve the number of pad bits in the last decoded message. + + + @exception InvalidCipherTextException if the decrypted block is not a valid ISO 9796 bit string + + + Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2. + + + @exception InvalidCipherTextException if the decrypted block turns out to + be badly formatted. + + + int to octet string. + + + mask generator function, as described in PKCS1v2. + + + this does your basic Pkcs 1 v1.5 padding - whether or not you should be using this + depends on your application - see Pkcs1 Version 2 for details. + + + some providers fail to include the leading zero in PKCS1 encoded blocks. If you need to + work with one of these set the system property Org.BouncyCastle.Pkcs1.Strict to false. + + + Basic constructor. + @param cipher + + + Constructor for decryption with a fixed plaintext length. + + @param cipher The cipher to use for cryptographic operation. + @param pLen Length of the expected plaintext. + + + Constructor for decryption with a fixed plaintext length and a fallback + value that is returned, if the padding is incorrect. + + @param cipher + The cipher to use for cryptographic operation. + @param fallback + The fallback value, we don't to a arraycopy here. + + + Checks if the argument is a correctly PKCS#1.5 encoded Plaintext + for encryption. + + @param encoded The Plaintext. + @param pLen Expected length of the plaintext. + @return Either 0, if the encoding is correct, or -1, if it is incorrect. + + + Decode PKCS#1.5 encoding, and return a random value if the padding is not correct. + + @param in The encrypted block. + @param inOff Offset in the encrypted block. + @param inLen Length of the encrypted block. + @param pLen Length of the desired output. + @return The plaintext without padding, or a random value if the padding was incorrect. + + @throws InvalidCipherTextException + + + @exception InvalidCipherTextException if the decrypted block is not in Pkcs1 format. + + + The same effect can be achieved by setting the static property directly +

+ The static property is checked during construction of the encoding object, it is set to + true by default. +

+
+ + an implementation of the AES (Rijndael), from FIPS-197. +

+ For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor, they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first. + + The slowest version uses no static tables at all and computes the values in each round. +

+

+ This file contains the middle performance version with 2Kbytes of static tables for round precomputation. +

+
+ + Base interface for a symmetric key block cipher. + + + Initialise the cipher. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The block size for this cipher, in bytes. + + + Process a block. + The input buffer. + The offset into inBuf that the input block begins. + The output buffer. + The offset into outBuf to write the output block. + If input block is wrong size, or outBuf too small. + The number of bytes processed and produced. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Indicates whether this cipher can handle partial blocks. + + + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + an implementation of the AES (Rijndael)), from FIPS-197. +

+ For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor), they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations), 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each), for a total of 2Kbytes), + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first + + The slowest version uses no static tables at all and computes the values in each round +

+

+ This file contains the fast version with 8Kbytes of static tables for round precomputation +

+
+ + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + an implementation of the AES (Rijndael), from FIPS-197. +

+ For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor, they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first + + The slowest version uses no static tables at all and computes the values + in each round. +

+

+ This file contains the slowest performance version with no static tables + for round precomputation, but it has the smallest foot print. +

+
+ + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + + An implementation of the AES Key Wrapper from the NIST Key Wrap Specification. +

+ For further details see: http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + + + + + An implementation of the AES Key Wrapper from the NIST Key Wrap + Specification as described in RFC 3394. +

+ For further details see: http://www.ietf.org/rfc/rfc3394.txt + and http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + + + +

The name of the algorithm this cipher implements. +
+ + A class that provides Blowfish key encryption operations, + such as encoding data and generating keys. + All the algorithms herein are from Applied Cryptography + and implement a simplified cryptography interface. + + + initialise a Blowfish cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + apply the encryption cycle to each value pair in the table. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Camellia - based on RFC 3713. + + + Camellia - based on RFC 3713, smaller implementation, about half the size of CamelliaEngine. + + + + An implementation of the Camellia key wrapper based on RFC 3657/RFC 3394. +

+ For further details see: http://www.ietf.org/rfc/rfc3657.txt. + + + + A class that provides CAST key encryption operations, + such as encoding data and generating keys. + + All the algorithms herein are from the Internet RFC's + + RFC2144 - Cast5 (64bit block, 40-128bit key) + RFC2612 - CAST6 (128bit block, 128-256bit key) + + and implement a simplified cryptography interface. + + + initialise a CAST cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + The first of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + The second of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + The third of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + Does the 16 rounds to encrypt the block. + + @param L0 the LH-32bits of the plaintext block + @param R0 the RH-32bits of the plaintext block + + + A class that provides CAST6 key encryption operations, + such as encoding data and generating keys. + + All the algorithms herein are from the Internet RFC + + RFC2612 - CAST6 (128bit block, 128-256bit key) + + and implement a simplified cryptography interface. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Does the 12 quad rounds rounds to encrypt the block. + + @param A the 00-31 bits of the plaintext block + @param B the 32-63 bits of the plaintext block + @param C the 64-95 bits of the plaintext block + @param D the 96-127 bits of the plaintext block + @param result the resulting ciphertext + + + Does the 12 quad rounds rounds to decrypt the block. + + @param A the 00-31 bits of the ciphertext block + @param B the 32-63 bits of the ciphertext block + @param C the 64-95 bits of the ciphertext block + @param D the 96-127 bits of the ciphertext block + @param result the resulting plaintext + + +

+ Implementation of Daniel J. Bernstein's ChaCha stream cipher. + +
+ + + Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005 + + + + The interface stream ciphers conform to. + + + Initialise the cipher. + If true the cipher is initialised for encryption, + if false for decryption. + The key and other data required by the cipher. + + If the parameters argument is inappropriate. + + + + encrypt/decrypt a single byte returning the result. + the byte to be processed. + the result of processing the input byte. + + + + Process a block of bytes from input putting the result into output. + + The input byte array. + + The offset into input where the data to be processed starts. + + The number of bytes to be processed. + The output buffer the processed bytes go into. + + The offset into output the processed data starts at. + + If the output buffer is too small. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Constants + + + + Creates a 20 round Salsa20 engine. + + + + + Creates a Salsa20 engine with a specific number of rounds. + + the number of rounds (must be an even number). + + + Rotate left + + @param x value to rotate + @param y amount to rotate x + + @return rotated x + + + + Creates a 20 rounds ChaCha engine. + + + + + Implementation of Daniel J. Bernstein's ChaCha stream cipher. + + + + + Creates a 20 rounds ChaCha engine. + + + + + Creates a ChaCha engine with a specific number of rounds. + + the number of rounds (must be an even number). + + + + ChaCha function. + + The number of ChaCha rounds to execute + The input words. + The ChaCha state to modify. + + + A class that provides a basic DESede (or Triple DES) engine. + + + A class that provides a basic DES engine. + + + initialise a DES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + what follows is mainly taken from "Applied Cryptography", by + Bruce Schneier, however it also bears great resemblance to Richard + Outerbridge's D3DES... + + + Generate an integer based working key based on our secret key + and what we processing we are planning to do. + + Acknowledgements for this routine go to James Gillogly and Phil Karn. + (whoever, and wherever they are!). + + + the DES engine. + + + initialise a DESede cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + * Wrap keys according to + * + * draft-ietf-smime-key-wrap-01.txt. + *

+ * Note: + *

    + *
  • this is based on a draft, and as such is subject to change - don't use this class for anything requiring long term storage.
  • + *
  • if you are using this to wrap triple-des keys you need to set the + * parity bits on the key and, if it's a two-key triple-des key, pad it + * yourself.
  • + *
+ *

+
+ + Field engine + + + Field param + + + Field paramPlusIV + + + Field iv + + + Field forWrapping + + + Field IV2 + + + Method init + + @param forWrapping + @param param + + + Method wrap + + @param in + @param inOff + @param inLen + @return + + + Method unwrap + + @param in + @param inOff + @param inLen + @return + @throws InvalidCipherTextException + + + Some key wrap algorithms make use of the Key Checksum defined + in CMS [CMS-Algorithms]. This is used to provide an integrity + check value for the key being wrapped. The algorithm is + + - Compute the 20 octet SHA-1 hash on the key being wrapped. + - Use the first 8 octets of this hash as the checksum value. + + @param key + @return + @throws Exception + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + @param key + @param checksum + @return + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + Method GetAlgorithmName + + @return + + + this does your basic ElGamal algorithm. + + + initialise the ElGamal engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary ElGamal key parameters. + + + Return the maximum size for an input block to this engine. + For ElGamal this is always one byte less than the size of P on + encryption, and twice the length as the size of P on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For ElGamal this is always one byte less than the size of P on + decryption, and twice the length as the size of P on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic ElGamal algorithm. + + @param in the input array. + @param inOff the offset into the input buffer where the data starts. + @param length the length of the data to be processed. + @return the result of the ElGamal process. + @exception DataLengthException the input block is too large. + + + implementation of GOST 28147-89 + + + standard constructor. + + + initialise an Gost28147 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is inappropriate. + + + Return the S-Box associated with SBoxName + @param sBoxName name of the S-Box + @return byte array representing the S-Box + + + HC-128 is a software-efficient stream cipher created by Hongjun Wu. It + generates keystream from a 128-bit secret key and a 128-bit initialization + vector. +

+ http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf +

+ It is a third phase candidate in the eStream contest, and is patent-free. + No attacks are known as of today (April 2007). See + + http://www.ecrypt.eu.org/stream/hcp3.html +

+
+ + Initialise a HC-128 cipher. + + @param forEncryption whether or not we are for encryption. Irrelevant, as + encryption and decryption are the same. + @param params the parameters required to set up the cipher. + @throws ArgumentException if the params argument is + inappropriate (ie. the key is not 128 bit long). + + + HC-256 is a software-efficient stream cipher created by Hongjun Wu. It + generates keystream from a 256-bit secret key and a 256-bit initialization + vector. +

+ http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc256_p3.pdf +

+ Its brother, HC-128, is a third phase candidate in the eStream contest. + The algorithm is patent-free. No attacks are known as of today (April 2007). + See + + http://www.ecrypt.eu.org/stream/hcp3.html +

+
+ + Initialise a HC-256 cipher. + + @param forEncryption whether or not we are for encryption. Irrelevant, as + encryption and decryption are the same. + @param params the parameters required to set up the cipher. + @throws ArgumentException if the params argument is + inappropriate (ie. the key is not 256 bit long). + + + A class that provides a basic International Data Encryption Algorithm (IDEA) engine. +

+ This implementation is based on the "HOWTO: INTERNATIONAL DATA ENCRYPTION ALGORITHM" + implementation summary by Fauzan Mirza (F.U.Mirza@sheffield.ac.uk). (baring 1 typo at the + end of the mulinv function!). +

+

+ It can be found at ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/idea/ +

+

+ Note 1: This algorithm is patented in the USA, Japan, and Europe including + at least Austria, France, Germany, Italy, Netherlands, Spain, Sweden, Switzerland + and the United Kingdom. Non-commercial use is free, however any commercial + products are liable for royalties. Please see + www.mediacrypt.com for + further details. This announcement has been included at the request of + the patent holders. +

+

+ Note 2: Due to the requests concerning the above, this algorithm is now only + included in the extended assembly. It is not included in the default distributions. +

+
+ + standard constructor. + + + initialise an IDEA cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return x = x * y where the multiplication is done modulo + 65537 (0x10001) (as defined in the IDEA specification) and + a zero input is taken to be 65536 (0x10000). + + @param x the x value + @param y the y value + @return x = x * y + + + The following function is used to expand the user key to the encryption + subkey. The first 16 bytes are the user key, and the rest of the subkey + is calculated by rotating the previous 16 bytes by 25 bits to the left, + and so on until the subkey is completed. + + + This function computes multiplicative inverse using Euclid's Greatest + Common Divisor algorithm. Zero and one are self inverse. +

+ i.e. x * MulInv(x) == 1 (modulo BASE) +

+
+ + Return the additive inverse of x. +

+ i.e. x + AddInv(x) == 0 +

+
+ + The function to invert the encryption subkey to the decryption subkey. + It also involves the multiplicative inverse and the additive inverse functions. + + + support class for constructing intergrated encryption ciphers + for doing basic message exchanges on top of key agreement ciphers + + + set up for use with stream mode, where the key derivation function + is used to provide a stream of bytes to xor with the message. + + @param agree the key agreement used as the basis for the encryption + @param kdf the key derivation function used for byte generation + @param mac the message authentication code generator for the message + + + set up for use in conjunction with a block cipher to handle the + message. + + @param agree the key agreement used as the basis for the encryption + @param kdf the key derivation function used for byte generation + @param mac the message authentication code generator for the message + @param cipher the cipher to used for encrypting the message + + + Initialise the encryptor. + + @param forEncryption whether or not this is encryption/decryption. + @param privParam our private key parameters + @param pubParam the recipient's/sender's public key parameters + @param param encoding and derivation parameters. + + + Implementation of Bob Jenkin's ISAAC (Indirection Shift Accumulate Add and Count). + see: http://www.burtleburtle.net/bob/rand/isaacafa.html + + + initialise an ISAAC cipher. + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + NaccacheStern Engine. For details on this cipher, please see + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Initializes this algorithm. Must be called before all other Functions. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#init(bool, + org.bouncycastle.crypto.CipherParameters) + + + Returns the input block size of this algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetInputBlockSize() + + + Returns the output block size of this algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetOutputBlockSize() + + + Process a single Block using the Naccache-Stern algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#ProcessBlock(byte[], + int, int) + + + Encrypts a BigInteger aka Plaintext with the public key. + + @param plain + The BigInteger to encrypt + @return The byte[] representation of the encrypted BigInteger (i.e. + crypted.toByteArray()) + + + Adds the contents of two encrypted blocks mod sigma + + @param block1 + the first encrypted block + @param block2 + the second encrypted block + @return encrypt((block1 + block2) mod sigma) + @throws InvalidCipherTextException + + + Convenience Method for data exchange with the cipher. + + Determines blocksize and splits data to blocksize. + + @param data the data to be processed + @return the data after it went through the NaccacheSternEngine. + @throws InvalidCipherTextException + + + Computes the integer x that is expressed through the given primes and the + congruences with the chinese remainder theorem (CRT). + + @param congruences + the congruences c_i + @param primes + the primes p_i + @return an integer x for that x % p_i == c_i + + + A Noekeon engine, using direct-key mode. + + + Create an instance of the Noekeon encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + The no-op engine that just copies bytes through, irrespective of whether encrypting and decrypting. + Provided for the sake of completeness. + + + an implementation of RC2 as described in RFC 2268 + "A Description of the RC2(r) Encryption Algorithm" R. Rivest. + + + initialise a RC2 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the result rotating the 16 bit number in x left by y + + + Wrap keys according to RFC 3217 - RC2 mechanism + + + Field engine + + + Field param + + + Field paramPlusIV + + + Field iv + + + Field forWrapping + + + Field IV2 + + + Method init + + @param forWrapping + @param param + + + Method wrap + + @param in + @param inOff + @param inLen + @return + + + Method unwrap + + @param in + @param inOff + @param inLen + @return + @throws InvalidCipherTextException + + + Some key wrap algorithms make use of the Key Checksum defined + in CMS [CMS-Algorithms]. This is used to provide an integrity + check value for the key being wrapped. The algorithm is + + - Compute the 20 octet SHA-1 hash on the key being wrapped. + - Use the first 8 octets of this hash as the checksum value. + + @param key + @return + @throws Exception + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + @param key + @param checksum + @return + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + Method GetAlgorithmName + + @return + + + initialise a RC4 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + The specification for RC5 came from the RC5 Encryption Algorithm + publication in RSA CryptoBytes, Spring of 1995. + http://www.rsasecurity.com/rsalabs/cryptobytes. +

+ This implementation has a word size of 32 bits.

+
+ + Create an instance of the RC5 encryption algorithm + and set some defaults + + + initialise a RC5-32 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Encrypt the given block starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param in in byte buffer containing data to encrypt + @param inOff offset into src buffer + @param out out buffer where encrypted data is written + @param outOff offset into out buffer + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(32) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % 32 + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(32) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % 32 + + + The specification for RC5 came from the RC5 Encryption Algorithm + publication in RSA CryptoBytes, Spring of 1995. + http://www.rsasecurity.com/rsalabs/cryptobytes. +

+ This implementation is set to work with a 64 bit word size.

+
+ + Create an instance of the RC5 encryption algorithm + and set some defaults + + + initialise a RC5-64 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Encrypt the given block starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param in in byte buffer containing data to encrypt + @param inOff offset into src buffer + @param out out buffer where encrypted data is written + @param outOff offset into out buffer + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + An RC6 engine. + + + Create an instance of the RC6 encryption algorithm + and set some defaults + + + initialise a RC5-32 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param inKey the key to be used + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + an implementation of the RFC 3211 Key Wrap + Specification. + + + an implementation of Rijndael, based on the documentation and reference implementation + by Paulo Barreto, Vincent Rijmen, for v2.0 August '99. +

+ Note: this implementation is based on information prior to readonly NIST publication. +

+
+ + multiply two elements of GF(2^m) + needed for MixColumn and InvMixColumn + + + xor corresponding text input and round key input bytes + + + Row 0 remains unchanged + The other three rows are shifted a variable amount + + + Replace every byte of the input by the byte at that place + in the nonlinear S-box + + + Mix the bytes of every column in a linear way + + + Mix the bytes of every column in a linear way + This is the opposite operation of Mixcolumn + + + Calculate the necessary round keys + The number of calculations depends on keyBits and blockBits + + + default constructor - 128 bit block size. + + + basic constructor - set the cipher up for a given blocksize + + @param blocksize the blocksize in bits, must be 128, 192, or 256. + + + initialise a Rijndael cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + this does your basic RSA algorithm with blinding + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic RSA algorithm. + + @param inBuf the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @exception DataLengthException the input block is too large. + + + This does your basic RSA Chaum's blinding and unblinding as outlined in + "Handbook of Applied Cryptography", page 475. You need to use this if you are + trying to get another party to generate signatures without them being aware + of the message they are signing. + + + Initialise the blinding engine. + + @param forEncryption true if we are encrypting (blinding), false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the RSA blinding algorithm. + + @param in the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @throws DataLengthException the input block is too large. + + + this does your basic RSA algorithm. + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + this does your basic RSA algorithm. + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic RSA algorithm. + + @param inBuf the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @exception DataLengthException the input block is too large. + + + Implementation of the SEED algorithm as described in RFC 4009 + + + + An implementation of the SEED key wrapper based on RFC 4010/RFC 3394. +

+ For further details see: http://www.ietf.org/rfc/rfc4010.txt. + + + + * Serpent is a 128-bit 32-round block cipher with variable key lengths, + * including 128, 192 and 256 bit keys conjectured to be at least as + * secure as three-key triple-DES. + *

+ * Serpent was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + * candidate algorithm for the NIST AES Quest. + *

+ *

+ * For full details see The Serpent home page + *

+
+ + initialise a Serpent cipher. + + @param encrypting whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @throws IllegalArgumentException if the params argument is + inappropriate. + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @return the number of bytes processed and produced. + @throws DataLengthException if there isn't enough data in in, or + space in out. + @throws IllegalStateException if the cipher isn't initialised. + + + InvSO - {13, 3,11, 0,10, 6, 5,12, 1,14, 4, 7,15, 9, 8, 2 } - 15 terms. + + + S1 - {15,12, 2, 7, 9, 0, 5,10, 1,11,14, 8, 6,13, 3, 4 } - 14 terms. + + + InvS1 - { 5, 8, 2,14,15, 6,12, 3,11, 4, 7, 9, 1,13,10, 0 } - 14 steps. + + + S2 - { 8, 6, 7, 9, 3,12,10,15,13, 1,14, 4, 0,11, 5, 2 } - 16 terms. + + + InvS2 - {12, 9,15, 4,11,14, 1, 2, 0, 3, 6,13, 5, 8,10, 7 } - 16 steps. + + + S3 - { 0,15,11, 8,12, 9, 6, 3,13, 1, 2, 4,10, 7, 5,14 } - 16 terms. + + + InvS3 - { 0, 9,10, 7,11,14, 6,13, 3, 5,12, 2, 4, 8,15, 1 } - 15 terms + + + S4 - { 1,15, 8, 3,12, 0,11, 6, 2, 5, 4,10, 9,14, 7,13 } - 15 terms. + + + InvS4 - { 5, 0, 8, 3,10, 9, 7,14, 2,12,11, 6, 4,15,13, 1 } - 15 terms. + + + S5 - {15, 5, 2,11, 4,10, 9,12, 0, 3,14, 8,13, 6, 7, 1 } - 16 terms. + + + InvS5 - { 8,15, 2, 9, 4, 1,13,14,11, 6, 5, 3, 7,12,10, 0 } - 16 terms. + + + S6 - { 7, 2,12, 5, 8, 4, 6,11,14, 9, 1,15,13, 3,10, 0 } - 15 terms. + + + InvS6 - {15,10, 1,13, 5, 3, 6, 0, 4, 9,14, 7, 2,12, 8,11 } - 15 terms. + + + S7 - { 1,13,15, 0,14, 8, 2,11, 7, 4,12,10, 9, 3, 5, 6 } - 16 terms. + + + InvS7 - { 3, 0, 6,13, 9,14,15, 8, 5,12,11, 7,10, 1, 4, 2 } - 17 terms. + + + Apply the linear transformation to the register set. + + + Apply the inverse of the linear transformation to the register set. + + + Expand a user-supplied key material into a session key. + + @param key The user-key bytes (multiples of 4) to use. + @exception ArgumentException + + + Encrypt one block of plaintext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + Decrypt one block of ciphertext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + a class that provides a basic SKIPJACK engine. + + + initialise a SKIPJACK cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + The G permutation + + + the inverse of the G permutation. + + + An TEA engine. + + + Create an instance of the TEA encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + + Implementation of the Threefish tweakable large block cipher in 256, 512 and 1024 bit block + sizes. + + + This is the 1.3 version of Threefish defined in the Skein hash function submission to the NIST + SHA-3 competition in October 2010. +

+ Threefish was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. +

+ This implementation inlines all round functions, unrolls 8 rounds, and uses 1.2k of static tables + to speed up key schedule injection.
+ 2 x block size state is retained by each cipher instance. + + + +

+ 256 bit block size - Threefish-256 + +
+ + + 512 bit block size - Threefish-512 + + + + + 1024 bit block size - Threefish-1024 + + + + Size of the tweak in bytes (always 128 bit/16 bytes) + + + Rounds in Threefish-256 + + + Rounds in Threefish-512 + + + Rounds in Threefish-1024 + + + Max rounds of any of the variants + + + Key schedule parity constant + + + Block size in bytes + + + Block size in 64 bit words + + + Buffer for byte oriented processBytes to call internal word API + + + Tweak bytes (2 byte t1,t2, calculated t3 and repeat of t1,t2 for modulo free lookup + + + Key schedule words + + + The internal cipher implementation (varies by blocksize) + + + + Constructs a new Threefish cipher, with a specified block size. + + the block size in bits, one of , , + . + + + + Initialise the engine. + + Initialise for encryption if true, for decryption if false. + an instance of or (to + use a 0 tweak) + + + + Initialise the engine, specifying the key and tweak directly. + + the cipher mode. + the words of the key, or null to use the current key. + the 2 word (128 bit) tweak, or null to use the current tweak. + + + + Process a block of data represented as 64 bit words. + + the number of 8 byte words processed (which will be the same as the block size). + a block sized buffer of words to process. + a block sized buffer of words to receive the output of the operation. + if either the input or output is not block sized + if this engine is not initialised + + + + Read a single 64 bit word from input in LSB first order. + + + + + Write a 64 bit word to output in LSB first order. + + + + Rotate left + xor part of the mix operation. + + + Rotate xor + rotate right part of the unmix operation. + + + The extended + repeated tweak words + + + The extended + repeated key words + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Tnepres is a 128-bit 32-round block cipher with variable key lengths, + including 128, 192 and 256 bit keys conjectured to be at least as + secure as three-key triple-DES. +

+ Tnepres is based on Serpent which was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + candidate algorithm for the NIST AES Quest. Unfortunately there was an endianness issue + with test vectors in the AES submission and the resulting confusion lead to the Tnepres cipher + as well, which is a byte swapped version of Serpent. +

+

+ For full details see The Serpent home page +

+
+ + Expand a user-supplied key material into a session key. + + @param key The user-key bytes (multiples of 4) to use. + @exception ArgumentException + + + Encrypt one block of plaintext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + Decrypt one block of ciphertext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + A class that provides Twofish encryption operations. + + This Java implementation is based on the Java reference + implementation provided by Bruce Schneier and developed + by Raif S. Naffah. + + + Define the fixed p0/p1 permutations used in keyed S-box lookup. + By changing the following constant definitions, the S-boxes will + automatically Get changed in the Twofish engine. + + + gSubKeys[] and gSBox[] are eventually used in the + encryption and decryption methods. + + + initialise a Twofish cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + encryptBlock uses the pre-calculated gSBox[] and subKey[] + arrays. + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Use (12, 8) Reed-Solomon code over GF(256) to produce + a key S-box 32-bit entity from 2 key material 32-bit + entities. + + @param k0 first 32-bit entity + @param k1 second 32-bit entity + @return Remainder polynomial Generated using RS code + + + * Reed-Solomon code parameters: (12,8) reversible code: + *

+ *

+                    * G(x) = x^4 + (a+1/a)x^3 + ax^2 + (a+1/a)x + 1
+                    * 
+ * where a = primitive root of field generator 0x14D + *

+
+ + initialise a VMPC cipher. + + @param forEncryption + whether or not we are for encryption. + @param params + the parameters required to set up the cipher. + @exception ArgumentException + if the params argument is inappropriate. + + + + Implementation of Daniel J. Bernstein's XSalsa20 stream cipher - Salsa20 with an extended nonce. + + + XSalsa20 requires a 256 bit key, and a 192 bit nonce. + + + + + XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce + using a core Salsa20 function without input addition to produce 256 bit working key + and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state. + + + + An XTEA engine. + + + Create an instance of the TEA encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
+ This implementation is based on ISO 18033/P1363a. +
+ + Construct a KDF Parameters generator. + + @param counterStart value of counter. + @param digest the digest to be used as the source of derived keys. + + + fill len bytes of the output buffer with bytes generated from + the derivation function. + + @throws ArgumentException if the size of the request will cause an overflow. + @throws DataLengthException if the out buffer is too small. + + + return the underlying digest. + + + Core of password hashing scheme Bcrypt, + designed by Niels Provos and David Mazières, + corresponds to the C reference implementation. +

+ This implementation does not correspondent to the 1999 published paper + "A Future-Adaptable Password Scheme" of Niels Provos and David Mazières, + see: https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node1.html. + In contrast to the paper, the order of key setup and salt setup is reversed: + state <- ExpandKey(state, 0, key) + state %lt;- ExpandKey(state, 0, salt) + This corresponds to the OpenBSD reference implementation of Bcrypt. +

+ Note: + There is no successful cryptanalysis (status 2015), but + the amount of memory and the band width of Bcrypt + may be insufficient to effectively prevent attacks + with custom hardware like FPGAs, ASICs +

+ This implementation uses some parts of Bouncy Castle's BlowfishEngine. +

+
+ + Size of the salt parameter in bytes + + + Minimum value of cost parameter, equal to log2(bytes of salt) + + + Maximum value of cost parameter (31 == 2,147,483,648) + + + Maximum size of password == max (unrestricted) size of Blowfish key + + + Derives a raw 192 bit Bcrypt key + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param psw the password + @return a 192 bit key + + + Calculates the bcrypt hash of a password. +

+ This implements the raw bcrypt function as defined in the bcrypt specification, not + the crypt encoded version implemented in OpenBSD. +

+ @param password the password bytes (up to 72 bytes) to use for this invocation. + @param salt the 128 bit salt to use for this invocation. + @param cost the bcrypt cost parameter. The cost of the bcrypt function grows as + 2^cost. Legal values are 4..31 inclusive. + @return the output of the raw bcrypt operation: a 192 bit (24 byte) hash. +
+ + initialise the key generator - if strength is set to zero + the key generated will be 64 bits in size, otherwise + strength can be 64 or 56 bits (if you don't count the parity bits). + + @param param the parameters to be used for key generation + + + initialise the key generator - if strength is set to zero + the key Generated will be 192 bits in size, otherwise + strength can be 128 or 192 (or 112 or 168 if you don't count + parity bits), depending on whether you wish to do 2-key or 3-key + triple DES. + + @param param the parameters to be used for key generation + + + a basic Diffie-Hellman key pair generator. + + This generates keys consistent for use with the basic algorithm for + Diffie-Hellman. + + + interface that a public/private key pair generator should conform to. + + + intialise the key pair generator. + + @param the parameters the key pair is to be initialised with. + + + return an AsymmetricCipherKeyPair containing the Generated keys. + + @return an AsymmetricCipherKeyPair containing the Generated keys. + + + a Diffie-Hellman key pair generator. + + This generates keys consistent for use in the MTI/A0 key agreement protocol + as described in "Handbook of Applied Cryptography", Pages 516-519. + + + which Generates the p and g values from the given parameters, + returning the DHParameters object. +

+ Note: can take a while...

+
+ + a DSA key pair generator. + + This Generates DSA keys in line with the method described + in FIPS 186-3 B.1 FFC Key Pair Generation. + + + Generate suitable parameters for DSA, in line with FIPS 186-2, or FIPS 186-3. + + + Initialise the generator + This form can only be used for older DSA (pre-DSA2) parameters + the size of keys in bits (from 512 up to 1024, and a multiple of 64) + measure of robustness of primes (at least 80 for FIPS 186-2 compliance) + the source of randomness to use + + + Initialise the generator for DSA 2 + You must use this Init method if you need to generate parameters for DSA 2 keys + An instance of DsaParameterGenerationParameters used to configure this generator + + + Generates a set of DsaParameters + Can take a while... + + + generate suitable parameters for DSA, in line with + FIPS 186-3 A.1 Generation of the FFC Primes p and q. + + + Given the domain parameters this routine generates an EC key + pair in accordance with X9.62 section 5.2.1 pages 26, 27. + + + a ElGamal key pair generator. +

+ This Generates keys consistent for use with ElGamal as described in + page 164 of "Handbook of Applied Cryptography".

+
+ + * which Generates the p and g values from the given parameters, + * returning the ElGamalParameters object. + *

+ * Note: can take a while... + *

+
+ + a GOST3410 key pair generator. + This generates GOST3410 keys in line with the method described + in GOST R 34.10-94. + + + generate suitable parameters for GOST3410. + + + initialise the key generator. + + @param size size of the key + @param typeProcedure type procedure A,B = 1; A',B' - else + @param random random byte source. + + + Procedure C + procedure generates the a value from the given p,q, + returning the a value. + + + which generates the p , q and a values from the given parameters, + returning the Gost3410Parameters object. + + + HMAC-based Extract-and-Expand Key Derivation Function (HKDF) implemented + according to IETF RFC 5869, May 2010 as specified by H. Krawczyk, IBM + Research & P. Eronen, Nokia. It uses a HMac internally to compute de OKM + (output keying material) and is likely to have better security properties + than KDF's based on just a hash function. + + + Creates a HKDFBytesGenerator based on the given hash function. + + @param hash the digest to be used as the source of generatedBytes bytes + + + Performs the extract part of the key derivation function. + + @param salt the salt to use + @param ikm the input keying material + @return the PRK as KeyParameter + + + Performs the expand part of the key derivation function, using currentT + as input and output buffer. + + @throws DataLengthException if the total number of bytes generated is larger than the one + specified by RFC 5869 (255 * HashLen) + + + KFD2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
+ This implementation is based on IEEE P1363/ISO 18033. +
+ + Construct a KDF1 byte generator. + + @param digest the digest to be used as the source of derived keys. + + + KDF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
+ This implementation is based on IEEE P1363/ISO 18033. +
+ + Construct a KDF2 bytes generator. Generates key material + according to IEEE P1363 or ISO 18033 depending on the initialisation. + + @param digest the digest to be used as the source of derived keys. + + + Generator for MGF1 as defined in Pkcs 1v2 + + + @param digest the digest to be used as the source of Generated bytes + + + int to octet string. + + + fill len bytes of the output buffer with bytes Generated from + the derivation function. + + @throws DataLengthException if the out buffer is too small. + + + return the underlying digest. + + + Key generation parameters for NaccacheStern cipher. For details on this cipher, please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Generates a permuted ArrayList from the original one. The original List + is not modified + + @param arr + the ArrayList to be permuted + @param rand + the source of Randomness for permutation + @return a new IList with the permuted elements. + + + Finds the first 'count' primes starting with 3 + + @param count + the number of primes to find + @return a vector containing the found primes as Integer + + + Password hashing scheme BCrypt, + designed by Niels Provos and David Mazières, using the + String format and the Base64 encoding + of the reference implementation on OpenBSD + + + Creates a 60 character Bcrypt String, including + version, cost factor, salt and hash, separated by '$' + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param password the password + @return a 60 character Bcrypt String + + + Creates a 60 character Bcrypt String, including + version, cost factor, salt and hash, separated by '$' + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param password the password + @return a 60 character Bcrypt String + + + Checks if a password corresponds to a 60 character Bcrypt String + + @param bcryptString a 60 character Bcrypt String, including + version, cost factor, salt and hash, + separated by '$' + @param password the password as an array of chars + @return true if the password corresponds to the + Bcrypt String, otherwise false + + + Generator for PBE derived keys and ivs as usd by OpenSSL. +

+ The scheme is a simple extension of PKCS 5 V2.0 Scheme 1 using MD5 with an + iteration count of 1. +

+
+ + super class for all Password Based Encyrption (Pbe) parameter generator classes. + + + base constructor. + + + initialise the Pbe generator. + + @param password the password converted into bytes (see below). + @param salt the salt to be mixed with the password. + @param iterationCount the number of iterations the "mixing" function + is to be applied for. + + + return the password byte array. + + @return the password byte array. + + + return the salt byte array. + + @return the salt byte array. + + + Generate derived parameters for a key of length keySize. + + @param keySize the length, in bits, of the key required. + @return a parameters object representing a key. + + + Generate derived parameters for a key of length keySize, and + an initialisation vector (IV) of length ivSize. + + @param keySize the length, in bits, of the key required. + @param ivSize the length, in bits, of the iv required. + @return a parameters object representing a key and an IV. + + + Generate derived parameters for a key of length keySize, specifically + for use with a MAC. + + @param keySize the length, in bits, of the key required. + @return a parameters object representing a key. + + + converts a password to a byte array according to the scheme in + Pkcs5 (ascii, no padding) + + @param password a character array representing the password. + @return a byte array representing the password. + + + converts a password to a byte array according to the scheme in + PKCS5 (UTF-8, no padding) + + @param password a character array representing the password. + @return a byte array representing the password. + + + converts a password to a byte array according to the scheme in + Pkcs12 (unicode, big endian, 2 zero pad bytes at the end). + + @param password a character array representing the password. + @return a byte array representing the password. + + + return the iteration count. + + @return the iteration count. + + + Construct a OpenSSL Parameters generator. + + + Initialise - note the iteration count for this algorithm is fixed at 1. + + @param password password to use. + @param salt salt to use. + + + the derived key function, the ith hash of the password and the salt. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + @exception ArgumentException if keySize + ivSize is larger than the base hash size. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 12 V1.0. +

+ The document this implementation is based on can be found at + + RSA's Pkcs12 Page +

+
+ + Construct a Pkcs 12 Parameters generator. + + @param digest the digest to be used as the source of derived keys. + @exception ArgumentException if an unknown digest is passed in. + + + add a + b + 1, returning the result in a. The a value is treated + as a BigInteger of length (b.Length * 8) bits. The result is + modulo 2^b.Length in case of overflow. + + + generation of a derived key ala Pkcs12 V1.0. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 1. + Note this generator is limited to the size of the hash produced by the + digest used to drive it. +

+ The document this implementation is based on can be found at + + RSA's Pkcs5 Page +

+
+ + Construct a Pkcs 5 Scheme 1 Parameters generator. + + @param digest the digest to be used as the source of derived keys. + + + the derived key function, the ith hash of the mPassword and the mSalt. + + + Generate a key parameter derived from the mPassword, mSalt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generate a key with initialisation vector parameter derived from + the mPassword, mSalt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + @exception ArgumentException if keySize + ivSize is larger than the base hash size. + + + Generate a key parameter for use with a MAC derived from the mPassword, + mSalt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 2. + This generator uses a SHA-1 HMac as the calculation function. +

+ The document this implementation is based on can be found at + + RSA's Pkcs5 Page

+
+ + construct a Pkcs5 Scheme 2 Parameters generator. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + + Generates keys for the Poly1305 MAC. + + + Poly1305 keys are 256 bit keys consisting of a 128 bit secret key used for the underlying block + cipher followed by a 128 bit {@code r} value used for the polynomial portion of the Mac.
+ The {@code r} value has a specific format with some bits required to be cleared, resulting in an + effective 106 bit key.
+ A separately generated 256 bit key can be modified to fit the Poly1305 key format by using the + {@link #clamp(byte[])} method to clear the required bits. +
+ +
+ + + Initialises the key generator. + + + Poly1305 keys are always 256 bits, so the key length in the provided parameters is ignored. + + + + + Generates a 256 bit key in the format required for Poly1305 - e.g. + k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + as per . + + + + + Modifies an existing 32 byte key value to comply with the requirements of the Poly1305 key by + clearing required bits in the r (second 16 bytes) portion of the key.
+ Specifically: +
    +
  • r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15})
  • +
  • r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252})
  • +
+
+ a 32 byte key value k[0] ... k[15], r[0] ... r[15] +
+ + + Checks a 32 byte key for compliance with the Poly1305 key requirements, e.g. + k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + as per . + + Key. + if the key is of the wrong length, or has invalid bits set + in the r portion of the key. + + + Generate a random factor suitable for use with RSA blind signatures + as outlined in Chaum's blinding and unblinding as outlined in + "Handbook of Applied Cryptography", page 475. + + + Initialise the factor generator + + @param param the necessary RSA key parameters. + + + Generate a suitable blind factor for the public key the generator was initialised with. + + @return a random blind factor + + + an RSA key pair generator. + + + Choose a random prime value for use with RSA + the bit-length of the returned prime + the RSA public exponent + a prime p, with (p-1) relatively prime to e + + + + Operators that reduce their input to a single block return an object + of this type. + + + + + Return the final result of the operation. + + A block of bytes, representing the result of an operation. + + + + Store the final result of the operation by copying it into the destination array. + + The number of bytes copied into destination. + The byte array to copy the result into. + The offset into destination to start copying the result at. + + + interface for classes implementing the Digital Signature Algorithm + + + initialise the signer for signature generation or signature + verification. + + @param forSigning true if we are generating a signature, false + otherwise. + @param param key parameters for signature generation. + + + sign the passed in message (usually the output of a hash function). + + @param message the message to be signed. + @return two big integers representing the r and s values respectively. + + + verify the message message against the signature values r and s. + + @param message the message that was supposed to have been signed. + @param r the r signature value. + @param s the s signature value. + + + + Base interface describing an entropy source for a DRBG. + + + + + Return a byte array of entropy. + + The entropy bytes. + + + + Return whether or not this entropy source is regarded as prediction resistant. + + true if this instance is prediction resistant; otherwise, false. + + + + Return the number of bits of entropy this source can produce. + + The size, in bits, of the return value of getEntropy. + + + + Base interface describing a provider of entropy sources. + + + + + Return an entropy source providing a block of entropy. + + The size of the block of entropy required. + An entropy source providing bitsRequired blocks of entropy. + + + The base interface for implementations of message authentication codes (MACs). + + + Initialise the MAC. + + @param param the key and other data required by the MAC. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Return the block size for this MAC (in bytes). + + @return the block size for this MAC in bytes. + + + add a single byte to the mac for processing. + + @param in the byte to be processed. + @exception InvalidOperationException if the MAC is not initialised. + + + @param in the array containing the input. + @param inOff the index in the array the data begins at. + @param len the length of the input starting at inOff. + @exception InvalidOperationException if the MAC is not initialised. + @exception DataLengthException if there isn't enough data in in. + + + Compute the final stage of the MAC writing the output to the out + parameter. +

+ doFinal leaves the MAC in the same state it was after the last init. +

+ @param out the array the MAC is to be output to. + @param outOff the offset into the out buffer the output is to start at. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the MAC is not initialised. +
+ + Reset the MAC. At the end of resetting the MAC should be in the + in the same state it was after the last init (if there was one). + + + Return the name of the algorithm the MAC implements. + + @return the name of the algorithm the MAC implements. + + + this exception is thrown whenever we find something we don't expect in a + message. + + + base constructor. + + + create a InvalidCipherTextException with the given message. + + @param message the message to be carried with the exception. + + + + Base interface for operators that serve as stream-based signature calculators. + + + + + Create a stream calculator for this signature calculator. The stream + calculator is used for the actual operation of entering the data to be signed + and producing the signature block. + + A calculator producing an IBlockResult with a signature in it. + + + The algorithm details object for this calculator. + + + Initialise the signer for signing or verification. + + @param forSigning true if for signing, false otherwise + @param param necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + return true if the internal state represents the signature described + in the passed in array. + + + reset the internal state + + + Return the name of the algorithm the signer implements. + + @return the name of the algorithm the signer implements. + + + Signer with message recovery. + + + Returns true if the signer has recovered the full message as + part of signature verification. + + @return true if full message recovered. + + + Returns a reference to what message was recovered (if any). + + @return full/partial message, null if nothing. + + + Perform an update with the recovered message before adding any other data. This must + be the first update method called, and calling it will result in the signer assuming + that further calls to update will include message content past what is recoverable. + + @param signature the signature that we are in the process of verifying. + @throws IllegalStateException + + + + Base interface for cryptographic operations such as Hashes, MACs, and Signatures which reduce a stream of data + to a single value. + + + + + Return the result of processing the stream. This value is only available once the stream + has been closed. + + The result of processing the stream. + + + Return a "sink" stream which only exists to update the implementing object. + A stream to write to in order to update the implementing object. + + + + Operators that reduce their input to the validation of a signature produce this type. + + + + + Return true if the passed in data matches what is expected by the verification result. + + The bytes representing the signature. + true if the signature verifies, false otherwise. + + + + Return true if the length bytes from off in the source array match the signature + expected by the verification result. + + Byte array containing the signature. + The offset into the source array where the signature starts. + The number of bytes in source making up the signature. + true if the signature verifies, false otherwise. + + + + Base interface for operators that serve as stream-based signature verifiers. + + + + + Create a stream calculator for this verifier. The stream + calculator is used for the actual operation of entering the data to be verified + and producing a result which can be used to verify the original signature. + + A calculator producing an IVerifier which can verify the signature. + + + The algorithm details object for this verifier. + + + + Base interface for a provider to support the dynamic creation of signature verifiers. + + + + + Return a signature verfier for signature algorithm described in the passed in algorithm details object. + + The details of the signature algorithm verification is required for. + A new signature verifier. + + + The base class for parameters to key generators. + + + initialise the generator with a source of randomness + and a strength (in bits). + + @param random the random byte source. + @param strength the size, in bits, of the keys we want to produce. + + + return the random source associated with this + generator. + + @return the generators random source. + + + return the bit strength for keys produced by this generator, + + @return the strength of the keys this generator produces (in bits). + + + standard CBC Block Cipher MAC - if no padding is specified the default of + pad of zeroes is used. + + + create a standard MAC based on a CBC block cipher. This will produce an + authentication code half the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a CBC block cipher. This will produce an + authentication code half the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used to complete the last block. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CBC mode as the basis for the + MAC generation. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
+ + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CBC mode as the basis for the + MAC generation. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding the padding to be used to complete the last block. +
+ + Reset the mac generator. + + + implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CFB" + and the block size in bits. + + + create a standard MAC based on a CFB block cipher. This will produce an + authentication code half the length of the block size of the cipher, with + the CFB mode set to 8 bits. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a CFB block cipher. This will produce an + authentication code half the length of the block size of the cipher, with + the CFB mode set to 8 bits. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CFB mode as the basis for the + MAC generation. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param cfbBitSize the size of an output block produced by the CFB mode. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
+ + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CFB mode as the basis for the + MAC generation. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param cfbBitSize the size of an output block produced by the CFB mode. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding a padding to be used. +
+ + Reset the mac generator. + + + CMAC - as specified at www.nuee.nagoya-u.ac.jp/labs/tiwata/omac/omac.html +

+ CMAC is analogous to OMAC1 - see also en.wikipedia.org/wiki/CMAC +

+ CMAC is a NIST recomendation - see + csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38B.pdf +

+ CMAC/OMAC1 is a blockcipher-based message authentication code designed and + analyzed by Tetsu Iwata and Kaoru Kurosawa. +

+ CMAC/OMAC1 is a simple variant of the CBC MAC (Cipher Block Chaining Message + Authentication Code). OMAC stands for One-Key CBC MAC. +

+ It supports 128- or 64-bits block ciphers, with any key size, and returns + a MAC with dimension less or equal to the block size of the underlying + cipher. +

+
+ + create a standard MAC based on a CBC block cipher (64 or 128 bit block). + This will produce an authentication code the length of the block size + of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). + + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8 and @lt;= 128. + + + Reset the mac generator. + + +

+ The GMAC specialisation of Galois/Counter mode (GCM) detailed in NIST Special Publication + 800-38D. + + + GMac is an invocation of the GCM mode where no data is encrypted (i.e. all input data to the Mac + is processed as additional authenticated data with the underlying GCM block cipher). + +
+ + + Creates a GMAC based on the operation of a block cipher in GCM mode. + + + This will produce an authentication code the length of the block size of the cipher. + + the cipher to be used in GCM mode to generate the MAC. + + + + Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode. + + + This will produce an authentication code the length of the block size of the cipher. + + the cipher to be used in GCM mode to generate the MAC. + the mac size to generate, in bits. Must be a multiple of 8, between 32 and 128 (inclusive). + Sizes less than 96 are not recommended, but are supported for specialized applications. + + + + Initialises the GMAC - requires a + providing a and a nonce. + + + + implementation of GOST 28147-89 MAC + + + HMAC implementation based on RFC2104 + + H(K XOR opad, H(K XOR ipad, text)) + + + Reset the mac generator. + + + DES based CBC Block Cipher MAC according to ISO9797, algorithm 3 (ANSI X9.19 Retail MAC) + + This could as well be derived from CBCBlockCipherMac, but then the property mac in the base + class must be changed to protected + + + create a Retail-MAC based on a CBC block cipher. This will produce an + authentication code of the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. This must + be DESEngine. + + + create a Retail-MAC based on a CBC block cipher. This will produce an + authentication code of the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used to complete the last block. + + + create a Retail-MAC based on a block cipher with the size of the + MAC been given in bits. This class uses single DES CBC mode as the basis for the + MAC generation. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
+ + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses single DES CBC mode as the basis for the + MAC generation. The final block is decrypted and then encrypted using the + middle and right part of the key. +

+ Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

+ @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding the padding to be used to complete the last block. +
+ + Reset the mac generator. + + + + Poly1305 message authentication code, designed by D. J. Bernstein. + + + Poly1305 computes a 128-bit (16 bytes) authenticator, using a 128 bit nonce and a 256 bit key + consisting of a 128 bit key applied to an underlying cipher, and a 128 bit key (with 106 + effective key bits) used in the authenticator. + + The polynomial calculation in this implementation is adapted from the public domain poly1305-donna-unrolled C implementation + by Andrew M (@floodyberry). + + + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Encrypted nonce + + + Encrypted nonce + + + Encrypted nonce + + + Encrypted nonce + + + Current block of buffered input + + + Current offset in input buffer + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Constructs a Poly1305 MAC, where the key passed to init() will be used directly. + + + Constructs a Poly1305 MAC, using a 128 bit block cipher. + + + + Initialises the Poly1305 MAC. + + a {@link ParametersWithIV} containing a 128 bit nonce and a {@link KeyParameter} with + a 256 bit key complying to the {@link Poly1305KeyGenerator Poly1305 key format}. + + + + Implementation of SipHash as specified in "SipHash: a fast short-input PRF", by Jean-Philippe + Aumasson and Daniel J. Bernstein (https://131002.net/siphash/siphash.pdf). + + + "SipHash is a family of PRFs SipHash-c-d where the integer parameters c and d are the number of + compression rounds and the number of finalization rounds. A compression round is identical to a + finalization round and this round function is called SipRound. Given a 128-bit key k and a + (possibly empty) byte string m, SipHash-c-d returns a 64-bit value..." + + + + SipHash-2-4 + + + SipHash-c-d + the number of compression rounds + the number of finalization rounds + + + + Implementation of the Skein parameterised MAC function in 256, 512 and 1024 bit block sizes, + based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

+ Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + + + + + +

+ 256 bit block size - Skein-256 + +
+ + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + + Constructs a Skein MAC with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/MAC size to produce in bits, which must be an integral number of + bytes. + + + + Optionally initialises the Skein digest with the provided parameters. + + See for details on the parameterisation of the Skein hash function. + the parameters to apply to this engine, or null to use no parameters. + + + + This exception is thrown whenever a cipher requires a change of key, iv + or similar after x amount of bytes enciphered + + + + implements Cipher-Block-Chaining (CBC) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of chaining. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size of the underlying cipher. + + @return the block size of the underlying cipher. + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + Do the appropriate chaining step for CBC mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate chaining step for CBC mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the decrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CBC". + + + Implements the Counter with Cipher Block Chaining mode (CCM) detailed in + NIST Special Publication 800-38C. +

+ Note: this mode is a packet mode - it needs all the data up front. +

+
+ + + A block cipher mode that includes authenticated encryption with a streaming mode + and optional associated data. + + + + The block cipher underlying this algorithm. + + + Initialise the cipher. + Parameter can either be an AeadParameters or a ParametersWithIV object. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The block size for this cipher, in bytes. + + + Add a single byte to the associated data check. + If the implementation supports it, this will be an online operation and will not retain the associated data. + The byte to be processed. + + + Add a sequence of bytes to the associated data check. + If the implementation supports it, this will be an online operation and will not retain the associated data. + The input byte array. + The offset into the input array where the data to be processed starts. + The number of bytes to be processed. + + + Encrypt/decrypt a single byte. + + @param input the byte to be processed. + @param outBytes the output buffer the processed byte goes into. + @param outOff the offset into the output byte array the processed data starts at. + @return the number of bytes written to out. + @exception DataLengthException if the output buffer is too small. + + + Process a block of bytes from in putting the result into out. + + @param inBytes the input byte array. + @param inOff the offset into the in array where the data to be processed starts. + @param len the number of bytes to be processed. + @param outBytes the output buffer the processed bytes go into. + @param outOff the offset into the output byte array the processed data starts at. + @return the number of bytes written to out. + @exception DataLengthException if the output buffer is too small. + + + Finish the operation either appending or verifying the MAC at the end of the data. + + @param outBytes space for any resulting output data. + @param outOff offset into out to start copying the data at. + @return number of bytes written into out. + @throws InvalidOperationException if the cipher is in an inappropriate state. + @throws InvalidCipherTextException if the MAC fails to match. + + + Return the value of the MAC associated with the last stream processed. + + @return MAC for plaintext data. + + + Return the size of the output buffer required for a ProcessBytes + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to ProcessBytes + with len bytes of input. + + + Return the size of the output buffer required for a ProcessBytes plus a + DoFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to ProcessBytes and DoFinal + with len bytes of input. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Basic constructor. + + @param cipher the block cipher to be used. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Returns a byte array containing the mac calculated as part of the + last encrypt or decrypt operation. + + @return the last mac calculated. + + + Process a packet of data for either CCM decryption or encryption. + + @param in data for processing. + @param inOff offset at which data starts in the input array. + @param inLen length of the data in the input array. + @return a byte array containing the processed input.. + @throws IllegalStateException if the cipher is not appropriately set up. + @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + + + Process a packet of data for either CCM decryption or encryption. + + @param in data for processing. + @param inOff offset at which data starts in the input array. + @param inLen length of the data in the input array. + @param output output array. + @param outOff offset into output array to start putting processed bytes. + @return the number of bytes added to output. + @throws IllegalStateException if the cipher is not appropriately set up. + @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + @throws DataLengthException if output buffer too short. + + + implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CFB" + and the block size in bits. + + + A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to + be used to produce cipher text which is the same outLength as the plain text. + + + Create a buffered block cipher that uses Cipher Text Stealing + + @param cipher the underlying block cipher this buffering object wraps. + + + return the size of the output buffer required for an update of 'length' bytes. + + @param length the outLength of the input. + @return the space required to accommodate a call to update + with length bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of length bytes. + + @param length the outLength of the input. + @return the space required to accommodate a call to update and doFinal + with length bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param length the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if cipher text decrypts wrongly (in + case the exception will never Get thrown). + + + A Two-Pass Authenticated-Encryption Scheme Optimized for Simplicity and + Efficiency - by M. Bellare, P. Rogaway, D. Wagner. + + http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf + + EAX is an AEAD scheme based on CTR and OMAC1/CMAC, that uses a single block + cipher to encrypt and authenticate data. It's on-line (the length of a + message isn't needed to begin processing it), has good performances, it's + simple and provably secure (provided the underlying block cipher is secure). + + Of course, this implementations is NOT thread-safe. + + + Constructor that accepts an instance of a block cipher engine. + + @param cipher the engine to use + + + + Implements the Galois/Counter mode (GCM) detailed in + NIST Special Publication 800-38D. + + + + + MAC sizes from 32 bits to 128 bits (must be a multiple of 8) are supported. The default is 128 bits. + Sizes less than 96 are not recommended, but are supported for specialized applications. + + + + implements the GOST 28147 OFB counter mode (GCTR). + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + counter mode (must have a 64 bit block size). + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param encrypting if true the cipher is initialised for + encryption, if false for decryption. + @param parameters the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is inappropriate. + + + return the block size we are operating at (in bytes). + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the feedback vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/GCTR" + and the block size in bits + + + An implementation of RFC 7253 on The OCB + Authenticated-Encryption Algorithm, licensed per: + +

License for + Open-Source Software Implementations of OCB (Jan 9, 2013) - 'License 1'
+ Under this license, you are authorized to make, use, and distribute open-source software + implementations of OCB. This license terminates for you if you sue someone over their open-source + software implementation of OCB claiming that you have a patent covering their implementation. +

+ This is a non-binding summary of a legal document (the link above). The parameters of the license + are specified in the license document and that document is controlling.

+
+ + implements a Output-FeedBack (OFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at (in bytes). + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the feedback vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/OFB" + and the block size in bits + + + * Implements OpenPGP's rather strange version of Cipher-FeedBack (CFB) mode + * on top of a simple cipher. This class assumes the IV has been prepended + * to the data stream already, and just accomodates the reset after + * (blockSize + 2) bytes have been read. + *

+ * For further info see RFC 2440. + *

+
+ + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param parameters the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt one byte of data according to CFB mode. + @param data the byte to encrypt + @param blockOff offset in the current block + @returns the encrypted byte + + + Do the appropriate processing for CFB IV mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB IV mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/PGPCFB" + and the block size in bits. + + + Implements the Segmented Integer Counter (SIC) mode on top of a simple + block cipher. + + + Basic constructor. + + @param c the block cipher to be used. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Calculator factory class for signature generation in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + signature algorithm details. + + + + + Base constructor. + + The name of the signature algorithm to use. + The private key to be used in the signing operation. + + + + Constructor which also specifies a source of randomness to be used if one is required. + + The name of the signature algorithm to use. + The private key to be used in the signing operation. + The source of randomness to be used in signature calculation. + + + + Allows enumeration of the signature names supported by the verifier provider. + + + + + Verifier class for signature verification in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + signature algorithm details. + + + + + Base constructor. + + The name of the signature algorithm to use. + The public key to be used in the verification operation. + + + + Provider class which supports dynamic creation of signature verifiers. + + + + + Base constructor - specify the public key to be used in verification. + + The public key to be used in creating verifiers provided by this object. + + + + Allows enumeration of the signature names supported by the verifier provider. + + + + Block cipher padders are expected to conform to this interface + + + Initialise the padder. + + @param param parameters, if any required. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + @exception InvalidCipherTextException if the padding is badly formed + or invalid. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds ISO10126-2 padding to a block. + + + Initialise the padder. + + @param random a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds the padding according to the scheme referenced in + ISO 7814-4 - scheme 2 from ISO 9797-1. The first byte is 0x80, rest is 0x00 + + + Initialise the padder. + + @param random - a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the padder implements. + + @return the name of the algorithm the padder implements. + + + A wrapper class that allows block ciphers to be used to process data in + a piecemeal fashion with padding. The PaddedBufferedBlockCipher + outputs a block only when the buffer is full and more data is being added, + or on a doFinal (unless the current block in the buffer is a pad block). + The default padding mechanism used is the one outlined in Pkcs5/Pkcs7. + + + Create a buffered block cipher with the desired padding. + + @param cipher the underlying block cipher this buffering object wraps. + @param padding the padding type. + + + Create a buffered block cipher Pkcs7 padding + + @param cipher the underlying block cipher this buffering object wraps. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the minimum size of the output buffer required for an update + plus a doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. If the buffer is currently + full and padding needs to be added a call to doFinal will produce + 2 * GetBlockSize() bytes. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output or we are decrypting and the input is not block size aligned. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + + + A padder that adds Pkcs7/Pkcs5 padding to a block. + + + Initialise the padder. + + @param random - a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds Trailing-Bit-Compliment padding to a block. +

+ This padding pads the block out compliment of the last bit + of the plain text. +

+
+
+ + Initialise the padder. + - a SecureRandom if available. + + + + add the pad bytes to the passed in block, returning the + number of bytes added. +

+ Note: this assumes that the last block of plain text is always + passed to it inside in. i.e. if inOff is zero, indicating the + entire block is to be overwritten with padding the value of in + should be the same as the last block of plain text. +

+
+
+ + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + the name of the algorithm the cipher implements. + + + + A padder that adds X9.23 padding to a block - if a SecureRandom is + passed in random padding is assumed, otherwise padding with zeros is used. + + + Initialise the padder. + + @param random a SecureRandom if one is available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds Null byte padding to a block. + + + Initialise the padder. + + + - a SecureRandom if available. + + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + + the name of the algorithm the cipher implements. + + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + @param associatedText associated text, if any + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + @param associatedText associated text, if any + + + DES has 16 weak keys. This method will check + if the given DES key material is weak or semi-weak. + Key material that is too short is regarded as weak. +

+ See "Applied + Cryptography" by Bruce Schneier for more information. +

+ @return true if the given DES key material is weak or semi-weak, + false otherwise. +
+ + DES Keys use the LSB as the odd parity bit. This can + be used to check for corrupt keys. + + @param bytes the byte array to set the parity on. + + + return true if the passed in key is a DES-EDE weak key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + @param length number of bytes making up the key + + + return true if the passed in key is a DES-EDE weak key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 2/3 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 2 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 3 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + The minimum bitlength of the private value. + + + The bitlength of the private value. + + + Construct without a usage index, this will do a random construction of G. + + @param L desired length of prime P in bits (the effective key size). + @param N desired length of prime Q in bits. + @param certainty certainty level for prime number generation. + @param random the source of randomness to use. + + + Construct for a specific usage index - this has the effect of using verifiable canonical generation of G. + + @param L desired length of prime P in bits (the effective key size). + @param N desired length of prime Q in bits. + @param certainty certainty level for prime number generation. + @param random the source of randomness to use. + @param usageIndex a valid usage index. + + + return the generator - g + + + return private value limit - l + + + Parameter class for the HkdfBytesGenerator class. + + + Generates parameters for HKDF, specifying both the optional salt and + optional info. Step 1: Extract won't be skipped. + + @param ikm the input keying material or seed + @param salt the salt to use, may be null for a salt for hashLen zeros + @param info the info to use, may be null for an info field of zero bytes + + + Factory method that makes the HKDF skip the extract part of the key + derivation function. + + @param ikm the input keying material or seed, directly used for step 2: + Expand + @param info the info to use, may be null for an info field of zero bytes + @return HKDFParameters that makes the implementation skip step 1 + + + Returns the input keying material or seed. + + @return the keying material + + + Returns the salt, or null if the salt should be generated as a byte array + of HashLen zeros. + + @return the salt, or null + + + Returns the info field, which may be empty (null is converted to empty). + + @return the info field, never null + + + Returns if step 1: extract has to be skipped or not + + @return true for skipping, false for no skipping of step 1 + + + parameters for using an integrated cipher in stream mode. + + + @param derivation the derivation parameter for the KDF function. + @param encoding the encoding parameter for the KDF function. + @param macKeySize the size of the MAC key (in bits). + + + @param derivation the derivation parameter for the KDF function. + @param encoding the encoding parameter for the KDF function. + @param macKeySize the size of the MAC key (in bits). + @param cipherKeySize the size of the associated Cipher key (in bits). + + + parameters for Key derivation functions for ISO-18033 + + + parameters for Key derivation functions for IEEE P1363a + + + Parameters for mask derivation functions. + + + Parameters for NaccacheStern public private key generation. For details on + this cipher, please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Parameters for generating a NaccacheStern KeyPair. + + @param random + The source of randomness + @param strength + The desired strength of the Key in Bits + @param certainty + the probability that the generated primes are not really prime + as integer: 2^(-certainty) is then the probability + @param countSmallPrimes + How many small key factors are desired + + + * Parameters for a NaccacheStern KeyPair. + * + * @param random + * The source of randomness + * @param strength + * The desired strength of the Key in Bits + * @param certainty + * the probability that the generated primes are not really prime + * as integer: 2^(-certainty) is then the probability + * @param cntSmallPrimes + * How many small key factors are desired + * @param debug + * Ignored + + + @return Returns the certainty. + + + @return Returns the countSmallPrimes. + + + Public key parameters for NaccacheStern cipher. For details on this cipher, + please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + @param privateKey + + + @return Returns the g. + + + @return Returns the lowerSigmaBound. + + + @return Returns the n. + + + Private key parameters for NaccacheStern cipher. For details on this cipher, + please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Constructs a NaccacheSternPrivateKey + + @param g + the public enryption parameter g + @param n + the public modulus n = p*q + @param lowerSigmaBound + the public lower sigma bound up to which data can be encrypted + @param smallPrimes + the small primes, of which sigma is constructed in the right + order + @param phi_n + the private modulus phi(n) = (p-1)(q-1) + + + Cipher parameters with a fixed salt value associated with them. + + + + Parameters for the Skein hash function - a series of byte[] strings identified by integer tags. + + + Parameterised Skein can be used for: +
    +
  • MAC generation, by providing a key.
  • +
  • Randomised hashing, by providing a nonce.
  • +
  • A hash function for digital signatures, associating a + public key with the message digest.
  • +
  • A key derivation function, by providing a + key identifier.
  • +
  • Personalised hashing, by providing a + recommended format or + arbitrary personalisation string.
  • +
+
+ + + +
+ + + The parameter type for a secret key, supporting MAC or KDF functions: 0 + + + + + The parameter type for the Skein configuration block: 4 + + + + + The parameter type for a personalisation string: 8 + + + + + The parameter type for a public key: 12 + + + + + The parameter type for a key identifier string: 16 + + + + + The parameter type for a nonce: 20 + + + + + The parameter type for the message: 48 + + + + + The parameter type for the output transformation: 63 + + + + + Obtains a map of type (int) to value (byte[]) for the parameters tracked in this object. + + + + + Obtains the value of the key parameter, or null if not + set. + + The key. + + + + Obtains the value of the personalisation parameter, or + null if not set. + + + + + Obtains the value of the public key parameter, or + null if not set. + + + + + Obtains the value of the key identifier parameter, or + null if not set. + + + + + Obtains the value of the nonce parameter, or null if + not set. + + + + + A builder for . + + + + + Sets a parameters to apply to the Skein hash function. + + + Parameter types must be in the range 0,5..62, and cannot use the value 48 + (reserved for message body). +

+ Parameters with type < 48 are processed before + the message content, parameters with type > 48 + are processed after the message and prior to output. + + the type of the parameter, in the range 5..62. + the byte sequence of the parameter. + + +

+ Sets the parameter. + +
+ + + Sets the parameter. + + + + + Implements the recommended personalisation format for Skein defined in Section 4.11 of + the Skein 1.3 specification. + + + The format is YYYYMMDD email@address distinguisher, encoded to a byte + sequence using UTF-8 encoding. + + the date the personalised application of the Skein was defined. + the email address of the creation of the personalised application. + an arbitrary personalisation string distinguishing the application. + + + + Sets the parameter. + + + + + Sets the parameter. + + + + + Sets the parameter. + + + + + Constructs a new instance with the parameters provided to this + builder. + + + + + Parameters for tweakable block ciphers. + + + + + Gets the key. + + the key to use, or null to use the current key. + + + + Gets the tweak value. + + The tweak to use, or null to use the current tweak. + + + An EntropySourceProvider where entropy generation is based on a SecureRandom output using SecureRandom.generateSeed(). + + + Create a entropy source provider based on the passed in SecureRandom. + + @param secureRandom the SecureRandom to base EntropySource construction on. + @param isPredictionResistant boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is). + + + Return an entropy source that will create bitsRequired bits of entropy on + each invocation of getEntropy(). + + @param bitsRequired size (in bits) of entropy to be created by the provided source. + @return an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method. + + + + Uses Microsoft's RNGCryptoServiceProvider + + + + Generic interface for objects generating random bytes. + + + Add more seed material to the generator. + A byte array to be mixed into the generator's state. + + + Add more seed material to the generator. + A long value to be mixed into the generator's state. + + + Fill byte array with random values. + Array to be filled. + + + Fill byte array with random values. + Array to receive bytes. + Index to start filling at. + Length of segment to fill. + + + Random generation based on the digest with counter. Calling AddSeedMaterial will + always increase the entropy of the hash. +

+ Internal access to the digest is synchronized so a single one of these can be shared. +

+
+ + A SP800-90A CTR DRBG. + + + Interface to SP800-90A deterministic random bit generators. + + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size of the DRBG. + + @return the block size (in bits) produced by each round of the DRBG. + + + Construct a SP800-90A CTR DRBG. +

+ Minimum entropy requirement is the security strength requested. +

+ @param engine underlying block cipher to use to support DRBG + @param keySizeInBits size of the key to use with the block cipher. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
+ + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Pad out a key for TDEA, setting odd parity for each byte. + + @param keyMaster + @param keyOff + @param tmp + @param tmpOff + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each internal round of the DRBG. + + + Used by both Dual EC and Hash. + + + A SP800-90A Hash DRBG. + + + Construct a SP800-90A Hash DRBG. +

+ Minimum entropy requirement is the security strength requested. +

+ @param digest source digest to use for DRB stream. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
+ + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each internal round of the DRBG. + + + A SP800-90A HMAC DRBG. + + + Construct a SP800-90A Hash DRBG. +

+ Minimum entropy requirement is the security strength requested. +

+ @param hMac Hash MAC to base the DRBG on. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
+ + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each round of the DRBG. + + + Generate numBytes worth of entropy from the passed in entropy source. + + @param entropySource the entropy source to request the data from. + @param numBytes the number of bytes of entropy requested. + @return a byte array populated with the random data. + + + + Takes bytes generated by an underling RandomGenerator and reverses the order in + each small window (of configurable size). +

+ Access to internals is synchronized so a single one of these can be shared. +

+
+
+ + Add more seed material to the generator. + A byte array to be mixed into the generator's state. + + + Add more seed material to the generator. + A long value to be mixed into the generator's state. + + + Fill byte array with random values. + Array to be filled. + + + Fill byte array with random values. + Array to receive bytes. + Index to start filling at. + Length of segment to fill. + + + + Create and auto-seed an instance based on the given algorithm. + + Equivalent to GetInstance(algorithm, true) + e.g. "SHA256PRNG" + + + + Create an instance based on the given algorithm, with optional auto-seeding + + e.g. "SHA256PRNG" + If true, the instance will be auto-seeded. + + + + To replicate existing predictable output, replace with GetInstance("SHA1PRNG", false), followed by SetSeed(seed) + + + + Use the specified instance of IRandomGenerator as random source. + + This constructor performs no seeding of either the IRandomGenerator or the + constructed SecureRandom. It is the responsibility of the client to provide + proper seed material as necessary/appropriate for the given IRandomGenerator + implementation. + + The source to generate all random bytes from. + + + Builder class for making SecureRandom objects based on SP 800-90A Deterministic Random Bit Generators (DRBG). + + + Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + predictionResistant set to false. +

+ Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the default SecureRandom does for its generateSeed() call. +

+
+ + Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + for prediction resistance. +

+ Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the passed in SecureRandom does for its generateSeed() call. +

+ @param entropySource + @param predictionResistant +
+ + Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. +

+ Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. +

+ @param entropySourceProvider a provider of EntropySource objects. +
+ + Set the personalization string for DRBG SecureRandoms created by this builder + @param personalizationString the personalisation string for the underlying DRBG. + @return the current builder. + + + Set the security strength required for DRBGs used in building SecureRandom objects. + + @param securityStrength the security strength (in bits) + @return the current builder. + + + Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects. + + @param entropyBitsRequired the number of bits of entropy to be requested from the entropy source on each seed/reseed. + @return the current builder. + + + Build a SecureRandom based on a SP 800-90A Hash DRBG. + + @param digest digest algorithm to use in the DRBG underneath the SecureRandom. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a Hash DRBG. + + + Build a SecureRandom based on a SP 800-90A CTR DRBG. + + @param cipher the block cipher to base the DRBG on. + @param keySizeInBits key size in bits to be used with the block cipher. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a CTR DRBG. + + + Build a SecureRandom based on a SP 800-90A HMAC DRBG. + + @param hMac HMAC algorithm to use in the DRBG underneath the SecureRandom. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a HMAC DRBG. + + + A thread based seed generator - one source of randomness. +

+ Based on an idea from Marcus Lippert. +

+
+ + Generate seed bytes. Set fast to false for best quality. +

+ If fast is set to true, the code should be round about 8 times faster when + generating a long sequence of random bytes. 20 bytes of random values using + the fast mode take less than half a second on a Nokia e70. If fast is set to false, + it takes round about 2500 ms. +

+ @param numBytes the number of bytes to generate + @param fast true if fast mode should be used +
+ + + Permutation generated by code: + + // First 1850 fractional digit of Pi number. + byte[] key = new BigInteger("14159265358979323846...5068006422512520511").ToByteArray(); + s = 0; + P = new byte[256]; + for (int i = 0; i < 256; i++) + { + P[i] = (byte) i; + } + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + key[m % key.length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + + + Value generated in the same way as P. + + + + @param engine + @param entropySource + + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the RNG. + + + Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + predictionResistant set to false. +

+ Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the default SecureRandom does for its generateSeed() call. +

+
+ + Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + for prediction resistance. +

+ Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the passed in SecureRandom does for its generateSeed() call. +

+ @param entropySource + @param predictionResistant +
+ + Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. +

+ Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. +

+ @param entropySourceProvider a provider of EntropySource objects. +
+ + Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the + generator will be reseeded on each request. + + @param engine a block cipher to use as the operator. + @param key the block cipher key to initialise engine with. + @param predictionResistant true if engine to be reseeded on each use, false otherwise. + @return a SecureRandom. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + true if the internal state represents the signature described in the passed in array. + + + Reset the internal state + + + The Digital Signature Algorithm - as described in "Handbook of Applied + Cryptography", pages 452 - 453. + + + Default configuration, random K values. + + + Configuration with an alternate, possibly deterministic calculator of K. + + @param kCalculator a K value calculator. + + + Generate a signature for the given message using the key we were + initialised with. For conventional DSA the message should be a SHA-1 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a DSA signature for + the passed in message for standard DSA the message should be a + SHA-1 hash of the real message to be verified. + + + EC-DSA as described in X9.62 + + + Default configuration, random K values. + + + Configuration with an alternate, possibly deterministic calculator of K. + + @param kCalculator a K value calculator. + + + Generate a signature for the given message using the key we were + initialised with. For conventional DSA the message should be a SHA-1 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a DSA signature for + the passed in message (for standard DSA the message should be + a SHA-1 hash of the real message to be verified). + + + GOST R 34.10-2001 Signature Algorithm + + + generate a signature for the given message using the key we were + initialised with. For conventional GOST3410 the message should be a GOST3411 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a GOST3410 signature for + the passed in message (for standard GOST3410 the message should be + a GOST3411 hash of the real message to be verified). + + + EC-NR as described in IEEE 1363-2000 + + + generate a signature for the given message using the key we were + initialised with. Generally, the order of the curve should be at + least as long as the hash of the message of interest, and with + ECNR it *must* be at least as long. + + @param digest the digest to be signed. + @exception DataLengthException if the digest is longer than the key allows + + + return true if the value r and s represent a signature for the + message passed in. Generally, the order of the curve should be at + least as long as the hash of the message of interest, and with + ECNR, it *must* be at least as long. But just in case the signer + applied mod(n) to the longer digest, this implementation will + apply mod(n) during verification. + + @param digest the digest to be verified. + @param r the r value of the signature. + @param s the s value of the signature. + @exception DataLengthException if the digest is longer than the key allows + + + initialise the signer for signing or verification. + + @param forSigning + true if for signing, false otherwise + @param parameters + necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using the key + we were initialised with. + + + return true if the internal state represents the signature described in + the passed in array. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + true if the internal state represents the signature described in the passed in array. + + + Reset the internal state + + + Gost R 34.10-94 Signature Algorithm + + + generate a signature for the given message using the key we were + initialised with. For conventional Gost3410 the message should be a Gost3411 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a Gost3410 signature for + the passed in message for standard Gost3410 the message should be a + Gost3411 hash of the real message to be verified. + + + A deterministic K calculator based on the algorithm in section 3.2 of RFC 6979. + + + Interface define calculators of K values for DSA/ECDSA. + + + Non-deterministic initialiser. + + @param n the order of the DSA group. + @param random a source of randomness. + + + Deterministic initialiser. + + @param n the order of the DSA group. + @param d the DSA private value. + @param message the message being signed. + + + Return the next valid value of K. + + @return a K value. + + + Return true if this calculator is deterministic, false otherwise. + + @return true if deterministic, otherwise false. + + + Base constructor. + + @param digest digest to build the HMAC on. + + + ISO9796-2 - mechanism using a hash function with recovery (scheme 2 and 3). +

+ Note: the usual length for the salt is the length of the hash + function used in bytes.

+
+
+ + + Return a reference to the recoveredMessage message. + + The full/partial recoveredMessage message. + + + + + Generate a signer with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3. + + base cipher to use for signature creation/verification + digest to use. + length of salt in bytes. + whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + + cipher to use. + + digest to sign with. + + length of salt in bytes. + + + + Initialise the signer. + true if for signing, false if for verification. + parameters for signature generation/verification. If the + parameters are for generation they should be a ParametersWithRandom, + a ParametersWithSalt, or just an RsaKeyParameters object. If RsaKeyParameters + are passed in a SecureRandom will be created. + + if wrong parameter type or a fixed + salt is passed in which is the wrong length. + + + + compare two byte arrays - constant time. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the loaded message using the key we were + initialised with. + + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + + + Return true if the full message was recoveredMessage. + + true on full message recovery, false otherwise, or if not sure. + + + + int to octet string. + int to octet string. + + + long to octet string. + + + mask generator function, as described in Pkcs1v2. + + + ISO9796-2 - mechanism using a hash function with recovery (scheme 1) + + + + Return a reference to the recoveredMessage message. + + The full/partial recoveredMessage message. + + + + + Generate a signer with either implicit or explicit trailers for ISO9796-2. + + base cipher to use for signature creation/verification + digest to use. + whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + + cipher to use. + + digest to sign with. + + + + compare two byte arrays - constant time. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the loaded message using the key we were + initialised with. + + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + + + Return true if the full message was recoveredMessage. + + true on full message recovery, false otherwise. + + + + RSA-PSS as described in Pkcs# 1 v 2.1. +

+ Note: the usual value for the salt length is the number of + bytes in the hash function.

+
+
+ + Basic constructor + the asymmetric cipher to use. + the digest to use. + the length of the salt to use (in bytes). + + + Basic constructor + the asymmetric cipher to use. + the digest to use. + the fixed salt to be used. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + + return true if the internal state represents the signature described + in the passed in array. + + + + int to octet string. + + + mask generator function, as described in Pkcs1v2. + + + + Load oid table. + + + + Initialise the signer for signing or verification. + + @param forSigning true if for signing, false otherwise + @param param necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + return true if the internal state represents the signature described + in the passed in array. + + + X9.31-1998 - signing using a hash. +

+ The message digest hash, H, is encapsulated to form a byte string as follows +

+
+            EB = 06 || PS || 0xBA || H || TRAILER
+            
+ where PS is a string of bytes all of value 0xBB of length such that |EB|=|n|, and TRAILER is the ISO/IEC 10118 part number† for the digest. The byte string, EB, is converted to an integer value, the message representative, f. +
+ + Generate a signer with either implicit or explicit trailers for X9.31. + + @param cipher base cipher to use for signature creation/verification + @param digest digest to use. + @param implicit whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + @param cipher cipher to use. + @param digest digest to sign with. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + generate a signature for the loaded message using the key we were + initialised with. + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + a wrapper for block ciphers with a single byte block size, so that they + can be treated like stream ciphers. + + + basic constructor. + + @param cipher the block cipher to be wrapped. + @exception ArgumentException if the cipher has a block size other than + one. + + + initialise the underlying cipher. + + @param forEncryption true if we are setting up for encryption, false otherwise. + @param param the necessary parameters for the underlying cipher to be initialised. + + + encrypt/decrypt a single byte returning the result. + + @param in the byte to be processed. + @return the result of processing the input byte. + + + process a block of bytes from in putting the result into out. + + @param in the input byte array. + @param inOff the offset into the in array where the data to be processed starts. + @param len the number of bytes to be processed. + @param out the output buffer the processed bytes go into. + @param outOff the offset into the output byte array the processed data stars at. + @exception DataLengthException if the output buffer is too small. + + + reset the underlying cipher. This leaves it in the same state + it was at after the last init (if there was one). + + + return the name of the algorithm we are wrapping. + + @return the name of the algorithm we are wrapping. + + + + + + + + + + + + + + + + draft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on + gmt_unix_time containing the current time, we recommend that implementors MAY provide the + ability to set gmt_unix_time as an option only, off by default." + + + true if the current time should be used in the gmt_unix_time field of + Random, or false if gmt_unix_time should contain a cryptographically + random value. + + + + + Report whether the server supports secure renegotiation + + + The protocol handler automatically processes the relevant extensions + + + A , true if the server supports secure renegotiation + + + + + + Return an implementation of to handle record compression. + + A + + + + + Return an implementation of to use for encryption/decryption. + + A + + + + This method will be called when an alert is raised by the protocol. + + + A human-readable message explaining what caused this alert. May be null. + The Exception that caused this alert to be raised. May be null. + + + This method will be called when an alert is received from the remote peer. + + + + + Notifies the peer that the handshake has been successfully completed. + + + + + Called at the start of a new TLS session, before any other methods. + + + A + + + + Return the session this client wants to resume, if any. + Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated. + + A representing the resumable session to be used for this connection, + or null to use a new session. + + + + + Get the list of cipher suites that this client supports. + + + An array of values, each specifying a supported cipher suite. + + + + + Get the list of compression methods that this client supports. + + + An array of values, each specifying a supported compression method. + + + + + Get the (optional) table of client extensions to be included in (extended) client hello. + + + A (Int32 -> byte[]). May be null. + + + + + + + + + Notifies the client of the session_id sent in the ServerHello. + + An array of + + + + Report the cipher suite that was selected by the server. + + + The protocol handler validates this value against the offered cipher suites + + + + A + + + + + Report the compression method that was selected by the server. + + + The protocol handler validates this value against the offered compression methods + + + + A + + + + + Report the extensions from an extended server hello. + + + Will only be called if we returned a non-null result from . + + + A (Int32 -> byte[]) + + + + A list of + + + + + Return an implementation of to negotiate the key exchange + part of the protocol. + + + A + + + + + + Return an implementation of to handle authentication + part of the protocol. + + + + + A list of + + + + RFC 5077 3.3. NewSessionTicket Handshake Message + + This method will be called (only) when a NewSessionTicket handshake message is received. The + ticket is opaque to the client and clients MUST NOT examine the ticket under the assumption + that it complies with e.g. RFC 5077 4. Recommended Ticket Construction. + + The ticket + + + + + Return the to use for the TLSPlaintext.version field prior to + receiving the server version. NOTE: This method is not called for DTLS. + + + See RFC 5246 E.1.: "TLS clients that wish to negotiate with older servers MAY send any value + {03,XX} as the record layer version number. Typical values would be {03,00}, the lowest + version number supported by the client, and the value of ClientHello.client_version. No + single value will guarantee interoperability with all old servers, but this is a complex + topic beyond the scope of this document." + + The to use. + + + Export keying material according to RFC 5705: "Keying Material Exporters for TLS". + + @param asciiLabel indicates which application will use the exported keys. + @param context_value allows the application using the exporter to mix its own data with the TLS PRF for + the exporter output. + @param length the number of bytes to generate + @return a pseudorandom bit string of 'length' bytes generated from the master_secret. + + + Used to get the resumable session, if any, used by this connection. Only available after the + handshake has successfully completed. + + @return A {@link TlsSession} representing the resumable session used by this connection, or + null if no resumable session available. + @see TlsPeer#NotifyHandshakeComplete() + + + + + + + + + + A generic interface for key exchange implementations in (D)TLS. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A (Int32 -> byte[]). Will never be null. + + + + + + + + + + + + + + Get the (optional) table of server extensions to be included in (extended) server hello. + + + A (Int32 -> byte[]). May be null. + + + + + + A (). May be null. + + + + + + + + + This method will be called (only) if the server included an extension of type + "status_request" with empty "extension_data" in the extended server hello. See RFC 3546 + 3.6. Certificate Status Request. If a non-null is returned, it + is sent to the client as a handshake message of type "certificate_status". + + A to be sent to the client (or null for none). + + + + + + + + + + () + + + + + Called by the protocol handler to report the client certificate, only if GetCertificateRequest + returned non-null. + + Note: this method is responsible for certificate verification and validation. + the effective client certificate (may be an empty chain). + + + + RFC 5077 3.3. NewSessionTicket Handshake Message. + + This method will be called (only) if a NewSessionTicket extension was sent by the server. See + RFC 5077 4. Recommended Ticket Construction for recommended format and protection. + + The ticket) + + + + + + + + + + + RFC 5246 7.2 + + + + This message notifies the recipient that the sender will not send any more messages on this + connection. Note that as of TLS 1.1, failure to properly close a connection no longer + requires that a session not be resumed. This is a change from TLS 1.0 ("The session becomes + unresumable if any connection is terminated without proper close_notify messages with level + equal to warning.") to conform with widespread implementation practice. + + + An inappropriate message was received. This alert is always fatal and should never be + observed in communication between proper implementations. + + + This alert is returned if a record is received with an incorrect MAC. This alert also MUST be + returned if an alert is sent because a TLSCiphertext decrypted in an invalid way: either it + wasn't an even multiple of the block length, or its padding values, when checked, weren't + correct. This message is always fatal and should never be observed in communication between + proper implementations (except when messages were corrupted in the network). + + + This alert was used in some earlier versions of TLS, and may have permitted certain attacks + against the CBC mode [CBCATT]. It MUST NOT be sent by compliant implementations. + + + A TLSCiphertext record was received that had a length more than 2^14+2048 bytes, or a record + decrypted to a TLSCompressed record with more than 2^14+1024 bytes. This message is always + fatal and should never be observed in communication between proper implementations (except + when messages were corrupted in the network). + + + The decompression function received improper input (e.g., data that would expand to excessive + length). This message is always fatal and should never be observed in communication between + proper implementations. + + + Reception of a handshake_failure alert message indicates that the sender was unable to + negotiate an acceptable set of security parameters given the options available. This is a + fatal error. + + + This alert was used in SSLv3 but not any version of TLS. It MUST NOT be sent by compliant + implementations. + + + A certificate was corrupt, contained signatures that did not verify correctly, etc. + + + A certificate was of an unsupported type. + + + A certificate was revoked by its signer. + + + A certificate has expired or is not currently valid. + + + Some other (unspecified) issue arose in processing the certificate, rendering it + unacceptable. + + + A field in the handshake was out of range or inconsistent with other fields. This message is + always fatal. + + + A valid certificate chain or partial chain was received, but the certificate was not accepted + because the CA certificate could not be located or couldn't be matched with a known, trusted + CA. This message is always fatal. + + + A valid certificate was received, but when access control was applied, the sender decided not + to proceed with negotiation. This message is always fatal. + + + A message could not be decoded because some field was out of the specified range or the + length of the message was incorrect. This message is always fatal and should never be + observed in communication between proper implementations (except when messages were corrupted + in the network). + + + A handshake cryptographic operation failed, including being unable to correctly verify a + signature or validate a Finished message. This message is always fatal. + + + This alert was used in some earlier versions of TLS. It MUST NOT be sent by compliant + implementations. + + + The protocol version the client has attempted to negotiate is recognized but not supported. + (For example, old protocol versions might be avoided for security reasons.) This message is + always fatal. + + + Returned instead of handshake_failure when a negotiation has failed specifically because the + server requires ciphers more secure than those supported by the client. This message is + always fatal. + + + An internal error unrelated to the peer or the correctness of the protocol (such as a memory + allocation failure) makes it impossible to continue. This message is always fatal. + + + This handshake is being canceled for some reason unrelated to a protocol failure. If the user + cancels an operation after the handshake is complete, just closing the connection by sending + a close_notify is more appropriate. This alert should be followed by a close_notify. This + message is generally a warning. + + + Sent by the client in response to a hello request or by the server in response to a client + hello after initial handshaking. Either of these would normally lead to renegotiation; when + that is not appropriate, the recipient should respond with this alert. At that point, the + original requester can decide whether to proceed with the connection. One case where this + would be appropriate is where a server has spawned a process to satisfy a request; the + process might receive security parameters (key length, authentication, etc.) at startup, and + it might be difficult to communicate changes to these parameters after that point. This + message is always a warning. + + + Sent by clients that receive an extended server hello containing an extension that they did + not put in the corresponding client hello. This message is always fatal. + + + This alert is sent by servers who are unable to retrieve a certificate chain from the URL + supplied by the client (see Section 3.3). This message MAY be fatal - for example if client + authentication is required by the server for the handshake to continue and the server is + unable to retrieve the certificate chain, it may send a fatal alert. + + + This alert is sent by servers that receive a server_name extension request, but do not + recognize the server name. This message MAY be fatal. + + + This alert is sent by clients that receive an invalid certificate status response (see + Section 3.6). This message is always fatal. + + + This alert is sent by servers when a certificate hash does not match a client provided + certificate_hash. This message is always fatal. + + + If the server does not recognize the PSK identity, it MAY respond with an + "unknown_psk_identity" alert message. + + + If TLS_FALLBACK_SCSV appears in ClientHello.cipher_suites and the highest protocol version + supported by the server is higher than the version indicated in ClientHello.client_version, + the server MUST respond with a fatal inappropriate_fallback alert [..]. + + + + RFC 5246 7.2 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + A queue for bytes. +

+ This file could be more optimized. +

+
+
+ + The initial size for our buffer. + + + The smallest number which can be written as 2^x which is bigger than i. + + + The buffer where we store our data. + + + How many bytes at the beginning of the buffer are skipped. + + + How many bytes in the buffer are valid data. + + + Read data from the buffer. + The buffer where the read data will be copied to. + How many bytes to skip at the beginning of buf. + How many bytes to read at all. + How many bytes from our data to skip. + + + Add some data to our buffer. + A byte-array to read data from. + How many bytes to skip at the beginning of the array. + How many bytes to read from the array. + + + Remove some bytes from our data from the beginning. + How many bytes to remove. + + + The number of bytes which are available in this buffer. + + + Parsing and encoding of a Certificate struct from RFC 4346. +

+

+             opaque ASN.1Cert<2^24-1>;
+            
+             struct {
+                 ASN.1Cert certificate_list<0..2^24-1>;
+             } Certificate;
+             
+ + @see Org.BouncyCastle.Asn1.X509.X509CertificateStructure +
+ + The certificates. + + + @return an array of {@link org.bouncycastle.asn1.x509.Certificate} representing a certificate + chain. + + + Encode this {@link Certificate} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link Certificate} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link Certificate} object. + @throws IOException + + + @return true if this certificate chain contains no certificates, or + false otherwise. + + + Parsing and encoding of a CertificateRequest struct from RFC 4346. +

+

+             struct {
+                 ClientCertificateType certificate_types<1..2^8-1>;
+                 DistinguishedName certificate_authorities<3..2^16-1>
+             } CertificateRequest;
+             
+ + @see ClientCertificateType + @see X509Name +
+ + @param certificateTypes see {@link ClientCertificateType} for valid constants. + @param certificateAuthorities an {@link IList} of {@link X509Name}. + + + Encode this {@link CertificateRequest} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateRequest} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link CertificateRequest} object. + @throws IOException + + + @return an array of certificate types + @see {@link ClientCertificateType} + + + @return an {@link IList} of {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + + + @return an {@link IList} of {@link X509Name} + + + Encode this {@link CertificateStatus} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateStatus} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link CertificateStatus} object. + @throws IOException + + + Encode this {@link CertificateStatusRequest} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateStatusRequest} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link CertificateStatusRequest} object. + @throws IOException + + + RFC 6091 + + + @param type + see {@link CertChainType} for valid constants. + @param urlAndHashList + a {@link IList} of {@link UrlAndHash}. + + + Encode this {@link CertificateUrl} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateUrl} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link CertificateUrl} object. + @throws IOException + + + @return {@link CertChainType} + + + @return an {@link IList} of {@link UrlAndHash} + + + draft-ietf-tls-chacha20-poly1305-04 + + + + + + + + + + + + + + + + + + + + + + RFC 2246 A.5 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + A combined hash, which implements md5(m) || sha1(m). + + + @see org.bouncycastle.crypto.Digest#update(byte[], int, int) + + + @see org.bouncycastle.crypto.Digest#doFinal(byte[], int) + + + @see org.bouncycastle.crypto.Digest#reset() + + + + RFC 2246 6.1 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 2246 6.2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check whether the given SRP group parameters are acceptable for use. + + @param group the {@link SRP6GroupParameters} to check + @return true if (and only if) the specified group parameters are acceptable + + + Accept only the group parameters specified in RFC 5054 Appendix A. + + + Specify a custom set of acceptable group parameters. + + @param groups a {@link Vector} of acceptable {@link SRP6GroupParameters} + + + Buffers input until the hash algorithm is determined. + + + Encode this {@link DigitallySigned} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link DigitallySigned} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link DigitallySigned} object. + @throws IOException + + + @return a {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there are no "extra" messages left in the current inbound flight + + + RFC 4347 4.1.2.5 Anti-replay +

+ Support fast rejection of duplicate records by maintaining a sliding receive window + + + Check whether a received record with the given sequence number should be rejected as a duplicate. + + @param seq the 48-bit DTLSPlainText.sequence_number field of a received record. + @return true if the record should be discarded without further processing. + + + Report that a received record with the given sequence number passed authentication checks. + + @param seq the 48-bit DTLSPlainText.sequence_number field of an authenticated record. + + + When a new epoch begins, sequence numbers begin again at 0 + + +

RFC 4492 5.4. (Errata ID: 2389) +
+ + + RFC 4492 5.4 + + + + Indicates the elliptic curve domain parameters are conveyed verbosely, and the + underlying finite field is a prime field. + + + Indicates the elliptic curve domain parameters are conveyed verbosely, and the + underlying finite field is a characteristic-2 field. + + + Indicates that a named curve is used. This option SHOULD be used when applicable. + + + + RFC 4492 5.1.2 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 5705 + + + RFC 5246 7.4.1.4.1 + + + Encode this {@link HeartbeatExtension} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link HeartbeatExtension} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link HeartbeatExtension} object. + @throws IOException + + + Encode this {@link HeartbeatMessage} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link HeartbeatMessage} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link HeartbeatMessage} object. + @throws IOException + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + RFC 4492 5.1.1 + The named curves defined here are those specified in SEC 2 [13]. Note that many of + these curves are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00 + through 0xFEFF are reserved for private use. Values 0xFF01 and 0xFF02 indicate that the + client supports arbitrary prime and characteristic-2 curves, respectively (the curve + parameters must be encoded explicitly in ECParameters). + + + + Encode this {@link NewSessionTicket} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link NewSessionTicket} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link NewSessionTicket} object. + @throws IOException + + + RFC 3546 3.6 + + + @param responderIDList + an {@link IList} of {@link ResponderID}, specifying the list of trusted OCSP + responders. An empty list has the special meaning that the responders are + implicitly known to the server - e.g., by prior arrangement. + @param requestExtensions + OCSP request extensions. A null value means that there are no extensions. + + + Encode this {@link OcspStatusRequest} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link OcspStatusRequest} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return an {@link OcspStatusRequest} object. + @throws IOException + + + @return an {@link IList} of {@link ResponderID} + + + @return OCSP request extensions + + + RFC 5246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + + + An implementation of the TLS 1.0/1.1/1.2 record layer, allowing downgrade to SSLv3. + + + RFC 5246 E.1. "Earlier versions of the TLS specification were not fully clear on what the + record layer version number (TLSPlaintext.version) should contain when sending ClientHello + (i.e., before it is known which version of the protocol will be employed). Thus, TLS servers + compliant with this specification MUST accept any value {03,XX} as the record layer version + number for ClientHello." + + + @return {@link ConnectionEnd} + + + @return {@link CipherSuite} + + + @return {@link CompressionMethod} + + + @return {@link PRFAlgorithm} + + + Encode this {@link ServerDHParams} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerDHParams} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerDHParams} object. + @throws IOException + + + Encode this {@link ServerName} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerName} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerName} object. + @throws IOException + + + @param serverNameList an {@link IList} of {@link ServerName}. + + + Encode this {@link ServerNameList} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerNameList} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerNameList} object. + @throws IOException + + + @return an {@link IList} of {@link ServerName}. + + + + Called by the protocol handler to report the server certificate. + + + This method is responsible for certificate verification and validation + + The server received + + + + + Return client credentials in response to server's certificate request + + + A containing server certificate request details + + + A to be used for client authentication + (or null for no client authentication) + + + + + Encode this {@link ServerSRPParams} to an {@link OutputStream}. + + @param output + the {@link OutputStream} to encode to. + @throws IOException + + + Parse a {@link ServerSRPParams} from an {@link InputStream}. + + @param input + the {@link InputStream} to parse from. + @return a {@link ServerSRPParams} object. + @throws IOException + + + RFC 5246 7.4.1.4.1 (in RFC 2246, there were no specific values assigned) + + + RFC 5246 7.4.1.4.1 + + + @param hash {@link HashAlgorithm} + @param signature {@link SignatureAlgorithm} + + + Encode this {@link SignatureAndHashAlgorithm} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link SignatureAndHashAlgorithm} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link SignatureAndHashAlgorithm} object. + @throws IOException + + + @return {@link HashAlgorithm} + + + @return {@link SignatureAlgorithm} + + + An implementation of {@link TlsSRPIdentityManager} that simulates the existence of "unknown" identities + to obscure the fact that there is no verifier for them. + + + Lookup the {@link TlsSRPLoginParameters} corresponding to the specified identity. + + NOTE: To avoid "identity probing", unknown identities SHOULD be handled as recommended in RFC + 5054 2.5.1.3. {@link SimulatedTlsSRPIdentityManager} is provided for this purpose. + + @param identity + the SRP identity sent by the connecting client + @return the {@link TlsSRPLoginParameters} for the specified identity, or else 'simulated' + parameters if the identity is not recognized. A null value is also allowed, but not + recommended. + + + Create a {@link SimulatedTlsSRPIdentityManager} that implements the algorithm from RFC 5054 2.5.1.3 + + @param group the {@link SRP6GroupParameters} defining the group that SRP is operating in + @param seedKey the secret "seed key" referred to in RFC 5054 2.5.1.3 + @return an instance of {@link SimulatedTlsSRPIdentityManager} + + + HMAC implementation based on original internet draft for HMAC (RFC 2104) + + The difference is that padding is concatentated versus XORed with the key + + H(K + opad, H(K + ipad, text)) + + + Base constructor for one of the standard digest algorithms that the byteLength of + the algorithm is know for. Behaviour is undefined for digests other than MD5 or SHA1. + + @param digest the digest. + + + Reset the mac generator. + + + RFC 4680 + + + + + + + + + + + + + + + + + + + A generic TLS 1.0-1.2 / SSLv3 block cipher. This can be used for AES or 3DES for example. + + + + + + + + + + This method is called, when a change cipher spec message is received. + + @throws IOException If the message has an invalid content or the handshake is not in the correct + state. + + + Read data from the network. The method will return immediately, if there is still some data + left in the buffer, or block until some application data has been read from the network. + + @param buf The buffer where the data will be copied to. + @param offset The position where the data will be placed in the buffer. + @param len The maximum number of bytes to read. + @return The number of bytes read. + @throws IOException If something goes wrong during reading data. + + + Send some application data to the remote system. +

+ The method will handle fragmentation internally. + + @param buf The buffer with the data. + @param offset The position in the buffer where the data is placed. + @param len The length of the data. + @throws IOException If something goes wrong during sending. + + + Offer input from an arbitrary source. Only allowed in non-blocking mode.
+
+ After this method returns, the input buffer is "owned" by this object. Other code + must not attempt to do anything with it.
+
+ This method will decrypt and process all records that are fully available. + If only part of a record is available, the buffer will be retained until the + remainder of the record is offered.
+
+ If any records containing application data were processed, the decrypted data + can be obtained using {@link #readInput(byte[], int, int)}. If any records + containing protocol data were processed, a response may have been generated. + You should always check to see if there is any available output after calling + this method by calling {@link #getAvailableOutputBytes()}. + @param input The input buffer to offer + @throws IOException If an error occurs while decrypting or processing a record +
+ + Gets the amount of received application data. A call to {@link #readInput(byte[], int, int)} + is guaranteed to be able to return at least this much data.
+
+ Only allowed in non-blocking mode. + @return The number of bytes of available application data +
+ + Retrieves received application data. Use {@link #getAvailableInputBytes()} to check + how much application data is currently available. This method functions similarly to + {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + is available, nothing will be copied and zero will be returned.
+
+ Only allowed in non-blocking mode. + @param buffer The buffer to hold the application data + @param offset The start offset in the buffer at which the data is written + @param length The maximum number of bytes to read + @return The total number of bytes copied to the buffer. May be less than the + length specified if the length was greater than the amount of available data. +
+ + Offer output from an arbitrary source. Only allowed in non-blocking mode.
+
+ After this method returns, the specified section of the buffer will have been + processed. Use {@link #readOutput(byte[], int, int)} to get the bytes to + transmit to the other peer.
+
+ This method must not be called until after the handshake is complete! Attempting + to call it before the handshake is complete will result in an exception. + @param buffer The buffer containing application data to encrypt + @param offset The offset at which to begin reading data + @param length The number of bytes of data to read + @throws IOException If an error occurs encrypting the data, or the handshake is not complete +
+ + Gets the amount of encrypted data available to be sent. A call to + {@link #readOutput(byte[], int, int)} is guaranteed to be able to return at + least this much data.
+
+ Only allowed in non-blocking mode. + @return The number of bytes of available encrypted data +
+ + Retrieves encrypted data to be sent. Use {@link #getAvailableOutputBytes()} to check + how much encrypted data is currently available. This method functions similarly to + {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + is available, nothing will be copied and zero will be returned.
+
+ Only allowed in non-blocking mode. + @param buffer The buffer to hold the encrypted data + @param offset The start offset in the buffer at which the data is written + @param length The maximum number of bytes to read + @return The total number of bytes copied to the buffer. May be less than the + length specified if the length was greater than the amount of available data. +
+ + Terminate this connection with an alert. Can be used for normal closure too. + + @param alertLevel + See {@link AlertLevel} for values. + @param alertDescription + See {@link AlertDescription} for values. + @throws IOException + If alert was fatal. + + + Closes this connection. + + @throws IOException If something goes wrong during closing. + + + Make sure the InputStream 'buf' now empty. Fail otherwise. + + @param buf The InputStream to check. + @throws IOException If 'buf' is not empty. + + + 'sender' only relevant to SSLv3 + + +

The secure bidirectional stream for this connection + Only allowed in blocking mode. +
+ + Constructor for blocking mode. + @param stream The bi-directional stream of data to/from the server + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for blocking mode. + @param input The stream of data from the server + @param output The stream of data to the server + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for non-blocking mode.
+
+ When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + provide the received ciphertext, then use + {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
+
+ Similarly, when data needs to be sent, use + {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + {@link #readOutput(byte[], int, int)} to get the corresponding + ciphertext. + + @param secureRandom + Random number generator for various cryptographic functions +
+ + Initiates a TLS handshake in the role of client.
+
+ In blocking mode, this will not return until the handshake is complete. + In non-blocking mode, use {@link TlsPeer#NotifyHandshakeComplete()} to + receive a callback when the handshake is complete. + + @param tlsClient The {@link TlsClient} to use for the handshake. + @throws IOException If in blocking mode and handshake was not successful. +
+ + (D)TLS DH key exchange. + + + (D)TLS ECDHE key exchange (see RFC 4492). + + + (D)TLS ECDH key exchange (see RFC 4492). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest. + + + + Generate a new instance of an TlsMac. + + @param context the TLS client context + @param digest The digest to use. + @param key A byte-array where the key for this MAC is located. + @param keyOff The number of bytes to skip, before the key starts in the buffer. + @param keyLen The length of the key. + + + Calculate the MAC for some given data. + + @param type The message type of the message. + @param message A byte-buffer containing the message. + @param offset The number of bytes to skip, before the message starts. + @param length The length of the message. + @return A new byte-buffer containing the MAC value. + + + @return the MAC write secret + + + @return The output length of this MAC. + + + + A NULL CipherSuite, with optional MAC. + + + + + + + + + + + + + Both streams can be the same object + + + (D)TLS PSK key exchange (RFC 4279). + + + (D)TLS and SSLv3 RSA key exchange. + + + + + + Constructor for blocking mode. + @param stream The bi-directional stream of data to/from the client + @param output The stream of data to the client + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for blocking mode. + @param input The stream of data from the client + @param output The stream of data to the client + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for non-blocking mode.
+
+ When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + provide the received ciphertext, then use + {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
+
+ Similarly, when data needs to be sent, use + {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + {@link #readOutput(byte[], int, int)} to get the corresponding + ciphertext. + + @param secureRandom + Random number generator for various cryptographic functions +
+ + Receives a TLS handshake in the role of server.
+
+ In blocking mode, this will not return until the handshake is complete. + In non-blocking mode, use {@link TlsPeer#notifyHandshakeComplete()} to + receive a callback when the handshake is complete. + + @param tlsServer + @throws IOException If in blocking mode and handshake was not successful. +
+ + (D)TLS SRP key exchange (RFC 5054). + + + RFC 5764 DTLS Extension to Establish Keys for SRTP. + + + + + + + + + + + + Some helper functions for MicroTLS. + + + Add a 'signature_algorithms' extension to existing extensions. + + @param extensions A {@link Hashtable} to add the extension to. + @param supportedSignatureAlgorithms {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @throws IOException + + + Get a 'signature_algorithms' extension from extensions. + + @param extensions A {@link Hashtable} to get the extension from, if it is present. + @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}, or null. + @throws IOException + + + Create a 'signature_algorithms' extension value. + + @param supportedSignatureAlgorithms A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @return A byte array suitable for use as an extension value. + @throws IOException + + + Read 'signature_algorithms' extension data. + + @param extensionData The extension data. + @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @throws IOException + + + RFC 6066 5. + + + Encode this {@link UrlAndHash} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link UrlAndHash} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link UrlAndHash} object. + @throws IOException + + + RFC 4681 + + + RFC 5764 4.1.1 + + + @param protectionProfiles see {@link SrtpProtectionProfile} for valid constants. + @param mki valid lengths from 0 to 255. + + + @return see {@link SrtpProtectionProfile} for valid constants. + + + @return valid lengths from 0 to 255. + + + return a = a + b - b preserved. + + + unsigned comparison on two arrays - note the arrays may + start with leading zeros. + + + return z = x / y - done in place (z value preserved, x contains the + remainder) + + + return whether or not a BigInteger is probably prime with a + probability of 1 - (1/2)**certainty. +

From Knuth Vol 2, pg 395.

+
+ + Calculate the numbers u1, u2, and u3 such that: + + u1 * a + u2 * b = u3 + + where u3 is the greatest common divider of a and b. + a and b using the extended Euclid algorithm (refer p. 323 + of The Art of Computer Programming vol 2, 2nd ed). + This also seems to have the side effect of calculating + some form of multiplicative inverse. + + @param a First number to calculate gcd for + @param b Second number to calculate gcd for + @param u1Out the return object for the u1 value + @return The greatest common divisor of a and b + + + return w with w = x * x - w is assumed to have enough space. + + + return x with x = y * z - x is assumed to have enough space. + + + Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size) + + + Montgomery multiplication: a = x * y * R^(-1) mod m +
+ Based algorithm 14.36 of Handbook of Applied Cryptography. +
+
  • m, x, y should have length n
  • +
  • a should have length (n + 1)
  • +
  • b = 2^32, R = b^n
  • +
    + The result is put in x +
    + NOTE: the indices of x, y, m, a different in HAC and in Java +
    + + return x = x % y - done in place (y value preserved) + + + do a left shift - this returns a new array. + + + do a right shift - this does it in place. + + + do a right shift by one - this does it in place. + + + returns x = x - y - we assume x is >= y + + + Class representing a simple version of a big decimal. A + SimpleBigDecimal is basically a + {@link java.math.BigInteger BigInteger} with a few digits on the right of + the decimal point. The number of (binary) digits on the right of the decimal + point is called the scale of the SimpleBigDecimal. + Unlike in {@link java.math.BigDecimal BigDecimal}, the scale is not adjusted + automatically, but must be set manually. All SimpleBigDecimals + taking part in the same arithmetic operation must have equal scale. The + result of a multiplication of two SimpleBigDecimals returns a + SimpleBigDecimal with double scale. + + + Returns a SimpleBigDecimal representing the same numerical + value as value. + @param value The value of the SimpleBigDecimal to be + created. + @param scale The scale of the SimpleBigDecimal to be + created. + @return The such created SimpleBigDecimal. + + + Constructor for SimpleBigDecimal. The value of the + constructed SimpleBigDecimal Equals bigInt / + 2scale. + @param bigInt The bigInt value parameter. + @param scale The scale of the constructed SimpleBigDecimal. + + + Class holding methods for point multiplication based on the window + τ-adic nonadjacent form (WTNAF). The algorithms are based on the + paper "Improved Algorithms for Arithmetic on Anomalous Binary Curves" + by Jerome A. Solinas. The paper first appeared in the Proceedings of + Crypto 1997. + + + The window width of WTNAF. The standard value of 4 is slightly less + than optimal for running time, but keeps space requirements for + precomputation low. For typical curves, a value of 5 or 6 results in + a better running time. When changing this value, the + αu's must be computed differently, see + e.g. "Guide to Elliptic Curve Cryptography", Darrel Hankerson, + Alfred Menezes, Scott Vanstone, Springer-Verlag New York Inc., 2004, + p. 121-122 + + + 24 + + + The αu's for a=0 as an array + of ZTauElements. + + + The αu's for a=0 as an array + of TNAFs. + + + The αu's for a=1 as an array + of ZTauElements. + + + The αu's for a=1 as an array + of TNAFs. + + + Computes the norm of an element λ of + Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The norm of λ. + + + Computes the norm of an element λ of + R[τ], where λ = u + vτ + and u and u are real numbers (elements of + R). + @param mu The parameter μ of the elliptic curve. + @param u The real part of the element λ of + R[τ]. + @param v The τ-adic part of the element + λ of R[τ]. + @return The norm of λ. + + + Rounds an element λ of R[τ] + to an element of Z[τ], such that their difference + has minimal norm. λ is given as + λ = λ0 + λ1τ. + @param lambda0 The component λ0. + @param lambda1 The component λ1. + @param mu The parameter μ of the elliptic curve. Must + equal 1 or -1. + @return The rounded element of Z[τ]. + @throws ArgumentException if lambda0 and + lambda1 do not have same scale. + + + Approximate division by n. For an integer + k, the value λ = s k / n is + computed to c bits of accuracy. + @param k The parameter k. + @param s The curve parameter s0 or + s1. + @param vm The Lucas Sequence element Vm. + @param a The parameter a of the elliptic curve. + @param m The bit length of the finite field + Fm. + @param c The number of bits of accuracy, i.e. the scale of the returned + SimpleBigDecimal. + @return The value λ = s k / n computed to + c bits of accuracy. + + + Computes the τ-adic NAF (non-adjacent form) of an + element λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The τ-adic NAF of λ. + + + Applies the operation τ() to an + AbstractF2mPoint. + @param p The AbstractF2mPoint to which τ() is applied. + @return τ(p) + + + Returns the parameter μ of the elliptic curve. + @param curve The elliptic curve from which to obtain μ. + The curve must be a Koblitz curve, i.e. a Equals + 0 or 1 and b Equals + 1. + @return μ of the elliptic curve. + @throws ArgumentException if the given ECCurve is not a Koblitz + curve. + + + Calculates the Lucas Sequence elements Uk-1 and + Uk or Vk-1 and + Vk. + @param mu The parameter μ of the elliptic curve. + @param k The index of the second element of the Lucas Sequence to be + returned. + @param doV If set to true, computes Vk-1 and + Vk, otherwise Uk-1 and + Uk. + @return An array with 2 elements, containing Uk-1 + and Uk or Vk-1 + and Vk. + + + Computes the auxiliary value tw. If the width is + 4, then for mu = 1, tw = 6 and for + mu = -1, tw = 10 + @param mu The parameter μ of the elliptic curve. + @param w The window width of the WTNAF. + @return the auxiliary value tw + + + Computes the auxiliary values s0 and + s1 used for partial modular reduction. + @param curve The elliptic curve for which to compute + s0 and s1. + @throws ArgumentException if curve is not a + Koblitz curve (Anomalous Binary Curve, ABC). + + + Partial modular reduction modulo + m - 1)/(τ - 1). + @param k The integer to be reduced. + @param m The bitlength of the underlying finite field. + @param a The parameter a of the elliptic curve. + @param s The auxiliary values s0 and + s1. + @param mu The parameter μ of the elliptic curve. + @param c The precision (number of bits of accuracy) of the partial + modular reduction. + @return ρ := k partmod (τm - 1)/(τ - 1) + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by a BigInteger using the reduced τ-adic + NAF (RTNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param k The BigInteger by which to Multiply p. + @return k * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param lambda The element λ of + Z[τ]. + @return λ * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method, given the TNAF + of λ. + @param p The AbstractF2mPoint to Multiply. + @param u The the TNAF of λ.. + @return λ * p + + + Computes the [τ]-adic window NAF of an element + λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @param width The window width of the resulting WNAF. + @param pow2w 2width. + @param tw The auxiliary value tw. + @param alpha The αu's for the window width. + @return The [τ]-adic window NAF of + λ. + + + Does the precomputation for WTNAF multiplication. + @param p The ECPoint for which to do the precomputation. + @param a The parameter a of the elliptic curve. + @return The precomputation array for p. + + + Class representing an element of Z[τ]. Let + λ be an element of Z[τ]. Then + λ is given as λ = u + vτ. The + components u and v may be used directly, there + are no accessor methods. + Immutable class. + + + The "real" part of λ. + + + The "τ-adic" part of λ. + + + Constructor for an element λ of + Z[τ]. + @param u The "real" part of λ. + @param v The "τ-adic" part of + λ. + + + Base class for an elliptic curve. + + + Adds PreCompInfo for a point on this curve, under a given name. Used by + ECMultipliers to save the precomputation for this ECPoint for use + by subsequent multiplication. + + @param point + The ECPoint to store precomputations for. + @param name + A String used to index precomputations of different types. + @param preCompInfo + The values precomputed by the ECMultiplier. + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. An (optional) z-scaling factor can be applied; effectively + each z coordinate is scaled by this value prior to normalization (but only one + actual multiplication is needed). + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + @param off + The start of the range of points to normalize + @param len + The length of the range of points to normalize + @param iso + The (optional) z-scaling factor - can be null + + + Sets the default ECMultiplier, unless already set. + + + Decode a point on this curve from its ASN.1 encoding. The different + encodings are taken account of, including point compression for + Fp (X9.62 s 4.2.1 pg 17). + @return The decoded point. + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + base class for points on elliptic curves. + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. + + @return a new ECPoint instance representing the same point, but with normalized coordinates + + + Normalizes this point, and then returns the affine x-coordinate. + + Note: normalization can be expensive, this method is deprecated in favour + of caller-controlled normalization. + + + Normalizes this point, and then returns the affine y-coordinate. + + Note: normalization can be expensive, this method is deprecated in favour + of caller-controlled normalization. + + + Returns the affine x-coordinate after checking that this point is normalized. + + @return The affine x-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the affine y-coordinate after checking that this point is normalized + + @return The affine y-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the x-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineXCoord if you expect the point to already have been normalized. + + @return the x-coordinate of this point + + + Returns the y-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineYCoord if you expect the point to already have been normalized. + + @return the y-coordinate of this point + + + return the field element encoded with point compression. (S 4.3.6) + + + Multiplies this ECPoint by the given number. + @param k The multiplicator. + @return k * this. + + + Create a point which encodes with point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + @param withCompression if true encode with point compression + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(boolean)} + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + The auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Solves a quadratic equation z2 + z = beta(X9.62 + D.1.6) The other solution is z + 1. + + @param beta + The value to solve the qradratic equation for. + @return the solution for z2 + z = beta or + null if no solution exists. + + + @return the auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Returns true if this is a Koblitz curve (ABC curve). + @return true if this is a Koblitz curve (ABC curve), false otherwise + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + Simple shift-and-add multiplication. Serves as reference implementation + to verify (possibly faster) implementations, and for very small scalars. + + @param p + The point to multiply. + @param k + The multiplier. + @return The result of the point multiplication kP. + + + Elliptic curve over Fp + + + Elliptic curves over F2m. The Weierstrass equation is given by + y2 + xy = x3 + ax2 + b. + + + The exponent m of F2m. + + + TPB: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + PPB: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + The point at infinity on this curve. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Return true if curve uses a Trinomial basis. + + @return true if curve Trinomial, false otherwise. + + + return a sqrt root - the routine verifies that the calculation + returns the right value - if none exists it returns null. + + + return the field name for this field. + + @return the string "Fp". + + + Class representing the Elements of the finite field + F2m in polynomial basis (PB) + representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial + basis representations are supported. Gaussian normal basis (GNB) + representation is not supported. + + + Indicates gaussian normal basis representation (GNB). Number chosen + according to X9.62. GNB is not implemented at present. + + + Indicates trinomial basis representation (Tpb). Number chosen + according to X9.62. + + + Indicates pentanomial basis representation (Ppb). Number chosen + according to X9.62. + + + Tpb or Ppb. + + + The exponent m of F2m. + + + The LongArray holding the bits. + + + Constructor for Ppb. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Constructor for Tpb. + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Checks, if the ECFieldElements a and b + are elements of the same field F2m + (having the same representation). + @param a field element. + @param b field element to be compared. + @throws ArgumentException if a and b + are not elements of the same field + F2m (having the same + representation). + + + @return the representation of the field + F2m, either of + {@link F2mFieldElement.Tpb} (trinomial + basis representation) or + {@link F2mFieldElement.Ppb} (pentanomial + basis representation). + + + @return the degree m of the reduction polynomial + f(z). + + + @return Tpb: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + Ppb: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always returns 0
    + Ppb: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always set to 0
    + Ppb: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + Elliptic curve points over Fp + + + Create a point which encodes without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + + + Create a point that encodes with or without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + @param withCompression if true encode with point compression + + + Elliptic curve points over F2m + + + @param curve base curve + @param x x point + @param y y point + + + @param curve base curve + @param x x point + @param y y point + @param withCompression true if encode with point compression. + + + Constructor for point at infinity + + + Interface for classes encapsulating a point multiplication algorithm + for ECPoints. + + + Multiplies the ECPoint p by k, i.e. + p is added k times to itself. + @param p The ECPoint to be multiplied. + @param k The factor by which p is multiplied. + @return p multiplied by k. + + + Joye's double-add algorithm. + + + Class holding precomputation data for fixed-point multiplications. + + + Interface for classes storing precomputation data for multiplication + algorithms. Used as a Memento (see GOF patterns) for + WNafMultiplier. + + + Array holding the precomputed ECPoints used for a fixed + point multiplication. + + + The width used for the precomputation. If a larger width precomputation + is already available this may be larger than was requested, so calling + code should refer to the actual width. + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left) using + mixed coordinates. + + + By default, addition will be done in Jacobian coordinates, and doubling will be done in + Modified Jacobian coordinates (independent of the original coordinate system of each point). + + + Montgomery ladder. + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (left-to-right). + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left). + + + Class implementing the WNAF (Window Non-Adjacent Form) multiplication + algorithm. + + + Multiplies this by an integer k using the + Window NAF method. + @param k The integer by which this is multiplied. + @return A new ECPoint which equals this + multiplied by k. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Class holding precomputation data for the WNAF (Window Non-Adjacent Form) + algorithm. + + + Array holding the precomputed ECPoints used for a Window + NAF multiplication. + + + Array holding the negations of the precomputed ECPoints used + for a Window NAF multiplication. + + + Holds an ECPoint representing Twice(this). Used for the + Window NAF multiplication to create or extend the precomputed values. + + + Computes the Window NAF (non-adjacent Form) of an integer. + @param width The width w of the Window NAF. The width is + defined as the minimal number w, such that for any + w consecutive digits in the resulting representation, at + most one is non-zero. + @param k The integer of which the Window NAF is computed. + @return The Window NAF of the given width, such that the following holds: + k = &sum;i=0l-1 ki2i + , where the ki denote the elements of the + returned byte[]. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @param windowSizeCutoffs a monotonically increasing list of bit sizes at which to increment the window width + @return the window size to use + + + Class implementing the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by k using the reduced τ-adic NAF (RTNAF) + method. + @param p The AbstractF2mPoint to multiply. + @param k The integer by which to multiply k. + @return p multiplied by k. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] using + the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to multiply. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @return p multiplied by λ. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the window τ-adic NAF (TNAF) method, given the + WTNAF of λ. + @param p The AbstractF2mPoint to multiply. + @param u The the WTNAF of λ.. + @return λ * p + + + Class holding precomputation data for the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Array holding the precomputed AbstractF2mPoints used for the + WTNAF multiplication in + {@link org.bouncycastle.math.ec.multiplier.WTauNafMultiplier.multiply() + WTauNafMultiplier.multiply()}. + + + 'Zeroless' Signed Digit Left-to-Right. + + + 'Zeroless' Signed Digit Right-to-Left. + + + Utility methods for generating primes and testing for primality. + + + FIPS 186-4 C.6 Shawe-Taylor Random_Prime Routine + + Construct a provable prime number using a hash function. + + @param hash + the {@link Digest} instance to use (as "Hash()"). Cannot be null. + @param length + the length (in bits) of the prime to be generated. Must be at least 2. + @param inputSeed + the seed to be used for the generation of the requested prime. Cannot be null or + empty. + @return an {@link STOutput} instance containing the requested prime. + + + FIPS 186-4 C.3.2 Enhanced Miller-Rabin Probabilistic Primality Test + + Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. This is an + alternative to {@link #isMRProbablePrime(BigInteger, SecureRandom, int)} that provides more + information about a composite candidate, which may be useful when generating or validating + RSA moduli. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param random + the source of randomness to use to choose bases. + @param iterations + the number of randomly-chosen bases to perform the test for. + @return an {@link MROutput} instance that can be further queried for details. + + + A fast check for small divisors, up to some implementation-specific limit. + + @param candidate + the {@link BigInteger} instance to test for division by small factors. + + @return true if the candidate is found to have any small factors, + false otherwise. + + + FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test + + Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param random + the source of randomness to use to choose bases. + @param iterations + the number of randomly-chosen bases to perform the test for. + @return false if any witness to compositeness is found amongst the chosen bases + (so candidate is definitely NOT prime), or else true + (indicating primality with some probability dependent on the number of iterations + that were performed). + + + FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test (to a fixed base). + + Run a single iteration of the Miller-Rabin algorithm against the specified base. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param baseValue + the base value to use for this iteration. + @return false if the specified base is a witness to compositeness (so + candidate is definitely NOT prime), or else true. + + + Used to return the output from the + {@linkplain Primes#enhancedMRProbablePrimeTest(BigInteger, SecureRandom, int) Enhanced + Miller-Rabin Probabilistic Primality Test} + + + Used to return the output from the {@linkplain Primes#generateSTRandomPrime(Digest, int, byte[]) Shawe-Taylor Random_Prime Routine} + + + + + BasicOcspResponse ::= SEQUENCE { + tbsResponseData ResponseData, + signatureAlgorithm AlgorithmIdentifier, + signature BIT STRING, + certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL + } + + + + + + Get all critical extension values, by oid + + IDictionary with string (OID) keys and Asn1OctetString values + + + + Get all non-critical extension values, by oid + + IDictionary with string (OID) keys and Asn1OctetString values + + + + Get non critical extensions. + + A set of non critical extension oids. + + + + Get any critical extensions. + + A sorted list of critical entension. + + + + Get the value of a given extension. + + The object ID of the extension. + An Asn1OctetString object if that extension is found or null if not. + + + The DER encoding of the tbsResponseData field. + In the event of an encoding error. + + + The certificates, if any, associated with the response. + In the event of an encoding error. + + + + Verify the signature against the tbsResponseData object we contain. + + + + The ASN.1 encoded representation of this object. + + + Generator for basic OCSP response objects. + + + basic constructor + + + construct with the responderID to be the SHA-1 keyHash of the passed in public key. + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param certStatus status of the certificate - null if okay + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param nextUpdate date when next update should be requested + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param thisUpdate date this response was valid on + @param nextUpdate date when next update should be requested + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Set the extensions for the response. + + @param responseExtensions the extension object to carry. + + + + Generate the signed response using the passed in signature calculator. + + Implementation of signing calculator factory. + The certificate chain associated with the response signer. + "produced at" date. + + + + Return an IEnumerable of the signature names supported by the generator. + + @return an IEnumerable containing recognised names. + + + create from an issuer certificate and the serial number of the + certificate it signed. + @exception OcspException if any problems occur creating the id fields. + + + Create a new CertificateID for a new serial number derived from a previous one + calculated for the same CA certificate. + + @param original the previously calculated CertificateID for the CA. + @param newSerialNumber the serial number for the new certificate of interest. + + @return a new CertificateID for newSerialNumber + + + return the serial number for the certificate associated + with this request. + + +
    +             OcspRequest     ::=     SEQUENCE {
    +                   tbsRequest                  TBSRequest,
    +                   optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
    +            
    +               TBSRequest      ::=     SEQUENCE {
    +                   version             [0]     EXPLICIT Version DEFAULT v1,
    +                   requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
    +                   requestList                 SEQUENCE OF Request,
    +                   requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
    +            
    +               Signature       ::=     SEQUENCE {
    +                   signatureAlgorithm      AlgorithmIdentifier,
    +                   signature               BIT STRING,
    +                   certs               [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL}
    +            
    +               Version         ::=             INTEGER  {  v1(0) }
    +            
    +               Request         ::=     SEQUENCE {
    +                   reqCert                     CertID,
    +                   singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
    +            
    +               CertID          ::=     SEQUENCE {
    +                   hashAlgorithm       AlgorithmIdentifier,
    +                   issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
    +                   issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
    +                   serialNumber        CertificateSerialNumber }
    +             
    +
    + + Return the DER encoding of the tbsRequest field. + @return DER encoding of tbsRequest + @throws OcspException in the event of an encoding error. + + + If the request is signed return a possibly empty CertStore containing the certificates in the + request. If the request is not signed the method returns null. + + @return null if not signed, a CertStore otherwise + @throws OcspException + + + Verify the signature against the TBSRequest object we contain. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier representing the signature algorithm + + + Return whether or not this request is signed. + + @return true if signed false otherwise. + + + Add a request for the given CertificateID. + + @param certId certificate ID of interest + + + Add a request with extensions + + @param certId certificate ID of interest + @param singleRequestExtensions the extensions to attach to the request + + + Set the requestor name to the passed in X509Principal + + @param requestorName a X509Principal representing the requestor name. + + + Generate an unsigned request + + @return the OcspReq + @throws OcspException + + + Return an IEnumerable of the signature names supported by the generator. + + @return an IEnumerable containing recognised names. + + + return the ASN.1 encoded representation of this object. + + + base generator for an OCSP response - at the moment this only supports the + generation of responses containing BasicOCSP responses. + + + note 4 is not used. + + + Carrier for a ResponderID. + + + wrapper for the RevokedInfo object + + + return the revocation reason. Note: this field is optional, test for it + with hasRevocationReason() first. + @exception InvalidOperationException if a reason is asked for and none is avaliable + + + Return the status object for the response - null indicates good. + + @return the status object for the response, null if it is good. + + + return the NextUpdate value - note: this is an optional field so may + be returned as null. + + @return nextUpdate, or null if not present. + + + wrapper for the UnknownInfo object + + + Compressed data objects + + + Get the raw input stream contained in the object. + + + Return an uncompressed input stream which allows reading of the compressed data. + + + The algorithm used for compression + + + Class for producing compressed data packets. + + + +

    + Return an output stream which will save the data being written to + the compressed object. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + Stream to be used for output. + A Stream for output of the compressed data. + + + +
    + + +

    + Return an output stream which will compress the data as it is written to it. + The stream will be written out in chunks according to the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used. +

    +

    + Note: using this may break compatibility with RFC 1991 compliant tools. + Only recent OpenPGP implementations are capable of accepting these streams. +

    +
    + Stream to be used for output. + The buffer to use. + A Stream for output of the compressed data. + + + + +
    + + Close the compressed object.summary> + + + + Thrown if the IV at the start of a data stream indicates the wrong key is being used. + + + + Generic exception class for PGP encoding/decoding problems. + + + Return the raw input stream for the data stream. + + + Return true if the message is integrity protected. + True, if there is a modification detection code namespace associated + with this stream. + + + Note: This can only be called after the message has been read. + True, if the message verifies, false otherwise + + + Generator for encrypted objects. + + + Existing SecureRandom constructor. + The symmetric algorithm to use. + Source of randomness. + + + Creates a cipher stream which will have an integrity packet associated with it. + + + Base constructor. + The symmetric algorithm to use. + Source of randomness. + PGP 2.6.x compatibility required. + + + + Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1). + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Add a PBE encryption method to the encrypted object. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Add a PBE encryption method to the encrypted object. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Add a PBE encryption method to the encrypted object. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Add a public key encrypted session key to the encrypted object. + + + +

    + If buffer is non null stream assumed to be partial, otherwise the length will be used + to output a fixed length packet. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    +
    + + +

    + Return an output stream which will encrypt the data as it is written to it. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    +
    + + +

    + Return an output stream which will encrypt the data as it is written to it. + The stream will be written out in chunks according to the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used. +

    +
    +
    + + +

    + Close off the encrypted object - this is equivalent to calling Close() on the stream + returned by the Open() method. +

    +

    + Note: This does not close the underlying output stream, only the stream on top of + it created by the Open() method. +

    +
    +
    + + A holder for a list of PGP encryption method packets. + + + Key flag values for the KeyFlags subpacket. + + + + General class to handle JCA key pairs and convert them into OpenPGP ones. +

    + A word for the unwary, the KeyId for an OpenPGP public key is calculated from + a hash that includes the time of creation, if you pass a different date to the + constructor below with the same public private key pair the KeyIs will not be the + same as for previous generations of the key, so ideally you only want to do + this once. +

    +
    +
    + + Create a key pair from a PgpPrivateKey and a PgpPublicKey. + The public key. + The private key. + + + The keyId associated with this key pair. + + + + Generator for a PGP master and subkey ring. + This class will generate both the secret and public key rings + + + + + Create a new key ring generator using old style checksumming. It is recommended to use + SHA1 checksumming where possible. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + + If true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + + If true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + Add a subkey to the key ring to be generated with default certification. + + + + Add a subkey to the key ring to be generated with default certification. + + The key pair. + The hash algorithm. + + + + Add a subkey with specific hashed and unhashed packets associated with it and + default certification. + + Public/private key pair. + Hashed packet values to be included in certification. + Unhashed packets values to be included in certification. + + + + + Add a subkey with specific hashed and unhashed packets associated with it and + default certification. + + Public/private key pair. + Hashed packet values to be included in certification. + Unhashed packets values to be included in certification. + The hash algorithm. + exception adding subkey: + + + + Return the secret key ring. + + + Return the public key ring that corresponds to the secret key ring. + + + + Thrown if the key checksum is invalid. + + + + Class for processing literal data objects. + + + The special name indicating a "for your eyes only" packet. + + + Return the file name as an unintrepreted byte array. + + + The raw input stream for the data stream. + + + The input stream representing the data stream. + + + The format of the data stream - Binary or Text + + + The file name that's associated with the data stream. + + + The modification time for the file. + + + Class for producing literal data packets. + + + The special name indicating a "for your eyes only" packet. + + + + Generates literal data objects in the old format. + This is important if you need compatibility with PGP 2.6.x. + + If true, uses old format. + + + +

    + Open a literal data packet, returning a stream to store the data inside the packet. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + The stream we want the packet in. + The format we are using. + The name of the 'file'. + The length of the data we will write. + The time of last modification we want stored. +
    + + +

    + Open a literal data packet, returning a stream to store the data inside the packet, + as an indefinite length stream. The stream is written out as a series of partial + packets with a chunk size determined by the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used.

    +
    + The stream we want the packet in. + The format we are using. + The name of the 'file'. + The time of last modification we want stored. + The buffer to use for collecting data to put into chunks. +
    + + +

    + Open a literal data packet for the passed in FileInfo object, returning + an output stream for saving the file contents. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + The stream we want the packet in. + The format we are using. + The FileInfo object containg the packet details. +
    + + + Close the literal data packet - this is equivalent to calling Close() + on the stream returned by the Open() method. + + + + + A PGP marker packet - in general these should be ignored other than where + the idea is to preserve the original input stream. + + + + + General class for reading a PGP object stream. +

    + Note: if this class finds a PgpPublicKey or a PgpSecretKey it + will create a PgpPublicKeyRing, or a PgpSecretKeyRing for each + key found. If all you are trying to do is read a key ring file use + either PgpPublicKeyRingBundle or PgpSecretKeyRingBundle.

    +
    +
    + + Return the next object in the stream, or null if the end is reached. + On a parse error + + + + Return all available objects in a list. + + An IList containing all objects from this factory, in order. + + + A one pass signature object. + + + Initialise the signature object for verification. + + + Verify the calculated signature against the passed in PgpSignature. + + + Holder for a list of PgpOnePassSignature objects. + + + Padding functions. + + + A password based encryption object. + + + Return the raw input stream for the data stream. + + + Return the decrypted input stream, using the passed in passphrase. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Return the decrypted input stream, using the passed in passphrase. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Return the decrypted input stream, using the passed in passphrase. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + General class to contain a private key for use with other OpenPGP objects. + + + + Create a PgpPrivateKey from a keyID, the associated public data packet, and a regular private key. + + ID of the corresponding public key. + the public key data packet to be associated with this private key. + the private key data packet to be associated with this private key. + + + The keyId associated with the contained private key. + + + The public key packet associated with this private key, if available. + + + The contained private key. + + + General class to handle a PGP public key object. + + + + Create a PgpPublicKey from the passed in lightweight one. + + + Note: the time passed in affects the value of the key's keyId, so you probably only want + to do this once for a lightweight key, or make sure you keep track of the time you used. + + Asymmetric algorithm type representing the public key. + Actual public key to associate. + Date of creation. + If pubKey is not public. + On key creation problem. + + + Constructor for a sub-key. + + + Copy constructor. + The public key to copy. + + + Return the trust data associated with the public key, if present. + A byte array with trust data, null otherwise. + + + The number of valid seconds from creation time - zero means no expiry. + + + The fingerprint of the key + + + The public key contained in the object. + A lightweight public key. + If the key algorithm is not recognised. + + + Allows enumeration of any user IDs associated with the key. + An IEnumerable of string objects. + + + Allows enumeration of any user attribute vectors associated with the key. + An IEnumerable of PgpUserAttributeSubpacketVector objects. + + + Allows enumeration of any signatures associated with the passed in id. + The ID to be matched. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of signatures associated with the passed in user attributes. + The vector of user attributes to be matched. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of signatures of the passed in type that are on this key. + The type of the signature to be returned. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of all signatures/certifications associated with this key. + An IEnumerable with all signatures/certifications. + + + Return all signatures/certifications directly associated with this key (ie, not to a user id). + + @return an iterator (possibly empty) with all signatures/certifications. + + + Check whether this (sub)key has a revocation signature on it. + True, if this (sub)key has been revoked. + + + Add a certification for an id to the given public key. + The key the certification is to be added to. + The ID the certification is associated with. + The new certification. + The re-certified key. + + + Add a certification for the given UserAttributeSubpackets to the given public key. + The key the certification is to be added to. + The attributes the certification is associated with. + The new certification. + The re-certified key. + + + + Remove any certifications associated with a user attribute subpacket on a key. + + The key the certifications are to be removed from. + The attributes to be removed. + + The re-certified key, or null if the user attribute subpacket was not found on the key. + + + + Remove any certifications associated with a given ID on a key. + The key the certifications are to be removed from. + The ID that is to be removed. + The re-certified key, or null if the ID was not found on the key. + + + Remove a certification associated with a given ID on a key. + The key the certifications are to be removed from. + The ID that the certfication is to be removed from. + The certfication to be removed. + The re-certified key, or null if the certification was not found. + + + Remove a certification associated with a given user attributes on a key. + The key the certifications are to be removed from. + The user attributes that the certfication is to be removed from. + The certification to be removed. + The re-certified key, or null if the certification was not found. + + + Add a revocation or some other key certification to a key. + The key the revocation is to be added to. + The key signature to be added. + The new changed public key object. + + + Remove a certification from the key. + The key the certifications are to be removed from. + The certfication to be removed. + The modified key, null if the certification was not found. + + + The version of this key. + + + The creation time of this key. + + + The number of valid days from creation time - zero means no expiry. + WARNING: This method will return 1 for keys with version > 3 that expire in less than 1 day + + + The keyId associated with the public key. + + + + Check if this key has an algorithm type that makes it suitable to use for encryption. + + + Note: with version 4 keys KeyFlags subpackets should also be considered when present for + determining the preferred use of the key. + + + true if this key algorithm is suitable for encryption. + + + + True, if this is a master key. + + + The algorithm code associated with the public key. + + + The strength of the key in bits. + + + A public key encrypted data object. + + + + Return the algorithm code for the symmetric algorithm used to encrypt the data. + + + + Return the decrypted data stream for the packet. + + + The key ID for the key used to encrypt the data. + + + + Class to hold a single master public key and its subkeys. +

    + Often PGP keyring files consist of multiple master keys, if you are trying to process + or construct one of these you should use the PgpPublicKeyRingBundle class. +

    +
    +
    + + Return the first public key in the ring. + + + Return the public key referred to by the passed in key ID if it is present. + + + Allows enumeration of all the public keys. + An IEnumerable of PgpPublicKey objects. + + + + Returns a new key ring with the public key passed in either added or + replacing an existing one. + + The public key ring to be modified. + The public key to be inserted. + A new PgpPublicKeyRing + + + Returns a new key ring with the public key passed in removed from the key ring. + The public key ring to be modified. + The public key to be removed. + A new PgpPublicKeyRing, or null if pubKey is not found. + + + + Often a PGP key ring file is made up of a succession of master/sub-key key rings. + If you want to read an entire public key file in one hit this is the class for you. + + + + Build a PgpPublicKeyRingBundle from the passed in input stream. + Input stream containing data. + If a problem parsing the stream occurs. + If an object is encountered which isn't a PgpPublicKeyRing. + + + Allow enumeration of the public key rings making up this collection. + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + If true, case is ignored in user ID comparisons. + An IEnumerable of key rings which matched (possibly none). + + + Return the PGP public key associated with the given key id. + The ID of the public key to return. + + + Return the public key ring which contains the key referred to by keyId + key ID to match against + + + + Return true if a key matching the passed in key ID is present, false otherwise. + + key ID to look for. + + + + Return a new bundle containing the contents of the passed in bundle and + the passed in public key ring. + + The PgpPublicKeyRingBundle the key ring is to be added to. + The key ring to be added. + A new PgpPublicKeyRingBundle merging the current one with the passed in key ring. + If the keyId for the passed in key ring is already present. + + + + Return a new bundle containing the contents of the passed in bundle with + the passed in public key ring removed. + + The PgpPublicKeyRingBundle the key ring is to be removed from. + The key ring to be removed. + A new PgpPublicKeyRingBundle not containing the passed in key ring. + If the keyId for the passed in key ring is not present. + + + Return the number of key rings in this collection. + + + General class to handle a PGP secret key object. + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + If utf8PassPhrase is true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + If utf8PassPhrase is true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + Replace the passed the public key on the passed in secret key. + Secret key to change. + New public key. + A new secret key. + If KeyId's do not match. + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Parse a secret key from one of the GPG S expression keys. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Parse a secret key from one of the GPG S expression keys. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Parse a secret key from one of the GPG S expression keys. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Parse a secret key from one of the GPG S expression keys. + + + + + Check if this key has an algorithm type that makes it suitable to use for signing. + + + Note: with version 4 keys KeyFlags subpackets should also be considered when present for + determining the preferred use of the key. + + + true if this key algorithm is suitable for use with signing. + + + + True, if this is a master key. + + + Detect if the Secret Key's Private Key is empty or not + + + The algorithm the key is encrypted with. + + + The key ID of the public key associated with this key. + + + Return the S2K usage associated with this key. + + + Return the S2K used to process this key. + + + The public key associated with this key. + + + Allows enumeration of any user IDs associated with the key. + An IEnumerable of string objects. + + + Allows enumeration of any user attribute vectors associated with the key. + An IEnumerable of string objects. + + + + Class to hold a single master secret key and its subkeys. +

    + Often PGP keyring files consist of multiple master keys, if you are trying to process + or construct one of these you should use the PgpSecretKeyRingBundle class. +

    +
    +
    + + Return the public key for the master key. + + + Return the master private key. + + + Allows enumeration of the secret keys. + An IEnumerable of PgpSecretKey objects. + + + + Return an iterator of the public keys in the secret key ring that + have no matching private key. At the moment only personal certificate data + appears in this fashion. + + An IEnumerable of unattached, or extra, public keys. + + + + Replace the public key set on the secret ring with the corresponding key off the public ring. + + Secret ring to be changed. + Public ring containing the new public key set. + + + + Return a copy of the passed in secret key ring, with the master key and sub keys encrypted + using a new password and the passed in algorithm. + + The PgpSecretKeyRing to be copied. + The current password for key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Returns a new key ring with the secret key passed in either added or + replacing an existing one with the same key ID. + + The secret key ring to be modified. + The secret key to be inserted. + A new PgpSecretKeyRing + + + Returns a new key ring with the secret key passed in removed from the key ring. + The secret key ring to be modified. + The secret key to be removed. + A new PgpSecretKeyRing, or null if secKey is not found. + + + + Often a PGP key ring file is made up of a succession of master/sub-key key rings. + If you want to read an entire secret key file in one hit this is the class for you. + + + + Build a PgpSecretKeyRingBundle from the passed in input stream. + Input stream containing data. + If a problem parsing the stream occurs. + If an object is encountered which isn't a PgpSecretKeyRing. + + + Allow enumeration of the secret key rings making up this collection. + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + If true, case is ignored in user ID comparisons. + An IEnumerable of key rings which matched (possibly none). + + + Return the PGP secret key associated with the given key id. + The ID of the secret key to return. + + + Return the secret key ring which contains the key referred to by keyId + The ID of the secret key + + + + Return true if a key matching the passed in key ID is present, false otherwise. + + key ID to look for. + + + + Return a new bundle containing the contents of the passed in bundle and + the passed in secret key ring. + + The PgpSecretKeyRingBundle the key ring is to be added to. + The key ring to be added. + A new PgpSecretKeyRingBundle merging the current one with the passed in key ring. + If the keyId for the passed in key ring is already present. + + + + Return a new bundle containing the contents of the passed in bundle with + the passed in secret key ring removed. + + The PgpSecretKeyRingBundle the key ring is to be removed from. + The key ring to be removed. + A new PgpSecretKeyRingBundle not containing the passed in key ring. + If the keyId for the passed in key ring is not present. + + + Return the number of rings in this collection. + + + A PGP signature object. + + + Return true if this signature represents a certification. + + + + Verify the signature as certifying the passed in public key as associated + with the passed in user attributes. + + User attributes the key was stored under. + The key to be verified. + True, if the signature matches, false otherwise. + + + + Verify the signature as certifying the passed in public key as associated + with the passed in ID. + + ID the key was stored under. + The key to be verified. + True, if the signature matches, false otherwise. + + + Verify a certification for the passed in key against the passed in master key. + The key we are verifying against. + The key we are verifying. + True, if the certification is valid, false otherwise. + + + Verify a key certification, such as revocation, for the passed in key. + The key we are checking. + True, if the certification is valid, false otherwise. + + + + Return true if the passed in signature type represents a certification, false if the signature type is not. + + + true if signatureType is a certification, false otherwise. + + + The OpenPGP version number for this signature. + + + The key algorithm associated with this signature. + + + The hash algorithm associated with this signature. + + + The ID of the key that created the signature. + + + The creation time of this signature. + + + + Return true if the signature has either hashed or unhashed subpackets. + + + + Generator for PGP signatures. + + + Create a generator for the passed in keyAlgorithm and hashAlgorithm codes. + + + Initialise the generator for signing. + + + Initialise the generator for signing. + + + Return the one pass header associated with the current signature. + + + Return a signature object containing the current signature state. + + + Generate a certification for the passed in ID and key. + The ID we are certifying against the public key. + The key we are certifying against the ID. + The certification. + + + Generate a certification for the passed in userAttributes. + The ID we are certifying against the public key. + The key we are certifying against the ID. + The certification. + + + Generate a certification for the passed in key against the passed in master key. + The key we are certifying against. + The key we are certifying. + The certification. + + + Generate a certification, such as a revocation, for the passed in key. + The key we are certifying. + The certification. + + + A list of PGP signatures - normally in the signature block after literal data. + + + Generator for signature subpackets. + + + + Add a TrustSignature packet to the signature. The values for depth and trust are largely + installation dependent but there are some guidelines in RFC 4880 - 5.2.3.13. + + true if the packet is critical. + depth level. + trust amount. + + + + Set the number of seconds a key is valid for after the time of its creation. + A value of zero means the key never expires. + + True, if should be treated as critical, false otherwise. + The number of seconds the key is valid, or zero if no expiry. + + + + Set the number of seconds a signature is valid for after the time of its creation. + A value of zero means the signature never expires. + + True, if should be treated as critical, false otherwise. + The number of seconds the signature is valid, or zero if no expiry. + + + + Set the creation time for the signature. +

    + Note: this overrides the generation of a creation time when the signature + is generated.

    +
    +
    + + + Sets revocation reason sub packet + + + + + Sets revocation key sub packet + + + + + Sets issuer key sub packet + + + + Container for a list of signature subpackets. + + + Return true if a particular subpacket type exists. + + @param type type to look for. + @return true if present, false otherwise. + + + Return all signature subpackets of the passed in type. + @param type subpacket type code + @return an array of zero or more matching subpackets. + + + + Return the number of seconds a signature is valid for after its creation date. + A value of zero means the signature never expires. + + Seconds a signature is valid for. + + + + Return the number of seconds a key is valid for after its creation date. + A value of zero means the key never expires. + + Seconds a signature is valid for. + + + Return the number of packets this vector contains. + + + Container for a list of user attribute subpackets. + + + Basic utility class. + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Write out the passed in file as a literal data packet. + + + Write out the passed in file as a literal data packet in partial packet format. + + + + Return either an ArmoredInputStream or a BcpgInputStream based on whether + the initial characters of the stream are binary PGP encodings or not. + + + + Generator for old style PGP V3 Signatures. + + + Create a generator for the passed in keyAlgorithm and hashAlgorithm codes. + + + Initialise the generator for signing. + + + Initialise the generator for signing. + + + Return the one pass header associated with the current signature. + + + Return a V3 signature object containing the current signature state. + + + Utility functions for looking a S-expression keys. This class will move when it finds a better home! +

    + Format documented here: + http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=agent/keyformat.txt;h=42c4b1f06faf1bbe71ffadc2fee0fad6bec91a97;hb=refs/heads/master +

    +
    + + PEM generator for the original set of PEM objects used in Open SSL. + + + + A + + + + + Class for reading OpenSSL PEM encoded streams containing + X509 certificates, PKCS8 encoded keys and PKCS7 objects. +

    + In the case of PKCS7 objects the reader will return a CMS ContentInfo object. Keys and + Certificates will be returned using the appropriate java.security type.

    +
    + + + A + + + + + Create a new PemReader + + @param reader the Reader + + + Create a new PemReader with a password finder + + @param reader the Reader + @param pFinder the password finder + + + Reads in a X509Certificate. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Reads in a X509CRL. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Reads in a PKCS10 certification request. + + @return the certificate request. + @throws IOException if an I/O error occured + + + Reads in a X509 Attribute Certificate. + + @return the X509 Attribute Certificate + @throws IOException if an I/O error occured + + + Reads in a PKCS7 object. This returns a ContentInfo object suitable for use with the CMS + API. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Read a Key Pair + + + General purpose writer for OpenSSL PEM objects. + + + A generic PEM writer, based on RFC 1421 + + + Base constructor. + + @param out output stream to use. + + + Return the number of bytes or characters required to contain the + passed in object if it is PEM encoded. + + @param obj pem object to be output + @return an estimate of the number of bytes + + + The TextWriter object to write the output to. + + + Constructor for an unencrypted private key PEM object. + + @param key private key to be encoded. + + + Constructor for an encrypted private key PEM object. + + @param key private key to be encoded + @param algorithm encryption algorithm to use + @param provider provider to use + @throws NoSuchAlgorithmException if algorithm/mode cannot be found + + + + A class for verifying and creating Pkcs10 Certification requests. + + + CertificationRequest ::= Sequence { + certificationRequestInfo CertificationRequestInfo, + signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + signature BIT STRING + } + + CertificationRequestInfo ::= Sequence { + version Integer { v1(0) } (v1,...), + subject Name, + subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + attributes [0] Attributes{{ CRIAttributes }} + } + + Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + + Attr { ATTRIBUTE:IOSet } ::= Sequence { + type ATTRIBUTE.&id({IOSet}), + values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + } + + see + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + Name of Sig Alg. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + Matching Private key for nominated (above) public key to be used to sign the request. + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + The factory for signature calculators to sign the PKCS#10 request with. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + Matching Private key for nominated (above) public key to be used to sign the request. + + + + Get the public key. + + The public key. + + + + Verify Pkcs10 Cert Request is valid. + + true = valid. + + + + A class for creating and verifying Pkcs10 Certification requests (this is an extension on ). + The requests are made using delay signing. This is useful for situations where + the private key is in another environment and not directly accessible (e.g. HSM) + So the first step creates the request, then the signing is done outside this + object and the signature is then used to complete the request. + + + CertificationRequest ::= Sequence { + certificationRequestInfo CertificationRequestInfo, + signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + signature BIT STRING + } + + CertificationRequestInfo ::= Sequence { + version Integer { v1(0) } (v1,...), + subject Name, + subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + attributes [0] Attributes{{ CRIAttributes }} + } + + Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + + Attr { ATTRIBUTE:IOSet } ::= Sequence { + type ATTRIBUTE.&id({IOSet}), + values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + } + + see + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + Name of Sig Alg. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + + After the object is constructed use the and finally the + SignRequest methods to finalize the request. + + + + simply return the cert entry for the private key + + + Utility class for reencoding PKCS#12 files to definite length. + + + Just re-encode the outer layer of the PKCS#12 file to definite length encoding. + + @param berPKCS12File - original PKCS#12 file + @return a byte array representing the DER encoding of the PFX structure + @throws IOException + + + Re-encode the PKCS#12 structure to definite length encoding at the inner layer + as well, recomputing the MAC accordingly. + + @param berPKCS12File - original PKCS12 file. + @param provider - provider to use for MAC calculation. + @return a byte array representing the DER encoding of the PFX structure. + @throws IOException on parsing, encoding errors. + + + + Returns the revocationDate. + + + + + Returns the certStatus. + + + + Returns an immutable Set of X.509 attribute certificate + extensions that this PkixAttrCertChecker supports or + null if no extensions are supported. +

    + Each element of the set is a String representing the + Object Identifier (OID) of the X.509 extension that is supported. +

    +

    + All X.509 attribute certificate extensions that a + PkixAttrCertChecker might possibly be able to process + should be included in the set. +

    + + @return an immutable Set of X.509 extension OIDs (in + String format) supported by this + PkixAttrCertChecker, or null if no + extensions are supported +
    + + Performs checks on the specified attribute certificate. Every handled + extension is rmeoved from the unresolvedCritExts + collection. + + @param attrCert The attribute certificate to be checked. + @param certPath The certificate path which belongs to the attribute + certificate issuer public key certificate. + @param holderCertPath The certificate path which belongs to the holder + certificate. + @param unresolvedCritExts a Collection of OID strings + representing the current set of unresolved critical extensions + @throws CertPathValidatorException if the specified attribute certificate + does not pass the check. + + + Returns a clone of this object. + + @return a copy of this PkixAttrCertChecker + + + Build and validate a CertPath using the given parameter. + + @param params PKIXBuilderParameters object containing all information to + build the CertPath + + + CertPathValidatorSpi implementation for X.509 Attribute Certificates la RFC 3281. + + @see org.bouncycastle.x509.ExtendedPkixParameters + + + Validates an attribute certificate with the given certificate path. + +

    + params must be an instance of + ExtendedPkixParameters. +

    + The target constraints in the params must be an + X509AttrCertStoreSelector with at least the attribute + certificate criterion set. Obey that also target informations may be + necessary to correctly validate this attribute certificate. +

    + The attribute certificate issuer must be added to the trusted attribute + issuers with {@link ExtendedPkixParameters#setTrustedACIssuers(Set)}. +

    + @param certPath The certificate path which belongs to the attribute + certificate issuer public key certificate. + @param params The PKIX parameters. + @return A PKIXCertPathValidatorResult of the result of + validating the certPath. + @throws InvalidAlgorithmParameterException if params is + inappropriate for this validator. + @throws CertPathValidatorException if the verification fails. +
    + + + Summary description for PkixBuilderParameters. + + + + + Summary description for PkixParameters. + + + + This is the default PKIX validity model. Actually there are two variants + of this: The PKIX model and the modified PKIX model. The PKIX model + verifies that all involved certificates must have been valid at the + current time. The modified PKIX model verifies that all involved + certificates were valid at the signing time. Both are indirectly choosen + with the {@link PKIXParameters#setDate(java.util.Date)} method, so this + methods sets the Date when all certificates must have been + valid. + + + This model uses the following validity model. Each certificate must have + been valid at the moment where is was used. That means the end + certificate must have been valid at the time the signature was done. The + CA certificate which signed the end certificate must have been valid, + when the end certificate was signed. The CA (or Root CA) certificate must + have been valid, when the CA certificate was signed and so on. So the + {@link PKIXParameters#setDate(java.util.Date)} method sets the time, when + the end certificate must have been valid.

    It is used e.g. + in the German signature law. + + + Creates an instance of PKIXParameters with the specified Set of + most-trusted CAs. Each element of the set is a TrustAnchor.
    +
    + Note that the Set is copied to protect against subsequent modifications. + + @param trustAnchors + a Set of TrustAnchors + + @exception InvalidAlgorithmParameterException + if the specified Set is empty + (trustAnchors.isEmpty() == true) + @exception NullPointerException + if the specified Set is null + @exception ClassCastException + if any of the elements in the Set are not of type + java.security.cert.TrustAnchor +
    + + Returns the required constraints on the target certificate. The + constraints are returned as an instance of CertSelector. If + null, no constraints are defined.
    +
    + Note that the CertSelector returned is cloned to protect against + subsequent modifications. + + @return a CertSelector specifying the constraints on the target + certificate (or null) + + @see #setTargetCertConstraints(CertSelector) +
    + + Sets the required constraints on the target certificate. The constraints + are specified as an instance of CertSelector. If null, no constraints are + defined.
    +
    + Note that the CertSelector specified is cloned to protect against + subsequent modifications. + + @param selector + a CertSelector specifying the constraints on the target + certificate (or null) + + @see #getTargetCertConstraints() +
    + + Returns an immutable Set of initial policy identifiers (OID strings), + indicating that any one of these policies would be acceptable to the + certificate user for the purposes of certification path processing. The + default return value is an empty Set, which is + interpreted as meaning that any policy would be acceptable. + + @return an immutable Set of initial policy OIDs in String + format, or an empty Set (implying any policy is + acceptable). Never returns null. + + @see #setInitialPolicies(java.util.Set) + + + Sets the Set of initial policy identifiers (OID strings), + indicating that any one of these policies would be acceptable to the + certificate user for the purposes of certification path processing. By + default, any policy is acceptable (i.e. all policies), so a user that + wants to allow any policy as acceptable does not need to call this + method, or can call it with an empty Set (or + null).
    +
    + Note that the Set is copied to protect against subsequent modifications.
    +
    + + @param initialPolicies + a Set of initial policy OIDs in String format (or + null) + + @exception ClassCastException + if any of the elements in the set are not of type String + + @see #getInitialPolicies() +
    + + Sets a List of additional certification path checkers. If + the specified List contains an object that is not a PKIXCertPathChecker, + it is ignored.
    +
    + Each PKIXCertPathChecker specified implements additional + checks on a certificate. Typically, these are checks to process and + verify private extensions contained in certificates. Each + PKIXCertPathChecker should be instantiated with any + initialization parameters needed to execute the check.
    +
    + This method allows sophisticated applications to extend a PKIX + CertPathValidator or CertPathBuilder. Each + of the specified PKIXCertPathCheckers will be called, in turn, by a PKIX + CertPathValidator or CertPathBuilder for + each certificate processed or validated.
    +
    + Regardless of whether these additional PKIXCertPathCheckers are set, a + PKIX CertPathValidator or CertPathBuilder + must perform all of the required PKIX checks on each certificate. The one + exception to this rule is if the RevocationEnabled flag is set to false + (see the {@link #setRevocationEnabled(boolean) setRevocationEnabled} + method).
    +
    + Note that the List supplied here is copied and each PKIXCertPathChecker + in the list is cloned to protect against subsequent modifications. + + @param checkers + a List of PKIXCertPathCheckers. May be null, in which case no + additional checkers will be used. + @exception ClassCastException + if any of the elements in the list are not of type + java.security.cert.PKIXCertPathChecker + @see #getCertPathCheckers() +
    + + Returns the List of certification path checkers. Each PKIXCertPathChecker + in the returned IList is cloned to protect against subsequent modifications. + + @return an immutable List of PKIXCertPathCheckers (may be empty, but not + null) + + @see #setCertPathCheckers(java.util.List) + + + Adds a PKIXCertPathChecker to the list of certification + path checkers. See the {@link #setCertPathCheckers setCertPathCheckers} + method for more details. +

    + Note that the PKIXCertPathChecker is cloned to protect + against subsequent modifications.

    + + @param checker a PKIXCertPathChecker to add to the list of + checks. If null, the checker is ignored (not added to list). +
    + + Method to support Clone() under J2ME. + super.Clone() does not exist and fields are not copied. + + @param params Parameters to set. If this are + ExtendedPkixParameters they are copied to. + + + Sets the Bouncy Castle Stores for finding CRLs, certificates, attribute + certificates or cross certificates. +

    + The IList is cloned. +

    + + @param stores A list of stores to use. + @see #getStores + @throws ClassCastException if an element of stores is not + a {@link Store}. +
    + + Adds a Bouncy Castle {@link Store} to find CRLs, certificates, attribute + certificates or cross certificates. +

    + This method should be used to add local stores, like collection based + X.509 stores, if available. Local stores should be considered first, + before trying to use additional (remote) locations, because they do not + need possible additional network traffic. +

    + If store is null it is ignored. +

    + + @param store The store to add. + @see #getStores +
    + + Adds an additional Bouncy Castle {@link Store} to find CRLs, certificates, + attribute certificates or cross certificates. +

    + You should not use this method. This method is used for adding additional + X.509 stores, which are used to add (remote) locations, e.g. LDAP, found + during X.509 object processing, e.g. in certificates or CRLs. This method + is used in PKIX certification path processing. +

    + If store is null it is ignored. +

    + + @param store The store to add. + @see #getStores() +
    + + Returns an IList of additional Bouncy Castle + Stores used for finding CRLs, certificates, attribute + certificates or cross certificates. + + @return an immutable IList of additional Bouncy Castle + Stores. Never null. + + @see #addAddionalStore(Store) + + + Returns an IList of Bouncy Castle + Stores used for finding CRLs, certificates, attribute + certificates or cross certificates. + + @return an immutable IList of Bouncy Castle + Stores. Never null. + + @see #setStores(IList) + + + Sets if additional {@link X509Store}s for locations like LDAP found in + certificates or CRLs should be used. + + @param enabled true if additional stores are used. + + + Returns the required constraints on the target certificate or attribute + certificate. The constraints are returned as an instance of + IX509Selector. If null, no constraints are + defined. + +

    + The target certificate in a PKIX path may be a certificate or an + attribute certificate. +

    + Note that the IX509Selector returned is cloned to protect + against subsequent modifications. +

    + @return a IX509Selector specifying the constraints on the + target certificate or attribute certificate (or null) + @see #setTargetConstraints + @see X509CertStoreSelector + @see X509AttributeCertStoreSelector +
    + + Sets the required constraints on the target certificate or attribute + certificate. The constraints are specified as an instance of + IX509Selector. If null, no constraints are + defined. +

    + The target certificate in a PKIX path may be a certificate or an + attribute certificate. +

    + Note that the IX509Selector specified is cloned to protect + against subsequent modifications. +

    + + @param selector a IX509Selector specifying the constraints on + the target certificate or attribute certificate (or + null) + @see #getTargetConstraints + @see X509CertStoreSelector + @see X509AttributeCertStoreSelector +
    + + Returns the trusted attribute certificate issuers. If attribute + certificates is verified the trusted AC issuers must be set. +

    + The returned ISet consists of TrustAnchors. +

    + The returned ISet is immutable. Never null +

    + + @return Returns an immutable set of the trusted AC issuers. +
    + + Sets the trusted attribute certificate issuers. If attribute certificates + is verified the trusted AC issuers must be set. +

    + The trustedACIssuers must be a ISet of + TrustAnchor +

    + The given set is cloned. +

    + + @param trustedACIssuers The trusted AC issuers to set. Is never + null. + @throws ClassCastException if an element of stores is not + a TrustAnchor. +
    + + Returns the necessary attributes which must be contained in an attribute + certificate. +

    + The returned ISet is immutable and contains + Strings with the OIDs. +

    + + @return Returns the necessary AC attributes. +
    + + Sets the necessary which must be contained in an attribute certificate. +

    + The ISet must contain Strings with the + OIDs. +

    + The set is cloned. +

    + + @param necessaryACAttributes The necessary AC attributes to set. + @throws ClassCastException if an element of + necessaryACAttributes is not a + String. +
    + + Returns the attribute certificates which are not allowed. +

    + The returned ISet is immutable and contains + Strings with the OIDs. +

    + + @return Returns the prohibited AC attributes. Is never null. +
    + + Sets the attribute certificates which are not allowed. +

    + The ISet must contain Strings with the + OIDs. +

    + The set is cloned. +

    + + @param prohibitedACAttributes The prohibited AC attributes to set. + @throws ClassCastException if an element of + prohibitedACAttributes is not a + String. +
    + + Returns the attribute certificate checker. The returned set contains + {@link PKIXAttrCertChecker}s and is immutable. + + @return Returns the attribute certificate checker. Is never + null. + + + Sets the attribute certificate checkers. +

    + All elements in the ISet must a {@link PKIXAttrCertChecker}. +

    +

    + The given set is cloned. +

    + + @param attrCertCheckers The attribute certificate checkers to set. Is + never null. + @throws ClassCastException if an element of attrCertCheckers + is not a PKIXAttrCertChecker. +
    + + Whether delta CRLs should be used for checking the revocation status. + Defaults to false. + + + The validity model. + @see #CHAIN_VALIDITY_MODEL + @see #PKIX_VALIDITY_MODEL + + + Returns if additional {@link X509Store}s for locations like LDAP found + in certificates or CRLs should be used. + + @return Returns true if additional stores are used. + + + Returns an instance of PkixBuilderParameters. +

    + This method can be used to get a copy from other + PKIXBuilderParameters, PKIXParameters, + and ExtendedPKIXParameters instances. +

    + + @param pkixParams The PKIX parameters to create a copy of. + @return An PkixBuilderParameters instance. +
    + + + Excluded certificates are not used for building a certification path. + + the excluded certificates. + + + + Sets the excluded certificates which are not used for building a + certification path. If the ISet is null an + empty set is assumed. + + + The given set is cloned to protect it against subsequent modifications. + + The excluded certificates to set. + + + Can alse handle ExtendedPKIXBuilderParameters and + PKIXBuilderParameters. + + @param params Parameters to set. + @see org.bouncycastle.x509.ExtendedPKIXParameters#setParams(java.security.cert.PKIXParameters) + + + Makes a copy of this PKIXParameters object. Changes to the + copy will not affect the original and vice versa. + + @return a copy of this PKIXParameters object + + + An immutable sequence of certificates (a certification path).
    +
    + This is an abstract class that defines the methods common to all CertPaths. + Subclasses can handle different kinds of certificates (X.509, PGP, etc.).
    +
    + All CertPath objects have a type, a list of Certificates, and one or more + supported encodings. Because the CertPath class is immutable, a CertPath + cannot change in any externally visible way after being constructed. This + stipulation applies to all public fields and methods of this class and any + added or overridden by subclasses.
    +
    + The type is a string that identifies the type of Certificates in the + certification path. For each certificate cert in a certification path + certPath, cert.getType().equals(certPath.getType()) must be true.
    +
    + The list of Certificates is an ordered List of zero or more Certificates. + This List and all of the Certificates contained in it must be immutable.
    +
    + Each CertPath object must support one or more encodings so that the object + can be translated into a byte array for storage or transmission to other + parties. Preferably, these encodings should be well-documented standards + (such as PKCS#7). One of the encodings supported by a CertPath is considered + the default encoding. This encoding is used if no encoding is explicitly + requested (for the {@link #getEncoded()} method, for instance).
    +
    + All CertPath objects are also Serializable. CertPath objects are resolved + into an alternate {@link CertPathRep} object during serialization. This + allows a CertPath object to be serialized into an equivalent representation + regardless of its underlying implementation.
    +
    + CertPath objects can be created with a CertificateFactory or they can be + returned by other classes, such as a CertPathBuilder.
    +
    + By convention, X.509 CertPaths (consisting of X509Certificates), are ordered + starting with the target certificate and ending with a certificate issued by + the trust anchor. That is, the issuer of one certificate is the subject of + the following one. The certificate representing the + {@link TrustAnchor TrustAnchor} should not be included in the certification + path. Unvalidated X.509 CertPaths may not follow these conventions. PKIX + CertPathValidators will detect any departure from these conventions that + cause the certification path to be invalid and throw a + CertPathValidatorException.
    +
    + Concurrent Access
    +
    + All CertPath objects must be thread-safe. That is, multiple threads may + concurrently invoke the methods defined in this class on a single CertPath + object (or more than one) with no ill effects. This is also true for the List + returned by CertPath.getCertificates.
    +
    + Requiring CertPath objects to be immutable and thread-safe allows them to be + passed around to various pieces of code without worrying about coordinating + access. Providing this thread-safety is generally not difficult, since the + CertPath and List objects in question are immutable. + + @see CertificateFactory + @see CertPathBuilder + + CertPath implementation for X.509 certificates. + +
    + + @param certs + + + Creates a CertPath of the specified type. + This constructor is protected because most users should use + a CertificateFactory to create CertPaths. + @param type the standard name of the type of Certificatesin this path + + + + Creates a CertPath of the specified type. + This constructor is protected because most users should use + a CertificateFactory to create CertPaths. + + @param type the standard name of the type of Certificatesin this path + + + + Compares this certification path for equality with the specified object. + Two CertPaths are equal if and only if their types are equal and their + certificate Lists (and by implication the Certificates in those Lists) + are equal. A CertPath is never equal to an object that is not a CertPath.
    +
    + This algorithm is implemented by this method. If it is overridden, the + behavior specified here must be maintained. + + @param other + the object to test for equality with this certification path + + @return true if the specified object is equal to this certification path, + false otherwise + + @see Object#hashCode() Object.hashCode() +
    + + Returns the encoded form of this certification path, using + the default encoding. + + @return the encoded bytes + @exception CertificateEncodingException if an encoding error occurs + + + + Returns the encoded form of this certification path, using + the specified encoding. + + @param encoding the name of the encoding to use + @return the encoded bytes + @exception CertificateEncodingException if an encoding error + occurs or the encoding requested is not supported + + + + Return a DERObject containing the encoded certificate. + + @param cert the X509Certificate object to be encoded + + @return the DERObject + + + + Returns an iteration of the encodings supported by this + certification path, with the default encoding + first. Attempts to modify the returned Iterator via its + remove method result in an UnsupportedOperationException. + + @return an Iterator over the names of the supported encodings (as Strings) + + + + + Returns the list of certificates in this certification + path. + + + + Implements the PKIX CertPathBuilding algorithm for BouncyCastle. + + @see CertPathBuilderSpi + + + Build and validate a CertPath using the given parameter. + + @param params PKIXBuilderParameters object containing all information to + build the CertPath + + + + Summary description for PkixCertPathBuilderException. + + + + + Summary description for PkixCertPathBuilderResult. + + + + + Summary description for PkixCertPathValidatorResult. + + + + * Initializes the internal state of this PKIXCertPathChecker. + *

    + * The forward flag specifies the order that certificates + * will be passed to the {@link #check check} method (forward or reverse). A + * PKIXCertPathChecker must support reverse checking + * and may support forward checking. + *

    + * + * @param forward + * the order that certificates are presented to the + * check method. If true, + * certificates are presented from target to most-trusted CA + * (forward); if false, from most-trusted CA to + * target (reverse). + * @exception CertPathValidatorException + * if this PKIXCertPathChecker is unable to + * check certificates in the specified order; it should never + * be thrown if the forward flag is false since reverse + * checking must be supported +
    + + Indicates if forward checking is supported. Forward checking refers to + the ability of the PKIXCertPathChecker to perform its + checks when certificates are presented to the check method + in the forward direction (from target to most-trusted CA). + + @return true if forward checking is supported, + false otherwise + + + * Returns an immutable Set of X.509 certificate extensions + * that this PKIXCertPathChecker supports (i.e. recognizes, + * is able to process), or null if no extensions are + * supported. + *

    + * Each element of the set is a String representing the + * Object Identifier (OID) of the X.509 extension that is supported. The OID + * is represented by a set of nonnegative integers separated by periods. + *

    + * All X.509 certificate extensions that a PKIXCertPathChecker + * might possibly be able to process should be included in the set. + *

    + * + * @return an immutable Set of X.509 extension OIDs (in + * String format) supported by this + * PKIXCertPathChecker, or null if no + * extensions are supported +
    + + Performs the check(s) on the specified certificate using its internal + state and removes any critical extensions that it processes from the + specified collection of OID strings that represent the unresolved + critical extensions. The certificates are presented in the order + specified by the init method. + + @param cert + the Certificate to be checked + @param unresolvedCritExts + a Collection of OID strings representing the + current set of unresolved critical extensions + @exception CertPathValidatorException + if the specified certificate does not pass the check + + + Returns a clone of this object. Calls the Object.clone() + method. All subclasses which maintain state must support and override + this method, if necessary. + + @return a copy of this PKIXCertPathChecker + + + The Service Provider Interface (SPI) + for the {@link CertPathValidator CertPathValidator} class. All + CertPathValidator implementations must include a class (the + SPI class) that extends this class (CertPathValidatorSpi) + and implements all of its methods. In general, instances of this class + should only be accessed through the CertPathValidator class. + For details, see the Java Cryptography Architecture.
    +
    + Concurrent Access
    +
    + Instances of this class need not be protected against concurrent + access from multiple threads. Threads that need to access a single + CertPathValidatorSpi instance concurrently should synchronize + amongst themselves and provide the necessary locking before calling the + wrapping CertPathValidator object.
    +
    + However, implementations of CertPathValidatorSpi may still + encounter concurrency issues, since multiple threads each + manipulating a different CertPathValidatorSpi instance need not + synchronize. + + CertPathValidatorSpi implementation for X.509 Certificate validation a la RFC + 3280. + +
    + + An exception indicating one of a variety of problems encountered when + validating a certification path.
    +
    + A CertPathValidatorException provides support for wrapping + exceptions. The {@link #getCause getCause} method returns the throwable, + if any, that caused this exception to be thrown.
    +
    + A CertPathValidatorException may also include the + certification path that was being validated when the exception was thrown + and the index of the certificate in the certification path that caused the + exception to be thrown. Use the {@link #getCertPath getCertPath} and + {@link #getIndex getIndex} methods to retrieve this information.
    +
    + Concurrent Access
    +
    + Unless otherwise specified, the methods defined in this class are not + thread-safe. Multiple threads that need to access a single + object concurrently should synchronize amongst themselves and + provide the necessary locking. Multiple threads each manipulating + separate objects need not synchronize. + + @see CertPathValidator + +
    + + + Creates a PkixCertPathValidatorException with the given detail + message. A detail message is a String that describes this + particular exception. + + the detail message + + + + Creates a PkixCertPathValidatorException with the specified + detail message and cause. + + the detail message + the cause (which is saved for later retrieval by the + {@link #getCause getCause()} method). (A null + value is permitted, and indicates that the cause is + nonexistent or unknown.) + + + + Creates a PkixCertPathValidatorException with the specified + detail message, cause, certification path, and index. + + the detail message (or null if none) + the cause (or null if none) + the certification path that was in the process of being + validated when the error was encountered + the index of the certificate in the certification path that * + + + + Returns the detail message for this CertPathValidatorException. + + the detail message, or null if neither the message nor cause were specified + + + Returns the certification path that was being validated when the + exception was thrown. + + @return the CertPath that was being validated when the + exception was thrown (or null if not specified) + + + Returns the index of the certificate in the certification path that + caused the exception to be thrown. Note that the list of certificates in + a CertPath is zero based. If no index has been set, -1 is + returned. + + @return the index that has been set, or -1 if none has been set + + + + Summary description for PkixCertPathValidatorUtilities. + + + + + key usage bits + + + + + Search the given Set of TrustAnchor's for one that is the + issuer of the given X509 certificate. + + the X509 certificate + a Set of TrustAnchor's + the TrustAnchor object if found or + null if not. + + @exception + + + + Returns the issuer of an attribute certificate or certificate. + + The attribute certificate or certificate. + The issuer as X500Principal. + + + Return the next working key inheriting DSA parameters if necessary. +

    + This methods inherits DSA parameters from the indexed certificate or + previous certificates in the certificate chain to the returned + PublicKey. The list is searched upwards, meaning the end + certificate is at position 0 and previous certificates are following. +

    +

    + If the indexed certificate does not contain a DSA key this method simply + returns the public key. If the DSA key already contains DSA parameters + the key is also only returned. +

    + + @param certs The certification path. + @param index The index of the certificate which contains the public key + which should be extended with DSA parameters. + @return The public key of the certificate in list position + index extended with DSA parameters if applicable. + @throws Exception if DSA parameters cannot be inherited. +
    + + + Return a Collection of all certificates or attribute certificates found + in the X509Store's that are matching the certSelect criteriums. + + a {@link Selector} object that will be used to select + the certificates + a List containing only X509Store objects. These + are used to search for certificates. + a Collection of all found or + objects. + May be empty but never null. + + + + Add the CRL issuers from the cRLIssuer field of the distribution point or + from the certificate if not given to the issuer criterion of the + selector. +

    + The issuerPrincipals are a collection with a single + X500Principal for X509Certificates. For + {@link X509AttributeCertificate}s the issuer may contain more than one + X500Principal. +

    + + @param dp The distribution point. + @param issuerPrincipals The issuers of the certificate or attribute + certificate which contains the distribution point. + @param selector The CRL selector. + @param pkixParams The PKIX parameters containing the cert stores. + @throws Exception if an exception occurs while processing. + @throws ClassCastException if issuerPrincipals does not + contain only X500Principals. +
    + + Fetches complete CRLs according to RFC 3280. + + @param dp The distribution point for which the complete CRL + @param cert The X509Certificate or + {@link org.bouncycastle.x509.X509AttributeCertificate} for + which the CRL should be searched. + @param currentDate The date for which the delta CRLs must be valid. + @param paramsPKIX The extended PKIX parameters. + @return A Set of X509CRLs with complete + CRLs. + @throws Exception if an exception occurs while picking the CRLs + or no CRLs are found. + + + Fetches delta CRLs according to RFC 3280 section 5.2.4. + + @param currentDate The date for which the delta CRLs must be valid. + @param paramsPKIX The extended PKIX parameters. + @param completeCRL The complete CRL the delta CRL is for. + @return A Set of X509CRLs with delta CRLs. + @throws Exception if an exception occurs while picking the delta + CRLs. + + + Find the issuer certificates of a given certificate. + + @param cert + The certificate for which an issuer should be found. + @param pkixParams + @return A Collection object containing the issuer + X509Certificates. Never null. + + @exception Exception + if an error occurs. + + + + Extract the value of the given extension, if it exists. + + The extension object. + The object identifier to obtain. + Asn1Object + if the extension cannot be read. + + + + crl checking + Return a Collection of all CRLs found in the X509Store's that are + matching the crlSelect criteriums. + + a {@link X509CRLStoreSelector} object that will be used + to select the CRLs + a List containing only {@link org.bouncycastle.x509.X509Store + X509Store} objects. These are used to search for CRLs + a Collection of all found {@link X509CRL X509CRL} objects. May be + empty but never null. + + + + Returns the intersection of the permitted IP ranges in + permitted with ip. + + @param permitted A Set of permitted IP addresses with + their subnet mask as byte arrays. + @param ips The IP address with its subnet mask. + @return The Set of permitted IP ranges intersected with + ip. + + + Returns the union of the excluded IP ranges in excluded + with ip. + + @param excluded A Set of excluded IP addresses with their + subnet mask as byte arrays. + @param ip The IP address with its subnet mask. + @return The Set of excluded IP ranges unified with + ip as byte arrays. + + + Calculates the union if two IP ranges. + + @param ipWithSubmask1 The first IP address with its subnet mask. + @param ipWithSubmask2 The second IP address with its subnet mask. + @return A Set with the union of both addresses. + + + Calculates the interesction if two IP ranges. + + @param ipWithSubmask1 The first IP address with its subnet mask. + @param ipWithSubmask2 The second IP address with its subnet mask. + @return A Set with the single IP address with its subnet + mask as a byte array or an empty Set. + + + Concatenates the IP address with its subnet mask. + + @param ip The IP address. + @param subnetMask Its subnet mask. + @return The concatenated IP address with its subnet mask. + + + Splits the IP addresses and their subnet mask. + + @param ipWithSubmask1 The first IP address with the subnet mask. + @param ipWithSubmask2 The second IP address with the subnet mask. + @return An array with two elements. Each element contains the IP address + and the subnet mask in this order. + + + Based on the two IP addresses and their subnet masks the IP range is + computed for each IP address - subnet mask pair and returned as the + minimum IP address and the maximum address of the range. + + @param ip1 The first IP address. + @param subnetmask1 The subnet mask of the first IP address. + @param ip2 The second IP address. + @param subnetmask2 The subnet mask of the second IP address. + @return A array with two elements. The first/second element contains the + min and max IP address of the first/second IP address and its + subnet mask. + + + Checks if the IP ip is included in the permitted ISet + permitted. + + @param permitted A Set of permitted IP addresses with + their subnet mask as byte arrays. + @param ip The IP address. + @throws PkixNameConstraintValidatorException + if the IP is not permitted. + + + Checks if the IP ip is included in the excluded ISet + excluded. + + @param excluded A Set of excluded IP addresses with their + subnet mask as byte arrays. + @param ip The IP address. + @throws PkixNameConstraintValidatorException + if the IP is excluded. + + + Checks if the IP address ip is constrained by + constraint. + + @param ip The IP address. + @param constraint The constraint. This is an IP address concatenated with + its subnetmask. + @return true if constrained, false + otherwise. + + + The common part of email1 and email2 is + added to the union union. If email1 and + email2 have nothing in common they are added both. + + @param email1 Email address constraint 1. + @param email2 Email address constraint 2. + @param union The union. + + + The most restricting part from email1 and + email2 is added to the intersection intersect. + + @param email1 Email address constraint 1. + @param email2 Email address constraint 2. + @param intersect The intersection. + + + Checks if the given GeneralName is in the permitted ISet. + + @param name The GeneralName + @throws PkixNameConstraintValidatorException + If the name + + + Check if the given GeneralName is contained in the excluded ISet. + + @param name The GeneralName. + @throws PkixNameConstraintValidatorException + If the name is + excluded. + + + Updates the permitted ISet of these name constraints with the intersection + with the given subtree. + + @param permitted The permitted subtrees + + + Adds a subtree to the excluded ISet of these name constraints. + + @param subtree A subtree with an excluded GeneralName. + + + Returns the maximum IP address. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The maximum IP address. + + + Returns the minimum IP address. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The minimum IP address. + + + Compares IP address ip1 with ip2. If ip1 + is equal to ip2 0 is returned. If ip1 is bigger 1 is returned, -1 + otherwise. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return 0 if ip1 is equal to ip2, 1 if ip1 is bigger, -1 otherwise. + + + Returns the logical OR of the IP addresses ip1 and + ip2. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The OR of ip1 and ip2. + + + Stringifies an IPv4 or v6 address with subnet mask. + + @param ip The IP with subnet mask. + @return The stringified IP address. + + + + Summary description for PkixPolicyNode. + + + + Constructors + + + + This class helps to handle CRL revocation reasons mask. Each CRL handles a + certain set of revocation reasons. + + + + + Constructs are reason mask with the reasons. + + The reasons. + + + + A reason mask with no reason. + + + + + A mask with all revocation reasons. + + + + Adds all reasons from the reasons mask to this mask. + + @param mask The reasons mask to add. + + + + Intersects this mask with the given reasons mask. + + mask The mask to intersect with. + The intersection of this and teh given mask. + + + + Returns true if the passed reasons mask has new reasons. + + The reasons mask which should be tested for new reasons. + true if the passed reasons mask has new reasons. + + + + Returns true if this reasons mask contains all possible + reasons. + + true if this reasons mask contains all possible reasons. + + + + + Returns the reasons in this mask. + + + + If the complete CRL includes an issuing distribution point (IDP) CRL + extension check the following: +

    + (i) If the distribution point name is present in the IDP CRL extension + and the distribution field is present in the DP, then verify that one of + the names in the IDP matches one of the names in the DP. If the + distribution point name is present in the IDP CRL extension and the + distribution field is omitted from the DP, then verify that one of the + names in the IDP matches one of the names in the cRLIssuer field of the + DP. +

    +

    + (ii) If the onlyContainsUserCerts boolean is asserted in the IDP CRL + extension, verify that the certificate does not include the basic + constraints extension with the cA boolean asserted. +

    +

    + (iii) If the onlyContainsCACerts boolean is asserted in the IDP CRL + extension, verify that the certificate includes the basic constraints + extension with the cA boolean asserted. +

    +

    + (iv) Verify that the onlyContainsAttributeCerts boolean is not asserted. +

    + + @param dp The distribution point. + @param cert The certificate. + @param crl The CRL. + @throws AnnotatedException if one of the conditions is not met or an error occurs. +
    + + If the DP includes cRLIssuer, then verify that the issuer field in the + complete CRL matches cRLIssuer in the DP and that the complete CRL + contains an + g distribution point extension with the indirectCRL + boolean asserted. Otherwise, verify that the CRL issuer matches the + certificate issuer. + + @param dp The distribution point. + @param cert The certificate ot attribute certificate. + @param crl The CRL for cert. + @throws AnnotatedException if one of the above conditions does not apply or an error + occurs. + + + Obtain and validate the certification path for the complete CRL issuer. + If a key usage extension is present in the CRL issuer's certificate, + verify that the cRLSign bit is set. + + @param crl CRL which contains revocation information for the certificate + cert. + @param cert The attribute certificate or certificate to check if it is + revoked. + @param defaultCRLSignCert The issuer certificate of the certificate cert. + @param defaultCRLSignKey The public key of the issuer certificate + defaultCRLSignCert. + @param paramsPKIX paramsPKIX PKIX parameters. + @param certPathCerts The certificates on the certification path. + @return A Set with all keys of possible CRL issuer + certificates. + @throws AnnotatedException if the CRL is not valid or the status cannot be checked or + some error occurs. + + + Checks a distribution point for revocation information for the + certificate cert. + + @param dp The distribution point to consider. + @param paramsPKIX PKIX parameters. + @param cert Certificate to check if it is revoked. + @param validDate The date when the certificate revocation status should be + checked. + @param defaultCRLSignCert The issuer certificate of the certificate cert. + @param defaultCRLSignKey The public key of the issuer certificate + defaultCRLSignCert. + @param certStatus The current certificate revocation status. + @param reasonMask The reasons mask which is already checked. + @param certPathCerts The certificates of the certification path. + @throws AnnotatedException if the certificate is revoked or the status cannot be checked + or some error occurs. + + + Checks a certificate if it is revoked. + + @param paramsPKIX PKIX parameters. + @param cert Certificate to check if it is revoked. + @param validDate The date when the certificate revocation status should be + checked. + @param sign The issuer certificate of the certificate cert. + @param workingPublicKey The public key of the issuer certificate sign. + @param certPathCerts The certificates of the certification path. + @throws AnnotatedException if the certificate is revoked or the status cannot be checked + or some error occurs. + + + If use-deltas is set, verify the issuer and scope of the delta CRL. + + @param deltaCRL The delta CRL. + @param completeCRL The complete CRL. + @param pkixParams The PKIX paramaters. + @throws AnnotatedException if an exception occurs. + + + Checks if an attribute certificate is revoked. + + @param attrCert Attribute certificate to check if it is revoked. + @param paramsPKIX PKIX parameters. + @param issuerCert The issuer certificate of the attribute certificate + attrCert. + @param validDate The date when the certificate revocation status should + be checked. + @param certPathCerts The certificates of the certification path to be + checked. + + @throws CertPathValidatorException if the certificate is revoked or the + status cannot be checked or some error occurs. + + + Searches for a holder public key certificate and verifies its + certification path. + + @param attrCert the attribute certificate. + @param pkixParams The PKIX parameters. + @return The certificate path of the holder certificate. + @throws Exception if +
      +
    • no public key certificate can be found although holder + information is given by an entity name or a base certificate + ID
    • +
    • support classes cannot be created
    • +
    • no certification path for the public key certificate can + be built
    • +
    +
    + + + Checks a distribution point for revocation information for the + certificate attrCert. + + @param dp The distribution point to consider. + @param attrCert The attribute certificate which should be checked. + @param paramsPKIX PKIX parameters. + @param validDate The date when the certificate revocation status should + be checked. + @param issuerCert Certificate to check if it is revoked. + @param reasonMask The reasons mask which is already checked. + @param certPathCerts The certificates of the certification path to be + checked. + @throws Exception if the certificate is revoked or the status + cannot be checked or some error occurs. + + + + A trust anchor or most-trusted Certification Authority (CA). + + This class represents a "most-trusted CA", which is used as a trust anchor + for validating X.509 certification paths. A most-trusted CA includes the + public key of the CA, the CA's name, and any constraints upon the set of + paths which may be validated using this key. These parameters can be + specified in the form of a trusted X509Certificate or as individual + parameters. + + + + + Creates an instance of TrustAnchor with the specified X509Certificate and + optional name constraints, which are intended to be used as additional + constraints when validating an X.509 certification path. + The name constraints are specified as a byte array. This byte array + should contain the DER encoded form of the name constraints, as they + would appear in the NameConstraints structure defined in RFC 2459 and + X.509. The ASN.1 definition of this structure appears below. + +
    +            	NameConstraints ::= SEQUENCE {
    +            		permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
    +            		excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }
    +            	   
    +             GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
    +             
    +            		GeneralSubtree ::= SEQUENCE {
    +            		base                    GeneralName,
    +            		minimum         [0]     BaseDistance DEFAULT 0,
    +            		maximum         [1]     BaseDistance OPTIONAL }
    +            		
    +            		BaseDistance ::= INTEGER (0..MAX)
    +            
    +            		GeneralName ::= CHOICE {
    +            		otherName                       [0]     OtherName,
    +            		rfc822Name                      [1]     IA5String,
    +            		dNSName                         [2]     IA5String,
    +            		x400Address                     [3]     ORAddress,
    +            		directoryName                   [4]     Name,
    +            		ediPartyName                    [5]     EDIPartyName,
    +            		uniformResourceIdentifier       [6]     IA5String,
    +            		iPAddress                       [7]     OCTET STRING,
    +            		registeredID                    [8]     OBJECT IDENTIFIER}
    +            	
    + + Note that the name constraints byte array supplied is cloned to protect + against subsequent modifications. +
    + a trusted X509Certificate + a byte array containing the ASN.1 DER encoding of a + NameConstraints extension to be used for checking name + constraints. Only the value of the extension is included, not + the OID or criticality flag. Specify null to omit the + parameter. + if the specified X509Certificate is null +
    + + + Creates an instance of TrustAnchor where the + most-trusted CA is specified as an X500Principal and public key. + + +

    + Name constraints are an optional parameter, and are intended to be used + as additional constraints when validating an X.509 certification path. +

    + The name constraints are specified as a byte array. This byte array + contains the DER encoded form of the name constraints, as they + would appear in the NameConstraints structure defined in RFC 2459 + and X.509. The ASN.1 notation for this structure is supplied in the + documentation for the other constructors. +

    + Note that the name constraints byte array supplied here is cloned to + protect against subsequent modifications. +

    +
    + the name of the most-trusted CA as X509Name + the public key of the most-trusted CA + + a byte array containing the ASN.1 DER encoding of a NameConstraints extension to + be used for checking name constraints. Only the value of the extension is included, + not the OID or criticality flag. Specify null to omit the parameter. + + + if caPrincipal or pubKey is null + +
    + + + Creates an instance of TrustAnchor where the most-trusted + CA is specified as a distinguished name and public key. Name constraints + are an optional parameter, and are intended to be used as additional + constraints when validating an X.509 certification path. +
    + The name constraints are specified as a byte array. This byte array + contains the DER encoded form of the name constraints, as they would + appear in the NameConstraints structure defined in RFC 2459 and X.509. +
    + the X.500 distinguished name of the most-trusted CA in RFC + 2253 string format + the public key of the most-trusted CA + a byte array containing the ASN.1 DER encoding of a + NameConstraints extension to be used for checking name + constraints. Only the value of the extension is included, not + the OID or criticality flag. Specify null to omit the + parameter. + throws NullPointerException, IllegalArgumentException +
    + + + Decode the name constraints and clone them if not null. + + + + + Returns a formatted string describing the TrustAnchor. + + a formatted string describing the TrustAnchor + + + + Returns the most-trusted CA certificate. + + + + + Returns the name of the most-trusted CA as an X509Name. + + + + + Returns the name of the most-trusted CA in RFC 2253 string format. + + + + + Returns the public key of the most-trusted CA. + + + + + Utility class for creating IBasicAgreement objects from their names/Oids + + + + + Cipher Utility class contains methods that can not be specifically grouped into other classes. + + + + + Returns a ObjectIdentifier for a give encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the Oid is not available. + + + + Utility class for creating IDigest objects from their names/Oids + + + + + Returns a ObjectIdentifier for a given digest mechanism. + + A string representation of the digest meanism. + A DerObjectIdentifier, null if the Oid is not available. + + + + A class containing methods to interface the BouncyCastle world to the .NET Crypto world. + + + + + Create an System.Security.Cryptography.X509Certificate from an X509Certificate Structure. + + + A System.Security.Cryptography.X509Certificate. + + + + Utility class for creating HMac object from their names/Oids + + + + + + + + + + Returns a ObjectIdentifier for a give encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the Oid is not available. + + + base constructor. + + + create a SecurityUtilityException with the given message. + + @param message the message to be carried with the exception. + + + + Signer Utility class contains methods that can not be specifically grouped into other classes. + + + + + Returns an ObjectIdentifier for a given encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the OID is not available. + + + + Utility class for creating IWrapper objects from their names/Oids + + + + Base class for an RFC 3161 Time Stamp Request. + + + Create a TimeStampRequest from the past in byte array. + + @param req byte array containing the request. + @throws IOException if the request is malformed. + + + Create a TimeStampRequest from the past in input stream. + + @param in input stream containing the request. + @throws IOException if the request is malformed. + + + Validate the timestamp request, checking the digest to see if it is of an + accepted type and whether it is of the correct length for the algorithm specified. + + @param algorithms a set of string OIDS giving accepted algorithms. + @param policies if non-null a set of policies we are willing to sign under. + @param extensions if non-null a set of extensions we are willing to accept. + @throws TspException if the request is invalid, or processing fails. + + + return the ASN.1 encoded representation of this object. + + + Generator for RFC 3161 Time Stamp Request objects. + + + add a given extension field for the standard extensions tag (tag 3) + @throws IOException + + + add a given extension field for the standard extensions tag + The value parameter becomes the contents of the octet string associated + with the extension. + + + add a given extension field for the standard extensions tag (tag 3) + @throws IOException + + + add a given extension field for the standard extensions tag + The value parameter becomes the contents of the octet string associated + with the extension. + + + Base class for an RFC 3161 Time Stamp Response object. + + + Create a TimeStampResponse from a byte array containing an ASN.1 encoding. + + @param resp the byte array containing the encoded response. + @throws TspException if the response is malformed. + @throws IOException if the byte array doesn't represent an ASN.1 encoding. + + + Create a TimeStampResponse from an input stream containing an ASN.1 encoding. + + @param input the input stream containing the encoded response. + @throws TspException if the response is malformed. + @throws IOException if the stream doesn't represent an ASN.1 encoding. + + + Check this response against to see if it a well formed response for + the passed in request. Validation will include checking the time stamp + token if the response status is GRANTED or GRANTED_WITH_MODS. + + @param request the request to be checked against + @throws TspException if the request can not match this response. + + + return the ASN.1 encoded representation of this object. + + + Generator for RFC 3161 Time Stamp Responses. + + + Return an appropriate TimeStampResponse. +

    + If genTime is null a timeNotAvailable error response will be returned. + + @param request the request this response is for. + @param serialNumber serial number for the response token. + @param genTime generation time for the response token. + @param provider provider to use for signature calculation. + @return + @throws NoSuchAlgorithmException + @throws NoSuchProviderException + @throws TSPException +

    +
    + + Generate a TimeStampResponse with chosen status and FailInfoField. + + @param status the PKIStatus to set. + @param failInfoField the FailInfoField to set. + @param statusString an optional string describing the failure. + @return a TimeStampResponse with a failInfoField and optional statusString + @throws TSPException in case the response could not be created + + + Validate the time stamp token. +

    + To be valid the token must be signed by the passed in certificate and + the certificate must be the one referred to by the SigningCertificate + attribute included in the hashed attributes of the token. The + certificate must also have the ExtendedKeyUsageExtension with only + KeyPurposeID.IdKPTimeStamping and have been valid at the time the + timestamp was created. +

    +

    + A successful call to validate means all the above are true. +

    +
    + + Return the underlying CmsSignedData object. + + @return the underlying CMS structure. + + + Return a ASN.1 encoded byte stream representing the encoded object. + + @throws IOException if encoding fails. + + + basic creation - only the default attributes will be included here. + + + create with a signer with extra signed/unsigned attributes. + + + @return the nonce value, null if there isn't one. + + + Recognised hash algorithms for the time stamp protocol. + + + Fetches the signature time-stamp attributes from a SignerInformation object. + Checks that the MessageImprint for each time-stamp matches the signature field. + (see RFC 3161 Appendix A). + + @param signerInfo a SignerInformation to search for time-stamps + @return a collection of TimeStampToken objects + @throws TSPValidationException + + + Validate the passed in certificate as being of the correct type to be used + for time stamping. To be valid it must have an ExtendedKeyUsage extension + which has a key purpose identifier of id-kp-timeStamping. + + @param cert the certificate of interest. + @throws TspValidationException if the certicate fails on one of the check points. + + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Exception thrown if a TSP request or response fails to validate. +

    + If a failure code is associated with the exception it can be retrieved using + the getFailureCode() method.

    +
    + + Return the failure code associated with this exception - if one is set. + + @return the failure code if set, -1 otherwise. + + + General array utilities. + + + + Are two arrays equal. + + Left side. + Right side. + True if equal. + + + + A constant time equals comparison - does not terminate early if + test will fail. + + first array + second array + true if arrays equal, false otherwise. + + + Make a copy of a range of bytes from the passed in data array. The range can + extend beyond the end of the input array, in which case the return array will + be padded with zeroes. + + @param data the array from which the data is to be copied. + @param from the start index at which the copying should take place. + @param to the final index of the range (exclusive). + + @return a new byte array containing the range given. + + + BigInteger utilities. + + + Return the passed in value as an unsigned byte array. + + @param value value to be converted. + @return a byte array without a leading zero byte if present in the signed encoding. + + + Return the passed in value as an unsigned byte array of specified length, zero-extended as necessary. + + @param length desired length of result array. + @param n value to be converted. + @return a byte array of specified length, with leading zeroes as necessary given the size of n. + + + Return a random BigInteger not less than 'min' and not greater than 'max' + + @param min the least value that may be generated + @param max the greatest value that may be generated + @param random the source of randomness + @return a random BigInteger value in the range [min,max] + + + + Return the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC) for a given DateTime value. + + A UTC DateTime value not before epoch. + Number of whole milliseconds after epoch. + 'dateTime' is before epoch. + + + + Create a DateTime value from the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + + Number of milliseconds since the epoch. + A UTC DateTime value + + + + Return the current number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + + + + encode the input data producing a base 64 encoded byte array. + + @return a byte array containing the base 64 encoded data. + + + encode the input data producing a base 64 encoded byte array. + + @return a byte array containing the base 64 encoded data. + + + Encode the byte data to base 64 writing it to the given output stream. + + @return the number of bytes produced. + + + Encode the byte data to base 64 writing it to the given output stream. + + @return the number of bytes produced. + + + decode the base 64 encoded input data. It is assumed the input data is valid. + + @return a byte array representing the decoded data. + + + decode the base 64 encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + decode the base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + Encode and decode byte arrays (typically from binary to 7-bit ASCII + encodings). + + + encode the input data producing a base 64 output stream. + + @return the number of bytes produced. + + + decode the base 64 encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + + A buffering class to allow translation from one format to another to + be done in discrete chunks. + + + + + Create a buffered Decoder. + + The translater to use. + The size of the buffer. + + + + Process one byte of data. + + Data in. + Byte array for the output. + The offset in the output byte array to start writing from. + The amount of output bytes. + + + + Process data from a byte array. + + The input data. + Start position within input data array. + Amount of data to process from input data array. + Array to store output. + Position in output array to start writing from. + The amount of output bytes. + + + + A class that allows encoding of data using a specific encoder to be processed in chunks. + + + + + Create. + + The translator to use. + Size of the chunks. + + + + Process one byte of data. + + The byte. + An array to store output in. + Offset within output array to start writing from. + + + + + Process data from a byte array. + + Input data Byte array containing data to be processed. + Start position within input data array. + Amount of input data to be processed. + Output data array. + Offset within output data array to start writing to. + The amount of data written. + + + + Class to decode and encode Hex. + + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + decode the Hex encoded input data. It is assumed the input data is valid. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + encode the input data producing a Hex output stream. + + @return the number of bytes produced. + + + decode the Hex encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + + A hex translator. + + + + + Translator interface. + + + + + Return encoded block size. + + 2 + + + + Encode some data. + + Input data array. + Start position within input data array. + The amount of data to process. + The output data array. + The offset within the output data array to start writing from. + Amount of data encoded. + + + + Returns the decoded block size. + + 1 + + + + Decode data from a byte array. + + The input data array. + Start position within input data array. + The amounty of data to process. + The output data array. + The position within the output data array to start writing from. + The amount of data written. + + + Convert binary data to and from UrlBase64 encoding. This is identical to + Base64 encoding, except that the padding character is "." and the other + non-alphanumeric characters are "-" and "_" instead of "+" and "/". +

    + The purpose of UrlBase64 encoding is to provide a compact encoding of binary + data that is safe for use as an URL parameter. Base64 encoding does not + produce encoded values that are safe for use in URLs, since "/" can be + interpreted as a path delimiter; "+" is the encoded form of a space; and + "=" is used to separate a name from the corresponding value in an URL + parameter. +

    +
    + + Encode the input data producing a URL safe base 64 encoded byte array. + + @return a byte array containing the URL safe base 64 encoded data. + + + Encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + Decode the URL safe base 64 encoded input data - white space will be ignored. + + @return a byte array representing the decoded data. + + + decode the URL safe base 64 encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the URL safe base 64 encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + Decode the URL safe base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + Convert binary data to and from UrlBase64 encoding. This is identical to + Base64 encoding, except that the padding character is "." and the other + non-alphanumeric characters are "-" and "_" instead of "+" and "/". +

    + The purpose of UrlBase64 encoding is to provide a compact encoding of binary + data that is safe for use as an URL parameter. Base64 encoding does not + produce encoded values that are safe for use in URLs, since "/" can be + interpreted as a path delimiter; "+" is the encoded form of a space; and + "=" is used to separate a name from the corresponding value in an URL + parameter. +

    +
    + + + A + + + A + + + + + + Pipe all bytes from inStr to outStr, throwing StreamFlowException if greater + than limit bytes in inStr. + + + A + + + A + + + A + + The number of bytes actually transferred, if not greater than limit + + + + Exception to be thrown on a failure to reset an object implementing Memoable. +

    + The exception extends InvalidCastException to enable users to have a single handling case, + only introducing specific handling of this one if required. +

    +
    + + Basic Constructor. + + @param msg message to be associated with this exception. + + + Validate the given IPv4 or IPv6 address. + + @param address the IP address as a string. + + @return true if a valid address, false otherwise + + + Validate the given IPv4 or IPv6 address and netmask. + + @param address the IP address as a string. + + @return true if a valid address with netmask, false otherwise + + + Validate the given IPv4 address. + + @param address the IP address as a string. + + @return true if a valid IPv4 address, false otherwise + + + Validate the given IPv6 address. + + @param address the IP address as a string. + + @return true if a valid IPv4 address, false otherwise + + + General string utilities. + + + + Summary description for DeflaterOutputStream. + + + + + Summary description for DeflaterOutputStream. + + + + + The Holder object. +
    +            Holder ::= SEQUENCE {
    +            	baseCertificateID   [0] IssuerSerial OPTIONAL,
    +            		-- the issuer and serial number of
    +            		-- the holder's Public Key Certificate
    +            	entityName          [1] GeneralNames OPTIONAL,
    +            		-- the name of the claimant or role
    +            	objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
    +            		-- used to directly authenticate the holder,
    +            		-- for example, an executable
    +            }
    +            
    +
    +
    + + Constructs a holder for v2 attribute certificates with a hash value for + some type of object. +

    + digestedObjectType can be one of the following: +

      +
    • 0 - publicKey - A hash of the public key of the holder must be + passed.
    • +
    • 1 - publicKeyCert - A hash of the public key certificate of the + holder must be passed.
    • +
    • 2 - otherObjectDigest - A hash of some other object type must be + passed. otherObjectTypeID must not be empty.
    • +
    +

    +

    This cannot be used if a v1 attribute certificate is used.

    + + @param digestedObjectType The digest object type. + @param digestAlgorithm The algorithm identifier for the hash. + @param otherObjectTypeID The object type ID if + digestedObjectType is + otherObjectDigest. + @param objectDigest The hash value. +
    + + Returns the hash if an object digest info is used. + + @return The hash or null if no object digest info is set. + + + Return any principal objects inside the attribute certificate holder entity names field. + + @return an array of IPrincipal objects (usually X509Name), null if no entity names field is set. + + + Return the principals associated with the issuer attached to this holder + + @return an array of principals, null if no BaseCertificateID is set. + + + Returns the digest object type if an object digest info is used. +

    +

      +
    • 0 - publicKey - A hash of the public key of the holder must be + passed.
    • +
    • 1 - publicKeyCert - A hash of the public key certificate of the + holder must be passed.
    • +
    • 2 - otherObjectDigest - A hash of some other object type must be + passed. otherObjectTypeID must not be empty.
    • +
    +

    + + @return The digest object type or -1 if no object digest info is set. +
    + + Returns the other object type ID if an object digest info is used. + + @return The other object type ID or null if no object + digest info is set. + + + Returns the digest algorithm ID if an object digest info is used. + + @return The digest algorithm ID or null if no object + digest info is set. + + + Return the serial number associated with the issuer attached to this holder. + + @return the certificate serial number, null if no BaseCertificateID is set. + + + Carrying class for an attribute certificate issuer. + + + Set the issuer directly with the ASN.1 structure. + + @param issuer The issuer + + + Return any principal objects inside the attribute certificate issuer object. + An array of IPrincipal objects (usually X509Principal). + + + A high level authority key identifier. + + + Constructor which will take the byte[] returned from getExtensionValue() + + @param encodedValue a DER octet encoded string with the extension structure in it. + @throws IOException on parsing errors. + + + Create an AuthorityKeyIdentifier using the passed in certificate's public + key, issuer and serial number. + + @param certificate the certificate providing the information. + @throws CertificateParsingException if there is a problem processing the certificate + + + Create an AuthorityKeyIdentifier using just the hash of the + public key. + + @param pubKey the key to generate the hash from. + @throws InvalidKeyException if there is a problem using the key. + + + A high level subject key identifier. + + + Constructor which will take the byte[] returned from getExtensionValue() + + @param encodedValue a DER octet encoded string with the extension structure in it. + @throws IOException on parsing errors. + + + Interface for an X.509 Attribute Certificate. + + + Return the attributes contained in the attribute block in the certificate. + An array of attributes. + + + Return the attributes with the same type as the passed in oid. + The object identifier we wish to match. + An array of matched attributes, null if there is no match. + + + Return an ASN.1 encoded byte array representing the attribute certificate. + An ASN.1 encoded byte array. + If the certificate cannot be encoded. + + + The version number for the certificate. + + + The serial number for the certificate. + + + The UTC DateTime before which the certificate is not valid. + + + The UTC DateTime after which the certificate is not valid. + + + The holder of the certificate. + + + The issuer details for the certificate. + + + + A utility class that will extract X509Principal objects from X.509 certificates. +

    + Use this in preference to trying to recreate a principal from a string, not all + DNs are what they should be, so it's best to leave them encoded where they + can be.

    +
    +
    + + Return the issuer of the given cert as an X509Principal. + + + Return the subject of the given cert as an X509Principal. + + + Return the issuer of the given CRL as an X509Principal. + + + This class is an Selector like implementation to select + attribute certificates from a given set of criteria. + + @see org.bouncycastle.x509.X509AttributeCertificate + @see org.bouncycastle.x509.X509Store + + + + Decides if the given attribute certificate should be selected. + + The attribute certificate to be checked. + true if the object matches this selector. + + + Adds a target name criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target names. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name The name as a GeneralName (not null) +
    + + Adds a target name criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target names. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name a byte array containing the name in ASN.1 DER encoded form of a GeneralName + @throws IOException if a parsing error occurs. +
    + + Adds a collection with target names criteria. If null is + given any will do. +

    + The collection consists of either GeneralName objects or byte[] arrays representing + DER encoded GeneralName structures. +

    + + @param names A collection of target names. + @throws IOException if a parsing error occurs. + @see #AddTargetName(byte[]) + @see #AddTargetName(GeneralName) +
    + + Gets the target names. The collection consists of Lists + made up of an Integer in the first entry and a DER encoded + byte array or a String in the second entry. +

    The returned collection is immutable.

    + + @return The collection of target names + @see #setTargetNames(Collection) +
    + + Adds a target group criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target groups. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param group The group as GeneralName form (not null) +
    + + Adds a target group criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target groups. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name a byte array containing the group in ASN.1 DER encoded form of a GeneralName + @throws IOException if a parsing error occurs. +
    + + Adds a collection with target groups criteria. If null is + given any will do. +

    + The collection consists of GeneralName objects or byte[] + representing DER encoded GeneralNames. +

    + + @param names A collection of target groups. + @throws IOException if a parsing error occurs. + @see #AddTargetGroup(byte[]) + @see #AddTargetGroup(GeneralName) +
    + + Gets the target groups. The collection consists of Lists + made up of an Integer in the first entry and a DER encoded + byte array or a String in the second entry. +

    The returned collection is immutable.

    + + @return The collection of target groups. + @see #setTargetGroups(Collection) +
    + + The attribute certificate which must be matched. + If null is given, any will do. + + + The criteria for validity + If null is given any will do. + + + The holder. + If null is given any will do. + + + The issuer. + If null is given any will do. + + + The serial number. + If null is given any will do. + + + + This class is an IX509Selector implementation to select + certificate pairs, which are e.g. used for cross certificates. The set of + criteria is given from two X509CertStoreSelector objects, + each of which, if present, must match the respective component of a pair. + + + + + Decides if the given certificate pair should be selected. If + obj is not a X509CertificatePair, this method + returns false. + + The X509CertificatePair to be tested. + true if the object matches this selector. + + + The certificate pair which is used for testing on equality. + + + The certificate selector for the forward part. + + + The certificate selector for the reverse part. + + + A simple collection backed store. + + + Basic constructor. + + @param collection - initial contents for the store, this is copied. + + + Return the matches in the collection for the passed in selector. + + @param selector the selector to match against. + @return a possibly empty collection of matching objects. + + + This class contains a collection for collection based X509Stores. + + + + Constructor. +

    + The collection is copied. +

    +
    + The collection containing X.509 object types. + If collection is null. +
    + + Returns a copy of the ICollection. + + + Returns a formatted string describing the parameters. + + + + An ICollection of X509Name objects + + + + The attribute certificate being checked. This is not a criterion. + Rather, it is optional information that may help a {@link X509Store} find + CRLs that would be relevant when checking revocation for the specified + attribute certificate. If null is specified, then no such + optional information is provided. + + @param attrCert the IX509AttributeCertificate being checked (or + null) + @see #getAttrCertificateChecking() + + + If true only complete CRLs are returned. Defaults to + false. + + @return true if only complete CRLs are returned. + + + Returns if this selector must match CRLs with the delta CRL indicator + extension set. Defaults to false. + + @return Returns true if only CRLs with the delta CRL + indicator extension are selected. + + + The issuing distribution point. +

    + The issuing distribution point extension is a CRL extension which + identifies the scope and the distribution point of a CRL. The scope + contains among others information about revocation reasons contained in + the CRL. Delta CRLs and complete CRLs must have matching issuing + distribution points.

    +

    + The byte array is cloned to protect against subsequent modifications.

    +

    + You must also enable or disable this criteria with + {@link #setIssuingDistributionPointEnabled(bool)}.

    + + @param issuingDistributionPoint The issuing distribution point to set. + This is the DER encoded OCTET STRING extension value. + @see #getIssuingDistributionPoint() +
    + + Whether the issuing distribution point criteria should be applied. + Defaults to false. +

    + You may also set the issuing distribution point criteria if not a missing + issuing distribution point should be assumed.

    + + @return Returns if the issuing distribution point check is enabled. +
    + + The maximum base CRL number. Defaults to null. + + @return Returns the maximum base CRL number. + @see #setMaxBaseCRLNumber(BigInteger) + + + + A factory to produce Public Key Info Objects. + + + + + Create a Subject Public Key Info object for a given public key. + + One of ElGammalPublicKeyParameters, DSAPublicKeyParameter, DHPublicKeyParameters, RsaKeyParameters or ECPublicKeyParameters + A subject public key info object. + Throw exception if object provided is not one of the above. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate object and initializes it with the data + read from the input stream inStream. + + + Returns a (possibly empty) collection view of the certificates + read from the given input stream inStream. + + + Class for carrying the values in an X.509 Attribute. + + + @param at an object representing an attribute. + + + Create an X.509 Attribute with the type given by the passed in oid and + the value represented by an ASN.1 Set containing value. + + @param oid type of the attribute + @param value value object to go into the atribute's value set. + + + Create an X.59 Attribute with the type given by the passed in oid and the + value represented by an ASN.1 Set containing the objects in value. + + @param oid type of the attribute + @param value vector of values to go in the attribute's value set. + + + + An Object representing an X509 Certificate. + Has static methods for loading Certificates encoded in many forms that return X509Certificate Objects. + + + + + Return true if the nominated time is within the start and end times nominated on the certificate. + + The time to test validity against. + True if certificate is valid for nominated time. + + + + Checks if the current date is within certificate's validity period. + + + + + Checks if the given date is within certificate's validity period. + + if the certificate is expired by given date + if the certificate is not yet valid on given date + + + + Return the Der encoded TbsCertificate data. + This is the certificate component less the signature. + To Get the whole certificate call the GetEncoded() member. + + A byte array containing the Der encoded Certificate component. + + + + The signature. + + A byte array containg the signature of the certificate. + + + + Get the signature algorithms parameters. (EG DSA Parameters) + + A byte array containing the Der encoded version of the parameters or null if there are none. + + + + Get a key usage guidlines. + + + + + Get the public key of the subject of the certificate. + + The public key parameters. + + + + Return a Der encoded version of this certificate. + + A byte array. + + + + Verify the certificate's signature using the nominated public key. + + An appropriate public key parameter object, RsaPublicKeyParameters, DsaPublicKeyParameters or ECDsaPublicKeyParameters + True if the signature is valid. + If key submitted is not of the above nominated types. + + + + Verify the certificate's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the certificate's signature. + True if the signature is valid. + If verifier provider is not appropriate or the certificate algorithm is invalid. + + + + Return true if the current time is within the start and end times nominated on the certificate. + + true id certificate is valid for the current time. + + + + Return the certificate's version. + + An integer whose value Equals the version of the cerficate. + + + + Return a BigInteger containing the serial number. + + The Serial number. + + + + Get the Issuer Distinguished Name. (Who signed the certificate.) + + And X509Object containing name and value pairs. + + + + Get the subject of this certificate. + + An X509Name object containing name and value pairs. + + + + The time that this certificate is valid from. + + A DateTime object representing that time in the local time zone. + + + + The time that this certificate is valid up to. + + A DateTime object representing that time in the local time zone. + + + + A meaningful version of the Signature Algorithm. (EG SHA1WITHRSA) + + A sting representing the signature algorithm. + + + + Get the Signature Algorithms Object ID. + + A string containg a '.' separated object id. + + + + Get the issuers UID. + + A DerBitString. + + + + Get the subjects UID. + + A DerBitString. + + + + This class contains a cross certificate pair. Cross certificates pairs may + contain two cross signed certificates from two CAs. A certificate from the + other CA to this CA is contained in the forward certificate, the certificate + from this CA to the other CA is contained in the reverse certificate. + + + + Constructor + Certificate from the other CA to this CA. + Certificate from this CA to the other CA. + + + Constructor from a ASN.1 CertificatePair structure. + The CertificatePair ASN.1 object. + + + Returns the certificate from the other CA to this CA. + + + Returns the certificate from this CA to the other CA. + + + class for dealing with X509 certificates. +

    + At the moment this will deal with "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----" + base 64 encoded certs, as well as the BER binaries of certificates and some classes of PKCS#7 + objects.

    +
    + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate object and initializes it with the data + read from the input stream inStream. + + + Returns a (possibly empty) collection view of the certificates + read from the given input stream inStream. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + The following extensions are listed in RFC 2459 as relevant to CRLs + + Authority Key Identifier + Issuer Alternative Name + CRL Number + Delta CRL Indicator (critical) + Issuing Distribution Point (critical) + + + + Verify the CRL's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the CRL's signature. + True if the signature is valid. + If verifier provider is not appropriate or the CRL algorithm is invalid. + + + Returns a string representation of this CRL. + + @return a string representation of this CRL. + + + Checks whether the given certificate is on this CRL. + + @param cert the certificate to check for. + @return true if the given certificate is on this CRL, + false otherwise. + + + The following extensions are listed in RFC 2459 as relevant to CRL Entries + + ReasonCode Hode Instruction Code Invalidity Date Certificate Issuer + (critical) + + + Constructor for CRLEntries of indirect CRLs. If isIndirect + is false {@link #getCertificateIssuer()} will always + return null, previousCertificateIssuer is + ignored. If this isIndirect is specified and this CrlEntry + has no certificate issuer CRL entry extension + previousCertificateIssuer is returned by + {@link #getCertificateIssuer()}. + + @param c + TbsCertificateList.CrlEntry object. + @param isIndirect + true if the corresponding CRL is a indirect + CRL. + @param previousCertificateIssuer + Certificate issuer of the previous CrlEntry. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate revocation list (CRL) object and initializes + it with the data read from the input stream inStream. + + + Returns a (possibly empty) collection view of the CRLs read from + the given input stream inStream. + + The inStream may contain a sequence of DER-encoded CRLs, or + a PKCS#7 CRL set. This is a PKCS#7 SignedData object, with the + only significant field being crls. In particular the signature + and the contents are ignored. + + + A holding class for constructing an X509 Key Usage extension. + +
    +                id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +            
    +                KeyUsage ::= BIT STRING {
    +                     digitalSignature        (0),
    +                     nonRepudiation          (1),
    +                     keyEncipherment         (2),
    +                     dataEncipherment        (3),
    +                     keyAgreement            (4),
    +                     keyCertSign             (5),
    +                     cRLSign                 (6),
    +                     encipherOnly            (7),
    +                     decipherOnly            (8) }
    +             
    +
    + + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (X509KeyUsage.keyEncipherment | X509KeyUsage.dataEncipherment) + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Class to Generate X509V1 Certificates. + + + + + Default Constructor. + + + + + Reset the generator. + + + + + Set the certificate's serial number. + + Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + You will be surprised how ugly a serial number collision can get. + The serial number. + + + + Set the issuer distinguished name. + The issuer is the entity whose private key is used to sign the certificate. + + The issuers DN. + + + + Set the date that this certificate is to be valid from. + + + + + + Set the date after which this certificate will no longer be valid. + + + + + + Set the subject distinguished name. + The subject describes the entity associated with the public key. + + + + + + Set the public key that this certificate identifies. + + + + + + Set the signature algorithm that will be used to sign this certificate. + This can be either a name or an OID, names are treated as case insensitive. + + string representation of the algorithm name + + + + Generate a new X509Certificate. + + The private key of the issuer used to sign this certificate. + An X509Certificate. + + + + Generate a new X509Certificate specifying a SecureRandom instance that you would like to use. + + The private key of the issuer used to sign this certificate. + The Secure Random you want to use. + An X509Certificate. + + + + Generate a new X509Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Certificate. + + + + Allows enumeration of the signature names supported by the generator. + + + + An implementation of a version 2 X.509 Attribute Certificate. + + + + Verify the certificate's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the certificate's signature. + True if the signature is valid. + If verifier provider is not appropriate or the certificate algorithm is invalid. + + + Class to produce an X.509 Version 2 AttributeCertificate. + + + Reset the generator + + + Set the Holder of this Attribute Certificate. + + + Set the issuer. + + + Set the serial number for the certificate. + + + + Set the signature algorithm. This can be either a name or an OID, names + are treated as case insensitive. + + The algorithm name. + + + Add an attribute. + + + Add a given extension field for the standard extensions tag. + + + + Add a given extension field for the standard extensions tag. + The value parameter becomes the contents of the octet string associated + with the extension. + + + + + Generate an X509 certificate, based on the current issuer and subject. + + + + + Generate an X509 certificate, based on the current issuer and subject, + using the supplied source of randomness, if required. + + + + + Generate a new X.509 Attribute Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An IX509AttributeCertificate. + + + + Allows enumeration of the signature names supported by the generator. + + + + class to produce an X.509 Version 2 CRL. + + + reset the generator + + + Set the issuer distinguished name - the issuer is the entity whose private key is used to sign the + certificate. + + + Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + or 0 if CrlReason is not to be used + + + + Add a CRL entry with an Invalidity Date extension as well as a CrlReason extension. + Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + or 0 if CrlReason is not to be used + + + + Add a CRL entry with extensions. + + + + Add the CRLEntry objects contained in a previous CRL. + + @param other the X509Crl to source the other entries from. + + + + Set the signature algorithm that will be used to sign this CRL. + + + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + + Generate an X.509 CRL, based on the current issuer and subject. + + The private key of the issuer that is signing this certificate. + An X509Crl. + + + + Generate an X.509 CRL, based on the current issuer and subject using the specified secure random. + + The private key of the issuer that is signing this certificate. + Your Secure Random instance. + An X509Crl. + + + + Generate a new X509Crl using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Crl. + + + + Allows enumeration of the signature names supported by the generator. + + + + + A class to Generate Version 3 X509Certificates. + + + + + Reset the Generator. + + + + + Set the certificate's serial number. + + Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + You will be surprised how ugly a serial number collision can Get. + The serial number. + + + + Set the distinguished name of the issuer. + The issuer is the entity which is signing the certificate. + + The issuer's DN. + + + + Set the date that this certificate is to be valid from. + + + + + + Set the date after which this certificate will no longer be valid. + + + + + + Set the DN of the entity that this certificate is about. + + + + + + Set the public key that this certificate identifies. + + + + + + Set the signature algorithm that will be used to sign this certificate. + + + + + + Set the subject unique ID - note: it is very rare that it is correct to do this. + + + + + + Set the issuer unique ID - note: it is very rare that it is correct to do this. + + + + + + Add a given extension field for the standard extensions tag (tag 3). + + string containing a dotted decimal Object Identifier. + Is it critical. + The value. + + + + Add an extension to this certificate. + + Its Object Identifier. + Is it critical. + The value. + + + + Add an extension using a string with a dotted decimal OID. + + string containing a dotted decimal Object Identifier. + Is it critical. + byte[] containing the value of this extension. + + + + Add an extension to this certificate. + + Its Object Identifier. + Is it critical. + byte[] containing the value of this extension. + + + + Add a given extension field for the standard extensions tag (tag 3), + copying the extension value from another certificate. + + + + add a given extension field for the standard extensions tag (tag 3) + copying the extension value from another certificate. + @throws CertificateParsingException if the extension cannot be extracted. + + + + Generate an X509Certificate. + + The private key of the issuer that is signing this certificate. + An X509Certificate. + + + + Generate an X509Certificate using your own SecureRandom. + + The private key of the issuer that is signing this certificate. + You Secure Random instance. + An X509Certificate. + + + + Generate a new X509Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Certificate. + + + + Allows enumeration of the signature names supported by the generator. + + +
    +
    diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.layout.dll b/src/packages/itext7.7.0.1/lib/net40/itext.layout.dll new file mode 100644 index 00000000000..1921355a626 Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.layout.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.layout.xml b/src/packages/itext7.7.0.1/lib/net40/itext.layout.xml new file mode 100644 index 00000000000..0e496f492aa --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.layout.xml @@ -0,0 +1,6143 @@ + + + + itext.layout + + + + Represents a border. + + + The solid border. + + + + The dashed border. + + + + The dotted border. + + + + The double border. + + + + The round-dots border. + + + + The 3D groove border. + + + + The 3D inset border. + + + + The 3D outset border. + + + + The 3D ridge border. + + + + The null Border, i.e. + The null Border, i.e. the presence of such border is equivalent to the absence of the border + + + The color of the border. + + + + The width of the border. + + + The type of the border. + + + The hash value for the border. + + + + Creates a + border + with the given width. + The + color + to be set by default is black + + the width which the border should have + + + + Creates a + border + with given width and + color + . + + the color which the border should have + the width which the border should have + + + + Draws the border of a cell. + PdfCanvas to be written to + x coordinate of the beginning point of the element side, that should be bordered + y coordinate of the beginning point of the element side, that should be bordered + x coordinate of the ending point of the element side, that should be bordered + y coordinate of the ending point of the element side, that should be bordered + + + + Returns the type of the + border + + + + + Gets the + color + of the + border + + + the + color + + + + + Gets the width of the + border + + the width + + + + Sets the + color + of the + border + + + + + Sets the width of the + border + + + + Indicates whether the border is equal to the given border. + + Indicates whether the border is equal to the given border. + The border type, width and color are considered during the comparison. + + + + + + + + Returns the + side + corresponded to the line between two points. + Notice that we consider the rectangle traversal to be clockwise. + If the rectangle sides are not parallel to the corresponding page sides + the result is Side.NONE + + the abscissa of the left-bottom point + the ordinate of the left-bottom point + the abscissa of the right-top point + the ordinate of the right-top point + + the corresponded + side + + + + Enumerates the different sides of the rectangle. + + Enumerates the different sides of the rectangle. + The rectangle sides are expected to be parallel to corresponding page sides + Otherwise the result is Side.NONE + + + + Represents a border that is displayed using a 3D effect. + + + + Predefined gray + RGB-color + + + + Creates a Border3D instance with the specified width. + Creates a Border3D instance with the specified width. Also sets the color to gray. + with of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + with of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + with of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + with of the border + + + + + + + + + + Makes the + color of the border + darker and returns the result + + + + + Sets the fill color for the inner half of + 3D Border + + PdfCanvas the color will be applied on + + the + side + the color will be applied on + + + + + Sets the fill color for the outer half of + 3D Border + + PdfCanvas the color will be applied on + + the + side + the color will be applied on + + + + Draws a border with dashes around the element it's been set to. + + + The modifier to be applied on the width to have the dash size + + + The modifier to be applied on the width to have the initial gap size + + + Creates a DashedBorder with the specified width and sets the color to black. + width of the border + + + Creates a DashedBorder with the specified width and the specified color. + color of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Draws a dotted border around the element it has been set to. + + Draws a dotted border around the element it has been set to. Do note that this border draw square dots, + if you want to draw round dots, see + + . + + + + The modifier to be applied on the width to have the initial gap size + + + Creates a DottedBorder instance with the specified width. + Creates a DottedBorder instance with the specified width. The color is set to the default: black. + + width of the border + + + Creates a DottedBorder instance with the specified width and color. + color of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Creates a double border around the element it's set to. + + Creates a double border around the element it's set to. The space between the two border lines has + the same width as the two borders. If a background has been set on the element the color will show in + between the two borders. + + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them. + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them. + The color is set to the default: black. + + width of the borders and the space between them + + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. The space in between the two borders is either colorless or will + be filled with the background color of the element, if a color has been set. + + width of the borders and the space between them + + + + + + + + + + + + Creates a GrooveBorder instance with the specified width. + + Creates a GrooveBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a GrooveBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a GrooveBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a GrooveBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + + + + + + + + + + Creates a InsetBorder instance with the specified width. + + Creates a InsetBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a InsetBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a InsetBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a InsetBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + + + + + + + + + + Creates a OutsetBorder instance with the specified width. + + Creates a OutsetBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a OutsetBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a OutsetBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a OutsetBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + + + + + + + + + + Creates a RidgeBorder instance with the specified width. + + Creates a RidgeBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a RidgeBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a RidgeBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a RidgeBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + + + + + + + + + + Draws a border with rounded dots aroudn the element it's been set to. + + Draws a border with rounded dots aroudn the element it's been set to. For square dots see + + . + + + + The modifier to be applied on the width to have the initial gap size + + + Creates a RoundDotsBorder with the specified wit?dth and sets the color to black. + width of the border + + + Creates a RoundDotsBorder with the specified wit?dth and the specified color. + color of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Draws a solid border around the element it's set to. + + + Creates a SolidBorder with the specified width and sets the color to black. + width of the border + + + Creates a SolidBorder with the specified width and the specified color. + color of the border + width of the border + + + + + + + + + + + + + This class is used for adding content directly onto a specified + + . + + does not know the concept of a page, so it can't reflow to a 'next' + + . + This class effectively acts as a bridge between the high-level layout + API and the low-level kernel API. + + + + A generic abstract root element for a PDF layout object hierarchy. + + + + A generic abstract element that fits in a PDF layout object hierarchy. + + A generic abstract element that fits in a PDF layout object hierarchy. + A superclass of all + layout object + implementations. + + + + + + A generic Map-like interface that defines methods for storing and retrieving + objects by an enum key of the + + type. + + + + Checks if this entity has the specified property. + + Checks if this entity has the specified property. Compared to + + , + this method can check parent's properties, styles, etc, depending on the origin of the instance + + the property to be checked + + + + if this instance has given property, + + otherwise + + + + Checks if this entity has the specified property, i.e. + Checks if this entity has the specified property, i.e. if it was set to this very element earlier + + the property to be checked + + + + if this instance has given own property, + + otherwise + + + + Gets the property from this entity. + + Gets the property from this entity. Compared to + + , + this method can check parent's properties, styles, etc, depending on the origin of the instance + + + the property to be retrieved + + the value of the given property. + + will be returned if the property value was not found + + + + Gets own property from this entity. + + Gets own property from this entity. The property must have been set earlier to this entity. + If the property is not found, + + will be returned. + + + the property to be retrieved + + the value of the given own property. + + will be returned if the property value was not found + + + + Gets the default property from this entity. + + the property to be retrieved + + the default property value. If the default property is not defined, + + will be returned + + + + Sets a property for this entity. + the property to be set + the value of the property + + + Deletes the own property of this entity. + the property to be deleted + + + Gets the width property of the Element. + the width of the element, with a value and a measurement unit. + + + + Sets the width property of the Element, measured in points. + a value measured in points. + this Element. + + + Sets the width property of the Element, measured in percentage. + a value measured in percentage. + this Element. + + + + Sets the width property of the Element with a + + . + + + a + + object + + this Element. + + + Gets the height property of the Element. + the height of the element, as a floating point value. + + + Sets the height property of the Element. + a floating point value for the new height + this Element. + + + Sets values for a relative repositioning of the Element. + + Sets values for a relative repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + relative + . + The default implementation in + + treats + left and top as the most important values. Only + if left == 0 will right be used for the + calculation; ditto for top vs. bottom. + + movement to the left + movement upwards on the page + movement to the right + movement downwards on the page + this Element. + + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + + a + + + this Element. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + Sets the horizontal alignment of this Element. + + an enum value of type + + + this Element. + + + Sets the font of this Element. + + a + font program + + this Element. + + + Sets the font color of this Element. + + a + + for the text in this Element. + + this Element. + + + Sets the font size of this Element. + a floating point value + this Element. + + + Sets the text alignment of this Element. + + an enum value of type + + + this Element. + + + Defines a custom spacing distance between all characters of a textual element. + + Defines a custom spacing distance between all characters of a textual element. + The character-spacing parameter is added to the glyph???s horizontal or vertical displacement (depending on the writing mode). + + a floating point value + this Element. + + + Defines a custom spacing distance between words of a textual element. + + Defines a custom spacing distance between words of a textual element. + This value works exactly like the character spacing, but only kicks in at word boundaries. + + a floating point value + this Element. + + + Enable or disable kerning. + + Enable or disable kerning. + Some fonts may specify kern pairs, i.e. pair of glyphs, between which the amount of horizontal space is adjusted. + This adjustment is typically negative, e.g. in "AV" pair the glyphs will typically be moved closer to each other. + + an enum value as a boolean wrapper specifying whether or not to apply kerning + this Element. + + + Specifies a background color for the Element. + the background color + this Element. + + + + Specifies a background color for the Element, and extra space that + must be counted as part of the background and therefore colored. + + the background color + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + this Element. + + + Sets a border for all four edges of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the upper limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the right limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the bottom limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the left limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a rule for splitting strings when they don't fit into one line. + + Sets a rule for splitting strings when they don't fit into one line. + The default implementation is + + + + an implementation of + + + this Element. + + + Gets a rule for splitting strings when they don't fit into one line. + + the current string splitting rule, an implementation of + + + + + + Gets the text rendering mode, a variable that determines whether showing + text causes glyph outlines to be stroked, filled, used as a clipping + boundary, or some combination of the three. + + the current text rendering mode + + + + + Sets the text rendering mode, a variable that determines whether showing + text causes glyph outlines to be stroked, filled, used as a clipping + boundary, or some combination of the three. + + an int value + this Element. + + + + Gets the stroke color for the current element. + + Gets the stroke color for the current element. + The stroke color is the color of the outlines or edges of a shape. + + the current stroke color + + + Sets the stroke color for the current element. + + Sets the stroke color for the current element. + The stroke color is the color of the outlines or edges of a shape. + + a new stroke color + this Element. + + + Gets the stroke width for the current element. + + Gets the stroke width for the current element. + The stroke width is the width of the outlines or edges of a shape. + + the current stroke width + + + Sets the stroke width for the current element. + + Sets the stroke width for the current element. + The stroke width is the width of the outlines or edges of a shape. + + a new stroke width + this Element. + + + Switch on the simulation of bold style for a font. + + Switch on the simulation of bold style for a font. + Be aware that using correct bold font is highly preferred over this option. + + this element + + + Switch on the simulation of italic style for a font. + + Switch on the simulation of italic style for a font. + Be aware that using correct italic (oblique) font is highly preferred over this option. + + this element + + + Sets default line-through attributes for text. + + Sets default line-through attributes for text. + See + + for more fine tuning. + + this element + + + Sets default underline attributes for text. + + Sets default underline attributes for text. + See other overloads for more fine tuning. + + this element + + + Sets an horizontal line that can be an underline or a strikethrough. + + Sets an horizontal line that can be an underline or a strikethrough. + Actually, the line can be anywhere vertically and has always the text width. + Multiple call to this method will produce multiple lines. + + the absolute thickness of the line + the absolute y position relative to the baseline + this element + + + + + This attribute specifies the base direction of directionally neutral text + (i.e., text that doesn't have inherent directionality as defined in Unicode) + in an element's content and attribute values. + + base direction + this element + + + + Sets a custom hyphenation configuration which will hyphenate words automatically accordingly to the + language and country. + + + this element + + + Sets the writing system for this text element. + a new script type + this Element. + + + Sets a destination name that will be created when this element is drawn to content. + the destination name to be created + this Element. + + + Adds an element to the root. + Adds an element to the root. The element is immediately placed in the contents. + an element with spacial margins, tabbing, and alignment + this element + + + + Adds an image to the root. + Adds an image to the root. The element is immediately placed in the contents. + a graphical image element + this element + + + + + Gets the rootRenderer attribute, a specialized + + that + acts as the root object that other + renderers + descend + from. + + + the + + attribute + + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a kerned text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + the page number to write the text + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + + Is initialized and used only when Canvas element autotagging is enabled, see + + . + It is also used to determine if autotagging is enabled. + + + + Creates a new Canvas to manipulate a specific document and page. + the low-level content stream writer + the document that the resulting content stream will be written to + the maximum area that the Canvas may write upon + + + Creates a new Canvas to manipulate a specific document and page. + the low-level content stream writer + the document that the resulting content stream will be written to + the maximum area that the Canvas may write upon + + + + Creates a new Canvas to manipulate a specific + + . + + the form + the document that the resulting content stream will be written to + + + + Gets the + + for this canvas. + + the document that the resulting content stream will be written to + + + Gets the root area rectangle. + the maximum area that the Canvas may write upon + + + + Gets the + + . + + the low-level content stream writer + + + + Sets the + + for this Canvas. + + a renderer specific for canvas operations + + + Returned value is not null only in case when autotagging is enabled. + the page, on which this canvas will be rendered, or null if autotagging is not enabled. + + + Enables canvas content autotagging. + Enables canvas content autotagging. By default it is disabled. + the page, on which this canvas will be rendered. + + + true if autotagging of canvas content is enabled. Default value - false. + + + + Performs an entire recalculation of the element flow on the canvas, + taking into account all its current child elements. + + + Performs an entire recalculation of the element flow on the canvas, + taking into account all its current child elements. May become very + resource-intensive for large documents. + Do not use when you have set + + to true. + + + + + Forces all registered renderers (including child element renderers) to + flush their contents to the content stream. + + + + + Closes the + + . Although not completely necessary in all cases, it is still recommended to call this + method when you are done working with + + object, as due to some properties set there might be some + 'hanging' elements, which are waiting other elements to be added and processed. + + tells the + + that no more elements will be added and it is time to finish processing all the elements. + + + + This class is used for convenient multi-column Document Layouting + + + + Defines the most common properties and behavior that are shared by most + + implementations. All default Renderers are subclasses of + this default implementation. + + + + + A renderer object is responsible for drawing a corresponding layout object on + a document or canvas. + + + A renderer object is responsible for drawing a corresponding layout object on + a document or canvas. Every layout object has a renderer, by default one of + the corresponding type, e.g. you can ask an + + for its + + . + Renderers are designed to be extensible, and custom implementations can be + seeded to layout objects (or their custom subclasses) at runtime. + + + + Adds a child to the current renderer + a child to be added + + + + This method simulates positioning of the renderer, including all of its children, and returns + the + + , representing the layout result, including occupied area, status, i.e. + if there was enough place to fit the renderer subtree, etc. + + can be extended to return custom layout results for custom elements, e.g. + + uses + + as its result. + This method can be called standalone to learn how much area the renderer subtree needs, or can be called + before + + , to prepare the renderer to be flushed to the output stream. + + the description of layout area and any other additional information + result of the layout process + + + Flushes the renderer subtree contents, i.e. + + Flushes the renderer subtree contents, i.e. draws itself on canvas, + adds necessary objects to the + + etc. + + + contains the + + to which the renderer subtree if flushed, + the + + on which the renderer subtree is drawn and other additional parameters + needed to perform drawing + + + + + Gets the resultant occupied area after the last call to the + + method. + + + + + instance + + + + Gets a property from this entity or one of its hierarchical parents. + + Gets a property from this entity or one of its hierarchical parents. + If the property is not found, + + will be returned. + + + the property to be retrieved + a fallback value + the value of the given property + + + + Explicitly sets this object as the child of another + + in + the renderer hierarchy. Some implementations also use this method + internally to create a consistent hierarchy tree. + + the object to place higher in the renderer hierarchy + by default, this object + + + Gets the model element associated with this renderer. + + the model element, as a + container of properties + + + + + Gets the child + + s. + + + a list of direct child + renderers + of this instance + + + + Indicates whether this renderer is flushed or not, i.e. + + Indicates whether this renderer is flushed or not, i.e. if + + has already + been called. + + whether the renderer has been flushed + + + Moves the renderer subtree by the specified offset. + Moves the renderer subtree by the specified offset. This method affects occupied area of the renderer. + + the x-axis offset in points. Positive value will move the renderer subtree to the right. + the y-axis offset in points. Positive value will move the renderer subtree to the top. + + + + Gets a new instance of this class to be used as a next renderer, after this renderer is used, if + + is called more than once. + + new renderer instance + + + + The maximum difference between + + coordinates to consider rectangles equal + + + + The infinity value which is used while layouting + + + Creates a renderer. + + + Creates a renderer for the specified layout element. + the layout element that will be drawn by this renderer + + + + + + + + + + + + + + + + + + + Checks if this renderer or its model element have the specified property, + i.e. if it was set to this very element or its very model element earlier. + + the property to be checked + + true if this instance or its model element have given own property, false otherwise + + + + + + + + Deletes property from this very renderer, or in case the property is specified on its model element, the + property of the model element is deleted + + the property key to be deleted + + + + + + + + + + + + + + + Returns a property with a certain key, as a font object. + + an + enum value + + + a + + + + + Returns a property with a certain key, as a color. + + an + enum value + + + a + + + + + Returns a property with a certain key, as a boolean value. + + an + enum value + + + a + + + + + + + + + + + + Draws a background layer if it is defined by a key + + in either the layout element or this + + itself. + + the context (canvas, document, etc) of this drawing operation. + + + + Performs the drawing operation for all + children + of this renderer. + + the context (canvas, document, etc) of this drawing operation. + + + + Performs the drawing operation for the border of this renderer, if + defined by any of the + + values in either the layout + element or this + + itself. + + the context (canvas, document, etc) of this drawing operation. + + + Indicates whether this renderer is flushed or not, i.e. + + Indicates whether this renderer is flushed or not, i.e. if + + has already + been called. + + whether the renderer has been flushed + + + + + + + + Gets all rectangles that this + + can draw upon in the given area. + + + a physical area on the + + + + a list of + rectangles + + + + + Gets the bounding box that contains all content written to the + + by this + + . + + + the smallest + + that surrounds the content + + + + Gets the border box of a renderer. + + Gets the border box of a renderer. + This is a box used to draw borders. + + border box of a renderer + + + Gets the first yLine of the nested children recursively. + + Gets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the + first item (if the first item is indeed a paragraph). + NOTE: this method will no go further than the first child. + Returns null if there is no text found. + + + + Applies margins of the renderer on the given rectangle + a rectangle margins will be applied on. + + indicates whether margins will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies given margins on the given rectangle + a rectangle margins will be applied on. + the margins to be applied on the given rectangle + + indicates whether margins will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + Returns margins of the renderer + + a + float[] margins + of the renderer + + + + Returns paddings of the renderer + + a + float[] paddings + of the renderer + + + + Applies paddings of the renderer on the given rectangle + a rectangle paddings will be applied on. + + indicates whether paddings will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies given paddings on the given rectangle + a rectangle paddings will be applied on. + the paddings to be applied on the given rectangle + + indicates whether paddings will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies the border box of the renderer on the given rectangle + If the border of a certain side is null, the side will remain as it was. + + a rectangle the border box will be applied on. + + indicates whether the border box will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies the given border box (borders) on the given rectangle + a rectangle paddings will be applied on. + + the + borders + to be applied on the given rectangle + + + indicates whether the border box will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + Indicates whether the renderer's position is fixed or not. + + a + boolean + + + + Indicates whether the renderer's position is fixed or not. + + a + boolean + + + + Gets borders of the element in the specified order: top, right, bottom, left. + + + an array of BorderDrawer objects. + In case when certain border isn't set Property.BORDER is used, + and if Property.BORDER is also not set then null is returned + on position of this border + + + + Calculates bounding box around points. + @param points list of the points calculated bbox will enclose. + @return array of float values which denote left, bottom, right, top lines of bbox in this specific order + + + + Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, + e.g. document page or form xObject. This is particularly useful for the cases when element is nested in the rotated + element. + + a which is a bbox of the content not relative to the parent's layout area but rather to + the some pdf entity coordinate system. + + + Draws (flushes) the content. + + + + + This method correctly closes the + + instance. + There might be hanging elements, like in case of + + is set to true + and when no consequent element has been added. This method addresses such situations. + + + + + + + Adds some pages so that the overall number is at least n. + + Adds some pages so that the overall number is at least n. + Returns the page size of the n'th page. + + + + Creates a ColumnDocumentRenderer. + + Creates a ColumnDocumentRenderer. Sets + + to true. + + + the + + on which this Renderer will calculate + and execute element placements + + + an array of + + specifying the acceptable + positions for elements on a page + + + + + Creates a ColumnDocumentRenderer whose elements need not be flushed + immediately. + + + the + + on which this Renderer will calculate + and execute element placements + + whether or not to flush contents as soon as possible + + an array of + + specifying the acceptable + positions for elements on a page + + + + + Gets the array index of the next area that will be written on after the + current one is full (overflowed). + + the array index of the next area that will be written on + + + + + Creates a document from a + + . Initializes the first page + with the + + 's current default + + . + + the in-memory representation of the PDF document + + + + Creates a document from a + + with a manually set + + . + + the in-memory representation of the PDF document + the page size + + + + Creates a document from a + + with a manually set + + . + + the in-memory representation of the PDF document + the page size + + if true, write pages and page-related instructions + to the + + as soon as possible. + + + + Closes the document and associated PdfDocument. + + + Terminates the current element, usually a page. + + Terminates the current element, usually a page. Sets the next element + to be the size specified in the argument. + + + an + + , optionally with a specified size + + this element + + + Gets PDF document. + the in-memory representation of the PDF document + + + + Changes the + + at runtime. Use this to customize + the Document's + + behavior. + + + + + + Forces all registered renderers (including child element renderers) to + flush their contents to the content stream. + + + + + Gets the left margin, measured in points + a float containing the left margin value + + + Sets the left margin, measured in points + a float containing the new left margin value + + + Gets the right margin, measured in points + a float containing the right margin value + + + Sets the right margin, measured in points + a float containing the new right margin value + + + Gets the top margin, measured in points + a float containing the top margin value + + + Sets the top margin, measured in points + a float containing the new top margin value + + + Gets the bottom margin, measured in points + a float containing the bottom margin value + + + Sets the bottom margin, measured in points + a float containing the new bottom margin value + + + Convenience method to set all margins with one method. + the upper margin + the right margin + the left margin + the lower margin + + + + Returns the area that will actually be used to write on the page, given + the current margins. + + + Returns the area that will actually be used to write on the page, given + the current margins. Does not have any side effects on the document. + + the size of the page to + + a + + with the required dimensions and origin point + + + + Checks whether a method is invoked at the closed document + + + + Defines the most common properties that most + + implementations + share. + + + + + This class represents a layout element, i.e. + + This class represents a layout element, i.e. a piece of content that will + take up 'physical' space on a canvas or document. Its presence and positioning + may influence the position of other + + s on the layout surface. + + + + + Overrides the + IRenderer + instance which will be returned by the next call to the + + . + + the renderer instance + + + Gets a renderer for this element. + + Gets a renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a renderer for this element + + + Creates a renderer subtree with root in the current element. + + Creates a renderer subtree with root in the current element. + Compared to + + , the renderer returned by this method should contain all the child + renderers for children of the current element. + + a renderer subtree for this element + + + Add a new style to this element. + + Add a new style to this element. A style can be used as an effective way + to define multiple equal properties to several elements. + + the style to be added + this element + + + Marks all child elements as artifacts recursively. + + + Returns true if this list contains no elements. + true if this list contains no elements + + + Sets an action on this Element. + + Sets an action on this Element. An action is a general PDF concept that + signifies anything that makes the document interactive, e.g. a hyperlink + or a button. + + + the + + that should be performed + + this Element + + + Explicitly sets the page number this element should be put on. + + Explicitly sets the page number this element should be put on. The location + on the page will be the same as if it were added at the end of the document, + but it will be located on the specified page. + This method should be used very carefully in client code. + + the page number of the page this element should be placed on + this Element + + + + A layout object that terminates the current content area and creates a new + one. + + + A layout object that terminates the current content area and creates a new + one. If no + + is given, the new content area will have the same + size as the current one. + + + + Creates an AreaBreak. + + Creates an AreaBreak. The new content area will have the same size as the + current one. + + + + Creates an AreaBreak that terminates a specified area type. + + an + area break type + + + + Creates an AreaBreak. + + Creates an AreaBreak. The new content area will have the specified page + size. + + the size of the new content area + + + Gets the page size. + + the + page size + of the next content area. + + + + Sets the page size. + + the new + page size + of the next content area. + + + + Gets the type of area that this AreaBreak will terminate. + + the current + area break type + + + + + A + + will try to take up as much horizontal space as + available to it on the canvas or page. The concept is comparable to the block + element in HTML. Also like in HTML, the visual representation of the object + can be delimited by padding, a border, and/or a margin. + + + + + Creates a BlockElement. + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets all margins around the element to the same width. + the new margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Gets the current left padding width of the element. + the left padding width, as a float + + + Sets the left padding width of the element. + the new left padding width + this element + + + Gets the current right padding width of the element. + the right padding width, as a float + + + Sets the right padding width of the element. + the new right padding width + this element + + + Gets the current top padding width of the element. + the top padding width, as a float + + + Sets the top padding width of the element. + the new top padding width + this element + + + Gets the current bottom padding width of the element. + the bottom padding width, as a float + + + Sets the bottom padding width of the element. + the new bottom padding width + this element + + + Sets all paddings around the element to the same width. + the new padding width + this element + + + Sets the paddings around the element to a series of new widths. + the new padding top width + the new padding right width + the new padding bottom width + the new padding left width + this element + + + Sets the vertical alignment of the element. + the vertical alignment setting + this element + + + + Sets a ratio which determines in which proportion will word spacing and character spacing + be applied when horizontal alignment is justified. + + + the ratio coefficient. It must be between 0 and 1, inclusive. + It means that ratio part of the free space will + be compensated by word spacing, and 1-ratio part of the free space will + be compensated by character spacing. + If ratio is 1, additional character spacing will not be applied. + If ratio is 0, additional word spacing will not be applied. + + + + + Returns whether the + + should be kept together as much + as possible. + + + the current value of the + + property + + + + + Sets whether the + + should be kept together as much + as possible. + + + the new value of the + + property + + this element + + + + Returns whether the end of this + + and the start of the next sibling of this element + should be placed in the same area. + + + the current value of the + + property + + + + + Sets whether the end of this + + and the start of the next sibling of this element + should be placed in the same area. + Note that this will only work for high-level elements, i.e. elements added to the + + . + + + the new value of the + + property + + this element + + + Sets the rotation radAngle. + the new rotation radAngle, as a float, in radians + this element + + + Sets the rotation angle. + the new rotation angle, as a double, in radians + this element + + + + A + + is one piece of data in an enclosing grid, the + + . + This object is a + + , giving it a number of visual layout + properties. + A cell can act as a container for a number of layout elements; it can only + contain other + + objects or images. Other types of layout + elements must be wrapped in a + + . + + + + Creates a cell which takes a custom amount of cell spaces in the table. + the number of rows this cell must occupy. Negative numbers will make the argument default to 1. + + the number of columns this cell must occupy. Negative numbers will make the argument default to 1. + + + + Creates a cell. + + + Gets a cell renderer for this element. + + Gets a cell renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a cell renderer for this element + + + + Gets + the number of the row + in which the cell is located. + + the row number + + + + Gets + the number of the column + in which the cell is located. + + the column number + + + + Gets the + rowspan + of the cell. + + the rowspan + + + + Gets the + colspan + of the cell. + + the colspan + + + Adds any block element to the cell's contents. + + a + + + this Element + + + Adds an image to the cell's contents. + + an + + + this Element + + + Adds an embedded table to the cell's contents. + + a nested + + + this Element + + + Directly adds a String of text to this cell. + + Directly adds a String of text to this cell. The content is wrapped in a + layout element. + + + a + + + this Element + + + Clones a cell with its position, properties, and optionally its contents. + whether or not to also include the contents of the cell. + a clone of this Element + + + + A + + is a container object that defines a section in a document, + which will have some shared layout properties. Like all + + types, it will try to take up as much horizontal space as possible. + The concept is very similar to that of the div tag in HTML. + + + + Adds any block element to the div's contents. + + a + + + this Element + + + Adds an image to the div's contents. + + an + + + this Element + + + + A + + is a layout element which may get added to + indefinitely, making the object prohibitively large. + In order to avoid consuming and holding on to undesirable amounts of + resources, the contents of a + + can be flushed regularly + by client code, e.g. at page boundaries or after a certain amount of additions. + + + + Checks whether an element has already been marked as complete. + the completion marker boolean + + + Indicates that all the desired content has been added to this large element. + + + Writes the newly added content to the document. + + + Flushes the content which has just been added to the document. + + Flushes the content which has just been added to the document. + This is a method for internal usage and is called automatically by the document. + + + + Sets the document this element is bound to. + + Sets the document this element is bound to. + We cannot write a large element into several documents simultaneously because we would need + more bulky interfaces for this feature. For now we went for simplicity. + + the document + + + + A marker subinterface of + + that specifies that the layout object + is, by definition, on the lowest tier in the object hierarchy. A + leaf element + must not act as a container for other + elements. + + + + A layout element that represents an image for inclusion in the document model. + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax. + + + an internal + + + + + + Creates an + + from a form XObject, the representation of a + form in PDF syntax. + + + an internal + + + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, with a custom width. + + + an internal + + + a float value + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, with a custom width and on a fixed position. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + a float value + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, on a fixed position. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + + + + Creates an + + from a form XObject, the representation of a + form in PDF syntax. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the form + a float value representing the vertical offset of the lower left corner of the form + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module. + + + an internal representation of the + image resource + + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module, on a fixed position. + + + an internal representation of the + image resource + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module, with a custom width and on a fixed position. + + + an internal representation of the + image resource + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + a float value + + + Gets the XObject contained in this image object + + a + + + + + Sets the rotation radAngle. + a value in radians + this element + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Scale the image relative to its default size. + the horizontal scaling coefficient. default value 1 = 100% + the vertical scaling coefficient. default value 1 = 100% + this element + + + Scale the image to an absolute size. + + Scale the image to an absolute size. This method will preserve the + width-height ratio of the image. + + the new maximum width of the image + the new maximum height of the image + this element + + + Scale the image to an absolute size. + + Scale the image to an absolute size. This method will not + preserve the width-height ratio of the image. + + the new absolute width of the image + the new absolute height of the image + this element + + + Sets the autoscale property for both width and height. + whether or not to let the image resize automatically + this image + + + Sets the autoscale property for the height of the image. + whether or not to let the image height resize automatically + this image + + + Sets the autoscale property for the width of the image. + whether or not to let the image width resize automatically + this image + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + this image. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + this Element. + + + Gets width of the image. + + Gets width of the image. It returns width of image or form XObject, + not the width set by one of the #setWidth methods + + the original width of the image + + + Gets height of the image. + + Gets height of the image. It returns height of image or form XObject, + not the height set by one of the #setHeight methods + + the original height of the image + + + Gets scaled width of the image. + the current scaled width + + + Gets scaled height of the image. + the current scaled height + + + + + Creates a custom line separator with line style defined by custom + + interface instance + + line drawer instance + + + + A clickable piece of + + which contains a + link annotation dictionary + . The concept is largely similar to that of the + HTML anchor tag. + + + + + A + + is a piece of text of any length. As a + leaf element + , + it is the smallest piece of content that may bear specific layout attributes. + + + + Constructs a Text with its role initialized. + + the contents, as a + + + + + Gets the contents of the Text object that will be rendered. + the string with the contents + + + Sets the contents of the Text object. + the new contents + + + Gets the text rise. + the vertical distance from the text's default base line, as a float. + + + Sets the text rise. + a vertical distance from the text's default base line. + this Text + + + + Gets the horizontal scaling property, which determines how wide the text + should be stretched. + + the horizontal spacing, as a float + + + Skews the text to simulate italic and other effects. + + Skews the text to simulate italic and other effects. Try alpha=0 + and beta=12. + + the first angle in degrees + the second angle in degrees + this Text + + + + The horizontal scaling parameter adjusts the width of glyphs by stretching or + compressing them in the horizontal direction. + + + the scaling parameter. 1 means no scaling will be applied, + 0.5 means the text will be scaled by half. + 2 means the text will be twice as wide as normal one. + + this Text + + + Creates a Link with a fully constructed link annotation dictionary. + the textual contents of the link + + a + + + + + Creates a Link which can execute an action. + the textual contents of the link + + a + + + + + Creates a Link to another location in the document. + the textual contents of the link + + a + + + + + Gets the link annotation dictionary associated with this link. + + a + + + + + + A List is a layout element representing a series of objects that are vertically + outlined with the same or very similar layout properties, giving it a sense + of unity. + + + A List is a layout element representing a series of objects that are vertically + outlined with the same or very similar layout properties, giving it a sense + of unity. It contains + + objects that can optionally be prefixed + with a symbol and/or numbered. + + + + + Creates a List with the + + as a prefix. + + + + Creates a List with a custom numbering type. + a prefix style + + + + Adds a new + + to the bottom of the List. + + a new list item + this list. + + + + Adds a new + + to the bottom of the List. + + textual contents of the new list item + this list. + + + Customizes the index of the first item in the list. + the custom index, as an int + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + the textual symbol to be used for all items. + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + + the + + object to be used for all items. + + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + + the + + object to be used for all items. + + this list. + + + Sets the list numbering type to be used. + + Sets the list numbering type to be used. This will create an ordered list, + i.e. every + + will have a unique prefix. + + + the + + that will generate appropriate prefixes for the + + s. + + this list. + + + A specialized enum containing alignment properties for list symbols. + + A specialized enum containing alignment properties for list symbols. + + means that the items will be aligned as follows: + 9. Item 9 + 10. Item 10 + Whereas + + means the items will be aligned as follows: + 9. Item 9 + 10. Item 10 + + + + + Gets the indent offset of the + + symbols. + + the indent offset as a float. + + + + Sets the indent offset of the + + symbols. + + the new indent offset. + this list. + + + + Gets the piece of text that is added after the + + symbol. + + the post symbol text + + + + Sets a piece of text that should be added after the + + symbol. + + the post symbol text + + + + Gets the piece of text that is added before the + + symbol. + + the pre symbol text + + + + Sets a piece of text that should be added before the + + symbol. + + the pre symbol text + + + + A list item is a layout element that is one entry in a + + . The list + object controls the prefix, postfix, and numbering of the list items. + + + + Creates a ListItem. + + + Creates a list item with text. + the textual contents of the list item + + + Creates a list item with an image. + the graphical contents of the list item + + + Sets the list item symbol to be used. + the textual symbol to be used for the item. + this list item. + + + Sets the list item symbol to be used. + + the + + object to be used for the item. + + this list item. + + + Sets the list item symbol to be used. + + the + + object to be used for the item. + + this list. + + + Sets the list item numbering type to be used. + + the + + that will generate appropriate prefixes for the + + . + + this list item. + + + + A layout element that represents a self-contained block of textual and + grpahical information. + + + A layout element that represents a self-contained block of textual and + grpahical information. + It is a + + which essentially acts as a container for + leaf elements + . + + + + Creates a Paragraph. + + + Creates a Paragraph, initialized with a piece of text. + + the initial textual content, as a + + + + + Creates a Paragraph, initialized with a piece of text. + + the initial textual content, as a + + + + + Adds a piece of text to the Paragraph + + the content to be added, as a + + + this Paragraph + + + Adds a layout element to the Paragraph. + + the content to be added, any + + + this Paragraph + + + + Adds a + + of layout elements to the Paragraph. + + + the content to be added, any + + + this Paragraph + + + Adds an unspecified amount of tabstop elements as properties to the Paragraph. + + the + tabstop(s) + to be added as properties + + this Paragraph + + + + + Adds a + + of tabstop elements as properties to the Paragraph. + + + the list of + + s to be added as properties + + this Paragraph + + + + + Removes a tabstop position from the Paragraph, if it is present in the + + property. + + + the + + position to be removed. + + this Paragraph + + + + + Sets the indent value for the first line of the + + . + + + the indent value that must be applied to the first line of + the Paragraph, as a float + + this Paragraph + + + + Sets the leading value, using the + + strategy. + + the new leading value + this Paragraph + + + + + Sets the leading value, using the + + strategy. + + the new leading value + this Paragraph + + + + + This class represents the empty space from a + + to the following + + , if any. Using this class will not have any effect unless + there are + + objects defined for the enveloping element. + + + + + A + + is a layout element that represents data in a two-dimensional + grid. It is filled with + cells + , ordered in rows and columns. + It is an implementation of + + , which means it can be flushed + to the canvas, in order to reclaim memory that is locked up. + + + + + Constructs a + Table + with the relative column widths. + + the relative column widths + whether parts of the table will be written before all data is added. + + + + + Constructs a + Table + with the relative column widths. + + the relative column widths + + + + Constructs a + Table + with + + columns. + + the number of columns + whether parts of the table will be written before all data is added. + + + + + Constructs a + Table + with + + columns. + + the number of columns + + + Sets the full width of the table. + the full width of the table. + this element + + + Returns the column width for the specified column. + index of the column + the width of the column + + + Returns the number of columns. + the number of columns. + + + Returns the number of rows. + the number of rows. + + + Adds a new cell to the header of the table. + + Adds a new cell to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a header cell to be added + + + Adds a new cell with received blockElement as a content to the header of the table. + + + Adds a new cell with received blockElement as a content to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a header cell + + + Adds a new cell with received image to the header of the table. + + Adds a new cell with received image to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a header cell + + + Adds a new cell with received string as a content to the header of the table. + + + Adds a new cell with received string as a content to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a string to be added to a header cell + + + Gets the header of the table. + Gets the header of the table. The header is represented as a distinct table and might have its own properties. + + + table header or + + , if + + hasn't been called. + + + + Adds a new cell to the footer of the table. + + Adds a new cell to the footer of the table. + The footer will be displayed in the bottom of every area of this table. + See also + + . + + a footer cell + + + Adds a new cell with received blockElement as a content to the footer of the table. + + + Adds a new cell with received blockElement as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a footer cell + + + Adds a new cell with received image as a content to the footer of the table. + + + Adds a new cell with received image as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an image to be added to a footer cell + + + Adds a new cell with received string as a content to the footer of the table. + + + Adds a new cell with received string as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a content string to be added to a footer cell + + + Gets the footer of the table. + Gets the footer of the table. The footer is represented as a distinct table and might have its own properties. + + + table footer or + + , if + + hasn't been called. + + + + + Tells you if the first header needs to be skipped (for instance if the + header says "continued from the previous page"). + + Value of property skipFirstHeader. + + + + Tells you if the last footer needs to be skipped (for instance if the + footer says "continued on the next page") + + Value of property skipLastFooter. + + + Skips the printing of the first header. + + Skips the printing of the first header. Used when printing tables in + succession belonging to the same printed table aspect. + + New value of property skipFirstHeader. + this element + + + Skips the printing of the last footer. + + Skips the printing of the last footer. Used when printing tables in + succession belonging to the same printed table aspect. + + New value of property skipLastFooter. + this element + + + Starts new row. + Starts new row. This mean that next cell will be added at the beginning of next line. + + this element + + + Adds a new cell to the table. + + Adds a new cell to the table. The implementation decides for itself which + row the cell will be placed on. + + + + Cell + to add. + + this element + + + Adds a new cell with received blockElement as a content. + a blockElement to add to the cell and then to the table + + this element + + + Adds a new cell with received image as a content. + an image to add to the cell and then to the table + this element + + + Adds a new cell with received string as a content. + a string to add to the cell and then to the table + this element + + + Returns a cell as specified by its location. + + Returns a cell as specified by its location. If the cell is in a col-span + or row-span and is not the top left cell, then null is returned. + + the row of the cell. indexes are zero-based + the column of the cell. indexes are zero-based + the cell at the specified position. + + + Creates a renderer subtree with root in the current table element. + + Creates a renderer subtree with root in the current table element. + Compared to + + , the renderer returned by this method should contain all the child + renderers for children of the current element. + + + a + + subtree for this element + + + + Gets a table renderer for this element. + + Gets a table renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a table renderer for this element + + + Indicates that all the desired content has been added to this large element. + + + Indicates that all the desired content has been added to this large element. + After this method is called, more precise rendering is activated. + For instance, a table may have a + + method set to true, + and in case of large table on + + we do not know if any more content will be added, + so we might not place the content in the bottom of the page where it would fit, but instead add a footer, and + place that content in the start of the page. Technically such result would look all right, but it would be + more concise if we placed the content in the bottom and did not start new page. For such cases to be + renderered more accurately, one can call + + when some content is still there and not flushed. + + + + Writes the newly added content to the document. + + + Flushes the content which has just been added to the document. + + Flushes the content which has just been added to the document. + This is a method for internal usage and is called automatically by the docunent. + + + + Gets the markup properties of the bottom border of the (current) last row. + + + an array of + + objects + + + + A simple object which holds the row numbers of a section of a table. + + + + Creates a + + + the start number of the row group, inclusive + the finish number of the row group, inclusive + + + Gets the starting row number of the table section + the start number of the row group, inclusive + + + Gets the finishing row number of the table section + the finish number of the row group, inclusive + + + + A TabStop is the closest location on a line of text that the text will jump + to if a + + is inserted. At least one TabStop must be defined on an + element if you want to use + Tabs + . + This object can be added to a + + with the method + + . + + + + Creates a TabStop at the appropriate position. + a float, measured in points + + + + Creates a TabStop at the appropriate position, with a specified tab + alignment. + + + Creates a TabStop at the appropriate position, with a specified tab + alignment. A tab alignment defines the way the textual content should be + positioned with regards to this tab stop. + + a float, measured in points + + a + + value + + + + + Creates a TabStop at the appropriate position, with a specified tab + alignment and an explicitly given line pattern. + + + Creates a TabStop at the appropriate position, with a specified tab + alignment and an explicitly given line pattern. A tab alignment defines + the way the textual content should be positioned with regards to this tab + stop. The line pattern defines a pattern that should be repeated until + the TabStop is reached. If null, the space leading up to the TabStop will + be empty. + + a float, measured in points + + a + + value + + + the + + value, a pattern drawing object + + + + +

    This class implements a simple byte vector with access to the + underlying array.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Capacity increment size + + + The encapsulated array + + + Points to next free item + + + Construct byte vector instance with default block size. + + + Construct byte vector instance. + initial block size + + + Construct byte vector instance. + + byte array to use + TODO should n should be initialized to a.length to be consistent with + CharVector behavior? [GA] + + + + Construct byte vector instance. + byte array to use + + initial block size + TODO should n should be initialized to a.length to be consistent with + CharVector behavior? [GA] + + + + Obtain byte vector array. + byte array + + + Obtain number of items in array. + number of items + + + Obtain capacity of array. + current capacity of array + + + Pet byte at index. + the index + a byte + + + Get byte at index. + the index + a byte + + + This is to implement memory allocation in the array. + This is to implement memory allocation in the array. Like malloc(). + to allocate + previous length + + + Trim byte vector to current length. + + + +

    This class implements a simple char vector with access to the + underlying array.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Capacity increment size + + + The encapsulated array + + + Points to next free item + + + Construct char vector instance with default block size. + + + Construct char vector instance. + initial block size + + + Construct char vector instance. + char array to use + + + Construct char vector instance. + char array to use + initial block size + + + Copy constructor + the CharVector that should be cloned + + + Reset length of vector, but don't clear contents. + + + Obtain char vector array. + char array + + + Obtain number of items in array. + number of items + + + Obtain capacity of array. + current capacity of array + + + Pet char at index. + the index + a char + + + Get char at index. + the index + a char + + + This is to implement memory allocation in the array. + This is to implement memory allocation in the array. Like malloc(). + to allocate + previous length + + + Trim char vector to current length. + + + Represents a hyphen. + + + pre break string + + + no break string + + + post break string + + + Construct a hyphen. + break string + break string + break string + + + Construct a hyphen. + break string + + + + + + + + + + number of hyphenation points in word + + + + rawWord as made of alternating strings and + Hyphen + instances + + + + the number of hyphenation points in the word + + + an index position + the pre-break text, not including the hyphen character + + + an index position + the post-break text + + + the hyphenation points + + + + + + + + + This is the class used to configure hyphenation on layout level + + + The Hyphenator object. + + + The hyphenation symbol used when hyphenating. + + + + Constructs a new + + . No language hyphenation files will be used. + Only soft hyphen symbols ('\u00ad') will be taken into account. + + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + + Constructs a new + + by a + + which will be used to + find hyphenation points. + + + the + + instance + + + + + Constructs a new + + instance. + + the language + the optional country code (may be null or "none") + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Hyphenates a given word. + + + + object representing possible hyphenation points + or + + if no hyphenation points are found. + + + + Gets the hyphenation symbol. + the hyphenation symbol + + + Sets the hyphenation symbol to the specified value. + the new hyphenation symbol + + + A hyphenation exception. + + A hyphenation exception. +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Construct a hyphenation exception. + a message string + + + + + allocation size for arrays + + + + Pointer to low branch and to rest of the key when it is + stored directly in this node, we don't have unions in java! + + + + Pointer to high branch. + + + Pointer to equal branch and to data when this node is a string terminator. + + + + This vector holds the trailing of the keys when the branch is compressed. + + + root + + + free node + + + number of items in tree + + + default constructor + + + initialize + + + + Branches are initially compressed, needing + one node per key plus the size of the string + key. + + + Branches are initially compressed, needing + one node per key plus the size of the string + key. They are decompressed as needed when + another key with same prefix + is inserted. This saves a lot of space, + specially for long keys. + + the key + a value + + + Insert key. + the key + offset into key array + a value + + + The actual insertion function, recursive version. + + + Compares 2 null terminated char arrays + a character array + an index into character array + a character array + an index into character array + an integer + + + Compares a string with null terminated char array + a string + a character array + an index into character array + an integer + + + a character array + an index into character array + a character array + an index into character array + + + a character array + an index into character array + an integer + + + a character array + an integer + + + Find key. + the key + result + + + Find key. + the key + offset into key array + result + + + a key + trye if key present + + + length + + + + Recursively insert the median first and then the median of the + lower and upper halves, and so on in order to get a balanced + tree. + + + Recursively insert the median first and then the median of the + lower and upper halves, and so on in order to get a balanced + tree. The array of keys is assumed to be sorted in ascending + order. + + array of keys + array of values + where to insert + count to insert + + + Balance the tree for best search performance + + + + Each node stores a character (splitchar) which is part of + some key(s). + + + Each node stores a character (splitchar) which is part of + some key(s). In a compressed branch (one that only contain + a single string key) the trailer of the key which is not + already in nodes is stored externally in the kv array. + As items are inserted, key substrings decrease. + Some substrings may completely disappear when the whole + branch is totally decompressed. + The tree is traversed to find the key substrings actually + used. In addition, duplicate substrings are removed using + a map (implemented with a TernaryTree!). + + + + the keys + + + +

    This interface is used to connect the XML pattern file parser to + the hyphenation tree.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Add a character class. + + Add a character class. + A character class defines characters that are considered + equivalent for the purpose of hyphenation (e.g. "aA"). It + usually means to ignore case. + + character group + + + Add a hyphenation exception. + + Add a hyphenation exception. An exception replaces the + result obtained by the algorithm for cases for which this + fails or the user wants to provide his own hyphenation. + A hyphenatedword is a vector of alternating String's and + Hyphen + instances + + word to add as an exception + pre-hyphenated word + + + Add hyphenation patterns. + the pattern + + interletter values expressed as a string of + digit characters. + + + + value space: stores the interletter values + + + This map stores hyphenation exceptions + + + This map stores the character classes + + + Temporary map to store interletter values on pattern loading. + + + Default constructor. + + + + Packs the values by storing them in 4 bits, two values into a byte + Values range is from 0 to 9. + + + Packs the values by storing them in 4 bits, two values into a byte + Values range is from 0 to 9. We use zero as terminator, + so we'll add 1 to the value. + + + a string of digits from '0' to '9' representing the + interletter values. + + + the index into the vspace array where the packed values + are stored. + + + + Unpack values. + an integer + a string + + + Read hyphenation patterns from an XML file. + the filename + In case the parsing fails + + + + + Read hyphenation patterns from an XML file. + the InputSource for the file + unique key representing country-language combination + In case the parsing fails + + + + Find pattern. + a pattern + a string + + + + String compare, returns 0 if equal or + t is a substring of s. + + first character array + starting index into first array + second character array + starting index into second array + an integer + + + Get values. + an integer + a byte array + + + + Hyphenate word and return a Hyphenation object. + the word to be hyphenated + + Minimum number of characters allowed + before the hyphenation point. + + + Minimum number of characters allowed after + the hyphenation point. + + + a + Hyphenation + object representing + the hyphenated word or null if word is not hyphenated. + + + + Hyphenate word and return an array of hyphenation points. + char array that contains the word + Offset to first character in word + Length of word + + Minimum number of characters allowed + before the hyphenation point. + + + Minimum number of characters allowed after + the hyphenation point. + + + a + Hyphenation + object representing + the hyphenated word or null if word is not hyphenated. + + + + Add a character class to the tree. + + Add a character class to the tree. It is used by + PatternParser + as callback to + add character classes. Character classes define the + valid word characters for hyphenation. If a word contains + a character not defined in any of the classes, it is not hyphenated. + It also defines a way to normalize the characters in order + to compare them with the stored patterns. Usually pattern + files use only lower case characters, in this case a class + for letter 'a', for example, should be defined as "aA", the first + character being the normalization char. + + a character class (group) + + + Add an exception to the tree. + + Add an exception to the tree. It is used by + PatternParser + class as callback to + store the hyphenation exceptions. + + normalized word + + a vector of alternating strings and + hyphen + objects. + + + + Add a pattern to the tree. + + Add a pattern to the tree. Mainly, to be used by + PatternParser + class as callback to + add a pattern to the tree. + + the hyphenation pattern + + interletter weight values indicating the + desirability and priority of hyphenating at a given point + within the pattern. It should contain only digit characters. + (i.e. '0' to '9'). + + + +

    This is a cache for HyphenationTree instances.

    +
    + + Contains the cached hyphenation trees + + + Used to avoid multiple error messages for the same language if a pattern file is missing. + + + Looks in the cache if a hyphenation tree is available and returns it if it is found. + the language + the country (may be null or "none") + the HyhenationTree instance or null if it's not in the cache + + + Constructs the key for the hyphenation pattern file. + the language + the country (may be null or "none") + the resulting key + + + + If the user configured a hyphenation pattern file name + for this (lang,country) value, return it. + + + If the user configured a hyphenation pattern file name + for this (lang,country) value, return it. If not, return null. + + the language + the country (may be null or "none") + the map of user-configured hyphenation pattern file names + the hyphenation pattern file name or null + + + Cache a hyphenation tree under its key. + the key (ex. "de_CH" or "en") + the hyphenation tree + + + Notes a key to a hyphenation tree as missing. + + Notes a key to a hyphenation tree as missing. + This is to avoid searching a second time for a hyphenation pattern file which is not + available. + + the key (ex. "de_CH" or "en") + + + Indicates whether a hyphenation file has been requested before but it wasn't available. + + Indicates whether a hyphenation file has been requested before but it wasn't available. + This is to avoid searching a second time for a hyphenation pattern file which is not + available. + + the key (ex. "de_CH" or "en") + true if the hyphenation tree is unavailable + + + + Logging instance. + + + Creates a new hyphenator. + the language + the optional country code (may be null or "none") + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Creates a new hyphenator. + the language + the optional country code (may be null or "none") + the map with user-configured hyphenation pattern file names + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Registers additional file directories. + directory to register + + + Returns the default hyphenation tree cache. + the default (static) hyphenation tree cache + + + Clears the default hyphenation tree cache. + Clears the default hyphenation tree cache. This method can be used if the underlying data files are changed at runtime. + + + + + Returns a hyphenation tree for a given language and country, + with fallback from (lang,country) to (lang). + + + Returns a hyphenation tree for a given language and country, + with fallback from (lang,country) to (lang). + The hyphenation trees are cached. + + the language + the country (may be null or "none") + the map with user-configured hyphenation pattern file names + the hyphenation tree + + + Returns a hyphenation tree for a given language and country. + Returns a hyphenation tree for a given language and country. The hyphenation trees are cached. + the language + the country (may be null or "none") + the map with user-configured hyphenation pattern file names + the hyphenation tree + + + Load tree from xml file using configuration settings. + the directory to search the file into + language key for the requested hyphenation file + the requested HyphenationTree or null if it is not available + + + Load tree from the stream. + the input stream to load the tree from + unique key representing country-language combination + the requested HyphenationTree or null if it is not available + + + Hyphenates a word. + the language + the optional country code (may be null or "none") + the map with user-configured hyphenation pattern file names + the word to hyphenate + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + the hyphenation result + + + Hyphenates a word. + the language + the optional country code (may be null or "none") + the word to hyphenate + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + the hyphenation result + + + Hyphenates a word. + the word to hyphenate + the hyphenation result + + + +

    A SAX document handler to read and parse hyphenation patterns + from a XML file.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Construct a pattern parser. + if a hyphenation exception is raised + + + + Construct a pattern parser. + a pattern consumer + if a hyphenation exception is raised + + + + Parses a hyphenation pattern file. + the filename + In case of an exception while parsing + + + + + Parses a hyphenation pattern file. + the InputStream for the file + unique key representing country-language combination + In case of an exception while parsing + + + + if not caught + + + + An object that iterates over the + + . + + + + current node index + + + current key + + + Node stack + + + key stack implemented with a StringBuffer + + + default constructor + + + rewind iterator + + + Resets the Iterator to its initial state. + + + value + + + true if more elements + + + traverse upwards + + + traverse the tree to find next key + + + next element + + + parent + + + child + + + default constructor + + + Construct item. + a char + a char + + + + Represents the area for content + layouting + . + + + + The number of page on which the area is located. + + + The area's bounding box + + + Indicates whether the area already has some placed content or not. + + + + Creates the area for content + layouting + . + + the number of page on which the area is located. + the area's bounding box + + + Gets the number of page on which the area is located. + page number + + + + Gets the + box + which bounds the area. + + the bounding box + + + + Sets the + box + which bounds the area. + + + + Indicates whether the area already has some placed content or not. + whether the area is empty or not + + + Defines whether the area already has some placed content or not. + + + + + + + + + + + + + + + + Represents the context for content + layouting + . + + + + + The + area + the content to be placed on. + + + + + Gets the + area + the content to be placed on. + + the area for content layouting. + + + + + + We use a simplified version of CSS positioning. + + We use a simplified version of CSS positioning. + See https://www.webkit.org/blog/117/webcore-rendering-iv-absolutefixed-and-relative-positioning + + + + Default positioning by normal rules of block and line layout. + + + + Relative positioning is exactly like static positioning except that the left, top, right and bottom properties + can be used to apply a translation to the object. + + + Relative positioning is exactly like static positioning except that the left, top, right and bottom properties + can be used to apply a translation to the object. Relative positioning is literally nothing more than a paint-time translation. + As far as layout is concerned, the object is at its original position. + + + + Fixed positioned objects are positioned relative to the viewport, i.e., the page area of the current page. + + + + Calculates the common rectangle which includes all the input rectangles. + + list of input rectangles. + common rectangle. + + + + Represents the result of content + layouting + . + + + + + The status of + + which indicates that the content was fully placed. + + + + + The status of + + which indicates that the content was placed partially. + + + + + The status of + + which indicates that the content was not placed. + + + + + The status of + + which indicates whether the content was added or not + and, if yes, was it added fully or partially. + + + + + The area occupied by the content during its + layouting + . + which indicates whether the content was added or not and, if yes, was it added fully or partially. + + + + + The split renderer created during + layouting + . + This renderer will be used to draw the splitted part of content. + + + + + The overflow renderer created during + layouting + . + This renderer will be used to draw the overflowed part of content. + + + + + The first renderer to produce + + during + + . + + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + + Gets the status of + + . + + the status + + + + Gets the + layout area + occupied by the content during + layouting + . + + + the + layout area + occupied by the content + + + + + Gets the split + renderer + created during + layouting + . + + + the + renderer + + + + + Sets the split + renderer + . + + + + + Gets the overflow renderer created during + layouting + . + + + the + renderer + + + + + Sets the overflow + renderer + . + + + + + Gets the first renderer to produce + + during + + + + the + renderer + + + + + + + + Represents the result of a line + layouting + . + + + + Indicates whether split was forced by new line symbol or not. + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + Indicates whether split was forced by new line symbol in rendered text. + + Indicates whether split was forced by new line symbol in rendered text. + The value will be set as true if, for example, + the rendered text of one of the child renderers contains '\n' symbol. + + whether split was forced by new line or not + + + + Sets + + + indicates that split was forced by new line symbol in rendered text. + + + this layout result + the setting was applied on. + + + + + + Represents the result of a text + layout + . + + + + + Indicates whether some word was splitted during + layout + . + + + + Indicates whether split was forced by new line symbol in text or not. + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + + Indicates whether some word in a rendered text was splitted during + layout + . + The value will be set as true if, for example, the rendered words width is bigger than the width of layout area. + + whether some word was splitted or not. + + + + Sets + + + + indicates that some word was splitted during + layout + . + + + + this layout result + the setting was applied on + + + + + Indicates whether split was forced by new line symbol in rendered text. + + Indicates whether split was forced by new line symbol in rendered text. + The value will be set as true if, for example, the rendered text contains '\n' symbol. + + whether split was forced by new line or not. + + + + Sets + + + indicates that split was forced by new line symbol in rendered text. + + + this layout result + the setting was applied on. + + + + + + A specialized class holding configurable properties related to an + + 's background. This class is meant to be used as the value for the + + key in an + + . Allows + to define a background color, and positive or negative changes to the + location of the edges of the background coloring. + + + + Creates a background with a specified color. + the background color + + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + These values are allowed to be negative. + + the background color + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + + + Gets the background's color. + + a + + of any supported kind + + + + Gets the extra space that must be filled to the left of the Element. + a float value + + + Gets the extra space that must be filled to the right of the Element. + a float value + + + Gets the extra space that must be filled at the top of the Element. + a float value + + + Gets the extra space that must be filled at the bottom of the Element. + a float value + + + + A specialized class that specifies the leading, "the vertical distance between + the baselines of adjacent lines of text" (ISO-32000-1, section 9.3.5). + + + A specialized class that specifies the leading, "the vertical distance between + the baselines of adjacent lines of text" (ISO-32000-1, section 9.3.5). + Allows to use either an absolute (constant) leading value, or one + determined by font size. Pronounce as 'ledding' (cfr. Led Zeppelin). + This class is meant to be used as the value for the + + key in an + + . + + + + A leading type independent of font size. + + + A leading type related to the font size and the resulting bounding box. + + + Creates a Leading object. + + a constant type that defines the calculation of actual + leading distance. Either + + or + + + to be used as a basis for the leading calculation. + + + Gets the calculation type of the Leading object. + + the calculation type. Either + + or + + + + + Gets the value to be used as the basis for the leading calculation. + a calculation value + + + A specialized enum containing alignment properties for list symbols. + + + + An enum of property names that are used for graphical properties of layout + elements. + + + An enum of property names that are used for graphical properties of layout + elements. The + + performs the same function as an + + , with the values of + + as its potential keys. + + + + Value of 1 is equivalent to no scaling + + + + Use values from + + . + + + + Value of 1 is equivalent to no scaling + + + + Some properties must be passed to + + objects that + are lower in the document's hierarchy. Most inherited properties are + related to textual operations. Indicates whether or not this type of property is inheritable. + + + + + This method checks whether a Property, in order to be picked up by the + rendering engine, must be defined on the current element or renderer + (return false), or may be defined in one of its parent + elements or renderers (return true). + + the ID, defined in this class, of the property to check + whether the property type is inheritable + + + A POJO that describes the underline of a layout element. + + A POJO that describes the underline of a layout element. + This class is to be used as a property for an element or renderer, + as the value for + + + + + Creates an Underline. + + Creates an Underline. Both the thickness and vertical positioning under + the text element's base line can be set to a fixed value, or a variable + one depending on the element's font size. + If you want a fixed-width thickness, set thicknessMul to 0; + if you want a thickness solely dependent on the font size, set + thickness to 0. + Mutatis mutandis for the y-position. + + + the + + of the underline + + a float defining the minimum thickness in points of the underline + a float defining the font size dependent component of the thickness of the underline + + a float defining the default absolute vertical distance in points from the text's base line + + a float defining the font size dependent component of the vertical positioning of the underline + + + the way the underline finishes at its edges. + + + + + Gets the color of the underline. + + a + + + + + Gets the total thickness of the underline (fixed + variable part). + the font size for which to calculate the variable thickness + the total thickness, as a float, in points + + + Gets the vertical position of the underline (fixed + variable part). + the font size for which to calculate the variable position + the y-position, as a float, in points + + + Gets the multiplier for the vertical positioning of the text underline. + the Y-position multiplier, as a float + + + + Gets the + + of the text underline. + + + the line cap style, as an int referring to + the values of + + + + + A specialized class that holds a value and the unit it is measured in. + + + Creates a UnitValue object with a specified type and value. + + either + + or a + + + the value to be stored. + + + Creates a UnitValue POINT object with a specified value. + the value to be stored. + + a new + + + + + + + Creates a UnitValue PERCENT object with a specified value. + the value to be stored. + + a new + + + + + + + Returns the unit this value is stored in, either points (pt) or percent(%) + + either 1 for + + or 2 for + + + + + Sets the unit this value is stored in, either points (pt) or percent(%) + + either + + or + + + + + Gets the measured value stored in this object + the value, as a float + + + Sets the measured value stored in this object + a float + + + Returns whether or not the value is stored in points (pt) + true if stored in points + + + Returns whether or not the value is stored in percent (%) + true if stored in percent + + + Returns a property with a certain key, as a floating point value. + + an + enum value + + + a + + + + + Returns a property with a certain key, as a floating point value. + + an + enum value + + default value to be returned if property is not found + + a + + + + + Returns a property with a certain key, as an integer value. + + an + enum value + + + a + + + + + + Writes standard structure attributes to the IAccessibleElement based on the layout element properties + and renderer layout result. + + + + The same layout element instance can be added several times to the document. + + The same layout element instance can be added several times to the document. + In that case it will already have attributes which belong to the previous positioning on the page, and because of + that we want to remove those old irrelevant attributes. + + + + + Renderer object for the + + layout element. Will terminate the + current content area and initialize a new one. + + + + Creates an AreaBreakRenderer. + + the + + that will be rendered by this object + + + + + This method creates + + instance that could be used + to rotate content inside the occupied area. Be aware that it should be used only after + layout rendering is finished and correct occupied area for the rotated element is calculated. + + + + + that rotates the content and places it inside occupied area. + + + + + This method calculates the shift needed to be applied to the points in order to position + upper and left borders of their bounding box at the given lines. + + x coordinate at which points bbox left border is to be aligned + y coordinate at which points bbox upper border is to be aligned + the points, which bbox will be aligned at the given position + + array of two floats, where first element denotes x-coordinate shift and the second + element denotes y-coordinate shift which are needed to align points bbox at the given lines. + + + + Creates a CanvasRenderer from its corresponding layout object. + + Creates a CanvasRenderer from its corresponding layout object. + Sets + + to true. + + + the + + which this object should manage + + + + Creates a CanvasRenderer from its corresponding layout object. + + Creates a CanvasRenderer from its corresponding layout object. + Defines whether the content should be flushed immediately after addition + + or not + + + the + + which this object should manage + + the value which stands for immediate flushing + + + + + + + + + + + + Creates a CellRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + + + + + + Creates a DivRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + Creates an ImageRenderer from its corresponding layout object. + + the + + which this object should manage + + + + Gets the total lengths of characters in this line. + + Gets the total lengths of characters in this line. Other elements (images, tables) are not taken + into account. + + + + Returns the number of base characters, i.e. + Returns the number of base characters, i.e. non-mark characters + + + Calculates and sets encountered tab size. + + Calculates and sets encountered tab size. + Returns null, if processing is finished and layout can be performed for the tab renderer; + otherwise, in case when the tab should be processed after the next element in the line, this method returns corresponding tab stop. + + + + Calculates and sets tab size with the account of the element that is next in the line after the tab. + + + Calculates and sets tab size with the account of the element that is next in the line after the tab. + Returns resulting width of the tab. + + + + Creates a LineSeparatorRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + This class represents the + renderer + object for a + + object. It will draw the glyphs of the textual content on the + + . + + + + Creates a TextRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + Creates a TextRenderer from its corresponding layout object, with a custom + text to replace the contents of the + + . + + + the + + which this object should manage + + the replacement text + + + + Trims any whitespace characters from the start of the + + to be rendered. + + + + + Trims any whitespace characters from the end of the + + to + be rendered. + + the amount of space in points which the text was trimmed by + + + Gets the maximum offset above the base line that this Text extends to. + + the upwards vertical offset of this + + + + + Gets the maximum offset below the base line that this Text extends to. + + the downwards vertical offset of this + + + + + + Gets the position on the canvas of the imaginary horizontal line upon which + the + + 's contents will be written. + + + the y position of this text on the + + + + + Moves the vertical position to the parameter's value. + the new vertical position of the Text + + + + Manually sets the contents of the Text's representation on the canvas, + regardless of the Text's own contents. + + the replacement text + + + + Manually sets a GlyphLine to be rendered with a specific start and end + point. + + + a + + + the leftmost end of the GlyphLine + the rightmost end of the GlyphLine + + + The length of the whole text assigned to this renderer. + the text length + + + Gets char code at given position for the text belonging to this renderer. + + the position in range [0; length()) + Unicode char code + + + + Returns the length of the which is the result of the layout call. + + the length of the line + + + This method return a LinkedHashMap with glyphlines as its keys. + + This method return a LinkedHashMap with glyphlines as its keys. Values are boolean flags indicating if a + glyphline is written in a reversed order (right to left text). + + + + Creates a LinkRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + Creates a LinkRenderer from its corresponding layout object, with a custom + text to replace the contents of the + + . + + + the + + which this object should manage + + the replacement text + + + Creates a ListItemRenderer from its corresponding layout object. + + the + + which this object should manage + + + + Creates a ListRenderer from its corresponding layout object. + + the + + which this object should manage + + + + +

    + Corrects split and overflow renderers when + + is applied. + We assume that + + is applied when the first + + cannot be fully layouted. + This means that the problem has occurred in one of first list item renderer's child. + We consider the right solution to force placement of all first item renderer's childs before the one, + which was the cause of + + , including this child. +

    +

    + Notice that we do not expect + + to be applied + if we can render the first item renderer and strongly recommend not to set + + manually. +

    +
    + + the + split renderer + before correction + + + the + overflow renderer + before correction + + + the + cause of nothing renderer + + the area occupied by layouting before correction + + corrected + layout result + +
    + + + This class represents the + renderer + object for a + + object. It will draw the glyphs of the textual content on the + + . + + + + Creates a ParagraphRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + + + + + + + + + + This class represents the + renderer + object for a + + object. It will delegate its drawing operations on to the + + instances associated with the + table cells + . + + + + True for newly created renderer. + True for newly created renderer. For split renderers this is set to false. Used for tricky layout. + + + + + Creates a TableRenderer from a + + which will partially render + the table. + + the table to be rendered by this renderer + the table rows to be rendered + + + + Creates a TableRenderer from a + + . + + the table to be rendered by this renderer + + + + + + + + + + + + + + + + + + + + + If there is some space left, we move footer up, because initially footer will be at the very bottom of the area. + + + If there is some space left, we move footer up, because initially footer will be at the very bottom of the area. + We also adjust occupied area by footer size if it is present. + + the layout box which represents the area which is left free. + + + This method checks if we can completely fit the rows in the given area, staring from the startRow. + + + + This method is used to set row range for table renderer during creating a new renderer. + + This method is used to set row range for table renderer during creating a new renderer. + The purpose to use this method is to remove input argument RowRange from createOverflowRenderer + and createSplitRenderer methods. + + + + This is a struct used for convenience in layout. + + + Creates a TabRenderer from its corresponding layout object + + the + + which this object should manage + + + + + + + + + + + + + + + + The default implementation of + ISplitCharacters interface + . + + + + Interface for customizing the split character. + + + Returns true if the character can split a line. + + Returns true if the character can split a line. The splitting implementation + is free to look ahead or look behind characters to make a decision. + + + the position of + Glyph + in the + GlyphLine + + an array of unicode char codes which represent current text + + + Container object for style properties of an element. + + Container object for style properties of an element. A style can be used as + an effective way to define multiple equal properties to several elements. + Used in + + + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets all margins around the element to the same width. + the new margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Gets the current left padding width of the element. + the left padding width, as a float + + + Sets the left padding width of the element. + the new left padding width + this element + + + Gets the current right padding width of the element. + the right padding width, as a float + + + Sets the right padding width of the element. + the new right padding width + this element + + + Gets the current top padding width of the element. + the top padding width, as a float + + + Sets the top padding width of the element. + the new top padding width + this element + + + Gets the current bottom padding width of the element. + the bottom padding width, as a float + + + Sets the bottom padding width of the element. + the new bottom padding width + this element + + + Sets all paddings around the element to the same width. + the new padding width + this element + + + Sets the paddings around the element to a series of new widths. + the new padding top width + the new padding right width + the new padding bottom width + the new padding left width + this element + + + Sets the vertical alignment of the element. + the vertical alignment setting + this element + + + + Sets a ratio which determines in which proportion will word spacing and character spacing + be applied when horizontal alignment is justified. + + + the ratio coefficient. It must be between 0 and 1, inclusive. + It means that ratio part of the free space will + be compensated by word spacing, and 1-ratio part of the free space will + be compensated by character spacing. + If ratio is 1, additional character spacing will not be applied. + If ratio is 0, additional word spacing will not be applied. + + + + + Returns whether the + + should be kept together as much + as possible. + + + the current value of the + + property + + + + + Sets whether the + + should be kept together as much + as possible. + + + the new value of the + + property + + this element + + + Sets the rotation radAngle. + the new rotation radAngle, as a float + this element + + + Sets the rotation angle. + the new rotation angle, as a double + this element + +
    +
    diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.dll b/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.dll new file mode 100644 index 00000000000..039ce40bcee Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.xml b/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.xml new file mode 100644 index 00000000000..a1afb4466f7 --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.pdfa.xml @@ -0,0 +1,316 @@ + + + + itext.pdfa + + + + + + An abstract class that will run through all necessary checks defined in the + different PDF/A standards and levels. + + + An abstract class that will run through all necessary checks defined in the + different PDF/A standards and levels. A number of common checks are executed + in this class, while standard-dependent specifications are implemented in the + available subclasses. The standard that is followed is the series of ISO + 19005 specifications, currently generations 1 through 3. The ZUGFeRD standard + is derived from ISO 19005-3. + While it is possible to subclass this method and implement its abstract + methods in client code, this is not encouraged and will have little effect. + It is not possible to plug custom implementations into iText, because iText + should always refuse to create non-compliant PDF/A, which would be possible + with client code implementations. Any future generations of the PDF/A + standard and its derivates will get their own implementation in the + iText 7 - pdfa project. + + + + + The Red-Green-Blue color profile as defined by the International Color + Consortium. + + + + + The Cyan-Magenta-Yellow-Key (black) color profile as defined by the + International Color Consortium. + + + + + The Grayscale color profile as defined by the International Color + Consortium. + + + + The Output device class + + + The Monitor device class + + + The maximum Graphics State stack depth in PDF/A documents, i.e. + + The maximum Graphics State stack depth in PDF/A documents, i.e. the + maximum number of graphics state operators with code q that + may be opened (i.e. not yet closed by a corresponding Q) at + any point in a content stream sequence. + Defined as 28 by PDF/A-1 section 6.1.12, by referring to the PDF spec + Appendix C table 1 "architectural limits". + + + + Contains some objects that are already checked. + + Contains some objects that are already checked. + NOTE: Not all objects that were checked are stored in that set. This set is used for avoiding double checks for + actions, xObjects and page objects; and for letting those objects to be manually flushed. + Use this mechanism carefully: objects that are able to be changed (or at least if object's properties + that shall be checked are able to be changed) shouldn't be marked as checked if they are not to be + flushed immediately. + + + + + This method checks a number of document-wide requirements of the PDF/A + standard. + + + This method checks a number of document-wide requirements of the PDF/A + standard. The algorithms of some of these checks vary with the PDF/A + level and thus are implemented in subclasses; others are implemented + as private methods in this class. + + + + + + This method checks all requirements that must be fulfilled by a page in a + PDF/A document. + + the page that must be checked + + + + This method checks the requirements that must be fulfilled by a COS + object in a PDF/A document. + + the COS object that must be checked + + + + Gets the + + for this file. + + the defined conformance level for this document. + + + + Remembers which objects have already been checked, in order to avoid + redundant checks. + + the object to check + whether or not the object has already been checked + + + + This method checks compliance of the tag structure elements, such as struct elements + or parent tree entries. + + an object that represents tag structure element. + + + + This method checks compliance with the graphics state architectural + limitation, explained by + + . + + the operation to check the graphics state counter for + + + + This method checks compliance with the inline image restrictions in the + PDF/A specs, specifically filter parameters. + + + a + + containing the inline image + + + a + + containing the color spaces used in the document + + + + + This method checks compliance with the color restrictions imposed by the + available color spaces in the document. + + the color to check + + a + + containing the color spaces used in the document + + whether the color is used for fill or stroke operations + + + + This method performs a range of checks on the given color space, depending + on the type and properties of that color space. + + the color space to check + + a + + containing the color spaces used in the document + + whether or not to also check the parent color space + whether the color space is used for fill or stroke operations + + + + Checks whether the rendering intent of the document is within the allowed + range of intents. + + + Checks whether the rendering intent of the document is within the allowed + range of intents. This is defined in ISO 19005-1 section 6.2.9, and + unchanged in newer generations of the PDF/A specification. + + the intent to be analyzed + + + + Performs a number of checks on the graphics state, among others ISO + 19005-1 section 6.2.8 and 6.4 and ISO 19005-2 section 6.2.5 and 6.2.10. + + the graphics state to be checked + + + Performs a number of checks on the font. + + Performs a number of checks on the font. See ISO 19005-1 section 6.3, + ISO 19005-2 and ISO 19005-3 section 6.2.11. + Be aware that not all constraints defined in the ISO are checked in this method, + for most of them we consider that iText always creates valid fonts. + + font to be checked + + + Creates a PdfA1Checker with the required conformance level + + the required conformance level, a or + b + + + + + Creates a PdfA2Checker with the required conformance level + + the required conformance level, a or + u or b + + + + + PdfA3Checker defines the requirements of the PDF/A-3 standard and contains a + number of methods that override the implementations of its superclass + + . + The specification implemented by this class is ISO 19005-3 + + + + Creates a PdfA3Checker with the required conformance level + + the required conformance level, a or + u or b + + + + Exception that is thrown when the PDF Document doesn't adhere to the PDF/A specification. + + + Creates a PdfAConformanceException. + the error message + + + Creates a PdfAConformanceException. + the error message + an object + + + + This class extends + + and is in charge of creating files + that comply with the PDF/A standard. + Client code is still responsible for making sure the file is actually PDF/A + compliant: multiple steps must be undertaken (depending on the + + ) to ensure that the PDF/A standard is followed. + This class will throw exceptions, mostly + + , + and thus refuse to output a PDF/A file if at any point the document does not + adhere to the PDF/A guidelines specified by the + + . + + + + Constructs a new PdfADocument for writing purposes, i.e. + + Constructs a new PdfADocument for writing purposes, i.e. from scratch. A + PDF/A file has a conformance level, and must have an explicit output + intent. + + + the + + object to write to + + the generation and strictness level of the PDF/A that must be followed. + + a + + + + + Opens a PDF/A document in the stamping mode. + PDF reader. + PDF writer. + + + Open a PDF/A document in stamping mode. + PDF reader. + PDF writer. + properties of the stamping process + + + + Gets the PdfAConformanceLevel set in the constructor or in the metadata + of the + + . + + + a + + + + + + + + Utilities to construct an XMP for a PDF/A file. + + + diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.sign.dll b/src/packages/itext7.7.0.1/lib/net40/itext.sign.dll new file mode 100644 index 00000000000..4f45b9e272a Binary files /dev/null and b/src/packages/itext7.7.0.1/lib/net40/itext.sign.dll differ diff --git a/src/packages/itext7.7.0.1/lib/net40/itext.sign.xml b/src/packages/itext7.7.0.1/lib/net40/itext.sign.xml new file mode 100644 index 00000000000..71ee652616e --- /dev/null +++ b/src/packages/itext7.7.0.1/lib/net40/itext.sign.xml @@ -0,0 +1,2444 @@ + + + + itext.sign + + + + + Class containing static methods that allow you to get information from + an X509 Certificate: the issuer and the subject. + + + + Get the issuer fields from an X509 Certificate. + an X509Certificate + an X500Name + + + Get the "issuer" from the TBSCertificate bytes that are passed in. + a TBSCertificate in a byte array + an ASN1Primitive + + + Get the subject fields from an X509 Certificate. + an X509Certificate + an X500Name + + + Get the "subject" from the TBSCertificate bytes that are passed in. + A TBSCertificate in a byte array + a ASN1Primitive + + + Class that holds an X509 name. + + + Country code - StringType(SIZE(2)). + + + Organization - StringType(SIZE(1..64)). + + + Organizational unit name - StringType(SIZE(1..64)). + + + Title. + + + Common name - StringType(SIZE(1..64)). + + + Device serial number name - StringType(SIZE(1..64)). + + + Locality name - StringType(SIZE(1..64)). + + + State, or province name - StringType(SIZE(1..64)). + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Email address (RSA PKCS#9 extension) - IA5String. + + Email address (RSA PKCS#9 extension) - IA5String. +

    Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.

    +
    +
    + + Email address in Verisign certificates. + + + Object identifier. + + + LDAP User id. + + + A Map with default symbols. + + + A Map with values. + + + Constructs an X509 name. + an ASN1 Sequence + + + Constructs an X509 name. + a directory name + + + Gets the first entry from the field array retrieved from the values Map. + the field name + the (first) field value + + + Gets a field array from the values Map. + + List + + + Getter for values. + Map with the fields of the X509 name + + + Class for breaking up an X500 Name into it's component tokens, similar to java.util.StringTokenizer. + + + Class for breaking up an X500 Name into it's component tokens, similar to java.util.StringTokenizer. + We need this class as some of the lightweight Java environments don't support classes such as StringTokenizer. + + + + Creates an X509NameTokenizer. + the oid that needs to be parsed + + + Checks if the tokenizer has any tokens left. + true if there are any tokens left, false if there aren't + + + Returns the next token. + the next token + + + + This class contains a series of static methods that + allow you to retrieve information from a Certificate. + + + + Gets a CRL from a certificate + + the CRL or null if there's no CRL available + + + + + + Gets the URL of the Certificate Revocation List for a Certificate + the Certificate + the String where you can check if the certificate was revoked + + + + + Gets the CRL object using a CRL URL. + the URL where to get the CRL + a CRL object + + + + + + Retrieves the OCSP URL from the given certificate. + the certificate + the URL or null + + + + Gets the URL of the TSA if it's available on the certificate + a certificate + a TSA URL + + + + the certificate from which we need the ExtensionValue + the Object Identifier value for the extension. + the extension value as an ASN1Primitive object + + + + Gets a String from an ASN1Primitive + the ASN1Primitive + a human-readable String + + + + This class consists of some methods that allow you to verify certificates. + + + Verifies a single certificate for the current date. + the certificate to verify + the certificate revocation list or null + + a String with the error description or null + if no error + + + + Verifies a single certificate. + the certificate to verify + the certificate revocation list or null + the date, shall not be null + + a String with the error description or null + if no error + + + + Verifies a certificate chain against a KeyStore for the current date. + the certificate chain + the KeyStore + the certificate revocation list or null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore. + the certificate chain + the KeyStore + the certificate revocation list or null + the date, shall not be null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore for the current date. + the certificate chain + the KeyStore + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore. + the certificate chain + the KeyStore + the date, shall not be null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies an OCSP response against a KeyStore. + the OCSP response + the KeyStore + the provider or null to use the BouncyCastle provider + true is a certificate was found + + + Verifies a time stamp against a KeyStore. + the time stamp + the KeyStore + the provider or null to use the BouncyCastle provider + true is a certificate was found + + + + Superclass for a series of certificate verifiers that will typically + be used in a chain. + + + Superclass for a series of certificate verifiers that will typically + be used in a chain. It wraps another CertificateVerifier + that is the next element in the chain of which the verify() + method will be called. + + + + The previous CertificateVerifier in the chain of verifiers. + + + Indicates if going online to verify a certificate is allowed. + + + Creates the final CertificateVerifier in a chain of verifiers. + the previous verifier in the chain + + + Decide whether or not online checking is allowed. + + + + + Checks the validity of the certificate, and calls the next + verifier in the chain, if any. + + the certificate that needs to be checked + its issuer + the date the certificate needs to be valid + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + An implementation of the CrlClient that handles offline + Certificate Revocation Lists. + + Paulo Soares + + + + Interface that needs to be implemented if you want to embed + Certificate Revocation Lists (CRL) into your PDF. + + Paulo Soares + + + Gets an encoded byte array. + The certificate which a CRL URL can be obtained from. + A CRL url if you don't want to obtain it from the certificate. + A collection of byte array each representing a crl. It may return null or an empty collection. + + + The CRL as a byte array. + + + + Creates an instance of a CrlClient in case you + have a local cache of the Certificate Revocation List. + + the CRL bytes + + + + Creates an instance of a CrlClient in case you + have a local cache of the Certificate Revocation List. + + a CRL object + + + Returns the CRL bytes (the parameters are ignored). + + + + + An implementation of the CrlClient that fetches the CRL bytes + from an URL. + + Paulo Soares + + + The Logger instance. + + + The URLs of the CRLs. + + + + Creates a CrlClientOnline instance that will try to find + a single CRL by walking through the certificate chain. + + + + Creates a CrlClientOnline instance using one or more URLs. + + + Creates a CrlClientOnline instance using one or more URLs. + + + Creates a CrlClientOnline instance using a certificate chain. + + + Adds an URL to the list of CRL URLs + an URL in the form of a String + + + Adds an URL to the list of CRL URLs + an URL object + + + Fetches the CRL bytes from an URL. + + Fetches the CRL bytes from an URL. + If no url is passed as parameter, the url will be obtained from the certificate. + If you want to load a CRL from a local file, subclass this method and pass an + URL with the path to the local file to this method. An other option is to use + the CrlClientOffline class. + + + + + + Class that allows you to verify a certificate against + one or more Certificate Revocation Lists. + + + + + Verifies a certificate against a KeyStore + containing trusted anchors. + + + + A key store against which certificates can be verified. + + + Creates a RootStoreVerifier in a chain of verifiers. + the next verifier in the chain + + + Sets the Key Store against which a certificate can be checked. + a root store + + + Verifies a single certificate against a key store (if present). + the certificate to verify + the issuer certificate + the date the certificate needs to be valid + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + The Logger instance + + + The list of CRLs to check for revocation date. + + + Creates a CRLVerifier instance. + the next verifier in the chain + a list of CRLs + + + Verifies if a a valid CRL is found for the certificate. + + Verifies if a a valid CRL is found for the certificate. + If this method returns false, it doesn't mean the certificate isn't valid. + It means we couldn't verify it against any CRL that was available. + + the certificate that needs to be checked + its issuer + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Verifies a certificate against a single CRL. + the Certificate Revocation List + a certificate that needs to be verified + its issuer + the sign date + true if the verification succeeded + + + + Fetches a CRL for a specific certificate online (without further checking). + the certificate + its issuer + an X509CRL object + + + Checks if a CRL verifies against the issuer certificate or a trusted anchor. + the CRL + the trusted anchor + true if the CRL can be trusted + + + Class that contains a map with the different message digest algorithms. + + + Algorithm available for signatures since PDF 1.3. + + + Algorithm available for signatures since PDF 1.6. + + + Algorithm available for signatures since PDF 1.7. + + + Algorithm available for signatures since PDF 1.7. + + + Algorithm available for signatures since PDF 1.7. + + + Maps the digest IDs with the human-readable name of the digest algorithm. + + + Maps digest algorithm that are unknown by the JDKs MessageDigest object to a known one. + + + Maps the name of a digest algorithm with its ID. + + + Get a digest algorithm. + oid of the digest algorithm + the provider you want to use to create the hash + MessageDigest object + + + + + Creates a MessageDigest object that can be used to create a hash. + the algorithm you want to use to create a hash + the provider you want to use to create the hash + a MessageDigest object + + + + + Creates a hash using a specific digest algorithm and a provider. + the message of which you want to create a hash + the algorithm used to create the hash + the provider used to create the hash + the hash + + + + + Create a digest based on the inputstream. + data to be digested + algorithm to be used + digest of the data + + + + + Gets the digest name for a certain id + an id (for instance "1.2.840.113549.2.5") + a digest name (for instance "MD5") + + + + Returns the id of a digest algorithms that is allowed in PDF, + or null if it isn't allowed. + + The name of the digest algorithm. + An oid. + + + Class that contains a map with the different encryption algorithms. + + + Maps IDs of encryption algorithms with its human-readable name. + + + Gets the algorithm name for a certain id. + an id (for instance "1.2.840.113549.1.1.1") + an algorithm name (for instance "RSA") + + + Produces a blank (or empty) signature. + + Produces a blank (or empty) signature. Useful for deferred signing with + MakeSignature.signExternalContainer(). + + Paulo Soares + + + Interface to sign a document. + Interface to sign a document. The signing is fully done externally, including the container composition. + + Paulo Soares + + + Produces the container with the signature. + the data to sign + a container with the signature and other objects, like CRL and OCSP. The container will generally be a PKCS7 one. + + + + + Modifies the signature dictionary to suit the container. + + Modifies the signature dictionary to suit the container. At least the keys + + and + + will have to be set. + + the signature dictionary + + + Creates an ExternalBlankSignatureContainer. + PdfDictionary containing signature iformation. /SubFilter and /Filter aren't set in this constructor. + + + + Creates an ExternalBlankSignatureContainer. + + Creates an ExternalBlankSignatureContainer. This constructor will create the PdfDictionary for the + signature information and will insert the /Filter and /SubFilter values into this dictionary. + + PdfName of the signature handler to use when validating this signature + PdfName that describes the encoding of the signature + + + + + + Interface that needs to be implemented to do the actual signing. + + Interface that needs to be implemented to do the actual signing. + For instance: you'll have to implement this interface if you want + to sign a PDF using a smart card. + + Paulo Soares + + + Returns the hash algorithm. + The hash algorithm (e.g. "SHA-1", "SHA-256,..."). + + + Returns the encryption algorithm used for signing. + The encryption algorithm ("RSA" or "DSA"). + + + + Signs the given message using the encryption algorithm in combination + with the hash algorithm. + + The message you want to be hashed and signed. + A signed message digest. + + + + Interface for the Online Certificate Status Protocol (OCSP) Client. + + + Gets an encoded byte array with OCSP validation. + Gets an encoded byte array with OCSP validation. The method should not throw an exception. + Certificate to check. + The parent certificate. + + The url to get the verification. It it's null it will be taken. + from the check cert or from other implementation specific source + + A byte array with the validation or null if the validation could not be obtained + + + + Get the time stamp estimated token size. + + Get the time stamp estimated token size. + Implementation must return value large enough to accommodate the + entire token returned by + + prior + to actual + + call. + + an estimate of the token size + + + + Returns the + + to digest the data imprint + + + The + + object. + + + + + Returns RFC 3161 timeStampToken. + + Returns RFC 3161 timeStampToken. + Method may return null indicating that timestamp should be skipped. + + byte[] - data imprint to be time-stamped + byte[] - encoded, TSA signed data of the timeStampToken + - TSA request failed + + + + Interface you can implement and pass to TSAClientBouncyCastle in case + you want to do something with the information returned + + + + + When a timestamp is created using TSAClientBouncyCastle, + this method is triggered passing an object that contains + info about the timestamp and the time stamping authority. + + a TimeStampTokenInfo object + + + Add verification according to PAdES-LTV (part 4). + Paulo Soares + + + The verification constructor. + + The verification constructor. This class should only be created with + PdfStamper.getLtvVerification() otherwise the information will not be + added to the Pdf. + + + The + + to apply the validation to. + + + + Add verification for a particular signature. + the signature to validate (it may be a timestamp) + the interface to get the OCSP + the interface to get the CRL + options as to how many certificates to include + the validation options to include + certificate inclusion options + true if a validation was generated, false otherwise + + + + + Get the issuing certificate for a child certificate. + the certificate for which we search the parent + an array with certificates that contains the parent + the parent certificate + + + Adds verification to the signature. + name of the signature + collection of ocsp responses + collection of crls + collection of certificates + boolean + + + + + + + + + + + + + + + Merges the validation with any validation already in the document or creates a new one. + + + + + + + + + + + + + Converts an array of bytes to a String of hexadecimal values + a byte array + the same bytes expressed as hexadecimal values + + + What type of verification to include. + + + Options for how many certificates to include. + + + + Certificate inclusion in the DSS and VRI dictionaries in the CERT and CERTS + keys. + + + + Verifies the signatures in an LTV document. + + + The Logger instance + + + Option to specify level of verification; signing certificate only or the entire chain. + + + Verify root. + + + A document object for the revision that is being verified. + + + The fields in the revision that is being verified. + + + The date the revision was signed, or null for the highest revision. + + + The signature that covers the revision. + + + The PdfPKCS7 object for the signature. + + + Indicates if we're working with the latest revision. + + + The document security store for the revision that is being verified + + + Creates a VerificationData object for a PdfReader + The document we want to verify. + + + + Sets an extra verifier. + the verifier to set + + + Sets the certificate option. + Either CertificateOption.SIGNING_CERTIFICATE (default) or CertificateOption.WHOLE_CHAIN + + + + Set the verifyRootCertificate to false if you can't verify the root certificate. + + + + Checks if the signature covers the whole document + and throws an exception if the document was altered + + a PdfPKCS7 object + + + + Verifies all the document-level timestamps and all the signatures in the document. + + + + + Verifies a document level timestamp. + + + + + + Checks the certificates in a certificate chain: + are they valid on a specific date, and + do they chain up correctly? + + the certificate chain + + + + Verifies certificates against a list of CRLs and OCSP responses. + the signing certificate + the issuer's certificate + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Switches to the previous revision. + + + + + Gets a list of X509CRL objects from a Document Security Store. + a list of CRLs + + + + + Gets OCSP responses from the Document Security Store. + a list of BasicOCSPResp objects + + + + + OcspClient implementation using BouncyCastle. + Paulo Soarees + + + The Logger instance. + + + + Create + OcspClient + + + will be used for response verification. + OCSPVerifier + . + + + + Gets OCSP response. + + Gets OCSP response. If + OCSPVerifier + was setted, the response will be checked. + + + + Gets an encoded byte array with OCSP validation. + Gets an encoded byte array with OCSP validation. The method should not throw an exception. + to certificate to check + the parent certificate + + to get the verification. It it's null it will be taken + from the check cert or from other implementation specific source + + a byte array with the validation or null if the validation could not be obtained + + + Generates an OCSP request using BouncyCastle. + certificate of the issues + serial number + an OCSP request + + + + + + + + + + + + + + Class that allows you to verify a certificate against + one or more OCSP responses. + + + + The Logger instance + + + The list of OCSP responses. + + + Creates an OCSPVerifier instance. + the next verifier in the chain + a list of OCSP responses + + + Verifies if a a valid OCSP response is found for the certificate. + + Verifies if a a valid OCSP response is found for the certificate. + If this method returns false, it doesn't mean the certificate isn't valid. + It means we couldn't verify it against any OCSP response that was available. + + the certificate that needs to be checked + its issuer + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Verifies a certificate against a single OCSP response + the OCSP response + the certificate that needs to be checked + the certificate of CA + sign date + + + + , in case successful check, otherwise false. + + + + + + + Verifies if an OCSP response is genuine + If it doesn't verify against the issuer certificate and response's certificates, it may verify + using a trusted anchor or cert. + + the OCSP response + the issuer certificate + + + + + Verifies if the response is valid. + + Verifies if the response is valid. + If it doesn't verify against the issuer certificate and response's certificates, it may verify + using a trusted anchor or cert. + NOTE. Use + isValidResponse() + instead. + + the response object + the issuer certificate + true if the response can be trusted + + + Checks if an OCSP response is genuine + the OCSP response + the responder certificate + true if the OCSP response verifies against the responder certificate + + + + Gets an OCSP response online and returns it if the status is GOOD + (without further checking!). + + the signing certificate + the issuer certificate + an OCSP response + + + + This class does all the processing related to signing + and verifying a PKCS#7 signature. + + + + Assembles all the elements needed to create a signature, except for the data. + the private key + the certificate chain + the interface digest + the hash algorithm + the provider or null for the default provider + true if the sub-filter is adbe.pkcs7.sha1 + on error + on error + on error + + + Use this constructor if you want to verify a signature using the sub-filter adbe.x509.rsa_sha1. + the /Contents key + the /Cert key + the provider or null for the default provider + + + Use this constructor if you want to verify a signature. + the /Contents key + the filtersubtype + the provider or null for the default provider + + + Holds value of property signName. + + + Holds value of property reason. + + + Holds value of property location. + + + Holds value of property signDate. + + + Getter for property sigName. + Value of property sigName. + + + Setter for property sigName. + New value of property sigName. + + + Getter for property reason. + Value of property reason. + + + Setter for property reason. + New value of property reason. + + + Getter for property location. + Value of property location. + + + Setter for property location. + New value of property location. + + + Getter for property signDate. + Value of property signDate. + + + Setter for property signDate. + New value of property signDate. + + + Version of the PKCS#7 object + + + Version of the PKCS#7 "SignerInfo" object. + + + Get the version of the PKCS#7 object. + the version of the PKCS#7 object. + + + Get the version of the PKCS#7 "SignerInfo" object. + the version of the PKCS#7 "SignerInfo" object. + + + The ID of the digest algorithm, e.g. + The ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1". + + + The object that will create the digest + + + The digest algorithms + + + The digest attributes + + + Getter for the ID of the digest algorithm, e.g. + Getter for the ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1" + + + Returns the name of the digest algorithm, e.g. + Returns the name of the digest algorithm, e.g. "SHA256". + the digest algorithm name, e.g. "SHA256" + + + The encryption algorithm. + + + Getter for the digest encryption algorithm + + + Get the algorithm used to calculate the message digest, e.g. + Get the algorithm used to calculate the message digest, e.g. "SHA1withRSA". + the algorithm used to calculate the message digest + + + The signed digest if created outside this class + + + External RSA data + + + Sets the digest/signature to an external calculated value. + the digest. This is the actual signature + the extra data that goes into the data tag in PKCS#7 + + the encryption algorithm. It may must be null if the digest + is also null. If the digest is not null + then it may be "RSA" or "DSA" + + + + Class from the Java SDK that provides the functionality of a digital signature algorithm. + + + The signed digest as calculated by this class (or extracted from an existing PDF) + + + The RSA data + + + + + + + + + + + + + Update the digest with the specified bytes. + + Update the digest with the specified bytes. + This method is used both for signing and verifying + + the data buffer + the offset in the data buffer + the data length + on error + + + Gets the bytes for the PKCS#1 object. + a byte array + + + Gets the bytes for the PKCS7SignedData object. + the bytes for the PKCS7SignedData object + + + Gets the bytes for the PKCS7SignedData object. + + Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes + in the signerInfo can also be set. If either of the parameters is null, none will be used. + + the digest in the authenticatedAttributes + the bytes for the PKCS7SignedData object + + + Gets the bytes for the PKCS7SignedData object. + + Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes + in the signerInfo can also be set, OR a time-stamp-authority client + may be provided. + + the digest in the authenticatedAttributes + TSAClient - null or an optional time stamp authority client + byte[] the bytes for the PKCS7SignedData object + + + + Added by Aiken Sam, 2006-11-15, modifed by Martin Brunecky 07/12/2007 + to start with the timeStampToken (signedData 1.2.840.113549.1.7.2). + + + Added by Aiken Sam, 2006-11-15, modifed by Martin Brunecky 07/12/2007 + to start with the timeStampToken (signedData 1.2.840.113549.1.7.2). + Token is the TSA response without response status, which is usually + handled by the (vendor supplied) TSA request/response interface). + + byte[] - time stamp token, DER encoded signedData + ASN1EncodableVector + + + + + + This method provides that encoding and the parameters must be + exactly the same as in + + . + + the content digest + the byte array representation of the authenticatedAttributes ready to be signed + + + Signature attributes + + + Signature attributes (maybe not necessary, but we use it as fallback) + + + encrypted digest + + + Indicates if a signature has already been verified + + + The result of the verification + + + Verify the digest. + true if the signature checks out, false otherwise + on error + + + + + + + Checks if the timestamp refers to this document. + true if it checks false otherwise + on error + + + All the X.509 certificates in no particular order. + + + All the X.509 certificates used for the main signature. + + + The X.509 certificate that is used to sign the digest. + + + Get all the X.509 certificates associated with this PKCS#7 object in no particular order. + + Get all the X.509 certificates associated with this PKCS#7 object in no particular order. + Other certificates, from OCSP for example, will also be included. + + the X.509 certificates associated with this PKCS#7 object + + + Get the X.509 sign certificate chain associated with this PKCS#7 object. + + Get the X.509 sign certificate chain associated with this PKCS#7 object. + Only the certificates used for the main signature will be returned, with + the signing certificate first. + + the X.509 certificates associated with this PKCS#7 object + + + Get the X.509 certificate actually used to sign the digest. + the X.509 certificate actually used to sign the digest + + + + Helper method that creates the collection of certificates + used for the main signature based on the complete list + of certificates and the sign certificate. + + + + Get the X.509 certificate revocation lists associated with this PKCS#7 object + the X.509 certificate revocation lists associated with this PKCS#7 object + + + Helper method that tries to construct the CRLs. + + + BouncyCastle BasicOCSPResp + + + Gets the OCSP basic response if there is one. + the OCSP basic response or null + + + Checks if OCSP revocation refers to the document signing certificate. + true if it checks, false otherwise + + + Helper method that creates the BasicOCSPResp object. + + + + + True if there's a PAdES LTV time stamp. + + + True if it's a CAdES signature type. + + + BouncyCastle TimeStampToken. + + + Check if it's a PAdES-LTV time stamp. + true if it's a PAdES-LTV time stamp, false otherwise + + + Gets the timestamp token if there is one. + the timestamp token or null + + + Gets the timestamp date + a date + + + Returns the filter subtype. + + + Returns the encryption algorithm + the name of an encryption algorithm + + + Represents the signature dictionary. + Paulo Soares + + + Creates new PdfSignature. + + + Creates new PdfSignature. + PdfName of the signature handler to use when validating this signature + PdfName that describes the encoding of the signature + + + Sets the /ByteRange. + an array of pairs of integers that specifies the byte range used in the digest calculation. A pair consists of the starting byte offset and the length + + + + Sets the /Contents value to the specified byte[]. + a byte[] representing the digest + + + Sets the /Cert value of this signature. + the byte[] representing the certificate chain + + + Sets the /Name of the person signing the document. + name of the person signing the document + + + Sets the /M value. + Sets the /M value. Should only be used if the time of signing is not available in the signature. + time of signing + + + Sets the /Location value. + physical location of signing + + + Sets the /Reason value. + reason for signing + + + + Sets the signature creator name in the + + dictionary. + + name of the signature creator + + + Sets the /ContactInfo value. + information to contact the person who signed this document + + + + Gets the + + instance if it exists, if + not it adds a new one and returns this. + + + + + + + + A dictionary that stores the name of the application that signs the PDF. + + + Creates a new PdfSignatureAppDictionary + + + Creates a new PdfSignatureAppDictionary. + PdfDictionary containing initial values + + + + Sets the signature created property in the Prop_Build dictionary's App + dictionary. + + String name of the application creating the signature + + + Provides convenient methods to make a signature appearance. + + Provides convenient methods to make a signature appearance. Use it in conjunction with + + . + + + + Extra space at the top. + + + Margin for the content inside the signature rectangle. + + + The document to be signed. + + + The page where the signature will appear. + + + + The coordinates of the rectangle for a visible signature, + or a zero-width, zero-height rectangle for an invisible signature. + + + + Rectangle that represent the position and dimension of the signature in the page. + + + Zero level of the signature appearance. + + + Second level of the signature appearance. + + + Form containing all layers drawn on top of each other. + + + The rendering mode chosen for visible signatures. + + + The reason for signing. + + + The caption for the reason for signing. + + + Holds value of property location. + + + The caption for the location of signing. + + + Holds value of the application that creates the signature. + + + The contact name of the signer. + + + Holds value of property signDate. + + + The signing certificate. + + + The image that needs to be used for a visible signature. + + + A background image for the text in layer 2. + + + The scaling to be applied to the background image. + + + The text that goes in Layer 2 of the signature appearance. + + + Font for the text in Layer 2. + + + Font size for the font of Layer 2. + + + + Indicates the field to be signed if it is already presented in the document + (signing existing field). + + + Indicates the field to be signed if it is already presented in the document + (signing existing field). Required for + + option. + + + + Indicates if we need to reuse the existing appearance as layer 0. + + + Creates a PdfSignatureAppearance. + PdfDocument + Rectangle of the appearance + Number of the page the appearance should be on + + + + Provides the page number of the signature field which this signature + appearance is associated with. + + + The page number of the signature field which this signature + appearance is associated with. + + + + + Sets the page number of the signature field which this signature + appearance is associated with. + + + The page number of the signature field which + this signature appearance is associated with. + + + + + Provides the rectangle that represent the position and dimension + of the signature field in the page. + + + the rectangle that represent the position and dimension + of the signature field in the page + + + + + Sets the rectangle that represent the position and dimension of + the signature field in the page. + + + The rectangle that represents the position and + dimension of the signature field in the page. + + + + Get Layer 0 of the appearance. + layer 0 + + + Get Layer 2 of the appearance. + layer 2 + + + Gets the rendering mode for this signature. + the rendering mode for this signature + + + Sets the rendering mode for this signature. + the rendering mode + + + Returns the signing reason. + reason for signing + + + Sets the signing reason. + signing reason. + + + Sets the caption for the signing reason. + A new signing reason caption + + + Returns the signing location. + signing location + + + Sets the signing location. + A new signing location + + + Sets the caption for the signing location. + A new signing location caption + + + Returns the signature creator. + The signature creator + + + Sets the name of the application used to create the signature. + A new name of the application signing a document + + + Returns the signing contact. + The signing contact + + + Sets the signing contact. + A new signing contact + + + Sets the certificate used to provide the text in the appearance. + + Sets the certificate used to provide the text in the appearance. + This certificate doesn't take part in the actual signing process. + + the certificate + + + Get the signing certificate. + the signing certificate + + + Gets the Image object to render. + the image + + + Sets the Image object to render when Render is set to RenderingMode.GRAPHIC or RenderingMode.GRAPHIC_AND_DESCRIPTION. + + image rendered. If null the mode is defaulted to RenderingMode.DESCRIPTION + + + Indicates that the existing appearances needs to be reused as layer 0. + + + Gets the background image for the layer 2. + the background image for the layer 2 + + + Sets the background image for the layer 2. + the background image for the layer 2 + + + Gets the scaling to be applied to the background image. + the scaling to be applied to the background image + + + Sets the scaling to be applied to the background image. + + Sets the scaling to be applied to the background image. If it's zero the image + will fully fill the rectangle. If it's less than zero the image will fill the rectangle but + will keep the proportions. If it's greater than zero that scaling will be applied. + In any of the cases the image will always be centered. It's zero by default. + + the scaling to be applied to the background image + + + Sets the signature text identifying the signer. + + the signature text identifying the signer. If null or not set + a standard description will be used + + + + Gets the signature text identifying the signer if set by setLayer2Text(). + the signature text identifying the signer + + + Gets the n2 and n4 layer font. + the n2 and n4 layer font + + + Sets the n2 and n4 layer font. + Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used. + the n2 and n4 font + + + Sets the n2 and n4 layer font size. + font size + + + Gets the visibility status of the signature. + the visibility status of the signature + + + + Returns the signature date. + the signature date + + + Sets the signature date. + A new signature date + + + Set the field name of the appearance. + name of the field + + + Signature rendering modes. + + + Dictionary that stores signature build properties. + Kwinten Pisman + + + Creates new PdfSignatureBuildProperties. + + + Creates new PdfSignatureBuildProperties with preset values. + PdfDictionary containing preset values + + + + Sets the signatureCreator property in the underlying + + dictionary. + + + + + + Gets the + + from this dictionary. If it + does not exist, it adds a new + + and + returns this instance. + + + + + + + + Takes care of the cryptographic options and appearances that form a signature. + + + Approval signature. + + + Author signature, no changes allowed. + + + Author signature, form filling allowed. + + + Author signature, form filling and annotations allowed. + + + The certification level. + + + The name of the field. + + + The file right before the signature is added (can be null). + + + The bytes of the file right before the signature is added (if raf is null). + + + Array containing the byte positions of the bytes that need to be hashed. + + + The PdfDocument. + + + The crypto dictionary. + + + Holds value of property signatureEvent. + + + OutputStream for the bytes of the document. + + + Outputstream that temporarily holds the output in memory. + + + Tempfile to hold the output temporarily. + + + Name and content of keys that can only be added in the close() method. + + + Indicates if the pdf document has already been pre-closed. + + + Signature field lock dictionary. + + + The signature appearance. + + + Holds value of property signDate. + + + Boolean to check if this PdfSigner instance has been closed already or not. + + + Creates a PdfSigner instance. + + Creates a PdfSigner instance. Uses a + + instead of a temporary file. + + PdfReader that reads the PDF file + OutputStream to write the signed PDF file + boolean to indicate whether the signing should happen in append mode or not + + + + Creates a PdfSigner instance. + + Creates a PdfSigner instance. Uses a + + instead of a temporary file. + + PdfReader that reads the PDF file + OutputStream to write the signed PDF file + File to which the output is temporarily written + boolean to indicate whether the signing should happen in append mode or not + + + + Gets the signature date. + Calendar set to the signature date + + + Sets the signature date. + the signature date + + + Provides access to a signature appearance object. + + Provides access to a signature appearance object. Use it to + customize the appearance of the signature. +

    + Be aware: +

      +
    • If you create new signature field (either use + + with + the name that doesn't exist in the document or don't specify it at all) then + the signature is invisible by default.
    • +
    • If you sign already existing field, then the signature appearance object + is modified to have all the properties (page num., rect etc.) consistent with + the state of the field (if you customized the appearance object + before the + + call you'll have to do it again)
    • +
    +

    +
    + + + + object. + +
    + + Returns the document's certification level. + + Returns the document's certification level. + For possible values see + + . + + The certified status. + + + Sets the document's certification level. + + a new certification level for a document. + Possible values are:
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    + +
    + + Gets the field name. + the field name + + + Returns the user made signature dictionary. + + Returns the user made signature dictionary. This is the dictionary at the /V key + of the signature field. + + The user made signature dictionary. + + + Getter for property signatureEvent. + Value of property signatureEvent. + + + Sets the signature event to allow modification of the signature dictionary. + the signature event + + + Gets a new signature field name that doesn't clash with any existing name. + A new signature field name. + + + Sets the name indicating the field to be signed. + + Sets the name indicating the field to be signed. The field can already be presented in the + document but shall not be signed. If the field is not presented in the document, it will be created. + + The name indicating the field to be signed. + + + Gets the PdfDocument associated with this instance. + the PdfDocument associated with this instance + + + Sets the PdfDocument. + + + Setter for the OutputStream. + + + Getter for the field lock dictionary. + Field lock dictionary. + + + Setter for the field lock dictionary. + + Setter for the field lock dictionary. +

    Be aware: if a signature is created on an existing signature field, + then its /Lock dictionary takes the precedence (if it exists).

    +
    + Field lock dictionary +
    + + Signs the document using the detached mode, CMS or CAdES equivalent. + + Signs the document using the detached mode, CMS or CAdES equivalent. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the certificate chain + the CRL list + the OCSP client + the Timestamp client + an implementation that provides the digest + the reserved size for the signature. It will be estimated if 0 + Either Signature.CMS or Signature.CADES + + +
    + + Sign the document using an external container, usually a PKCS7. + + Sign the document using an external container, usually a PKCS7. The signature is fully composed + externally, iText will just put the container inside the document. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the reserved size for the signature + + +
    + + Signs a document with a PAdES-LTV Timestamp. + + Signs a document with a PAdES-LTV Timestamp. The document is closed at the end. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the timestamp generator + + the signature name or null to have a name generated + automatically + + + +
    + + Signs a PDF where space was already reserved. + the original PDF + the field to sign. It must be the last field + the output PDF + + the signature container doing the actual signing. Only the + method ExternalSignatureContainer.sign is used + + + + + + Processes a CRL list. + a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it. + + a list of CrlClient implementations + a collection of CRL bytes that can be embedded in a PDF + + + Checks if the document is in the process of closing. + true if the document is in the process of closing, false otherwise + + + + Gets the document bytes that are hashable when using external signatures. + + Gets the document bytes that are hashable when using external signatures. + The general sequence is: + + , + + and + + . + + + The + + of bytes to be signed. + + + + + + Returns the underlying source. + The underlying source + + + + Adds keys to the signature dictionary that define the certification level and the permissions. + + Adds keys to the signature dictionary that define the certification level and the permissions. + This method is only used for Certifying signatures. + + the signature dictionary + + + Adds keys to the signature dictionary that define the field permissions. + + Adds keys to the signature dictionary that define the field permissions. + This method is only used for signatures that lock fields. + + the signature dictionary + + + Get the rectangle associated to the provided widget. + PdfWidgetAnnotation to extract the rectangle from + Rectangle + + + Get the page number associated to the provided widget. + PdfWidgetAnnotation from which to extract the page number + page number + + + Enum containing the Cryptographic Standards. + Enum containing the Cryptographic Standards. Possible values are "CMS" and "CADES". + + + An interface to retrieve the signature dictionary for modification. + + + Allows modification of the signature dictionary. + The signature dictionary + + + + Implementation of the + + interface that + can be used when you have a + + object. + + Paulo Soares + + + The private key object. + + + The hash algorithm. + + + The encryption algorithm (obtained from the private key) + + + + Creates a + + instance. + + + A + + object. + + A hash algorithm (e.g. "SHA-1", "SHA-256",...). + A security provider (e.g. "BC"). + + + + + + + + + + + + + A list of IDs that are used by the security classes + + + + A helper class that tells you more about the type of signature + (certification or approval) and the signature's DMP settings. + + + + Is the signature a cerification signature (true) or an approval signature (false)? + + + Is form filling allowed by this signature? + + + Is adding annotations allowed by this signature? + + + Does this signature lock specific fields? + + + + Creates an object that can inform you about the type of signature + in a signature dictionary as well as some of the permissions + defined by the signature. + + + + Getter to find out if the signature is a certification signature. + true if the signature is a certification signature, false for an approval signature. + + + Getter to find out if filling out fields is allowed after signing. + true if filling out fields is allowed + + + Getter to find out if adding annotations is allowed after signing. + true if adding annotations is allowed + + + Getter for the field lock actions, and fields that are impacted by the action + an Array with field names + + + + Class that contains a field lock action and + an array of the fields that are involved. + + + + Can be /All, /Exclude or /Include + + + An array of PdfString values with fieldnames + + + Creates a FieldLock instance + + + Getter for the field lock action. + + + Getter for the fields involved in the lock action. + + + toString method + + + Utility class that provides several convenience methods concerning digital signatures. + + + Creates a SignatureUtil instance. + + Creates a SignatureUtil instance. Sets the acroForm field to the acroForm in the PdfDocument. + iText will create a new AcroForm if the PdfDocument doesn't contain one. + + PdfDocument to be inspected + + + Verifies a signature. + + Verifies a signature. Further verification can be done on the returned + + object. + + the signature field name + the provider or null for the default provider + PdfPKCS7 object to continue the verification + + + Gets the signature dictionary, the one keyed by /V. + the field name + + the signature dictionary keyed by /V or null if the field is not + a signature + + + + Gets the field names that have signatures and are signed. + List containing the field names that have signatures and are signed + + + Gets the field names that have blank signatures. + List containing the field names that have blank signatures + + + Extracts a revision from the document. + the signature field name + an InputStream covering the revision. Returns null if it's not a signature field + + + + Checks if the signature covers the entire document or just part of it. + the signature field name + true if the signature covers the entire document, false if it doesn't + + + Checks whether a name exists as a signature field or not. + Checks whether a name exists as a signature field or not. It checks both signed fields and blank signatures. + + name of the field + boolean does the signature field exist + + + + Converts a + + to an array of longs + + PdfArray to be converted + long[] containing the PdfArray values + + + + + + + + Time Stamp Authority Client interface implementation using Bouncy Castle + org.bouncycastle.tsp package. + + + Time Stamp Authority Client interface implementation using Bouncy Castle + org.bouncycastle.tsp package. +

    + Created by Aiken Sam, 2006-11-15, refactored by Martin Brunecky, 07/15/2007 + for ease of subclassing. +

    +
    +
    + + The default value for the hash algorithm + + + The default value for the hash algorithm + + + The Logger instance. + + + URL of the Time Stamp Authority + + + TSA Username + + + TSA password + + + An interface that allows you to inspect the timestamp info. + + + Estimate of the received time stamp token + + + Hash algorithm + + + Creates an instance of a TSAClient that will use BouncyCastle. + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + + + Creates an instance of a TSAClient that will use BouncyCastle. + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + String - user(account) name + String - password + + + Constructor. + + Constructor. + Note the token size estimate is updated by each call, as the token + size is not likely to change (as long as we call the same TSA using + the same imprint length). + + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + String - user(account) name + String - password + int - estimated size of received time stamp token (DER encoded) + + + the tsaInfo to set + + + Get the token size estimate. + + Get the token size estimate. + Returned value reflects the result of the last succesfull call, padded + + an estimate of the token size + + + Gets the MessageDigest to digest the data imprint + the digest algorithm name + + + + Get RFC 3161 timeStampToken. + + Get RFC 3161 timeStampToken. + Method may return null indicating that timestamp should be skipped. + + data imprint to be time-stamped + encoded, TSA signed data of the timeStampToken + + + + + Get timestamp token - communications layer + - byte[] - TSA response, raw bytes (RFC 3161 encoded) + + + + An exception that is thrown when something is wrong with a certificate. + + + Creates a VerificationException + + + + Class that informs you that the verification of a Certificate + succeeded using a specific CertificateVerifier and for a specific + reason. + + + + The certificate that was verified successfully. + + + The CertificateVerifier that was used for verifying. + + + The reason why the certificate verified successfully. + + + Creates a VerificationOK object + the certificate that was successfully verified + the class that was used for verification + the reason why the certificate could be verified + + + Return a single String explaining which certificate was verified, how and why. + + +
    +
    diff --git a/src/packages/itext7.7.0.2/LICENSE.md b/src/packages/itext7.7.0.2/LICENSE.md new file mode 100644 index 00000000000..482d6c91c20 --- /dev/null +++ b/src/packages/itext7.7.0.2/LICENSE.md @@ -0,0 +1,36 @@ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License version 3 + as published by the Free Software Foundation with the addition of the + following permission added to Section 15 as permitted in Section 7(a): + FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY + ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT + OF THIRD PARTY RIGHTS + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + You should have received a copy of the GNU Affero General Public License + along with this program; if not, see http://www.gnu.org/licenses or write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA, 02110-1301 USA, or download the license from the following URL: + http://itextpdf.com/terms-of-use/ + + The interactive user interfaces in modified source and object code versions + of this program must display Appropriate Legal Notices, as required under + Section 5 of the GNU Affero General Public License. + + In accordance with Section 7(b) of the GNU Affero General Public License, + a covered work must retain the producer line in every PDF that is created + or manipulated using iText. + + You can be released from the requirements of the license by purchasing + a commercial license. Buying such a license is mandatory as soon as you + develop commercial activities involving the iText software without + disclosing the source code of your own applications. + These activities include: offering paid services to customers as an ASP, + serving PDFs on the fly in a web application, shipping iText with a closed + source product. + + For more information, please contact iText Software Corp. at this + address: sales@itextpdf.com diff --git a/src/packages/itext7.7.0.2/gnu-agpl-v3.0.md b/src/packages/itext7.7.0.2/gnu-agpl-v3.0.md new file mode 100644 index 00000000000..4ef32f08339 --- /dev/null +++ b/src/packages/itext7.7.0.2/gnu-agpl-v3.0.md @@ -0,0 +1,651 @@ +GNU Affero General Public License +================================= + +_Version 3, 19 November 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +## Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: **(1)** assert copyright on the software, and **(2)** offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions + +“This License” refers to version 3 of the GNU Affero General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that **(1)** displays an appropriate copyright notice, and **(2)** +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that **(a)** is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and **(b)** serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified +it, and giving a relevant date. +* **b)** The work must carry prominent notices stating that it is +released under this License and any conditions added under section 7. +This requirement modifies the requirement in section 4 to +“keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +* **d)** If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either **(1)** a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or **(2)** access to copy the +Corresponding Source from a network server at no charge. +* **c)** Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +* **d)** Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either **(1)** a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or **(2)** anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or +authors of the material; or +* **e)** Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated **(a)** +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and **(b)** permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either **(1)** cause the Corresponding Source to be so +available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license **(a)** in connection with copies of the covered work +conveyed by you (or copies made from those copies), or **(b)** primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +_END OF TERMS AND CONDITIONS_ + +## How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a “Source” link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +<>. diff --git a/src/packages/itext7.7.0.2/itext7.7.0.2.nupkg b/src/packages/itext7.7.0.2/itext7.7.0.2.nupkg new file mode 100644 index 00000000000..6422d141dd6 Binary files /dev/null and b/src/packages/itext7.7.0.2/itext7.7.0.2.nupkg differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.dll b/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.dll new file mode 100644 index 00000000000..d706f2d5961 Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.xml b/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.xml new file mode 100644 index 00000000000..aeef15d2b5e --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.barcodes.xml @@ -0,0 +1,2156 @@ + + + + itext.barcodes + + + + The minimum bar width. + + + + The bar multiplier for wide bars or the distance between + bars for Postnet and Planet. + + + + The text font. + The text font. null if no text. + + + + The size of the text or the height of the shorter bar + in Postnet. + + + + If positive, the text distance under the bars. + + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + + + The height of the bars. + + + The text alignment. + + + The optional checksum generation. + + + Shows the generated checksum in the the text. + + + + Show the start and stop character '*' in the text for + the barcode 39 or 'ABCD' for codabar. + + + + Generates extended barcode 39. + + + The code to generate. + + + Show the guard bars for barcode EAN. + + + The code type. + + + The ink spreading. + + + The alternate text to be used, if present. + + + Gets the minimum bar width. + the minimum bar width + + + Sets the minimum bar width. + the minimum bar width + + + Gets the bar multiplier for wide bars. + the bar multiplier for wide bars + + + Sets the bar multiplier for wide bars. + the bar multiplier for wide bars + + + Gets the text font. + Gets the text font. null if no text. + the text font. null if no text + + + Sets the text font. + the text font. Set to null to suppress any text + + + Sets the size of the text. + the size of the text + + + Gets the text baseline. + + Gets the text baseline. + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + the baseline. + + + Sets the text baseline. + + Sets the text baseline. + If positive, the text distance under the bars. If zero or negative, + the text distance above the bars. + + the baseline. + + + Gets the height of the bars. + the height of the bars + + + Sets the height of the bars. + the height of the bars + + + Gets the text alignment. + the text alignment + + + Sets the text alignment. + the text alignment + + + Gets the optional checksum generation. + the optional checksum generation + + + Setter for property generateChecksum. + New value of property generateChecksum. + + + Gets the property to show the generated checksum in the the text. + value of property checksumText + + + Sets the property to show the generated checksum in the the text. + new value of property checksumText + + + + Sets the property to show the start and stop character '*' in the text for + the barcode 39. + + value of property startStopText + + + + Gets the property to show the start and stop character '*' in the text for + the barcode 39. + + new value of property startStopText + + + Gets the property to generate extended barcode 39. + value of property extended. + + + Sets the property to generate extended barcode 39. + new value of property extended + + + Gets the code to generate. + the code to generate + + + Sets the code to generate. + the code to generate + + + Gets the property to show the guard bars for barcode EAN. + value of property guardBars + + + Sets the property to show the guard bars for barcode EAN. + new value of property guardBars + + + Gets the code type. + the code type + + + Sets the code type. + the code type + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Gets the amount of ink spreading. + the ink spreading + + + Sets the amount of ink spreading. + + Sets the amount of ink spreading. This value will be subtracted + to the width of each bar. The actual value will depend on the ink + and the printing medium. + + the ink spreading + + + Gets the alternate text. + the alternate text + + + Sets the alternate text. + + Sets the alternate text. If present, this text will be used instead of the + text derived from the supplied code. + + the alternate text + + + Creates a PdfFormXObject with the barcode. + Creates a PdfFormXObject with the barcode. Default bar color and text color will be used. + the XObject + + + + Creates a PdfFormXObject with the barcode. + the color of the bars. It can be null + the color of the text. It can be null + the XObject + + + + Make the barcode occupy the specified width. + + Make the barcode occupy the specified width. + Usually this is achieved by adjusting bar widths. + + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + The charset code change. + + + The charset code change. + + + The charset code change. + + + The code for UCC/EAN-128. + + + The start code. + + + The start code. + + + The start code. + + + The bars to generate the code. + + + The stop bars. + + + Creates new Barcode128 + + + Removes the FNC1 codes in the text. + the text to clean + the cleaned text + + + Gets the human readable text of a sequence of AI. + the text + the human readable text + + + + Converts the human readable text to the characters needed to + create a barcode using the specified code set. + + the text to convert + + true if it is an UCC/EAN-128. In this case + the character FNC1 is added + + forced code set, or AUTO for optimized barcode. + the code ready to be fed to getBarsCode128Raw() + + + + Converts the human readable text to the characters needed to + create a barcode. + + + Converts the human readable text to the characters needed to + create a barcode. Some optimization is done to get the shortest code. + + the text to convert + + true if it is an UCC/EAN-128. In this case + the character FNC1 is added + + the code ready to be fed to getBarsCode128Raw() + + + Generates the bars. + + Generates the bars. The input has the actual barcodes, not + the human readable text. + + the barcode + the bars + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Sets the code to generate. + + Sets the code to generate. If it's an UCC code and starts with '(' it will + be split by the AI. This code in UCC mode is valid: +

    + (01)00000090311314(10)ABC123(15)060916 + + the code to generate + + +

    + Returns true if the next numDigits + starting from index textIndex are numeric skipping any FNC1. + + the text to check + where to check from + the number of digits to check + the check result +
    + + Packs the digits for charset C also considering FNC1. + + Packs the digits for charset C also considering FNC1. It assumes that all the parameters + are valid. + + the text to pack + where to pack from + the number of digits to pack. It is always an even number + the packed digits, two digits per character + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + Places the barcode in a PdfCanvas. + + Places the barcode in a PdfCanvas. The + barcode is always placed at coordinates (0, 0). Use the + translation matrix to move it elsewhere. + + the PdfCanvas where the barcode will be placed + the foreground color. It can be null + the dimensions the barcode occupies + + + Creates a PdfFormXObject with the barcode. + + Creates a PdfFormXObject with the barcode. + Default foreground color will be used. + + the XObject. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + + The index chars to BARS, symbol * use only start and stop characters, + the * character will not appear in the input data. + + + + The character combinations to make the code 39 extended. + + + The bars to generate the code. + + + Creates a new Barcode39. + + + Creates the bars. + + the text to create the bars. This text does not include the start and + stop characters + + the bars + + + + Converts the extended text into a normal, escaped text, + ready to generate bars. + + the extended text + the escaped text + + + Calculates the checksum. + the text + the checksum + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + The index chars to BARS. + + + The bars to generate the code. + + + Creates a new BarcodeCodabar. + + + Creates the bars. + the text to create the bars + the bars + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + No error. + + + The text is too big for the symbology capabilities. + + + The dimensions given for the symbol are illegal. + + + An error while parsing an extension. + + + The best encodation will be used. + + + ASCII encodation. + + + C40 encodation. + + + TEXT encodation. + + + Binary encodation. + + + X21 encodation. + + + EDIFACT encodation. + + + No encodation needed. + No encodation needed. The bytes provided are already encoded. + + + Allows extensions to be embedded at the start of the text. + + + Doesn't generate the image but returns all the other information. + + + Creates an instance of this class. + + + Creates a PdfFormXObject with the barcode with given module width and module height. + the color of the pixels. It can be null + the side (width and height) of the pixels. + the XObject. + + + Gets the barcode size + + + Creates a barcode. + Creates a barcode. The String is interpreted with the ISO-8859-1 encoding + the text + + the status of the generation. It can be one of this values: +

    + DM_NO_ERROR - no error.
    + DM_ERROR_TEXT_TOO_BIG - the text is too big for the symbology capabilities.
    + DM_ERROR_INVALID_SQUARE - the dimensions given for the symbol are illegal.
    + DM_ERROR_EXTENSION - an error was while parsing an extension. + + + +

    Creates a barcode. + the text + the offset to the start of the text + the text size + + the status of the generation. It can be one of this values: +

    + DM_NO_ERROR - no error.
    + DM_ERROR_TEXT_TOO_BIG - the text is too big for the symbology capabilities.
    + DM_ERROR_INVALID_SQUARE - the dimensions given for the symbol are illegal.
    + DM_ERROR_EXTENSION - an error was while parsing an extension. + + + +

    Gets the height of the barcode. + + Gets the height of the barcode. Will contain the real height used after a successful call + to generate(). This height doesn't include the whitespace border, if any. + + the height of the barcode +
    + + + Gets the width of the barcode. + + Gets the width of the barcode. Will contain the real width used after a successful call + to generate(). This width doesn't include the whitespace border, if any. + + the width of the barcode + + + + Gets the whitespace border around the barcode. + the whitespace border around the barcode + + + Sets the whitespace border around the barcode. + the whitespace border around the barcode + + + Gets the barcode options. + the barcode options + + + + setting encoding for data matrix code ( default encoding iso-8859-1) + encoding for data matrix code + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + A type of barcode + + + The total number of bars for EAN13. + + + The total number of bars for EAN8. + + + The total number of bars for UPCE. + + + The total number of bars for supplemental 2. + + + The total number of bars for supplemental 5. + + + Marker for odd parity. + + + Marker for even parity. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The bar positions that are guard bars. + + + The x coordinates to place the text. + + + The x coordinates to place the text. + + + The basic bar widths. + + + Sequence of parities to be used with EAN13. + + + Sequence of parities to be used with supplemental 2. + + + Sequence of parities to be used with supplemental 2. + + + Sequence of parities to be used with UPCE. + + + Creates new BarcodeEAN + + + Calculates the EAN parity character. + the code + the parity character + + + Converts an UPCA code into an UPCE code. + + Converts an UPCA code into an UPCE code. If the code can not + be converted a null is returned. + + the code to convert. It must have 12 numeric characters + + the 8 converted digits or null if the + code could not be converted + + + + Creates the bars for the barcode EAN13 and UPCA. + the text with 13 digits + the barcode + + + Creates the bars for the barcode EAN8. + the text with 8 digits + the barcode + + + Creates the bars for the barcode UPCE. + the text with 8 digits + the barcode + + + Creates the bars for the barcode supplemental 2. + the text with 2 digits + the barcode + + + Creates the bars for the barcode supplemental 5. + the text with 5 digits + the barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + The barcode with the EAN/UPC. + + + The barcode with the supplemental. + + + Creates new combined barcode. + the EAN/UPC barcode + the supplemental barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Implements the code interleaved 2 of 5. + + Implements the code interleaved 2 of 5. The text can include + non numeric characters that are printed but do not generate bars. + The default parameters are: +
    +            x = 0.8f;
    +            n = 2;
    +            font = new PdfType1Font(document, new TYPE_1_FONT(FontConstants.HELVETICA, PdfEncodings.WINANSI));
    +            size = 8;
    +            baseline = size;
    +            barHeight = size * 3;
    +            textAlignment = ALIGN_CENTER;
    +            generateChecksum = false;
    +            checksumText = false;
    +            
    +
    +
    + + The bars to generate the code. + + + Creates new BarcodeInter25 + + + Deletes all the non numeric characters from text. + the text + a String with only numeric characters + + + Calculates the checksum. + the numeric text + the checksum + + + Creates the bars for the barcode. + the text. It can contain non numeric characters + the barcode + + + + Gets the maximum area that the barcode and the text, if + any, will occupy. + + + Gets the maximum area that the barcode and the text, if + any, will occupy. The lower left corner is always (0, 0). + + the size the barcode occupies. + + + + Auto-size is made based on aspectRatio and yHeight. + + + The size of the barcode will be at least codeColumns*codeRows. + + + + The size will be at least codeColumns + with a variable number of codeRows. + + + + + The size will be at least codeRows + with a variable number of codeColumns. + + + + + The error level correction is set automatically according + to ISO 15438 recommendations. + + + + The error level correction is set by the user. + The error level correction is set by the user. It can be 0 to 8. + + + One single binary segment is used + + + + No text interpretation is done and the content of codewords + is used directly. + + + + + Inverts the output bits of the raw bitmap that is normally + bit one for black. + + + Inverts the output bits of the raw bitmap that is normally + bit one for black. It has only effect for the raw bitmap. + + + + Use Macro PDF417 Encoding + + + + + + Holds value of property outBits. + + + Holds value of property bitColumns. + + + Holds value of property codeRows. + + + Holds value of property codeColumns. + + + Holds value of property codewords. + + + Holds value of property lenCodewords. + + + Holds value of property errorLevel. + + + Holds value of property code. + + + Holds value of property options. + + + Holds value of property aspectRatio. + + + Holds value of property yHeight. + + + Creates a new BarcodePDF417 with the default settings. + + + Sets the segment id for macro PDF417 encoding + the id (starting at 0) + + + + Sets the segment count for macro PDF417 encoding + the number of macro segments + + + + Sets the File ID for macro PDF417 encoding + the file id + + + + Set the default settings that correspond to PDF417_USE_ASPECT_RATIO + and PDF417_AUTO_ERROR_LEVEL. + + + + Paints the barcode. + Paints the barcode. If no exception was thrown a valid barcode is available. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + Creates a PdfFormXObject with the barcode with given module width and module height. + the color of the pixels. It can be null + the width of the pixels. + the height of the pixels. + the XObject. + + + Gets the raw image bits of the barcode. + + Gets the raw image bits of the barcode. The image will have to + be scaled in the Y direction by yHeight. + + The raw barcode image + + + Gets the number of X pixels of outBits. + the number of X pixels of outBits + + + Gets the number of Y pixels of outBits. + + Gets the number of Y pixels of outBits. + It is also the number of rows in the barcode. + + the number of Y pixels of outBits + + + Sets the number of barcode rows. + + Sets the number of barcode rows. This number may be changed + to keep the barcode valid. + + the number of barcode rows + + + Gets the number of barcode data columns. + he number of barcode data columns + + + Sets the number of barcode data columns. + + Sets the number of barcode data columns. + This number may be changed to keep the barcode valid. + + the number of barcode data columns + + + Gets the codeword array. + + Gets the codeword array. This array is always 928 elements long. + It can be written to if the option PDF417_USE_RAW_CODEWORDS + is set. + + the codeword array + + + Gets the length of the codewords. + the length of the codewords + + + Sets the length of the codewords. + the length of the codewords + + + Gets the error level correction used for the barcode. + + Gets the error level correction used for the barcode. It may different + from the previously set value. + + the error level correction used for the barcode + + + Sets the error level correction for the barcode. + the error level correction for the barcode + + + Gets the bytes that form the barcode. + + Gets the bytes that form the barcode. This bytes should + be interpreted in the codepage Cp437. + + the bytes that form the barcode + + + Sets the bytes that form the barcode. + + Sets the bytes that form the barcode. This bytes should + be interpreted in the codepage Cp437. + + the bytes that form the barcode + + + Sets the code that will form the barcode. + + Sets the code that will form the barcode. This text is converted + to bytes using the encoding Cp437. + + the text that will form the barcode + + + Gets the options to generate the barcode. + the options to generate the barcode + + + Sets the options to generate the barcode. + + Sets the options to generate the barcode. This can be all + the PDF417_* constants. + + the options to generate the barcode + + + Gets the barcode aspect ratio. + the barcode aspect ratio + + + Sets the barcode aspect ratio. + + Sets the barcode aspect ratio. A ratio or 0.5 will make the + barcode width twice as large as the height. + + the barcode aspect ratio + + + Gets the Y pixel height relative to X. + the Y pixel height relative to X + + + Sets the Y pixel height relative to X. + Sets the Y pixel height relative to X. It is usually 3. + the Y pixel height relative to X + + + The bars for each character. + + + Creates the bars for Postnet. + the code to be created without checksum + the bars + + + A QRCode implementation based on the zxing code. + + + modifiers to change the way the barcode is create. + + + Creates the QR barcode. + the text to be encoded + barcode hints. See #setHints for description. + + + + Creates the QR barcode with default error correction level (ErrorCorrectionLevel.L) + and default character set (ISO-8859-1). + + the text to be encoded + + + Gets the current data. + + + Sets the data to be encoded by the barcode. + Sets the data to be encoded by the barcode. If not specified in hints otherwise, the character set should be ISO-8859-1. + + + + modifiers to change the way the barcode is created. + + + + modifiers to change the way the barcode is created. They can be EncodeHintType.ERROR_CORRECTION + and EncodeHintType.CHARACTER_SET. For EncodeHintType.ERROR_CORRECTION the values can be ErrorCorrectionLevel.L, M, Q, H. + For EncodeHintType.CHARACTER_SET the values are strings and can be Cp437, Shift_JIS and ISO-8859-1 to ISO-8859-16. + You can also use UTF-8, but correct behaviour is not guaranteed as Unicode is not supported in QRCodes. + The default value is ISO-8859-1. + + + + Regenerates barcode after changes in hints or code. + + + Gets the size of the barcode grid + + + Gets the barcode size + + + * Places the barcode in a PdfCanvas. + + * Places the barcode in a PdfCanvas. The + barcode is always placed at coordinates (0, 0). Use the + translation matrix to move it elsewhere. + + the PdfCanvas where the barcode will be placed + the foreground color. It can be null + the size of the square grid cell + the dimensions the barcode occupies + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the XObject. + + + Creates a PdfFormXObject with the barcode. + the color of the pixels. It can be null + the size of the pixels. + the XObject. + + + Creates a DM code parameter block + total height + total width + height of a single section + width of a single section + size of the data + size of a data-block + size of a error-correction block + + + Execute the placement + number of rows + number of columns + array containing appropriate values for ECC200 + + + Calculates the error correction code for the given parameters. + bytearray containing the data + size of the data + size of a datablock + size of a errorblock + + +

    A simple, fast array of bits, represented compactly by an array of ints internally.

    + Sean Owen +
    + + bit to get. + true iff bit i is set + + + Sets bit i. + bit to set + + + Flips bit i. + bit to set + + + Sets a block of 32 bits, starting at bit i. + first bit to set + + the new value of the next 32 bits. Note again that the least-significant bit + corresponds to bit i, the next-least-significant to i+1, and so on. + + + + Clears all bits (sets to false). + + + Efficient method to check if a range of bits is set, or not set. + start of range, inclusive. + end of range, exclusive + if true, checks that bits in range are set, otherwise checks that they are not set + true iff all bits are set or not set in range, according to value argument + if end is less than or equal to start + + + + underlying array of ints. The first element holds the first 32 bits, and the least + significant bit is bit 0. + + + + Reverses all bits in the array. + + + +

    Gets the requested bit, where true means black.

    + The horizontal component (i.e. which column) + The vertical component (i.e. which row) + value of given bit in matrix +
    + +

    Sets the given bit to true.

    + The horizontal component (i.e. which column) + The vertical component (i.e. which row) +
    + +

    Flips the given bit.

    + The horizontal component (i.e. which column) + The vertical component (i.e. which row) +
    + + Clears all bits (sets to false). + + +

    Sets a square region of the bit matrix to true.

    + The horizontal position to begin at (inclusive) + The vertical position to begin at (inclusive) + The width of the region + The height of the region +
    + + A fast method to retrieve one row of data from the matrix as a BitArray. + The row to retrieve + An optional caller-allocated BitArray, will be allocated if null or too small + + The resulting BitArray - this reference should always be used even when passing + your own row + + + + The width of the matrix + + + The height of the matrix + + + This method is for compatibility with older code. + + This method is for compatibility with older code. It's only logical to call if the matrix + is square, so I'm throwing if that's not the case. + + row/column dimension of this matrix + + + + JAVAPORT: This should be combined with BitArray in the future, although that class is not yet + dynamically resizeable. + + + JAVAPORT: This should be combined with BitArray in the future, although that class is not yet + dynamically resizeable. This implementation is reasonable but there is a lot of function calling + in loops I'd like to get rid of. + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + Create a bitvector usng the default size + + + Return the bit value at "index". + index in the vector + bit value at "index" + + + the number of bits in the bit vector. + + + the number of bytes in the bit vector. + + + Append the a bit to the bit vector + 0 or 1 + + + Append "numBits" bits in "value" to the bit vector. + + Append "numBits" bits in "value" to the bit vector. + Examples: + - appendBits(0x00, 1) adds 0. + - appendBits(0x00, 4) adds 0000. + - appendBits(0xff, 8) adds 11111111. + + int interpreted as bitvector + 0<= numBits <= 32. + + + Append a different BitVector to this BitVector + BitVector to append + + + XOR the contents of this bitvector with the contetns of "other" + Bitvector of equal length + + + String representation of the bitvector + + + + Callers should not assume that array.length is the exact number of bytes needed to hold + sizeInBits - it will typically be larger for efficiency. + + size of the array containing the bitvector + + + + Add a new byte to the end, possibly reallocating and doubling the size of the array if we've + run out of room. + + byte to add. + + + Helper class that groups a block of databytes with its corresponding block of error correction block + + + + data block of the pair + + + error correction block of the pair + + + This class implements an array of unsigned bytes. + dswitkin@google.com (Daniel Switkin) + + + Creates a new ByteArray instance with size 0. + + + Creates a new ByteArray instance of the specified size. + size of the array + + + Creates a new ByteArray instance based on an existing byte[]. + the byte[] + + + Access an unsigned byte at location index. + The index in the array to access. + The unsigned value of the byte as an int. + + + Set the value at "index" to "value" + position in the byte-array + new value + + + size of the array + + + true if size is equal to 0, false otherwise + + + Append a byte to the end of the array. + Append a byte to the end of the array. If the array is too small, it's capacity is doubled. + byte to append. + + + Increase the capacity of the array to "capacity" if the current capacity is smaller + the new capacity + + + Copy count bytes from array source starting at offset. + source of the copied bytes + offset to start at + number of bytes to copy + + + + Create a ByteMatix of given width and height, with the values initialized to 0 + width of the matrix + height of the matrix + + + height of the matrix + + + width of the matrix + + + Get the value of the byte at (x,y) + the width coordinate + the height coordinate + the byte value at position (x,y) + + + matrix as byte[][] + + + Set the value of the byte at (x,y) + the width coordinate + the height coordinate + the new byte value + + + Set the value of the byte at (x,y) + the width coordinate + the height coordinate + the new byte value + + + Resets the contents of the entire matrix to value + new value of every element + + + String representation + + + + Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1 + of ISO 18004. + + Sean Owen + + + name of the encoding. + + + the value of the encoding. + + + character set ECI encoding name + + + + representing ECI for character encoding, or null if it is legal + but unsupported + + + + These are a set of hints that you may pass to Writers to specify their behavior. + dswitkin@google.com (Daniel Switkin) + + + Specifies what degree of error correction to use, for example in QR Codes (type Integer). + + + Specifies what character encoding to use where applicable (type String) + + + Specifies the minimal version level to use, for example in QR Codes (type Integer). + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + + + + the code point of the table used in alphanumeric mode or + -1 if there is no corresponding code in the table. + + + + Choose the best mode by examining the content. + content to examine + mode to use + + + Choose the best mode by examining the content. + + Choose the best mode by examining the content. Note that 'encoding' is used as a hint; + if it is Shift_JIS, and the input is only double-byte Kanji, then we return + + + content to examine + hint for the encoding to use + mode to use + + + + + + Initialize "qrCode" according to "numInputBytes", "ecLevel", and "mode". + + Initialize "qrCode" according to "numInputBytes", "ecLevel", and "mode". On success, + modify "qrCode". + + + + + Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24). + + + + Get number of data bytes and number of error correction bytes for block id "blockID". + + Get number of data bytes and number of error correction bytes for block id "blockID". Store + the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of + JISX0510:2004 (p.30) + + + + + Interleave "bits" with corresponding error correction bytes. + + Interleave "bits" with corresponding error correction bytes. On success, store the result in + "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details. + + + + + Append mode info. + Append mode info. On success, store the result in "bits". + + + Append length info. + Append length info. On success, store the result in "bits". + + + + Append "bytes" in "mode" mode (encoding) into "bits". + Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits". + + + + + + + + + + + + + + L = ~7% correction + + + M = ~15% correction + + + Q = ~25% correction + + + H = ~30% correction + + + Gets the ordinal value. + the ordinal + + + int containing the two bits encoding a QR Code's error correction level + + + + representing the encoded error correction level + + + + +

    Encapsulates a QR Code's format information, including the data mask used and + error correction level.

    +
    + Sean Owen + +
    + + See ISO 18004:2006, Annex C, Table C.1 + + + Offset i holds the number of 1 bits in the binary representation of i + + + format info indicator, with mask still applied + + second copy of same info; both are checked at the same time + to establish best match + + + information about the format it specifies, or null + if doesn't seem to match any known pattern + + + + The datamask in byte-format + + + the hashcode of the QR-code format information + + + Compares the Format Information of this and o + object to compare to + True if o is a FormatInformationObject and the error-correction level and the datamask are equal, false otherwise + + + + + Create a representation of GF(256) using the given primitive polynomial. + + irreducible polynomial whose coefficients are represented by + the bits of an int, where the least-significant bit represents the constant + coefficient + + + + the monomial representing coefficient * x^degree + + + Implements both addition and subtraction -- they are the same in GF(256). + sum/difference of a and b + + + 2 to the power of a in GF(256) + + + base 2 log of a in GF(256) + + + multiplicative inverse of a + + + + + product of a and b in GF(256) + + + + + the + + instance representing the field to use + to perform computations + + + coefficients as ints representing elements of GF(256), arranged + from most significant (highest-power term) coefficient to least significant + + + if argument is null or empty, + or if leading coefficient is 0 and this is not a + constant polynomial (that is, it is not the monomial "0") + + + + degree of this polynomial + + + true iff this polynomial is the monomial "0" + + + coefficient of x^degree term in this polynomial + + + evaluation of this polynomial at a given point + + + GF addition or subtraction (they are identical for a GF(2^n) + the other GF-poly + new GF256Poly obtained by summing this GF and other + + + GF multiplication + the other GF-poly + new GF-poly obtained by multiplying this with other + + + GF scalar multiplication + scalar + new GF-poly obtained by multiplying every element of this with the scalar. + + + String representation of the Galois Field polynomial. + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + Apply mask penalty rule 1 and return the penalty. + + Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and + give penalty to them. Example: 00000 or 11111. + + ByteMatrix to apply the penalty rule to + the rule 1 penalty + + + Apply mask penalty rule 2 and return the penalty. + + Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give + penalty to them. + + ByteMatrix to apply the penalty rule to + the rule 2 penalty + + + Apply mask penalty rule 3 and return the penalty. + + Apply mask penalty rule 3 and return the penalty. Find consecutive cells of 00001011101 or + 10111010000, and give penalty to them. If we find patterns like 000010111010000, we give + penalties twice (i.e. 40 * 2). + + ByteMatrix to apply the penalty rule to + the rule 3 penalty + + + Apply mask penalty rule 4 and return the penalty. + + Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give + penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance. Examples: + - 0% => 100 + - 40% => 20 + - 45% => 10 + - 50% => 0 + - 55% => 10 + - 55% => 20 + - 100% => 100 + + Bytematrix to apply the rule to + the rule 4 penalty + + + Return the mask bit for "getMaskPattern" at "x" and "y". + + Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask + pattern conditions. + + masking pattern to use + width coordiante + height-coordinate + the mask bit at that position + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + Build 2D matrix of QR Code from "dataBits" with "ecLevel", "version" and "getMaskPattern". + + Build 2D matrix of QR Code from "dataBits" with "ecLevel", "version" and "getMaskPattern". On + success, store the result in "matrix". + + BitVector containing the databits + Error correction level of the QR code (L,M,Q,H) + Version of the QR code, [1 .. 40] + masking pattern + Bytematrix in which the output will be stored + + + + Embed basic patterns. + + Embed basic patterns. On success, modify the matrix. + The basic patterns are: + - Position detection patterns + - Timing patterns + - Dark dot at the left bottom corner + - Position adjustment patterns, if need be + + Version of the QR code, [1 .. 40] + Bytematrix in which the output will be stored + + + + Embed type information into the matrix + The error correction level (L,M,Q,H) + the masking pattern + Bytematrix in which the output will be stored + + + + Embed version information if need be. + + Embed version information if need be. + For version < 7, version info is not necessary + On success, the matrix is modified + See 8.10 of JISX0510:2004 (p.47) for how to embed version information. + + QR code version + Byte matrix representing the QR code + + + + + Embed "dataBits" using "getMaskPattern". + + Embed "dataBits" using "getMaskPattern". On success, the matrix is modified + For debugging purposes, it skips masking process if "getMaskPattern" is -1. + See 8.7 of JISX0510:2004 (p.38) for how to embed data bits. + + data bits to embed in the QR code + masking pattern to apply to the data bits + Byte matrix representing the QR code + + + + + Return the position of the most significant bit set (to one) in the "value". + + Return the position of the most significant bit set (to one) in the "value". + The most significant bit is position 32. If there is no bit set, return 0. Examples: + - findMSBSet(0) => 0 + - findMSBSet(1) => 1 + - findMSBSet(255) => 8 + + bitstring as integer + the position of the most significant bit set to 1 in the bit-representation of value + + + + Make bit vector of type information. + + Make bit vector of type information. On success, store the result in "bits". + Encode error correction level and mask pattern. See 8.9 of JISX0510:2004 (p.45) for details. + + error correction level of the QR code + masking pattern to use + Vactor of bits to contain the result + + + + + Make bit vector of version information. + + Make bit vector of version information. On success, store the result in "bits". + See 8.10 of JISX0510:2004 (p.45) for details. + + Version of the QR-code + Vector of bits to contain the result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + four bits encoding a QR Code data mode + + + + encoded by these bits + + if bits do not correspond to a known mode + + + version in question + + number of bits used, in this QR Code symbol + + , to encode the + count of characters that will follow encoded in this + + + + + the bits of the mode + + + the name of the mode. + + + the name of the mode. + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + Create a QR-code object with unitialized parameters + + + Mode used by the QR code to encode data into bits. + + Mode used by the QR code to encode data into bits. + Possible values: TERMINATOR, NUMERIC, ALPHANUMERIC, STRUCTURED_APPEND, BYTE, ECI, KANJI, FNC1_FIRST_POSITION, FNC2_SECOND_POSITION + + Mode of the QR Code. + + + Possible error correction level values ranked from lowest error correction capability to highest: L, M, Q, H + + Error correction level of the QR Code. + + + Together with error correction level, the version determines the information capacity of the QR code. + + Together with error correction level, the version determines the information capacity of the QR code. Higher version numbers correspond with higher capacity. Ranges from 1 to 40. + + Version of the QR Code. + + + ByteMatrix width of the QR Code. + + + Mask pattern of the QR Code. + + + Number of total bytes in the QR Code. + + + Number of data bytes in the QR Code. + + + Number of error correction bytes in the QR Code. + + + Number of Reedsolomon blocks in the QR Code. + + + ByteMatrix data of the QR Code. + + + Retrieve the value of the module (cell) pointed by "x" and "y" in the matrix of the QR Code. + + Retrieve the value of the module (cell) pointed by "x" and "y" in the matrix of the QR Code. + 1 represents a black cell, and 0 represents a white cell. + + width coordinate + height coordinate + 1 for a black cell, 0 for a white cell + + + Check the validity of all member variables + true if all variables are valid, false otherwise + + + Prints all parameters + string containing all parameters + + + + Set the data encoding mode of the QR code + Possible modes: TERMINATOR, NUMERIC, ALPHANUMERIC, STRUCTURED_APPEND, BYTE, ECI, KANJI, FNC1_FIRST_POSITION, FNC2_SECOND_POSITION + + new data encoding mode + + + Set the error correction level of th QR code. + + Set the error correction level of th QR code. + Possible error correction level values ranked from lowest error correction capability to highest: L, M, Q, H + + new error correction level + + + Set the version of the QR code. + + Set the version of the QR code. + Together with error correction level, the version determines the information capacity of the QR code. Higher version numbers correspond with higher capacity. + Range: 1 to 40. + + the new version of the QR code + + + Sets the width of the byte matrix + the new width of the matrix + + + Set the masking pattern + new masking pattern of the QR code + + + Set the number of total bytes + new number of total bytes + + + Set the number of data bytes + new number of data bytes + + + Set the number of error correction blocks + new number of error correction blocks + + + Set the number of Reed-Solomon blocks + new number of Reed-Solomon blocks + + + Set the byte-matrix + the new byte-matrix + + + Check if "mask_pattern" is valid. + masking pattern to check + true if the pattern is valid, false otherwise + + + This object renders a QR Code as a ByteMatrix 2D array of greyscale values. + dswitkin@google.com (Daniel Switkin) + + + Encode a string into a QR code with dimensions width x height, using error-correction level L and the smallest version for which he contents fit into the QR-code? + + String to encode into the QR code + width of the QR-code + height of the QR-code + 2D Greyscale map containing the visual representation of the QR-code, stored as a Bytematrix + + + + + Encode a string into a QR code with dimensions width x height. + + Encode a string into a QR code with dimensions width x height. Hints contains suggestions for error-correction level and version. + The default error-correction level is L, the default version is the smallest version for which the contents will fit into the QR-code. + + String to encode into the QR code + width of the QR-code + height of the QR-code + Map containing suggestions for error-correction level and version + 2D Greyscale map containing the visual representation of the QR-code, stored as a Bytematrix + + + + +

    Implements Reed-Solomon encoding, as the name implies.

    + Sean Owen + William Rucklidge +
    + + + Creates a SolomonEncoder object based on a + + object. + Only QR codes are supported at the moment. + + the galois field + + + Encodes the provided data. + data to encode + error correction bytes + + + +

    Thrown when an exception occurs during Reed-Solomon decoding, such as when + there are too many errors to correct.

    +
    + Sean Owen +
    + + Creates a ReedSolomonException with a message. + the message of the exception + + + See ISO 18004:2006 Annex D. + Sean Owen + + + See ISO 18004:2006 Annex D. + + See ISO 18004:2006 Annex D. + Element i represents the raw version bits that specify version i + 7 + + + + the version number + + + int[] containing the positions of the alignment pattern centers + + + total number of code words + + + the square dimension for the current version number + + + error correction level + the number of EC blocks for the given error correction level + + +

    Deduces version information purely from QR Code dimensions.

    + dimension in modules + + + + for a QR Code of that dimension + +
    + + Version number + the version for the given version number + + + Decode the version information. + bits stored as int containing + Version decoded from the versionBits + + + Build the function pattern, See ISO 18004:2006 Annex E. + Bitmatrix containing the pattern + + + The version number as a string + + + See ISO 18004:2006 6.5.1 Table 9. + + + + The number of error-correction words per block + + + the total number of error-correction words + + + + + + + + A base class which covers the range of exceptions which may occur when encoding a barcode using + the Writer framework. + + dswitkin@google.com (Daniel Switkin) + + + Creates a WriterException. + + + Creates a WriterException with a message. + message of the exception + +
    +
    diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.forms.dll b/src/packages/itext7.7.0.2/lib/net40/itext.forms.dll new file mode 100644 index 00000000000..3025b1a3ed9 Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.forms.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.forms.xml b/src/packages/itext7.7.0.2/lib/net40/itext.forms.xml new file mode 100644 index 00000000000..7510ff9b1bc --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.forms.xml @@ -0,0 +1,2942 @@ + + + + itext.forms + + + + An interactive control on the screen that raises events and/or can retain data. + + + + Size of text in form fields when font size is not explicitly set. + + + A field with the symbol check + + + A field with the symbol circle + + + A field with the symbol cross + + + A field with the symbol diamond + + + A field with the symbol square + + + A field with the symbol star + + + + Flag that designates, if set, that the field can contain multiple lines + of text. + + + + Flag that designates, if set, that the field's contents must be obfuscated. + + + + Creates a form field as a wrapper object around a + + . + This + + must be an indirect object. + + the dictionary to be wrapped, must have an indirect reference. + + + + Creates a minimal + + . + + + + + Creates a form field as a parent of a + + . + + + the widget which will be a kid of the + + + + + Makes a field flag by bit position. + + Makes a field flag by bit position. Bit positions are numbered 1 to 32. + But position 0 corresponds to flag 1, position 3 corresponds to flag 4 etc. + + bit position of a flag in range 1 to 32 from the pdf specification. + corresponding field flag. + + + + Creates an empty form field without a predefined set of layout or + behavior. + + + the + + to create the field in + + + a new + + + + + + Creates an empty + button form field + with custom + behavior and layout, on a specified location. + + + the + + to create the button field in + + the location on the page for the button + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + button form field + with custom + behavior and layout. + + + the + + to create the button field in + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + text form field + . + + + the + + to create the text field in + + + a new + + + + + + Creates an empty + text form field + . + + + the + + to create the text field in + + the location on the page for the text field + + a new + + + + + + Creates a named + text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + + a new + + + + + + Creates a named + text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + true for multiline text field + + a new + + + + + + Creates a named + text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + true for multiline text field + + a new + + + + + + Creates a named + multilined text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + multilined text form field + with an initial + value, with a specified font and font size. + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a + + + the size of the font + + a new + + + + + + Creates a named + multiline text form field + with an initial + value, and the form's default font specified in + + . + + + the + + to create the text field in + + the location on the page for the text field + the name of the form field + the initial value + + a new + + + + + + Creates an empty + choice form field + . + + + the + + to create the choice field in + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a + + + the size of the font + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates a + choice form field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a + + + the size of the font + + an array of + + objects that each represent + the 'on' state of one of the choices. + + + an int, containing a set of binary behavioral + flags. Do binary OR on this int to set the + flags you require. + + + a new + + + + + + Creates an empty + signature form field + . + + + the + + to create the signature field in + + + a new + + + + + + Creates an empty + signature form field + . + + + the + + to create the signature field in + + the location on the page for the signature field + + a new + + + + + + Creates a + radio group form field + . + + + the + + to create the radio group in + + the name of the form field + the initial value + + a new + radio group + + + + + Creates a generic + + that is added to a radio group. + + + the + + to create the radio group in + + the location on the page for the field + the radio button group that this field should belong to + the initial value + + a new + + + + + + + Creates a generic + + that is added to a radio group. + + + the + + to create the radio group in + + the location on the page for the field + the radio button group that this field should belong to + the initial value + + the + + of the document. + + null if it's no PDF/A document + + + a new + + + + + + + Creates a + + as a push button without data. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a new + + + + + + Creates a + + as a push button without data, with + its caption in a custom font. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a + + + the size of the font + + a new + + + + + + Creates a + + as a push button without data, with + its caption in a custom font. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the text to display on the button + + a + + + the size of the font + + a new + + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + + a new + checkbox + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + the type of checkbox graphic to use. + + a new + checkbox + + + + + Creates a + + as a checkbox. + + + the + + to create the radio group in + + the location on the page for the field + the name of the form field + the initial value + the type of checkbox graphic to use. + + the + + of the document. + + null if it's no PDF/A document + + + a new + checkbox + + + + + Creates a + combobox + with custom + behavior and layout, on a specified location. + + + the + + to create the combobox in + + the location on the page for the combobox + the name of the form field + the initial value + + a two-dimensional array of Strings which will be converted + to a PdfArray. + + + a new + + as a combobox + + + + + Creates a + combobox + with custom + behavior and layout, on a specified location. + + + the + + to create the combobox in + + the location on the page for the combobox + the name of the form field + the initial value + an array of Strings which will be converted to a PdfArray. + + a new + + as a combobox + + + + + Creates a + list field + with custom + behavior and layout, on a specified location. + + + the + + to create the choice field in + + the location on the page for the choice field + the name of the form field + the initial value + + a two-dimensional array of Strings which will be converted + to a PdfArray. + + + a new + + as a list field + + + + + Creates a + list field + with custom + behavior and layout, on a specified location. + + + the + + to create the list field in + + the location on the page for the list field + the name of the form field + the initial value + an array of Strings which will be converted to a PdfArray. + + a new + + as a list field + + + + + Creates a (subtype of) + + object. The type of the object + depends on the FT entry in the pdfObject parameter. + + + assumed to be either a + + , or a + + to a + + + + the + + to create the field in + + + a new + + , or null if + pdfObject does not contain a FT entry + + + + + Returns the type of the

    Parent

    form field, or of the wrapped + <PdfDictionary> object. +
    + + the form type, as a + + +
    + + Sets a value to the field and generating field appearance if needed. + of the field + the field + + + Sets a value to the field and generating field appearance if needed. + of the field + set this flat to false if you want to keep the appearance of the field generated before + + the field + + + Set text field value with given font and size + text value + + a + + + the size of the font + the edited field + + + Set text field value with given font and size + text value + + a + + + the size of the font + the edited field + + + Sets the field value and the display string. + + Sets the field value and the display string. The display string + is used to build the appearance. + + the field value + + the string that is used for the appearance. If null + the value parameter will be used + + the edited field + + + + Sets a parent + + for the current object. + + another form field that this field belongs to, usually a group field + the edited field + + + Gets the parent dictionary. + another form field that this field belongs to, usually a group field + + + Gets the kids of this object. + + contents of the dictionary's Kids property, as a + + + + + + Adds a new kid to the Kids array property from a + + . Also sets the kid's Parent property to this object. + + + a new + + entry for the field's Kids array property + + the edited field + + + + Adds a new kid to the Kids array property from a + + . Also sets the kid's Parent property to this object. + + + a new + + entry for the field's Kids array property + + the edited field + + + Changes the name of the field to the specified value. + the new field name, as a String + the edited field + + + Gets the current field name. + + the current field name, as a + + + + + Changes the alternate name of the field to the specified value. + + Changes the alternate name of the field to the specified value. The + alternate is a descriptive name to be used by status messages etc. + + the new alternate name, as a String + the edited field + + + Gets the current alternate name. + + Gets the current alternate name. The alternate is a descriptive name to + be used by status messages etc. + + + the current alternate name, as a + + + + + Changes the mapping name of the field to the specified value. + + Changes the mapping name of the field to the specified value. The + mapping name can be used when exporting the form data in the document. + + the new alternate name, as a String + the edited field + + + Gets the current mapping name. + + Gets the current mapping name. The mapping name can be used when + exporting the form data in the document. + + + the current mapping name, as a + + + + + + Checks whether a certain flag, or any of a combination of flags, is set + for this form field. + + an int interpreted as a series of a binary flags + + true if any of the flags specified in the parameter is also set + in the form field. + + + + Adds a flag, or combination of flags, for the form field. + + Adds a flag, or combination of flags, for the form field. This method is + intended to be used one flag at a time, but this is not technically + enforced. To replace the current value, use + + . + + an int interpreted as a series of a binary flags + the edited field + + + Adds or removes a flag, or combination of flags, for the form field. + + Adds or removes a flag, or combination of flags, for the form field. This + method is intended to be used one flag at a time, but this is not + technically enforced. To replace the current value, use + + . + + an int interpreted as a series of a binary flags + + if true, adds the flag(s). if false, + removes the flag(s). + + the edited field + + + If true, the field can contain multiple lines of text; if false, the field's text is restricted to a single line. + + whether the field can span over multiple lines. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters. + + whether or not the contents of the field must be obfuscated + + + Sets a flag, or combination of flags, for the form field. + + Sets a flag, or combination of flags, for the form field. This method + replaces the previous value. Compare with + + which adds a flag to the existing flags. + + an int interpreted as a series of a binary flags + the edited field + + + Gets the current list of PDF form field flags. + the current list of flags, encoded as an int + + + Gets the current value contained in the form field. + + the current value, as a + + + + + Gets the current value contained in the form field. + + the current value, as a + + + + + Sets the default fallback value for the form field. + the default value + the edited field + + + Gets the default fallback value for the form field. + the default value + + + Sets an additional action for the form field. + the dictionary key to use for storing the action + the action + the edited field + + + Gets the currently additional action dictionary for the form field. + the additional action dictionary + + + Sets options for the form field. + Sets options for the form field. Only to be used for checkboxes and radio buttons. + + an array of + + objects that each represent + the 'on' state of one of the choices. + + the edited field + + + Gets options for the form field. + + Gets options for the form field. Should only return usable values for + checkboxes and radio buttons. + + + the options, as an + + of + + objects + + + + + Gets all + + that this form field and its + kids + refer to. + + + a list of + + + + + + Gets default appearance string containing a sequence of valid page-content graphics or text state operators that + define such properties as the field's text size and color. + + + the default appearance graphics, as a + + + + + + Sets default appearance string containing a sequence of valid page-content graphics or text state operators that + define such properties as the field's text size and color. + + a valid sequence of PDF content stream syntax + the edited field + + + + Gets a code specifying the form of quadding (justification) to be used in displaying the text: + 0 Left-justified + 1 Centered + 2 Right-justified + + the current justification attribute + + + + Sets a code specifying the form of quadding (justification) to be used in displaying the text: + 0 Left-justified + 1 Centered + 2 Right-justified + + the value to set the justification attribute to + the edited field + + + Gets a default style string, as described in "Rich Text Strings" section of Pdf spec. + + the default style, as a + + + + + Sets a default style string, as described in "Rich Text Strings" section of Pdf spec. + a new default style for the form field + the edited field + + + Gets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + + Gets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + May be either + + or + + . + + the current rich text value + + + Sets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + + Sets a rich text string, as described in "Rich Text Strings" section of Pdf spec. + May be either + + or + + . + + a new rich text value + the edited field + + + Gets the current font of the form field. + + the current + font + + + + Basic setter for the font property. + + Basic setter for the font property. Regenerates the field + appearance after setting the new value. + + the new font to be set + + + Basic setter for the fontSize property. + + Basic setter for the fontSize property. Regenerates the + field appearance after setting the new value. + + the new font size to be set + + + Basic setter for the fontSize property. + + Basic setter for the fontSize property. Regenerates the + field appearance after setting the new value. + + the new font size to be set + + + + Combined setter for the font and fontSize + properties. + + + Combined setter for the font and fontSize + properties. Regenerates the field appearance after setting the new value. + + the new font to be set + the new font size to be set + + + Basic setter for the backgroundColor property. + + Basic setter for the backgroundColor property. Regenerates + the field appearance after setting the new value. + + the new color to be set + + + Basic setter for the degRotation property. + + Basic setter for the degRotation property. Regenerates + the field appearance after setting the new value. + + the new degRotation to be set + + + + Sets the action on all + widgets + of this form field. + + the action + the edited field + + + Changes the type of graphical marker used to mark a checkbox as 'on'. + + Changes the type of graphical marker used to mark a checkbox as 'on'. + Notice that in order to complete the change one should call + regenerateField + method + + the new checkbox marker + + + + Set the visibility flags of the form field annotation + Options are: HIDDEN, HIDDEN_BUT_PRINTABLE, VISIBLE, VISIBLE_BUT_DOES_NOT_PRINT + + visibility option + the edited form field annotation + + + This method regenerates appearance stream of the field. + + This method regenerates appearance stream of the field. Use it if you + changed any field parameters and didn't use setValue method which + generates appearance by itself. + + whether or not the regeneration was successful. + + + + Calculate the necessary height offset after applying field rotation + so that the origin of the bounding box is the lower left corner with respect to the field text. + + bounding box rectangle before rotation + rotation of the page + rotation of the field relative to the page + translation value for height + + + + Calculate the necessary width offset after applying field rotation + so that the origin of the bounding box is the lower left corner with respect to the field text. + + bounding box rectangle before rotation + rotation of the page + rotation of the field relative to the page + translation value for width + + + Gets the border width for the field. + the current border width. + + + Sets the border width for the field. + the new border width. + + + Sets the Border Color. + the new value for the Border Color + the edited field + + + Sets the text color. + the new value for the Color + the edited field + + + Sets the ReadOnly flag, specifying whether or not the field can be changed. + if true, then the field cannot be changed. + the edited field + + + Gets the ReadOnly flag, specifying whether or not the field can be changed. + true if the field cannot be changed. + + + Sets the Required flag, specifying whether or not the field must be filled in. + if true, then the field must be filled in. + the edited field + + + Gets the Required flag, specifying whether or not the field must be filled in. + true if the field must be filled in. + + + Sets the NoExport flag, specifying whether or not exporting is forbidden. + if true, then exporting is forbidden + the edited field + + + Gets the NoExport attribute. + whether exporting the value following a form action is forbidden. + + + Specifies on which page the form field's widget must be shown. + the page number + the edited field + + + Gets the appearance state names. + an array of Strings containing the names of the appearance states + + + Sets an appearance for (the widgets related to) the form field. + + the type of appearance stream to be added +
      +
    • PdfName.N: normal appearance
    • +
    • PdfName.R: rollover appearance
    • +
    • PdfName.D: down appearance
    • +
    + + + the state of the form field that needs to be true + for the appearance to be used. Differentiates between several streams + of the same type. + + + the appearance instructions, as a + + + the edited field +
    + + Releases underlying pdf object and other pdf entities used by wrapper. + + Releases underlying pdf object and other pdf entities used by wrapper. + This method should be called instead of direct call to + + if the wrapper is used. + + + + + + + Draws the visual appearance of text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of multiline text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws the visual appearance of multiline text in a form field. + the location on the page for the list field + + a + + + the size of the font + the initial value + + + Draws a border using the borderWidth and borderColor of the form field. + + the + + on which to draw + + the width of the rectangle to draw + the height of the rectangle to draw + + + Draws the appearance of a radio button with a specified value. + the width of the radio button to draw + the height of the radio button to draw + the value of the button + + + Draws the appearance of a radio button with a specified value. + the width of the radio button to draw + the height of the radio button to draw + the value of the button + + + Draws a radio button. + + the + + on which to draw + + the width of the radio button to draw + the height of the radio button to draw + required to be true for fulfilling the drawing operation + + + Draws the appearance of a checkbox with a specified state value. + the width of the checkbox to draw + the height of the checkbox to draw + the state of the form field that will be drawn + + + Draws the appearance for a push button. + the width of the pushbutton + the width of the pushbutton + the text to display on the button + + a + + + the size of the font + + a new + + + + + Draws the appearance for a push button. + the width of the pushbutton + the width of the pushbutton + the text to display on the button + + a + + + the size of the font + + a new + + + + + Performs the low-level drawing operations to draw a button object. + + the + + of the page to draw on. + + the x coordinate of the lower left corner of the button rectangle + the y coordinate of the lower left corner of the button rectangle + the width of the button + the width of the button + the text to display on the button + + a + + + the size of the font + + + Performs the low-level drawing operations to draw a button object. + + the + + of the page to draw on. + + the x coordinate of the lower left corner of the button rectangle + the y coordinate of the lower left corner of the button rectangle + the width of the button + the width of the button + the text to display on the button + + a + + + the size of the font + + + Performs the low-level drawing operations to draw a checkbox object. + + the + + of the page to draw on. + + the width of the button + the width of the button + the size of the font + the boolean value of the checkbox + + + Performs the low-level drawing operations to draw a checkbox object. + + the + + of the page to draw on. + + the width of the button + the width of the button + the size of the font + the boolean value of the checkbox + + + Button field flags + + + Returns Btn, the form type for choice form fields. + + the form type, as a + + + + + + If true, the field is a set of radio buttons; if false, the field is a + check box. + + + If true, the field is a set of radio buttons; if false, the field is a + check box. This flag only works if the Pushbutton flag is set to false. + + whether the field is currently radio buttons or a checkbox + + + + If true, the field is a set of radio buttons; if false, the field is a + check box. + + + If true, the field is a set of radio buttons; if false, the field is a + check box. This flag should be set only if the Pushbutton flag is set to false. + + whether the field should be radio buttons or a checkbox + + current + + + + + + If true, clicking the selected button deselects it, leaving no button + selected. + + + If true, clicking the selected button deselects it, leaving no button + selected. If false, exactly one radio button shall be selected at all + times. Only valid for radio buttons. + + whether a radio button currently allows to choose no options + + + If true, clicking the selected button deselects it, leaving no button selected. + + If true, clicking the selected button deselects it, leaving no button selected. + If false, exactly one radio button shall be selected at all times. + + whether a radio button may allow to choose no options + + current + + + + + If true, the field is a pushbutton that does not retain a permanent value. + whether or not the field is currently a pushbutton + + + If true, the field is a pushbutton that does not retain a permanent value. + whether or not to set the field to a pushbutton + + current + + + + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; + that is if one is checked, they are all checked. + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; + that is if one is checked, they are all checked. + If false, the buttons are mutually exclusive + + whether or not buttons are turned off in unison + + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; that is + if one is checked, they are all checked. + + + If true, a group of radio buttons within a radio button field that use + the same value for the on state will turn on and off in unison; that is + if one is checked, they are all checked. + If false, the buttons are mutually exclusive + + whether or not buttons should turn off in unison + + current + + + + + + + + An AcroForm field type representing any type of choice field. + + An AcroForm field type representing any type of choice field. Choice fields + are to be represented by a viewer as a list box or a combo box. + + + + Choice field flags + + + Returns Ch, the form type for choice form fields. + + the form type, as a + + + + + Sets the index of the first visible option in a scrollable list. + the index of the first option + + current + + + + + Gets the current index of the first option in a scrollable list. + + the index of the first option, as a + + + + + Sets the selected items in the field. + a sorted array of indices representing selected items in the field + + current + + + + + Highlights the options. + + Highlights the options. If this method is used for Combo box, the first value in input array + will be the field value + + Array of options to be highlighted + + current + + + + + Highlights the options. + + Highlights the options. Is this method is used for Combo box, the first value in input array + will be the field value + + + + current + + + + + Gets the currently selected items in the field + a sorted array of indices representing the currently selected items in the field + + + If true, the field is a combo box; if false, the field is a list box. + whether or not the field should be a combo box + + current + + + + + If true, the field is a combo box; if false, the field is a list box. + whether or not the field is now a combo box. + + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + This flag shall be used only if the Combo flag is true. + + whether or not to add an editable text box + + current + + + + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + + + If true, the combo box shall include an editable text box as well as a + drop-down list; if false, it shall include only a drop-down list. + This flag shall be used only if the Combo flag is true. + + whether or not there is currently an editable text box + + + If true, the field???s option items shall be sorted alphabetically. + + If true, the field???s option items shall be sorted alphabetically. + This flag is intended for use by writers, not by readers. + + whether or not to sort the items + + current + + + + + If true, the field???s option items shall be sorted alphabetically. + + If true, the field???s option items shall be sorted alphabetically. + This flag is intended for use by writers, not by readers. + + whether or not the items are currently sorted + + + + If true, more than one of the field???s option items may be selected + simultaneously; if false, at most one item shall be selected. + + whether or not to allow multiple selection + + current + + + + + If true, more than one of the field???s option items may be selected simultaneously; if false, at most one item shall be selected. + + whether or not multiple selection is currently allowed + + + If true, text entered in the field shall be spell-checked.. + whether or not to require the PDF viewer to perform a spell check + + current + + + + + If true, text entered in the field shall be spell-checked.. + whether or not PDF viewer must perform a spell check + + + If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device). + + whether or not to save changes immediately + + current + + + + + If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device). + + whether or not to save changes immediately + + + An AcroForm field containing signature data. + + + Returns Sig, the form type for signature form fields. + + the form type, as a + + + + + Adds the signature to the signature field. + the signature to be contained in the signature field, or an indirect reference to it + the edited field + + + + Gets the + + , which contains fields that + must be locked if the document is signed. + + a dictionary containing locked fields. + + + + An AcroForm field containing textual data. + + + Returns Tx, the form type for textual form fields. + + the form type, as a + + + + + If true, the field can contain multiple lines of text; if false, the field?s text is restricted to a single line. + + whether or not the file can contain multiple lines of text + + current + + + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + + + If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. + Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters. + + whether or not to obscure the typed characters + + current + + + + + + If true, the text entered in the field represents the pathname of a file + whose contents are to be submitted as the value of the field. + + whether or not this field currently represents a path + + + + If true, the text entered in the field represents the pathname of a file + whose contents are to be submitted as the value of the field. + + whether or not this field should represent a path + + current + + + + + If true, text entered in the field is spell-checked. + whether or not spell-checking is currently enabled + + + If true, text entered in the field is spell-checked. + whether or not to spell-check + + current + + + + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + Once the field is full, no further text is accepted. + + whether or not longer texts are currently allowed + + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + + + If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) + to accommodate more text than fits within its annotation rectangle. + Once the field is full, no further text is accepted. + + whether or not to allow longer texts + + current + + + + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + If true, the field is automatically divided into as many equally spaced positions, + or combs, as the value of MaxLen, and the text is laid out into those combs. + + whether or not combing is enabled + + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + + + Meaningful only if the MaxLen entry is present in the text field dictionary + and if the Multiline, Password, and FileSelect flags are clear. + If true, the field is automatically divided into as many equally spaced positions, + or combs, as the value of MaxLen, and the text is laid out into those combs. + + whether or not to enable combing + + current + + + + + If true, the value of this field should be represented as a rich text string. + + If true, the value of this field should be represented as a rich text string. + If the field has a value, the RV entry of the field dictionary specifies the rich text string. + + whether or not text is currently represented as rich text + + + If true, the value of this field should be represented as a rich text string. + + If true, the value of this field should be represented as a rich text string. + If the field has a value, the RV entry of the field dictionary specifies the rich text string. + + whether or not to represent text as rich text + + current + + + + + Gets the maximum length of the field's text, in characters. + + Gets the maximum length of the field's text, in characters. + This is an optional parameter, so if it is not specified, null will be returned. + + the current maximum text length + + + Sets the maximum length of the field?s text, in characters. + the maximum text length + current + + + This class represents the static form technology AcroForm on a PDF file. + + + + + + Keeps track of whether or not appearances must be generated by the form + fields themselves, or by the PDF viewer application. + + + Keeps track of whether or not appearances must be generated by the form + fields themselves, or by the PDF viewer application. Default is + true. + + + + + A map of field names and their associated + form field + objects. + + + + The PdfDocument to which the PdfAcroForm belongs. + + + Creates a PdfAcroForm as a wrapper of a dictionary. + + Creates a PdfAcroForm as a wrapper of a dictionary. + Also initializes an XFA form if an /XFA entry is present in + the dictionary. + + the PdfDictionary to be wrapped + + + + Creates a PdfAcroForm from a + + of fields. + Also initializes an empty XFA form. + + + a + + of + + objects + + + + Retrieves AcroForm from the document. + + Retrieves AcroForm from the document. If there is no AcroForm in the + document Catalog and createIfNotExist flag is true then the AcroForm + dictionary will be created and added to the document. + + + the document to retrieve the + + from + + + when true, this method will create a + + if none exists for this document + + + the + document + 's AcroForm, or a new one + + + + This method adds the field to the last page in the document. + + This method adds the field to the last page in the document. + If there's no pages, creates a new one. + + + the + + to be added to the form + + + + This method adds the field to a specific page. + + the + + to be added to the form + + + the + + on which to add the field + + + + + This method merges field with its annotation and place it on the given + page. + + + This method merges field with its annotation and place it on the given + page. This method won't work if the field has no or more than one widget + annotations. + + + the + + to be added to the form + + + the + + on which to add the field + + + + + Gets the + form field + s as a + + . + + + a map of field names and their associated + form field + objects + + + + + + + + + + + + + + + + + + + Gets the XFA property on the AcroForm. + + an object representing the entire XDP. It can either be a + + or a + + . + + + + + Gets a + form field + by its name. + + + the name of the + form field + to retrieve + + + the + form field + , or null if it + isn't present + + + + + Gets the attribute generateAppearance, which tells + + to generate an appearance Stream for all + form field + s + that don't have one. + + bolean value indicating if the appearances need to be generated + + + + + Flattens interactive + form field + s in the document. If + no fields have been explicitly included via {#link #partialFormFlattening}, + then all fields are flattened. Otherwise only the included fields are + flattened. + + + + + Tries to remove the + form field + with the specified + name from the document. + + + the name of the + form field + to remove + + a boolean representing whether or not the removal succeeded. + + + + Adds a + form field + , identified by name, to the list of fields to be flattened. + Does not perform a flattening operation in itself. + + + the name of the + form field + to be flattened + + + + + Changes the identifier of a + form field + . + + the current name of the field + the new name of the field. Must not be used currently. + + + + Creates an in-memory copy of a + + . This new field is + not added to the document. + + + the name of the + form field + to be copied + + + a clone of the original + + + + + + Replaces the + + of a certain name with another + + . + + + the name of the + form field + to be replaced + + + the new + + + + + Gets all AcroForm fields in the document. + + a + + of field dictionaries + + + + Merges two dictionaries. + + Merges two dictionaries. When both dictionaries contain the same key, + the value from the first dictionary is kept. + + + the + + which may get extra entries from source + + + the + + whose entries may be merged into result + + + + Determines whether the AcroForm contains XFA data. + a boolean + + + + Gets the + + atribute. + + the XFA form object + + + Removes the XFA stream from the document. + + + Releases underlying pdf object and other pdf entities used by wrapper. + + Releases underlying pdf object and other pdf entities used by wrapper. + This method should be called instead of direct call to + + if the wrapper is used. + + + + + A sample implementation of the {#link IPdfPageExtraCopier} interface which + copies only AcroForm fields to a new page. + + + A sample implementation of the {#link IPdfPageExtraCopier} interface which + copies only AcroForm fields to a new page. +

    + NOTE: While it's absolutely not necessary to use the same PdfPageFormCopier instance for copying operations, + it is still worth to know that PdfPageFormCopier uses some caching logic which can potentially improve performance + in case of the reusing of the same instance. +
    +
    + + A signature field lock dictionary. + + A signature field lock dictionary. Specifies a set of form + fields that shall be locked when this signature field is + signed. + + + + + Creates an instance of + + . + + + + + Creates an instance of + + . + + + The dictionary whose entries should be added to + the signature field lock dictionary. + + + + + Sets the permissions granted for the document when the corresponding signature + field is signed. + + + Sets the permissions granted for the document when the corresponding signature + field is signed. See + + for getting more info. + + The permissions granted for the document. + + This + + object. + + + + Sets signature lock for specific fields in the document. + + Indicates the set of fields that should be locked after the actual + signing of the corresponding signature takes place. + + Names indicating the fields. + + This + + object. + + + + Enumerates the different actions of a signature field lock. + + Enumerates the different actions of a signature field lock. + Indicates the set of fields that should be locked when the + corresponding signature field is signed: +
      +
    • all the fields in the document,
    • +
    • all the fields specified in the /Fields array,
    • +
    • all the fields except those specified in the /Fields array.
    • +
    +
    +
    + + + Enumerates the different levels of access permissions granted for + the document when the corresponding signature field is signed: +
      +
    • + + - no changes to the document are + permitted; any change to the document invalidates the signature,
    • +
    • + + - permitted changes are filling in forms, + instantiating page templates, and signing; other changes invalidate + the signature,
    • +
    • + + - permitted changes are the + same as for the previous, as well as annotation creation, deletion, + and modification; other changes invalidate the signature.
    • +
    +
    +
    + + A class to process "classic" fields. + + + A class for some basic SOM processing. + + + The order the names appear in the XML, depth first. + + + The mapping of full names to nodes. + + + The data to do a search from the bottom hierarchy. + + + A stack to be used when parsing. + + + A temporary store for the repetition count. + + + Escapes a SOM string fragment replacing "." with "\.". + the unescaped string + the escaped string + + + Unescapes a SOM string fragment replacing "\." with ".". + the escaped string + the unescaped string + + + + Outputs the stack as the sequence of elements separated + by '.'. + + the stack as the sequence of elements separated by '.' + + + Gets the name with the #subform removed. + the long name + the short name + + + Adds a SOM name to the search node chain. + the SOM name + + + Adds a SOM name to the search node chain. + the start point + the stack with the separated SOM parts + the full name + + + Searches the SOM hierarchy from the bottom. + the SOM parts + the full name or null if not found + + + Splits a SOM name in the individual parts. + the full SOM name + the split name + + + Gets the order the names appear in the XML, depth first. + the order the names appear in the XML, depth first + + + Sets the order the names appear in the XML, depth first + the order the names appear in the XML, depth first + + + Gets the mapping of full names to nodes. + the mapping of full names to nodes + + + Sets the mapping of full names to nodes. + the mapping of full names to nodes + + + Gets the data to do a search from the bottom hierarchy. + the data to do a search from the bottom hierarchy + + + Sets the data to do a search from the bottom hierarchy. + the data to do a search from the bottom hierarchy + + + Creates a new instance from a Collection with the full names. + the Collection + + + Gets the mapping from short names to long names. + + Gets the mapping from short names to long names. A long + name may contain the #subform name part. + + the mapping from short names to long names + + + Sets the mapping from short names to long names. + + Sets the mapping from short names to long names. A long + name may contain the #subform name part. + + the mapping from short names to long names + + + + A structure to store each part of a SOM name and link it to the next part + beginning from the lower hierarchy. + + + + + Gets the full name by traversing the hierarchy using only the + index 0. + + the full name + + + Search the current node for a similar name. + + Search the current node for a similar name. A similar name starts + with the same name but has a different index. For example, "detail[3]" + is similar to "detail[9]". The main use is to discard names that + correspond to out of bounds records. + + the name to search + true if a similitude was found + + + Processes XFA forms. + + + The URI for the XFA Data schema. + + + An empty constructor to build on. + + + Creates an XFA form by the stream containing all xml information + + + + Creates an XFA form by the + + containing all xml information + + + + + A constructor from a + + . It is assumed, but not + necessary for correct initialization, that the dictionary is actually a + + . An entry in the dictionary with the XFA + key must contain correct XFA syntax. If the XFA key is + absent, then the constructor essentially does nothing. + + the dictionary object to initialize from + + + A constructor from a PdfDocument. + + A constructor from a PdfDocument. It basically does everything + from finding the XFA stream to the XML parsing. + + the PdfDocument instance + + + Sets the XFA key from a byte array. + Sets the XFA key from a byte array. The old XFA is erased. + the data + pdfDocument + on IO error + + + Extracts DOM nodes from an XFA document. + + an XFA file as a + + DOM + document + + + + a + + of XFA packet names and their associated + DOM nodes + + + + Write the XfaForm to the provided PdfDocument. + the PdfDocument to write the XFA Form to + + + + Changes a field value in the XFA form. + the name of the field to be changed + the new value + + + Gets the xfa field value. + the fully qualified field name + the field value + + + Returns true if it is a XFA form. + true if it is a XFA form + + + Finds the complete field name from a partial name. + the complete or partial name + the complete name or null if not found + + + + Finds the complete SOM name contained in the datasets section from a + possibly partial name. + + the complete or partial name + the complete name or null if not found + + + + Finds the Node contained in the datasets section from a + possibly partial name. + + the complete or partial name + the Node or null if not found + + + Gets all the text contained in the child nodes of this node. + the Node + the text found or "" if no text was found + + + Sets the text of this node. + + Sets the text of this node. All the child's node are deleted and a new + child text node is created. + + the Node to add the text to + the text to add + + + Gets the top level DOM document. + the top level DOM document + + + Sets the top DOM document. + the top DOM document + + + Gets the Node that corresponds to the datasets part. + the Node that corresponds to the datasets part + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + + file + object + + to fill this object with XFA data. The resulting DOM document may + be modified. + + + the + + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + + file + object + + to fill this object with XFA data. + + + the + + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts an + + to fill this object with XFA data. The resulting DOM document may be + modified. + + + the + + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts an + + to fill this object with XFA data. + + + the + + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + SAX input source + to fill this object with XFA data. The resulting DOM + document may be modified. + + + the + SAX input source + + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + Replaces the XFA data under datasets/data. Accepts a + SAX input source + to fill this object with XFA data. + + + the + SAX input source + + whether or not the resulting DOM document may be modified + + on IO error on the + + + + + Replaces the XFA data under datasets/data. + + the input + + + + + Replaces the XFA data under datasets/data. + + the input + + + whether or not the resulting DOM document may be modified + + + Return the XFA Object, could be an array, could be a Stream. + + Return the XFA Object, could be an array, could be a Stream. + Returns null f no XFA Object is present. + + a PdfDocument instance + the XFA object + + + Serializes a XML document to a byte array. + the XML document + the serialized XML document + on error + + + + + + + + + + + + + Extracts the nodes from the domDocument. + + + Some XFA forms don't have a datasets node. + + Some XFA forms don't have a datasets node. + If this is the case, we have to add one. + + + + Processes the datasets section in the XFA form. + + + Creates a new instance from the datasets node. + + Creates a new instance from the datasets node. This expects + not the datasets but the data node that comes below. + + the datasets node + + + Inserts a new Node that will match the short name. + the datasets top Node + the short name + the new Node of the inserted name + +
    +
    diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.io.dll b/src/packages/itext7.7.0.2/lib/net40/itext.io.dll new file mode 100644 index 00000000000..91e1f9010b7 Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.io.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.io.xml b/src/packages/itext7.7.0.2/lib/net40/itext.io.xml new file mode 100644 index 00000000000..8b4d3f98c5e --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.io.xml @@ -0,0 +1,6555 @@ + + + + itext.io + + + + Came from GIFEncoder initially. + + Came from GIFEncoder initially. + Modified - to allow for output compressed data without the block counts + which breakup the compressed data stream for GIF. + + + + note this also indicates gif format BITFile. + + + destination for output data + GIF LZW requires block counts for output data + + + + + + + + + Encodes data in the CCITT G4 FAX format. + + + Creates a new encoder. + the line width + + + Encodes a number of lines. + the data to be encoded + the offset into the data + the size of the data to be encoded + + + Encodes a full image. + the data to encode + the image width + the image height + the encoded image + + + Encodes a number of lines. + the data to be encoded + the number of lines to encode + + + Closes the encoder and returns the encoded data. + the encoded data + + + + Class to read a JBIG2 file at a basic level: understand all the segments, + understand what segments belong to which pages, how many pages there are, + what the width and height of each page is, and global segments if there + are any. + + + Class to read a JBIG2 file at a basic level: understand all the segments, + understand what segments belong to which pages, how many pages there are, + what the width and height of each page is, and global segments if there + are any. Or: the minimum required to be able to take a normal sequential + or random-access organized file, and be able to embed JBIG2 pages as images + in a PDF. + TODO: the indeterminate-segment-size value of dataLength, else? + + + + + + + + + + + + + + + + + + + Inner class that holds information about a JBIG2 segment. + + + Inner class that holds information about a JBIG2 page. + + + + return as a single byte array the header-data for each segment in segment number + order, EMBEDDED organization, but i am putting the needed segments in SEQUENTIAL organization. + + + return as a single byte array the header-data for each segment in segment number + order, EMBEDDED organization, but i am putting the needed segments in SEQUENTIAL organization. + if for_embedding, skip the segment types that are known to be not for acrobat. + + + + a byte array + + + + Modified from original LZWCompressor to change interface to passing a + buffer of data to be compressed. + + + + base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF + + + reserved clear code based on code size + + + reserved end of data code based on code size + + + current number bits output for each code + + + limit at which current number of bits code size has to be increased + + + the prefix code which represents the predecessor string to current input point + + + output destination for bit codes + + + general purpose LZW string table + + + modify the limits of the code values in LZW encoding due to TIFF bug / feature + + + destination for compressed data + the initial code size for the LZW compressor + flag indicating that TIFF lzw fudge needs to be applied + if underlying output stream error + + + data to be compressed to output stream + if underlying output stream error + + + + Indicate to compressor that no more data to go so write out + any remaining buffered data. + + if underlying output stream error + + + General purpose LZW String Table. + + General purpose LZW String Table. + Extracted from GIFEncoder by Adam Doppelt + Comments added by Robin Luiten + expandCode added by Robin Luiten + The strLen_ table to give quick access to the lenght of an expanded + code for use by the expandCode method added by Robin. + + + + codesize + Reserved Codes + + + + each entry corresponds to a code and contains the length of data + that the code expands to when decoded. + + + + Constructor allocate memory for string store data + + + value of -1 indicates no predecessor [used in initialization] + + the byte [character] to add to the string store which follows + the predecessor string specified the index. + + + 0xFFFF if no space in table left for addition of predecessor + index and byte b. Else return the code allocated for combination index + b. + + + + index to prefix string + the character that follws the index prefix + + b if param index is HASH_FREE. Else return the code + for this prefix and byte successor + + + + + the size of code to be preallocated for the + string store. + + + + + If expanded data doesn't fit into array only what will fit is written + to buf and the return value indicates how much of the expanded code has + been written to the buf. + + + If expanded data doesn't fit into array only what will fit is written + to buf and the return value indicates how much of the expanded code has + been written to the buf. The next call to expandCode() should be with + the same code and have the skip parameter set the negated value of the + previous return. Successive negative return values should be negated and + added together for next skip parameter value with same code. + + buffer to place expanded data into + offset to place expanded data + + the code to expand to the byte array it represents. + PRECONDITION This code must already be in the LZSS + + + is the number of bytes at the start of the expanded code to + be skipped before data is written to buf. It is possible that skipHead is + equal to codeLen. + + + the length of data expanded into buf. If the expanded code is longer + than space left in buf then the value returned is a negative number which when + negated is equal to the number of bytes that were used of the code being expanded. + This negative value also indicates the buffer is full. + + + + Writes a PNG image. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A list of constants used in class TIFFImage. + + + subfile data descriptor + + + reduced resolution version + + + one page of many + + + transparency mask + + + +kind of data in subfile + + + full resolution image data + + + reduced size image data + + + one page of many + + + image width in pixels + + + image height in pixels + + + bits per channel (sample) + + + data compression technique + + + dump mode + + + CCITT modified Huffman RLE + + + CCITT Group 3 fax encoding + + + CCITT Group 4 fax encoding + + + + !6.0 JPEG + + + %JPEG DCT compression + + + NeXT 2-bit RLE + + + #1 w/ word alignment + + + Macintosh RLE + + + ThunderScan RLE + + + IT8 CT w/padding + + + IT8 Linework RLE + + + IT8 Monochrome picture + + + IT8 Binary line art + + + Pixar companded 10bit LZW + + + Pixar companded 11bit ZIP + + + Deflate compression + + + Deflate compression, as recognized by Adobe + + + Kodak DCS encoding + + + ISO JBIG + + + SGI Log Luminance RLE + + + SGI Log 24-bit packed + + + photometric interpretation + + + min value is white + + + min value is black + + + RGB color model + + + color map indexed + + + $holdout mask + + + !color separations + + + !CCIR 601 + + + !1976 CIE L*a*b + + + CIE Log2(L) + + + CIE Log2(L) (u',v') + + + +thresholding used on data + + + + or dithered scan + + + usually floyd-steinberg + + + +dithering matrix width + + + +dithering matrix height + + + data order within a byte + + + most significant -> least + + + least significant -> most + + + name of doc. + name of doc. image is from + + + info about image + + + scanner manufacturer name + + + scanner model name/number + + + offsets to data strips + + + +image orientation + + + row 0 top, col 0 lhs + + + row 0 top, col 0 rhs + + + row 0 bottom, col 0 rhs + + + row 0 bottom, col 0 lhs + + + row 0 lhs, col 0 top + + + row 0 rhs, col 0 top + + + row 0 rhs, col 0 bottom + + + row 0 lhs, col 0 bottom + + + samples per pixel + + + rows per strip of data + + + bytes counts for strips + + + +minimum sample value + + + +maximum sample value + + + pixels/resolution in x + + + pixels/resolution in y + + + storage organization + + + single image plane + + + separate planes of data + + + page name image is from + + + x page offset of image lhs + + + y page offset of image lhs + + + +byte offset to free block + + + +sizes of free blocks + + + $gray scale curve accuracy + + + tenths of a unit + + + hundredths of a unit + + + thousandths of a unit + + + ten-thousandths of a unit + + + hundred-thousandths + + + $gray scale response curve + + + 32 flag bits + + + 2-dimensional coding + + + data not compressed + + + fill to byte boundary + + + 32 flag bits + + + data not compressed + + + units of resolutions + + + no meaningful units + + + english + + + metric + + + page numbers of multi-page + + + $color curve accuracy + + + tenths of a unit + + + hundredths of a unit + + + thousandths of a unit + + + ten-thousandths of a unit + + + hundred-thousandths + + + !colorimetry info + + + + creation date and time + + + creator of image + + + machine where created + + + prediction scheme w/ LZW + + + no predictor + + + horizontal differencing + + + image white point + + + !primary chromaticities + + + RGB map for pallette image + + + !highlight+shadow info + + + !rows/data tile + + + !cols/data tile + + + !offsets to data tiles + + + !byte counts for tiles + + + lines w/ wrong pixel count + + + regenerated line info + + + no errors detected + + + receiver regenerated lines + + + uncorrected errors exist + + + max consecutive bad lines + + + subimage descriptors + + + !inks in separated image + + + !cyan-magenta-yellow-black + + + !ascii names of inks + + + !number of inks + + + !0% and 100% dot codes + + + !separation target + + + !info about extra samples + + + !unspecified data + + + !associated alpha data + + + !unassociated alpha data + + + !data sample format + + + !unsigned integer data + + + !signed integer data + + + !IEEE floating point data + + + !untyped data + + + !complex signed int + + + !complex ieee floating + + + !variable MinSampleValue + + + !variable MaxSampleValue + + + %JPEG table stream + + + !JPEG processing algorithm + + + !baseline sequential + + + !Huffman coded lossless + + + !pointer to SOI marker + + + !JFIF stream length + + + !restart interval length + + + !lossless proc predictor + + + !lossless point transform + + + !Q matrice offsets + + + !DCT table offsets + + + !AC coefficient offsets + + + !RGB -> YCbCr transform + + + !YCbCr subsampling factors + + + !subsample positioning + + + !as in PostScript Level 2 + + + !as in CCIR 601-1 + + + !colorimetry info + + + image reference points + + + region-xform tack point + + + warp quadrilateral + + + affine transformation mat + + + $use ExtraSamples + + + $use SampleFormat + + + z depth of image + + + z depth/data tile + + + full image size in x + + + full image size in y + + + texture map format + + + + cotan(fov) for env. + cotan(fov) for env. maps + + + W2S + + + W2C + + + + device serial number + tag 33405 is a private tag registered to Eastman Kodak + + + + tag 33432 is listed in the 6.0 spec w/ unknown ownership + + + IPTC TAG from RichTIFF specifications + + + site name + + + color seq. + color seq. [RGB,CMYK,etc] + + + DDES Header + + + raster scanline padding + + + # of bits in short run + + + # of bits in long run + + + LW colortable + + + BP/BL image color switch + + + BP/BL bg color switch + + + BP/BL image color value + + + BP/BL bg color value + + + MP pixel intensity value + + + HC transparency switch + + + color character. + color character. table + + + Sequence Frame Count + + + + ICC profile data + tag 34750 is a private tag registered to Adobe? + + + + tag 34377 is private tag registered to Adobe for PhotoShop + + + + JBIG options + tag 34750 is a private tag registered to Pixel Magic + + + + encoded Class 2 ses. + encoded Class 2 ses. parms + + + received SubAddr string + + + receive time (secs) + + + Sample value to Nits + + + + unknown use + tag 34929 is a private tag registered to FedEx + + + + + hue shift correction data + tag 65535 is an undefined tag used by Eastman Kodak + + + + + A boolean storing the endianness of the stream. + + + The number of entries in the IFD. + + + An array of TIFFFields. + + + A Hashtable indexing the fields by tag number. + + + The offset of this IFD. + + + The offset of the next IFD. + + + The default constructor. + + + Constructs a TIFFDirectory from a SeekableStream. + + Constructs a TIFFDirectory from a SeekableStream. + The directory parameter specifies which directory to read from + the linked list present in the stream; directory 0 is normally + read but it is possible to store multiple images in a single + TIFF file by maintaining multiple directories. + + a SeekableStream to read from. + the index of the directory to read. + + + + Constructs a TIFFDirectory by reading a SeekableStream. + + Constructs a TIFFDirectory by reading a SeekableStream. + The ifd_offset parameter specifies the stream offset from which + to begin reading; this mechanism is sometimes used to store + private IFDs within a TIFF file that are not part of the normal + sequence of IFDs. + + a SeekableStream to read from. + the long byte offset of the directory. + + the index of the directory to read beyond the + one at the current stream offset; zero indicates the IFD + at the current offset. + + + + + + + + Returns the number of directory entries. + + + + Returns the value of a given tag as a TIFFField, + or null if the tag is not present. + + + + Returns true if a tag appears in the directory. + + + + Returns an ordered array of ints indicating the tag + values. + + + + + Returns an array of TIFFFields containing all the fields + in this directory. + + + + + Returns the value of a particular index of a given tag as a + byte. + + + Returns the value of a particular index of a given tag as a + byte. The caller is responsible for ensuring that the tag is + present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or + TIFF_UNDEFINED. + + + + + Returns the value of index 0 of a given tag as a + byte. + + + Returns the value of index 0 of a given tag as a + byte. The caller is responsible for ensuring that the tag is + present and has type TIFFField.TIFF_SBYTE, TIFF_BYTE, or + TIFF_UNDEFINED. + + + + + Returns the value of a particular index of a given tag as a + long. + + + Returns the value of a particular index of a given tag as a + long. The caller is responsible for ensuring that the tag is + present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, + TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. + + + + + Returns the value of index 0 of a given tag as a + long. + + + Returns the value of index 0 of a given tag as a + long. The caller is responsible for ensuring that the tag is + present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, + TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. + + + + + Returns the value of a particular index of a given tag as a + float. + + + Returns the value of a particular index of a given tag as a + float. The caller is responsible for ensuring that the tag is + present and has numeric type (all but TIFF_UNDEFINED and + TIFF_ASCII). + + + + Returns the value of index 0 of a given tag as a float. + + Returns the value of index 0 of a given tag as a float. The + caller is responsible for ensuring that the tag is present and + has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII). + + + + + Returns the value of a particular index of a given tag as a + double. + + + Returns the value of a particular index of a given tag as a + double. The caller is responsible for ensuring that the tag is + present and has numeric type (all but TIFF_UNDEFINED and + TIFF_ASCII). + + + + Returns the value of index 0 of a given tag as a double. + + Returns the value of index 0 of a given tag as a double. The + caller is responsible for ensuring that the tag is present and + has numeric type (all but TIFF_UNDEFINED and TIFF_ASCII). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the number of image directories (subimages) stored in a + given TIFF file, represented by a SeekableStream. + + + + + + Returns a boolean indicating whether the byte order used in the + the TIFF file is big-endian (i.e. + + + Returns a boolean indicating whether the byte order used in the + the TIFF file is big-endian (i.e. whether the byte order is from + the most significant to the least significant) + + + + + Returns the offset of the IFD corresponding to this + TIFFDirectory. + + + + + Returns the offset of the next IFD after the IFD corresponding to this + TIFFDirectory. + + + + Class that can decode TIFF files. + + + The fill order of the compressed data bytes. + + + + + Reverses the bits in the array + the bits to reverse + + + Class that can decompress TIFF files. + + + The logical order of bits within a byte. + + The logical order of bits within a byte. +
    +            1 = MSB-to-LSB
    +            2 = LSB-to-MSB (flipped)
    +            
    +
    +
    + + Uncompressed mode flag: 1 if uncompressed, 0 if not. + + + + EOL padding flag: 1 if fill bits have been added before an EOL such + that the EOL ends on a byte boundary, 0 otherwise. + + + + Coding dimensionality: 1 for 2-dimensional, 0 for 1-dimensional. + + + + Invokes the superclass method and then sets instance variables on + the basis of the metadata set on this decompressor. + + + + + Flag for 8 bit unsigned integers. + + + Flag for null-terminated ASCII strings. + + + Flag for 16 bit unsigned integers. + + + Flag for 32 bit unsigned integers. + + + Flag for pairs of 32 bit unsigned integers. + + + Flag for 8 bit signed integers. + + + Flag for 8 bit uninterpreted bytes. + + + Flag for 16 bit signed integers. + + + Flag for 32 bit signed integers. + + + Flag for pairs of 32 bit signed integers. + + + Flag for 32 bit IEEE floats. + + + Flag for 64 bit IEEE doubles. + + + The tag number. + + + The tag type. + + + The number of data items present in the field. + + + The field data. + + + The default constructor. + + + + Returns the tag number, between 0 and 65535. + + + Returns the type of the data stored in the IFD. + + Returns the type of the data stored in the IFD. + For a TIFF6.0 file, the value will equal one of the + TIFF_ constants defined in this class. For future + revisions of TIFF, higher values are possible. + + + + Returns the number of elements in the IFD. + + + + + + + + + + + + + + + + + + + + A class for performing LZW decoding. + + + Method to decode LZW compressed data. + The compressed data. + Array to return the uncompressed data in. + The number of rows the compressed data contains. + + + Initialize the string table. + + + Write out the string just uncompressed. + + + Add a new string to the string table. + + + Add a new string to the string table. + + + Append newString to the end of oldString. + + + Exports images as TIFF. + + + + + + + + + + + + + + + Inner class class containing information about a field. + + + + + + + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about a field. + + + Inner class containing info about an ASCII field. + + + Class used to represented the International Color Consortium profile + + + Construct an icc profile from the passed byte[], using the passed number of components. + byte[] containing the raw icc profile data + number of components the profile contains + IccProfile constructed from the data + when the specified number of components and the number of components in the created profile do not match. + + + + Construct an icc profile from the passed byte[], using the passed number of components. + byte[] containing the raw icc profile data + IccProfile constructed from the data + + + Construct an icc profile from the passed random-access file or array. + random-access file or array containing the profile + IccProfile constructed from the data + if the source does not contain a valid icc profile + + + Construct an icc profile from the passed InputStream. + inputstream containing the profile + IccProfile constructed from the data + if the source does not contain a valid icc profile + + + Construct an icc profile from the file found at the passed path + path to the file contaning the profile + IccProfile constructed from the data + if the source does not contain a valid icc profile + + + Get the Color space name of the icc profile found in the data. + byte[] containing the icc profile + String containing the color space of the profile + if the source does not contain a valid icc profile + + + Get the device class of the icc profile found in the data. + byte[] containing the icc profile + String containing the device class of the profile + if the source does not contain a valid icc profile + + + Get the number of color components of the icc profile found in the data. + byte[] containing the icc profile + Number of color components + + + Get the icc color profile data. + byte[] containing the data + + + Get the number of color components in the profile. + number of components + + + a utility that creates a range item for an entire index + where the index is + a range item representing the entire index + + + get a single CID font. + + get a single CID font. The PDF architecture (1.4) + supports 16-bit strings only with CID CFF fonts, not + in Type-1 CFF fonts, so we convert the font to CID if + it is in the Type-1 format. + Two other tasks that we need to do are to select + only a single font from the CFF package (this again is + a PDF restriction) and to subset the CharStrings glyph + description. + + + + A random Access File or an array + + + List items for the linked list that builds the new CID font. + + + remember the current offset and increment by item's size in bytes. + + + Emit the byte stream for this item. + + + Fix up cross references to this item (applies only to markers). + + + set the value of an offset item that was initially unknown. + + set the value of an offset item that was initially unknown. + It will be fixed up latex by a call to xref on some marker. + + + + A range item. + + + An index-offset item for the list. + + An index-offset item for the list. + The size denotes the required size in the CFF. A positive + value means that we need a specific size in bytes (for offset arrays) + and a negative value means that this is a dict item that uses a + variable-size representation. + + + + + TODO To change the template for this generated type comment go to + Window - Preferences - Java - Code Generation - Code and Comments + + + + an unknown offset in a dictionary for the list. + + an unknown offset in a dictionary for the list. + We will fix up the offset later; for now, assume it's large. + + + + Card24 item. + + + Card32 item. + + + A SID or Card16 item. + + + A Card8 item. + + + A dictionary number on the list. + + A dictionary number on the list. + This implementation is inefficient: it doesn't use the variable-length + representation. + + + + An offset-marker item for the list. + + An offset-marker item for the list. + It is used to mark an offset and to set the offset list item. + + + + This Class subsets a CFF Type Font. + + This Class subsets a CFF Type Font. The subset is preformed for CID fonts and NON CID fonts. + The Charstring is subsetted for both types. For CID fonts only the FDArray which are used are embedded. + The Lsubroutines of the FDArrays used are subsetted as well. The Subroutine subset supports both Type1 and Type2 + formatting although only tested on Type2 Format. + For Non CID the Lsubroutines are subsetted. On both types the Gsubroutines is subsetted. + A font which was not of CID type is transformed into CID as a part of the subset process. + The CID synthetic creation was written by Sivan Toledo (sivan@math.tau.ac.il) + + Oren Manor (manorore@post.tau.ac.il) and Ygal Blum (blumygal@post.tau.ac.il) + + + Operator codes for unused CharStrings and unused local and global Subrs + + + The Strings in this array represent Type1/Type2 operator names + + + The Strings in this array represent Type1/Type2 escape operator names + + + + A Map containing the glyphs used in the text after being converted + to glyph number by the CMap + + + + The GlyphsUsed keys as an list + + + A Set for keeping the FDArrays being used by the font + + + A Maps array for keeping the subroutines used in each FontDict + + + The SubroutinesUsed Maps as lists + + + A Map for keeping the Global subroutines used in the font + + + The Global SubroutinesUsed Maps as lists + + + A Map for keeping the subroutines used in a non-cid font + + + The SubroutinesUsed Map as list + + + An array of the new Indexes for the local Subr. + An array of the new Indexes for the local Subr. One index for each FontDict + + + The new subroutines index for a non-cid font + + + The new global subroutines index of the font + + + The new CharString of the font + + + The bias for the global subroutines + + + The linked list for generating the new font stream + + + Number of arguments to the stem operators in a subroutine calculated recursively + + + C'tor for CFFFontSubset + - The font file + - a Map that contains the glyph used in the subset + + + Calculates the length of the charset according to its format + The Charset Offset + Number of glyphs in the font + the length of the Charset + + + Function calculates the number of ranges in the Charset + The number of glyphs in the font + The format of the Charset + The number of ranges in the Charset data structure + + + Read the FDSelect of the font and compute the array and its length + The index of the font being processed + + + Function reads the FDSelect and builds the FDArrayUsed Map According to the glyphs used + the Number of font being processed + + + Read the FDArray count, offsize and Offset array + + + + + The Process function extracts one font out of the CFF file and returns a + subset version of the original. + + - The name of the font to be taken out of the CFF + The new font stream + + + + Function calcs bias according to the CharString type and the count + of the subrs + + The offset to the relevant subrs index + the font + The calculated Bias + + + Function uses BuildNewIndex to create the new index of the subset charstrings + the font + + + + + + The function finds for the FD array processed the local subr offset and its + offset array. + + the font + The FDARRAY processed + + + + + The function reads a subrs (glyph info) between begin and end. + + The function reads a subrs (glyph info) between begin and end. + Adds calls to a Lsubr to the hSubr and lSubrs. + Adds calls to a Gsubr to the hGSubr and lGSubrs. + + the start point of the subr + the end point of the subr + the bias of the Global Subrs + the bias of the Local Subrs + the Map for the lSubrs + the list for the lSubrs + + + + Function Checks how the current operator effects the run time stack after being run + An operator may increase or decrease the stack size + + + + Function checks the key and return the change to the stack after the operator + The change in the stack. 2-> flush the stack + + + Empty the Type2 Stack + + + Pop one element from the stack + + + Add an item to the stack + + + The function reads the next command after the file pointer is set + + + The function reads the subroutine and returns the number of the hint in it. + + The function reads the subroutine and returns the number of the hint in it. + If a call to another subroutine is found the function calls recursively. + + the start point of the subr + the end point of the subr + the bias of the Local Subrs + the bias of the Global Subrs + The Offsets array of the subroutines + The number of hints in the subroutine read. + + + Function builds the new offset array, object array and assembles the index. + + Function builds the new offset array, object array and assembles the index. + used for creating the glyph and subrs subsetted index + + the offset array of the original index + the Map of the used objects + the operator inserted into the data stream for unused entries + the new index subset version + + + + + Function creates the new index, inserting the count,offsetsize,offset array + and object array. + + the subsetted offset array + the subsetted object array + the new index created + + + The function builds the new output stream according to the subset process + the font + the subsetted font stream + + + Function Copies the header from the original fileto the output list + + + Function Build the header of an index + the count field of the index + the offsize field of the index + the first offset of the index + + + Function adds the keys into the TopDict + OffsetItem for the FDArray + OffsetItem for the FDSelect + OffsetItem for the CharSet + OffsetItem for the CharString + + + + Function takes the original string item and adds the new strings + to accommodate the CID rules + + the font + + + Function creates new FDSelect for non-CID fonts. + + Function creates new FDSelect for non-CID fonts. + The FDSelect built uses a single range for all glyphs + + OffsetItem for the FDSelect + the number of glyphs in the font + + + Function creates new CharSet for non-CID fonts. + + Function creates new CharSet for non-CID fonts. + The CharSet built uses a single range for all glyphs + + OffsetItem for the CharSet + the number of glyphs in the font + + + Function creates new FDArray for non-CID fonts. + + Function creates new FDArray for non-CID fonts. + The FDArray built has only the "Private" operator that points to the font's + original private dict + + OffsetItem for the FDArray + OffsetItem for the Private Dict + the font + + + Function reconstructs the FDArray, PrivateDict and LSubr for CID fonts + the font + + + Function subsets the FDArray and builds the new one with new offsets + The font + OffsetItem Array (one for each FDArray) + + + Function Adds the new private dicts (only for the FDs used) to the list + the font + OffsetItem array one element for each private + IndexBaseItem array one element for each private + OffsetItem array one element for each private + + + Function Adds the new LSubrs dicts (only for the FDs used) to the list + The index of the font + The IndexBaseItem array for the linked list + OffsetItem array for the linked list + + + + Calculates how many byte it took to write the offset for the subrs in a specific + private dict. + + The Offset for the private dict + The size of the private dict + The size of the offset of the subrs in the private dict + + + Function computes the size of an index + The offset for the computed index + The size of the index + + + + The function creates a private dict for a font that was not CID + All the keys are copied as is except for the subrs key + + the font + The OffsetItem for the subrs of the private + + + + the function marks the beginning of the subrs index and adds the subsetted subrs + index to the output list. + + the font + IndexBaseItem for the private that's referencing to the subrs + OffsetItem for the subrs + + + The font's encoding name. + + The font's encoding name. This encoding is 'StandardEncoding' or 'AdobeStandardEncoding' for a font + that can be totally encoded according to the characters names. For all other names the font is treated as symbolic. + + + + Get glyph's width. + a unicode symbol or FontSpecif code. + Gets width in normalized 1000 units. + + + Get glyph's bbox. + a unicode symbol or FontSpecif code. + Gets bbox in normalized 1000 units. + + + Gets the kerning between two glyphs. + the first unicode value + the second unicode value + the kerning to be applied + + + Gets the kerning between two glyphs. + the first glyph + the second glyph + the kerning to be applied + + + Gets the name without the modifiers Bold, Italic or BoldItalic. + the full name of the font + the name without the modifiers Bold, Italic or BoldItalic + + + The path to the font resources. + + + Checks if its a valid CJKFont font. + the font name. + the encoding. + + + + if it is CJKFont. + + + + + + + + + + CMap name. + + + CMap name. + CMap to convert Unicode value to CID. + + + psoares + + + psoares + + + + + + + + + psoares + + + psoares + + + Commands have this type. + + + Holds value of property tokeniser. + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + + Parses a single command from the content. + + Parses a single command from the content. Each command is output as an array of arguments + having the command itself as the last element. The returned array will be empty if the + end of content was reached. + + + an + ArrayList + to use. It will be cleared before using. + + on error + + + Reads a dictionary. + + Reads a dictionary. The tokeniser must be positioned past the + "<<" + token. + + the dictionary + on error + + + Reads an array. + Reads an array. The tokeniser must be positioned past the "[" token. + an array + on error + + + Reads a pdf object. + the pdf object + on error + + + Reads the next token skipping over the comments. + + + + if a token was read, + + if the end of content was reached. + + on error. + + + Gets an hex string in the format "<HHHH>". + the number + the hex string + + + psoares + + + psoares + + + + + + + + + psoares + + + + + + + Return String representation of + value + field. + + + + + + + + + + This class represents a CMap file. + Ben Litchfield (ben@benlitchfield.com) + + + Creates a new instance of CMap. + + + This will tell if this cmap has any two byte mappings. + true If there are any two byte mappings, false otherwise. + + + This will perform a lookup into the map. + The code used to lookup. + The offset into the byte array. + The length of the data we are getting. + The string that matches the lookup. + + + + + + + + + + + + psoares + + + The path to the font resources. + + + + Checks if the font with the given name and encoding is one + of the predefined CID fonts. + + the font name. + + + + if it is CJKFont. + + + + + + + + + + + Font constants for + + and PdfFontFactory. + + + + The path to the font resources. + + + Undefined font style. + + + Normal font style. + + + Bold font style. + + + Italic font style. + + + Deprecated. + Deprecated. Will be removed in 7.1 + + + Deprecated. + Deprecated. Will be removed in 7.1 + + + Bold-Italic font style. + + + Type 1 PostScript font. + + + Compact Font Format PostScript font. + + + TrueType or OpenType with TrueType outlines font. + + + CIDFont Type0 (Type1 outlines). + + + CIDFont Type2 (TrueType outlines). + + + OpenType with Type1 outlines. + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + This is a possible value of a base 14 type 1 font + + + + The maximum height above the baseline reached by glyphs in this + font, excluding the height of glyphs for accented characters. + + + + + The y coordinate of the top of flat capital letters, measured from + the baseline. + + + + + The maximum depth below the baseline reached by glyphs in this + font. + + + The maximum depth below the baseline reached by glyphs in this + font. The value is a negative number. + + + + + The angle, expressed in degrees counterclockwise from the vertical, + of the dominant vertical strokes of the font. + + + The angle, expressed in degrees counterclockwise from the vertical, + of the dominant vertical strokes of the font. The value is + negative for fonts that slope to the right, as almost all italic fonts do. + + + + The lower left x glyph coordinate. + + + The lower left y glyph coordinate. + + + The upper right x glyph coordinate. + + + The upper right y glyph coordinate. + + + AWT Font property. + + + AWT Font property. + + + AWT Font property. + + + AWT Font property. + + + The underline position. + The underline position. Usually a negative value. + + + The underline thickness. + + + The strikethrough position. + + + The strikethrough thickness. + + + The recommended vertical size for subscripts for this font. + + + The recommended vertical offset from the baseline for subscripts for this font. + The recommended vertical offset from the baseline for subscripts for this font. Usually a negative value. + + + + The recommended vertical size for superscripts for this font. + + + The recommended vertical offset from the baseline for superscripts for this font. + + + The weight class of the font, as defined by the font author. + + + The width class of the font, as defined by the font author. + + + The entry of PDF FontDescriptor dictionary. + + The entry of PDF FontDescriptor dictionary. + (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) + The weight (thickness) component of the fully-qualified font name or font specifier. + A value larger than 500 indicates bold font-weight. + + + + A not defined character in a custom PDF encoding. + + + The code pages possible for a True Type font. + + + Base font encoding. + + + + + if the font must use its built in encoding. In that case + the + encoding + is only used to map a char to the position inside the font, not to the expected char name. + + + + Mapping map from unicode to simple code according to the encoding. + + + Encoding names. + + + Encodings unicode differences + + + This encoding will base on font encoding (FontSpecific encoding in Type 1 terminology) + + + Gets unicode value for corresponding font's char code. + font's char code + -1, if the char code unsupported or valid unicode. + + + + Converts a + String + to a + byte + array according to the encoding. + String could contain a unicode symbols or font specific codes. + + + the + String + to be converted. + + + an array of + byte + representing the conversion according to the encoding + + + + + Converts a unicode symbol or font specific code + to + byte + according to the encoding. + + a unicode symbol or FontSpecif code to be converted. + + a + byte + representing the conversion according to the encoding + + + + + Check whether a unicode symbol or font specific code can be converted + to + byte + according to the encoding. + + a unicode symbol or font specific code to be checked. + + + + if + ch + could be encoded. + + + + + Check whether a + byte + code can be converted + to unicode symbol according to the encoding. + + a byte code to be checked. + + + + if + + could be decoded. + + + + Normalize the encoding names. + + Normalize the encoding names. "winansi" is changed to "Cp1252" and + "macroman" is changed to "MacRoman". + + the encoding to be normalized + the normalized encoding + + + Extracts the names of the font in all the languages available. + the name id to retrieve in OpenType notation + + not empty + String[][] + if any names exists, otherwise + + . + + + + + + + + + + + + + + + + + + + Provides methods for creating various types of fonts. + + + This is the default value of the cached variable. + + + Creates a new standard Helvetica font program file. + + a + + object with Helvetica font description + + + + + Creates a new font program. + + Creates a new font program. This font program can be one of the 14 built in fonts, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or one from collection) or + a CJK font from the Adobe Asian Font Pack. + TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType Collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

    + The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

    + + the name of the font or its location on file + + returns a new + + . This font program may come from the cache + + + + +

    Creates a new font program. + + Creates a new font program. This font program can be one of the 14 built in fonts, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or one from collection) or + a CJK font from the Adobe Asian Font Pack. + TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType Collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

    + The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

    + + the name of the font or its location on file + whether to to cache this font program after it has been loaded + + returns a new + + . This font program may come from the cache + + + + +

    Creates a new font program. + + Creates a new font program. This font program can be one of the 14 built in fonts, + a Type1 font referred to by an AFM or PFM file, a TrueType font (simple only) or + a CJK font from the Adobe Asian Font Pack. + TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType Collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

    + The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

    + + the byte contents of the font program + + returns a new + + . This font program may come from the cache + + + + +

    Creates a new font program. + + Creates a new font program. This font program can be one of the 14 built in fonts, + a Type 1 font referred to by an AFM or PFM file, a TrueType font (simple only) or + a CJK font from the Adobe Asian Font Pack. + TrueType fonts and CJK fonts can have an optional style modifier + appended to the name. These modifiers are: Bold, Italic and BoldItalic. An + example would be "STSong-Light,Bold". Note that this modifiers do not work if + the font is embedded. Fonts in TrueType Collections are addressed by index such as "msgothic.ttc,1". + This would get the second font (indexes start at 0), in this case "MS PGothic". +

    + The fonts are cached and if they already exist they are extracted from the cache, + not parsed again. +

    + + the byte contents of the font program + whether to to cache this font program + + returns a new + + . This font program may come from the cache + + + + +

    This method is deprecated and will be made private in 7.1 + +
    + + This method is deprecated and will be completely removed in 7.1 + + + + Creates a new Type 1 font by the byte contents of the corresponding AFM/PFM and PFB files + the contents of the AFM or PFM metrics file + the contents of the PFB file + + created + + instance + + + + + Creates a new Type 1 font by the byte contents of the corresponding AFM/PFM and PFB files + the contents of the AFM or PFM metrics file + the contents of the PFB file + + specifies whether to cache the created + + or not + + + created + + instance + + + + + Creates a new Type 1 font by the corresponding AFM/PFM and PFB files + path to the AFM or PFM metrics file + path to the contents of the PFB file + + created + + instance + + + + + Creates a new Type 1 font by the corresponding AFM/PFM and PFB files + path to the AFM or PFM metrics file + path to the contents of the PFB file + + specifies whether to cache the created + + or not + + + created + + instance + + + + + Creates a new TrueType font program from ttc (TrueType Collection) file. + location of TrueType Collection file (*.ttc) + the index of the font file from the collection to be read + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + + returns a new + + instance. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + + + + Creates a new TrueType font program from ttc (TrueType Collection) file bytes. + the content of a TrueType Collection file (*.ttc) + the index of the font file from the collection to be read + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + + returns a new + + instance. This font may come from the cache but only if cached + is true, otherwise it will always be created new + + + + + Creates a FontProgram from the font file that has been previously registered. + + either a font alias, if the font file has been registered with an alias, + or just a font name otherwise + + + the style of the font to look for. Possible values are listed in + + . + See + + , + + , + + , + + , + + + whether to try to get the font program from cache + + created + + + + + + Creates a FontProgram from the font file that has been previously registered. + + either a font alias, if the font file has been registered with an alias, + or just a font name otherwise + + + the style of the font to look for. Possible values are listed in + + . + See + + , + + , + + , + + , + + + + created + + + + + + Creates a FontProgram from the font file that has been previously registered. + + either a font alias, if the font file has been registered with an alias, + or just a font name otherwise + + + created + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + In case if TrueType Collection (.ttc), an additional parameter may be specified defining the index of the font + to be registered, e.g. "path/to/font/collection.ttc,0". The index is zero-based. + + the path to a font file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Register all the fonts in a directory. + the directory + the number of fonts registered + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font names. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found + + + + + + + If you are using True Type fonts, you can declare the paths of the different ttf- and ttc-files + to this class first and then create fonts in your code using one of the getFont method + without having to enter a path as parameter. + + + + This is a map of postscriptfontnames of fonts and the path of their font file. + + + This is a map of fontfamilies. + + + Creates new FontRegisterProvider + + + Constructs a Font-object. + the name of the font + the style of this font + the Font constructed based on the parameters + + + + Constructs a Font-object. + the name of the font + the style of this font + + true if the font comes from the cache or is added to + the cache if new, false if the font is always created new + + the Font constructed based on the parameters + + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Register a font file, either .ttf or .otf, .afm or a font from TrueType Collection. + + Register a font file, either .ttf or .otf, .afm or a font from TrueType Collection. + If a TrueType Collection is registered, an additional index of the font program can be specified + + the path to a ttf- or ttc-file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Register all the fonts in a directory. + the directory + the number of fonts registered + + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font names. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found + + + + Classes implementing this interface can create custom encodings or + replace existing ones. + + + Classes implementing this interface can create custom encodings or + replace existing ones. It is used in the context of PdfEncoding. + + Paulo Soares + + + Converts an Unicode string to a byte array according to some encoding. + the Unicode string + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + Converts an Unicode char to a byte array according to some encoding. + the Unicode char + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + Converts a byte array to an Unicode string according to some encoding. + the input byte array + + the requested encoding. It's mainly of use if the same class + supports more than one encoding. + + the conversion or null if no conversion is supported + + + The file name. + + + The file in use. + + + The index for the TTC font. + + The index for the TTC font. It is -1 + int + for a TTF file. + + + + The offset from the start of the file to the table directory. + + The offset from the start of the file to the table directory. + It is 0 for TTF and may vary for TTC depending on the chosen font. + + + + The font name. + The font name. This name is usually extracted from the table 'name' with the 'Name ID' 6. + + + All the names of the Names-Table. + + + Indicate, that the font contains 'CFF ' table. + + + Offset to 'CFF ' table. + + + Length of 'CFF ' table. + + + Contains the location of the several tables. + + Contains the location of the several tables. The key is the name of + the table and the value is an int[2] where position 0 + is the offset from the start of the file and position 1 is the length + of the table. + + + + + + + + + + + + + + + + Gets the Postscript font name. + + + + + + + If this font file is using the Compact Font File Format, then this method + will return the raw bytes needed for the font stream. + + + If this font file is using the Compact Font File Format, then this method + will return the raw bytes needed for the font stream. If this method is + ever made public: make sure to add a test if (cff == true). + + a byte array + + + + + + + + + + + + + Reads the font data. + if true, all tables will be read, otherwise only 'head', 'name', and 'os/2'. + + + + Reads the font data. + + + + Gets the name from a composed TTC file name. + + Gets the name from a composed TTC file name. + If I have for input "myfont.ttc,2" the return will + be "myfont.ttc". + + the full name + the simple file name + + + Reads the glyphs widths. + + Reads the glyphs widths. The widths are extracted from the table 'hmtx'. + The glyphs are normalized to 1000 units (TrueTypeFont.UNITS_NORMALIZATION). + Depends from + hhea.numberOfHMetrics + property, + HorizontalHeader + and + head.unitsPerEm + property, + HeaderTable + . + + the font file could not be read. + + + Reads the kerning information from the 'kern' table. + + + head.unitsPerEm + property, + HeaderTable + . + + the font file could not be read + + + Read the glyf bboxes from 'glyf' table. + + + head.unitsPerEm + property, + HeaderTable + . + + the font is invalid. + the font file could not be read. + + + + + + Extracts the names of the font in all the languages available. + on error + on error + + + Read horizontal header, table 'hhea'. + the font is invalid. + the font file could not be read. + + + Read font header, table 'head'. + the font is invalid. + the font file could not be read. + + + Reads the windows metrics table. + + Reads the windows metrics table. The metrics are extracted from the table 'OS/2'. + Depends from + head.unitsPerEm + property, + HeaderTable + . + + the font is invalid. + the font file could not be read. + + + + + + Reads the several maps from the table 'cmap'. + + Reads the several maps from the table 'cmap'. The maps of interest are 1.0 for symbolic + fonts and 3.1 for all others. A symbolic font is defined as having the map 3.0. + Depends from + readGlyphWidths() + . + + the font file could not be read + + + + Reads a String from the font file as bytes using the Cp1252 + encoding. + + the length of bytes to read + the String read + the font file could not be read + + + Reads a Unicode String from the font file. + Reads a Unicode String from the font file. Each character is represented by two bytes. + + the length of bytes to read. The String will have length/2 characters. + + the String read. + the font file could not be read. + + + Gets a glyph width. + the glyph to get the width of + the width of the glyph in normalized 1000 units (TrueTypeFont.UNITS_NORMALIZATION) + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 0 is the Apple standard character to glyph index mapping table. + + a HashMap representing this map + the font file could not be read + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 4 is the Microsoft standard character to glyph index mapping table. + + a HashMap representing this map + the font file could not be read + + + The information in the maps of the table 'cmap' is coded in several formats. + + The information in the maps of the table 'cmap' is coded in several formats. + Format 6 is a trimmed table mapping. It is similar to format 0 but can have + less than 256 entries. + + a HashMap representing this map + the font file could not be read + + + + + + The components of table 'head'. + + + The components of table 'hhea'. + + + The components of table 'OS/2'. + + + The italic angle. + + The italic angle. It is usually extracted from the 'post' table or in it's + absence with the code: +
    +            -Math.atan2(hhea.caretSlopeRun, hhea.caretSlopeRise) * 180 / Math.PI
    +            
    +
    +
    + + true if all the glyphs have the same width. + + + The map containing the code information for the table 'cmap', encoding 1.0. + + The map containing the code information for the table 'cmap', encoding 1.0. + The key is the code and the value is an + int[2] + where position 0 + is the glyph number and position 1 is the glyph width normalized to 1000 units. + TrueTypeFont.UNITS_NORMALIZATION + . + + + + The map containing the code information for the table 'cmap', encoding 3.1 in Unicode. + + The map containing the code information for the table 'cmap', encoding 3.1 in Unicode. + The key is the code and the value is an + int[2] + where position 0 + is the glyph number and position 1 is the glyph width normalized to 1000 units. + TrueTypeFont.UNITS_NORMALIZATION + . + + + + length of the context glyph sequence defined by this rule. + + + + an array of SubstLookupRecord. Each record specifies a position in the context glyph + sequence and a LookupListIndex to the substitution lookup that is applied at that position. + + + + Checks if glyph line element matches element from input sequence of the rule. + + Checks if glyph line element matches element from input sequence of the rule. +

    + NOTE: rules do not contain the first element of the input sequence, the first element is defined by rule + position in substitution table. Therefore atIdx shall not be 0. +
    + index in the rule sequence. Shall be: 0 < atIdx < ContextualSubstRule.getContextLength(). + +
    + + length of the lookahead context glyph sequence defined by this rule. + + + length of the backtrack context glyph sequence defined by this rule. + + + Checks if glyph line element matches element from lookahead sequence of the rule. + index in rule sequence. Shall be: 0 <= atIdx < ContextualSubstRule.getLookaheadContextLength(). + + + + Checks if glyph line element matches element from backtrack sequence of the rule. + index in rule sequence. Shall be: 0 <= atIdx < ContextualSubstRule.getBacktrackContextLength(). + + + + Gets a most preferable context rule that matches the line at current position. + + Gets a most preferable context rule that matches the line at current position. If no matching context rule is found, + it returns null. +

    + NOTE: if matching context rule is found, the GlyphLine.start and GlyphLine.end will be + changed in such way, that they will point at start and end of the matching context glyph sequence inside the glyph line. +
    + a line, which is to be checked if it matches some context. + matching context rule or null, if none was found. +
    + + Gets a set of rules, which start with given glyph id. + id of the first glyph in the sequence. + + + Checks if given glyph line at the given position matches given rule. + + either index which corresponds to the last glyph of the matching context inside the glyph line if context matches, + or -1 if context doesn't match. + + + + psoares + + +
    Palash Ray + + + Construct a non-mark Glyph, retrieving characters from unicode. + code representation of the glyph in the font file + normalized width of the glyph + utf-32 representation of glyph if appears. Correct value is > -1 + + + Construct a non-mark Glyph, using the codepoint of the characters as unicode point. + code representation of the glyph in the font file + normalized width of the glyph + The Unicode text represented by this Glyph. + + + Construct a non-mark Glyph, retrieving characters from unicode. + code representation of the glyph in the font file + normalized width of the glyph + utf-32 representation of glyph if appears. Correct value is > -1 + The normalized bounding box of this Glyph. + + + Construct a non-mark Glyph object with id -1 and characters retrieved from unicode. + normalized width of the glyph + utf-32 representation of glyph if appears. Correct value is > -1 + + + Construct a glyph object form the passed arguments. + code representation of the glyph in the font file + normalized width of the glyph + utf-32 representation of glyph if appears. Correct value is > -1 + + The Unicode text represented by this Glyph. + if null is passed, the unicode value is used to retrieve the chars. + + True if the glyph is a Mark + + + Copy a Glyph. + Glyph to copy + + + Copy a Glyph and assign new placement and advance offsets and a new index delta to base glyph + Glyph to copy + x - placement offset + y - placement offset + x - advance offset + y - advance offset + Index delta to base glyph. If after a glyph there are several anchored glyphs we should know we to find base glyph. + + + + Copy a glyph and assign the copied glyph a new unicode point and characters + glyph to copy + new unicode point + + + Two Glyphs are equal if their unicode characters, code and normalized width are equal. + + True if this equals obj cast to Glyph, false otherwise. + + + Gets a Unicode string corresponding to this glyph. + + Gets a Unicode string corresponding to this glyph. In general case it might consist of many characters. + If this glyph does not have a valid unicode ( + #hasValidUnicode() + , then a string consisting of a special + Unicode '\ufffd' character is returned. + + the Unicode string that corresponds to this glyph + + + Gets Unicode char sequence corresponding to this glyph. + + Gets Unicode char sequence corresponding to this glyph. In general case it might consist of many characters. + If this glyph does not have a valid unicode ( + #hasValidUnicode() + , then a special Unicode '\ufffd' character is returned. + + the Unicode char sequence that corresponds to this glyph + + + Create a new line of Glyphs. + list containing the glyphs + + + Create a new line of Glyphs from a slice of a List of Glyphs. + list of Glyphs to slice + starting index of the slice + terminating index of the slice + + + Create a new line of Glyphs from a slice of a List of Glyphs, and add the actual text. + list of Glyphs to slice + corresponding list containing the actual text the glyphs represent + starting index of the slice + terminating index of the slice + + + Copy a line of Glyphs. + line of Glyphs to copy + + + Copy a slice of a line of Glyphs + line of Glyphs to copy + starting index of the slice + terminating index of the slice + + + Get the unicode string representation of the GlyphLine slice. + starting index of the slice + terminating index of the slice + String containing the unicode representation of the slice. + + + Copy a slice of this Glyphline. + leftmost index of the slice + rightmost index of the slice + new GlyphLine containing the copied slice + + + + Palash Ray + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the starting point of the class. + + This is the starting point of the class. A sub-class must call this + method to start getting call backs to the + + method. + + + + + + + + + + + + + + + + + + + + + + + + + + Lookup Type 2: + Pair Adjustment Positioning Subtable + + + + psoares + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lookup Type 4: + MarkToBase Attachment Positioning Subtable + + + + + + + + + + + Lookup Type 5: + MarkToLigature Attachment Positioning Subtable + + + + + + + + + + + Lookup Type 6: + MarkToMark Attachment Positioning Subtable + + + + + + + + + + LookupType 1: Single Substitution Subtable + psoares + + + + + + + + + LookupType 2: Multiple Substitution Subtable + + + + + + + + + LookupType 3: Alternate Substitution Subtable + psoares + + + + + + + + + LookupType 4: Ligature Substitution Subtable + psoares + + + The key is the first character. + + The key is the first character. The first element in the int array is the + output ligature + + + + + + + + + + LookupType 5: Contextual Substitution Subtable + + + + + + + + + + + + + + + + + + LookupType 6: Chaining Contextual Substitution Subtable + + + + + + + + + + + + + + + Contextual Substitution Subtable: Simple context glyph substitution + + + Contextual Substitution Subtable: Class-based context glyph substitution + + + Contextual Substitution Subtable: Coverage-based context glyph substitution + + + Checks if given glyph line at the given position matches given rule. + + + Checks if given glyph line at the given position matches given rule. + + + Chaining Contextual Substitution Subtable: Simple Chaining Context Glyph Substitution + + + Chaining Contextual Substitution Subtable: Class-based Chaining Context Glyph Substitution + + + Chaining Contextual Substitution Subtable: Coverage-based Chaining Context Glyph Substitution + + + psoares + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Unicode encoding with horizontal writing. + + + The Unicode encoding with vertical writing. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + A possible encoding. + + + This is the encoding to be used to output text in Unicode. + + + This is the encoding to be used to output text for Identity-H/V CMaps. + + + + This is the default encoding to be used for converting Strings into + bytes and vice versa. + + + This is the default encoding to be used for converting Strings into + bytes and vice versa. The default encoding is PDF_DOC_ENCODING. + + + + + Converts a + String + to a + byte + array according + to the font's encoding. + + the encoding + + the + String + to be converted + + + an array of + byte + representing the conversion according to the font's encoding + + + + + Converts a + String + to a + byte + array according + to the font's encoding. + + the encoding + + the + char + to be converted + + + an array of + byte + representing the conversion according to the font's encoding + + + + + Converts a + byte + array to a + String + according + to the some encoding. + + the bytes to convert + the encoding + + the converted + String + + + + + Checks is + + only has PDF_DOC_ENCODING characters. + + + the + String + to test + + + + + if only PDF_DOC_ENCODING characters are present + + + + Adds an extra encoding. + the name of the encoding. The encoding recognition is case insensitive + the conversion class + + + Converts a PFM file into an AFM file. + + + Creates a new instance of Pfm2afm + + + + Converts a PFM file into an AFM file. + the PFM file + the AFM file + on error + + + + + + + + + + + + + + + + + + + + + Translate table from 1004 to psstd. + + Translate table from 1004 to psstd. 1004 is an extension of the + Windows translate table used in PM. + + + + Windows character names. + + Windows character names. Give a name to the used locations + for when the all flag is specified. + + + + Use this class for working with true type collection font (*.ttc) + + + + + + + Creates a new + + instance by its bytes. + + the byte contents of the collection + in case the input in mal-formatted + + + + + + + Creates a new + + instance by its file path. + + the path of the collection + in case the input in mal-formatted + + + method return TrueTypeFont by ttc index + the index for the TTC font + TrueTypeFont + + + + returns the number of fonts in True Type Collection (file or bytes array) + returns the number of fonts + + + + Indicates if fonts created by the call to + + will be cached or not. + + true if the created fonts will be cached, false otherwise + + + + Sets if fonts created by the call to + + will be cached or not. + + true if the created fonts will be cached, false otherwise + + + + + + The map containing the kerning information. + + The map containing the kerning information. It represents the content of + table 'kern'. The key is an Integer where the top 16 bits + are the glyph number for the first character and the lower 16 bits are the + glyph number for the second character. The value is the amount of kerning in + normalized 1000 units as an Integer. This value is usually negative. + + + + + + + + + + + + + + + + Gets the kerning between two glyphs. + the first glyph + the second glyph + the kerning to be applied + + + The offset from the start of the file to the table directory. + + The offset from the start of the file to the table directory. + It is 0 for TTF and may vary for TTC depending on the chosen font. + + + + + + + + + + + + + + + + Gets the code pages supported by the font. + the code pages supported by the font + + + + + + Subsets a True Type font by removing the unneeded glyphs from the font. + Paulo Soares + + + Contains the location of the several tables. + + Contains the location of the several tables. The key is the name of + the table and the value is an + int[3] + where position 0 + is the checksum, position 1 is the offset from the start of the file + and position 2 is the length of the table. + + + + The file in use. + + + The file name. + + + Creates a new TrueTypeFontSubSet + The offset from the start of the file to the table directory + the file name of the font + the glyphs used + + + + if the table cmap is to be included in the generated font + + + + Does the actual work of subsetting the font. + the subset font + on error + error + + + + + + + + + + + + + + + + + + + + + + Reads a + String + from the font file as bytes using the Cp1252 encoding. + + the length of bytes to read + + the + String + read + + the font file could not be read + + + Represents the section KernPairs in the AFM file. + + Represents the section KernPairs in the AFM file. + Key is uni1<<32 + uni2. Value is kerning value. + + + + Types of records in a PFB file. + Types of records in a PFB file. ASCII is 1 and BINARY is 2. They have to appear in the PFB file in this sequence. + + + + + + + + + + Checks if the font has any kerning pairs. + + + + if the font has any kerning pairs. + + + + Sets the kerning between two Unicode chars. + the first unicode char. + the second unicode char. + the kerning to apply in normalized 1000 units. + + + + if the kerning was applied, + + otherwise. + + + + Find glyph by glyph name. + Glyph name + Glyph instance if found, otherwise null. + + + + + + Creates a new Type1 font file. + the AFM file if the input is made with a byte array + the PFB file if the input is made with a byte array + the name of one of the 14 built-in fonts or the location of an AFM file. The file must end in '.afm' + + AFM file is invalid + the AFM file could not be read + + + + + + + + + + + + a static that is used for attributing a unique id to each image. + + + Checks if image can be inline + if the image can be inline + + + Load data from URL. + + Load data from URL. url must be not null. + Note, this method doesn't check if data or url is null. + + + + + Creates a new serial id. + the new serialId + + + Pure two-dimensional encoding (Group 4) + + + Pure one-dimensional encoding (Group 3, 1-D) + + + Mixed one- and two-dimensional encoding (Group 3, 2-D) + + + + A flag indicating whether 1-bits are to be interpreted as black pixels + and 0-bits as white pixels, + + + + + A flag indicating whether the filter expects extra 0-bits before each + encoded line so that the line begins on a byte boundary. + + + + + A flag indicating whether end-of-line bit patterns are required to be + present in the encoding. + + + + + A flag indicating whether the filter expects the encoded data to be + terminated by an end-of-block pattern, overriding the Rows parameter. + + + A flag indicating whether the filter expects the encoded data to be + terminated by an end-of-block pattern, overriding the Rows parameter. The + use of this flag will set the key /EndOfBlock to false. + + + + size of the image + + + True if the bitmap image does not contain a header + + + Process the passed Image data as a BMP image. + + Process the passed Image data as a BMP image. + Image is loaded and all image attributes are initialized and/or updated + + the image to process as a BMP image + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets an instance of an Image from a java.awt.Image + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + RawImage + + + + + Gets an instance of an Image from a System.Drwaing.Image. + + the System.Drawing.Image to convert + + if different from null the transparency + pixels are replaced by this color + + if true the image is treated as black and white + an object of type ImgRaw + + + + Converts a .NET image to a Native(PNG, JPG, GIF, WMF) image + + + + + + + Load data by URL. + + Load data by URL. url must be not null. + Note, this method doesn't check if data or url is null. + + + + + Reads image source and fills GifImage object with parameters (frames, width, height) + GifImage + + + Reads image source and fills GifImage object with parameters (frames, width, height) + GifImage + the last frame of the gif image should be read + + + + + + Reads GIF file header information. + + + + Reads Logical Screen Descriptor + + + + Reads next 16-bit value, LSB first + + + + Reads next variable length block from input. + number of bytes stored in "buffer" + + + + + + + + + + Reads next frame image + + + + + + + Reads Graphics Control Extension values + + + + + Skips variable length blocks up to and including + next zero length block. + + + + + Create an ImageData instance representing the image from the image bytes. + byte representation of the image. + whether to recover from a image error (for TIFF-images) + The created ImageData object. + + + Create an ImageData instance representing the image from the image bytes. + byte representation of the image. + The created ImageData object. + + + Create an ImageData instance representing the image from the file located at the specified url. + location of the image + whether to recover from a image error (for TIFF-images) + The created ImageData object. + + + Create an ImageData instance representing the image from the file located at the specified url. + location of the image + The created ImageData object. + + + Create an ImageData instance representing the image from the specified file. + filename of the file containing the image + whether to recover from a image error (for TIFF-images) + The created ImageData object. + + + + Create an ImageData instance representing the image from the specified file. + filename of the file containing the image + The created ImageData object. + + + + Create an ImageData instance from the passed parameters. + width of the image in pixels + height of the image in pixels + whether to reverse the bits stored in data (TIFF images). + Type of CCITT encoding + colour space parameters + array containing raw image data + array containing transparency information + created ImageData object. + + + Create an ImageData instance from the passed parameters. + width of the image in pixels + height of the image in pixels + colour space components + bits per colour. + array containing raw image data + array containing transparency information + created ImageData object. + + + Gets an instance of an Image from a java.awt.Image + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + RawImage + + + + Gets an instance of an Image from a java.awt.Image. + the java.awt.Image to convert + if different from null the transparency pixels are replaced by this color + + if true the image is treated as black and white + RawImage + + + + Get a bitmap ImageData instance from the specified url. + location of the image. + Whether the image contains a header. + size of the image + created ImageData. + + + Get a bitmap ImageData instance from the provided bytes. + array containing the raw image data + Whether the image contains a header. + size of the image + created ImageData. + + + Return a GifImage object. + Return a GifImage object. This object cannot be added to a document + array containing the raw image data + GifImageData instance. + + + Returns a specified frame of the gif image + url of gif image + number of frame to be returned + GifImageData instance. + + + Returns a specified frame of the gif image + byte array of gif image + number of frame to be returned + + + + Returns List of gif image frames + byte array of gif image + array of frame numbers of gif image + + + + Returns List of gif image frames + url of gif image + array of frame numbers of gif image + + + + Returns List of gif image frames + byte array of gif image + all frames of gif image + + + Returns List of gif image frames + url of gif image + all frames of gif image + + + Create a ImageData instance from a Jpeg image url + + + + + Checks if the type of image (based on first 8 bytes) is supported by factory. +
    +
    + Note:if this method returns true it doesn't means that won't throw exception +
    + image raw bytes + true if first eight bytes are recognised by factory as valid image type and false otherwise +
    + + Gets the number of pages in a JBIG2 image. + a byte array containing a JBIG2 image + the number of pages + + + Gets the number of pages in a JBIG2 image. + + a + RandomAccessFileOrArray + containing a JBIG2 image + + the number of pages + + + + Gets a byte array that can be used as a /JBIG2Globals, + or null if not applicable to the given jbig2. + + an random access file or array + a byte array + + + This method checks if the image is a valid JPEG and processes some parameters. + + + + + + + + + + + + This is a type of marker. + + + This is a type of marker. + + + This is a type of marker. + + + This is a type of marker. + + + Marker value + + + Marker value + + + Marker value + + + Marker value for Photoshop IRB + + + Acceptable Jpeg markers. + + + Unsupported Jpeg markers. + + + Jpeg markers without additional parameters. + + + sequence that is used in all Jpeg files + + + sequence preceding Photoshop resolution data + + + Process the passed Image data as a JPEG image. + + Process the passed Image data as a JPEG image. + Image is loaded and all image attributes are initialized and/or updated. + + the image to process as a JPEG image + + + This method checks if the image is a valid JPEG and processes some parameters. + + + + + Reads a short from the InputStream. + the InputStream + an int + + + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + A PNG marker. + + + Some PNG specific values. + + + + + + + + + Gets an int from an InputStream. + an InputStream + the value of an int + + + + Gets a word from an InputStream. + an InputStream + the value of an int + + + + Gets a String from an InputStream. + an InputStream + the value of an int + + + + Update original image with Raw Image parameters. + the exact width of the image + the exact height of the image + 1,3 or 4 for GrayScale, RGB and CMYK + bits per component. Must be 1,2,4 or 8 + the image data + on error + + + Gets the number of pages the TIFF document has. + + a + RandomAccessFileOrArray + containing a TIFF image. + + the number of pages. + + + Gets the number of pages the TIFF document has. + a byte array containing a TIFF image. + the number of pages. + + + Processes the ImageData as a TIFF image. + image to process. + + + + + + Exception class for exceptions in io module. + + + Object for more details + + + Creates a new IOException. + the detail message. + + + Creates a new IOException. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new IOException. + the detail message. + an object for more details. + + + Creates a new IOException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of IOException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + an object for more details. + + + Gets additional params for Exception message. + + + Sets additional params for Exception message. + additional params. + object itself. + + + + + + Class containing constants to be used in logging. + + + + LoggerFactory can be used to set a logger. The logger should be created by + implementing . In the implementation users can choose how they + log received messages. Added for developers. For some cases it can be handy + to receive logging statements while developing applications with iText + + redlab_b + + + + The no-operation logger, it does nothing with the received logging + statements. And returns false by default for , + , , and + . + + redlab_b + + + A RandomAccessSource that is based on an underlying byte array + + + Represents an abstract source that bytes can be read from. + + Represents an abstract source that bytes can be read from. This class forms the foundation for all byte input in iText. + Implementations do not keep track of a current 'position', but rather provide absolute get methods. Tracking position + should be handled in classes that use RandomAccessSource internally (via composition). + + + + Gets a byte at the specified position + byte position + the byte, or -1 if EOF is reached + in case of any reading error. + + + Read an array of bytes of specified length from the specified position of source to the buffer applying the offset. + + + Read an array of bytes of specified length from the specified position of source to the buffer applying the offset. + If the number of bytes requested cannot be read, all the possible bytes will be read to the buffer, + and the number of actually read bytes will be returned. + + the position in the RandomAccessSource to read from + output buffer + offset into the output buffer where results will be placed + the number of bytes to read + the number of bytes actually read, or -1 if the file is at EOF + in case of any I/O error. + + + Gets the length of the source + the length of this source + + + Closes this source. + Closes this source. The underlying data structure or source (if any) will also be closed + + + + + + + + Fill + ByteBuffer + from the end. + Set byte at + capacity() - size() - 1 + position. + + + + byte + . + + + + ByteBuffer + . + + + + + Fill + ByteBuffer + from the end. + Set bytes from + capacity() - size() - b.length + position. + + + + byte + . + + + + ByteBuffer + . + + + + + Summary description for DeflaterOutputStream. + + + + Constructs a new OffsetRandomAccessSource + the source + + + + + + + + + + + + + + Does nothing - the underlying source is not closed + + + + + A RandomAccessSource that is based on a set of underlying sources, + treating the sources as if they were a contiguous block of data. + + + + The underlying sources (along with some meta data to quickly determine where each source begins and ends) + + + + Cached value to make multiple reads from the same underlying source more efficient + + + Cached size of the underlying channel + + + + Constructs a new + + based on the specified set of sources + + the sources used to build this group + + + + For a given offset, return the index of the source that contains the specified offset. + + For a given offset, return the index of the source that contains the specified offset. + This is an optimization feature to help optimize the access of the correct source without having to iterate + through every single source each time. It is safe to always return 0, in which case the full set of sources + will be searched. + Subclasses should override this method if they are able to compute the source index more efficiently + (for example + + takes advantage of fixed size page buffers to compute the index) + + the offset + the index of the input source that contains the specified offset, or 0 if unknown + + + + Returns the SourceEntry that contains the byte at the specified offset + sourceReleased is called as a notification callback so subclasses can take care of cleanup + when the source is no longer the active source + + the offset of the byte to look for + the SourceEntry that contains the byte at the specified offset + if there is a problem with IO (usually the result of the sourceReleased() call) + + + + Called when a given source is no longer the active source. + Called when a given source is no longer the active source. This gives subclasses the abilty to release resources, if appropriate. + + the source that is no longer the active source + if there are any problems + + + Called when a given source is about to become the active source. + Called when a given source is about to become the active source. This gives subclasses the abilty to retrieve resources, if appropriate. + + the source that is about to become the active source + if there are any problems + + + + + The source that contains the byte at position is retrieved, the correct offset into that source computed, then the value + from that offset in the underlying source is returned. + + + + + + + + + + + + + +
    + Closes all of the underlying sources. +
    + +
    + + Used to track each source, along with useful meta data + + + The underlying source + + + The first byte (in the coordinates of the GroupedRandomAccessSource) that this source contains + + + The last byte (in the coordinates of the GroupedRandomAccessSource) that this source contains + + + The index of this source in the GroupedRandomAccessSource + + + Standard constructor + the index + the source + the offset of the source in the GroupedRandomAccessSource + + + Given an absolute offset (in the GroupedRandomAccessSource coordinates), calculate the effective offset in the underlying source + + the offset in the parent GroupedRandomAccessSource + the effective offset in the underlying source + + + A RandomAccessSource that is wraps another RandomAccessSource but does not propagate close(). + + A RandomAccessSource that is wraps another RandomAccessSource but does not propagate close(). This is useful when + passing a RandomAccessSource to a method that would normally close the source. + + + + The source + + + Constructs a new IndependentRandomAccessSource object + the source + + + + + + + + + + + + + + Does nothing - the underlying source is not closed + + + + + + + + + + + + + + + + Streams are closed automatically. + + + + Creates a PdfTokenizer for the specified + + . + The beginning of the file is read to determine the location of the header, and the data source is adjusted + as necessary to account for any junk that occurs in the byte source before the header + + the source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resolve escape symbols or hexadecimal symbols. + + Resolve escape symbols or hexadecimal symbols. +

    + NOTE Due to PdfReference 1.7 part 3.2.3 String value contain ASCII characters, + so we can convert it directly to byte array. + + + byte[] for decrypting or for creating + + . + + + +

    Resolve escape symbols or hexadecimal symbols. + + Resolve escape symbols or hexadecimal symbols. +

    + NOTE Due to PdfReference 1.7 part 3.2.3 String value contain ASCII characters, + so we can convert it directly to byte array. + + + byte[] for decrypting or for creating + + . + + + +

    Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'. + + + Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'. +
    The same as calling + isWhiteSpace(ch, true) + . +
    + int + boolean +
    + + Checks whether a character is a whitespace. + Checks whether a character is a whitespace. Currently checks on the following: '0', '9', '10', '12', '13', '32'. + + int + boolean + boolean + + + Helper method to handle content errors. + + Helper method to handle content errors. Add file position to + PdfRuntimeException + . + + message. + error params. + + error message into + PdfRuntimeException + and add position in file. + + + + + Checks whether + + equals to 'trailer'. + + for check. + true, if line is equals tio 'trailer', otherwise false. + + + Reads data into the provided byte[]. + + Reads data into the provided byte[]. Checks on leading whitespace. + See + isWhiteSpace(int) + or + isWhiteSpace(int, boolean) + for a list of whitespace characters. +
    The same as calling + readLineSegment(input, true) + . +
    + @see ByteBuffer + boolean + +
    + + Reads data into the provided byte[]. + + Reads data into the provided byte[]. Checks on leading whitespace. + See + isWhiteSpace(int) + or + isWhiteSpace(int, boolean) + for a list of whitespace characters. + + @see ByteBuffer + + boolean to indicate whether '0' is whitespace or not. + If in doubt, use true or overloaded method + readLineSegment(input) + + boolean + + + + Check whether line starts with object declaration. + tokenizer, built by single line. + object number and generation if check is successful, otherwise - null. + + + + + + + A RandomAccessSource that uses a + + as it's source + Note: Unlike most of the RandomAccessSource implementations, this class is not thread safe + + + + The source + + + The length of the underling RAF. + + The length of the underling RAF. Note that the length is cached at construction time to avoid the possibility + of java.io.IOExceptions when reading the length. + + + + Creates this object + the source for this RandomAccessSource + if the RAF can't be read + + + + + + + + + + + + + Note: the length is determined when the + + is constructed. If the file length changes + after construction, that change will not be reflected in this call. + + + + Closes the underlying RandomAccessFile + + + + Class that is used to unify reading from random access files and arrays. + + + When true the file access is not done through a memory mapped file. + + When true the file access is not done through a memory mapped file. Use it if the file + is too big to be mapped in your address space. + + + + The source that backs this object + + + The physical location in the underlying byte source. + + + the pushed back byte, if any + + + Whether there is a pushed back byte + + + Creates a RandomAccessFileOrArray that wraps the specified byte source. + + Creates a RandomAccessFileOrArray that wraps the specified byte source. The byte source will be closed when + this RandomAccessFileOrArray is closed. + + the byte source to wrap + + + Creates an independent view of this object (with it's own file pointer and push back queue). + + Creates an independent view of this object (with it's own file pointer and push back queue). Closing the new object will not close this object. + Closing this object will have adverse effect on the view. + + the new view + + + Creates the view of the byte source of this object. + + Creates the view of the byte source of this object. Closing the view won't affect this object. + Closing source will have adverse effect on the view. + + the byte source view. + + + Pushes a byte back. + Pushes a byte back. The next get() will return this byte instead of the value from the underlying data source + + the byte to push + + + Reads a single byte + the byte, or -1 if EOF is reached + in case of any reading error. + + + Reads the specified amount of bytes to the buffer applying the offset. + destination buffer + offset at which to start storing characters + maximum number of characters to read + the number of bytes actually read or -1 in case of EOF + in case of any I/O error + + + Reads the bytes to the buffer. + Reads the bytes to the buffer. This method will try to read as many bytes as the buffer can hold. + + the destination buffer + the number of bytes actually read + in + + + + + + + + + + + Make an attempt to skip the specified amount of bytes in source. + + Make an attempt to skip the specified amount of bytes in source. + However it may skip less amount of bytes. Possibly zero. + + the number of bytes to skip + the actual number of bytes skipped + in case of any I/O error + + + + + + + Closes the underlying source. + + + + Gets the total amount of bytes in the source. + source's size. + + + + Sets the current position in the source to the specified index. + the position to set + + + + Gets the current position of the source considering the pushed byte to the source. + + the index of last read byte in the source in + or the index of last read byte in source - 1 in case byte was pushed. + + in case of any I/O error. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a + String + from the font file as bytes using the given encoding. + + the length of bytes to read + the given encoding + + the + String + read + + the font file could not be read + + + + Factory to create + + objects based on various types of sources + + + + Whether the full content of the source should be read into memory at construction + + + + + Whether + + should be used instead of a + + , where applicable + + + + Whether the underlying file should have a RW lock on it or just an R lock + + + + Creates a factory that will give preference to accessing the underling data source using memory mapped files + + + + Determines whether the full content of the source will be read into memory + + true if the full content will be read, false otherwise + this object (this allows chaining of method calls) + + + + Determines whether + + should be used as the primary data access mechanism + + + whether + + should be used as the primary data access mechanism + + this object (this allows chaining of method calls) + + + + Creates a + + based on a byte array + + the byte array + + the newly created + + + + + + + + + Creates a + + based on a URL. The data available at the URL is read into memory and used + as the source for the + + + the url to read from + + the newly created + + + + + + + Creates a + + based on an + + . The full content of the InputStream is read into memory and used + as the source for the + + + the stream to read from + + the newly created + + + + + + + Creates a + + based on a filename string. + If the filename describes a URL, a URL based source is created + If the filename describes a file on disk, the contents may be read into memory (if + forceRead + is true), + opened using memory mapped file channel (if usePlainRandomAccess is false), or + opened using + + access (if usePlainRandomAccess is true) + This call will automatically fail over to using + + if the memory map operation fails + + + the name of the file or resource to create the + + for + + + the newly created + + + + + + + + + + Creates a new + + by reading the specified file/resource into memory + + the name of the resource to read + + the newly created + + + if reading the underling file or stream fails + + + + + Creates a new + + by reading the specified file/resource into memory + + the name of the resource to read + + the newly created + + + if reading the underling file or stream fails + + + + + An input stream that uses a + + as + its underlying source. + + + + The source. + + + The current position in the source. + + + Creates an input stream based on the source. + The source. + + + + + + + + + + + + + + + + + + + + + A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over + a specific length. + + + A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over + a specific length. Position 0 becomes the offset position in the underlying source. + + + + The source + + + The amount to offset the source by + + + The length + + + Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source + the source + the amount of the offset to use + + + Constructs a new OffsetRandomAccessSource with an explicit length + the source + the amount of the offset to use + the number of bytes to be included in this RAS + + + + + Note that the position will be adjusted to read from the corrected location in the underlying source + + + + + + + Note that the position will be adjusted to read from the corrected location in the underlying source + + + + + + + Note that the length will be adjusted to read from the corrected location in the underlying source + + + + + + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + Abstract class for reading filtered character streams. + The abstract class FilterReader itself + provides default methods that pass all requests to + the contained stream. Subclasses of FilterReader + should override some of these methods and may also provide + additional methods and fields. + + @author Mark Reinhold + @since JDK1.1 + + + + + Reads a single character. + + + + + Reads characters into a portion of an array. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + A helper to FlateDecode. + the input data + + true to read a correct stream. false + to try to read a corrupted stream + + the decoded data + + + Decodes a stream that has the FlateDecode filter. + the input data + the decoded data + + + + This method provides support for general purpose decompression using the + popular ZLIB compression library. + + the input data bytes + the buffer for the uncompressed data + + + + The hashCode value before any data is appended, equals to 1. + + + + Returns accumulated hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Combines hashCode of previous elements sequence and value's hashCode. + previous hashCode value + new element + combined hashCode + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Appends value's hashCode to the current hashCode. + new element + this + + + Translates a IANA encoding name to a Java encoding. + + + The object that maps IANA to Java encodings. + + + + The hash table data. + + + The total number of entries in the hash table. + + + The table is rehashed when its size exceeds this threshold. + + The table is rehashed when its size exceeds this threshold. (The + value of this field is (int)(capacity * loadFactor).) + + + + + The load factor for the hashtable. + + + + +

    Constructs a new, empty hashtable with a default capacity and load + factor, which is 20 and 0.75 respectively.

    +
    +
    + + +

    Constructs a new, empty hashtable with the specified initial capacity + and default load factor, which is 0.75.

    +
    + the initial capacity of the hashtable. + + if the initial capacity is less + than zero. + +
    + + +

    Constructs a new, empty hashtable with the specified initial + capacity and the specified load factor.

    +
    + the initial capacity of the hashtable. + the load factor of the hashtable. + + if the initial capacity is less + than zero, or if the load factor is nonpositive. + +
    + +

    Returns the number of keys in this hashtable.

    + the number of keys in this hashtable. +
    + +

    Tests if this hashtable maps no keys to values.

    + + true if this hashtable maps no keys to values; + false otherwise. + +
    + + + +

    Returns true if this HashMap maps one or more keys + to this value.

    +

    Note that this method is identical in functionality to contains + (which predates the Map interface).

    +
    + value whose presence in this HashMap is to be tested. + boolean true if the value is contained + +
    + +

    Tests if the specified int is a key in this hashtable.

    + possible key. + + true if and only if the specified int is a + key in this hashtable, as determined by the equals + method; false otherwise. + + +
    + +

    Returns the value to which the specified key is mapped in this map.

    + a key in the hashtable. + + the value to which the key is mapped in this hashtable; + 0 if the key is not mapped to any value in + this hashtable. + + +
    + + +

    Increases the capacity of and internally reorganizes this + hashtable, in order to accommodate and access its entries more + efficiently.

    +

    This method is called automatically when the number of keys + in the hashtable exceeds this hashtable's capacity and load + factor.

    +
    +
    + + + +

    Removes the key (and its corresponding value) from this + hashtable.

    +

    This method does nothing if the key is not present in the + hashtable.

    +
    + the key that needs to be removed. + + the value to which the key had been mapped in this hashtable, + or null if the key did not have a mapping. + +
    + +

    Clears this hashtable so that it contains no keys.

    +
    + + + + + +

    Innerclass that acts as a datastructure to create a new entry in the + table.

    +
    +
    + +

    Create a new entry with the given values.

    + The key used to enter this in the table + The value for this key + A reference to the next entry in the table +
    + + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Summary description for Properties. + + + + + A character-stream reader that allows characters to be pushed back into the + stream. + + @author Mark Reinhold + @since JDK1.1 + + + + + Pushback buffer + + + + Current position in buffer + + + + + Creates a new pushback reader with a one-character pushback buffer. + + The reader from which characters will be read + + + + Checks to make sure that the stream has not been closed. + + + + Reads a single character. + + The character read, or -1 if the end of the stream has been + reached + + If an I/O error occurs + + + + Reads characters into a portion of an array. + + Destination buffer + Offset at which to start writing characters + Maximum number of characters to read + + The number of characters read, or -1 if the end of the + stream has been reached + + If an I/O error occurs + + + + Pushes back a single character by copying it to the front of the + pushback buffer. After this method returns, the next character to be read + will have the value (char)c. + + The int value representing a character to be pushed back + + If the pushback buffer is full, + or if some other I/O error occurs + + + + Pushes back a portion of an array of characters by copying it to the + front of the pushback buffer. After this method returns, the next + character to be read will have the value cbuf[off], the + character after that will have the value cbuf[off+1], and + so forth. + + Character array + Offset of first character to push back + Number of characters to push back + + If there is insufficient room in the pushback + buffer, or if some other I/O error occurs + + + + Pushes back an array of characters by copying it to the front of the + pushback buffer. After this method returns, the next character to be + read will have the value cbuf[0], the character after that + will have the value cbuf[1], and so forth. + + Character array to push back + + If there is insufficient room in the pushback + buffer, or if some other I/O error occurs + + + + Closes the stream and releases any system resources associated with + it. Once the stream has been closed, further read(), + unread(), ready(), or skip() invocations will throw an IOException. + Closing a previously closed stream has no effect. + + If an I/O error occurs + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + Gets the resource's inputstream. + the full name of the resource. + + the + InputStream + to get the resource or + + if not found. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + the index of the first element, inclusive, to be sorted + the index of the last element, exclusive, to be sorted + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This method is an alternative for the + InputStream.skip() + -method that doesn't seem to work properly for big values of + + . + + + the + InputStream + + the number of bytes to skip + + + + + Escapes a + byte + array according to the PDF conventions. + + + the + byte + array to escape + + + an escaped + byte + array + + + + + Escapes a + byte + array according to the PDF conventions. + + + the + OutputStream + an escaped + byte + array write to. + + + the + byte + > array to escape. + + + + + + + + + + Reads the full content of a stream and returns them in a byte array + the stream to read + a byte array containing all of the bytes from the stream + if there is a problem reading from the input stream + + + + Copy bytes from the + RandomAccessSource + to + OutputStream + . + + + the + RandomAccessSource + copy from. + + start position of source copy from. + length copy to. + + the + OutputStream + copy to. + + on error. + + + + Reads + + bytes from an input stream. + + the buffer into which the data is read. + an int specifying the offset into the data. + an int specifying the number of bytes to read. + + EOFException + if this stream reaches the end before reading all the bytes. + + + IOException + if an I/O error occurs. + + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Gets environment variable with given name. + + the name of environment variable. + variable value or null if there is no such. + + + + + + + + + + This file is a helper class for internal usage only. + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + Check if the value of a character belongs to a certain interval + that indicates it's the higher part of a surrogate pair. + + the character + true if the character belongs to the interval + + + + Check if the value of a character belongs to a certain interval + that indicates it's the lower part of a surrogate pair. + + the character + true if the character belongs to the interval + + + + Checks if two subsequent characters in a String are + are the higher and the lower character in a surrogate + pair (and therefore eligible for conversion to a UTF 32 character). + + the String with the high and low surrogate characters + the index of the 'high' character in the pair + true if the characters are surrogate pairs + + + + Checks if two subsequent characters in a character array are + are the higher and the lower character in a surrogate + pair (and therefore eligible for conversion to a UTF 32 character). + + the character array with the high and low surrogate characters + the index of the 'high' character in the pair + true if the characters are surrogate pairs + + + + Returns the code point of a UTF32 character corresponding with + a high and a low surrogate value. + + the high surrogate value + the low surrogate value + a code point value + + + Converts a unicode character in a character array to a UTF 32 code point value. + a character array that has the unicode character(s) + the index of the 'high' character + the code point value + + + Converts a unicode character in a String to a UTF32 code point value + a String that has the unicode character(s) + the index of the 'high' character + the codepoint value + + + Converts a UTF32 code point value to a String with the corresponding character(s). + a Unicode value + the corresponding characters in a String + + + + / + Converts a UTF32 code point sequence to a String with the corresponding character(s). + + a Unicode text sequence + start position of text to convert, inclusive + end position of txt to convert, exclusive + the corresponding characters in a String + + + Converts a UTF32 code point value to a char array with the corresponding character(s). + a Unicode value + the corresponding characters in a char arrat + + + + Determines if the specified character (Unicode code point) should be regarded + as an ignorable character in a Java identifier or a Unicode identifier. + + + + + Determines if represented Glyph is '\n' or '\r' character. + + + + + Determines if represented Glyph is space or whitespace character. + + + + + Determines if represented Glyph is ' ' (SPACE) character. + + + + Unicode script "Common". + + + Unicode script "Latin". + + + Unicode script "Greek". + + + Unicode script "Cyrillic". + + + Unicode script "Armenian". + + + Unicode script "Hebrew". + + + Unicode script "Arabic". + + + Unicode script "Syriac". + + + Unicode script "Thaana". + + + Unicode script "Devanagari". + + + Unicode script "Bengali". + + + Unicode script "Gurmukhi". + + + Unicode script "Gujarati". + + + Unicode script "Oriya". + + + Unicode script "Tamil". + + + Unicode script "Telugu". + + + Unicode script "Kannada". + + + Unicode script "Malayalam". + + + Unicode script "Sinhala". + + + Unicode script "Thai". + + + Unicode script "Lao". + + + Unicode script "Tibetan". + + + Unicode script "Myanmar". + + + Unicode script "Georgian". + + + Unicode script "Hangul". + + + Unicode script "Ethiopic". + + + Unicode script "Cherokee". + + + Unicode script "Canadian_Aboriginal". + + + Unicode script "Ogham". + + + Unicode script "Runic". + + + Unicode script "Khmer". + + + Unicode script "Mongolian". + + + Unicode script "Hiragana". + + + Unicode script "Katakana". + + + Unicode script "Bopomofo". + + + Unicode script "Han". + + + Unicode script "Yi". + + + Unicode script "Old_Italic". + + + Unicode script "Gothic". + + + Unicode script "Deseret". + + + Unicode script "Inherited". + + + Unicode script "Tagalog". + + + Unicode script "Hanunoo". + + + Unicode script "Buhid". + + + Unicode script "Tagbanwa". + + + Unicode script "Limbu". + + + Unicode script "Tai_Le". + + + Unicode script "Linear_B". + + + Unicode script "Ugaritic". + + + Unicode script "Shavian". + + + Unicode script "Osmanya". + + + Unicode script "Cypriot". + + + Unicode script "Braille". + + + Unicode script "Buginese". + + + Unicode script "Coptic". + + + Unicode script "New_Tai_Lue". + + + Unicode script "Glagolitic". + + + Unicode script "Tifinagh". + + + Unicode script "Syloti_Nagri". + + + Unicode script "Old_Persian". + + + Unicode script "Kharoshthi". + + + Unicode script "Balinese". + + + Unicode script "Cuneiform". + + + Unicode script "Phoenician". + + + Unicode script "Phags_Pa". + + + Unicode script "Nko". + + + Unicode script "Sundanese". + + + Unicode script "Batak". + + + Unicode script "Lepcha". + + + Unicode script "Ol_Chiki". + + + Unicode script "Vai". + + + Unicode script "Saurashtra". + + + Unicode script "Kayah_Li". + + + Unicode script "Rejang". + + + Unicode script "Lycian". + + + Unicode script "Carian". + + + Unicode script "Lydian". + + + Unicode script "Cham". + + + Unicode script "Tai_Tham". + + + Unicode script "Tai_Viet". + + + Unicode script "Avestan". + + + Unicode script "Egyptian_Hieroglyphs". + + + Unicode script "Samaritan". + + + Unicode script "Mandaic". + + + Unicode script "Lisu". + + + Unicode script "Bamum". + + + Unicode script "Javanese". + + + Unicode script "Meetei_Mayek". + + + Unicode script "Imperial_Aramaic". + + + Unicode script "Old_South_Arabian". + + + Unicode script "Inscriptional_Parthian". + + + Unicode script "Inscriptional_Pahlavi". + + + Unicode script "Old_Turkic". + + + Unicode script "Brahmi". + + + Unicode script "Kaithi". + + + Unicode script "Meroitic Hieroglyphs". + + + Unicode script "Meroitic Cursive". + + + Unicode script "Sora Sompeng". + + + Unicode script "Chakma". + + + Unicode script "Sharada". + + + Unicode script "Takri". + + + Unicode script "Miao". + + + Unicode script "Unknown". + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + * Returns the enum constant representing the Unicode script of which + * the given character (Unicode code point) is assigned to. + * + * @param codePoint the character (Unicode code point) in question. + * @return The {@code UnicodeScript} constant representing the + * Unicode script of which this character is assigned to. + * + * @exception IllegalArgumentException if the specified + * {@code codePoint} is an invalid Unicode code point. + * @see Character#isValidCodePoint(int) + * + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + This method makes a valid URL from a given filename. + a given filename + a valid URL + + + + + + + This method makes a normalized URI from a given filename. + + a given filename + a valid Uri + + + + This method makes a normalized URI from a given file. + + a given file + a valid Uri + + + + Summary description for DeflaterOutputStream. + + + + diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.kernel.dll b/src/packages/itext7.7.0.2/lib/net40/itext.kernel.dll new file mode 100644 index 00000000000..57441d8723e Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.kernel.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.kernel.xml b/src/packages/itext7.7.0.2/lib/net40/itext.kernel.xml new file mode 100644 index 00000000000..ba7f731d4a3 --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.kernel.xml @@ -0,0 +1,51646 @@ + + + + itext.kernel + + + + Represents a color + + + Predefined black DeviceRgb color + + + Predefined blue DeviceRgb color + + + Predefined cyan DeviceRgb color + + + Predefined dark gray DeviceRgb color + + + Predefined gray DeviceRgb color + + + Predefined green DeviceRgb color + + + Predefined light gray DeviceRgb color + + + Predefined magenta DeviceRgb color + + + Predefined orange DeviceRgb color + + + Predefined pink DeviceRgb color + + + Predefined red DeviceRgb color + + + Predefined white DeviceRgb color + + + Predefined yellow DeviceRgb color + + + The color space of the color + + + The color value of the color + + + Creates a Color of certain color space and color value. + + Creates a Color of certain color space and color value. + If color value is set in null, all value components will be initialised with zeroes. + + the color space to which the created Color object relates + the color value of the created Color object + + + Makes a Color of certain color space. + + Makes a Color of certain color space. + All color value components will be initialised with zeroes. + + the color space to which the returned Color object relates + + + Makes a Color of certain color space and color value. + + Makes a Color of certain color space and color value. + If color value is set in null, all value components will be initialised with zeroes. + + the color space to which the returned Color object relates + the color value of the returned Color object + + + + Converts + DeviceCmyk + color to + DeviceRgb + color + + the DeviceCmyk color which will be converted to DeviceRgb color + converted color + + + + Converts + DeviceRgb + color to + DeviceCmyk + color + + the DeviceRgb color which will be converted to DeviceCmyk color + converted color + + + Returns the number of color value components + the number of color value components + + + + Returns the + color space + to which the color is related. + + the color space of the color + + + Returns the color value of the color + the color value + + + Sets the color value of the color + new color value + + + Indicates whether the color is equal to the given color. + + Indicates whether the color is equal to the given color. + The + color space + and + color value + are considered during the comparison. + + + + + + + Color space to specify colors according to CMYK color model. + + + Predefined cyan DeviceCmyk color + + + Predefined magenta DeviceCmyk color + + + Predefined yellow DeviceCmyk color + + + Predefined black DeviceCmyk color + + + Creates DeviceCmyk color with all colorants intensities initialised as zeroes. + + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + The intensities are considered to be in [0, 100] gap, if not, + the intensity will be considered as 100 (when colorant's value is bigger than 100) + or 0 (when colorant's value is less than 0). + + the intensity of cyan colorant + the intensity of magenta colorant + the intensity of yellow colorant + the intensity of black colorant + + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + + Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants. + The intensities are considered to be in [0, 1] interval, if not, + the intensity will be considered as 1 (when colorant's value is bigger than 1) + or 0 (when colorant's value is less than 0). + + the intensity of cyan colorant + the intensity of magenta colorant + the intensity of yellow colorant + the intensity of black colorant + + + + Returns + DeviceCmyk + color which is lighter than given one + + the DeviceCmyk color to be made lighter + lighter color + + + + Returns + DeviceCmyk + color which is darker than given one + + the DeviceCmyk color to be made darker + darker color + + + Color space to specify shades of gray color. + + + Predefined white DeviceGray color. + + + Predefined gray DeviceGray color. + + + Predefined black DeviceGray color. + + + Creates DeviceGray color by given grayscale. + + Creates DeviceGray color by given grayscale. + The grayscale is considered to be in [0, 1] interval, if not, + the grayscale will be considered as 1 (when grayscale's value is bigger than 1) + or 0 (when grayscale's value is less than 0). + + the grayscale value + + + Creates DeviceGray color with grayscale value initialised as zero. + + + + Returns + DeviceGray + color which is lighter than given one + + the DeviceGray color to be made lighter + lighter color + + + + Returns + DeviceGray + color which is darker than given one + + the DeviceGray color to be made darker + darker color + + + Color space to specify colors according to RGB color model. + + + Creates DeviceRgb color by intensities of red, green and blue colorants. + + Creates DeviceRgb color by intensities of red, green and blue colorants. + The intensities are considered to be in [0, 255] gap, if not, + the intensity will be considered as 255 (when colorant's value is bigger than 255) + or 0 (when colorant's value is less than 0). + + the intensity of red colorant + the intensity of green colorant + the intensity of blue colorant + + + Creates DeviceRgb color by intensities of red, green and blue colorants. + + Creates DeviceRgb color by intensities of red, green and blue colorants. + The intensities are considered to be in [0, 1] interval, if not, + the intensity will be considered as 1 (when colorant's value is bigger than 1) + or 0 (when colorant's value is less than 0). + + the intensity of red colorant + the intensity of green colorant + the intensity of blue colorant + + + Creates DeviceRgb color with all colorants intensities initialised as zeroes. + + + + Returns + DeviceRgb + color which is lighter than given one + + the DeviceRgb color to be made lighter + lighter color + + + + Returns + DeviceRgb + color which is darker than given one + + the DeviceRgb color to be made darker + darker color + + + Creates IccBased color. + ICC profile stream. User is responsible for closing the stream. + + + Creates IccBased color. + ICC profile stream. User is responsible for closing the stream. + color value. + + + + This class is a HashMap that contains the names of colors as a key and the + corresponding RGB color as value. + + + This class is a HashMap that contains the names of colors as a key and the + corresponding RGB color as value. (Source: Wikipedia + http://en.wikipedia.org/wiki/Web_colors ) + + + + HashMap containing all the names and corresponding color values. + + + Gives you a DeviceRgb based on a name. + + a name such as black, violet, cornflowerblue or #RGB or + #RRGGBB or RGB or RRGGBB or rgb(R,G,B) + + the corresponding DeviceRgb object. Never returns null. + + + Gives an array of four floats that contain RGBA values, each value is between 0 and 1. + + a name such as black, violet, cornflowerblue or #RGB or + #RRGGBB or RGB or RRGGBB or rgb(R,G,B) or rgb(R,G,B,A) + + the corresponding array of four floats, or null if parsing failed. + + + + A web color string without the leading # will be 3 or 6 characters long + and all those characters will be hex digits. + + + A web color string without the leading # will be 3 or 6 characters long + and all those characters will be hex digits. NOTE: colStr must be all + lower case or the current hex letter test will fail. + + + A non-null, lower case string that might describe an RGB color + in hex. + + Is this a web color hex string without the leading #? + + + Creates an AES Cipher with CBC and padding PKCS5/7. + Paulo Soares + + + Creates a new instance of AESCipher + + + Creates an AES Cipher with CBC and no padding. + Paulo Soares + + + Creates a new instance of AESCipher + + + Creates a new instance of AesDecryption + + + Creates a new instance of ARCFOUREncryption + + + Bad password exception. + + + Exception class for exceptions in kernel module. + + + Object for more details + + + Creates a new instance of PdfException. + the detail message. + + + Creates a new instance of PdfException. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of PdfException. + the detail message. + an object for more details. + + + Creates a new instance of PdfException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new instance of PdfException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + an object for more details. + + + Sets additional params for Exception message. + additional params. + object itself. + + + Gets additional params for Exception message. + + + Creates a new BadPasswordException. + the detail message. + + the cause (which is saved for later retrieval by + + method). + + + + Creates a new BadPasswordException. + the detail message. + + + + This file is a helper class for internal usage only. + Be aware that it's API and functionality may be changed in future. + + + + + + + + An initialization vector generator for a CBC block encryption. + An initialization vector generator for a CBC block encryption. It's a random generator based on ARCFOUR. + + Paulo Soares + + + Creates a new instance of IVGenerator + + + Gets a 16 byte random initialization vector. + a 16 byte random initialization vector + + + Gets a random initialization vector. + the length of the initialization vector + a random initialization vector + + + Creates a new instance of OutputStreamCounter + + + + Closes this output stream and releases any system resources + associated with this stream. + + + Closes this output stream and releases any system resources + associated with this stream. The general contract of + close + is that it closes the output stream. A closed stream cannot perform + output operations and cannot be reopened. +

    + The + close + method of + OutputStream + does nothing. + + if an I/O error occurs. + + +

    + Flushes this output stream and forces any buffered output bytes + to be written out. + + + Flushes this output stream and forces any buffered output bytes + to be written out. The general contract of + flush + is + that calling it is an indication that, if any bytes previously + written have been buffered by the implementation of the output + stream, such bytes should immediately be written to their + intended destination. +

    + The + flush + method of + OutputStream + does nothing. + + if an I/O error occurs. + + +

    + Writes + b.length + bytes from the specified byte array + to this output stream. The general contract for + write(b) + is that it should have exactly the same effect as the call + write(b, 0, b.length) + . + + the data. + if an I/O error occurs. + +
    + + Writes the specified byte to this output stream. + + Writes the specified byte to this output stream. The general + contract for + write + is that one byte is written + to the output stream. The byte to be written is the eight + low-order bits of the argument + + . The 24 + high-order bits of + + are ignored. +

    + Subclasses of + OutputStream + must provide an + implementation for this method. + + + the + byte + . + + + if an I/O error occurs. In particular, an + IOException + may be thrown if the + output stream has been closed. + + + +

    + Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

    + The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

    + If + + is + + , a + NullPointerException + is thrown. +

    + If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

    + the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
    + + Creates a new instance of OutputStreamCounter + + + + Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

    + The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

    + If + + is + + , a + NullPointerException + is thrown. +

    + If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

    + the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
    + + Creates a new instance of OutputStreamStandardEncryption + + + + Writes + + bytes from the specified byte array + starting at offset + + to this output stream. + The general contract for + write(b, off, len) + is that + some of the bytes in the array + + are written to the + output stream in order; element + b[off] + is the first + byte written and + b[off+len-1] + is the last byte written + by this operation. +

    + The + write + method of + OutputStream + calls + the write method of one argument on each of the bytes to be + written out. Subclasses are encouraged to override this method and + provide a more efficient implementation. +

    + If + + is + + , a + NullPointerException + is thrown. +

    + If + + is negative, or + + is negative, or + off+len + is greater than the length of the array + + , then an IndexOutOfBoundsException is thrown. +

    + the data. + the start offset in the data. + the number of bytes to write. + + if an I/O error occurs. In particular, + an + IOException + is thrown if the output + stream is closed. + +
    + + + + + + + + + + Aiken Sam (aikensam@ieee.org) + + + The global encryption key + + + The encryption key for a particular object/generation. + + The encryption key for a particular object/generation. + It is recalculated with + + for every object individually based in its object/generation. + + + + + The encryption key length for a particular object/generation + It is recalculated with + + for every object individually based in its object/generation. + + + + Work area to prepare the object/generation bytes + + + + Note: For most of the supported security handlers algorithm to calculate encryption key for particular object + is the same. + + + + + + + + + + + + + + + + + + + + + + Gets bytes of String-value without considering encoding. + byte array + + + Creates a new instance of StandardDecryption + + + Describes abstract event. + + + A type of event. + + + Creates an event of the specified type. + type of event + + + Returns the type of this event. + type of this event + + + + IEventDispatcher implementation that forwards Events to registered + + implementations. + + + + Event dispatcher interface. + + + Adds new event handler. + a type of event to be handled. + event handler. + + + Dispatches an event. + + + + Dispatches a delayed event. + + Dispatches a delayed event. + Sometimes event cannot be handled immediately because event handler has not been set yet. + In this case event is placed into event ques of dispatcher and is waiting until handler is assigned. + + + + + + Checks if event dispatcher as an event handler assigned for a certain event type. + + + + + Removes event handler. + + + + + Remove all event handlers. + + + Interface for handling events. + + Interface for handling events. EventHandlers are added to the + + . + + + + Hook for handling events. + + Hook for handling events. Implementations can access the PdfDocument instance + associated to the specified Event or, if available, the PdfPage instance. + + the Event that needs to be processed + + + Event dispatched by PdfDocument. + + + Dispatched after page is created. + + + Dispatched after page is inserted/added into document. + + + Dispatched after page is removed from document. + + + Dispatched before page is closed and written. + + + The PdfPage associated with this event. + + + The PdfDocument associated with this event. + + + Creates a PdfDocumentEvent. + type of the event that fired this event + document that fired this event + + + Creates a PdfDocumentEvent. + type of the event that fired this event + page that fired this event + + + Returns the PdfDocument associated with this event. + the PdfDocument associated with this event + + + Returns the PdfPage associated with this event. + Returns the PdfPage associated with this event. Warning: this can be null. + the PdfPage associated with this event + + + This class allow to parse document font's encoding. + + + Marks object behind wrapper to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object behind wrapper to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + + Defines if the object behind this wrapper must be an indirect object in the + resultant document. + + + Defines if the object behind this wrapper must be an indirect object in the + resultant document. +

    + If this method returns true it doesn't necessarily mean that object + must be in the indirect state at any moment, but rather defines that + when the object will be written to the document it will be transformed into + indirect object if it's not indirect yet. +

    + Return value of this method shouldn't depend on any logic, it should return + always true or false. +
    + + true if in the resultant document the object behind the wrapper + must be indirect, otherwise false. + +
    + + + Some wrappers use object's indirect reference to obtain the + PdfDocument + to which the object belongs to. For this matter, for these wrappers it is implicitly defined + that they work with indirect objects only. Commonly these wrappers have two constructors: one with + PdfDocument + as parameter to create a new object, and the other one which + wraps around the given + PdfObject + . This method should be used in the second + type of constructors to ensure that wrapper will able to obtain the + PdfDocument + instance. + + + the + PdfObject + to be checked if it is indirect. + + + + false, if the font comes from PdfDocument. + + + true if the font is to be embedded in the PDF. + + + Indicates if all the glyphs and widths for that particular encoding should be included in the document. + + + + Get glyph by unicode + a unicode code point + + + Glyph + if it exists or .NOTDEF if supported, otherwise + + . + + + + Check whether font contains glyph with specified unicode. + a unicode code point + + true if font contains glyph, represented with the unicode code point, + otherwise false. + + + + Check whether font contains glyph with specified unicode. + a unicode code point + + true if font contains glyph, represented with the unicode code point, + otherwise false. + + + + Check whether font contains glyph with specified unicode. + a java unicode string + start index. one or two char may be used. + + true if font contains glyph, represented with the unicode code point, + otherwise false. + + + + Append all supported glyphs and return number of processed chars. + + Append all supported glyphs and return number of processed chars. + Composite font supports surrogate pairs. + + String to convert to glyphs. + from index of the text. + to index of the text. + array for a new glyphs, shall not be null. + number of processed chars from text. + + + Append any single glyph, even notdef. + + Append any single glyph, even notdef. + Returns number of processed chars: 2 in case surrogate pair, otherwise 1. + + String to convert to glyphs. + from index of the text. + array for a new glyph, shall not be null. + number of processed chars: 2 in case surrogate pair, otherwise 1 + + + Converts the text into bytes to be placed in the document. + + Converts the text into bytes to be placed in the document. + The conversion is done according to the font and the encoding and the characters + used are stored. + + the text to convert + the conversion + + + + Decodes a given + + containing encoded string (e.g. from content stream) into a + + + the encoded string + + the + + containing the glyphs encoded by the passed string + + + + Returns the width of a certain character of this font in 1000 normalized units. + a certain character. + a width in Text Space. + + + Returns the width of a certain character of this font in points. + a certain character. + the font size. + a width in points. + + + Returns the width of a string of this font in 1000 normalized units. + a string content. + a width of string in Text Space. + + + + Gets the width of a + String + in points. + + + the + String + to get the width of + + the font size + the width in points + + + + Gets the descent of a + String + in points. The descent will always be + less than or equal to zero even if all the characters have an higher descent. + + + the + String + to get the descent of + + the font size + the descent in points + + + Gets the descent of a char code in points. + + Gets the descent of a char code in points. The descent will always be + less than or equal to zero even if all the characters have an higher descent. + + the char code to get the descent of + the font size + the descent in points + + + + Gets the ascent of a + String + in points. The ascent will always be + greater than or equal to zero even if all the characters have a lower ascent. + + + the + String + to get the ascent of + + the font size + the ascent in points + + + Gets the ascent of a char code in normalized 1000 units. + + Gets the ascent of a char code in normalized 1000 units. The ascent will always be + greater than or equal to zero even if all the characters have a lower ascent. + + the char code to get the ascent of + the font size + the ascent in points + + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. + + false to include all the glyphs and widths. + + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. + + + Indicates if all the glyphs and widths for that particular + encoding should be included in the document. When set to true + only the glyphs used will be included in the font. When set to false + and + + was not called the full font will be included + otherwise just the characters ranges will be included. + + new value of property subset + + + Adds a character range when subsetting. + + Adds a character range when subsetting. The range is an int array + where the first element is the start range inclusive and the second element is the + end range inclusive. Several ranges are allowed in the same array. + + the character range + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + Creates a unique subset prefix to be added to the font name when the font is embedded and subset. + + the subset prefix + + + + Create + PdfStream + based on + + . + + original font data, must be not null. + + array to generate + Length* + keys, must be not null. + + + the PdfStream containing the font or + + , if there is an error reading the font. + + + Method will throw exception if + + is + + . + + + + Helper method for making an object indirect, if the object already is indirect. + + Helper method for making an object indirect, if the object already is indirect. + Useful for FontDescriptor and FontFile to make possible immediate flushing. + If there is no PdfDocument, mark the object as + MUST_BE_INDIRECT + . + + an object to make indirect. + + if current object isn't indirect, returns + + , otherwise + tree + + + + + This class provides helpful methods for creating fonts ready to be used in a + + Note, just created + + is almost empty until it will be flushed, + because it is impossible to fulfill font data until flush. + + + + This is the default encoding to use. + + + This is the default value of the embedded variable. + + + This is the default value of the cached variable. + + + + Creates a new instance of default font, namely + + standard font + with + + encoding. + Note, if you want to reuse the same instance of default font, you may use + + . + + created font + if error occurred while creating the font, e.g. metrics loading failure + + + + + Creates a + + by already existing font dictionary. + Note, the font won't be added to any document, + until you add it to + + . + While adding to + + , or to + + the font will be made indirect implicitly. + + method is strongly recommended if you want to get PdfFont by both + existing font dictionary, or just created and hasn't flushed yet. + + the font dictionary to create the font from + + created + + instance + + + + + Creates a + + instance by the path of the font program file + + the path of the font program file + + created + + instance + + exception is thrown in case an I/O error occurs when reading the file + + + + + Creates a + + instance by the path of the font program file and given encoding. + + the path of the font program file + + the font encoding. See + + + + created + + instance + + exception is thrown in case an I/O error occurs when reading the file + + + + + Creates a + + instance from the TrueType Collection represented by its byte contents. + + the byte contents of the TrueType Collection + the index of the font in the collection, zero-based + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + in case the contents of the TrueType Collection is mal-formed or an error occurred during reading the font + + + + + Creates a + + instance from the TrueType Collection given by the path to the .ttc file. + + the path of the .ttc file + the index of the font in the collection, zero-based + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + + in case the file is not found, contents of the TrueType Collection is mal-formed + or an error occurred during reading the font + + + + + Created a + + instance given the path to the font file. + + the font program file + indicates whether the font is to be embedded into the target document + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the path to the font file. + + the font program file + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the path to the font file. + + the font program file + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + in case the file is not found or the contents of the font file is mal-formed + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + the encoding of the font to be created. See + + + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance given the given underlying + + instance. + + + the font program of the + + instance to be created + + + created + + instance + + this exception is actually never thrown and will be removed in 7.1. + + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Created a + + instance by the bytes of the underlying font program. + + the bytes of the underlying font program + + the encoding of the font to be created. See + + + indicates whether the font is to be embedded into the target document + indicates whether the font will be cached + + created + + instance + + this exception is actually never thrown. Will be removed in 7.1. + + + + Creates a new instance of + + + the target document of the new font + indicates whether the font will be colorized + created font + actually this exception is never thrown. This will be removed in 7.1. + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + + Creates + + based on registered + + 's. + + + + + + + + + + + + Register a font by giving explicitly the font family and name. + the font family + the font name + the font path + + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + + Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. + In case if TrueType Collection (.ttc), an additional parameter may be specified defining the index of the font + to be registered, e.g. "path/to/font/collection.ttc,0". The index is zero-based. + + the path to a font file + + + Register a font file and use an alias for the font contained in it. + the path to a font file + the alias you want to use for the font + + + Registers all the fonts in a directory. + the directory path to be registered as a font directory path + the number of fonts registered + + + Register fonts in some probable directories. + + Register fonts in some probable directories. It usually works in Windows, + Linux and Solaris. + + the number of fonts registered + + + Gets a set of registered font names. + a set of registered fonts + + + Gets a set of registered font families. + a set of registered font families + + + Checks if a certain font is registered. + the name of the font that has to be checked. + true if the font is found, false otherwise + + + Checks if the provided dictionary is a valid font dictionary of the provided font type. + true if the passed dictionary is a valid dictionary, false otherwise + + + Forces the output of the width array. + Forces the output of the width array. Only matters for the 14 built-in fonts. + + + The array used with single byte encodings. + + + Checks whether the glyph is appendable, i.e. + Checks whether the glyph is appendable, i.e. has valid unicode and code values + + not-null + + + + + + + + Gets the state of the property. + value of property forceWidthsOutput + + + + Set to + + to force the generation of the widths array. + + + + + to force the generation of the widths array + + + + + Generates the font descriptor for this font or + + if it is one of the 14 built in fonts. + + + the PdfDictionary containing the font descriptor or + + . + + + + Note. + Note. For TrueType FontNames.getStyle() is the same to Subfamily(). So, we shouldn't add style to /BaseFont. + + + + + + + Creates a ToUnicode CMap to allow copy and paste from Acrobat. + + metrics[0] contains the glyph index and metrics[2] + contains the Unicode code + + the stream representing this CMap or null + + + Generates the CIDFontTyte2 dictionary. + the indirect reference to the font descriptor + a name of the font + the horizontal width metrics + fully initialized CIDFont + + + The method used to sort the metrics array. + the first element + the second element + the comparison + + + + If the embedded flag is + + or if the font is one of the 14 built in types, it returns + + , + otherwise the font is read and output in a PdfStream object. + + + + Low-level API class for Type 3 fonts. + + Low-level API class for Type 3 fonts. +

    + In Type 3 fonts, glyphs are defined by streams of PDF graphics operators. + These streams are associated with character names. A separate encoding entry + maps character codes to the appropriate character names for the glyphs. +

    + To be able to be wrapped with this + + the + + must be indirect. + + + +

    Creates a Type3 font. + defines whether the glyph color is specified in the glyph descriptions in the font. + +
    + + Creates a Type3 font based on an existing font dictionary, which must be an indirect object. + a dictionary of type /Font, must have an indirect reference. + + + Defines a glyph. + Defines a glyph. If the character was already defined it will return the same content + the character to match this glyph. + the advance this character will have + + the X lower left corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the Y lower left corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the X upper right corner of the glyph bounding box. If the colorize option is + true the value is ignored + + + the Y upper right corner of the glyph bounding box. If the colorize option is + true the value is ignored + + a content where the glyph can be defined + + + + Gets first empty code, that could use with + addSymbol() + + code from 1 to 255 or -1 if all slots are busy. + + + The content where Type3 glyphs are written to. + + + PdfCanvas class represents an algorithm for writing data into content stream. + + PdfCanvas class represents an algorithm for writing data into content stream. + To write into page content, create PdfCanvas from a page instance. + To write into form XObject, create PdfCanvas from a form XObject instance. + Make sure to call PdfCanvas.release() after you finished writing to the canvas. + It will save some memory. + + + + a LIFO stack of graphics state saved states. + + + the current graphics state. + + + the content stream for this canvas object. + + + the resources for the page that this canvas belongs to. + + + + the document that the resulting content stream of this canvas will be written to. + + + a counter variable for the marked content stack. + + + The list where we save/restore the layer depth. + + + Creates PdfCanvas from content stream of page, form XObject, pattern etc. + @see PdfStream. + the resources, a specialized dictionary that can be used by PDF instructions in the content stream + + the document that the resulting content stream will be written to + + + Convenience method for fast PdfCanvas creation by a certain page. + page to create canvas from. + + + Convenience method for fast PdfCanvas creation by a certain page. + page to create canvas from. + + true to wrap all old content streams into q/Q operators so that the state of old + content streams would not affect the new one + + + + Creates a PdfCanvas from a PdfFormXObject. + the PdfFormXObject used to create the PdfCanvas + the document to which the resulting content stream will be written + + + Convenience method for fast PdfCanvas creation by a certain page. + @see PdfDocument. + page number. + + + Get the resources of the page that this canvas belongs to.. + PdfResources of the page that this canvas belongs to.. + + + Attaches new content stream to the canvas. + + Attaches new content stream to the canvas. + This method is supposed to be used when you want to write in different PdfStream keeping context (gsStack, currentGs, ...) the same. + + a content stream to attach. + + + + Gets current + + . + + container containing properties for the current state of the canvas. + + + Releases the canvas. + + Releases the canvas. + Use this method after you finished working with canvas. + + + + Saves graphics state. + current canvas. + + + Restores graphics state. + current canvas. + + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + Contrast with + PdfCanvas#setTextMatrix + + operand 1,1 in the matrix. + operand 1,2 in the matrix. + operand 2,1 in the matrix. + operand 2,2 in the matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas + + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the 2x3 affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + If an array not containing the 6 values of the matrix is passed, + The current canvas is returned unchanged. + + affine transformation stored as a PdfArray with 6 values + current canvas + + + + Concatenates the affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + + + Concatenates the affine transformation matrix to the current matrix + in the content stream managed by this Canvas. + See also + + + current canvas + + + Begins text block (PDF BT operator). + current canvas. + + + Ends text block (PDF ET operator). + current canvas. + + + Begins variable text block + current canvas + + + Ends variable text block + current canvas + + + Sets font and size (PDF Tf operator). + @see PdfFont. + Font size. + current canvas. + + + Moves text by shifting text line matrix (PDF Td operator). + x coordinate. + y coordinate. + current canvas. + + + + + Moves to the start of the next line. + current canvas. + + + + Moves to the next line and shows + + . + + the text to write + current canvas. + + + Moves to the next line and shows text string, using the given values of the character and word spacing parameters. + + a parameter + a parameter + the text to write + current canvas. + + + Sets text rendering mode. + text rendering mode @see PdfCanvasConstants. + current canvas. + + + + Sets the word spacing parameter. + a parameter + current canvas. + + + Sets the character spacing parameter. + a parameter + current canvas. + + + Sets the horizontal scaling parameter. + a parameter. + current canvas. + + + Replaces the text matrix. + + Replaces the text matrix. Contrast with + PdfCanvas#concatMatrix + + operand 1,1 in the matrix. + operand 1,2 in the matrix. + operand 2,1 in the matrix. + operand 2,2 in the matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas. + + + Changes the text matrix. + operand 3,1 in the matrix. + operand 3,2 in the matrix. + current canvas. + + + Shows text (operator Tj). + text to show. + current canvas. + + + Shows text (operator Tj). + text to show. + current canvas. + + + Shows text (operator Tj). + text to show. + + iterator over parts of the glyph line that should be wrapped into some marked content groups, + e.g. /ActualText or /ReversedChars + + current canvas. + + + Shows text (operator TJ) + + the text array. Each element of array can be a string or a number. + If the element is a string, this operator shows the string. + If it is a number, the operator adjusts the text position by that amount. + The number is expressed in thousandths of a unit of text space. + This amount is subtracted from the current horizontal or vertical coordinate, depending on the writing mode. + + current canvas. + + + Move the current point (x, y), omitting any connecting line segment. + x coordinate. + y coordinate. + current canvas. + + + Appends a straight line segment from the current point (x, y). + + Appends a straight line segment from the current point (x, y). The new current + point is (x, y). + + x coordinate. + y coordinate. + current canvas. + + + Appends a Bêzier curve to the path, starting from the current point. + x coordinate of the first control point. + y coordinate of the first control point. + x coordinate of the second control point. + y coordinate of the second control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + Appends a B??zier curve to the path, starting from the current point. + x coordinate of the second control point. + y coordinate of the second control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + Appends a B??zier curve to the path, starting from the current point. + x coordinate of the first control point. + y coordinate of the first control point. + x coordinate of the ending point. + y coordinate of the ending point. + current canvas. + + + + Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, + starting at startAng degrees and covering extent degrees. + + + Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, + starting at startAng degrees and covering extent degrees. Angles + start with 0 to the right (+x) and increase counter-clockwise. + + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + starting angle in degrees. + angle extent in degrees. + current canvas. + + + Draws an ellipse inscribed within the rectangle x1,y1,x2,y2. + a corner of the enclosing rectangle + a corner of the enclosing rectangle + a corner of the enclosing rectangle + a corner of the enclosing rectangle + current canvas. + + + Generates an array of bezier curves to draw an arc. + + Generates an array of bezier curves to draw an arc. +

    + (x1, y1) and (x2, y2) are the corners of the enclosing rectangle. + Angles, measured in degrees, start with 0 to the right (the positive X + axis) and increase counter-clockwise. The arc extends from startAng + to startAng+extent. i.e. startAng=0 and extent=180 yields an openside-down + semi-circle. +

    + The resulting coordinates are of the form double[]{x1,y1,x2,y2,x3,y3, x4,y4} + such that the curve goes from (x1, y1) to (x4, y4) with (x2, y2) and + (x3, y3) as their respective Bezier control points. +

    + Note: this code was taken from ReportLab (www.reportlab.org), an excellent + PDF generator for Python (BSD license: http://www.reportlab.org/devfaq.html#1.3 ). + + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + a corner of the enclosing rectangle. + starting angle in degrees. + angle extent in degrees. + a list of double[] with the bezier curves. + + +

    Draws a rectangle. + x coordinate of the starting point. + y coordinate of the starting point. + width. + height. + current canvas. +
    + + Draws a rectangle. + a rectangle to be drawn + current canvas. + + + Draws rounded rectangle. + x coordinate of the starting point. + y coordinate of the starting point. + width. + height. + radius of the arc corner. + current canvas. + + + Draws a circle. + Draws a circle. The endpoint will (x+r, y). + x center of circle. + y center of circle. + radius of circle. + current canvas. + + + Paints a shading object and adds it to the resources of this canvas + + current canvas. + + + + Closes the current subpath by appending a straight line segment from the current point + to the starting point of the subpath. + + current canvas. + + + Closes the path, fills it using the even-odd rule to determine the region to fill and strokes it. + + current canvas. + + + Closes the path, fills it using the non-zero winding number rule to determine the region to fill and strokes it. + + current canvas. + + + Ends the path without filling or stroking it. + current canvas. + + + Strokes the path. + current canvas. + + + + Modify the current clipping path by intersecting it with the current path, using the + nonzero winding rule to determine which regions lie inside the clipping path. + + current canvas. + + + + Modify the current clipping path by intersecting it with the current path, using the + even-odd rule to determine which regions lie inside the clipping path. + + current canvas. + + + Closes the path and strokes it. + current canvas. + + + Fills current path. + current canvas. + + + Fills the path using the non-zero winding number rule to determine the region to fill and strokes it. + + current canvas. + + + EOFills current path. + current canvas. + + + Fills the path, using the even-odd rule to determine the region to fill and strokes it. + current canvas. + + + Sets line width. + line width. + current canvas. + + + + Sets the line cap style, the shape to be used at the ends of open subpaths + when they are stroked. + + + current canvas. + for possible values. + + + + Sets the line join style, the shape to be used at the corners of paths + when they are stroked. + + + current canvas. + for possible values. + + + + Sets the miter limit, a parameter specifying the maximum length a miter join + may extend beyond the join point, relative to the angle of the line segments. + + + current canvas. + + + Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

    + The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + current canvas. + + +

    Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

    + The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + the number of units that must be 'on' (equals the number of units that must be 'off'). + + current canvas. + + +

    Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

    + The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + the value of the phase + the number of units that must be 'on' + the number of units that must be 'off' + current canvas. + + +

    Changes the value of the line dash pattern. + + Changes the value of the line dash pattern. +

    + The line dash pattern controls the pattern of dashes and gaps used to stroke paths. + It is specified by an array and a phase. The array specifies the length + of the alternating dashes and gaps. The phase specifies the distance into the dash + pattern to start the dash. + + length of the alternating dashes and gaps + the value of the phase + current canvas. + + +

    Set the rendering intent. + + Set the rendering intent. possible values are: PdfName.AbsoluteColorimetric, + PdfName.RelativeColorimetric, PdfName.Saturation, PdfName.Perceptual. + + a PdfName containing a color metric + current canvas. +
    + + + Changes the current color for filling paths. + fill color. + current canvas. + + + Changes the current color for stroking paths. + stroke color. + current canvas. + + + Changes the current color for paths. + the new color. + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for paths. + the color space of the new color + a list of numerical values with a length corresponding to the specs of the color space. Values should be in the range [0,1] + + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for paths with an explicitly defined pattern. + the color space of the new color + a list of numerical values with a length corresponding to the specs of the color space. Values should be in the range [0,1] + + a pattern for the colored line or area + set fill color (true) or stroke color (false) + current canvas. + + + Changes the current color for filling paths to a grayscale value. + a grayscale value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to a grayscale value. + a grayscale value in the range [0,1] + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + Changes the current color for filling paths to an RGB value. + a red value in the range [0,1] + a green value in the range [0,1] + a blue value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to an RGB value. + a red value in the range [0,1] + a green value in the range [0,1] + a blue value in the range [0,1] + current canvas. + + + Adds or changes the shading of the current fill color path. + the shading + current canvas. + + + Adds or changes the shading of the current stroke color path. + the shading + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + Changes the current color for filling paths to a CMYK value. + a cyan value in the range [0,1] + a magenta value in the range [0,1] + a yellow value in the range [0,1] + a key (black) value in the range [0,1] + current canvas. + + + Changes the current color for stroking paths to a CMYK value. + a cyan value in the range [0,1] + a magenta value in the range [0,1] + a yellow value in the range [0,1] + a key (black) value in the range [0,1] + current canvas. + + + Changes the current color for filling paths to black. + current canvas. + + + Changes the current color for stroking paths to black. + current canvas. + + + + Ends OCG layer. + current canvas. + + + Creates Image XObject from image and adds it to canvas (as Image XObject). + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + created Image XObject. + + + Creates Image XObject from image and adds it to canvas. + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + true if to add image as in-line. + created Image XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to canvas. + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to canvas. + + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to the specified position with specified width preserving aspect ratio. + + + + + + true if to add image as in-line. + created XObject or null in case of in-line image (asInline = true). + + + Creates Image XObject from image and adds it to the specified position with specified width preserving aspect ratio. + + + + + + true if to add image as in-line. + + created XObject or null in case of in-line image (asInline = true). + + + + Adds + PdfXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + current canvas. + + + + Adds + PdfXObject + to the specified position. + + + + + current canvas. + + + + Adds + PdfXObject + to specified rectangle on canvas. + + + + current canvas. + + + + Adds + PdfXObject + to the specified position with specified width preserving aspect ratio. + + + + + + current canvas. + + + + Adds + PdfXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + current canvas. + + + Sets the ExtGState dictionary for the current graphics state + a dictionary that maps resource names to graphics state parameter dictionaries + current canvas. + + + Sets the ExtGState dictionary for the current graphics state + a dictionary that maps resource names to graphics state parameter dictionaries + current canvas. + + + Manually start a Marked Content sequence. + Manually start a Marked Content sequence. Used primarily for Tagged PDF + the type of content contained + current canvas + + + Manually start a Marked Content sequence with properties. + Manually start a Marked Content sequence with properties. Used primarily for Tagged PDF + the type of content that will be contained + the properties of the content, including Marked Content ID. If null, the PDF marker is BMC, else it is BDC + + current canvas + + + Manually end a Marked Content sequence. + Manually end a Marked Content sequence. Used primarily for Tagged PDF + current canvas + + + Manually open a canvas tag, beginning a Marked Content sequence. + Manually open a canvas tag, beginning a Marked Content sequence. Used primarily for Tagged PDF + the type of content that will be contained + current canvas + + + Open a tag, beginning a Marked Content sequence. + + Open a tag, beginning a Marked Content sequence. This MC sequence will belong to the tag from the document + logical structure. +
    + CanvasTag will be automatically created with assigned mcid(Marked Content id) to it. Mcid serves as a reference + between Marked Content sequence and logical structure element. +
    + reference to the tag from the document logical structure + current canvas +
    + + Manually close a tag, ending a Marked Content sequence. + Manually close a tag, ending a Marked Content sequence. Used primarily for Tagged PDF + current canvas + + + + Outputs a + String + directly to the content. + + + the + String + + current canvas. + + + + Outputs a + char + directly to the content. + + + the + char + + current canvas. + + + + Outputs a + float + directly to the content. + + + the + float + + current canvas. + + + Please, use this method with caution and only if you know what you are doing. + + Please, use this method with caution and only if you know what you are doing. + Manipulating with underlying stream object of canvas could lead to corruption of it's data. + + the content stream to which this canvas object writes. + + + + Adds + PdfImageXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + + + + Adds + PdfFormXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + current canvas. + + + + Adds + PdfFormXObject + to the specified position. + + + + + current canvas. + + + + Adds + PdfFormXObject + to specified rectangle on canvas. + + + + current canvas. + + + + Adds I + PdfFormXObject + to the specified position with specified width preserving aspect ratio. + + + + + + current canvas. + + + + Adds + PdfFormXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + + + + + Adds + PdfImageXObject + to canvas. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + canvas a reference to this object. + + + + Adds + PdfImageXObject + to the specified position. + + + + + + + + + Adds + PdfImageXObject + to specified rectangle on canvas. + + + + + + + + Adds + PdfImageXObject + to the specified position with specified width preserving aspect ratio. + + + + + + + + + + Adds + PdfImageXObject + to the specified position with specified height preserving aspect ratio. + + + + + + + current canvas. + + + + A helper to insert into the content stream the + + converted to bytes according to the font's encoding. + + the text to write. + + + Creates a Type3Glyph canvas with a new Content Stream. + the document that this canvas is created for + + + Creates a Type3Glyph canvas with a non-empty Content Stream. + + + PdfStream + from existed document. + + + document to which + PdfStream + belongs. + + + + Indicates if the glyph color specified in the glyph description or not. + whether the glyph color is specified in the glyph description or not + + + Writes the width and optionally the bounding box parameters for a glyph + the advance this character will have + + the X lower left corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the Y lower left corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the X upper right corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + the Y upper right corner of the glyph bounding box. If the isColor option is + true the value is ignored + + + defines whether the glyph color is specified in the glyph description in the font. + The consequence of value true is that the bounding box parameters are ignored. + + + + Creates Image XObject from image and adds it to canvas. + + Creates Image XObject from image and adds it to canvas. Performs additional checks to make + sure that we only add mask images to not colorized type 3 fonts. + + + the + PdfImageXObject + object + + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + an element of the transformation matrix + true if to add image as in-line. + created Image XObject or null in case of in-line image (asInline = true). + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The type of affine transformation. + + The type of affine transformation. See + + . + + + + The TYPE_UNKNOWN is an initial type value. + + + The min value equivalent to zero. + The min value equivalent to zero. If absolute value less then ZERO it considered as zero. + + + The values of transformation matrix + + + The transformation type + + + Method returns type of affine transformation. + + Method returns type of affine transformation. + Transform matrix is + m00 m01 m02 + m10 m11 m12 + According analytic geometry new basis vectors are (m00, m01) and (m10, m11), + translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1). + Type transformations classification: +
      +
    • + + - new basis equals original one and zero translation
    • +
    • + + - translation vector isn't zero
    • +
    • + + - vectors length of new basis equals
    • +
    • + + - vectors length of new basis doesn't equal
    • +
    • + + - new basis vector orientation differ from original one
    • +
    • + + - new basis is rotated by 90, 180, 270, or 360 degrees
    • +
    • + + - new basis is rotated by arbitrary angle
    • +
    • + + - transformation can't be inversed
    • +
    +
    +
    + + Multiply matrix of two AffineTransform objects + - the AffineTransform object is a multiplicand + - the AffineTransform object is a multiplier + an AffineTransform object that is a result of t1 multiplied by matrix t2. + + + + + + + + + + + + + + + + + + Represents a Bezier curve. + + + Represents segment from a PDF path. + + + Treat base points as the points which are enough to construct a shape. + + Treat base points as the points which are enough to construct a shape. + E.g. for a bezier curve they are control points, for a line segment - the start and the end points + of the segment. + + + Ordered + + consisting of shape's base points. + + + + + If the distance between a point and a line is less than + this constant, then we consider the point lies on the line. + + + + + In the case when neither the line ((x1, y1), (x4, y4)) passes + through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we + use the square of the sum of the distances mentioned below in + compare to this field as the criterion of good approximation. + + + In the case when neither the line ((x1, y1), (x4, y4)) passes + through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we + use the square of the sum of the distances mentioned below in + compare to this field as the criterion of good approximation. + 1. The distance between the line and (x2, y2) + 2. The distance between the line and (x3, y3) + + + + + The Manhattan distance is used in the case when either the line + ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) + or (x1, y1) = (x4, y4). + + + The Manhattan distance is used in the case when either the line + ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) + or (x1, y1) = (x4, y4). The essential observation is that when + the curve is a uniform speed straight line from end to end, the + control points are evenly spaced from beginning to end. Our measure + of how far we deviate from that ideal uses distance of the middle + controls: point 2 should be halfway between points 1 and 3; point 3 + should be halfway between points 2 and 4. + + + + Constructs new bezier curve. + Curve's control points. + + + + + + + You can adjust precision of the approximation by varying the following + parameters: + + , + + , + + + + + + containing points of piecewise linear approximation + for this bezier curve. + + + + Represents a line. + + + Constructs a new zero-length line starting at zero. + + + Constructs a new line based on the given coordinates. + + + Constructs a new line based on the given coordinates. + + + Represents a line segment in a particular coordinate system. + Represents a line segment in a particular coordinate system. This class is immutable. + + + Start vector of the segment. + + + End vector of the segment. + + + Creates a new line segment. + the start point of a line segment. + the end point of a line segment. + + + the start point + + + the end point + + + the length of this line segment + + + Computes the bounding rectangle for this line segment. + + Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees + with respect to the coordinate system that the line system is in. For example, if a line segment + is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have + origin of the lower left hand end point of the segment, with width = 4 and height = 3. + + the bounding rectangle + + + Computes the bounding rectangle for this line segment. + + Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees + with respect to the coordinate system that the line system is in. For example, if a line segment + is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have + origin of the lower left hand end point of the segment, with width = 4 and height = 3. + + the bounding rectangle + + + Transforms the segment by the specified matrix + the matrix for the transformation + the transformed segment + + + Checks if a segment contains another segment in itself + a segment to be checked + true if this segment contains other one, false otherwise + + + Checks if a segment contains a given point in itself + a point to be checked + true if this segment contains given point, false otherwise + + + + Keeps all the values of a 3 by 3 matrix and allows you to + do some math with matrices. + + + + the row=1, col=1 position ('a') in the matrix. + + + the row=1, col=2 position ('b') in the matrix. + + + the row=1, col=3 position (always 0 for 2-D) in the matrix. + + + the row=2, col=1 position ('c') in the matrix. + + + the row=2, col=2 position ('d') in the matrix. + + + the row=2, col=3 position (always 0 for 2-D) in the matrix. + + + the row=3, col=1 ('e', or X translation) position in the matrix. + + + the row=3, col=2 ('f', or Y translation) position in the matrix. + + + the row=3, col=3 position (always 1 for 2-D) in the matrix. + + + + constructs a new Matrix with identity. + + + Constructs a matrix that represents translation + + + + + Creates a Matrix with 6 specified entries + + + + + + + + + + + multiplies this matrix by 'b' and returns the result + See http://en.wikipedia.org/wiki/Matrix_multiplication + + The matrix to multiply by + the resulting matrix + + + Subtracts a matrix from this matrix and returns the results + the matrix to subtract from this matrix + a Matrix object + + + Computes the determinant of the matrix. + the determinant of the matrix + + + Checks equality of matrices. + the other Matrix that needs to be compared with this matrix. + true if both matrices are equal + + + + Generates a hash code for this object. + the hash code of this object + + + + Generates a String representation of the matrix. + the values, delimited with tabs and newlines. + + + + NoninvertibleTransformException + Denis M. Kishenko + + + Creates a new NoninvertibleTransformException. + the detail message. + + + Class that represent rectangle object. + + + Creates new instance. + the x coordinate of lower left point + the y coordinate of lower left point + the width value + the height value + + + Creates new instance of rectangle with (0, 0) as the lower left point. + the width value + the height value + + + + Creates the copy of given + + + + the copied + + + + + Calculates the common rectangle which includes all the input rectangles. + list of input rectangles. + common rectangle. + + + Sets the rectangle by the coordinates, specifying its lower left and upper right points. + + Sets the rectangle by the coordinates, specifying its lower left and upper right points. May be used in chain. +
    +
    + Note: this method will normalize coordinates, so the rectangle will have non negative width and height, + and its x and y coordinates specified lower left point. +
    + the X coordinate of lower left point + the Y coordinate of lower left point + the X coordinate of upper right point + the Y coordinate of upper right point + + this + + instance. + +
    + + Gets the X coordinate of lower left point. + the X coordinate of lower left point. + + + Sets the X coordinate of lower left point. + Sets the X coordinate of lower left point. May be used in chain. + the X coordinate of lower left point to be set. + + this + + instance. + + + + Gets the Y coordinate of lower left point. + the Y coordinate of lower left point. + + + Sets the Y coordinate of lower left point. + Sets the Y coordinate of lower left point. May be used in chain. + the Y coordinate of lower left point to be set. + + this + + instance. + + + + Gets the width of rectangle. + the width of rectangle. + + + Sets the width of rectangle. + Sets the width of rectangle. May be used in chain. + the the width of rectangle to be set. + + this + + instance. + + + + Gets the height of rectangle. + the height of rectangle. + + + Sets the height of rectangle. + Sets the height of rectangle. May be used in chain. + the the width of rectangle to be set. + + this + + instance. + + + + Increases the height of rectangle by the given value. + Increases the height of rectangle by the given value. May be used in chain. + the value of the extra height to be added. + + this + + instance. + + + + Decreases the height of rectangle by the given value. + Decreases the height of rectangle by the given value. May be used in chain. + the value of the extra height to be subtracted. + + this + + instance. + + + + Gets the X coordinate of the left edge of the rectangle. + + Gets the X coordinate of the left edge of the rectangle. Same as: + getX() + . + + the X coordinate of the left edge of the rectangle. + + + Gets the X coordinate of the right edge of the rectangle. + + Gets the X coordinate of the right edge of the rectangle. Same as: + getX() + getWidth() + . + + the X coordinate of the right edge of the rectangle. + + + Gets the Y coordinate of the upper edge of the rectangle. + + Gets the Y coordinate of the upper edge of the rectangle. Same as: + getY() + getHeight() + . + + the Y coordinate of the upper edge of the rectangle. + + + Gets the Y coordinate of the lower edge of the rectangle. + + Gets the Y coordinate of the lower edge of the rectangle. Same as: + getY() + . + + the Y coordinate of the lower edge of the rectangle. + + + Decreases the y coordinate. + the value on which the position will be changed. + + this + + instance. + + + + Increases the y coordinate. + the value on which the position will be changed. + + this + + instance. + + + + Increases the x coordinate. + the value on which the position will be changed. + + this + + instance. + + + + Decreases the x coordinate. + the value on which the position will be changed. + + this + + instance. + + + + Change the rectangle according the specified margins. + the value on which the top y coordinate will change. + the value on which the right x coordinate will change. + the value on which the bottom y coordinate will change. + the value on which the left x coordinate will change. + + if + + the rectangle will expand, otherwise it will shrink + + + this instance that is cast to type T. + + + Checks if rectangle have common points with line, specified by two points. + the x coordinate of first line's point. + the y coordinate of first line's point. + the x coordinate of second line's point. + the y coordinate of second line's point. + + + + if rectangle have common points with line and + + otherwise. + + + + Gets the string representation of rectangle. + the string representation of rectangle. + + + Gets the copy of this rectangle. + the copied rectangle. + + + Compares instance of this rectangle with given deviation equals to 0.0001 + + the + + to compare with. + + + + + if the difference between corresponding rectangle values is less than deviation and + + otherwise. + + + + Compares instance of this rectangle with given deviation. + + the + + to compare with. + + the deviation value. + + + + if the difference between corresponding rectangle values is less than deviation and + + otherwise. + + + + Rotates PageSize clockwise. + + + Paths define shapes, trajectories, and regions of all sorts. + + Paths define shapes, trajectories, and regions of all sorts. They shall be used + to draw lines, define the shapes of filled areas, and specify boundaries for clipping + other graphics. A path shall be composed of straight and curved line segments, which + may connect to one another or may be disconnected. + + + + + A + + of subpaths forming this path. + + + + Adds the subpath to this path. + The subpath to be added to this path. + + + Adds the subpaths to this path. + + + + of subpaths to be added to this path. + + + + The current point is the trailing endpoint of the segment most recently added to the current path. + + The current point. + + + Begins a new subpath by moving the current point to coordinates (x, y). + + + Appends a straight line segment from the current point to the point (x, y). + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3). + + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3) with the note that the current + point represents two control points. + + + + Appends a cubic Bezier curve to the current path. + + Appends a cubic Bezier curve to the current path. The curve shall extend from + the current point to the point (x3, y3) with the note that the (x3, y3) + point represents two control points. + + + + Appends a rectangle to the current path as a complete subpath. + + + Appends a rectangle to the current path as a complete subpath. + + + Closes the current subpath. + + + Closes all subpathes contained in this path. + + + Adds additional line to each closed subpath and makes the subpath unclosed. + + Adds additional line to each closed subpath and makes the subpath unclosed. + The line connects the last and the first points of the subpaths. + + Indices of modified subpaths. + + + Path is empty if it contains no subpaths. + + + As subpath is a part of a path comprising a sequence of connected segments. + + + Creates a new SubPath instance. + + + Copy constuctor. + + + + Constructs a new subpath starting at the given point. + + + Constructs a new subpath starting at the given point. + + + Sets the start point of the subpath. + + + + Sets the start point of the subpath. + + + + + The point this subpath starts at. + + + The last point of the subpath. + + + Adds a segment to the subpath. + + Adds a segment to the subpath. + Note: each new segment shall start at the end of the previous segment. + + new segment. + + + + + + comprising all the segments + the subpath made on. + + + + Checks whether subpath is empty or not. + true if the subpath is empty, false otherwise. + + + + true if this subpath contains only one point and it is not closed, + false otherwise + + + + + true if this subpath contains only one point and it is closed, + false otherwise + + + + Returns a boolean value indicating whether the subpath must be closed or not. + + Returns a boolean value indicating whether the subpath must be closed or not. + Ignore this value if the subpath is a rectangle because in this case it is already closed + (of course if you paint the path using re operator) + + boolean value indicating whether the path must be closed or not. + + + + See + + + + + Returns a boolean indicating whether the subpath is degenerate or not. + + Returns a boolean indicating whether the subpath is degenerate or not. + A degenerate subpath is the subpath consisting of a single-point closed path or of + two or more points at the same coordinates. + + boolean value indicating whether the path is degenerate or not. + + + + + + containing points of piecewise linear approximation + for this subpath. + + + + Represents a vector (i.e. + + Represents a vector (i.e. a point in space). This class is completely + unrelated to the + + class in the standard JRE. +

    + For many PDF related operations, the z coordinate is specified as 1 + This is to support the coordinate transformation calculations. If it + helps, just think of all PDF drawing operations as occurring in a single plane + with z=1. +
    +
    + + index of the X coordinate + + + index of the Y coordinate + + + index of the Z coordinate + + + the values inside the vector + + + Creates a new Vector + the X coordinate + the Y coordinate + the Z coordinate + + + Gets the value from a coordinate of the vector + the index of the value to get (I1, I2 or I3) + a coordinate value + + + Computes the cross product of this vector and the specified matrix + the matrix to cross this vector with + the result of the cross product + + + Computes the difference between this vector and the specified vector + the vector to subtract from this one + the results of the subtraction + + + Computes the cross product of this vector and the specified vector + the vector to cross this vector with + the cross product + + + Normalizes the vector (i.e. + Normalizes the vector (i.e. returns the unit vector in the same orientation as this vector) + the unit vector + + + Multiplies the vector by a scalar + the scalar to multiply by + the result of the scalar multiplication + + + Computes the dot product of this vector with the specified vector + the vector to dot product this vector with + the dot product + + + + Computes the length of this vector +
    + Note: If you are working with raw vectors from PDF, be careful - + the Z axis will generally be set to 1. +
    + + Computes the length of this vector +
    + Note: If you are working with raw vectors from PDF, be careful - + the Z axis will generally be set to 1. If you want to compute the + length of a vector, subtract it from the origin first (this will set + the Z axis to 0). +
    + For example: + aVector.subtract(originVector).length(); +
    + the length of this vector +
    + + Computes the length squared of this vector. + + Computes the length squared of this vector. +

    + The square of the length is less expensive to compute, and is often + useful without taking the square root. +

    + Note: See the important note under + + + the square of the length of the vector + + + + + +

    Calculates the hashcode using the values. +
    + + + + + + Gets a Counter instance for a specific class. + + + This method gets triggered if a document is read. + the length of the document that was read + + + This method gets triggered if a document is written. + the length of the document that was written + + + + The singleton instance. + + + The current counter implementation. + + + The empty constructor. + + + Returns the singleton instance of the factory. + + + Returns a counter factory. + + + Getter for the counter. + + + Setter for the counter. + + + Default implementation of the Counter interface that essentially doesn't do anything. + + + Implementation of the Counter interface that doesn't do anything. + + + + A + + implementation that outputs information about read and written documents to + + + + + + The name of the class for which the Counter was created + (or iText if no name is available) + + + + This is a general class for alphabet numbering. + + This is a general class for alphabet numbering. + You can specify an alphabet and convert an integer into the corresponding + alphabet number representation. + E.g.: if the alphabet is English letters 'a' to 'z', then + 1 is represented as "a", ..., 26 is represented as "z", + 27 is represented as "aa" and so on. + + + + + Translates a positive integer (not equal to zero) + into an alphabet number using the letters from the specified alphabet. + + the number + the array containing all possible letters from the alphabet + a translated number representation + + + + This class is responsible for converting integer numbers to their + English alphabet letter representations. + + + + Converts the given number to its English alphabet lowercase string representation. + + Converts the given number to its English alphabet lowercase string representation. + E.g. 1 will be converted to "a", 2 to "b", ..., 27 to "aa", and so on. + + the number to be converted + + + Converts the given number to its English alphabet lowercase string representation. + + Converts the given number to its English alphabet lowercase string representation. + E.g. 1 will be converted to "A", 2 to "B", ..., 27 to "AA", and so on. + + the number to be converted + + + Converts the given number to its English alphabet string representation. + + Converts the given number to its English alphabet string representation. + E.g. for upperCase set to false, + 1 will be converted to "a", 2 to "b", ..., 27 to "aa", and so on. + + the number to be converted + whether to use uppercase or lowercase alphabet + + + + This class is responsible for converting integer numbers to their + Greek alphabet letter representations. + + + This class is responsible for converting integer numbers to their + Greek alphabet letter representations. + We are aware of the fact that the original Greek numbering is different. + See http://www.cogsci.indiana.edu/farg/harry/lan/grknum.htm#ancient + but this isn't implemented yet; the main reason being the fact that we + need a font that has the obsolete Greek characters qoppa and sampi. + So we use standard 24 letter Greek alphabet + + + + Converts the given number to its Greek alphabet lowercase string representation. + + Converts the given number to its Greek alphabet lowercase string representation. + E.g. 1 will be converted to "?", 2 to "?", and so on. + + the number to be converted + + + Converts the given number to its Greek alphabet lowercase string representation. + + Converts the given number to its Greek alphabet lowercase string representation. + E.g. 1 will be converted to "A", 2 to "B", and so on. + + the number to be converted + + + Converts the given number to its Greek alphabet string representation. + + Converts the given number to its Greek alphabet string representation. + E.g. for upperCase set to false, + 1 will be converted to "?", 2 to "?", and so on. + + the number to be converted + whether to use uppercase or lowercase alphabet + + + Converts a given greek unicode character code into the code of the corresponding char Symbol font. + + original unicode char + the corresponding symbol code in Symbol standard font + + + This class can produce String combinations representing a roman number. + + This class can produce String combinations representing a roman number. + The first roman numbers are: I, II, III, IV, V, VI, VII, VIII, IX, X + See http://en.wikipedia.org/wiki/Roman_numerals + + + + Array with Roman digits. + + + Returns a lower case roman representation of an integer. + a number to be converted to roman notation. + + + Returns an upper case roman representation of an integer. + a number to be converted to roman notation. + + + Returns a roman representation of an integer. + a number to be converted to roman notation. + + true for upper case representation, + false for lower case one. + + + + Returns a roman representation of an integer. + the original number + the roman number representation (lower case) + + + Helper class for Roman Digits + + + part of a roman number + + + value of the roman digit + + + can the digit be used as a prefix + + + Constructs a roman digit + the roman digit + the value + can it be used as a prefix + + + A wrapper for action dictionaries (ISO 32000-1 section 12.6). + + A wrapper for action dictionaries (ISO 32000-1 section 12.6). + An action dictionary defines the characteristics and behaviour of an action. + + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + A possible submit value + + + Constructs an empty action that can be further modified. + + + + Constructs a + + instance with a given dictionary. It can be used for handy + property reading in reading mode or modifying in stamping mode. + + the dictionary to construct the wrapper around + + + Creates a GoTo action (section 12.6.4.2 of ISO 32000-1) via a given destination. + the desired destination of the action + created action + + + + Creates a GoTo action (section 12.6.4.2 of ISO 32000-1) via a given + + name. + + + + + name + + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the file in which the destination shall be located + the destination in the remote document to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the file in which the destination shall be located + the destination in the remote document to jump to + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the remote destination document page to jump to + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the remote destination document page to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the string destination in the remote document to jump to + a flag specifying whether to open the destination document in a new window + created action + + + Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). + the remote destination file to jump to + the string destination in the remote document to jump to + created action + + + Creates a GoToE action, or embedded file action (section 12.6.4.4 of ISO 32000-1). + the destination in the target to jump to + + if true, the destination document should be opened in a new window; + if false, the destination document should replace the current document in the same window + + + A target dictionary specifying path information to the target document. + Each target dictionary specifies one element in the full path to the target and + may have nested target dictionaries specifying additional elements + + created action + + + Creates a GoToE action, or embedded file action (section 12.6.4.4 of ISO 32000-1). + The root document of the target relative to the root document of the source + the destination in the target to jump to + + if true, the destination document should be opened in a new window; + if false, the destination document should replace the current document in the same window + + + A target dictionary specifying path information to the target document. + Each target dictionary specifies one element in the full path to the target and + may have nested target dictionaries specifying additional elements + + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + a flag specifying whether to open the destination document in a new window + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + created action + + + Creates a Launch action (section 12.6.4.5 of ISO 32000-1). + the application that shall be launched or the document that shall beopened or printed + + A dictionary containing Windows-specific launch parameters + a flag specifying whether to open the destination document in a new window + created action + + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + A thread action jumps to a specified bead on an article thread (see 12.4.3, “Articles”), + in either the current document or a different one. Table 205 shows the action dictionary + entries specific to this type of action. + + the file containing the thread. If this entry is absent, the thread is in the current file + + the destination thread + the bead in the destination thread + created action + + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + + Creates a Thread action (section 12.6.4.6 of ISO 32000-1). + A thread action jumps to a specified bead on an article thread (see 12.4.3, “Articles”), + in either the current document or a different one. Table 205 shows the action dictionary + entries specific to this type of action. + + the file containing the thread. If this entry is absent, the thread is in the current file + + created action + + + Creates a URI action (section 12.6.4.7 of ISO 32000-1). + the uniform resource identifier to resolve + created action + + + Creates a URI action (section 12.6.4.7 of ISO 32000-1). + the uniform resource identifier to resolve + a flag specifying whether to track the mouse position when the URI is resolved + created action + + + Creates a Sound action (section 12.6.4.8 of ISO 32000-1). + a sound object defining the sound that shall be played (see section 13.3 of ISO 32000-1) + + created action + + + Creates a Sound action (section 12.6.4.8 of ISO 32000-1). + a sound object defining the sound that shall be played (see section 13.3 of ISO 32000-1) + + the volume at which to play the sound, in the range -1.0 to 1.0. Default value: 1.0 + + a flag specifying whether to play the sound synchronously or asynchronously. + If this flag is true, the conforming reader retains control, allowing no further user + interaction other than canceling the sound, until the sound has been completely played. + Default value: false + + + a flag specifying whether to repeat the sound indefinitely + If this entry is present, the Synchronous entry shall be ignored. Default value: false + + a flag specifying whether to mix this sound with any other sound already playing + created action + + + Creates a Movie annotation (section 12.6.4.9 of ISO 32000-1). + a movie annotation identifying the movie that shall be played + the title of a movie annotation identifying the movie that shall be played + + the operation that shall be performed on the movie. Shall be one of the following: + + , + + , + + , + + + created annotation + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + the annotation to be hidden or shown + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + the annotations to be hidden or shown + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + + a text string giving the fully qualified field name of an interactive form field whose + associated widget annotation or annotations are to be affected + + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Hide action (section 12.6.4.10 of ISO 32000-1). + + a text string array giving the fully qualified field names of interactive form fields whose + associated widget annotation or annotations are to be affected + + a flag indicating whether to hide the annotation (true) or show it (false) + + created action + + + Creates a Named action (section 12.6.4.11 of ISO 32000-1). + + the name of the action that shall be performed. Shall be one of the following: + + , + + , + + , + + + created action + + + Creates a Set-OCG-State action (section 12.6.4.12 of ISO 32000-1). + + a list of + + state descriptions + + created action + + + Creates a Set-OCG-State action (section 12.6.4.12 of ISO 32000-1). + + states a list of + + state descriptions + + + If true, indicates that radio-button state relationships between optional content groups + should be preserved when the states are applied + + created action + + + Creates a Rendition action (section 12.6.4.13 of ISO 32000-1). + the name of the media clip, for use in the user interface. + a full file specification or form XObject that specifies the actual media data + an ASCII string identifying the type of data + a screen annotation + created action + + + Creates a JavaScript action (section 12.6.4.16 of ISO 32000-1). + a text string containing the JavaScript script to be executed. + created action + + + Creates a Submit-Form Action (section 12.7.5.2 of ISO 32000-1). + a uniform resource locator, as described in 7.11.5, "URL Specifications" + + an array identifying which fields to include in the submission or which to exclude, + depending on the setting of the Include/Exclude flag in the Flags entry. + This is an optional parameter and can be null + + + a set of flags specifying various characteristics of the action (see Table 237 of ISO 32000-1). + Default value to be passed: 0. + + created action + + + Creates a Reset-Form Action (section 12.7.5.3 of ISO 32000-1). + + an array identifying which fields to reset or which to exclude from resetting, + depending on the setting of the Include/Exclude flag in the Flags entry (see Table 239 of ISO 32000-1). + + + a set of flags specifying various characteristics of the action (see Table 239 of ISO 32000-1). + Default value to be passed: 0. + + created action + + + + Adds a chained action. + the next action or sequence of actions that shall be performed after the current action + + + + + Inserts the value into the underlying object of this + + and associates it with the specified key. + If the key is already present in this + + , this method will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + + this + + instance + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + This is a helper class for optional content states use in Set-OCG-State actions. + + This is a helper class for optional content states use in Set-OCG-State actions. + See + + . + + + + + Can be: + + , + + , + + + + + Optional content group dictionaries + + + Constructs an optional content state object. + + a + + describing the state. Shall be one of the following: + + , + + , + + + a list of the OCG dictionaries + + + Gets the state the optional content groups should be switched to + + the state, one of the following: + + , + + , + + + + + Gets a list of optional content groups that shall have the state changed + the list of optional content groups + + + + Gets a list of + + that is describing this particular optional content group states. + + + a list of + + for construction of a + + + + + This class is a wrapper of media clip data dictionary that defines the data for a media object that can be played. + + + + + Constructs a new + + wrapper using an existing dictionary. + + the dictionary to construct the wrapper from + + + + Constructs a new + + wrapper around a newly created dictionary. + + the name of the file to create a media clip for + a file specification that specifies the actual media data + an ASCII string identifying the type of data + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + This a wrapper around a rendition dictionary. + This a wrapper around a rendition dictionary. See ISO 32000-1 sections 13.2.3.2, 13.2.3.3. + + + + Creates a new wrapper around an existing + + + a rendition object to create a wrapper for + + + Creates a new wrapper around a newly created media rendition dictionary object. + a text string specifying the name of the file to display + a file specification that specifies the actual media data + an ASCII string identifying the type of data + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + + A target dictionary locates the target in relation to the source, + in much the same way that a relative path describes the physical + relationship between two files in a file system. + + + A target dictionary locates the target in relation to the source, + in much the same way that a relative path describes the physical + relationship between two files in a file system. Target dictionaries may be + nested recursively to specify one or more intermediate targets before reaching the final one. + + + + + Creates a new + + object by the underlying dictionary. + + the underlying dictionary object + + + + Creates a new + + object given its type. The type must be either + + , or + + . If it is + + , additional entries must be specified + according to the spec. + + the relationship between the current document and the target + + + + Creates a new + + object. + + the relationship between the current document and the target + the name of the file in the EmbeddedFiles name tree + + if the value is an integer, it specifies the page number (zero-based) in the current + document containing the file attachment annotation. If the value is a string, + it specifies a named destination in the current document that provides the page + number of the file attachment annotation + + + If the value is an integer, it specifies the index (zero-based) of the annotation in the + Annots array of the page specified by P. If the value is a text string, + it specifies the value of NM in the annotation dictionary + + + A target dictionary specifying additional path information to the target document. + If this entry is absent, the current document is the target file containing the destination + + + + Creates a new target object pointing to the parent of the current document. + + created + + + + + Creates a new target object pointing to a file in the EmbeddedFiles name tree. + the name of the file in the EmbeddedFiles name tree + created object + + + Creates a new target object pointing to a file attachment annotation. + + a named destination in the current document that + provides the page number of the file attachment annotation + + + a unique annotation identifier ( + + entry) of the annotation + + created object + + + Creates a new target object pointing to a file attachment annotation. + the number of the page in the current document, one-based + the index of the annotation in the Annots entry of the page, zero-based + created object + + + + Sets the name of the file in the EmbeddedFiles name tree for the child target located + in the EmbeddedFiles. + + the name of the file + this object wrapper + + + + Gets name of the file in the EmbeddedFiles name tree for the child target located + in the EmbeddedFiles. + + the name of the child file for this target + + + + Sets the page number in the current document containing the file attachment annotation for the + child target associates with a file attachment annotation. + + + the page number (one-based) in the current document containing + the file attachment annotation + + this object wrapper + + + + Sets a named destination in the current document that provides the page number of the file + attachment annotation for the child target associated with a file attachment annotation. + + + a named destination in the current document that provides the page + number of the file attachment annotation + + this object wrapper + + + Get the contents of the /P entry of this target object. + + Get the contents of the /P entry of this target object. + If the value is an integer, it specifies the page number (zero-based) + in the current document containing the file attachment annotation. + If the value is a string, it specifies a named destination in the current + document that provides the page number of the file attachment annotation. + + the /P entry of target object + + + + Sets the index of the annotation in Annots array of the page specified by /P entry + for the child target associated with a file attachment annotation. + + the index (zero-based) of the annotation in the Annots array + this object wrapper + + + + Sets the text value, which uniquely identifies an annotation (/NM entry) in an annotation dictionary + for the child target associated with a file attachment annotation. + + specifies the value of NM in the annotation dictionary of the target annotation + + this object wrapper + + + Gets the object in the /A entry of the underlying object. + + Gets the object in the /A entry of the underlying object. If the value is an integer, + it specifies the index (zero-based) of the annotation in the Annots array of the page specified by P. + If the value is a text string, it specifies the value of NM in the annotation dictionary. + + the /A entry in the target object + + + Sets a target dictionary specifying additional path information to the target document. + + Sets a target dictionary specifying additional path information to the target document. + If this entry is absent, the current document is the target file containing the destination. + + the additional path target dictionary + this object wrapper + + + Get a target dictionary specifying additional path information to the target document. + + Get a target dictionary specifying additional path information to the target document. + If the current target object is the final node in the target path, null is returned. + + a target dictionary specifying additional path information to the target document + + + + This is a convenient method to put key-value pairs to the underlying + + . + + + the key, a + + instance + + the value + this object wrapper + + + + + + This class is a wrapper around a Windows launch parameter dictionary. + + + Creates a new wrapper around an existing Windows launch parameter dictionary. + the dictionary to create a wrapper for + + + Creates a new wrapper around a newly created Windows launch parameter dictionary. + + the file name of the application that shall be launched or the document that shall be opened or printed, + in standard Windows pathname format. If the name string includes a backslash character (\), + the backslash shall itself be preceded by a backslash. + + + + Creates a new wrapper around a newly created Windows launch parameter dictionary. + + the file name of the application that shall be launched or the document that shall be opened or printed, + in standard Windows pathname format. If the name string includes a backslash character (\), + the backslash shall itself be preceded by a backslash + + a bye string specifying the default directory in standard DOS syntax + + an ASCII string specifying the operation to perform on the file. Shall be one of the following: + "open", "print" + + + a parameter string that shall be passed to the application. + This entry shall be omitted if a document is abound to be opened + + + + + + + This is a super class for the annotation dictionary wrappers. + + This is a super class for the annotation dictionary wrappers. Derived classes represent + different standard types of annotations. See ISO-320001 12.5.6, “Annotation Types.” + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Annotation flag. + + Annotation flag. + See also + + and ISO-320001, table 165. + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Widget annotation highlighting mode. + + Widget annotation highlighting mode. See ISO-320001, Table 188 (H key). + Also see + + . + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation border style. + + Annotation border style. See ISO-320001, Table 166 (S key). + Also see + + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state. + + Annotation state. See ISO-320001 12.5.6.3 "Annotation States" and Table 171 in particular. + Also see + + . + + + + Annotation state model. + + Annotation state model. See ISO-320001, Table 172 (StateModel key). + Also see + + . + + + + Annotation state model. + + Annotation state model. See ISO-320001, Table 172 (StateModel key). + Also see + + . + + + + + Factory method that creates the type specific + + from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. See derived classes of this class to see possible specific annotation types + created. + + + a + + that represents annotation in the document. + + + created + + . + + + + + Factory method that creates the type specific + + from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. + + + a + + that represents annotation in the document. + + + parent annotation of the + + to be created. This parameter is + only needed if passed + + represents a pop-up annotation in the document. + + + created + + . + + + + + Gets a + + which value is a subtype of this annotation. + See ISO-320001 12.5.6, “Annotation Types” for the reference to the possible types. + + subtype of this annotation. + + + Sets the layer this annotation belongs to. + the layer this annotation belongs to + + + + Sets a + + to this annotation which will be performed when the annotation is activated. + + + + + to set to this annotation. + + + this + + instance. + + + + + Sets an additional + + to this annotation which will be performed in response to + the specific trigger event defined by + + . See ISO-320001 12.6.3, "Trigger Events". + + + a + + that denotes a type of the additional action to set. + + + + + to set as additional to this annotation. + + + this + + instance. + + + + + Gets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + annotation text content. + + + + Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + + a + + containing text content to be set to the annotation. + + + this + + instance. + + + + + Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, + an alternate description of the annotation’s contents in human-readable form. + + + a java + + containing text content to be set to the annotation. + + + this + + instance. + + + + + Gets a + + that represents a page of the document on which annotation is placed, + i.e. which has this annotation in it's /Annots array. + + + + + that is a page pdf object or null if annotation is not added to the page yet. + + + + + Gets a + + on which annotation is placed. + + + + + on which annotation is placed or null if annotation is not placed yet. + + + + Method that modifies annotation page property, which defines to which page annotation belongs. + + Method that modifies annotation page property, which defines to which page annotation belongs. + Keep in mind that this doesn't actually add an annotation to the page, + it should be done via + + . + Also you don't need to set this property manually, this is done automatically on addition to the page. + + + the + + to which annotation will be added. + + + this + + instance. + + + + + Gets the annotation name, a text string uniquely identifying it among all the + annotations on its page. + + + a + + with annotation name as it's value or null if name + is not specified. + + + + + Sets the annotation name, a text string uniquely identifying it among all the + annotations on its page. + + + a + + to be set as annotation name. + + + this + + instance. + + + + The date and time when the annotation was most recently modified. + + The date and time when the annotation was most recently modified. + This is an optional property of the annotation. + + + a + + with the modification date as it's value or null if date is not specified. + + + + The date and time when the annotation was most recently modified. + + a + + with date. The format should be a date string as described + in ISO-320001 7.9.4, “Dates”. + + + this + + instance. + + + + A set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + + + A set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + For specific annotation flag constants see + + . + Default value: 0. + + an integer interpreted as one-bit flags specifying various characteristics of the annotation. + + + Sets a set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + + + Sets a set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”). + On the contrary from + + , this method sets a complete set of enabled and disabled flags at once. + If not set specifically the default value is 0. + + an integer interpreted as set of one-bit flags specifying various characteristics of the annotation. + + + this + + instance. + + + + Sets a flag that specifies a characteristic of the annotation to enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + + Sets a flag that specifies a characteristic of the annotation to enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + On the contrary from + + , this method sets only specified flags to enabled state, + but doesn't disable other flags. + Possible flags: +
      +
    • + + - If set, do not display the annotation if it does not belong to one of the + standard annotation types and no annotation handler is available. If clear, display such unknown annotation + using an appearance stream specified by its appearance dictionary, if any. +
    • +
    • + + - If set, do not display or print the annotation or allow it to interact with + the user, regardless of its annotation type or whether an annotation handler is available. +
    • +
    • + + - If set, print the annotation when the page is printed. If clear, never print + the annotation, regardless of whether it is displayed on the screen. +
    • +
    • + + - If set, do not scale the annotation’s appearance to match the magnification of + the page. The location of the annotation on the page (defined by the upper-left corner of its annotation + rectangle) shall remain fixed, regardless of the page magnification.} +
    • +
    • + + - If set, do not rotate the annotation’s appearance to match the rotation + of the page. The upper-left corner of the annotation rectangle shall remain in a fixed location on the page, + regardless of the page rotation. +
    • +
    • + + - If set, do not display the annotation on the screen or allow it to interact + with the user. The annotation may be printed (depending on the setting of the Print flag) but should be considered + hidden for purposes of on-screen display and user interaction. +
    • +
    • + + - If set, do not allow the annotation to interact with the user. The annotation + may be displayed or printed (depending on the settings of the NoView and Print flags) but should not respond to mouse + clicks or change its appearance in response to mouse motions. +
    • +
    • + + - If set, do not allow the annotation to be deleted or its properties + (including position and size) to be modified by the user. However, this flag does not restrict changes to + the annotation’s contents, such as the value of a form field. +
    • +
    • + + - If set, invert the interpretation of the NoView flag for certain events. +
    • +
    • + + - If set, do not allow the contents of the annotation to be modified + by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, + such as position and size. +
    • +
    +
    + - an integer interpreted as set of one-bit flags which will be enabled for this annotation. + + + this + + instance. + +
    + + Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + an integer interpreted as set of one-bit flags which will be reset to disabled state. + + this + + instance. + + + + + Checks if the certain flag that specifies a characteristic of the annotation + is in enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + + + Checks if the certain flag that specifies a characteristic of the annotation + is in enabled state (see ISO-320001 12.5.3, “Annotation Flags”). + This method allows only one flag to be checked at once, use constants listed in + + . + + + an integer interpreted as set of one-bit flags. Only one bit must be set in this integer, otherwise + exception is thrown. + + true if the given flag is in enabled state. + + + + An appearance dictionary specifying how the annotation shall be presented visually on the page during its + interactions with the user (see ISO-320001 12.5.5, “Appearance Streams”). + + + An appearance dictionary specifying how the annotation shall be presented visually on the page during its + interactions with the user (see ISO-320001 12.5.5, “Appearance Streams”). An appearance dictionary is a dictionary + containing one or several appearance streams or subdictionaries. + + + an appearance + + or null if it is not specified. + + + + Specific appearance object corresponding to the specific appearance type. + + Specific appearance object corresponding to the specific appearance type. This object might be either an appearance + stream or an appearance subdictionary. In the latter case, the subdictionary defines multiple appearance streams + corresponding to different appearance states of the annotation. See ISO-320001 12.5.5, “Appearance Streams”. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + + null if their is no such appearance type or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + The normal appearance is used when the annotation is not interacting with the user. + + The normal appearance is used when the annotation is not interacting with the user. + This appearance is also used for printing the annotation. + See also + + . + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + + The rollover appearance is used when the user moves the cursor into the annotation’s active area + without pressing the mouse button. + + + The rollover appearance is used when the user moves the cursor into the annotation’s active area + without pressing the mouse button. If not specified normal appearance is used. + See also + + . + + + null if rollover appearance is not specified or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + The down appearance is used when the mouse button is pressed or held down within the annotation’s active area. + + + The down appearance is used when the mouse button is pressed or held down within the annotation’s active area. + If not specified normal appearance is used. + See also + + . + + + null if down appearance is not specified or an appearance object which might be either + an appearance stream or an appearance subdictionary. + + + + Sets a specific type of the appearance. + + Sets a specific type of the appearance. See + + and + + for more info. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets normal appearance. + + Sets normal appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets rollover appearance. + + Sets rollover appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + Sets down appearance. + + Sets down appearance. See + + and + + for more info. + + an appearance object which might be either an appearance stream or an appearance subdictionary. + + + this + + instance. + + + + + Sets a specific type of the appearance using + + wrapper. + This method is used to set only an appearance subdictionary. See + + and + + for more info. + + + a + + specifying appearance type. Possible types are + Normal + , + Rollover + and + Down + . + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets normal appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets rollover appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + Sets down appearance using + + wrapper. This method is used to set only + appearance subdictionary. See + + and + + for more info. + + + an appearance subdictionary wrapped in + + . + + + this + + instance. + + + + + The annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary if there is such. + + + The annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary if there is such. See + + for more info. + + + a + + which defines selected appearance state. + + + + + Sets the annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary. + + + Sets the annotation’s appearance state, which selects the applicable appearance stream + from an appearance subdictionary. See + + for more info. + + + a + + which defines appearance state to be selected. + + + this + + instance. + + + + + Sets the characteristics of the annotation’s border. + + an + + specifying the characteristics of the annotation’s border. + See + + for more detailes. + + + this + + instance. + + + + + An array of numbers in the range 0.0 to 1.0, representing a colour used for the following purposes: +
      +
    • The background of the annotation’s icon when closed
    • +
    • The title bar of the annotation’s pop-up window
    • +
    • The border of a link annotation
    • +
    + The number of array elements determines the colour space in which the colour shall be defined: +
      +
    • 0 - No colour; transparent
    • +
    • 1 - DeviceGray
    • +
    • 3 - DeviceRGB
    • +
    • 4 - DeviceCMYK
    • +
    +
    + An array of numbers in the range 0.0 to 1.0, representing an annotation colour. +
    + + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes and the format + of the passing + + see + + . + + an array of numbers in the range 0.0 to 1.0, specifying color. + + this + + instance. + + + + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes and the format + of the passing array see + + . + + an array of numbers in the range 0.0 to 1.0, specifying color. + + this + + instance. + + + + Sets an annotation color. + + Sets an annotation color. For more details on annotation color purposes + see + + . + + + + + object of the either + + , + + or + + type. + + + this + + instance. + + + + + The integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + + integer key in structural parent tree or -1 if annotation is not tagged. + + + + Sets he integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + + + Sets he integer key of the annotation’s entry in the structural parent tree + (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). + Note: Normally, there is no need to take care of this manually, struct parent index is set automatically + if annotation is added to the tagged document's page. + + + integer which is to be the key of the annotation's entry + in structural parent tree. + + + this + + instance. + + + + A flag specifying whether the annotation shall initially be displayed open. + + A flag specifying whether the annotation shall initially be displayed open. + This flag has affect to not all kinds of annotations. + + true if annotation is initially open, false - if closed. + + + Sets a flag specifying whether the annotation shall initially be displayed open. + + Sets a flag specifying whether the annotation shall initially be displayed open. + This flag has affect to not all kinds of annotations. + + true if annotation shall initially be open, false - if closed. + + this + + instance. + + + + + + + Sets border style dictionary that has more settings than the array specified for the Border entry ( + + ). + See ISO-320001, Table 166 and + + for more info. + + + a border style dictionary specifying the line width and dash pattern that shall be used + in drawing the annotation’s border. + + + this + + instance. + + + + Setter for the annotation's preset border style. + + Setter for the annotation's preset border style. Possible values are +
      +
    • + + - A solid rectangle surrounding the annotation.
    • +
    • + + - A dashed rectangle surrounding the annotation.
    • +
    • + + - A simulated embossed rectangle that appears to be raised above the surface of the page.
    • +
    • + + - A simulated engraved rectangle that appears to be recessed below the surface of the page.
    • +
    • + + - A single line along the bottom of the annotation rectangle.
    • +
    + See also ISO-320001, Table 166. +
    + The new value for the annotation's border style. + The annotation which this method was called on. + +
    + + Setter for the annotation's preset dashed border style. + + Setter for the annotation's preset dashed border style. This property has affect only if + + style was used for the annotation border style (see + + . + See ISO-320001 8.4.3.6, “Line Dash Pattern” for the format in which dash pattern shall be specified. + + + a dash array defining a pattern of dashes and gaps that + shall be used in drawing a dashed border. + + + this + + instance. + + + + The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. + + + The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. + That entry specifies a border style dictionary that has more settings than the array specified for the Border + entry (see + + ). If an annotation dictionary includes the BS entry, then the Border + entry is ignored. If annotation includes AP (see + + ) it takes + precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. + + + + + which is a border style dictionary or null if it is not specified. + + + + Sets annotation title. + Sets annotation title. This property affects not all annotation types. + + a + + which value is to be annotation title. + + + this + + instance. + + + + Annotation title. + + Annotation title. For example for markup annotations, the title is the text label that shall be displayed in the + title bar of the annotation’s pop-up window when open and active. For movie annotation Movie actions + (ISO-320001 12.6.4.9, “Movie Actions”) may use this title to reference the movie annotation. + + + + + which value is an annotation title or null if it isn't specifed. + + + + + Sets an appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. + + + Sets an appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. See ISO-320001, Table 189. + This property affects + + and + + . + + + the + + with additional information for appearance stream. + + + this + + instance. + + + + + An appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. + + + An appearance characteristics dictionary containing additional information for constructing the + annotation’s appearance stream. See ISO-320001, Table 189. + This property affects + + and + + . + + an appearance characteristics dictionary or null if it isn't specified. + + + + An + + to perform, such as launching an application, playing a sound, + changing an annotation’s appearance state etc, when the annotation is activated. + + + + + which defines the characteristics and behaviour of an action. + + + + An additional actions dictionary that extends the set of events that can trigger the execution of an action. + + + An additional actions dictionary that extends the set of events that can trigger the execution of an action. + See ISO-320001 12.6.3 Trigger Events. + + + an additional actions + + . + + + + + The annotation rectangle, defining the location of the annotation on the page in default user space units. + + + a + + which specifies a rectangle by two diagonally opposite corners. + Typically, the array is of form [llx lly urx ury]. + + + this + + instance. + + + + The annotation rectangle, defining the location of the annotation on the page in default user space units. + + + a + + which specifies a rectangle by two diagonally opposite corners. + Typically, the array is of form [llx lly urx ury]. + + + + + Inserts the value into into the underlying + + of this + + and associates it + with the specified key. If the key is already present in this + + , this method will override + the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + + this + + instance. + + + + + Removes the specified key from the underlying + + of this + + . + + key to be removed + + this + + instance. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This is a super class for the annotations which are defined as markup annotations + because they are used primarily to mark up PDF documents. + + + This is a super class for the annotations which are defined as markup annotations + because they are used primarily to mark up PDF documents. These annotations have + text that appears as part of the annotation and may be displayed in other ways + by a conforming reader, such as in a Comments pane. + See also ISO-320001 12.5.6.2 "Markup Annotations". + + + + + The text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. + + + The text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. This entry shall identify the user who added the annotation. + + + + + which value is an annotation text label content + or null if text is not specified. + + + + + Sets the text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. + + + Sets the text label that will be displayed in the title bar of the annotation's pop-up window + when open and active. This entry shall identify the user who added the annotation. + + + + + which value is an annotation text label content. + + + this + + instance. + + + + The constant opacity value that will be used in painting the annotation. + + The constant opacity value that will be used in painting the annotation. + This value is applied to all visible elements of the annotation in its closed state + (including its background and border) but not to the pop-up window that appears when + the annotation is opened. Default value: 1.0. + + + a + + which value is in range between 0 and 1, which specifies the + level of opacity. This method returns null if opacity is not specified; in this case default + value is used, which is 1. + + + + Sets the constant opacity value that will be used in painting the annotation. + + a + + which value is in range between 0 and 1, which specifies the + level of opacity. + + + this + + instance. + + + + + + A rich text string (see ISO-320001 12.7.3.4, “Rich Text Strings”) that + shall be displayed in the pop-up window when the annotation is opened. + + + text string or text stream that specifies rich text or null if + rich text is not specified. + + + + + Sets a rich text string (see ISO-320001 12.7.3.4, “Rich Text Strings”) that + shall be displayed in the pop-up window when the annotation is opened. + + text string or text stream that specifies rich text. + + this + + instance. + + + + The date and time when the annotation was created. + + a + + which value should be in the date format specified in (ISO-320001 7.9.4, “Dates”). + + + + Sets the date and time when the annotation was created. + + + + which value should be in the date format + specified in (ISO-320001 7.9.4, “Dates”). + + + this + + instance. + + + + + An annotation object that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + An annotation object that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that represents an annotation that this annotation is “in reply to.” + + + + + An annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + An annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that this annotation is “in reply to.” + + + + + Sets an annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + + + Sets an annotation that this annotation is “in reply to.” + Both annotations shall be on the same page of the document. + The relationship between the two annotations shall be specified by the RT entry + (see + + ). + + + a + + that this annotation is “in reply to.” + + + this + + instance. + + + + Sets a pop-up annotation for entering or editing the text associated with this annotation. + + Sets a pop-up annotation for entering or editing the text associated with this annotation. + Pop-up annotation defines an associated with this annotation pop-up window that may contain text. + The Contents (see + + ) entry of the annotation that has + an associated popup specifies the text that shall be displayed when the pop-up window is opened. + + + an + + that will be associated with this annotation. + + + this + + instance. + + + + An associated pop-up annotation object. + + An associated pop-up annotation object. See + + for more info. + + + a + + that represents an associated pop-up annotation, + or null if popup annotation is not specified. + + + + An associated pop-up annotation for entering or editing the text associated with this annotation. + + + An associated pop-up annotation for entering or editing the text associated with this annotation. + Pop-up annotation defines an associated with this annotation pop-up window that may contain text. + The Contents (see + + ) entry of the annotation that has + an associated popup specifies the text that shall be displayed when the pop-up window is opened. + + + an + + that is associated with this annotation, or null if there is none. + + + + Text representing a short description of the subject being addressed by the annotation. + + a + + which value is a annotation subject. + + + + Sets the text representing a short description of the subject being addressed by the annotation. + + a + + which value is a annotation subject. + + + this + + instance. + + + + + A name specifying the relationship (the “reply type”) between this annotation and one specified by IRT entry + (see + + ). Valid values are: +
      +
    • + + - The annotation shall be considered a reply to the annotation specified by IRT. + Conforming readers shall not display replies to an annotation individually but together in the form of + threaded comments.
    • +
    • + + - The annotation shall be grouped with the annotation specified by IRT.
    • +
    +
    + + a + + specifying relationship with the specified by the IRT entry; or null if reply + type is not specified, in this case the default value is + + . + +
    + + + Sets the relationship (the “reply type”) between this annotation and one specified by IRT entry + (see + + ). For valid values see + + . + + + a + + specifying relationship with the specified by the IRT entry. + + + this + + instance. + + + + A name describing the intent of the markup annotation. + + A name describing the intent of the markup annotation. + See + + for more info. + + + a + + describing the intent of the markup annotation, or null if not specified. + + + + Sets a name describing the intent of the markup annotation. + + Sets a name describing the intent of the markup annotation. + Intents allow conforming readers to distinguish between different uses and behaviors + of a single markup annotation type. If this entry is not present or its value is the same as the annotation type, + the annotation shall have no explicit intent and should behave in a generic manner in a conforming reader. +

    + See ISO-320001, free text annotations (Table 174), line annotations (Table 175), polygon annotations (Table 178), + and polyline annotations (Table 178) for the specific intent values for those types. +

    +
    + + a + + describing the intent of the markup annotation. + + + this + + instance. + +
    + + An external data dictionary specifying data that shall be associated with the annotation. + + An external data dictionary specifying data that shall be associated with the annotation. + This dictionary contains the following entries: +
      +
    • + + - (optional) If present, shall be + + .
    • +
    • + + - (required) a name specifying the type of data that the markup annotation + shall be associated with. The only defined value is + + . Table 298 (ISO-320001) + lists the values that correspond to a subtype of Markup3D (See also + + ).
    • +
    +
    + + An external data + + , or null if not specified. + +
    + + Sets an external data dictionary specifying data that shall be associated with the annotation. + + Sets an external data dictionary specifying data that shall be associated with the annotation. + This dictionary should contain the following entries: +
      +
    • + + - (optional) If present, shall be + + .
    • +
    • + + - (required) a name specifying the type of data that the markup annotation + shall be associated with. The only defined value is + + . Table 298 (ISO-320001) + lists the values that correspond to a subtype of Markup3D (See also + + ).
    • +
    +
    + + this + + instance. + +
    + + + A set of four numbers describing the numerical differences between two rectangles: + the Rect entry of the annotation and another rectangle within that one, which + meaning depends on the type of the annotation: +
      +
    • for + + the inner rectangle is where the annotation's text should be displayed;
    • +
    • + for + + and + + the inner rectangle is the actual boundaries + of the underlying square or circle; +
    • +
    • for + + the inner rectangle is the actual boundaries of the underlying caret.
    • +
    +
    + + a + + with four numbers which correspond to the differences in default user space between + the left, top, right, and bottom coordinates of Rect and those of the inner rectangle, respectively. + Each value shall be greater than or equal to 0. The sum of the top and bottom differences shall be + less than the height of Rect, and the sum of the left and right differences shall be less than + the width of Rect. + + + this + + instance. + +
    + + + A set of four numbers describing the numerical differences between two rectangles: + the Rect entry of the annotation and another rectangle within that one, which + meaning depends on the type of the annotation (see + + ). + + + null if not specified, otherwise a + + with four numbers which correspond to the + differences in default user space between the left, top, right, and bottom coordinates of Rect and those + of the inner rectangle, respectively. + + + + + Some annotations types ( + + , + + , + + and + + ) may have a + + entry, which is a border effect dictionary that specifies + an effect that shall be applied to the border of the annotations. + + + a + + which contents shall be specified in accordance to ISO-320001, Table 167. + + + this + + instance. + + + + A border effect dictionary that specifies an effect that shall be applied to the border of the annotations. + + + a + + , which is a border effect dictionary (see ISO-320001, Table 167). + + + + The interior color which is used to fill areas specific for different types of annotation. + + The interior color which is used to fill areas specific for different types of annotation. For + + and polyline annotation ( + + - the annotation's line endings, for + + and + + - the annotation's rectangle or ellipse, for + + - the redacted + region after the affected content has been removed. + + + + + of either + + , + + or + + type which defines + interior color of the annotation, or null if interior color is not specified. + + + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. For + + and polyline annotation ( + + - + the annotation's line endings, for + + and + + - the annotation's + rectangle or ellipse, for + + - the redacted region after the affected content has been removed. + + + a + + of numbers in the range 0.0 to 1.0. The number of array elements determines + the colour space in which the colour is defined: 0 - No colour, transparent; 1 - DeviceGray, + 3 - DeviceRGB, 4 - DeviceCMYK. For the + + number of elements shall be + equal to 3 (which defines DeviceRGB colour space). + + + this + + instance. + + + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. + + + An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill areas specific + for different types of annotation. See + + for more info. + + an array of floats in the range 0.0 to 1.0. + + this + + instance. + + + + The name of an icon that is used in displaying the annotation. + + The name of an icon that is used in displaying the annotation. Possible values are different for different + annotation types. See + + . + + + a + + that specifies the icon for displaying annotation, or null if icon name is not specified. + + + + The name of an icon that is used in displaying the annotation. + + a + + that specifies the icon for displaying annotation. Possible values are different + for different annotation types: +
      +
    • + + - Comment, Key, Note, Help, NewParagraph, Paragraph, Insert;
    • +
    • + + - Approved, Experimental, NotApproved, AsIs, Expired, NotForPublicRelease, + Confidential, Final, Sold, Departmental, ForComment, TopSecret, Draft, ForPublicRelease.
    • +
    • + + - GraphPushPin, PaperclipTag. Additional names may be supported as well.
    • +
    • + + - Speaker and Mic. Additional names may be supported as well.
    • +
    + + + this + + instance. + +
    + + The default appearance string that shall be used in formatting the text. + The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, “Variable Text”. + + + a + + that specifies the default appearance. + + + this + + instance. + + + + The default appearance string that shall be used in formatting the text. + The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, “Variable Text”. + + + a + + that specifies the default appearance, or null if default appereance is not specified. + + + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified). + + a code specifying the form of quadding (justification), returns the default value if not explicitly specified. + + + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. + + + A code specifying the form of quadding (justification) that is used in displaying the annotation's text: + 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified). + + a code specifying the form of quadding (justification). + + this + + instance. + + + + Text justification options. + + + The purpose of a line annotation is to display a single straight line on the page. + + The purpose of a line annotation is to display a single straight line on the page. + When opened, it displays a pop-up window containing the text of the associated note. + See also ISO-320001 12.5.6.7 "Line Annotations". + + + + + Creates a + + instance. + + + the annotation rectangle, defining the location of the annotation on the page + in default user space units. See + + . + + + an array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates + of the line in default user space. See also + + . + + + + + Creates a + + instance from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. + + + a + + that represents existing annotation in the document. + + + + + + + + An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line + in default user space. + + + An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line + in default user space. If the + + (see + + ) entry is present, this value represents + the endpoints of the leader lines rather than the endpoints of the line itself. + + An array of four numbers specifying the starting and ending coordinates of the line in default user space. + + + + An array of two names specifying the line ending styles that is used in drawing the line. + + An array of two names specifying the line ending styles that is used in drawing the line. + The first and second elements of the array shall specify the line ending styles for the endpoints defined, + respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the + + array + (see + + . For possible values see + + . + + + An array of two names specifying the line ending styles that is used in drawing the line; or null if line + endings style is not explicitly defined, default value is [/None /None]. + + + + Sets the line ending styles that are used in drawing the line. + + Sets the line ending styles that are used in drawing the line. + The first and second elements of the array shall specify the line ending styles for the endpoints defined, + respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the + + array + (see + + . Possible values for styles are: +
      +
    • + + - A square filled with the annotation's interior color, if any;
    • +
    • + + - A circle filled with the annotation's interior color, if any;
    • +
    • + + - A diamond shape filled with the annotation's interior color, if any;
    • +
    • + + - Two short lines meeting in an acute angle to form an open arrowhead;
    • +
    • + + - Two short lines meeting in an acute angle as in the + + style and + connected by a third line to form a triangular closed arrowhead filled with the annotation's interior color, if any;
    • +
    • + + - No line ending;
    • +
    • + + - A short line at the endpoint perpendicular to the line itself;
    • +
    • + + - Two short lines in the reverse direction from + + ;
    • +
    • + + - A triangular closed arrowhead in the reverse direction from + + ;
    • +
    • + + - A short line at the endpoint approximately 30 degrees clockwise from perpendicular to the line itself;
    • +
    + see also ISO-320001, Table 176 "Line ending styles". +
    + An array of two names specifying the line ending styles that is used in drawing the line. + + + this + + instance. + +
    + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + this + + instance. + + + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + The length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. + + + Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular + to the line itself. A positive value means that the leader lines appear in the direction that is clockwise + when traversing the line from its starting point to its ending point (as specified by + + (see + + ); + a negative value indicates the opposite direction. + + a float specifying the length of leader lines in default user space. + + this + + instance. + + + + + A non-negative number that represents the length of leader line extensions that extend from the line proper + 180 degrees from the leader lines. + + + a non-negative float that represents the length of leader line extensions; or if the leader line extension + is not explicitly set, returns the default value, which is 0. + + + + Sets the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. + + + Sets the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. + This value shall not be set unless + + (see + + ) is set. + + a non-negative float that represents the length of leader line extensions. + + + this + + instance. + + + + + A non-negative number that represents the length of the leader line offset, which is the amount of empty space + between the endpoints of the annotation and the beginning of the leader lines. + + + a non-negative number that represents the length of the leader line offset, + or null if leader line offset is not set. + + + + + Sets the length of the leader line offset, which is the amount of empty space between the endpoints of the + annotation and the beginning of the leader lines. + + a non-negative number that represents the length of the leader line offset. + + + this + + instance. + + + + + If true, the text specified by the + + or + + entries + (see + + and + + ) + is replicated as a caption in the appearance of the line. + + + true, if the annotation text is replicated as a caption, false otherwise. If this property is + not set, default value is used which is false. + + + + + If set to true, the text specified by the + + or + + entries + (see + + and + + ) + will be replicated as a caption in the appearance of the line. + + true, if the annotation text should be replicated as a caption, false otherwise. + + + this + + instance. + + + + A name describing the annotation's caption positioning. + + A name describing the annotation's caption positioning. Valid values are + + , meaning the caption + is centered inside the line, and + + , meaning the caption is on top of the line. + + + a name describing the annotation's caption positioning, or null if the caption positioning is not + explicitly defined (in this case the default value is used, which is + + ). + + + + Sets annotation's caption positioning. + + Sets annotation's caption positioning. Valid values are + + , meaning the caption + is centered inside the line, and + + , meaning the caption is on top of the line. + + a name describing the annotation's caption positioning. + + this + + instance. + + + + A measure dictionary (see ISO-320001, Table 261) that specifies the scale and units that apply to the line annotation. + + + a + + that represents a measure dictionary. + + + + Sets a measure dictionary that specifies the scale and units that apply to the line annotation. + + a + + that represents a measure dictionary, see ISO-320001, Table 261 for valid + contents specification. + + + this + + instance. + + + + An array of two numbers that specifies the offset of the caption text from its normal position. + + An array of two numbers that specifies the offset of the caption text from its normal position. + The first value is the horizontal offset along the annotation line from its midpoint, with a positive value + indicating offset to the right and a negative value indicating offset to the left. The second value is the vertical + offset perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating + a shift down. + + + a + + of two numbers that specifies the offset of the caption text from its normal position, + or null if caption offset is not explicitly specified (in this case a default value is used, which is [0, 0]). + + + + Sets the offset of the caption text from its normal position. + + a + + of two numbers that specifies the offset of the caption text from its + normal position. The first value defines the horizontal offset along the annotation line from + its midpoint, with a positive value indicating offset to the right and a negative value indicating + offset to the left. The second value defines the vertical offset perpendicular to the annotation line, + with a positive value indicating a shift up and a negative value indicating a shift down. + + + this + + instance. + + + + Sets the offset of the caption text from its normal position. + + an array of two floats that specifies the offset of the caption text from its + normal position. The first value defines the horizontal offset along the annotation line from + its midpoint, with a positive value indicating offset to the right and a negative value indicating + offset to the left. The second value defines the vertical offset perpendicular to the annotation line, + with a positive value indicating a shift up and a negative value indicating a shift down. + + + this + + instance. + + + + Highlight modes. + + + Subtypes + + + + + + Subtypes + + + + + + + + A + + may be used to define the trapping characteristics for a page + of a PDF document. Trapping is the process of adding marks to a page along colour boundaries + to avoid unwanted visual artifacts resulting from misregistration of colorants when the page is printed. + See ISO-320001 14.11.6 "Trapping Support" and 14.11.6.2 "Trap Network Annotations" in particular. + + + + + Creates a + + instance. Note that there shall be at most one trap network annotation + per page, which shall be the last element in the page’s Annots array. + + + the annotation rectangle, defining the location of the annotation on the page + in default user space units. See + + . + + + the form XObject defining a trap network which body contains the graphics objects needed + to paint the traps making up the trap network. Process colour model shall be defined for the + appearance stream (see + + . + See also ISO-320001 Table 367 "Additional entries specific to a trap network appearance stream". + + + + + Creates a + + instance from the given + + that represents annotation object. This method is useful for property reading in reading mode or + modifying in stamping mode. + + + a + + that represents existing annotation in the document. + + + + + + + + The date and time when the trap network was most recently modified. + + a + + with date. The format should be a date string as described + in ISO-320001 7.9.4, “Dates”. See also + + . + + + + + + An unordered array of all objects present in the page description at the time the trap networks were generated + and that, if changed, could affect the appearance of the page. + + + an unordered + + of all objects present in the page description at the time the trap networks + were generated. + + + + + An array of name objects representing the appearance states for annotations associated with the page. + + + An array of name objects representing the appearance states for annotations associated with the page. + See also + + . + + + a + + of name objects representing the appearance states for annotations associated with the page, + + + + + An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the + generation of trap networks for the page. + + + a + + of + + each of which represent font in the document. + + + this + + instance. + + + + + A list of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the + generation of trap networks for the page. + + + a + + of + + objects. + + + this + + instance. + + + + + An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the + generation of trap networks for the page. + + + a + + of + + each of which represent font in the document. + + + + Setter for the annotation's highlighting mode. + + Setter for the annotation's highlighting mode. Possible values are +
      +
    • + + - No highlighting.
    • +
    • + + - Invert the contents of the annotation rectangle.
    • +
    • + + - Invert the annotation's border.
    • +
    • + + - Display the annotation?s down appearance, if any.
    • +
    • + + - Same as P.
    • +
    +
    + The new value for the annotation's highlighting mode. + The widget annotation which this method was called on. +
    + + Getter for the annotation's highlighting mode. + Current value of the annotation's highlighting mode. + + + This method removes all widget annotation entries from the form field the given annotation merged with. + + + + + Set the visibility flags of the Widget annotation + Options are: HIDDEN, HIDDEN_BUT_PRINTABLE, VISIBLE, VISIBLE_BUT_DOES_NOT_PRINT + + visibility option + the edited widget annotation + + + Acts like a StringBuffer but works with byte arrays. + + + Acts like a StringBuffer but works with byte arrays. + Floating point is converted to a format suitable to the PDF. + + Paulo Soares + + + The count of bytes in the buffer. + + + The buffer where the bytes are stored. + + + If true always output floating point numbers with 6 decimal digits. + + + If true always output floating point numbers with 6 decimal digits. + If false uses the faster, although less precise, representation. + + + + Creates new ByteBufferOutputStream with capacity 128 + + + Creates a byte buffer with a certain capacity. + the initial capacity + + + + You can fill the cache in advance if you want to. + + + + Converts an double (multiplied by 100 and cast to an int) into an array of bytes. + + the int + a byte array + + + Appends an int. + Appends an int. The size of the array will grow by one. + the int to be appended + a reference to this ByteBufferOutputStream object + + + Appends the subarray of the byte array. + + Appends the subarray of the byte array. The buffer will grow by + len bytes. + + the array to be appended + the offset to the start of the array + the length of bytes to append + a reference to this ByteBufferOutputStream object + + + Appends an array of bytes. + the array to be appended + a reference to this ByteBufferOutputStream object + + + Appends a String to the buffer. + + Appends a String to the buffer. The String is + converted according to the encoding ISO-8859-1. + + the String to be appended + a reference to this ByteBufferOutputStream object + + + Appends a char to the buffer. + + Appends a char to the buffer. The char is + converted according to the encoding ISO-8859-1. + + the char to be appended + a reference to this ByteBufferOutputStream object + + + Appends another ByteBufferOutputStream to this buffer. + the ByteBufferOutputStream to be appended + a reference to this ByteBufferOutputStream object + + + Appends the string representation of an int. + the int to be appended + a reference to this ByteBufferOutputStream object + + + Appends the string representation of a long. + the long to be appended + a reference to this ByteBufferOutputStream object + + + + Appends a string representation of a float according + to the Pdf conventions. + + the float to be appended + a reference to this ByteBufferOutputStream object + + + + Appends a string representation of a double according + to the Pdf conventions. + + the double to be appended + a reference to this ByteBufferOutputStream object + + + Outputs a double into a format suitable for the PDF. + a double + the String representation of the double + + + Outputs a double into a format suitable for the PDF. + a double + a ByteBufferOutputStream + + the String representation of the double if + buf is null. If buf is not null, + then the double is appended directly to the buffer and this methods returns null. + + + + Sets the size to zero. + + + Creates a newly allocated byte array. + + Creates a newly allocated byte array. Its size is the current + size of this output stream and the valid contents of the buffer + have been copied into it. + + the current contents of this output stream, as a byte array. + + + Returns the current size of the buffer. + the value of the count field, which is the number of valid bytes in this byte buffer. + + + + + Converts the buffer's contents into a string, translating bytes into + characters according to the platform's default character encoding. + + String translated from the buffer's contents. + + + + Converts the buffer's contents into a string, translating bytes into + characters according to the specified character encoding. + + a character-encoding name. + String translated from the buffer's contents. + If the named encoding is not supported. + + + + + Writes the complete contents of this byte buffer output to + the specified output stream argument, as if by calling the output + stream's write method using out.write(buf, 0, count). + + the output stream to which to write the data. + + java.io.IOException + if an I/O error occurs. + + + + + + + + + A subclass of + + for Artifacts. + In Tagged PDF, an object can be marked as an Artifact in order to signify + that it is more part of the document structure than of the document content. + Examples are page headers, layout features, etc. Screen readers can choose to + ignore Artifacts. + + + + This class represents a single tag on a single piece of marked content. + + This class represents a single tag on a single piece of marked content. +

    + In Tagged PDF, a tag is the basic structure unit for marking content. The tag + structure and hierarchy is largely comparable to HTML. As in HTML, every tag + type has a name, defined here in the role attribute. The tagging + mechanism in Tagged PDF is extensible, so PDF creators can choose to create + custom tags.

    +
    +
    + + The type of the tag. + + + The properties of the tag. + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + the type of tag + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + the type of tag + marked content id which serves as a reference to the document's logical structure + + + Creates a tag that is referenced to the document's tag structure (i.e. + + Creates a tag that is referenced to the document's tag structure (i.e. + logical structure). + + + the + Marked Content Reference + wrapper object + + + + Get the role of the tag. + the role of the tag as a PdfName + + + Get the marked content id of the tag. + marked content id + if there is no MCID + + + Determine if an MCID is available + true if the MCID is available, false otherwise + + + + Adds a dictionary of properties to the + tag + 's properties. + + a dictionary + + current + + + + + + Adds a single property to the + tag + 's properties. + + a key + the value for the key + + current + + + + + + Removes a single property from the + tag + 's properties. + + the key of the key-value pair to be removed + + current + + + + + + Gets a property from the + tag + 's properties dictionary. + + the key of the key-value pair to be retrieved + the value corresponding to the key + + + Get the properties of the tag. + properties of the tag + + + + Creates a CanvasArtifact object, which is a + + with a role + of + Artifact + . + + + + This class is designed for internal usage. + + This class is designed for internal usage.
    + Use PdfExtGState class and PdfCanvas#setExtGState() method for setting extended graphics properties. +
    +
    + + The current transformation matrix, which maps positions from user coordinates to device coordinates. + + + The current transformation matrix, which maps positions from user coordinates to device coordinates. + We use an identity matrix as a default value, but in spec a default value is: + "a matrix that transforms default user coordinates to device coordinates". + + + + A description of the dash pattern to be used when paths are stroked. + + A description of the dash pattern to be used when paths are stroked. Default value is solid line. + The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], + where dashArray is itself an array and dashPhase is an integer. + An empty dash array (first element in the array) and zero phase (second element in the array) + can be used to restore the dash pattern to a solid line. + + + + + Copy constructor. + the Graphics State to copy from + + + Updates this object with the values from a dictionary. + the dictionary containing source parameters + + + current transformation matrix. + + + Updates current transformation matrix. + + + Updates current transformation matrix. + new current transformation matrix. + + + Updates current graphic state with values from extended graphic state dictionary. + the wrapper around the extended graphic state dictionary + + + + Implementation of + + which draws a dashed horizontal line over + the middle of the specified rectangle. + + + + + The + + defines a drawing operation on a + +

    + This interface allows to customize the 'empty' space in a + TabStop + through a Strategy design + pattern +

    +
    + + + Performs configurable drawing operations related to specific region + coordinates on a canvas. + + the canvas to draw on + + the rectangle in relation to which to fulfill drawing + instructions + + + + Gets the width of the line + width of the line + + + Sets line width in points + new line width + + + Gets the color of the line + color of the line + + + Sets line color + new line color + + + + Creates an instance of + + with the specified line width. + + + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + Implementation of + + which draws a dotted horizontal line along + the bottom edge of the specified rectangle. + + + + the gap between the dots. + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + the width of the line + the gap between the center of the dots of the dotted line. + + + Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle. + + the width of the line + + + Getter for the gap between the center of the dots of the dotted line. + the gap between the center of the dots + + + Setter for the gap between the center of the dots of the dotted line. + the gap between the center of the dots + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + Implementation of + + which draws a solid horizontal line along + the bottom edge of the specified rectangle. + + + + Constructs an instance of solid line drawer + + + Constructs an instance of solid line drawer with the specified line thickness + line width + + + Gets line width in points + line thickness + + + Sets line width in points + new line width + + + + This class contains variety of methods allowing to convert iText + abstractions into the abstractions of the Clipper library and vise versa. + + + This class contains variety of methods allowing to convert iText + abstractions into the abstractions of the Clipper library and vise versa. +

    + For example: +

      +
    • + + to + +
    • +
    • + + to + +
    • +
    • + + to + +
    • +
    +

    +
    +
    + + + Since the clipper library uses integer coordinates, we should convert + our floating point numbers into fixed point numbers by multiplying by + this coefficient. + + + Since the clipper library uses integer coordinates, we should convert + our floating point numbers into fixed point numbers by multiplying by + this coefficient. Vary it to adjust the preciseness of the calculations. + + + + + Converts Clipper library + + abstraction into iText + + object. + + + + + + + Converts list of + + objects into list of + + objects. + + + + + Converts list of + + objects into list of + + objects. + + + + + Converts iText line join style constant into the corresponding constant + of the Clipper library. + + + iText line join style constant. See + + + Clipper line join style constant. + + + + Converts iText line cap style constant into the corresponding constant + of the Clipper library. + + + iText line cap style constant. See + + + Clipper line cap (end type) style constant. + + + + Converts iText filling rule constant into the corresponding constant + of the Clipper library . + + + Either + + or + + . + + Clipper fill type constant. + + + + Marker interface for the set of classes used to combine + parameters required for different types of events. + + + + The path to be rendered. + The path to be rendered. + + + + The + + which represents current clipping path. + + + + Current transformation matrix. + + + Represents image data from a PDF + + + The coordinate transformation matrix that was in effect when the image was rendered + + + the color space dictionary from resources which are associated with the image + + + defines if the encountered image was inline + + + Create an ImageRenderInfo + the coordinate transformation matrix at the time the image is rendered + image stream object + the color space dictionary from resources which are associated with the image + + defines if the encountered image was inline + + + Gets an image wrapped in ImageXObject. + + Gets an image wrapped in ImageXObject. + You can: +
      +
    • get image bytes with + + , these image bytes + represent native image, i.e you can write these bytes to disk and get just an usual image;
    • +
    • obtain PdfStream object which contains image dictionary with + + method;
    • +
    • convert image to + + with + + ;
    • +
    +
    +
    + + a vector in User space representing the start point of the image + + + The coordinate transformation matrix which was active when this image was rendered. Coordinates are in User space. + + + + the size of the image, in User space units + + + true if image was inlined in original stream. + + + the color space dictionary from resources which are associated with the image + + + Contains information relating to painting current path. + + + End the path object without filling or stroking it. + + End the path object without filling or stroking it. This operator shall be a path-painting no-op, + used primarily for the side effect of changing the current clipping path + + + + Value specifying stroke operation to perform on the current path. + + + Value specifying fill operation to perform on the current path. + + Value specifying fill operation to perform on the current path. When the fill operation + is performed it should use either nonzero winding or even-odd rule. + + + + The path to be rendered. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + . + + True indicates that current path modifies the clipping path, false - if not. + + Either + + or + + . + + The graphics state. + + + + If the operation is + + then the rule is ignored, + otherwise + + is used by default. + With this constructor path is considered as not modifying clipping path. + See + + + + + + The + + to be rendered. + + + + + int value which is either + + or one of possible + combinations of + + and + + + + + + Either + + or + + . + + + + true indicates that current path modifies the clipping path, false - if not. + + + + Either + + or + + . + + + + Current transformation matrix. + + + + Provides information and calculations needed by render listeners + to display/evaluate text render operations. + + + Provides information and calculations needed by render listeners + to display/evaluate text render operations. +

    + This is passed between the + + and + + objects as text rendering operations are + discovered +
    +
    + + Hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer. + + + + Creates a new TextRenderInfo object + the PDF string that should be displayed + the graphics state (note: at this time, this is not immutable, so don't cache it) + the text matrix at the time of the render operation + the marked content tags sequence, if available + + + Used for creating sub-TextRenderInfos for each individual character + the parent TextRenderInfo + the content of a TextRenderInfo + the unscaled horizontal offset of the character that this TextRenderInfo represents + + + + the text to render + + + original PDF string + + + + Checks if the text belongs to a marked content sequence + with a given mcid. + + a marked content id + true if the text is marked with this id + + + + Checks if the text belongs to a marked content sequence + with a given mcid. + + a marked content id + indicates whether to check the topmost level of marked content stack only + + true if the text is marked with this id + + + the marked content associated with the TextRenderInfo instance. + + + Gets the baseline for the text (i.e. + + Gets the baseline for the text (i.e. the line that the text 'sits' on) + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the baseline line segment + + + Gets the ascentline for the text (i.e. + + Gets the ascentline for the text (i.e. the line that represents the topmost extent that a string of the current font could have) + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the ascentline line segment + + + Gets the descentline for the text (i.e. + + Gets the descentline for the text (i.e. the line that represents the bottom most extent that a string of the current font could have). + This value includes the Rise of the draw operation - see + + for the amount added by Rise + + the descentline line segment + + + Getter for the font + the font + + + The rise represents how far above the nominal baseline the text should be rendered. + + The rise represents how far above the nominal baseline the text should be rendered. The + + , + + and + + methods already include Rise. + This method is exposed to allow listeners to determine if an explicit rise was involved in the computation of the baseline (this might be useful, for example, for identifying superscript rendering) + + The Rise for the text draw operation, in user space units (Ts value, scaled to user space) + + + Provides detail useful if a listener needs access to the position of each individual glyph in the text render operation + + + A list of + + objects that represent each glyph used in the draw operation. The next effect is if there was a separate Tj opertion for each character in the rendered string + + + + The width, in user space units, of a single space character in the current font + + + + the text render mode that should be used for the text. From the + PDF specification, this means: +
      +
    • 0 = Fill text
    • +
    • 1 = Stroke text
    • +
    • 2 = Fill, then stroke text
    • +
    • 3 = Invisible
    • +
    • 4 = Fill text and add to path for clipping
    • +
    • 5 = Stroke text and add to path for clipping
    • +
    • 6 = Fill, then stroke text and add to path for clipping
    • +
    • 7 = Add text to padd for clipping
    • +
    +
    +
    + + the current fill color. + + + the current stroke color. + + + Gets /ActualText tag entry value if this text chunk is marked content. + /ActualText value or null if none found + + + + Determines if the text represented by this + + instance is written in a text showing operator + wrapped by /ReversedChars marked content sequence + + true if this text block lies within /ReversedChars block, false otherwise + + + + Gets hierarchy of the canvas tags that wraps given text. + list of the wrapping canvas tags. The first tag is the innermost (nearest to the text). + + + the unscaled (i.e. in Text space) width of the text + + + the width, in text space + the width in user space + + + the height, in text space + the height in user space + + + Calculates the width of a space character. + + Calculates the width of a space character. If the font does not define + a width for a standard space character \u0020, we also attempt to use + the width of \u00A0 (a non-breaking space in many fonts) + + the width of a single space character in text space units + + + Gets the width of a String in text space units + the string that needs measuring + the width of a String in text space units + + + Gets the width of a PDF string in text space units + the string that needs measuring + the width of a String in text space units + + + Calculates width and word spacing of a single character PDF string. + + Calculates width and word spacing of a single character PDF string. + IMPORTANT: Shall ONLY be used for a single character pdf strings. + + a character to calculate width. + array of 2 items: first item is a character width, second item is a calculated word spacing. + + + Converts a single character string to char code. + single character string to convert to. + char code. + + + Split PDF string into array of single character PDF strings. + PDF string to be splitted. + splitted PDF string. + + + Specifies different types of events where a callback should be notified. + + + This is an interface which helps to filter events. + + + + This method checks an event and decides whether it should be processed further (corresponds to + + return value), or filtered out (corresponds to + + return value). + + event data + event type + true to process event further, false to filter event out + + + + This + + implementation only accepts text render events within the specified + rectangular region. + + + + Constructs a filter instance. + the rectangle to filter text against + + + Root interface for a series of handlers for content stream operators. + + + Called when a content operator should be processed. + The processor that is dealing with the PDF content stream. + The literal PDF syntax of the operator. + The operands that come with the operator. + + + Kevin Day + + + An event listener which filters events on the fly before passing them on to the delegate. + + + + A callback interface that receives notifications from the + + as various events occur (see + + ). + + + + Called when some event occurs during parsing a content stream. + Combines the data required for processing corresponding event type. + Event type. + + + Provides the set of event types this listener supports. + + Provides the set of event types this listener supports. + Returns null if all possible event types are supported. + + + Set of event types supported by this listener or + null if all possible event types are supported. + + + + + Constructs a + + empty instance. + Use + + to add an event listener along with its filters. + + + + + Constructs a + + instance with one delegate. + Use + + to add more + + delegates + along with their filters. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + + + + Attaches another + + delegate with its filters. + When all the filters attached to the delegate for an event accept the event, the event will be passed on to + the delegate. + You can attach multiple delegates to this + + instance. The content stream will + be parsed just once, so it is better for performance than creating multiple + + instances and parsing the content stream multiple times. This is useful, for instance, when you want + to extract content from multiple regions of a page. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + delegate that has been passed to the method, used for convenient call chaining + + + A text event listener which filters events on the fly before passing them on to the delegate. + + A text event listener which filters events on the fly before passing them on to the delegate. + The only difference from + + is that this class conveniently implements + + and can therefore used as a strategy on its own, apart from the inherited + function of filtering event appropriately to its delegates. + + + + + This is a special interface for + + that returns text as result of its work. + + + + Returns the text that has been processed so far. + + + + instance with the current resultant text + + + + + Constructs a + + instance with a + + delegate. + + a delegate that fill be called when all the corresponding filters for an event pass + + filters attached to the delegate that will be tested before passing an event on to the delegate + + + + + As an resultant text we use the concatenation of all the resultant text of all the delegates that implement + + . + + the resulting concatenation of the text extracted from the delegates + + + + This class expands each + + for + + event types into + multiple + + instances for each glyph occurred. + + + + + Constructs a + + instance by a delegate to which the expanded text events for each + glyph occurred will be passed on. + + delegate to pass the expanded glyph render events to. + + + + This class expands each + + for + + event types into + multiple + + instances for each glyph occurred. + The only difference from + + is that this class conveniently implements + + and can therefore used as a strategy on its own. + + + + + Constructs a + + instance by a + + delegate to which + the expanded text events for each glyph occurred will be passed on. + + delegate to pass the expanded glyph render events to. + + + + As an resultant text we use the the resultant text of the delegate that implement + + and was passed to this class. + + the resulting text extracted from the delegate + + + set to true for debugging + + + a summary of all found text + + + Creates a new text extraction renderer. + + + + Creates a new text extraction renderer, with a custom strategy for + creating new TextChunkLocation objects based on the input of the + TextRenderInfo. + + the custom strategy + + + + Changes the behavior of text extraction so that if the parameter is set to + + , + /ActualText marked content property will be used instead of raw decoded bytes. + Beware: the logic is not stable yet. + + true to use /ActualText, false otherwise + this object + + + Sets if text flows from left to right or from right to left. + + Sets if text flows from left to right or from right to left. + Call this method with true argument for extracting Arabic, Hebrew or other + text with right-to-left writing direction. + + value specifying whether the direction should be right to left + this object + + + + Gets the value of the property which determines if /ActualText will be used when extracting + the text + + true if /ActualText value is used, false otherwise + + + Determines if a space character should be inserted between a previous chunk and the current chunk. + + + Determines if a space character should be inserted between a previous chunk and the current chunk. + This method is exposed as a callback so subclasses can fine time the algorithm for determining whether a space should be inserted or not. + By default, this method will insert a space if the there is a gap of more than half the font space character width between the end of the + previous chunk and the beginning of the current chunk. It will also indicate that a space is needed if the starting point of the new chunk + appears *before* the end of the previous chunk (i.e. overlapping text). + + the new chunk being evaluated + the chunk that appeared immediately before the current chunk + true if the two chunks represent different words (i.e. should have a space between them). False otherwise. + + + + Checks if the string starts with a space character, false if the string is empty or starts with a non-space character. + + the string to be checked + true if the string starts with a space character, false if the string is empty or starts with a non-space character + + + + Checks if the string ends with a space character, false if the string is empty or ends with a non-space character + + the string to be checked + true if the string ends with a space character, false if the string is empty or ends with a non-space character + + + + Used for debugging only + + + Represents a chunk of text, it's orientation, and location relative to the orientation vector + + + the text of the chunk + + + the text captured by this chunk + + + Compares based on orientation, perpendicular distance, then parallel distance + + + + the starting location of the chunk + + + the ending location of the chunk + + + unit vector in the orientation of the chunk + + + the orientation as a scalar for quick sorting + + + perpendicular distance to the orientation unit vector (i.e. + + perpendicular distance to the orientation unit vector (i.e. the Y position in an unrotated coordinate system) + we round to the nearest integer to handle the fuzziness of comparing floats + + + + distance of the start of the chunk parallel to the orientation unit vector (i.e. + distance of the start of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system) + + + + distance of the end of the chunk parallel to the orientation unit vector (i.e. + distance of the end of the chunk parallel to the orientation unit vector (i.e. the X position in an unrotated coordinate system) + + + + the width of a single space character in the font of the chunk + + + the start location of the text + + + the end location of the text + + + the width of a single space character as rendered by this chunk + + + the location to compare to + true is this location is on the the same line as the other + + + + Computes the distance between the end of 'other' and the beginning of this chunk + in the direction of this chunk's orientation vector. + + + Computes the distance between the end of 'other' and the beginning of this chunk + in the direction of this chunk's orientation vector. Note that it's a bad idea + to call this for chunks that aren't on the same line and orientation, but we don't + explicitly check for that condition for performance reasons. + + + the number of spaces between the end of 'other' and the beginning of this chunk + + + used to store the resulting String. + + + Returns the result so far. + a String with the resulting text. + + + Used to actually append text to the text results. + + Used to actually append text to the text results. Subclasses can use this to insert + text that wouldn't normally be included in text parsing (e.g. result of OCR performed against + image content) + + the text to append to the text results accumulated so far + + + This class allows you to find the rectangle which contains all the text in the given content stream. + + + + + Returns the common text rectangle, containing all the text found in the stream so far, ot + + , if no + text has been found yet. + + common text rectangle + + + + Internal class which is essentially a + + which supports tracking of + clipping path state and changes. + + + + + Copy constructor. + the Graphics State to copy from + + + Sets the current clipping path to the specified path. + + Sets the current clipping path to the specified path. +
    + Note:This method doesn't modify existing clipping path, + it simply replaces it with the new one instead. +
    + New clipping path. +
    + + Intersects the current clipping path with the given path. + + Intersects the current clipping path with the given path. +
    + Note: Coordinates of the given path should be in + the transformed user space. +
    + The path to be intersected with the current clipping path. + + The filling rule which should be applied to the given path. + It should be either + + or + + +
    + + Getter for the current clipping path. + + Getter for the current clipping path. +
    + Note: The returned clipping path is in the transformed user space, so + if you want to get it in default user space, apply transformation matrix ( + + ). +
    + The current clipping path. +
    + + Processor for a PDF content stream. + + + Listener that will be notified of render events + + + + Cache supported events in case the user's + + method is not very efficient + + + + + Indicates whether the current clipping path should be modified by + intersecting it with the current path. + + + + + Specifies the filling rule which should be applied while calculating + new clipping path. + + + + A map with all supported operators (PDF syntax). + + + Resources for the content stream. + + Resources for the content stream. + Current resources are always at the top of the stack. + Stack is needed in case if some "inner" content stream with it's own resources + is encountered (like Form XObject). + + + + Stack keeping track of the graphics state. + + + A map with all supported XObject handlers + + + The font cache + + + A stack containing marked content info. + + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + + + the + + that will receive rendering notifications + + + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + + + Creates a new PDF Content Stream Processor that will send its output to the + designated render listener. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + + the + + that will receive rendering notifications + + + an optional map of custom + + s for rendering instructions + + + + Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. + + + Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. +
    + If you register a handler, it is a very good idea to pass the call on to the existing registered handler (returned by this call), otherwise you + may inadvertently change the internal behavior of the processor. +
    + the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler + + the handler that will receive notification when the Do operator for the specified subtype is encountered + + the existing registered handler, if any +
    + + Registers a content operator that will be called when the specified operator string is encountered during content processing. + + + Registers a content operator that will be called when the specified operator string is encountered during content processing. +
    + If you register an operator, it is a very good idea to pass the call on to the existing registered operator (returned by this call), otherwise you + may inadvertently change the internal behavior of the processor. +
    + the operator id, or DEFAULT_OPERATOR for a catch-all operator + the operator that will receive notification when the operator is encountered + the existing registered operator, if any +
    + + + Gets the + + containing all the registered operators strings. + + + + + containing all the registered operators strings. + + + + Resets the graphics state stack, matrices and resources. + + + + Gets the current + + + + the current + + + + + Processes PDF syntax. + + Processes PDF syntax. + Note: If you re-use a given + + , you must call + + + the bytes of a content stream + the resources of the content stream. Must not be null. + + + Processes PDF syntax. + + Processes PDF syntax. +
    + Note: If you re-use a given + + , you must call + +
    + the page to process +
    + + + Accessor method for the + + object maintained in this class. + Necessary for implementing custom ContentOperator implementations. + + the renderListener + + + Loads all the supported graphics and text state operators in a map. + + + Displays the current path. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + In case it isn't applicable pass any byte value. + + + + Invokes an operator. + the PDF Syntax of the operator + a list with operands + + + Gets the font pointed to by the indirect reference. + Gets the font pointed to by the indirect reference. The font may have been cached. + + the font + + + Add to the marked content stack + the tag of the marked content + the PdfDictionary associated with the marked content + + + Remove the latest marked content from the stack. + Remove the latest marked content from the stack. Keeps track of the BMC, BDC and EMC operators. + + + Used to trigger beginTextBlock on the renderListener + + + Used to trigger endTextBlock on the renderListener + + + This is a proxy to pass only those events to the event listener which are supported by it. + event data + event type + + + Displays text. + the text to display + + + Displays an XObject using the registered handler for this XObject's subtype + the name of the XObject to retrieve from the resource dictionary + + + Adjusts the text matrix for the specified adjustment value (see TJ operator in the PDF spec for information) + + the text adjustment + + + Gets a color based on a list of operands and Color space. + + + Gets a color based on a list of operands. + + + A handler that implements operator (unregistered). + + + + + + A handler that implements operator (TJ). + A handler that implements operator (TJ). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator ("). + A handler that implements operator ("). For more information see Table 51 ISO-32000-1 + + + Create new instance of this handler. + the handler for Tw operator + the handler for Tc operator + the handler for ' operator + + + + + + A handler that implements operator ('). + A handler that implements operator ('). For more information see Table 51 ISO-32000-1 + + + Creates the new instance of this handler + the handler for T* operator + the handler for Tj operator + + + + + + A handler that implements operator (Tj). + A handler that implements operator (Tj). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (T*). + A handler that implements operator (T*). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tm). + A handler that implements operator (Tm). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (TD). + A handler that implements operator (TD). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Td). + A handler that implements operator (Td). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tf). + A handler that implements operator (Tf). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tr). + A handler that implements operator (Tr). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Ts). + A handler that implements operator (Ts). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (TL). + A handler that implements operator (TL). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tz). + A handler that implements operator (Tz). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tc). + A handler that implements operator (Tc). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Tw). + A handler that implements operator (Tw). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (gs). + A handler that implements operator (gs). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (q). + A handler that implements operator (q). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (cm). + A handler that implements operator (cm). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Q). + A handler that implements operator (Q). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (g). + A handler that implements operator (g). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (G). + A handler that implements operator (G). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (rg). + A handler that implements operator (rg). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (RG). + A handler that implements operator (RG). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (k). + A handler that implements operator (k). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (K). + A handler that implements operator (K). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (CS). + A handler that implements operator (CS). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (cs). + A handler that implements operator (cs). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (sc / scn). + A handler that implements operator (sc / scn). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (SC / SCN). + A handler that implements operator (SC / SCN). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (BT). + A handler that implements operator (BT). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (ET). + A handler that implements operator (ET). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (BMC). + A handler that implements operator (BMC). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (BDC). + A handler that implements operator (BDC). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (EMC). + A handler that implements operator (EMC). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (Do). + A handler that implements operator (Do). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (EI). + + A handler that implements operator (EI). For more information see Table 51 ISO-32000-1 + BI and ID operators are parsed along with this operator. + This not a usual operator, it will have a single operand, which will be a PdfStream object which + encapsulates inline image dictionary and bytes + + + + + + + A handler that implements operator (w). + A handler that implements operator (w). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (J). + A handler that implements operator (J). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (j). + A handler that implements operator (j). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (M). + A handler that implements operator (M). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (d). + A handler that implements operator (d). For more information see Table 51 ISO-32000-1 + + + + + + An XObject subtype handler for FORM + + + An XObject subtype handler for IMAGE + + + An XObject subtype handler that does nothing + + + A handler that implements operator (m). + A handler that implements operator (m). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (l). + A handler that implements operator (l). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (c). + A handler that implements operator (c). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (v). + A handler that implements operator (v). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (y). + A handler that implements operator (y). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (h). + A handler that implements operator (h). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (re). + A handler that implements operator (re). For more information see Table 51 ISO-32000-1 + + + + + + A handler that implements operator (S, s, f, F, f*, B, B*, b, b*). + A handler that implements operator (S, s, f, F, f*, B, B*, b, b*). For more information see Table 51 ISO-32000-1 + + + + Constructs PainPath object. + + One of the possible combinations of + + and + + values or + + + + Either + + or + + In case it isn't applicable pass any value. + + Indicates whether the path should be closed or not. + + + + + + A handler that implements operator (W, W*). + A handler that implements operator (W, W*). For more information see Table 51 ISO-32000-1 + + + + + + + A utility class that makes it cleaner to process content from pages of a + + through a specified RenderListener. + + + + Processes content from the specified page number using the specified listener. + + Processes content from the specified page number using the specified listener. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + + the page number to process + the listener that will receive render callbacks + an optional map of custom ContentOperators for rendering instructions + + the provided renderListener + + + Processes content from the specified page number using the specified listener + + the page number to process + the listener that will receive render callbacks + the provided renderListener + + + Extract text from a specified page using an extraction strategy. + + Extract text from a specified page using an extraction strategy. + Also allows registration of custom IContentOperators that can influence + how (and whether or not) the PDF instructions will be parsed. + + the page for the text to be extracted from + the strategy to use for extracting text + + an optional map of custom + + s for rendering instructions + + the extracted text + + + Extract text from a specified page using an extraction strategy. + the page for the text to be extracted from + the strategy to use for extracting text + the extracted text + + + Extract text from a specified page using the default strategy. + + Extract text from a specified page using the default strategy. + Node: the default strategy is subject to change. If using a specific strategy + is important, please use + + . + + the page for the text to be extracted from + the extracted text + + + Utility methods to help with processing of inline images + + + + Map between key abbreviations allowed in dictionary of inline images and their + equivalent image dictionary keys + + + + Map between value abbreviations allowed in dictionary of inline images for COLORSPACE + + + Map between value abbreviations allowed in dictionary of inline images for FILTER + + + Parses an inline image from the provided content parser. + + Parses an inline image from the provided content parser. The parser must be positioned immediately following the BI operator in the content stream. + The parser will be left with current position immediately following the EI operator that terminates the inline image + + the content parser to use for reading the image. + a color space dictionary + the parsed image + if anything goes wring with the parsing + if parsing of the inline image failed due to issues specific to inline image processing + + + + Parses the next inline image dictionary from the parser. + + Parses the next inline image dictionary from the parser. The parser must be positioned immediately following the BI operator. + The parser will be left with position immediately following the whitespace character that follows the ID operator that ends the inline image dictionary. + + the parser to extract the embedded image information from + the dictionary for the inline image, with any abbreviations converted to regular image dictionary keys and values + + if the parse fails + + + Transforms value abbreviations into their corresponding real value + the key that the value is for + the value that might be an abbreviation + if value is an allowed abbreviation for the key, the expanded value for that abbreviation. Otherwise, value is returned without modification + + + + the name of the color space. If null, a bi-tonal (black and white) color space is assumed. + + the components per pixel for the specified color space + + + Computes the number of unfiltered bytes that each row of the image will contain. + + Computes the number of unfiltered bytes that each row of the image will contain. + If the number of bytes results in a partial terminating byte, this number is rounded up + per the PDF specification + + the dictionary of the inline image + the number of bytes per row of the image + + + Parses the samples of the image from the underlying content parser, ignoring all filters. + + Parses the samples of the image from the underlying content parser, ignoring all filters. + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + The parser will be left positioned immediately following the EI operator. + This is primarily useful if no filters have been applied. + + the dictionary of the inline image + the content parser + the samples of the image + if anything bad happens during parsing + + + + Parses the samples of the image from the underlying content parser, accounting for filters + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + + + Parses the samples of the image from the underlying content parser, accounting for filters + The parser must be positioned immediately after the ID operator that ends the inline image's dictionary. + The parser will be left positioned immediately following the EI operator. + Note:This implementation does not actually apply the filters at this time + + the dictionary of the inline image + the content parser + the samples of the image + if anything bad happens during parsing + + + + + Simple class in case users need to differentiate an exception from processing + inline images vs other exceptions + + + + Parses the page or form XObject content. + Paulo Soares + + + Holds value of property tokeniser. + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + + Creates a new instance of PdfContentParser + the tokeniser with the content + + current resources of the content stream. + It is optional parameter, which is used for performance improvements of specific cases of + inline images parsing. + + + + Parses a single command from the content. + + Parses a single command from the content. Each command is output as an array of arguments + having the command itself as the last element. The returned array will be empty if the + end of content was reached. +
    + A specific behaviour occurs when inline image is encountered (BI command): + in that case, parser would continue parsing until it meets EI - end of the inline image; + as a result in this case it will return an array with inline image dictionary and image bytes + encapsulated in PdfStream object as first element and EI command as second element. +
    + + an ArrayList to use. It will be cleared before using. If it's + null will create a new ArrayList + + the same ArrayList given as argument or a new one + on error +
    + + Gets the tokeniser. + the tokeniser. + + + Sets the tokeniser. + the tokeniser + + + Reads a dictionary. + Reads a dictionary. The tokeniser must be positioned past the "<<" token. + the dictionary + on error + + + Reads an array. + Reads an array. The tokeniser must be positioned past the "[" token. + an array + on error + + + Reads a pdf object. + the pdf object + on error + + + Reads the next token skipping over the comments. + true if a token was read, false if the end of content was reached + on error + + + A container for constants defined in the PDF specification (ISO 32000-1). + + + + The text rendering mode determines whether showing text causes glyph + outlines to be stroked, filled, used as a clipping boundary, or some + combination of the three. + + + The text rendering mode determines whether showing text causes glyph + outlines to be stroked, filled, used as a clipping boundary, or some + combination of the three. Stroking, filling, and clipping have the same + effects for a text object as they do for a path object, although they are + specified in an entirely different way. + If the text rendering mode calls for filling, the current nonstroking + color in the graphics state is used; if it calls for stroking, the + current stroking color is used. + All documentation for this class is taken from ISO 32000-1, section 9.3.6 + "Text Rendering Mode". + + + + Fill text + + + Stroke text, providing the outline of the glyphs + + + Fill and stroke text + + + Neither fill nor stroke, i.e. + Neither fill nor stroke, i.e. render invisibly + + + Fill text and add to path for clipping + + + Stroke text and add to path for clipping + + + Fill, then stroke text and add to path for clipping + + + Add text to path for clipping + + + + The line cap style specifies the shape to be used at the ends of open + subpaths (and dashes, if any) when they are stroked. + + + The line cap style specifies the shape to be used at the ends of open + subpaths (and dashes, if any) when they are stroked. + All documentation for this class is taken from ISO 32000-1, section + 8.4.3.3 "Line Cap Style". + + + + The stroke is squared of at the endpoint of the path. + + The stroke is squared of at the endpoint of the path. There is no + projection beyond the end of the path. + + + + + A semicircular arc with a diameter equal to the line width is drawn + around the endpoint and filled in. + + + + + The stroke continues beyond the endpoint of the path for a distance + equal to half the line width and is squared off. + + + + + The line join style specifies the shape to be used at the corners of + paths that are stroked. + + + The line join style specifies the shape to be used at the corners of + paths that are stroked. Join styles are significant only at points where + consecutive segments of a path connect at an angle; segments that meet or + intersect fortuitously receive no special treatment. + All documentation for this class is taken from ISO 32000-1, section + 8.4.3.4 "Line Join Style". + + + + + The outer edges of the strokes for the two segments are extended + until they meet at an angle, as in a picture frame. + + + The outer edges of the strokes for the two segments are extended + until they meet at an angle, as in a picture frame. If the segments + meet at too sharp an angle, a bevel join is used instead. + + + + + An arc of a circle with a diameter equal to the line width is drawn + around the point where the two segments meet, connecting the outer + edges of the strokes for the two segments. + + + An arc of a circle with a diameter equal to the line width is drawn + around the point where the two segments meet, connecting the outer + edges of the strokes for the two segments. This pieslice-shaped + figure is filled in, producing a rounded corner. + + + + + The two segments are finished with butt caps (@see LineCapStyle#BUTT) + and the resulting notch beyond the ends of the segments is filled + with a triangle. + + + + A PdfCanvas instance with an inherent tiling pattern. + + + Creates PdfPatternCanvas from content stream of page, form XObject, pattern etc. + @see PdfStream. + the resources, a specialized dictionary that can be used by PDF instructions in the content stream + + the document that the resulting content stream will be written to + + + Creates PdfPatternCanvas for a document from a provided Tiling pattern + @see PdfPattern.Tiling. The Tiling pattern must be colored + the document that the resulting content stream will be written to + + + Helper class to read nt, short, words, etc. + Helper class to read nt, short, words, etc. from an InputStream. + + + Creates an InputMeta object. + InputStream containing the WMF data + + + Read the next word from the InputStream. + the next word or 0 if the end of the stream has been reached + + + + Read the next short from the InputStream. + the next short value + + + + Read the next int from the InputStream. + the next int + + + + Read the next byte from the InputStream. + the next byte + + + + Skips "len" amount of bytes from the InputStream. + Skips "len" amount of bytes from the InputStream. If len is < 0, nothing is skipped. + amount of bytes needed to skip + + + + Get the amount of bytes read and/or skipped from the InputStream. + number of bytes read + + + + Read the next + + from the InputStream. This reads 4 bytes. + + the next Color + + + + + A Brush bject that holds information about the style, the hatch and the color of + the brush. + + + + A meta object. + + + Creates a new MetaObject. + Creates a new MetaObject. This constructor doesn't set the type. + + + Creates a MetaObject with a type. + the type of meta object + + + Get the type of this MetaObject. + type of MetaObject + + + Creates a MetaBrush object. + + + Initializes this MetaBrush object. + the InputMeta + + + + Get the style of the MetaBrush. + style of the brush + + + Get the hatch pattern of the MetaBrush + hatch of the brush + + + Get the color of the MetaBrush. + color of the brush + + + A class to process WMF files. + + A class to process WMF files. Used internally by + + . + + + + PdfCanvas of the MetaDo object. + + + The InputMeta instance containing the data. + + + Creates a MetaDo instance. + inputstream containing the data + PdfCanvas + + + Reads and processes all the data of the InputMeta. + + + + Output Text at a certain x and y coordinate. + Output Text at a certain x and y coordinate. Clipped or opaque text isn't supported as of yet. + x-coordinate + y-coordinate + flag indicating clipped or opaque + x1-coordinate of the rectangle if clipped or opaque + y1-coordinate of the rectangle if clipped or opaque + x2-coordinate of the rectangle if clipped or opaque + y1-coordinate of the rectangle if clipped or opaque + text to output + + + + Return true if the pen style is null and if it isn't a brush. + + value to decide how to change the state. If true state.setLineJoinRectangle(cb) is called, + if false state.setLineJoinPolygon(cb) is called. + + true if the pen style is null and if it isn't a brush + + + Stroke and fill the MetaPen and MetaBrush paths. + + + Wrap a BMP image in an WMF. + the BMP image to be wrapped + the wrapped BMP + + + + Writes the specified value to the specified outputstream as a word. + outputstream to write the word to + value to be written + + + + Writes the specified value to the specified outputstream as a dword. + outputstream to write the dword to + value to be written + + + + A Meta Font. + + + Creates a MetaFont instance. + + + Initializes the MetaFont instance. + InputMeta containing the WMF data + + + + Returns the Font. + the font + + + + Returns the encoding used in the MetaFont. + the font encoding + + + Returns the angle of the MetaFont. + the angle + + + Returns a boolean value indicating if the font is underlined or not. + true if the font is underlined + + + Returns a boolean value indicating if a font has a strikeout. + true if the font set strikeout + + + Returns the font size. + the MetaState + font size + + + A Pen object of the WMF format. + A Pen object of the WMF format. Holds the color, style and width information of the pen. + + + Creates a MetaPen object. + + + Initializes a MetaPen object. + the InputMeta object that holds the inputstream of the WMF image + + + + Get the style of the MetaPen. + style of the pen + + + Get the width of the MetaPen. + width of the pen + + + Get the color of the MetaPen. + color of the pen + + + Class to keep the state. + + + Stack of saved states. + + + List of MetaObjects. + + + Current Point. + + + Current Pen. + + + Current Brush. + + + Current Font. + + + The current background color. + The current background color. Default value is DeviceRgb#WHITE. + + + Current text color. + Current text color. Default value is DeviceRgb#BLACK. + + + The current background mode. + The current background mode. Default value is OPAQUE. + + + Current polygon fill mode. + Current polygon fill mode. Default value is ALTERNATE. + + + Curent line join. + Curent line join. Default value is 1. + + + Current text alignment. + + + Current offset for Wx. + + + Current offset for Wy. + + + Current extent for Wx. + + + Current extent for Wy. + + + Current x value for scaling. + + + Current y value for scaling. + + + Creates new MetaState + + + Clones a new MetaState from the specified MetaState. + the state to clone + + + Sets every field of this MetaState to the values of the fields of the specified MetaState. + state to copy + + + Add a MetaObject to the State. + MetaObject to be added + + + Select the MetaObject at the specified index and prepare the PdfCanvas. + position of the MetaObject + PdfCanvas to prepare + + + Deletes the MetaObject at the specified index. + index of the MetaObject to delete + + + Saves the state of this MetaState object. + PdfCanvas object on which saveState() will be called + + + Restores the state to the next state on the saved states stack. + index of the state to be restored + PdfCanvas object on which restoreState() will be called + + + Restres the state of the specified PdfCanvas object for as many times as there are saved states on the stack. + + PdfCanvas object + + + Transform the specified value. + the value to transform + the transformed value + + + Transform the specified value. + the value to transform + transformed value + + + Sets the x value for scaling. + x value for scaling + + + Sets the y value for scaling. + y value for scaling + + + Sets the Wx offset value. + Wx offset value + + + Sets the Wy offset value. + Wy offset value + + + Sets the Wx extent value. + Wx extent value + + + Sets the Wy extent value. + Wy extent value + + + Transforms the specified angle. + + Transforms the specified angle. If scalingY is less than 0, the angle is multiplied by -1. If scalingX is less + than 0, the angle is subtracted from Math.PI. + + the angle to transform + the transformed angle + + + Sets the current Point to the specified Point. + Point to set + + + Returns the current Point. + current Point + + + Returns the current MetaBrush object. + current MetaBrush + + + Returns the current MetaPen object. + current MetaPen + + + Returns the current MetaFont object. + current MetaFont + + + Getter for property currentBackgroundColor. + Value of property currentBackgroundColor. + + + Setter for property currentBackgroundColor. + New value of property currentBackgroundColor. + + + Getter for property currentTextColor. + Value of property currentTextColor. + + + Setter for property currentTextColor. + New value of property currentTextColor. + + + Getter for property backgroundMode. + Value of property backgroundMode. + + + Setter for property backgroundMode. + New value of property backgroundMode. + + + Getter for property textAlign. + Value of property textAlign. + + + Setter for property textAlign. + New value of property textAlign. + + + Getter for property polyFillMode. + Value of property polyFillMode. + + + Setter for property polyFillMode. + New value of property polyFillMode. + + + + Sets the line join style to + + if lineJoin isn't 0. + + PdfCanvas to set the line join style + + + + Sets the line join style to + + if lineJoin is 0. + + PdfCanvas to set the line join style + + + Returns true if lineJoin is 0. + true if lineJoin is 0 + + + Image implementation for WMF, Windows Metafile. + + + Creates a WmfImage from a file. + pah to the file + + + + Creates a WmfImage from a URL. + URL to the file + + + Creates a WmfImage from a byte[]. + the image bytes + + + Helper class for the WmfImage implementation. + + Helper class for the WmfImage implementation. Assists in the creation of a + + . + + + + Scales the WMF font size. + Scales the WMF font size. The default value is 0.86. + + + Creates a helper instance. + + the + + object + + + + This method checks if the image is a valid WMF and processes some parameters. + + + Create a PdfXObject based on the WMF image. + + Create a PdfXObject based on the WMF image. The PdfXObject will have the dimensions of the + WMF image. + + PdfDocument to add the PdfXObject to + PdfXObject based on the WMF image + + + A type of initial view + + + A type of initial view + + + A type of initial view + + + Constructs a PDF Collection. + + + Sets the Collection schema dictionary. + an overview of the collection fields + + + + + Identifies the document that will be initially presented + in the user interface. + + a string that identifies an entry in the EmbeddedFiles name tree + + + + Sets the initial view. + + + + + Sets the Collection sort dictionary. + + + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + A possible type of collection field. + + + Creates a PdfCollectionField. + the field name + the field subtype + + + The relative order of the field name. + The relative order of the field name. Fields are sorted in ascending order. + a number indicating the order of the field + + + + Sets the initial visibility of the field. + + + + + Indication if the field value should be editable in the viewer. + + + + + Sets the value of the collection item. + + + + + + Sets the value of the collection item. + + + + Sets the value of the collection item. + + + + Adds a prefix for the Collection item. + + Adds a prefix for the Collection item. + You can only use this method after you have set the value of the item. + + + + + + + Creates a Collection Schema dictionary. + + + Adds a Collection field to the Schema. + the name of the collection field + a Collection Field + + + + Constructs a PDF Collection Sort Dictionary. + the key of the field that will be used to sort entries + + + Constructs a PDF Collection Sort Dictionary. + the keys of the fields that will be used to sort entries + + + Defines the sort order of the field (ascending or descending). + true is the default, use false for descending order + + + + Defines the sort order of the field (ascending or descending). + an array with every element corresponding with a name of a field. + + + + Represents the most common properties of color spaces. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + Dictionary wrapper that represent special type of color space, that uses pattern objects + as the equivalent of colour values instead of the numeric component values used with other spaces. + + + Dictionary wrapper that represent special type of color space, that uses pattern objects + as the equivalent of colour values instead of the numeric component values used with other spaces. + A pattern object shall be a dictionary or a stream, depending on the type of pattern. + For mor information see paragraph 8.7 in ISO-32000-1. + + + + + Creates the instance wrapper of correct type from the + + + + the + + that represent Pattern + + new wrapper instance. + + + + Gets a transformation matrix that maps the pattern’s internal coordinate system + to the default coordinate system of the pattern’s parent content stream. + + + Gets a transformation matrix that maps the pattern’s internal coordinate system + to the default coordinate system of the pattern’s parent content stream. + The concatenation of the pattern matrix with that of the parent content stream + establishes the pattern coordinate space, within which all graphics objects in the pattern shall be interpreted. + + pattern matrix + + + + Sets a transformation matrix that maps the pattern’s internal coordinate system + to the default coordinate system of the pattern’s parent content stream. + + + Sets a transformation matrix that maps the pattern’s internal coordinate system + to the default coordinate system of the pattern’s parent content stream. + The concatenation of the pattern matrix with that of the parent content stream + establishes the pattern coordinate space, within which all graphics objects in the pattern shall be interpreted. + + pattern matrix to set + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + Wrapper that represents tiling pattern of color space. + + Wrapper that represents tiling pattern of color space. This pattern consists of a small graphical figure (cells). + Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. + The pattern cell can include graphical elements such as filled areas, text, and sampled images. + Its shape need not be rectangular, and the spacing of tiles can differ from the dimensions of the cell itself. + The appearance of the pattern cell shall be defined by a content stream + containing the painting operators needed to paint one instance of the cell + + + + + Creates new instance from the + + object. + This stream should have PatternType equals to 1. + + + the + + that represents Tiling Pattern. + + + + Checks if this pattern have colored paint type. + + + + if this pattern's paint type is + + and + + otherwise. + + + + Sets the paint type. + + if + + then the paint type will be set as + + , + and + + otherwise. + + + + Gets the tiling type. + + int value of + + + + + Sets the tiling type. + + int value of + + to set. + + in case of wrong value. + + + Gets the pattern cell's bounding box. + Gets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell. + pattern cell's bounding box. + + + Sets the pattern cell's bounding box. + Sets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell. + pattern cell's bounding box to set. + + + + + + A code that determines how the colour of the pattern cell shall be specified + + + The pattern’s content stream shall specify the colours used to paint the pattern cell. + + + The pattern’s content stream shall not specify any colour information. + + The pattern’s content stream shall not specify any colour information. + Instead, the entire cell is painted with a separately specified colour each time the pattern is used. + + + + A code that controls adjustments to the spacing of tiles relative to the device pixel grid + + + Pattern cells shall be spaced consistently—that is, by a multiple of a device pixel. + + Pattern cells shall be spaced consistently—that is, by a multiple of a device pixel. + To achieve this, the conforming reader may need to distort the pattern cell slightly. + + + + + The pattern cell shall not be distorted, + but the spacing between pattern cells may vary by as much as 1 device pixel. + + + + + Pattern cells shall be spaced consistently as in tiling type 1, + but with additional distortion permitted to enable a more efficient implementation. + + + + The abstract PdfShading class that represents the Shading Dictionary PDF object. + + + + Creates the + + object from the existing + + with corresponding type. + + + + + from which the + + object will be created. + + + Created + + object. + + + + Gets the shading type. + + int value of + + . + + + + Gets the color space in which colour values shall be expressed. + + + + Color space + + + + + Gets the function PdfObject that represents color transitions + across the shading geometry. + + + + + Function + + + + + Sets the function that represents color transitions + across the shading geometry as one object. + + + The + + to set. + + + + + Sets the function object that represents color transitions + across the shading geometry as an array of functions. + + + The array of + + to be set. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + constants of shading type + ISO-320001 Table 78 + + + + + The int value of function-based shading type + + + The int value of axial shading type + + + The int value of radial shading type + + + The int value of free-form Gouraud-shaded triangle mesh shading type + + + The int value of lattice-form Gouraud-shaded triangle mesh shading type + + + The int value of coons patch meshes shading type + + + The int value of tensor-product patch meshes shading type + + + + The class that extends + + class and is in charge of Shading Dictionary with function-based type, + that defines color at every point in the domain by a specified mathematical function. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + + + the + + , that is used to calculate color transitions. + + + + Creates the new instance of the class. + + the + + , that represents color space in which colour values shall be expressed. + + + the + + , that is used to calculate color transitions. + + + + + Gets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + + + + domain rectangle. + + + + + Sets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + the Xmin coordinate of rectangle. + the Xmax coordinate of rectangle. + the Ymin coordinate of rectangle. + the Ymax coordinate of rectangle. + + + + Sets the + + domain rectangle object that establishes an internal coordinate space + for the shading that is independent of the target coordinate space in which it shall be painted. + + + the + + domain rectangle object to be set. + + + + + Gets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + float[] + of transformation matrix (identical matrix by default). + + + + + Sets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + float[] + of transformation matrix to be set. + + + + + Sets the array of floats that represents the transformation matrix that maps the domain rectangle + into a corresponding figure in the target coordinate space. + + + the + + transformation matrix object to be set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with axial type, + that define a colour blend that varies along a linear axis between two endpoints + and extends indefinitely perpendicular to that axis. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + the start coordinate of X axis expressed in the shading's target coordinate space. + the start coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the start point. + + the end coordinate of X axis expressed in the shading's target coordinate space. + the end coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the end point. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + the start coordinate of X axis expressed in the shading's target coordinate space. + the start coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the start point. + + the end coordinate of X axis expressed in the shading's target coordinate space. + the end coordinate of Y axis expressed in the shading's target coordinate space. + + the + float[] + that represents the color in the end point. + + + the array of two booleans that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the + + of four number four numbers [x0 y0 x1 y1] that specified the starting + and the endings coordinates of thew axis, expressed in the shading's target coordinate space. + + + the + + object, that is used to calculate color transitions. + + + + + Gets the Coords object - a + + of four numbers [x0 y0 x1 y1] that specified the starting + and the endings coordinates of thew axis, expressed in the shading's target coordinate space. + + + the + + Coords object. + + + + Sets the Choords object with the four params expressed in the shading's target coordinate space. + the start coordinate of X axis to be set. + the start coordinate of Y axis to be set. + the end coordinate of X axis to be set. + the end coordinate of Y axis to be set. + + + + Sets the Choords object with the + + of four numbers [x0 y0 x1 y1], + that specified the starting and the endings coordinates of thew axis, + expressed in the shading's target coordinate space. + + + the Chords + + to be set. + + + + + Gets the array of two + float + [t0, t1] that represent the limiting values of a parametric + variable t, that becomes an input of color function(s). + + + + float[] + of Domain object ([0.0 1.0] by default) + + + + + Sets the Domain with the array of two + float + [t0, t1] that represent the limiting values + of a parametric variable t, that becomes an input of color function(s). + + first limit of variable t + second limit of variable t + + + + Gets the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + boolean[] + of Extended object ([false false] by default) + + + + + Sets the Extend object with the two + boolean + value. + + if true will extend shading beyond the starting point of Coords + if true will extend shading beyond the ending point of Coords + + + + The class that extends + + class and is in charge of Shading Dictionary with radial type, + that define a colour blend that varies between two circles. + This type of shading shall not be used with an Indexed colour space + + + + + Creates the new instance of the class from the existing + + object. + + + - + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the start circle. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the end circle. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the start circle. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + the + float[] + that represents the color in the end circle. + + + the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending points of the axis, respectively. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The Indexed color space isn't excepted. + + + the + + of of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + the + + object, that is used to calculate color transitions. + + + + + Gets the coords + + object - an array of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + the + + coords object. + + + + Sets the coords object. + the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of starting circle's centre, should be greater or equal to 0. + If 0 then starting circle is treated as point. + If both radii are 0, nothing shall be painted. + + the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space. + + + the radius of ending circle's centre, should be greater or equal to 0. + If 0 then ending circle is treated as point. + If both radii are 0, nothing shall be painted. + + + + + Sets the coords + + object - an array of six numbers [x0 y0 r0 x1 y1 r1], + specifying the centres and radii of the starting and ending circles, + expressed in the shading’s target coordinate space. + The radii r0 and r1 shall both be greater than or equal to 0. + If one radius is 0, the corresponding circle shall be treated as a point; + if both are 0, nothing shall be painted. + + + - + + choords object to be set. + + + + + Gets the array of two + float + [t0, t1] that represent the limiting values of a parametric + variable t, that becomes an input of color function(s). + + + + float[] + of Domain object ([0.0 1.0] by default) + + + + + Sets the Domain with the array of two + float + [t0, t1] that represent the limiting values + of a parametric variable t, that becomes an input of color function(s). + + first limit of variable t + second limit of variable t + + + + Gets the array of two + boolean + that specified whether to extend the shading + beyond the starting and ending circles of the axis, respectively. + + + + boolean[] + of Extended object ([false false] by default) + + + + + Sets the Extend object with the two + boolean + value. + + if true will extend shading beyond the starting circle of Coords. + if true will extend shading beyond the ending circle of Coords. + + + + The class that extends + + class and is in charge of Shading Dictionary with + free-form Gouraud-shaded triangle mesh type. + The area to be shaded is defined by a path composed entirely of triangles. + The colour at each vertex of the triangles is specified, + and a technique known as Gouraud interpolation is used to colour the interiors. + The object shall be represented as stream containing a sequence of vertex data. + Each vertex is specified by the following values, in the order shown: + f x y c1 … cn where: + f - the vertex’s edge flag, that determines the vertex is connected to other vertices of the triangle mesh. + For full description + ISO-320001 Paragph 8.7.4.5.5 + x, y - vertex’s horizontal and vertical coordinates, expressed in the shading’s target coordinate space. + c1…cn - vertex’s colour components. + If the shading dictionary includes a Function entry, only a single parametric value, t, + shall be specified for each vertex in place of the colour components c1…cn. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, or 2. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, or 2. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1 or 2. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1 or 2. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + lattice-form Gouraud-shaded triangle mesh type. + This type is similar to + + but instead of using free-form geometry, + the vertices are arranged in a pseudorectangular lattice, + which is topologically equivalent to a rectangular grid. + The vertices are organized into rows, which need not be geometrically linear. + The verticals data in stream is similar to + + , + except there is no edge flag. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of vertices in each row of the lattice (shall be > 1). + The number of rows need not be specified. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of vertices in each row of the lattice (shall be > 1). + The number of rows need not be specified. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of vertices in each row of the lattice. + the number of vertices. Can only be greater than 1. + + + Sets the number of vertices in each row of the lattice. + + Sets the number of vertices in each row of the lattice. + The number of rows need not be specified. + + the number of vertices to be set. Shall be greater than 1. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + Coons Patch mesh type. + This type of shading is constructed from one or more colour patches, each bounded by four cubic Bézier curves. + Degenerate Bézier curves are allowed and are useful for certain graphical effects. + At least one complete patch shall be specified. + The shape of patch is defined by 12 control points. + Colours are specified for each corner of the unit square, + and bilinear interpolation is used to fill in colours over the entire unit square. + Coordinates are mapped from the unit square into a four-sided patch whose sides are not necessarily linear. + The mapping is continuous: the corners of the unit square map to corners of the patch + and the sides of the unit square map to sides of the patch. + For the format of data stream, that defines patches + ISO-320001 Table 85 + . + If the shading dictionary contains a Function entry, the colour data for each corner of a patch + shall be specified by a single parametric value t rather than by n separate colour components c1…cn. + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + The class that extends + + class and is in charge of Shading Dictionary with + Tensor-Product Patch mesh type. + This type of shading is identical to + + , except that it's based on a + bicubic tensor-product patch defined by 16 control points. + For the format of data stream, that defines patches + ISO-320001 Table 86 + . + + + + + Creates the new instance of the class from the existing + + object. + + + + + from which the instance is created. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + int[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Creates the new instance of the class. + + the + + object in which colour values shall be expressed. + The special Pattern space isn't excepted. + + + the number of bits used to represent each vertex coordinate. + The value shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + the number of bits used to represent each colour component. + The value shall be 1, 2, 4, 8, 12, or 16. + + + the number of bits used to represent the edge flag for each vertex. + The value of BitsPerFlag shall be 2, 4, or 8, + but only the least significant 2 bits in each flag value shall be used. + The value for the edge flag shall be 0, 1, 2 or 3. + + + the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + + Gets the number of bits used to represent each vertex coordinate. + the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Sets the number of bits used to represent each vertex coordinate. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32. + + + Gets the number of bits used to represent each colour component. + the number of bits. Can be 1, 2, 4, 8, 12, or 16. + + + Sets the number of bits used to represent each colour component. + the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. + + + Gets the number of bits used to represent the edge flag for each vertex. + + Gets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits. Can be 2, 4 or 8. + + + Sets the number of bits used to represent the edge flag for each vertex. + + Sets the number of bits used to represent the edge flag for each vertex. + But only the least significant 2 bits in each flag value shall be used. + The valid flag values are 0, 1, 2 or 3. + + the number of bits to be set. Shall be 2, 4 or 8. + + + + Gets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object. + + + + + Sets the + float[] + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + float[] + of Decode object to set. + + + + + Sets the + + of numbers specifying how to map vertex coordinates and colour components + into the appropriate ranges of values. The ranges shall be specified as follows: + [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. + Only one pair of color values shall be specified if a Function entry is present. + + + the + + Decode object to set. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + Compression constants for . + + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + A possible compression level. + + + + Encryption constants for + + . + + + + Type of encryption. + + + Type of encryption. + + + Type of encryption. + + + Type of encryption. + + + Mask to separate the encryption type from the encryption mode. + + + Add this to the mode to keep the metadata in clear text. + + + Add this to the mode to keep encrypt only the embedded files. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + The operation permitted when the document is opened with the user password. + + + StandardEncryption properties + + + PublicKeyEncryption properties + + + Sets the encryption options for the document. + + Sets the encryption options for the document. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + ALLOW_PRINTING, ALLOW_MODIFY_CONTENTS, ALLOW_COPY, ALLOW_MODIFY_ANNOTATIONS, + ALLOW_FILL_IN, ALLOW_SCREENREADERS, ALLOW_ASSEMBLY and ALLOW_DEGRADED_PRINTING. + The permissions can be combined by ORing them. + See + + . + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256 + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + + + Sets the certificate encryption options for the document. + + Sets the certificate encryption options for the document. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ORed to output the metadata in cleartext + See + + . + + the public certificates to be used for the encryption + the user permissions for each of the certificates + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256. + + + + Graphics state parameter dictionary wrapper. + + Graphics state parameter dictionary wrapper. + See ISO-320001, 8.4.5 Graphics State Parameter Dictionaries. + + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard separable blend mode. + Standard separable blend mode. See ISO-320001, table 136 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + Standard nonseparable blend mode. + Standard nonseparable blend mode. See ISO-320001, table 137 + + + + Create instance of graphics state parameter dictionary wrapper + by existed + PdfDictionary + object + + instance of graphics state parameter dictionary + + + Create default instance of graphics state parameter dictionary + + + + Gets line width value, + LW + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets line width value, + LW + key. + + + a + float + value. + + object itself. + + + + Gets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + + + + Sets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + object itself. + + + + Sets line gap style value, + LC + key. + + 0 - butt cap, 1 - round cap, 2 - projecting square cap. + object itself. + + + + Gets line join style value, + LJ + key. + + 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. + + + + Sets line join style value, + LJ + key. + + 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. + object itself. + + + + Gets miter limit value, + ML key + . See also line join style. + + + a + float + value if exist, otherwise + + . + + + + + Sets miter limit value, + ML key + . See also line join style. + + + a + float + value. + + object itself. + + + + Gets line dash pattern value, + D + key. + + + a + PdfArray + , that represents line dash pattern. + + + + + Sets line dash pattern value, + D + key. + + + a + PdfArray + , that represents line dash pattern. + + object itself. + + + + Gets rendering intent value, + RI + key. + Valid values are: + AbsoluteColorimetric + , + RelativeColorimetric + , + Saturation + , + Perceptual + . + + + a + PdfName + instance. + + + + + Sets rendering intent value, + RI + key. + + + a + PdfName + instance, Valid values are: + AbsoluteColorimetric + , + RelativeColorimetric + , + Saturation + , + Perceptual + . + + object itself. + + + + Get overprint flag value for stroking operations, + OP + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Set overprint flag value for stroking operations, + OP + key. + + + + + , for applying overprint for stroking operations. + + object itself. + + + + Get overprint flag value for non-stroking operations, + op + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Set overprint flag value for non-stroking operations, + op + key. + + + + + , for applying overprint for non-stroking operations. + + object itself. + + + + Get overprint control mode, + OPM + key. + + + an + int + value if exist, otherwise + + . + + + + + Set overprint control mode, + OPM + key. + + + an + int + value, see ISO-320001, 8.6.7 Overprint Control. + + object itself. + + + + Gets font and size, + Font + key. + + + a + + of the form + [font size] + , where + font + shall be an indirect reference to a font dictionary and + size + shall be a number expressed in text space units. + + + + + Sets font and size, + Font + key. + + + a + + of the form + [font size] + , where + + shall be an indirect reference to a font dictionary and + size + shall be a number expressed in text space units. + + object itself. + + + + Gets the black-generation function value, + BG + . + + + a + + , should be + + . + + + + + Sets the black-generation function value, + BG + . + + + a + + , shall be + + . + + object itself. + + + + Gets the black-generation function value or + Default + , + BG2 + key. + + + a + + value, should be either + + or + + . + + + + + Sets the black-generation function value or + Default + , + BG2 + key. + Note, if both + BG + and + BG2 + are present in the same graphics state parameter dictionary, + BG2 + takes precedence. + + + a + + value, shall be either + + or + Default + . + + object itself. + + + + Gets the undercolor-removal function, + UCR + key. + + + a + + , should be + + . + + + + + Sets the undercolor-removal function, + UCR + key. + + + a + + , shall be + + . + + object itself. + + + + Gets the undercolor-removal function value or + Default + , + UCR2 + key. + + + a + + value, should be either + + or + + . + + + + + Sets the undercolor-removal function value or + Default + , + UCR2 + key. + Note, if both + UCR + and + UCR2 + are present in the same graphics state parameter dictionary, + UCR2 + takes precedence. + + + a + + value, shall be either + + or + Default + . + + object itself. + + + + Gets the transfer function value, + TR + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the transfer function value, + TR + key. + + + a + + , shall be either + + , + + or + + . + + object itself. + + + + Gets the transfer function value or + Default + , + TR2 + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the transfer function value or + Default + , + TR2 + key. + Note, if both + TR + and + TR2 + are present in the same graphics state parameter dictionary, + TR2 + takes precedence. + + + a + + , shall be either + + , + + , + + or + Default + . + + object itself. + + + + Gets the halftone dictionary, stream or + Default + , + HT + key. + + + a + + , should be either + + , + + or + + . + + + + + Sets the halftone or + Default + , + HT + key. + + + a + + , shall be either + + , + + or + + . + + object itself. + + + + Gets + HTP + key. + + + + + Sets + HTP + key. + + + a + + . + + object itself. + + + + Gets the flatness tolerance value, + FL + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the flatness tolerance value, + FL + key. + + + a + float + value. + + object itself. + + + + Gets the smoothness tolerance value, + SM + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the smoothness tolerance value, + SM + key. + + + a + float + value. + + object itself. + + + + Gets value of an automatic stroke adjustment flag, + SA + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets value of an automatic stroke adjustment flag, + SA + key. + + + a + boolean + value. + + object itself. + + + + Gets the current blend mode for the transparent imaging model, + BM + key. + + + a + + , should be either + + or + + . + + + + + Sets the current blend mode for the transparent imaging model, + BM + key. + + + a + + , shall be either + + or + + . + + object itself. + + + + Gets the current soft mask, + SMask + key. + + + a + + , should be either + + or + + . + + + + + Sets the current soft mask, + SMask + key. + + + a + + , shall be either + + or + + . + + object itself. + + + + Gets the current alpha constant, specifying the constant shape or constant opacity value + for stroking operations in the transparent imaging model, + CA + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the current alpha constant, specifying the constant shape or constant opacity value + for stroking operations in the transparent imaging model, + CA + key. + + + a + float + value. + + object itself. + + + + Gets the current alpha constant, specifying the constant shape or constant opacity value + for non-stroking operations in the transparent imaging model, + ca + key. + + + a + float + value if exist, otherwise + + . + + + + + Sets the current alpha constant, specifying the constant shape or constant opacity value + for non-stroking operations in the transparent imaging model, + ca + key. + + + a + float + value. + + object itself. + + + + Gets the alpha source flag (“alpha is shape”), specifying whether the current soft mask and alpha constant + shall be interpreted as shape values ( + + ) or opacity values ( + + ), + AIS + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets the alpha source flag (“alpha is shape”), specifying whether the current soft mask and alpha constant + shall be interpreted as shape values ( + + ) or opacity values ( + + ), + AIS + key. + + + if + + - alpha as shape values, if + + — as opacity values. + + object itself. + + + + Gets the text knockout flag, which determine the behaviour of overlapping glyphs + within a text object in the transparent imaging model, + TK + key. + + + a + boolean + value if exist, otherwise + + . + + + + + Sets the text knockout flag, which determine the behaviour of overlapping glyphs + within a text object in the transparent imaging model, + TK + key. + + + + + if enabled. + + object itself. + + + Puts the value into Graphics state parameter dictionary and associates it with the specified key. + + + Puts the value into Graphics state parameter dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + + + Embed a file to a PdfDocument. + PdfDocument to add the file to + byte[] containing the file + file description + actual file name stored in the pdf + mime-type of the file + Pdfdictionary containing fil parameters + AFRelationship key value, @see AFRelationshipValue. If null, @see AFRelationshipValue.Unspecified will be added. + + + PdfFileSpec containing the file specification of the file as Pdfobject + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Handles ASCII85Decode filter + + + + The main interface for creating a new + FilterHandler + + + + Decode the byte[] using the provided filterName. + the bytes that need to be decoded + PdfName of the filter + decode parameters + the dictionary of the stream. Can contain additional information needed to decode the byte[]. + + decoded byte array + + + Decodes the input bytes according to ASCII85. + the byte[] to be decoded + the decoded byte[] + + + Handles ASCIIHexDecode filter + + + Decodes a byte[] according to ASCII Hex encoding. + byte[] to be decoded + decoded byte[] + + + Handles CCITTFaxDecode filter + + + A filter that doesn't modify the stream at all + + + Encapsulates filter behavior for PDF streams. + + Encapsulates filter behavior for PDF streams. Classes generally interace with this + using the static getDefaultFilterHandlers() method, then obtain the desired + + via a lookup. + + + + + The default + + s used by iText + + + + + the default + + s used by iText + + + + Handles FlateDecode filter. + + + A helper to flateDecode. + the input data + + + + to read a correct stream. + + to try to read a corrupted stream. + + the decoded data + + + Input byte array. + PdfDictionary of decodeParams. + a byte array + + + Handles LZWDECODE filter + + + Decodes a byte[] according to the LZW encoding. + byte[] to be decoded + decoded byte[] + + + A class for performing LZW decoding. + + + Creates an LZWDecoder instance. + + + Method to decode LZW compressed data. + The compressed data. + Array to return the uncompressed data in. + + + Initialize the string table. + + + Write out the string just uncompressed. + content to write to the uncompressed data + + + Add a new string to the string table. + stored string + string to be appended to the stored string + + + Add a new string to the string table. + byte[] to store in the string table + + + Append newString to the end of oldString. + string be appended to + string that is to be appended to oldString + combined string + + + Attempt to get the next code. + + Attempt to get the next code. Exceptions are caught to make + this robust to cases wherein the EndOfInformation code has been + omitted from a strip. Examples of such cases have been observed + in practice. + + next code + + + Handles RunLengthDecode filter. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This interface defines logic which can be used to perform a custom copying + operation of a + + . + + + + Copies a page. + + Copies a page. + The new page must already be created before calling this, either in a new + + or in the same + + as the old page. + + the source page + the target page in a target document + + + Type of object to conform. + + + The interface generalizing the layer types (PdfLayer, PdfLayerMembership). + + + Gets the object representing the layer. + the object representing the layer + + + Gets the PdfIndirectReference that represents this layer. + the PdfIndirectReference that represents this layer + + + + An optional content group is a dictionary representing a collection of graphics + that can be made visible or invisible dynamically by users of viewer applications. + + + An optional content group is a dictionary representing a collection of graphics + that can be made visible or invisible dynamically by users of viewer applications. + In iText they are referenced as layers. +

    + To be able to be wrapped with this + + the + + must be indirect. +
    +
    + + Used for titling group of objects but not actually grouping them. + + + Creates a new layer by existing dictionary, which must be an indirect object. + the layer dictionary, must have an indirect reference. + + + Creates a new layer by its name and document. + the layer name + the PdfDocument which the layer belongs to + + + Creates a title layer. + + Creates a title layer. A title layer is not really a layer but a collection of layers + under the same title heading. + + the title text + the PdfDocument + the title layer + + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + That is, the state of at most one optional content group + in the array should be ON at a time: if one group is turned + ON, all others must be turned OFF. + + the PdfDocument + the radio group + + + Adds a child layer. + Adds a child layer. Nested layers can only have one parent. + the child layer + + + Gets the parent of this layer, be it a title layer, or a usual one. + the parent of the layer, or null if it has no parent + + + Sets the name of the layer to be displayed in the Layers panel. + the name of the layer. + + + Gets the initial visibility of the layer when the document is opened. + the initial visibility of the layer + + + Sets the initial visibility of the layer when the document is opened. + the initial visibility of the layer + + + Gets whether the layer is currently locked or not. + + Gets whether the layer is currently locked or not. If the layer is locked, + it will not be possible to change its state (on/off) in a viewer. + + true of the layer is currently locked, false otherwise. + + + Use this method to lock an optional content group. + + Use this method to lock an optional content group. + The state of a locked group cannot be changed through the user interface + of a viewer application. Producers can use this entry to prevent the visibility + of content that depends on these groups from being changed by users. + + + + Gets the layer visibility in Acrobat's layer panel + the layer visibility in Acrobat's layer panel + + + Sets the visibility of the layer in Acrobat's layer panel. + + Sets the visibility of the layer in Acrobat's layer panel. If false + the layer cannot be directly manipulated by the user. Note that any children layers will + also be absent from the panel. + + the visibility of the layer in Acrobat's layer panel + + + Gets a collection of current intents specified for this layer. + + Gets a collection of current intents specified for this layer. + The default value is PdfName.View, so it will be the only element of the + resultant colletion if no intents are currently specified. + + the collection of intents. + + + Sets the intents of the layer. + the list of intents. + + + + Used by the creating application to store application-specific + data associated with this optional content group. + + a text string specifying the application that created the group + + a string defining the type of content controlled by the group. Suggested + values include but are not limited to Artwork, for graphic-design or publishing + applications, and Technical, for technical designs such as building plans or + schematics + + + + + Specifies the language of the content controlled by this + optional content group + + + a language string which specifies a language and possibly a locale + (for example, es-MX represents Mexican Spanish) + + + used by viewer applications when there is a partial match but no exact + match between the system language and the language strings in all usage dictionaries + + + + + Specifies the recommended state for content in this + group when the document (or part of it) is saved by a viewer application to a format + that does not support optional content (for example, an earlier version of + PDF or a raster image format). + + the export state + + + + Specifies a range of magnifications at which the content + in this optional content group is best viewed. + + + the minimum recommended magnification factors at which the group + should be ON. A negative value will set the default to 0 + + + the maximum recommended magnification factor at which the group + should be ON. A negative value will set the largest possible magnification supported by the + viewer application + + + + + Specifies that the content in this group is intended for + use in printing + + + a name specifying the kind of content controlled by the group; + for example, Trapping, PrintersMarks and Watermark + + + indicates that the group should be + set to that state when the document is printed from a viewer application + + + + + Indicates that the group should be set to that state when the + document is opened in a viewer application. + + the view state + + + + Specifies one or more users for whom this optional content group + is primarily intended. + + a name that can be Ind (individual), Ttl (title), or Org (organization). + + one or more text strings representing + the name(s) of the individual, position or organization + + + + Indicates that the group contains a pagination artifact. + + one of the following names: "HF" (Header Footer), + "FG" (Foreground), "BG" (Background), or "L" (Logo). + + + + + Gets the indirect reference to the current layer object, + making it indirect first if necessary. + + the indirect reference to the object representing the layer + + + Gets the title of the layer if it is a title layer, or null if it is a usual layer. + + + Gets the list of the current child layers of the layer. + + Gets the list of the current child layers of the layer. + BE CAREFUL! Do not try to add a child layer using the resultant child list, + use #addChild method instead. + + the list of the current child layers, null if the layer has no children. + + + Creates a title layer without registering it in PdfOCProperties. + the title of the layer + the document this title layer belongs to + the created layer + + + Gets the /Usage dictionary, creating a new one if necessary. + the /Usage dictionary + + + + Content typically belongs to a single optional content group, + and is visible when the group is ON and invisible when it is OFF. + + + Content typically belongs to a single optional content group, + and is visible when the group is ON and invisible when it is OFF. To express more + complex visibility policies, content should not declare itself to belong to an optional + content group directly, but rather to an optional content membership dictionary + represented by this class. +

    + To be able to be wrapped with this + + the + + must be indirect. +
    +
    + + Creates a new, empty membership layer. + + + Creates a new PdfLayerMembership instance by its PdfDictionary, which must be an indirect object. + + the membership dictionary, must have an indirect reference. + + + Gets the collection of the layers this layer membership operates with. + + + Adds a new layer to the current layer membership. + the layer to be added + + + + Sets the visibility policy for content belonging to this + membership dictionary. + + + Sets the visibility policy for content belonging to this + membership dictionary. Possible values are AllOn, AnyOn, AnyOff and AllOff. + AllOn - Visible only if all of the entries are ON. + AnyOn - Visible if any of the entries are ON. + AnyOff - Visible if any of the entries are OFF. + AllOff - Visible only if all of the entries are OFF. + The default value is AnyOn. + + the visibility policy + + + + Gets the visibility policy for content belonging to this + optional content membership dictionary. + + + + + Sets the visibility expression for content belonging to this + membership dictionary. + + + A (nested) array of which the first value is /And, /Or, or /Not + followed by a series of indirect references to OCGs or other visibility + expressions. + + + + + Gets the visibility expression for content belonging to this + optional content membership dictionary. + + + + + This class represents /OCProperties entry if pdf catalog and manages + the layers of the pdf document. + + + This class represents /OCProperties entry if pdf catalog and manages + the layers of the pdf document. +

    + To be able to be wrapped with this + + the + + must be indirect. +
    +
    + + Creates a new PdfOCProperties instance. + the document the optional content belongs to + + + + Creates a new PdfOCProperties instance by the dictionary it represents, + the dictionary must be an indirect object. + + the dictionary of optional content properties, must have an indirect reference. + + + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + + + Use this method to set a collection of optional content groups + whose states are intended to follow a "radio button" paradigm. + That is, the state of at most one optional content group + in the array should be ON at a time: if one group is turned + ON, all others must be turned OFF. + + the radio group + + + Fills the underlying PdfDictionary object with the current layers and their settings. + + Fills the underlying PdfDictionary object with the current layers and their settings. + Note that it completely regenerates the dictionary, so your direct changes to the dictionary + will not take any affect. + + the resultant dictionary + + + Gets the list of all the layers currently registered in the OCProperties. + + Gets the list of all the layers currently registered in the OCProperties. + Note that this is just a new list and modifications to it will not affect anything. + + + + This method registers a new layer in the OCProperties. + the new layer + + + + Gets the order of the layers in which they will be displayed in the layer view panel, + including nesting. + + + + Populates the /AS entry in the /D dictionary. + + + Reads the layers from the document to be able to modify them in the future. + + + Reads the /Order in the /D entry and initialized the parent-child hierarchy. + + + + An array specifying a visibility expression, used to compute visibility + of content based on a set of optional content groups. + + + + Constructs a new PdfVisibilityExpression instance by its raw PdfArray. + the array representing the visibility expression + + + Creates a visibility expression. + should be either PdfName#And, PdfName#Or, or PdfName#Not + + + Adds a new operand to the current visibility expression. + the layer operand to be added. + + + Adds a new opeand to the current visibility expression. + the PdfVisibilityExpression instance operand to be added + + + Enumeration of all the PDF/A conformance levels. + + + A representation of an array as described in the PDF specification. + + A representation of an array as described in the PDF specification. A PdfArray can contain any + subclass of + + . + + + + If object is flushed the indirect reference is kept here. + + + Indicate same special states of PdfIndirectObject or PdfObject like @see Free, @see Reading, @see Modified. + + + + Gets object type. + object type. + + + Flushes the object to the document. + + + Flushes the object to the document. + indicates whether object can be placed into object stream. + + + Gets the indirect reference associated with the object. + + Gets the indirect reference associated with the object. + The indirect reference is used when flushing object to the document. + + indirect reference. + + + Checks if object is indirect. + + Checks if object is indirect. +
    + Note: + Return value + + doesn't necessarily mean that indirect reference of this object + is not null at the moment. Object could be marked as indirect and + be transformed to indirect on flushing. +
    + E.g. all PdfStreams are transformed to indirect objects when they are written, but they don't always + have indirect references at any given moment. +
    + + returns + + if object is indirect or is to be indirect in the resultant document. + +
    + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Indicates is the object has been flushed or not. + true if object has been flushed, otherwise false. + + + Indicates is the object has been set as modified or not. + Indicates is the object has been set as modified or not. Useful for incremental updates (e.g. appendMode). + + true is object has been set as modified, otherwise false. + + + Creates clone of the object which belongs to the same document as original object. + + Creates clone of the object which belongs to the same document as original object. + New object shall not be used in other documents. + + cloned object. + + + Copies object to a specified document. + + Copies object to a specified document. +

    + NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. +
    + document to copy object to. + copied object. +
    + + Copies object to a specified document. + + Copies object to a specified document. +

    + NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. +
    + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. +
    + + Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since the document opening. + + + Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since the document opening. +

    + This flag is meaningful only if the + + is opened in append mode + (see + + ). +

    +

    + In append mode the whole document is preserved as is, and only changes to the document are + appended to the end of the document file. Because of this, only modified objects need to be flushed and are + allowed to be flushed (i.e. to be written). +

    +
    + + this + + instance. + +
    + + + Checks if this PdfObject is of the type + PdfNull. + + true or false + + + + Checks if this PdfObject is of the type + PdfBoolean. + + true or false + + + + Checks if this PdfObject is of the type + PdfNumber. + + true or false + + + + Checks if this PdfObject is of the type + PdfString. + + true or false + + + + Checks if this PdfObject is of the type + PdfName. + + true or false + + + + Checks if this PdfObject is of the type + PdfArray. + + true or false + + + + Checks if this PdfObject is of the type + PdfDictionary. + + true or false + + + + Checks if this PdfObject is of the type + PdfStream. + + true or false + + + + Checks if this PdfObject is of the type + PdfIndirectReference. + + + true if this is an indirect reference, + otherwise false + + + + + Checks if this PdfObject is of the type + PdfLiteral. + + + true if this is a literal, + otherwise false + + + + Creates new instance of object. + new instance of object. + + + Checks state of the flag of current object. + special flag to check + true if the state was set. + + + Sets special states of current object. + special flag of current object + + + Clear state of the flag of current object. + special flag state to clear + + + Copies object content from object 'from'. + object to copy content from. + document to copy object to. + + + + Create a new, empty PdfArray. + + + + Create a new PdfArray with the provided PdfObject as the first item in the + array. + + first item in the array + + + Create a new PdfArray. + Create a new PdfArray. The array is filled with the items of the provided PdfArray. + + PdfArray containing items that will added to this PdfArray + + + Create a new PdfArray. + + Create a new PdfArray. The array is filled with the four values of the Rectangle in the + follozing order: left, bottom, right, top. + + Rectangle whose 4 values will be added to the PdfArray + + + Create a new PdfArray. + Create a new PdfArray. The PdfObjects in the list will be added to the PdfArray. + + List of PdfObjects to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the float[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the double[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the int[] as + + . + + values to be added to this PdfArray + + + + Create a new PdfArray filled with the values in the boolean[] as + + . + + values to be added to this PdfArray + + + Create a new PdfArray filled with a list of Strings. + + Create a new PdfArray filled with a list of Strings. The boolean value decides if the Strings + should be added as + + (true) or as + + (false). + + list of strings to be added to the list + indicates whether the strings should be added as PdfName (true) or as PdfString (false) + + + + + Returns an iterator over an array of PdfObject elements. +
    + NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get {@link PdfIndirectReference} instances for the indirect objects value, + you shall use {@link #get(int, boolean)} method. +
    + an enumerator. +
    + + + Returns an iterator over an array of PdfObject elements. + + + + Adds the Collection of PdfObjects. + the Collection of PdfObjects to be added + + + + + Adds content of the + PdfArray + . + + + the + PdfArray + to be added + + + + + Gets the (direct) PdfObject at the specified index. + index of the PdfObject in the PdfArray + the PdfObject at the position in the PdfArray + + + Sets the PdfObject at the specified index in the PdfArray. + the position to set the PdfObject + PdfObject to be added + true if the operation changed the PdfArray + + + + Adds the specified PdfObject at the specified index. + Adds the specified PdfObject at the specified index. All objects after this index will be shifted by 1. + + position to insert the PdfObject + PdfObject to be added + + + + Removes the PdfObject at the specified index. + position of the PdfObject to be removed + true if the operation changes the PdfArray + + + + Gets the first index of the specified PdfObject. + PdfObject to find the index of + index of the PdfObject + + + + Returns a sublist of this PdfArray, starting at fromIndex (inclusive) and ending at toIndex (exclusive). + + the position of the first element in the sublist (inclusive) + + the position of the last element in the sublist (exclusive) + + List of PdfObjects + + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + true is to extract direct object always. + + + Returns the element at the specified index as a PdfArray. + Returns the element at the specified index as a PdfArray. If the element isn't a PdfArray, null is returned. + + position of the element to be returned + the element at the index as a PdfArray + + + Returns the element at the specified index as a PdfDictionary. + Returns the element at the specified index as a PdfDictionary. If the element isn't a PdfDictionary, null is returned. + + position of the element to be returned + the element at the index as a PdfDictionary + + + Returns the element at the specified index as a PdfStream. + Returns the element at the specified index as a PdfStream. If the element isn't a PdfStream, null is returned. + + position of the element to be returned + the element at the index as a PdfStream + + + Returns the element at the specified index as a PdfNumber. + Returns the element at the specified index as a PdfNumber. If the element isn't a PdfNumber, null is returned. + + position of the element to be returned + the element at the index as a PdfNumber + + + Returns the element at the specified index as a PdfName. + Returns the element at the specified index as a PdfName. If the element isn't a PdfName, null is returned. + + position of the element to be returned + the element at the index as a PdfName + + + Returns the element at the specified index as a PdfString. + Returns the element at the specified index as a PdfString. If the element isn't a PdfString, null is returned. + + position of the element to be returned + the element at the index as a PdfString + + + Returns the element at the specified index as a PdfBoolean. + Returns the element at the specified index as a PdfBoolean. If the element isn't a PdfBoolean, null is returned. + + position of the element to be returned + the element at the index as a PdfBoolean + + + Returns the first four elements of this array as a PdfArray. + + Returns the first four elements of this array as a PdfArray. The first four values need to be + PdfNumbers, if not a PdfException will be thrown. + + Rectangle of the first four values + if one of the first values isn't a PdfNumber + + + + Release content of PdfArray. + + + Store a boolean value + value to store + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Use this method to get the Optional Content Properties Dictionary. + + Use this method to get the Optional Content Properties Dictionary. + Note that if you call this method, then the PdfDictionary with OCProperties will be + generated from PdfOCProperties object right before closing the PdfDocument, + so if you want to make low-level changes in Pdf structures themselves (PdfArray, PdfDictionary, etc), + then you should address directly those objects, e.g.: + + PdfCatalog pdfCatalog = pdfDoc.getCatalog(); + PdfDictionary ocProps = pdfCatalog.getAsDictionary(PdfName.OCProperties); + // manipulate with ocProps. + + Also note that this method is implicitly called when creating a new PdfLayer instance, + so you should either use hi-level logic of operating with layers, + or manipulate low-level Pdf objects by yourself. + + + true to create new /OCProperties entry in catalog if not exists, + false to return null if /OCProperties entry in catalog is not present. + + the Optional Content Properties Dictionary + + + PdfCatalog will be flushed in PdfDocument.close(). + PdfCatalog will be flushed in PdfDocument.close(). User mustn't flush PdfCatalog! + + + + This method sets a page layout of the document + + + + + + This method sets the document viewer preferences, specifying the way the document shall be displayed on the + screen + + + + + + This method gets Names tree from the catalog. + type of the tree (Dests, AP, EmbeddedFiles etc). + + returns + + + + + This method returns the NumberTree of Page Labels + + returns + + + + + An entry specifying the natural language, and optionally locale. + + An entry specifying the natural language, and optionally locale. Use this + to specify the Language attribute on a Tagged Pdf element. + For the content usage dictionary, use PdfName.Language + + + + + Sets collection dictionary that a conforming reader shall use to enhance the presentation of file attachments + stored in the PDF document. + + + + + + + True indicates that getOCProperties() was called, may have been modified, + and thus its dictionary needs to be reconstructed. + + + + this method return map containing all pages of the document with associated outlines. + + + + This methods adds new name to the Dests NameTree. + This methods adds new name to the Dests NameTree. It throws an exception, if the name already exists. + + Name of the destination. + + An object destination refers to. Must be an array or a dictionary with key /D and array. + See ISO 32000-1 12.3.2.3 for more info. + + + + This methods adds a new name to the specified NameTree. + This methods adds a new name to the specified NameTree. It throws an exception, if the name already exists. + + key in the name tree + value in the name tree + type of the tree (Dests, AP, EmbeddedFiles etc). + + + This method returns a complete outline tree of the whole document. + + if the flag is true, the method read the whole document and creates outline tree. + If false the method gets cached outline tree (if it was cached via calling getOutlines method before). + + + fully initialized + + object. + + + + Indicates if the catalog has any outlines + + + + , if there are outlines and + + otherwise. + + + + This flag determines if Outline tree of the document has been built via calling getOutlines method. + + This flag determines if Outline tree of the document has been built via calling getOutlines method. If this flag is false all outline operations will be ignored + + state of outline mode. + + + This method removes all outlines associated with a given page + + + + This method sets the root outline element in the catalog. + + + + This is the length of a dash. + + + This is the length of a gap. + + + This is the phase. + + + + + Constructs a + PdfDate + -object. + + + the date that has to be turned into a + PdfDate + >-object + + + + + Constructs a + PdfDate + -object, representing the current day and time. + + + + Gives the W3C format of the PdfDate. + a formatted date + + + + Gives the W3C format of the + PdfDate + . + + the date in the format D:YYYYMMDDHHmmSSOHH'mm' + a formatted date + + + + Converts a PDF string representing a date into a + DateTime + . + + the PDF string representing a date + + a + DateTime + representing the date + + + + + Beginning with BaseVersion 1.7, the extensions dictionary lets developers + designate that a given document contains extensions to PDF. + + + Beginning with BaseVersion 1.7, the extensions dictionary lets developers + designate that a given document contains extensions to PDF. The presence + of the extension dictionary in a document indicates that it may contain + developer-specific PDF properties that extend a particular base version + of the PDF specification. + The extensions dictionary enables developers to identify their own extensions + relative to a base version of PDF. Additionally, the convention identifies + extension levels relative to that base version. The intent of this dictionary + is to enable developers of PDF-producing applications to identify company-specific + specifications (such as this one) that PDF-consuming applications use to + interpret the extensions. + + + + An instance of this class for Adobe 1.7 Extension level 3. + + + An instance of this class for ETSI 1.7 Extension level 2. + + + An instance of this class for ETSI 1.7 Extension level 5. + + + The prefix used in the Extensions dictionary added to the Catalog. + + + The base version. + + + The extension level within the base version. + + + Creates a PdfDeveloperExtension object. + the prefix referring to the developer + the number of the base version + the extension level within the baseverion. + + + Gets the prefix name. + a PdfName + + + Gets the baseVersion name. + a PdfName + + + Gets the extension level within the baseVersion. + an integer + + + + Generations the developer extension dictionary corresponding + with the prefix. + + a PdfDictionary + + + A representation of a Dictionary as described by the PDF Specification. + + A representation of a Dictionary as described by the PDF Specification. A Dictionary is a mapping between keys + and values. Keys are + PdfNames + and the values are + PdfObjects + . Each key can only be associated with one value and + adding a new value to an existing key will override the previous value. A value of null should be ignored when + the PdfDocument is closed. + + + + Creates a new PdfDictionary instance. + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified Map into this + PdfDictionary instance. + + Map containing values to be inserted into PdfDictionary + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified Set into this + PdfDictionary instance. + + Set containing Map#Entries to be inserted into PdfDictionary + + + Creates a new PdfDictionary instance. + + Creates a new PdfDictionary instance. This constructor inserts the content of the specified PdfDictionary + into this PdfDictionary instance. + + PdfDictionary containing values to be inserted into PdfDictionary + + + Returns the number of key-value pairs in this PdfDictionary. + number of key-value pairs + + + Returns true if there are no key-value pairs in this PdfDictionary. + true if there are no key-value pairs in this PdfDictionary + + + Returns true if this PdfDictionary contains the specified key. + the key to check + true if key is present in the PdfDictionary + + + Returns true if this PdfDictionary contains the specified value. + the value to check + true if value is present in the PdfDictionary + + + Returns the value associated to this key. + the key of which the associated value needs to be returned + the value associated with this key + + + Returns the value associated to this key as a PdfArray. + Returns the value associated to this key as a PdfArray. If the value isn't a PdfArray, null is returned. + + the key of which the associated value needs to be returned + PdfArray associated with this key + + + Returns the value associated to this key as a PdfDictionary. + Returns the value associated to this key as a PdfDictionary. If the value isn't a PdfDictionary, null is returned. + + the key of which the associated value needs to be returned + PdfDictionary associated with this key + + + Returns the value associated to this key as a PdfStream. + Returns the value associated to this key as a PdfStream. If the value isn't a PdfStream, null is returned. + + the key of which the associated value needs to be returned + PdfStream associated with this key + + + Returns the value associated to this key as a PdfNumber. + Returns the value associated to this key as a PdfNumber. If the value isn't a PdfNumber, null is returned. + + the key of which the associated value needs to be returned + PdfNumber associated with this key + + + Returns the value associated to this key as a PdfName. + Returns the value associated to this key as a PdfName. If the value isn't a PdfName, null is returned. + + the key of which the associated value needs to be returned + PdfName associated with this key + + + Returns the value associated to this key as a PdfString. + Returns the value associated to this key as a PdfString. If the value isn't a PdfString, null is returned. + + the key of which the associated value needs to be returned + PdfString associated with this key + + + Returns the value associated to this key as a PdfBoolean. + Returns the value associated to this key as a PdfBoolean. If the value isn't a PdfBoolean, null is returned. + + the key of which the associated value needs to be returned + PdfBoolean associated with this key + + + Returns the value associated to this key as a Rectangle. + + Returns the value associated to this key as a Rectangle. If the value isn't a PdfArray of which the + firt four elements are PdfNumbers, null is returned. + + the key of which the associated value needs to be returned + PdfArray associated with this key + + + + Returns the value associated to this key as a Float. + Returns the value associated to this key as a Float. If the value isn't a Pdfnumber, null is returned. + + the key of which the associated value needs to be returned + Float associated with this key + + + Returns the value associated to this key as an Integer. + Returns the value associated to this key as an Integer. If the value isn't a Pdfnumber, null is returned. + + the key of which the associated value needs to be returned + Integer associated with this key + + + Returns the value associated to this key as a Boolean. + Returns the value associated to this key as a Boolean. If the value isn't a PdfBoolean, null is returned. + + the key of which the associated value needs to be returned + Boolean associated with this key + + + Inserts the value into this PdfDictionary and associates it with the specified key. + + Inserts the value into this PdfDictionary and associates it with the specified key. If the key is already + present in this PdfDictionary, this method will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + the previous PdfObject associated with this key + + + Removes the specified key from this PdfDictionary. + key to be removed + the removed value associated with the specified key + + + Inserts all the key-value pairs into this PdfDictionary. + PdfDictionary holding the key-value pairs to be copied + + + Removes all key-value pairs from this PdfDictionary. + + + Returns all the keys of this PdfDictionary as a Set. + Set of keys + + + Returns all the values of this map in a Collection. + + if false, collection will contain + + instances + for the indirect objects in dictionary, otherwise it will contain collection of direct objects. + + a Collection holding all the values + + + Returns all the values of this map in a Collection. + + Returns all the values of this map in a Collection. +
    + NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get + + instances for the indirect objects value, + you shall use + + method. +
    + a Collection holding all the values +
    + + Returns all the values of this map in a Collection. + + Returns all the values of this map in a Collection. In opposite to + + method, + this method will resolve all indirect references in the dictionary and return actual objects in collection. + + a Collection holding all the values + + + Returns a Set holding the key-value pairs as Map#Entry objects. + + Returns a Set holding the key-value pairs as Map#Entry objects. +
    + NOTE: since 7.0.1 it returns collection of direct objects. + If you want to get + + instances for the indirect objects value, + you shall use + + method. +
    + a Set of Map.Entry objects +
    + + Returns a Set holding the key-value pairs as Map#Entry objects. + + Returns a Set holding the key-value pairs as Map#Entry objects. In opposite to + + method, this method will resolve all indirect references in the dictionary and return actual objects as values of + entries in the collection. + + a Set of Map.Entry objects + + + Creates clones of the dictionary in the current document. + + Creates clones of the dictionary in the current document. + It's possible to pass a list of keys to exclude when cloning. + + list of objects to exclude when cloning dictionary. + cloned dictionary. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Copies dictionary to specified document. + + Copies dictionary to specified document. + It's possible to pass a list of keys to exclude when copying. + + document to copy dictionary to. + list of objects to exclude when copying dictionary. + + + + + copied dictionary. + + + true is to extract direct object always. + + + This method merges different fields from two dictionaries into the current one + a dictionary whose fields should be merged into the current dictionary. + + + Release content of PdfDictionary. + + + Main enter point to work with PDF document. + + + Currently active page. + + + Default page size. + + Default page size. + New page by default will be created with this size. + + + + PdfWriter associated with the document. + + PdfWriter associated with the document. + Not null if document opened either in writing or stamping mode. + + + + PdfReader associated with the document. + + PdfReader associated with the document. + Not null if document is opened either in reading or stamping mode. + + + + XMP Metadata for the document. + + + Document catalog. + + + Document trailed. + + + Document info. + + + Document version. + + + The ID entry that represents a change in a document. + + + The original second id when the document is read initially. + + + List of indirect objects used in the document. + + + flag determines whether to write unused objects to result document + + + Yet not copied link annotations from the other documents. + + Yet not copied link annotations from the other documents. + Key - page from the source document, which contains this annotation. + Value - link annotation from the source document. + + + + Open PDF document in reading mode. + PDF reader. + + + Open PDF document in writing mode. + + Open PDF document in writing mode. + Document has no pages when initialized. + + PDF writer + + + Opens PDF document in the stamping mode. + + Opens PDF document in the stamping mode. +
    +
    + PDF reader. + PDF writer. +
    + + Open PDF document in stamping mode. + PDF reader. + PDF writer. + properties of the stamping process + + + Use this method to set the XMP Metadata. + The xmpMetadata to set. + + + + + + + + + Gets XMPMetadata. + + + Gets XMPMetadata or create a new one. + if true, create a new empty XMPMetadata if it did not present. + existed or newly created XMPMetadata byte array. + + + Gets PdfObject by object number. + object number. + + + + or + + , if object not found. + + + + Get number of indirect objects in the document. + number of indirect objects. + + + Gets the page by page number. + page number. + page by page number. + + + + Gets the + + instance by + + . + + + + + that present page. + + + page by + + . + + + + Get the first page of the document. + first page of the document. + + + Gets the last page of the document. + last page. + + + Creates and adds new page to the end of document. + added page + + + Creates and adds new page with the specified page size. + page size of the new page + added page + + + Creates and inserts new page to the document. + position to addPage page to + inserted page + + in case + page + is flushed + + + + Creates and inserts new page to the document. + position to addPage page to + page size of the new page + inserted page + + in case + page + is flushed + + + + Adds page to the end of document. + page to add. + added page. + + in case + + is flushed + + + + Inserts page to the document. + position to addPage page to + page to addPage + inserted page + + in case + + is flushed + + + + Gets number of pages of the document. + number of pages. + + + Gets page number by page. + the page. + page number. + + + + Gets page number by + + . + + + + + that present page. + + + page number by + + . + + + + + Removes the first occurrence of the specified page from this document, + if it is present. + + + Removes the first occurrence of the specified page from this document, + if it is present. Returns true if this document + contained the specified element (or equivalently, if this document + changed as a result of the call). + + page to be removed from this document, if present + true if this document contained the specified page + + + Removes page from the document by page number. + the one-based index of the PdfPage to be removed + the page that was removed from the list + + + Gets document information dictionary. + document information dictionary. + + + Gets default page size. + default page size. + + + Sets default page size. + page size to be set as default. + + + + + + + + + + + + + + + + + + + + + + Gets + PdfWriter + associated with the document. + + PdfWriter associated with the document. + + + + Gets + PdfReader + associated with the document. + + PdfReader associated with the document. + + + + Returns + + if the document is opened in append mode, and + + otherwise. + + + + + if the document is opened in append mode, and + + otherwise. + + + + Creates next available indirect reference. + created indirect reference. + + + Gets PDF version. + PDF version. + + + Gets PDF catalog. + PDF catalog. + + + Close PDF document. + + + Gets close status of the document. + true, if the document has already been closed, otherwise false. + + + Gets tagged status of the document. + true, if the document has tag structure, otherwise false. + + + + Gets + + of tagged document. + + + + + in case tagged document, otherwise false. + + + + + + Gets next parent index of tagged document. + -1 if document is not tagged, or >= 0 if tagged. + + + + + + Gets document + TagStructureContext + . + The document must be tagged, otherwise an exception will be thrown. + + + document + TagStructureContext + . + + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + start of the range of pages to be copied. + end of the range of pages to be copied. + a document to copy pages to. + a position where to insert copied pages. + list of copied pages + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + a position where to insert copied pages. + a copier which bears a special copy logic. May be NULL + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + 1-based start of the range of pages to be copied. + 1-based end of the range of pages to be copied. + a document to copy pages to. + a copier which bears a special copy logic. May be null. + list of new copied pages. + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a position where to insert copied pages. + list of new copied pages + + + + Copies a range of pages from current document to + + . + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a position where to insert copied pages. + a copier which bears a special copy logic. May be NULL + list of new copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + list of copied pages + + + + Copies a range of pages from current document to + + appending copied pages to the end. + Use this method if you want to copy pages across tagged documents. + This will keep resultant PDF structure consistent. + + list of pages to be copied. TreeSet for the order of the pages to be natural. + a document to copy pages to. + a copier which bears a special copy logic + list of copied pages + + + + Checks, whether + + method will close associated PdfReader. + + + true, + + method is going to close associated PdfReader, otherwise false. + + + + + Sets, whether + + method shall close associated PdfReader. + + + true, + + method shall close associated PdfReader, otherwise false. + + + + + Checks, whether + + method will close associated PdfWriter. + + + true, + + method is going to close associated PdfWriter, otherwise false. + + + + + Sets, whether + + method shall close associated PdfWriter. + + + true, + + method shall close associated PdfWriter, otherwise false. + + + + + Checks, whether + + will flush unused objects, + e.g. unreachable from PDF Catalog. By default - false. + + + false, if + + shall not flush unused objects, otherwise true. + + + + + Sets, whether + + shall flush unused objects, + e.g. unreachable from PDF Catalog. + + + false, if + + shall not flush unused objects, otherwise true. + + + + This method returns a complete outline tree of the whole document. + + if the flag is true, the method read the whole document and creates outline tree. + If false the method gets cached outline tree (if it was cached via calling getOutlines method before). + + + fully initialize + + object. + + + + This method initializes an outline tree of the document and sets outline mode to true. + + + This methods adds new name in the Dests NameTree. + This methods adds new name in the Dests NameTree. It throws an exception, if the name already exists. + + Name of the destination. + + An object destination refers to. Must be an array or a dictionary with key /D and array. + See ISO 32000-1 12.3.2.3 for more info. + + + + Gets static copy of cross reference table. + + + Gets document trailer. + document trailer. + + + + Adds + + that shall specify the colour characteristics of output devices + on which the document might be rendered. + + + + + to add. + + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + An object to conform. + type of object to conform. + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + an object to conform. + type of object to conform. + + + + associated with an object to check. + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + + a + + object to conform. + + + + + associated with an object to check. + + + + Adds file attachment at document level. + the file description + an array with the file. + the actual file name stored in the pdf + mime type of the file + the optional extra file parameters such as the creation or modification date + + if + + , + + will be added. Shall be one of: + + , + + , + + , + + or + + . + + + + Adds file attachment at document level. + the file description + the path to the file. + the actual file name stored in the pdf + mime type of the file + + if + + , + + will be added. Shall be one of: + + , + + , + + , + + or + + . + + + + + Adds file attachment at document level. + the file description + + + + object. + + + + This method retrieves the page labels from a document as an array of String objects. + + + + list of page labels if they were found, or + + otherwise + + + + Indicates if the document has any outlines + + + + , if there are outlines and + + otherwise. + + + + Sets the flag indicating the presence of structure elements that contain user properties attributes. + + the user properties flag + + + The /ID entry of a document contains an array with two entries. + + The /ID entry of a document contains an array with two entries. The first one represents the initial document id. + The second one should be the same entry, unless the document has been modified. iText will by default generate + a modified id. But if you'd like you can set this id yourself using this setter. + + the new modified document id + + + + Create a new instance of + + or load already created one. + Note, PdfFont which created with + + won't be cached + until it will be added to + + or + + . + + + + Gets default font for the document: Helvetica, WinAnsi. + + Gets default font for the document: Helvetica, WinAnsi. + One instance per document. + + + instance of + + or + + on error. + + + + Gets list of indirect references. + list of indirect references. + + + Adds PdfFont without an checks + the same PdfFont instance. + + + + Initialize + + . + + + + Save the link annotation in a temporary storage for further copying. + + just copied + + link annotation belongs to. + + + + + itself. + + + + Checks whether PDF document conforms a specific standard. + + Checks whether PDF document conforms a specific standard. + Shall be override. + + + + + Mark an object with + + . + + an object to mark. + + + Flush an object. + object to flush. + indicates whether object can be placed into object stream. + on error. + + + Initializes document. + + new pdf version of the resultant file if stamper is used and the version needs to be changed, + or + + otherwise + + + + Adds custom XMP metadata extension. + Adds custom XMP metadata extension. Useful for PDF/UA, ZUGFeRD, etc. + + + + to add custom metadata to. + + + + Updates XMP metadata. + + Updates XMP metadata. + Shall be override. + + + + + Update XMP metadata values from + + . + + + + + List all newly added or loaded fonts + + List of + PdfFonts + . + + + + Checks page before adding and add. + one-base index of the page. + + + + to add. + + + + Checks page before adding. + + + + to add. + + + + checks whether a method is invoked at the closed document + + + + Gets + + instance. + + + + + instance. + + + + This method removes all annotation entries from form fields associated with a given page. + to remove from. + + + This method copies all given outlines + outlines to be copied + document where outlines should be copied + + + This method gets all outlines to be copied including parent outlines + current outline + a Set of outlines to be copied + + + This method copies create new outlines in the Document to copy. + - Set of outlines to be copied + - new parent outline + - old parent outline + + + + + + A structure storing documentId, object number and generation number. + + A structure storing documentId, object number and generation number. This structure is using to calculate + an unique object key during the copy process. + + + + Create a PdfDocumentInfo based on the passed PdfDictionary and linked to the passed PdfDocument. + PdfDictionary containing PdfDocumentInfo + PdfDocument the PdfDocumentInfo corresponds to. + + + Create a default, empty PdfDocumentInfo and link it to the passed PdfDocument + + + + Paulo Soares + Kazuya Ujihara + + + Creates the encryption. + + Creates the encryption. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + if the document is already open + + + Creates the certificate encryption. + + Creates the certificate encryption. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + the public certificates to be used for the encryption + the user permissions for each of the certificates + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. + + if the document is already open + + + Creates a PdfLiteral that contains an array of two id entries. + + Creates a PdfLiteral that contains an array of two id entries. These entries are both hexadecimal + strings containing 16 hex characters. The first entry is the original id, the second entry + should be different from the first one if the document has changed. + + the first id + whether the document has been changed or not + PdfObject containing the two entries. + + + Creates a PdfLiteral that contains an array of two id entries. + + Creates a PdfLiteral that contains an array of two id entries. These entries are both hexadecimal + strings containing 16 hex characters. The first entry is the original id, the second entry + should be different from the first one if the document has changed. + + the first id + the second id + PdfObject containing the two entries. + + + Gets the encryption permissions. + + Gets the encryption permissions. It can be used directly in + + . + See ISO 32000-1, Table 22 for more details. + + the encryption permissions, an unsigned 32-bit quantity. + + + Gets encryption algorithm and access permissions. + + + + document id which was used for encryption. Could be null, if encryption doesn't rely on document id. + + + + Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm. + + owner password of the encrypted document. + user password, or null if not a standard encryption handler was used. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + This class takes any PDF and returns exactly the same but + encrypted. + + + This class takes any PDF and returns exactly the same but + encrypted. All the content, links, outlines, etc, are kept. + It is also possible to change the info dictionary. + + + + Entry point to encrypt a PDF document. + the read PDF + the output destination + + encryption properties. See + + . + + + an optional + String + map to add or change + the info dictionary. Entries with + + values delete the key in the original info dictionary + + + + Entry point to encrypt a PDF document. + the read PDF + the output destination + + encryption properties. See + + . + + + + Give you a verbose analysis of the permissions. + the permissions value of a PDF file + a String that explains the meaning of the permissions value + + + Tells you if printing is allowed. + the permissions value of a PDF file + true if printing is allowed + + + Tells you if modifying content is allowed. + the permissions value of a PDF file + true if modifying content is allowed + + + Tells you if copying is allowed. + the permissions value of a PDF file + true if copying is allowed + + + Tells you if modifying annotations is allowed. + the permissions value of a PDF file + true if modifying annotations is allowed + + + Tells you if filling in fields is allowed. + the permissions value of a PDF file + true if filling in fields is allowed + + + Tells you if repurposing for screenreaders is allowed. + the permissions value of a PDF file + true if repurposing for screenreaders is allowed + + + Tells you if document assembly is allowed. + the permissions value of a PDF file + true if document assembly is allowed + + + Tells you if degraded printing is allowed. + the permissions value of a PDF file + true if degraded printing is allowed + + + Object number. + + + Object generation. + + + PdfObject that current PdfIndirectReference instance refers to. + + + Indirect reference number of object stream containing refersTo object. + + Indirect reference number of object stream containing refersTo object. + If refersTo is not placed into object stream - objectStreamNumber = 0. + + + + + Offset in a document of the + refersTo + object. + If the object placed into object stream then it is an object index inside object stream. + + + + PdfDocument object belongs to. + PdfDocument object belongs to. For direct objects it is null. + + + Gets direct object and try to resolve indirects chain. + + Gets direct object and try to resolve indirects chain. +

    + Note: If chain of references has length of more than 32, + this method return 31st reference in chain. +

    +
    +
    + + Gets refersTo object offset in a document. + object offset in a document. If refersTo object is in object stream then -1. + + + Gets refersTo object index in the object stream. + object index in a document. If refersTo object is not in object stream then -1. + + + Releases indirect reference from the document. + + Releases indirect reference from the document. Remove link to the referenced indirect object. +

    + Note: Be careful when using this method. Do not use this method for wrapper objects, + it can be cause of errors. + Free indirect reference could be reused for a new indirect object. +

    +
    +
    + + Gets a PdfWriter associated with the document object belongs to. + PdfWriter. + + + Gets a PdfReader associated with the document object belongs to. + PdfReader. + + + Sets special states of current object. + special flag of current object + + + PdfName for the abbreviation of FlateDecode. + + PdfName for the abbreviation of FlateDecode. For the Flatness Tolerance PdfName use + + (Uppercase 'L') + + + + PdfName for Flatness Tolerance. + + PdfName for Flatness Tolerance. For the PdfName with the FlateDecode abbreviation use + + (Lowercase 'L') + + + + map strings to all known static names + + + Create a PdfName from the passed string + + + + Create a PdfName from the passed bytes + + + + Compare this PdfName to o. + PdfName to compare this object to/ + Comparison between both values or, if one of the values is null, Comparison between contents. If one of the values and one of the contents are equal to null, generate values and compare those. + + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Creates the NameTree of current Document + Document catalog + the type of tree. Dests Tree, AP Tree etc. + + + Retrieves the names stored in the name tree + Map containing the PdfObjects stored in the tree + + + Add an entry to the name tree + key of the entry + object to add + + + True if the object has been modified, false otherwise. + + + Build a PdfDictionary containing the name tree + PdfDictionary containing the name tree + + + Representation of the null object in the PDF specification. + + + Creates a PdfNull instance. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Creates the NumberTree of current Document + Document catalog + the type of tree. ParentTree or PageLabels. + + + Representation of a stream as described in the PDF Specification. + + + + Constructs a + PdfStream + -object. + + + initial content of + PdfOutputStream + . + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Creates a PdfStream instance. + bytes to write to the PdfStream + + + Creates an efficient stream. + + Creates an efficient stream. No temporary array is ever created. The + InputStream + is totally consumed but is not closed. The general usage is: +

    +

    +            PdfDocument document = ?;
    +            InputStream in = ?;
    +            PdfStream stream = new PdfStream(document, in, PdfOutputStream.DEFAULT_COMPRESSION);
    +            ?
    +            stream.flush();
    +            in.close();
    +            
    +
    + the data to write to this stream + the compression level (0 = best speed, 9 = best compression, -1 is default) + +
    + + Creates an efficient stream. + + Creates an efficient stream. No temporary array is ever created. The + InputStream + is totally consumed but is not closed. The general usage is: +

    +

    +            PdfDocument document = ?;
    +            InputStream in = ?;
    +            PdfStream stream = new PdfStream(document, in);
    +            stream.flush();
    +            in.close();
    +            
    +
    + the data to write to this stream +
    + + + Constructs a + PdfStream + -object. + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Creates an empty PdfStream instance. + + + Gets output stream. + output stream + + + Gets compression level of this PdfStream. + + Gets compression level of this PdfStream. + For more details @see + + . + + compression level. + + + Sets compression level of this PdfStream. + + Sets compression level of this PdfStream. + For more details @see + + . + + the compression level (0 = best speed, 9 = best compression, -1 is default) + + + + Gets decoded stream bytes. + byte[] + + + Gets stream bytes. + true if to get decoded stream bytes, otherwise false. + + byte content of the + PdfStream + . Byte content will be + + , + if the + PdfStream + was created by + InputStream + . + + + + Sets bytes as stream's content. + + Sets bytes as stream's content. + Could not be used with streams which were created by InputStream. + + new content for stream; if null then stream's content will be discarded + + + Sets or appends bytes to stream content. + + Sets or appends bytes to stream content. + Could not be used with streams which were created by InputStream. + + + New content for stream. These bytes are considered to be a raw data (i.e. not encoded/compressed/encrypted) + and if it's not true, the corresponding filters shall be set to the PdfStream object manually. + Data compression generally should be configured via + + and + is handled on stream writing to the output document. + If null and append is false then stream's content will be discarded. + + + If set to true then bytes will be appended to the end, + rather then replace original content. The original content will be decoded if needed. + + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + Update length manually in case its correction. + + Update length manually in case its correction. + PdfReader.checkPdfStreamLength() + method. + + + + Release content of PdfStream. + + + Max number of objects in object stream. + + + Current object stream size (number of objects inside). + + + Stream containing object indices, a heading part of object stream. + + + This constructor is for reusing ByteArrayOutputStreams of indexStream and outputStream. + + This constructor is for reusing ByteArrayOutputStreams of indexStream and outputStream. + NOTE Only for internal use in PdfWriter! + + previous PdfObjectStream. + + + Adds object to the object stream. + object to add. + + + Gets object stream size (number of objects inside). + object stream size. + + + + Document outline object + See ISO-320001, 12.3.3 Document Outline. + + + + A flag for displaying the outline item’s text with italic font. + + + A flag for displaying the outline item’s text with bold font. + + + Create instance of document outline. + the text that shall be displayed on the screen for this item. + Outline dictionary + + + + the outline belongs to. + + + + Create instance of document outline. + the text that shall be displayed on the screen for this item. + Outline dictionary + parent outline. + + + This constructor creates root outline in the document. + + + + + + + Gets title of the outline. + String value. + + + + Sets title of the outline with + + encoding, + Title + key. + + String value. + + + + Sets color for the outline entry’s text, + C + key. + + + + + + + + + Sets text style for the outline entry’s text, + F + key. + + + Could be either + + or + + . Default value is + 0 + . + + + + Gets content dictionary. + + + + . + + + + Gets list of children outlines. + + List of + + . + + + + Gets parent outline. + + + + . + + + + + Gets + + . + + + + + . + + + + + Adds + + for the outline, + Dest + key. + + + instance of + + . + + + + + Adds + + for the outline, + A + key. + + + instance of + + . + + + + Defines if the outline needs to be closed or not. + + Defines if the outline needs to be closed or not. + By default, outlines are open. + + if false, the outline will be closed by default + + + + Adds a new + PdfOutline + with specified parameters as a child to existing + PdfOutline + and put it to specified position in the existing + PdfOutline + children list. + + an outline title + + a position in the current outline child List where a new outline should be added. + If the position equals -1, then the outline will be put in the end of children list. + + just created outline + + + + Adds an + PdfOutline + as a child to existing + PdfOutline + and put it in the end of the existing + PdfOutline + children list. + + an outline title + just created outline + + + + Adds an + PdfOutline + as a child to existing + PdfOutline + and put it to the end of the existing + PdfOutline + children list. + + an outline to add. + just created outline + + + Clear list of children. + + + + Sets + + . + + + instance of + + . + + + + Remove this outline from the document. + + + + Specify the colour characteristics of output devices on which the document might be rendered + See ISO 32000-1 14.11.5: Output Intents. + + + + Creates output intent dictionary. + + Creates output intent dictionary. Null values are allowed to + suppress any key. + By default output intent subtype is GTS_PDFA1, use setter to change it. + + + + Document associated with PdfOutputStream. + + + Contains the business logic for cryptography. + + + Create a pdfOutputSteam writing to the passed OutputStream. + Outputstream to write to. + + + Write a PdfObject to the outputstream. + PdfObject to write + this PdfOutPutStream + + + Automatically rotate new content if the page has a rotation ( is disabled by default ) + + + + See + + . + + + + Gets page size, defined by media box object. + Gets page size, defined by media box object. This method doesn't take page rotation into account. + + + + + that specify page size. + + + + Gets page size, considering page rotation. + + + + that specify size of rotated page. + + + + Gets the number of degrees by which the page shall be rotated clockwise when displayed or printed. + + + Gets the number of degrees by which the page shall be rotated clockwise when displayed or printed. + Shall be a multiple of 90. + + + + int + number of degrees. Default value: 0 + + + + Sets the page rotation. + + the + int + number of degrees by which the page shall be rotated clockwise + when displayed or printed. Shall be a multiple of 90. + + + this + + instance. + + + + + Gets the content stream at specified 0-based index in the Contents object + + . + The situation when Contents object is a + + is treated like a one element array. + + + the + int + index of returned + + . + + + + + object at specified index. + + if the index is out of range + + + + Gets the size of Contents object + + . + The situation when Contents object is a + + is treated like a one element array. + + + the + int + size of Contents object, or 1 if Contents object is a + + . + + + + + Returns the Contents object if it is + + , or first stream in the array if it is + + . + + + first + + in Contents object, or + + if Contents is empty. + + + + + Returns the Contents object if it is + + , or last stream in the array if it is + + . + + + first + + in Contents object, or + + if Contents is empty. + + + + + Creates new + + object and puts it at the beginning of Contents array + (if Contents object is + + it will be replaced with one-element array). + + + Created + + object. + + + + + Creates new + + object and puts it at the end of Contents array + (if Contents object is + + it will be replaced with one-element array). + + + Created + + object. + + + + + Gets the + + wrapper object for this page resources. + If page doesn't have resource object, then it will be inherited from page's parents. + If neither parents nor page has the resource object, then the new one is created and added to page dictionary. +

    + NOTE: If you'll try to modify the inherited resources, then the new resources object will be created, + so you won't change the parent's resources. + This new object under the wrapper will be added to page dictionary on + + , + or you can add it manually with this line, if needed:
    + getPdfObject().put(PdfName.Resources, getResources().getPdfObject()); +
    + + + + wrapper of the page. + +
    + + + Sets + + object. + + + + + to set. + + + this + + instance. + + + + Sets the XMP Metadata. + + the + byte[] + of XMP Metadata to set. + + in case of writing error. + + + Serializes XMP Metadata to byte array and sets it. + + the + + object to set. + + + the + + used while serialization. + + in case of XMP Metadata serialization error. + in case of writing error. + + + Serializes XMP Metadata to byte array and sets it. + Serializes XMP Metadata to byte array and sets it. Uses padding equals to 2000. + + the + + object to set. + + in case of XMP Metadata serialization error. + in case of writing error. + + + Gets the XMP Metadata object. + + + + object, that represent XMP Metadata. + + + + + Copies page to the specified document. + + Copies page to the specified document. +

    + NOTE: Works only for pages from the document opened in reading mode, otherwise an exception is thrown. +
    + a document to copy page to. + + copied + + . + +
    + + Copies page to the specified document. + + Copies page to the specified document. +

    + NOTE: Works only for pages from the document opened in reading mode, otherwise an exception is thrown. +
    + a document to copy page to. + + a copier which bears a specific copy logic. May be + + + + copied + + . + +
    + + Copies page as FormXObject to the specified document. + a document to copy to. + + copied + + object. + + + + + + Gets the + + that owns that page, or + + if such document isn't exist. + + + + + that owns that page, or + + if such document isn't exist. + + + + Flushes page and it's content stream. + + Flushes page and it's content stream. +
    +
    + If the page belongs to the document which is tagged, page flushing also triggers flushing of the tags, + which are considered to belong to the page. The logic that defines if the given tag (structure element) belongs + to the page is the following: if all the marked content references (dictionary or number references), that are the + descenders of the given structure element, belong to the current page - the tag is considered + to belong to the page. If tag has descenders from several pages - it is flushed, if all other pages except the + current one are flushed. +
    +
    + + Flushes page and its content stream. + + Flushes page and its content stream. If flushResourcesContentStreams is true, all content streams that are + rendered on this page (like FormXObjects, annotation appearance streams, patterns) and also all images associated + with this page will also be flushed. +
    + For notes about tag structure flushing see + PdfPage#flush() method + . +
    +
    + If PdfADocument is used, flushing will be applied only if flushResourcesContentStreams is true. +
    + + if true all content streams that are rendered on this page (like form xObjects, + annotation appearance streams, patterns) and also all images associated with this page + will be flushed. + +
    + + + Gets + + object specified by page's Media Box, that defines the boundaries of the physical medium + on which the page shall be displayed or printed + + + + + object specified by page Media Box, expressed in default user space units. + + in case of any error while reading MediaBox object. + + + + Sets the Media Box object, that defines the boundaries of the physical medium + on which the page shall be displayed or printed. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + specified by page's CropBox, that defines the visible region of default user space. + When the page is displayed or printed, its contents shall be clipped (cropped) to this rectangle + and then shall be imposed on the output medium in some implementation-defined manner. + + + the + + object specified by pages's CropBox, expressed in default user space units. + MediaBox by default. + + + + Sets the CropBox object, that defines the visible region of default user space. + + Sets the CropBox object, that defines the visible region of default user space. + When the page is displayed or printed, its contents shall be clipped (cropped) to this rectangle + and then shall be imposed on the output medium in some implementation-defined manner. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Sets the BleedBox object, that defines the region to which the contents of the page shall be clipped + when output in a production environment. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + object specified by page's BleedBox, that define the region to which the + contents of the page shall be clipped when output in a production environment. + + + the + + object specified by page's BleedBox, expressed in default user space units. + CropBox by default. + + + + + Sets the ArtBox object, that define the extent of the page’s meaningful content + (including potential white space) as intended by the page’s creator. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + object specified by page's ArtBox, that define the extent of the page’s + meaningful content (including potential white space) as intended by the page’s creator. + + + the + + object specified by page's ArtBox, expressed in default user space units. + CropBox by default. + + + + Sets the TrimBox object, that define the intended dimensions of the finished page after trimming. + + + the + + object to set, expressed in default user space units. + + + this + + instance. + + + + + Gets the + + object specified by page's TrimBox object, + that define the intended dimensions of the finished page after trimming. + + + the + + object specified by page's TrimBox, expressed in default user space units. + CropBox by default. + + + + Get decoded bytes for the whole page content. + byte array. + + in case of any + IOException). + + + + Gets decoded bytes of a certain stream of a page content. + index of stream inside Content. + byte array. + + in case of any + IOException). + + + + Calculates and returns next available MCID reference. + calculated MCID reference. + in case of not tagged document. + + + + Gets + + key of the page’s entry in the structural parent tree. + + + + + key of the page’s entry in the structural parent tree. + + + + Helper method to add an additional action to this page. + + Helper method to add an additional action to this page. + May be used in chain. + + + a + + specifying the name of an additional action + + + the + + to add as an additional action + + + this + + instance. + + + + + Checks if page contains the specified annotation. + + the + + to check. + + + + + if page contains specified annotation and + + otherwise. + + + + Adds specified annotation to the end of annotations array and tagged it. + + Adds specified annotation to the end of annotations array and tagged it. + May be used in chain. + + + the + + to add. + + + this + + instance. + + + + + Adds specified + + to specified index in annotations array with or without autotagging. + May be used in chain. + + + the index at which specified annotation will be added. If + -1 + then annotation will be added + to the end of array. + + + the + + to add. + + + if + + the added annotation will be autotagged.
    + (see + + ) + + + this + + instance. + +
    + + Removes an annotation from the page. + + Removes an annotation from the page. +

    + NOTE: If document is tagged, PdfDocument's PdfTagStructure instance will point at annotation tag parent after method call. +
    + an annotation to be removed. + + this + + instance. + +
    + + + Gets the number of + + associated with this page. + + + the + int + number of + + associated with this page. + + + + This method gets outlines of a current page + + return all outlines of a current page + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + this + + instance. + + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + The value of the numeric portion for the first page label in the range. Must be greater or + equal 1. + + + this + + instance. + + + + + true - if in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. On the rotated page this would look like if new content ignores page rotation. + + + + + If true - defines that in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. + + + If true - defines that in case the page has a rotation, then new content will be automatically rotated in the + opposite direction. On the rotated page this would look like if new content ignores page rotation. + Default value - + + . + + - true to ignore rotation of the new content on the rotated page. + + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + this + + instance. + + + + This method adds or replaces a page label. + + The numbering style that shall be used for the numeric portion of each page label. + May be NULL + + The label prefix for page labels in this range. May be NULL + + The value of the numeric portion for the first page label in the range. Must be greater or + equal 1. + + + this + + instance. + + + + Sets a name specifying the tab order that shall be used for annotations on the page. + + Sets a name specifying the tab order that shall be used for annotations on the page. + The possible values are + + (row order), + + (column order), and + + (structure order). + See ISO 32000 12.5, "Annotations" for details. + + + a + + specifying the annotations tab order. See method description for the allowed values. + + + this + + instance. + + + + Gets a name specifying the tab order that shall be used for annotations on the page. + + Gets a name specifying the tab order that shall be used for annotations on the page. + The possible values are + + (row order), + + (column order), and + + (structure order). + See ISO 32000 12.5, "Annotations" for details. + + + a + + specifying the annotations tab order or null if tab order is not defined. + + + + + Helper method that associate specified value with specified key in the underlined + + . + May be used in chain. + + + the + + key with which the specified value is to be associated. + + + the + + value to be associated with the specified key. + + + this + + object. + + + + + This flag is meaningful for the case, when page rotation is applied and ignorePageRotationForContent + is set to true. + + + This flag is meaningful for the case, when page rotation is applied and ignorePageRotationForContent + is set to true. NOTE: It is needed for the internal usage. +

    + This flag defines if inverse matrix (which rotates content into the opposite direction from page rotation + direction in order to give the impression of the not rotated text) is already applied to the page content stream. + See + +
    + true, if inverse matrix is already applied, false otherwise. +
    + + NOTE: For internal usage! Use this method only if you know what you are doing. + + NOTE: For internal usage! Use this method only if you know what you are doing. +

    + This method is called when inverse matrix (which rotates content into the opposite direction from page rotation + direction in order to give the impression of the not rotated text) is applied to the page content stream. + See + +
    +
    + + + Algorithm for construction + + tree + + + + Create PdfPages tree. + + + PdfCatalog + + + + + Returns the + PdfPage + at the specified position in this list. + + one-based index of the element to return + + the + PdfPage + at the specified position in this list + + + + + Returns the + PdfPage + by page's PdfDictionary. + + page's PdfDictionary + + the + PdfPage + object, that wraps + + . + + + + Gets total number of @see PdfPages. + total number of pages + + + + Returns the index of the first occurrence of the specified page + in this tree, or 0 if this tree does not contain the page. + + + + + Returns the index of the first occurrence of the page in this tree + specified by it's PdfDictionary, or 0 if this tree does not contain the page. + + + + + Appends the specified + PdfPage + to the end of this tree. + + + + PdfPage + + + + + Insert + PdfPage + into specific one-based position. + + one-base index of the page + + + + to insert. + + + + Removes the page at the specified position in this tree. + + Removes the page at the specified position in this tree. + Shifts any subsequent elements to the left (subtracts one from their + indices). + + the one-based index of the PdfPage to be removed + the page that was removed from the list + + + Generate PdfPages tree. + + root + + + in case empty document + + + Reads a PDF document. + + + Constructs a new PdfReader. + source of bytes for the reader + properties of the created reader + + + + Reads and parses a PDF document. + + the + InputStream + containing the document. The stream is read to the + end but is not closed + + properties of the created reader + on error + + + Reads and parses a PDF document. + + the + InputStream + containing the document. Stream is closed automatically, when document is closed, + if user doesn't want to close stream, he should set closeStream=false; + + on error + + + Reads and parses a PDF document. + the file name of the document + properties of the created reader + on error + + + Reads and parses a PDF document. + the file name of the document + on error + + + + Close + + . + + on error. + + + + The iText is not responsible if you decide to change the + value of this parameter. + + + + + Gets whether + + method shall close input stream. + + + true, if + + method will close input stream, + otherwise false. + + + + + Sets whether + + method shall close input stream. + + + true, if + + method shall close input stream, + otherwise false. + + + + If any exception generated while reading XRef section, PdfReader will try to rebuild it. + true, if PdfReader rebuilt Cross-Reference section. + + + + Some documents contain hybrid XRef, for more information see "7.5.8.4 Compatibility with Applications + That Do Not Support Compressed Reference Streams" in PDF 32000-1:2008 spec. + + true, if the document has hybrid Cross-Reference section. + + + Indicates whether the document has Cross-Reference Streams. + true, if the document has Cross-Reference Streams. + + + If any exception generated while reading PdfObject, PdfReader will try to fix offsets of all objects. + + true, if PdfReader fixed offsets of PdfObjects. + + + Gets position of the last Cross-Reference table. + -1 if Cross-Reference table has rebuilt, otherwise position of the last Cross-Reference table. + + + Reads, decrypt and optionally decode stream bytes. + + Reads, decrypt and optionally decode stream bytes. + Note, this method doesn't store actual bytes in any internal structures. + + true if to get decoded stream bytes, false if to leave it originally encoded. + byte[] array. + on error. + + + Reads and decrypt stream bytes. + + Reads and decrypt stream bytes. + Note, this method doesn't store actual bytes in any internal structures. + + byte[] array. + on error. + + + + Reads, decrypt and optionally decode stream bytes into + + . + User is responsible for closing returned stream. + + true if to get decoded stream, false if to leave it originally encoded. + + InputStream or + + if reading was failed. + + on error. + + + Decode bytes applying the filters specified in the provided dictionary using default filter handlers. + + the bytes to decode + the dictionary that contains filter information + the decoded bytes + if there are any problems decoding the bytes + + + Decode a byte[] applying the filters specified in the provided dictionary using the provided filter handlers. + + the bytes to decode + the dictionary that contains filter information + the map used to look up a handler for each type of filter + the decoded bytes + if there are any problems decoding the bytes + + + + Gets a new file instance of the original PDF + document. + + a new file instance of the original PDF document + + + Provides the size of the opened file. + The size of the opened file. + on error. + + + + Checks if the document was opened with the owner password so that the end application + can decide what level of access restrictions to apply. + + + Checks if the document was opened with the owner password so that the end application + can decide what level of access restrictions to apply. If the document is not encrypted + it will return + + . + + + + + if the document was opened with the owner password or if it's not encrypted, + + if the document was opened with the user password. + + + + Gets the encryption permissions. + + Gets the encryption permissions. It can be used directly in + + . + See ISO 32000-1, Table 22 for more details. + + the encryption permissions, an unsigned 32-bit quantity. + + + Gets encryption algorithm and access permissions. + + + + Gets the declared Pdf/A conformance level of the source document that is being read. + + Gets the declared Pdf/A conformance level of the source document that is being read. + Note that this information is provided via XMP metadata and is not verified by iText. + + + conformance level of the source document, or + + if no Pdf/A + conformance level information is specified. + + + + Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 encryption algorithm. + + user password, or null if not a standard encryption handler was used or if ownerPasswordUsed wasn't use to open the document. + + + + + Gets file ID, either + + key of trailer or a newly generated id. + + byte array represents file ID. + + + + Parses the entire PDF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Utility method that checks the provided byte source to see if it has junk bytes at the beginning. + + + Utility method that checks the provided byte source to see if it has junk bytes at the beginning. If junk bytes + are found, construct a tokeniser that ignores the junk. Otherwise, construct a tokeniser for the byte source as it is + + the source to check + a tokeniser that is guaranteed to start at the PDF header + if there is a problem reading the byte source + + + + + + + + + + Wrapper class that represent resource dictionary - that define named resources + used by content streams operators. + + + Wrapper class that represent resource dictionary - that define named resources + used by content streams operators. (ISO 32000-1, 7.8.3 Resource Dictionaries) + + + + Creates new instance from given dictionary. + + the + + object from which the resource object will be created. + + + + Creates new instance from empty dictionary. + + + Adds font to resources and register PdfFont in the document for further flushing. + added font resource name. + + + + Adds + + object to the resources. + + + the + + to add. + + added image resource name. + + + + Adds + + to the resources as image. + + + the + + to add. + + added image resources name. + + + + Adds + + to the resources as image. + + + the + + to add. Should be + + . + + added image resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added form resource name. + + + + Adds + + to the resources as form. + + + the + + to add. + + added form resources name. + + + + Adds + + to the resources as form. + + + the + + to add. Should be + + . + + added form resources name. + + + + Adds the given Form XObject to the current instance of + + . + + Form XObject. + Preferred name for the given Form XObject. + + the + + of the newly added resource + + + + + Adds + + object to the resources. + + + the + + to add. + + added graphics state parameter dictionary resource name. + + + + Adds + + to the resources as graphics state parameter dictionary. + + + the + + to add. + + added graphics state parameter dictionary resources name. + + + + Adds + + to the resources as graphics state parameter dictionary. + + + the + + to add. Should be + + . + + added graphics state parameter dictionary resources name. + + + + Adds + + to the resources as properties list. + + + the + + to add. + + added properties list resources name. + + + + Adds + + to the resources as properties list. + + + the + + to add. Should be + + . + + added properties list resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added color space resource name. + + + + Adds + + to the resources as color space. + + + the + + to add. + + added color space resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added pattern resource name. + + + + Adds + + to the resources as pattern. + + + the + + to add. + + added pattern resources name. + + + + Adds + + to the resources as pattern. + + + the + + to add. Should be + + or + + . + + added pattern resources name. + + + + Adds + + object to the resources. + + + the + + to add. + + added shading resource name. + + + + Adds + + to the resources as shading dictionary. + + + the + + to add. + + added shading dictionary resources name. + + + + Adds + + to the resources as shading dictionary. + + + the + + to add. Should be + + or + + . + + added shading dictionary resources name. + + + Sets the default color space (see ISO-320001 Paragraph 8.6.5.6). + + the name of Default Color Space. Should be + + , + + , or + + . + + the value of the default color space to be set. + + + Sets the value of default Gray Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + Sets the value of default RGB Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + Sets the value of default CMYK Color Space (see ISO-320001 Paragraph 8.6.5.6). + the color space to set. + + + + + Gets the names of all the added resources. + the name of all the added resources. + + + Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). + the array of predefined procedure set names. + + + Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). + the array of predefined procedure set names to be set. + + + Gets the names of all resources of specified type. + + the resource type. Should be + + , + + , + + , + + , + + , + + . + + + set of resources name of corresponding type. May be empty. + Will be empty in case of incorrect resource type. + + + + + Get the + + object that that contain resources of specified type. + + + the resource type. Should be + + , + + , + + , + + , + + , + + . + + + the + + object containing all resources of specified type, + or + + in case of incorrect resource type. + + + + + Get the + + object with specified type and name. + + + the resource type. Should be + + , + + , + + , + + , + + , + + . + + the name of the resource object. + + the + + with specified name in the resources of specified type or + + in case of incorrect type or missing resource with such name. + + + + Represents a resource name generator. + + Represents a resource name generator. The generator takes into account + the names of already existing resources thus providing us a unique name. + The name consists of the following parts: prefix (literal) and number. + + + + + Constructs an instance of + + class. + + + Type of resource. Should be + + , + + , + + , + + , + + , + + . + + Prefix used for generating names. + + Seed for the value which is appended to the number each time + new name is generated. + + + + + Constructs an instance of + + class. + + + Type of resource. Should be + + , + + , + + , + + , + + , + + . + + Prefix used for generating names. + + + Gets the resource type of generator. + + Type of resource. May be + + , + + , + + , + + , + + , + + . + + + + Generates new (unique) resource name. + + the + + object for which name will be generated. + + new (unique) resource name. + + + + A + PdfString + -class is the PDF-equivalent of a + JAVA- + String + -object. +

    + A string is a sequence of characters delimited by parenthesis. + If a string is too long to be conveniently placed on a single line, it may + be split across multiple lines by using the backslash character (\) at the + end of a line to indicate that the string continues on the following line. + Within a string, the backslash character is used as an escape to specify + unbalanced parenthesis, non-printing ASCII characters, and the backslash + character itself. Use of the \ddd escape sequence is the preferred + way to represent characters outside the printable ASCII character set.
    + This object is described in the 'Portable Document Format Reference Manual + version 1.7' section 3.2.3 (page 53-56). +

    + +

    +
    + + Only PdfReader can use this method! + + + Gets the encoding of this string. + + + Sets the encoding of this string. + + Sets the encoding of this string. + NOTE. Byte content will be removed. + + + + + Returns the Unicode + String + value of this + PdfString + -object. + + + + Gets bytes of String-value considering encoding. + byte array + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Marks object to be saved as indirect. + a document the indirect reference will belong to. + object itself. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + copied object. + + + Copies object to a specified document. + + Copies object to a specified document. + Works only for objects that are read from existing document, otherwise an exception is thrown. + + document to copy object to. + + indicates if to allow copy objects which already have been copied. + If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. + If allowDuplicating is true then object will be copied and new indirect reference will be assigned. + + copied object. + + + + Decrypt content of an encrypted + PdfString + . + + + + + Encrypt content of + value + and set as content. + generateContent() + won't be called. + + @see PdfEncryption + true if value was encrypted, otherwise false. + + + Escape special symbols or convert to hexadecimal string. + + Escape special symbols or convert to hexadecimal string. + This method don't change either + value + or + content + ot the + PdfString + . + + byte array to manipulate with. + Hexadecimal string or string with escaped symbols in byte array view. + + + + + Adds content of the + PdfArray + . + + + the + PdfArray + to be added + + + + + Adds the Collection of PdfObjects. + the Collection of PdfObjects to be added + + + + This class represents all official PDF versions. + + + Creates a PdfVersion class. + major version number + minor version number + + + + Creates a PdfVersion class from a String object if the specified version + can be found. + + version number + PdfVersion of the specified version + + + + Creates a PdfVersion class from a + + object if the specified version + can be found. + + version number + PdfVersion of the specified version + + + This method sets HideToolBar flag to true or false + + + + + This method sets HideMenuBar flag to true or false + + + + + This method sets HideWindowUI flag to true or false + + + + + This method sets FitWindow flag to true or false + + + + + This method sets CenterWindow flag to true or false + + + + + This method sets DisplayDocTitle flag to true or false + + + + + This method sets NonFullScreenPageMode property. + + This method sets NonFullScreenPageMode property. Allowed values are UseNone, UseOutlines, useThumbs, UseOC. + This entry is meaningful only if the value of the PageMode entry in the Catalog dictionary is FullScreen + + + + + + This method sets predominant reading order of text. + + + + + + This method sets the name of the page boundary representing the area of a page that shall be displayed when + viewing the document on the screen. + + + + + + + This method sets the name of the page boundary to which the contents of a page shall be clipped when + viewing the document on the screen. + + + + + + + This method sets the name of the page boundary representing the area of a page that shall be + rendered when printing the document. + + + + + + + This method sets the name of the page boundary to which the contents of a page shall be clipped when + printing the document. + + + + + + + This method sets the page scaling option that shall be selected when a print dialog is displayed for this + document. + + + This method sets the page scaling option that shall be selected when a print dialog is displayed for this + document. Valid values are None and AppDefault. + + + + + + This method sets the paper handling option that shall be used when printing the file from the print dialog. + + + This method sets the paper handling option that shall be used when printing the file from the print dialog. + The following values are valid: Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge. + + + + + + This method sets PickTrayByPDFSize flag to true or false. + + + + + This method sets the page numbers used to initialize the print dialog box when the file is printed. + + + + + + This method sets the number of copies that shall be printed when the print dialog is opened for this file. + + + + + + Currently active object stream. + + Currently active object stream. + Objects are written to the object stream if fullCompression set to true. + + + + Is used to avoid duplications on object copying. + + Is used to avoid duplications on object copying. + It stores hashes of the indirect reference from the source document and the corresponding + indirect references of the copied objects from the new document. + + + + Is used in smart mode to store serialized objects content. + + + Create a PdfWriter writing to the passed outputstream and with default writer properties. + Outputstream to write too. + + + Create a PdfWriter writing to the passed filename and with default writer properties. + filename of the resulting pdf. + + + + Create a PdfWriter writing to the passed filename and using the passed writer properties. + filename of the resulting pdf. + writerproperties to use. + + + + Indicates if to use full compression mode. + true if to use full compression, false otherwise. + + + Gets default compression level for @see PdfStream. + + Gets default compression level for @see PdfStream. + For more details @see + + . + + compression level. + + + Sets default compression level for @see PdfStream. + + Sets default compression level for @see PdfStream. + For more details @see + + . + + compression level. + + + Sets the smart mode. + + Sets the smart mode. +

    + In smart mode when resources (such as fonts, images,...) are + encountered, a reference to these resources is saved + in a cache, so that they can be reused. + This requires more memory, but reduces the file size + of the resulting PDF document. + + True for enabling smart mode. + + +

    Gets the current object stream. + object stream. + +
    + + Flushes the object. + Flushes the object. Override this method if you want to define custom behaviour for object flushing. + + object to flush. + indicates whether object can be placed into object stream. + on error. + + + Writes object to body of PDF document. + object to write. + + + + Writes PDF header. + + + Flushes all objects which have not been flushed yet. + + + Flushes all modified objects which have not been flushed yet. + Flushes all modified objects which have not been flushed yet. Used in case incremental updates. + + + Calculates hash code for the indirect reference taking into account the document it belongs to. + object to be hashed. + calculated hash code. + + + Calculates hash code for object to be copied. + + Calculates hash code for object to be copied. + The hash code and the copied object is the stored in @{link copiedObjects} hash map to avoid duplications. + + object to be copied. + calculated hash code. + + + Used in the smart mode. + + Used in the smart mode. + It serializes given object content and tries to find previously copied object with the same content. + If already copied object is not found, it saves current object serialized content into the map. + + an object to check if some other object with the same content was already copied. + indirect reference of the object with the same content, which already has a copy in the new document. + + + + Compares this PdfWriter to the obj. + + Compares this PdfWriter to the obj. + Two PdfWriters are equal if their hashcodes are equal and their serialized content are equal. + + obj to compare + True if this and obj are equal, false otherwise + + + Adds indirect reference to list of indirect objects. + indirect reference to add. + + + Creates next available indirect reference. + created indirect reference. + + + Writes cross reference table and trailer to PDF. + + + + + + + Defines the password which will be used if the document is encrypted with standard encryption. + + Defines the password which will be used if the document is encrypted with standard encryption. + This could be either user or owner password. + + the password to use in order to open the document. + + + Defines the certificate which will be used if the document is encrypted with public key encryption. + + + + Defines the certificate which will be used if the document is encrypted with public key encryption. + + + + Defines if the document will be edited in append mode. + + this + + instance + + + + Defines if the encryption of the original document (if it was encrypted) will be preserved. + + Defines if the encryption of the original document (if it was encrypted) will be preserved. + By default, the resultant document doesn't preserve the original encryption. + + + this + + instance + + + + + Internal helper class which is used to effectively build parent tree and also find marked content references: + for specified page, by MCID or by struct parent index. + + + + Represents parentTree in structTreeRoot. + Represents parentTree in structTreeRoot. It contains only those entries that belong to the already flushed pages. + + + + Contains marked content references for every page. + + Contains marked content references for every page. + If new mcrs are added to the tag structure, these new mcrs are also added to this map. So for each adding or + removing mcr, register/unregister calls must be made (this is done automatically if addKid or removeKid methods + of PdfStructElem are used). + Keys in this map are page references, values - a map which contains all mcrs that belong to the given page. + This inner map of mcrs is of following structure: + * for McrDictionary and McrNumber values the keys are their MCIDs; + * for ObjRef values the keys are struct parent indexes, but with one trick. Struct parent indexes and MCIDs have the + same value domains: the increasing numbers starting from zero. So, in order to store them in one map, for + struct parent indexes simple transformation is applied via + #structParentIndexIntoKey + and + #keyIntoStructParentIndex + . With this we simply store struct parent indexes as negative numbers. + + + + Init ParentTreeHandler. + Init ParentTreeHandler. On init the parent tree is read and stored in this instance. + + + Gets a list of marked content references on page. + + + Creates and flushes parent tree entry for the page. + + Creates and flushes parent tree entry for the page. + Effectively this means that new content mustn't be added to the page. + + + + + for which to create parent tree entry. Typically this page is flushed after this call. + + + + Represents Marked Content Reference (MCR) object wrapper. + + + + To be able to be wrapped with this + + the + + must be indirect. + + + + must be an indirect object. + + + Method to to distinguish struct elements from other elements of the logical tree (like mcr or struct tree root). + + + + Gets attributes object. + + sometimes attributes object may not exist. + Pass + + if you want to create empty dictionary in such case. + The attributes dictionary will be stored inside element. + + attributes dictionary. + + + parent of the current structure element. If parent is already flushed it returns null. + + + Gets list of the direct kids of structure element. + + Gets list of the direct kids of structure element. + If certain kid is flushed, there will be a + + in the list on it's place. + + list of the direct kids of structure element. + + + + To be able to be wrapped with this + + the + + must be indirect. + + + + must be an indirect object. + + + Gets list of the direct kids of StructTreeRoot. + + Gets list of the direct kids of StructTreeRoot. + If certain kid is flushed, there will be a + + in the list on it's place. + + list of the direct kids of StructTreeRoot. + + + Creates and flushes parent tree entry for the page. + + Creates and flushes parent tree entry for the page. + Effectively this means that new content mustn't be added to the page. + + + + + for which to create parent tree entry. Typically this page is flushed after this call. + + + + Gets an unmodifiable collection of marked content references on page. + + Gets an unmodifiable collection of marked content references on page. +

    + NOTE: Do not remove tags when iterating over returned collection, this could + lead to the ConcurrentModificationException, because returned collection is backed by the internal list of the + actual page tags. +
    +
    + + + Copies structure to a + + . +

    + NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
    + document to copy structure to. Shall not be current document. + association between original page and copied page. +
    + + + Copies structure to a + + and insert it in a specified position in the document. +

    + NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
    + document to copy structure to. + indicates where the structure to be inserted. + association between original page and copied page. +
    + + Internal helper class which is used to copy tag structure across documents. + + + + Copies structure to a + + . +

    + NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
    + document to copy structure to. Shall not be current document. + association between original page and copied page. +
    + + + Copies structure to a + + and insert it in a specified position in the document. +

    + NOTE: Works only for + PdfStructTreeRoot + that is read from the document opened in reading mode, + otherwise an exception is thrown. +
    + Also, to insert a tagged page into existing tag structure, existing tag structure shouldn't be flushed, otherwise + an exception may be raised. +
    + document to copy structure to. + indicates where the structure to be inserted. + association between original page and copied page. +
    + + + Copies structure to a + + . + + document to cpt structure to. + association between original page and copied page. + + indicates if page2page keys and values represent pages from + + . + + + + the topmost parent added to set. If encountered flushed element - stops and returns this flushed element. + + + + A layout element which can have a role. + + A layout element which can have a role. The name of the role will be + used to tag the element if it is added to a Tagged PDF document. It can also + have + + , metadata for the tag dictionary. + + + + Gets the element's role. + + a + + containing the name of the role + + + + Sets the element's role. + + the new role which the + + should take + + + + + Gets the + accessibility properties + . + + a properties wrapper object specific to a tagged element in Tagged PDF + + + + TagStructureContext + class is used to track necessary information of document's tag structure. + It is also used to make some global modifications of the tag tree like removing or flushing page tags, however + these two methods and also others are called automatically and are for the most part for internal usage. +

    + There shall be only one instance of this class per + PdfDocument + . To obtain instance of this class use + + . +
    +
    + + + These two fields define the connections between tags ( + PdfStructElem + ) and + layout model elements ( + IAccessibleElement + ). This connection is used as + a sign that tag is not yet finished and therefore should not be flushed or removed + if page tags are flushed or removed. Also, any + TagTreePointer + could be + immediately moved to the tag with connection via it's connected element + + . + When connection is removed, accessible element role and properties are set to the structure element. + + + + + Do not use this constructor, instead use + + method. +

    + Creates + TagStructureContext + for document. There shall be only one instance of this + class per + PdfDocument + . +
    + the document which tag structure will be manipulated with this class. +
    + + + If forbidUnknownRoles is set to true, then if you would try to add new tag which has not a standard role and + it's role is not mapped through RoleMap, an exception will be raised. + + + If forbidUnknownRoles is set to true, then if you would try to add new tag which has not a standard role and + it's role is not mapped through RoleMap, an exception will be raised. + Default value - true. + + new value of the flag + + current + + instance. + + + + + All document auto tagging logic uses + + returned by this method to manipulate tag structure. + Typically it points at the root tag. This pointer also could be used to tweak auto tagging process + (e.g. move this pointer to the Sect tag, which would result in placing all automatically tagged content + under Sect tag). + + + the + TagTreePointer + which is used for all auto tagging of the document. + + + + + Checks if given + IAccessibleElement + is connected to some tag. + + element to check if it has a connected tag. + true, if there is a tag which retains the connection to the given accessible element. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + + + + IAccessibleElement + which connection to the tag (if there is one) will be removed. + + + current + + instance. + + + + Removes annotation content item from the tag structure. + + Removes annotation content item from the tag structure. + If annotation is not added to the document or is not tagged, nothing will happen. + + + + + instance which points at annotation tag parent if annotation was removed, + otherwise returns null. + + + + Removes content item from the tag structure. + + Removes content item from the tag structure. +
    + Nothing happens if there is no such mcid on given page. +
    + page, which contains this content item + marked content id of this content item + + + TagTreePointer + which points at the parent of the removed content item, or null if there is no + such mcid on given page. + +
    + + Removes all tags that belong only to this page. + + Removes all tags that belong only to this page. The logic which defines if tag belongs to the page is described + at + + . + + page that defines which tags are to be removed + + current + + instance. + + + + + Sets the tag, which is connected with the given accessible element, as a current tag for the given + + . An exception will be thrown, if given accessible element is not connected to any tag. + + an element which has a connection with some tag. + + + + which will be moved to the tag connected to the given accessible element. + + + current + + instance. + + + + Destroys all the retained connections. + + current + + instance. + + + + Flushes the tags which are considered to belong to the given page. + + Flushes the tags which are considered to belong to the given page. + The logic that defines if the given tag (structure element) belongs to the page is the following: + if all the marked content references (dictionary or number references), that are the + descenders of the given structure element, belong to the current page - the tag is considered + to belong to the page. If tag has descenders from several pages - it is flushed, if all other pages except the + current one are flushed. +

    + If some of the page's tags are still connected to the accessible elements, in this case these tags are considered + as not yet finished ones, and they won't be flushed. +
    + a page which tags will be flushed. +
    + + Transforms root tags in a way that complies with the PDF References. + + Transforms root tags in a way that complies with the PDF References. +

    + PDF Reference + 10.7.3 Grouping Elements: +

    + For most content extraction formats, the document must be a tree with a single top-level element; + the structure tree root (identified by the StructTreeRoot entry in the document catalog) must have + only one child in its K (kids) array. If the PDF file contains a complete document, the structure + type Document is recommended for this top-level element in the logical structure hierarchy. If the + file contains a well-formed document fragment, one of the structure types Part, Art, Sect, or Div + may be used instead. +
    +
    + + Method for internal usages. + + Method for internal usages. + Essentially, all it does is just making sure that for connected tags the properties are + up to date with the connected accessible elements properties. + + + + parent of the flushed tag + + + + + Creates + TagTreePointer + instance. After creation + TagTreePointer + points at the root tag. + + the document, at which tag structure this instance will point. + + + A copy constructor. + + the + TagTreePointer + from which current position and page are copied. + + + + + Sets a page which content will be tagged with this instance of + TagTreePointer + . + To tag page content: +
      +
    1. Set pointer position to the tag which will be the parent of the page content item;
    2. +
    3. Call + + to obtain the reference to the current tag;
    4. +
    5. Pass + PdfTagReference + to the + + method of the page's + + to start marked content item;
    6. +
    7. Draw content on + PdfCanvas + ;
    8. +
    9. Use + + to finish marked content item.
    10. +
    +
    + + the page which content will be tagged with this instance of + TagTreePointer + . + + + this + + instance. + +
    + + + a page which content will be tagged with this instance of + TagTreePointer + . + + + + + Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, + but rather in the some appearance stream or in the form xObject stream. + + + Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, + but rather in the some appearance stream or in the form xObject stream. In that case, to have a valid tag structure, + one shall set not only the page, on which the content will be rendered, but also the content stream in which + the tagged content will reside. +

    + NOTE: It's important to set a + + for this value, when tagging of this stream content is finished. +
    + + the content stream which content will be tagged with this instance of + TagTreePointer + or + + if content stream tagging is finished. + +
    + + + the content stream which content will be tagged with this instance of + TagTreePointer + . + + + + the document, at which tag structure this instance points. + + + Adds a new tag with given role to the tag structure. + + Adds a new tag with given role to the tag structure. + This method call moves this + TagTreePointer + to the added kid. + + role of the new tag. + + this + + instance. + + + + Adds a new tag with given role to the tag structure. + + Adds a new tag with given role to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
    + This call is equivalent of calling sequentially + + and + + . +
    + zero-based index in kids array of parent tag at which new tag will be added. + role of the new tag. + + this + + instance. + +
    + + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
    + New tag will have a role and attributes defined by the given IAccessibleElement. +
    + accessible element which represents a new tag. + + this + + instance. + +
    + + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
    + New tag will have a role and attributes defined by the given IAccessibleElement. +

    + If keepConnectedToTag is true then a newly created tag will retain the connection with given + accessible element. See + + for more explanations about tag connections concept. +

    + If the same accessible element is connected to the tag and is added twice to the same parent - + this + TagTreePointer + instance would move to connected kid instead of creating tag twice. + But if it is added to some other parent, then connection will be removed. +
    + accessible element which represents a new tag. + defines if to retain the connection between accessible element and the tag. + + + this + + instance. + +
    + + Adds a new tag to the tag structure. + + Adds a new tag to the tag structure. + This method call moves this + TagTreePointer + to the added kid. +
    + New tag will have a role and attributes defined by the given IAccessibleElement. + This call is equivalent of calling sequentially + + and + + . +
    + zero-based index in kids array of parent tag at which new tag will be added. + accessible element which represents a new tag. + + this + + instance. + +
    + + + + Adds a new content item for the given + PdfAnnotation + under the current tag. +

    + By default, when annotation is added to the page it is automatically tagged with auto tagging pointer + (see + + ). If you want to add annotation tag manually, be sure to use + + method with false for boolean flag. +
    + + + PdfAnnotation + to be tagged. + + + this + + instance. + +
    + + Sets index of the next added to the current tag kid, which could be another tag or content item. + + Sets index of the next added to the current tag kid, which could be another tag or content item. + By default, new tag is added at the end of the parent kids array. This property affects only the next added tag, + all tags added after will be added with the default behaviour. +

    + This method could be used with any overload of + + method, + with + + and + + . +
    + Keep in mind, that this method set property to the + TagTreePointer + and not to the tag itself, which means + that if you would move the pointer, this property would be applied to the new current tag. +
    + index of the next added kid. + + this + + instance. + +
    + + + Checks if given + IAccessibleElement + is connected to some tag. + See + + for more explanations about tag connections concept. + + element to check if it has a connected tag. + true, if there is a tag which retains the connection to the given accessible element. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + + + Destroys the connection between the given accessible element and the tag to which this element is connected to. + See + + for more explanations about tag connections concept. + + + + IAccessibleElement + which connection to the tag (if there is one) will be removed. + + + this + + instance. + + + + Removes the current tag. + + Removes the current tag. If it has kids, they will become kids of the current tag parent. + This method call moves this + TagTreePointer + to the current tag parent. +

    + You cannot remove root tag, and also you cannot remove any tag if document's tag structure was partially flushed; + in this two cases an exception will be thrown. +
    + + this + + instance. + +
    + + + Moves kid of the current tag to the tag at which given + TagTreePointer + points. + This method doesn't change pointerToNewParent position. + + zero-based index of the current tag's kid to be relocated. + + the + TagTreePointer + which is positioned at the tag which will become kid's new parent. + + + this + + instance. + + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + See + + and + + . + + the reference to the current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + + + Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. + See + + and + + . + + zero-based index in kids array of tag. These indexes define the logical order of the content on the page. + + the reference to the current tag. + + + + Moves this + TagTreePointer + instance to the document root tag. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the parent of the current tag. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + zero-based index of the current tag kid to which pointer will be moved. + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + + role of the current tag kid to which pointer will be moved. + If there is several kids with this role, pointer will be moved to the first kid with such role. + + + this + + instance. + + + + + Moves this + TagTreePointer + instance to the kid of the current tag. + + + if there is several kids with the given role, pointer will be moved to the kid + which is the n'th if you count kids with such role. + + role of the current tag kid to which pointer will be moved. + + this + + instance. + + + + + Gets current element kids roles. + + Gets current element kids roles. + If certain kid is already flushed, at its position there will be a + + . + If kid is content item, at its position there will be "MCR" (Marked Content Reference). + + current element kids roles + + + + Gets connected accessible element for the current tag. + + Gets connected accessible element for the current tag. If tag is not connected to element, behaviour is defined + by the createIfNotExist flag. + See + + for more explanations about tag connections concept. + + + if true, creates an + IAccessibleElement + and connects it to the tag. + + + connected + IAccessibleElement + if there is one (or if it is created), otherwise null. + + + + Gets accessibility properties of the current tag. + accessibility properties of the current tag. + + + Gets current tag role. + current tag role. + + + Sets new role to the current tag. + new role to be set. + + this + + instance. + + + + Indicates if to use full compression (using object streams). + + + Indicates if the writer copy objects in a smart mode. + + Indicates if the writer copy objects in a smart mode. If so PdfDictionary and PdfStream will be hashed + and reused if there's an object with the same content later. + + + + Defines pdf version for the created document. + Defines pdf version for the created document. Default value is PDF_1_7. + version for the document. + + this + WriterProperties + instance + + + + Enables smart mode. + + Enables smart mode. +

    + In smart mode when resources (such as fonts, images,...) are + encountered, a reference to these resources is saved + in a cache, so that they can be reused. + This requires more memory, but reduces the file size + of the resulting PDF document. + + + this + WriterProperties + instance + + + +

    + If true, default XMPMetadata based on + + will be added. + + + this + WriterProperties + instance + +
    + + Defines the level of compression for the document. + + Defines the level of compression for the document. + See + + + + + this + WriterProperties + instance + + + + Defines if full compression mode is enabled. + + Defines if full compression mode is enabled. If enabled, not only the content of the pdf document will be + compressed, but also the pdf document inner structure. + + true - to enable full compression mode, false to disable it + + this + WriterProperties + instance + + + + Sets the encryption options for the document. + + Sets the encryption options for the document. The userPassword and the + ownerPassword can be null or have zero length. In this case the ownerPassword + is replaced by a random string. The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + See + + . + + the user password. Can be null or empty + the owner password. Can be null or empty + the user permissions + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256 + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + + + this + WriterProperties + instance + + + + Sets the certificate encryption options for the document. + + Sets the certificate encryption options for the document. An array of one or more public certificates + must be provided together with an array of the same size for the permissions for each certificate. + The open permissions for the document can be + AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, + AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. + The permissions can be combined by ORing them. + Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext + See + + . + + the public certificates to be used for the encryption + the user permissions for each of the certificates + + the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, + ENCRYPTION_AES128 or ENCRYPTION_AES256. + + + this + WriterProperties + instance + + + + This activates debug mode with pdfDebug tool. + + This activates debug mode with pdfDebug tool. + It causes additional overhead of duplicating document bytes into memory, so use it careful. + NEVER use it in production or in any other cases except pdfDebug. + + + this + WriterProperties + instance + + + + A wrapper for Form XObject. + A wrapper for Form XObject. ISO 32000-1, 8.10 FormXObjects. + + + An abstract wrapper for supported types of XObject. + + + + + + Create + + or + + by + + . + + + + + with either + + or + + + + + + either + + or + + . + + + + Sets the layer this XObject belongs to. + the layer this XObject belongs to. + + + Gets width of XObject. + float value. + + + Gets height of XObject. + float value. + + + + + + Creates a new instance of Form XObject. + the form XObject’s bounding box. + + + + Create + + instance by + + . + Note, this constructor doesn't perform any additional checks + + + + + with Form XObject. + + + + + Creates form XObject from page content. + + Creates form XObject from page content. + The page shall be from the document, to which FormXObject will be added. + + + an instance of + + + + + + Creates a form XObject from + + . + Unlike other images, + + images are represented as + + , not as + + . + + image to create form object from + document instance which is needed for writing form stream contents + + + + Gets + + of the Form XObject. + Note, if there is no resources, a new instance will be created. + + + not null instance of + + . + + + + + Gets Form XObject's BBox, + + key. + + + a + + , that represents + + . + + + + + Sets Form XObject's BBox, + + key. + + + a + + , that represents + + . + + object itself. + + + + Sets a group attributes dictionary indicating that the contents of the form XObject + shall be treated as a group and specifying the attributes of that group. + + + Sets a group attributes dictionary indicating that the contents of the form XObject + shall be treated as a group and specifying the attributes of that group. + + key. + + + instance of + + . + + object itself. + + + + Gets width based on XObject's BBox. + float value. + + + Gets height based on XObject's BBox. + float value. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note that not every wrapper require this, only those that have such warning in documentation. + + + + + Sets process color model for trap network appearance, + + key. + + + shall be one of the valid values: + + , + + , + + , + + , + + , and + + . + + object itself. + + + + Gets process color model of trap network appearance, + + key. + + + a + + instance, possible values: + + , + + , + + , + + , + + , and + + . + + + + + Sets separation color names for the trap network appearance, + + key. + + + an array of names identifying the colorants that were assumed + when the trap network appearance was created. + + object itself. + + + + Gets separation color names of trap network appearance, + + key. + + + an + + of names identifying the colorants. + + + + + Sets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + + Sets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + key. + + + A + + of indirect references to TrapRegion objects. + + object itself. + + + + Gets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + + Gets an array of TrapRegion objects defining the page’s trapping zones + and the associated trapping parameters, as described in Adobe Technical Note #5620, + Portable Job Ticket Format. + + key. + + + A + + of indirect references to TrapRegion objects. + + + + Sets a human-readable text string that described this trap network to the user. + + Sets a human-readable text string that described this trap network to the user. + + key. + + + a + + value. + + object itself. + + + Gets a human-readable text string that described this trap network to the user. + + Gets a human-readable text string that described this trap network to the user. + + key. + + + a + + value. + + + + Sets a text string representing the printer’s mark in human-readable form. + a string value. + object itself. + + + Gets a text string representing the printer’s mark in human-readable form. + a string value. + + + Puts the value into Image XObject dictionary and associates it with the specified key. + + Puts the value into Image XObject dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + A wrapper for Image XObject. + A wrapper for Image XObject. ISO 32000-1, 8.9 Images. + + + Creates Image XObject by image. + + + + with actual image data. + + + + Creates Image XObject by image. + + + + with actual image data. + + + + + with image mask. + + + + + Create + + instance by + + . + Note, this constructor doesn't perform any additional checks + + + + + with Image XObject. + + + + + + Gets width of image, + Width + key. + + float value. + + + + Gets height of image, + Height + key. + + float value. + + + + To manually flush a + PdfObject + behind this wrapper, you have to ensure + that this object is added to the document, i.e. it has an indirect reference. + Basically this means that before flushing you need to explicitly call + + . + For example: wrapperInstance.makeIndirect(document).flush(); + Note, that not every wrapper require this, only those that have such warning in documentation. + + + + Copy Image XObject to the specified document. + target document + + just created instance of + + . + + + + Gets decoded image bytes. + byte array. + + + Gets image bytes. + + Gets image bytes. + Note, + + , + + and + + filters will be ignored. + + + if + + , decodes stream bytes. + + byte array. + + + + Identifies the type of the image that is stored in the bytes of this + + . + Note that this has nothing to do with the original type of the image. For instance, the return value + of this method will never be + + as we loose this information when converting a + PNG image into something that can be put into a PDF file. + The possible values are: + + , + + , + + , + + , + + + the identified type of image + + + + Identifies recommended file extension to store the bytes of this + + . + Possible values are: 'png', 'jpg', 'jp2', 'tif', 'jbig2'. + This extension can later be used together with the result of + + . + + + a + + with recommended file extension + + + + + Puts the value into Image XObject dictionary and associates it with the specified key. + + Puts the value into Image XObject dictionary and associates it with the specified key. + If the key is already present, it will override the old value with the specified one. + + key to insert or to override + the value to associate with the specified key + object itself. + + + + + + Sets state of this object according to the color space + the colorspace to use + whether indexed color spaces will be resolved (used for recursive call) + if there is a problem with reading from the underlying stream + + + Determining the initial backdrop against which its stack is composited. + + + + Determining whether the objects within the stack are composited with one another or only with the group's backdrop. + + + + + + This class provides means to compare two PDF files both by content and visually + and gives the report of their differences. + + + This class provides means to compare two PDF files both by content and visually + and gives the report of their differences. +

    + For visual comparison it uses external tools: Ghostscript and ImageMagick, which + should be installed on your machine. To allow CompareTool to use them, you need + to pass either java properties or environment variables with names "gsExec" and + "compareExec", which would contain the paths to the executables of correspondingly + Ghostscript and ImageMagick tools. +

    + CompareTool class was mainly designed for the testing purposes of iText in order to + ensure that the same code produces the same PDF document. For this reason you will + often encounter such parameter names as "outDoc" and "cmpDoc" which stand for output + document and document-for-comparison. The first one is viewed as the current result, + and the second one is referred as normal or ideal result. OutDoc is compared to the + ideal cmpDoc. Therefore all reports of the comparison are in the form: "Expected ..., + but was ...". This should be interpreted in the following way: "expected" part stands + for the content of the cmpDoc and "but was" part stands for the content of the outDoc. +
    +
    + + Creates an instance of the CompareTool. + + + + Compares two PDF documents by content starting from Catalog dictionary and then recursively comparing + corresponding objects which are referenced from it. + + + Compares two PDF documents by content starting from Catalog dictionary and then recursively comparing + corresponding objects which are referenced from it. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

    + The main difference between this method and the + + methods is the return value. This method returns a + + class instance, which could be used + in code, however compareByContent methods in case of the differences simply return String value, which could + only be printed. Also, keep in mind that this method doesn't perform visual comparison of the documents. +

    + For more explanations about what is outDoc and cmpDoc see last paragraph of the + + class description. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + + the report of comparison of two files in the form of the custom class instance. + See + + for more info. + + +
    + + + Sets the maximum errors count which will be returned as the result of the comparison. + the errors count. + this CompareTool instance. + + + Enables or disables the generation of the comparison report in the form of the xml document. + + Enables or disables the generation of the comparison report in the form of the xml document. +
    + IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! +
    + true to enable xml report generation, false - to disable. + this CompareTool instance. +
    + + Enables the comparison of the encryption properties of the documents. + + Enables the comparison of the encryption properties of the documents. Encryption properties comparison + results are returned along with all other comparison results. +
    + IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! +
    + this CompareTool instance. +
    + + + + Compares two documents visually. + + Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. + For more info about needed configuration for visual comparison process see + + class description. +
    + During comparison for every page of two documents an image file will be created in the folder specified by + outPath absolute path. Then those page images will be compared and if there are any differences for some pages, + another image file will be created with marked differences on it. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked differences if there is any. + + string containing list of the pages that are visually different, or null if there are no visual differences. + + + +
    + + Compares two documents visually. + + Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. + For more info about needed configuration for visual comparison process see + + class description. +
    + During comparison for every page of two documents an image file will be created in the folder specified by + outPath absolute path. Then those page images will be compared and if there are any differences for some pages, + another image file will be created with marked differences on it. +
    + It is possible to ignore certain areas of the document pages during visual comparison. This is useful for example + in case if documents should be the same except certain page area with date on it. In this case, in the folder + specified by the outPath, new pdf documents will be created with the black rectangles at the specified ignored + areas, and visual comparison will be performed on these new documents. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + string containing list of the pages that are visually different, or null if there are no visual differences. + + + +
    + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

    + Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
    + When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

    + For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
    + + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

    + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

    + Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
    + When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

    + For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
    + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. + + + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

    + Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
    + When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

    + For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
    + + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

    + Compares two PDF documents by content starting from page dictionaries and then recursively comparing + corresponding objects which are referenced from them. You can roughly imagine it as depth-first traversal + of the two trees that represent pdf objects structure of the documents. +

    + Unlike + + this method performs content comparison page by page + and doesn't compare the tag structure, acroforms and all other things that doesn't belong to specific pages. +
    + When comparison by content is finished, if any differences were found, visual comparison is automatically started. + For more info see + + . +

    + For more explanations about what is outPdf and cmpPdf see last paragraph of the + + class description. +
    + the absolute path to the output file, which is to be compared to cmp-file. + the absolute path to the cmp-file, which is to be compared to output file. + the absolute path to the folder, which will be used to store image files for visual comparison. + + file name prefix for image files with marked visual differences if there is any. + + a map with one-based page numbers as keys and lists of ignored rectangles as values. + + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + + string containing text report of the encountered content differences and also list of the pages that are + visually different, or null if there are no content and therefore no visual differences. + + + +
    + + Simple method that compares two given PdfDictionaries by content. + + Simple method that compares two given PdfDictionaries by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + dictionary to compare. + dictionary to compare. + true if dictionaries are equal by content, otherwise false. + + + + Simple method that compares two given PdfStreams by content. + + Simple method that compares two given PdfStreams by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + stream to compare. + stream to compare. + true if stream are equal by content, otherwise false. + + + + Simple method that compares two given PdfArrays by content. + + Simple method that compares two given PdfArrays by content. This is "deep" comparing, which means that all + nested objects are also compared by content. + + array to compare. + array to compare. + true if arrays are equal by content, otherwise false. + + + + Simple method that compares two given PdfNames. + name to compare. + name to compare. + true if names are equal, otherwise false. + + + Simple method that compares two given PdfNumbers. + number to compare. + number to compare. + true if numbers are equal, otherwise false. + + + Simple method that compares two given PdfStrings. + string to compare. + string to compare. + true if strings are equal, otherwise false. + + + Simple method that compares two given PdfBooleans. + boolean to compare. + boolean to compare. + true if booleans are equal, otherwise false. + + + Compares xmp metadata of the two given PDF documents. + the absolute path to the output file, which xmp is to be compared to cmp-file. + the absolute path to the cmp-file, which xmp is to be compared to output file. + text report of the xmp differences, or null if there are no differences. + + + Compares xmp metadata of the two given PDF documents. + the absolute path to the output file, which xmp is to be compared to cmp-file. + the absolute path to the cmp-file, which xmp is to be compared to output file. + + true, if to ignore differences in date or producer xmp metadata + properties. + + text report of the xmp differences, or null if there are no differences. + + + Utility method that provides simple comparison of the two xml files stored in byte arrays. + first xml file data to compare. + second xml file data to compare. + true if xml structures are identical, false otherwise. + + + + + + Utility method that provides simple comparison of the two xml files. + absolute path to the first xml file to compare. + absolute path to the second xml file to compare. + true if xml structures are identical, false otherwise. + + + + + + This method overload is used to compare two encrypted PDF documents. + + This method overload is used to compare two encrypted PDF documents. Document passwords are passed with + outPass and cmpPass parameters. +

    + Compares document info dictionaries of two pdf documents. +
    + the absolute path to the output file, which info is to be compared to cmp-file info. + the absolute path to the cmp-file, which info is to be compared to output file info. + password for the encrypted document specified by the outPdf absolute path. + password for the encrypted document specified by the cmpPdf absolute path. + text report of the differences in documents infos. + +
    + + Compares document info dictionaries of two pdf documents. + the absolute path to the output file, which info is to be compared to cmp-file info. + the absolute path to the cmp-file, which info is to be compared to output file info. + text report of the differences in documents infos. + + + + Compares if two documents has identical link annotations on corresponding pages. + the absolute path to the output file, which links are to be compared to cmp-file links. + + the absolute path to the cmp-file, which links are to be compared to output file links. + + text report of the differences in documents links. + + + + Compares tag structures of the two PDF documents. + + Compares tag structures of the two PDF documents. +
    + This method creates xml files in the same folder with outPdf file. These xml files contain documents tag structures + converted into the xml structure. These xml files are compared if they are equal. +
    + the absolute path to the output file, which tags are to be compared to cmp-file tags. + + the absolute path to the cmp-file, which tags are to be compared to output file tags. + + text report of the differences in documents tags. + + + +
    + + + + + + + + + + + + + + + + + Runs ghostscript to create images of pdfs. + Path to the output folder. + Returns null if result is successful, else returns error message. + + + + + + + + + + + + + + + + + + + first difference offset + + + Class containing results of the comparison of two documents. + + + Creates new empty instance of CompareResult with given limit of difference messages. + maximum number of difference messages handled by this CompareResult. + + + Is used to define if documents are considered equal after comparison. + true if documents are equal, false otherwise. + + + Returns number of differences between two documents met during comparison. + number of differences. + + + Converts this CompareResult into text form. + text report of the differences between two documents. + + + + Returns map with + + as keys and difference descriptions as values. + + differences map which could be used to find in the document objects that are different. + + + Converts this CompareResult into xml form. + output stream to which xml report will be written. + + + + + + Creates empty ObjectPath. + + + Creates ObjectPath with corresponding base objects in two documents. + base object in cmp document. + base object in out document. + + + + Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base + objects of the current instance of the ObjectPath. + + + Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base + objects of the current instance of the ObjectPath. This method is used to avoid infinite loop in case of + circular references in pdf documents objects structure. +
    + Basically, this method creates copy of the current ObjectPath instance, but resets information of the direct + paths, and also adds current ObjectPath instance base objects to the indirect references chain that denotes + a path to the new base objects. +
    + new base object in cmp document. + new base object in out document. + + new ObjectPath instance, which stores chain of the indirect references which were already met to get + to the new base objects. + +
    + + This method is used to define if given objects were already met in the path to the current base objects. + + + This method is used to define if given objects were already met in the path to the current base objects. + If this method returns true it basically means that we found a loop in the objects structure and that we + already compared these objects. + + cmp object to check if it was already met in base objects path. + out object to check if it was already met in base objects path. + true if given objects are contained in the path and therefore were already compared. + + + Adds array item to the direct path. + + Adds array item to the direct path. See + + . + + index in the array of the direct object to be compared. + + + Adds dictionary item to the direct path. + + Adds dictionary item to the direct path. See + + . + + key in the dictionary to which corresponds direct object to be compared. + + + Adds offset item to the direct path. + + Adds offset item to the direct path. See + + . + + offset to the specific byte in the stream that is compared. + + + Removes the last path item from the direct path. + + + + Gets local (or direct) path that denotes sequence of the path items from base object to the comparing + direct object. + + direct path to the comparing object. + + + + Gets indirect path which denotes sequence of the indirect references that were passed in comparing process + to get to the current base objects. + + indirect path to the current base objects. + + + current base object in the cmp document. + + + current base object in the out document. + + + Creates an xml node that describes a direct path stored in this ObjectPath instance. + xml document, to which this xml node will be added. + an xml node describing direct path. + + + string representation of the direct path stored in this ObjectPath instance. + + + + An item in the indirect path (see + + . It encapsulates two corresponding objects from the two + comparing documents that were met to get to the path base objects during comparing process. + + + + Creates IndirectPathItem instance for two corresponding objects from two comparing documents. + an object from the cmp document. + an object from the out document. + + + an object from the cmp object that was met to get to the path base objects during comparing process. + + + + an object from the out object that was met to get to the path base objects during comparing process. + + + + + An abstract class for the items in the direct path (see + + . + + + + Creates an xml node that describes this direct path item. + xml document, to which this xml node will be added. + an xml node describing direct path item. + + + + Direct path item (see + + , which describes transition to the + + entry which value is now a currently comparing direct object. + + + + + Creates an instance of the + + . + + + the key which defines to which entry of the + + the transition was performed. + + + + + The key which defines to which entry of the + + the transition was performed. + See + + for more info. + + + a + + which is the key which defines to which entry of the dictionary + the transition was performed. + + + + + Direct path item (see + + , which describes transition to the + + element which is now a currently comparing direct object. + + + + + Creates an instance of the + + . + + + the index which defines element of the + + to which + the transition was performed. + + + + + The index which defines element of the + + to which the transition was performed. + See + + for more info. + + the index which defines element of the array to which the transition was performed + + + + Direct path item (see + + , which describes transition to the + specific position in + + . + + + + + Creates an instance of the + + . + + + bytes offset to the specific position in + + . + + + + + The bytes offset of the stream which defines specific position in the + + , to which transition + was performed. + + an integer defining bytes offset to the specific position in stream. + + + + Class representing a page range, for instance a page range can contain pages + 5, then pages 10 through 15, then page 18, then page 21 and so on. + + + + + Constructs an empty + + instance. + + + + + Adds any page range part to this page range. + + Adds any page range part to this page range. Users may define and plug in + custom implementations for behavior not found in the standard library. + + + a custom implementation of + + + this range, already modified + + + Adds a page sequence to the range. + the starting page number of the sequence + the finishing page number of the sequence + this range, already modified + + + Adds a single page to the range. + the page number to add + this range, already modified + + + Gets the list of pages that have been added to the range so far. + + Gets the list of pages that have been added to the range so far. + This method has been deprecated in favor of an alternative method that + requires the user to supply the total number of pages in the document. + This number is necessary in order to limit open-ended ranges like "4-". + + the list containing page numbers added to the range + + + Gets the list of pages that have been added to the range so far. + + number of pages of the document to get the pages, to list + only the pages eligible for this document. + + + the list containing page numbers added to the range matching this + document + + + + Checks if a given page is present in the range built so far. + the page number to check + + true if the page is present in this range, + false otherwise + + + + + + + + + + Inner interface for range parts definition + + + Class for range part containing a single page + + + + + + + + + + Class for range part containing a range of pages represented by a start + and an end page + + + + + + + + + + + Class for range part containing a range of pages for all pages after a + given start page + + + + + + + + + + Class for range part for all even or odd pages. + + Class for range part for all even or odd pages. The class contains only 2 + instances, one for odd pages and one for even pages. + + + + + + + + + + Class for range part based on several range parts. + + Class for range part based on several range parts. A 'and' is performed + between all conditions. This allows for example to configure odd pages + between page 19 and 25. + + + + + + + + + + This class is used to merge a number of existing documents into one. + + This class is used to merge a number of existing documents into one. By default, if source document + contains tags and outlines, they will be also copied to the destination document. + + the document into which source documents will be merged. + + + This class is used to merge a number of existing documents into one. + the document into which source documents will be merged. + + if true, then tags from the source document are copied even if destination document is not set as + tagged. Note, that if false, tag structure is still could be copied if the destination document + is explicitly marked as tagged with + + . + + + if true, then outlines from the source document are copied even if in destination document + outlines are not initialized. Note, that if false, outlines are still could be copied if the + destination document outlines were explicitly initialized with + + . + + + + + If set to true then passed to the + PdfMerger#merge + method source documents will be closed + immediately after merging specified pages into current document. If false - PdfDocuments are left open. + Default value - false. + + should be true to close pdf documents in merge method. + + this + PdfMerger + instance. + + + + This method merges pages from the source document to the current one. + + This method merges pages from the source document to the current one. +

    + If closeSourceDocuments flag is set to true (see + + ), + passed + PdfDocument + will be closed after pages are merged. +
    + - document, from which pages will be copied. + - start page in the range of pages to be copied. + - end page in the range to be copied. + + this + PdfMerger + instance. + +
    + + This method merges pages from the source document to the current one. + + This method merges pages from the source document to the current one. +

    + If closeSourceDocuments flag is set to true (see + + ), + passed + PdfDocument + will be closed after pages are merged. +
    + - document, from which pages will be copied. + - List of numbers of pages which will be copied. + + this + PdfMerger + instance. + +
    + + Closes the current document. + + Closes the current document. It is a complete equivalent of calling + PdfDocument#close + on the PdfDocument + passed to the constructor of this PdfMerger instance. This means that it is enough to call close either on + passed PdfDocument or on this PdfMerger instance, but there is no need to call them both. + + + + + This class can be used to count the number of bytes needed when copying + pages from an existing PDF into a newly created PDF. + + + + A map of the resources that are already taken into account + + + + Creates a PdfResourceCounter instance to be used to count the resources + needed for either a page (in this case pass a page dictionary) or the + trailer (root and info dictionary) of a PDF file. + + the object we want to examine + + + Processes an object. + + Processes an object. If the object is indirect, it is added to the + list of resources. If not, it is just processed. + + the object to process + + + + In case an object is an array, a dictionary or a stream, + we need to loop over the entries and process them one by one. + + the object to examine + + + Returns a map with the resources. + the resources + + + + Returns the resources needed for the object that was used to create + this PdfResourceCounter. + + + Returns the resources needed for the object that was used to create + this PdfResourceCounter. If you pass a Map with resources that were + already used by other objects, these objects will not be taken into + account. + + The resources that can be excluded when counting the bytes. + The number of bytes needed for an object. + + + Creates a new instance of PdfSplitter class. + the document to be split. + + + If original document is tagged, then by default all resultant document will also be tagged. + + If original document is tagged, then by default all resultant document will also be tagged. + This could be changed with this flag - if set to false, resultant documents will be not tagged, even if + original document is tagged. + + + + If original document has outlines, then by default all resultant document will also have outlines. + + + If original document has outlines, then by default all resultant document will also have outlines. + This could be changed with this flag - if set to false, resultant documents won't contain outlines, even if + original document had them. + + + + Splits the document basing on the given size. + Preferred size for splitting. + + The documents which the source document was split into. + Be warned that these documents are not closed. + + + + Splits the document by page numbers. + + the numbers of pages from which another document is to be started. + If the first element is not 1, then 1 is implied (i.e. the first split document will start from page 1 in any case). + + + the event listener which is called when another document is ready. + You can close this document in this listener, for instance. + + + + Splits the document by page numbers. + + the numbers of pages from which another document is to be started. + If the first element is not 1, then 1 is implied (i.e. the first split document will start from page 1 in any case). + + the list of resultant documents. By warned that they are not closed. + + + Splits a document into smaller documents with no more than @pageCount pages each. + the biggest possible number of pages in a split document. + + the event listener which is called when another document is ready. + You can close this document in this listener, for instance. + + + + Splits a document into smaller documents with no more than @pageCount pages each. + the biggest possible number of pages in a split document. + the list of resultant documents. By warned that they are not closed. + + + Extracts the specified page ranges from a document. + the list of page ranges for each of the resultant document. + + the list of the resultant documents for each of the specified page range. + Be warned that these documents are not closed. + + + + Extracts the specified page ranges from a document. + the page range to be extracted from the document. + + the resultant document containing the pages specified by the provided page range. + Be warned that this document is not closed. + + + + This method is called when another split document is to be created. + + This method is called when another split document is to be created. + You can override this method and return your own + PdfWriter + depending on your needs. + + the page range of the original document to be included in the document being created now. + + the PdfWriter instance for the document which is being created. + + + + Split a document by outline title (bookmark name), find outline by name + and places the entire hierarchy in a separate document ( outlines and pages ) . + + list of outline titles . + + + the next element in the entire hierarchy + + + + Converts a tagged PDF document into an XML file. + + + + Constructs a + + via a given + + . + + the document to read tag structure from + + + Checks if a character value should be escaped/unescaped. + a character value + true if it's OK to escape or unescape this value + + + Converts the current tag structure into an XML file with default encoding (UTF-8). + the output stream to save XML file to + + + + Converts the current tag structure into an XML file with provided encoding. + the output stream to save XML file to + the charset of the resultant XML file + + + + Sets the name of the root tag of the resultant XML file + the name of the root tag + this object + + + + NOTE: copied from itext5 XMLUtils class + Escapes a string with the appropriated XML codes. + + the string to be escaped + codes above 127 will always be escaped with &#nn; if true + the escaped string + + + This class contains version information about iText. + + This class contains version information about iText. + DO NOT CHANGE THE VERSION INFORMATION WITHOUT PERMISSION OF THE COPYRIGHT HOLDERS OF ITEXT. + Changing the version makes it extremely difficult to debug an application. + Also, the nature of open source software is that you honor the copyright of the original creators of the software. + + + + String that will indicate if the AGPL version is used. + + + The iText version instance. + + + This String contains the name of the product. + + This String contains the name of the product. + iText is a registered trademark by iText Group NV. + Please don't change this constant. + + + + This String contains the version number of this iText release. + + This String contains the version number of this iText release. + For debugging purposes, we request you NOT to change this constant. + + + + This String contains the iText version as shown in the producer line. + + This String contains the iText version as shown in the producer line. + iText is a product developed by iText Group NV. + iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + + + The license key. + + + Gets an instance of the iText version that is currently used. + + Gets an instance of the iText version that is currently used. + Note that iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + + + Checks if the AGPL version is used. + returns true if the AGPL version is used. + + + Is the license expired? + true if expired + + + Gets the product name. + + Gets the product name. + iText Group NV requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + the product name + + + Gets the release number. + + Gets the release number. + iText Group NV requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + the release number + + + Returns the iText version as shown in the producer line. + + Returns the iText version as shown in the producer line. + iText is a product developed by iText Group NV. + iText Group requests that you retain the iText producer line + in every PDF that is created or manipulated using iText. + + iText version + + + Returns a license key if one was provided, or null if not. + a license key. + + + + A wrapper for an Encoding to suppress the preamble. + + + + + A utility class to perform base64 encoding and decoding as specified + in RFC-1521. + + + A utility class to perform base64 encoding and decoding as specified + in RFC-1521. See also RFC 1421. + + $Revision: 1.4 $ + + + marker for invalid bytes + + + marker for accepted whitespace bytes + + + marker for an equal symbol + + + Encode the given byte[]. + the source string. + the base64-encoded data. + + + Encode the given byte[]. + the source string. + + a linefeed is added after linefeed characters; + must be dividable by four; 0 means no linefeeds + + the base64-encoded data. + + + Encode the given string. + the source string. + the base64-encoded string. + + + Decode the given byte[]. + the base64-encoded data. + the decoded data. + + Thrown if the base 64 strings contains non-valid characters, + beside the bas64 chars, LF, CR, tab and space are accepted. + + + + Decode the given string. + the base64-encoded string. + the decoded string. + + + Byte buffer container including length of valid data. + 11.10.2006 + + + the initial capacity for this buffer + + + a byte array that will be wrapped with ByteBuffer. + + + a byte array that will be wrapped with ByteBuffer. + the length of valid bytes in the array + + + Loads the stream into a buffer. + an InputStream + If the stream cannot be read. + + + a byte array that will be wrapped with ByteBuffer. + the offset of the provided buffer. + the length of valid bytes in the array + + + Returns a byte stream that is limited to the valid amount of bytes. + + + + Returns the length, that means the number of valid bytes, of the buffer; + the inner byte array might be bigger than that. + + + + the index to retrieve the byte from + Returns a byte from the buffer + + + the index to retrieve a byte as int or char. + Returns a byte from the buffer + + + Appends a byte to the buffer. + a byte + + + Appends a byte array or part of to the buffer. + a byte array + an offset with + + + + Append a byte array to the buffer + a byte array + + + Append another buffer to this buffer. + another ByteBuffer + + + Detects the encoding of the byte buffer, stores and returns it. + + Detects the encoding of the byte buffer, stores and returns it. + Only UTF-8, UTF-16LE/BE and UTF-32LE/BE are recognized. + Note: UTF-32 flavors are not supported by Java, the XML-parser will complain. + + Returns the encoding string. + + + + Ensures the requested capacity by increasing the buffer size when the + current length is exceeded. + + requested new buffer length + + + + An OutputStream that counts the written bytes. + + @since 08.11.2006 + + + + + the decorated output stream + + + + the byte counter + + + + Constructor with providing the output stream to decorate. + an OutputStream + + + the bytesWritten + + + + + + 22.08.2006 + + + the state of the automaton + + + the result of the escaping sequence + + + count the digits of the sequence + + + The look-ahead size is 6 at maximum (&#xAB;) + + a Reader + + + + + + + Processes numeric escaped chars to find out if they are a control character. + a char + Returns the char directly or as replacement for the escaped sequence. + + + Converts between ISO 8601 Strings and Calendar with millisecond resolution. + + 16.02.2006 + + + Hides public constructor + + + + a date string that is ISO 8601 conform. + an existing XMPDateTime to set with the parsed date + Returns an XMPDateTime-object containing the ISO8601-date. + Is thrown when the string is non-conform. + + + + + 22.08.2006 + + + initializes the parser container + + + Returns the length of the input. + + + Returns whether there are more chars to come. + + + index of char + Returns char at a certain index. + + + Returns the current char or 0x0000 if there are no more chars. + + + Skips the next char. + + + Returns the current position. + + + Parses a integer from the source and sets the pointer after it. + Error message to put in the exception if no number can be found + + the max value of the number to return + Returns the parsed integer. + Thrown if no integer can be found. + + + + 12.10.2006 + + + Private constructor + + + + + Converts a Cp1252 char (contains all Latin-1 chars above 0x80) into a + UTF-8 byte sequence. + + + Converts a Cp1252 char (contains all Latin-1 chars above 0x80) into a + UTF-8 byte sequence. The bytes 0x81, 0x8D, 0x8F, 0x90, and 0x9D are + formally undefined by Windows 1252 and therefore replaced by a space + (0x20). + + an Cp1252 / Latin-1 byte + Returns a byte array containing a UTF-8 byte sequence. + + + 11.08.2006 + + + Common constants for the XMP Toolkit. + 20.01.2006 + + + The XML namespace for XML. + + + The XML namespace for RDF. + + + The XML namespace for the Dublin Core schema. + + + The XML namespace for the IPTC Core schema. + + + The XML namespace for the IPTC Extension schema. + + + The XML namespace for the DICOM medical schema. + + + The XML namespace for the PLUS (Picture Licensing Universal System, http://www.useplus.org) + + + The XML namespace Adobe XMP Metadata. + + + The XML namespace for the XMP "basic" schema. + + + The XML namespace for the XMP copyright schema. + + + The XML namespace for the XMP digital asset management schema. + + + The XML namespace for the job management schema. + + + The XML namespace for the job management schema. + + + The XML namespace for the PDF schema. + + + The XML namespace for the PDF schema. + + + The XML namespace for the Photoshop custom schema. + + + The XML namespace for the Photoshop Album schema. + + + The XML namespace for Adobe's EXIF schema. + + + NS for the CIPA XMP for Exif document v1.1 + + + The XML namespace for Adobe's TIFF schema. + + + BExt Schema + + + RIFF Info Schema + + + Transform XMP + + + Adobe Flash SWF + + + legacy Dublin Core NS, will be converted to NS_DC + + + The XML namespace for qualifiers of the xmp:Identifier property. + + + The XML namespace for fields of the Dimensions type. + + + The XML namespace for fields of a graphical image. + The XML namespace for fields of a graphical image. Used for the Thumbnail type. + + + The XML namespace for fields of the ResourceEvent type. + + + The XML namespace for fields of the ResourceRef type. + + + The XML namespace for fields of the Version type. + + + The XML namespace for fields of the JobRef type. + + + The canonical true string value for Booleans in serialized XMP. + + The canonical true string value for Booleans in serialized XMP. Code that converts from the + string to a bool should be case insensitive, and even allow "1". + + + + The canonical false string value for Booleans in serialized XMP. + + The canonical false string value for Booleans in serialized XMP. Code that converts from the + string to a bool should be case insensitive, and even allow "0". + + + + Index that has the meaning to be always the last item in an array. + + + Node name of an array item. + + + The x-default string for localized properties + + + xml:lang qualfifier + + + rdf:type qualfifier + + + Processing Instruction (PI) for xmp packet + + + XMP meta tag version new + + + XMP meta tag version old + + + Part, 1, 2, or 3 + + + Conformance, A, B, or U. + + + private constructor + + + Asserts that an array name is set. + an array name + Array name is null or empty + + + Asserts that a property name is set. + a property name or path + Property name is null or empty + + + Asserts that a schema namespace is set. + a schema namespace + Schema is null or empty + + + Asserts that a prefix is set. + a prefix + Prefix is null or empty + + + Asserts that a specific language is set. + a specific lang + Specific language is null or empty + + + Asserts that a struct name is set. + a struct name + Struct name is null or empty + + + Asserts that any string parameter is set. + any string parameter + Thrown if the parameter is null or has length 0. + + + + Asserts that the xmp object is of this implemention + ( + + ). + + the XMP object + A wrong implentaion is used. + + + Parser for "normal" XML serialisation of RDF. + 14.07.2006 + + + Start of coreSyntaxTerms. + + + End of coreSyntaxTerms + + + Start of additions for syntax Terms. + + + End of of additions for syntaxTerms. + + + Start of oldTerms. + + + End of oldTerms. + + + ! Yes, the syntax terms include the core terms. + + + this prefix is used for default namespaces + + + The main parsing method. + + The main parsing method. The XML tree is walked through from the root node and and XMP tree + is created. This is a raw parse, the normalisation of the XMP tree happens outside. + + the XML root node + Returns an XMP metadata object (not normalized) + Occurs if the parsing fails for any reason. + + + + + Each of these parsing methods is responsible for recognizing an RDF + syntax production and adding the appropriate structure to the XMP tree. + + + Each of these parsing methods is responsible for recognizing an RDF + syntax production and adding the appropriate structure to the XMP tree. + They simply return for success, failures will throw an exception. + + the xmp metadata object that is generated + the top-level xml node + thown on parsing errors + + + + 7.2.10 nodeElementList
    + ws* ( nodeElement ws* ) + Note: this method is only called from the rdf:RDF-node (top level) +
    + the xmp metadata object that is generated + the parent xmp node + the top-level xml node + thown on parsing errors +
    + + + 7.2.5 nodeElementURIs + anyURI - ( coreSyntaxTerms | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + A node element URI is rdf:Description or anything else that is not an RDF + term. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.7 propertyAttributeURIs + anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + Process the attribute list for an RDF node element. + + + 7.2.7 propertyAttributeURIs + anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) + 7.2.11 nodeElement + start-element ( URI == nodeElementURIs, + attributes == set ( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) + propertyEltList + end-element() + Process the attribute list for an RDF node element. A property attribute URI is + anything other than an RDF term. The rdf:ID and rdf:nodeID attributes are simply ignored, + as are rdf:about attributes on inner nodes. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.13 propertyEltList + ws* ( propertyElt ws* ) + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.14 propertyElt + resourcePropertyElt | literalPropertyElt | parseTypeLiteralPropertyElt | + parseTypeResourcePropertyElt | parseTypeCollectionPropertyElt | + parseTypeOtherPropertyElt | emptyPropertyElt + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + 7.2.16 literalPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + 7.2.17 parseTypeLiteralPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + 7.2.18 parseTypeResourcePropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + 7.2.19 parseTypeCollectionPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + 7.2.21 emptyPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr* ) ) + end-element() + The various property element forms are not distinguished by the XML element name, + but by their attributes for the most part. + + + 7.2.14 propertyElt + resourcePropertyElt | literalPropertyElt | parseTypeLiteralPropertyElt | + parseTypeResourcePropertyElt | parseTypeCollectionPropertyElt | + parseTypeOtherPropertyElt | emptyPropertyElt + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + 7.2.16 literalPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + 7.2.17 parseTypeLiteralPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + 7.2.18 parseTypeResourcePropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + 7.2.19 parseTypeCollectionPropertyElt + start-element ( + URI == propertyElementURIs, attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + 7.2.21 emptyPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr* ) ) + end-element() + The various property element forms are not distinguished by the XML element name, + but by their attributes for the most part. The exceptions are resourcePropertyElt and + literalPropertyElt. They are distinguished by their XML element content. + NOTE: The RDF syntax does not explicitly include the xml:lang attribute although it can + appear in many of these. We have to allow for it in the attibute counts below. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + This handles structs using an rdf:Description node, + arrays using rdf:Bag/Seq/Alt, and typedNodes. + + + 7.2.15 resourcePropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr? ) ) + ws* nodeElement ws + end-element() + This handles structs using an rdf:Description node, + arrays using rdf:Bag/Seq/Alt, and typedNodes. It also catches and cleans up qualified + properties written with rdf:Description and rdf:value. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.16 literalPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, datatypeAttr?) ) + text() + end-element() + Add a leaf node with the text value and qualifiers for the attributes. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.17 parseTypeLiteralPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseLiteral ) ) + literal + end-element() + + thown on parsing errors + + + + 7.2.18 parseTypeResourcePropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + Add a new struct node with a qualifier for the possible rdf:ID attribute. + + + 7.2.18 parseTypeResourcePropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseResource ) ) + propertyEltList + end-element() + Add a new struct node with a qualifier for the possible rdf:ID attribute. + Then process the XML child nodes to get the struct fields. + + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Flag if the node is a top-level node + thown on parsing errors + + + + 7.2.19 parseTypeCollectionPropertyElt + start-element ( URI == propertyElementURIs, + attributes == set ( idAttr?, parseCollection ) ) + nodeElementList + end-element() + + thown on parsing errors + + + + 7.2.20 parseTypeOtherPropertyElt + start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) ) + propertyEltList + end-element() + + thown on parsing errors + + + + Adds a child node. + the xmp metadata object that is generated + the parent xmp node + the currently processed XML node + Node value + Flag if the node is a top-level node + Returns the newly created child node. + thown on parsing errors + + + Adds a qualifier node. + the parent xmp node + + the name of the qualifier which has to be + QName including the default prefix + + the value of the qualifier + Returns the newly created child node. + thown on parsing errors + + + The parent is an RDF pseudo-struct containing an rdf:value field. + + The parent is an RDF pseudo-struct containing an rdf:value field. Fix the + XMP data model. The rdf:value node must be the first child, the other + children are qualifiers. The form, value, and children of the rdf:value + node are the real ones. The rdf:value node's qualifiers must be added to + the others. + + the parent xmp node + thown on parsing errors + + + Checks if the node is a white space. + an XML-node + + Returns whether the node is a whitespace node, + i.e. a text node that contains only whitespaces. + + + + + 7.2.6 propertyElementURIs + anyURI - ( coreSyntaxTerms | rdf:Description | oldTerms ) + + the term id + Return true if the term is a property element name. + + + + 7.2.4 oldTerms
    + rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID +
    + the term id + Returns true if the term is an old term. +
    + + + 7.2.2 coreSyntaxTerms
    + rdf:RDF | rdf:ID | rdf:about | rdf:parseType | rdf:resource | rdf:nodeID | + rdf:datatype +
    + the term id + Return true if the term is a core syntax term +
    + + Determines the ID for a certain RDF Term. + + Determines the ID for a certain RDF Term. + Arranged to hopefully minimize the parse time for large XMP. + + an XML node + Returns the term ID. + + + 09.11.2006 + + + XML namespace prefix + + + XML localname + + + Splits a qname into prefix and localname. + a QName + + + Constructor that initializes the fields + the prefix + the name + + + Returns whether the QName has a prefix. + + + the localName + + + the prefix + + + Utility functions for the XMPToolkit implementation. + 06.06.2006 + + + segments of a UUID + + + length of a UUID + + + table of XML name start chars (<= 0xFF) + + + table of XML name chars (<= 0xFF) + + + Private constructor + + + + + a schema namespace + an XMP Property + + Returns true if the property is defined as "Internal + Property", see XMP Specification. + + + + + Check some requirements for an UUID: +
      +
    • Length of the UUID is 32
    • +
    • The Delimiter count is 4 and all the 4 delimiter are on their right + position (8,13,18,23)
    • +
    +
    + uuid to test + true - this is a well formed UUID, false - UUID has not the expected format +
    + + Simple check for valid XMLNames. + + Simple check for valid XMLNames. Within ASCII range
    + ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6]
    + are accepted, above all characters (which is not entirely + correct according to the XML Spec. +
    + an XML Name + Return true if the name is correct. +
    + + + Checks if the value is a legal "unqualified" XML name, as + defined in the XML Namespaces proposed recommendation. + + + Checks if the value is a legal "unqualified" XML name, as + defined in the XML Namespaces proposed recommendation. + These are XML names, except that they must not contain a colon. + + the value to check + Returns true if the name is a valid "unqualified" XML name. + + + a char + Returns true if the char is an ASCII control char. + + + Serializes the node value in XML encoding. + + Serializes the node value in XML encoding. Its used for tag bodies and + attributes.
    + Note: The attribute is always limited by quotes, + thats why &apos; is never serialized.
    + Note: Control chars are written unescaped, but if the user uses others than tab, LF + and CR the resulting XML will become invalid. +
    + a string + flag if string is attribute value (need to additional escape quotes) + Decides if LF, CR and TAB are escaped. + Returns the value ready for XML output. +
    + + Replaces the ASCII control chars with a space. + a node value + Returns the cleaned up value + + + Simple check if a character is a valid XML start name char. + + Simple check if a character is a valid XML start name char. + All characters according to the XML Spec 1.1 are accepted: + http://www.w3.org/TR/xml11/#NT-NameStartChar + + a character + Returns true if the character is a valid first char of an XML name. + + + + Simple check if a character is a valid XML name char + (every char except the first one), according to the XML Spec 1.1: + http://www.w3.org/TR/xml11/#NT-NameChar + + a character + Returns true if the character is a valid char of an XML name. + + + + Initializes the char tables for the chars 0x00-0xFF for later use, + according to the XML 1.1 specification + http://www.w3.org/TR/xml11 + + + + The implementation of XMPDateTime. + + The implementation of XMPDateTime. Internally a calendar is used + plus an additional nano seconds field, because Calendar supports only milli + seconds. The nanoSeconds convers only the resolution beyond a milli second. + + 16.02.2006 + + + + Returns the year, can be negative. + + + Sets the year + + + Returns The month in the range 1..12. + + + Sets the month 1..12 + + + Returns the day of the month in the range 1..31. + + + Sets the day 1..31 + + + Returns hour - The hour in the range 0..23. + + + Sets the hour in the range 0..23. + + + Returns the minute in the range 0..59. + + + Sets the minute in the range 0..59. + + + Returns the second in the range 0..59. + + + Sets the second in the range 0..59. + + + + Returns milli-, micro- and nano seconds. + Nanoseconds within a second, often left as zero? + + + + + Sets the milli-, micro- and nano seconds. + Granularity goes down to milli seconds. + + + + Returns the time zone. + + + a time zone to set + + + This flag is set either by parsing or by setting year, month or day. + Returns true if the XMPDateTime object has a date portion. + + + This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. + + Returns true if the XMPDateTime object has a time portion. + + + This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. + + Returns true if the XMPDateTime object has a defined timezone. + + + + Returns a Calendar (only with milli second precision).
    + Note: the dates before Oct 15th 1585 (which normally fall into validity of + the Julian calendar) are also rendered internally as Gregorian dates. +
    +
    + + Returns the ISO 8601 string representation of the date and time. + + + Use NO time zone as default + + + The nano seconds take micro and nano seconds, while the milli seconds are in the calendar. + + + + + Creates an XMPDateTime-instance with the current time in the default time + zone. + + + + + Creates an XMPDateTime-instance from a calendar. + + a Calendar + + + + Creates an XMPDateTime-instance from + a Date and a TimeZone. + + a date describing an absolute point in time + a TimeZone how to interpret the date + + + Creates an XMPDateTime-instance from an ISO 8601 string. + an ISO 8601 string + If the string is a non-conform ISO 8601 string, an exception is thrown + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the ISO string representation. + + + The XMPIterator implementation. + + The XMPIterator implementation. + Iterates the XMP Tree according to a set of options. + During the iteration the XMPMeta-object must not be changed. + Calls to skipSubtree() / skipSiblings() will affect the iteration. + + 29.06.2006 + + + + + Skip the subtree below the current node when next() is + called. + + + + + Skip the subtree below and remaining siblings of the current node when + next() is called. + + + + stores the iterator options + + + the base namespace of the property path, will be changed during the iteration + + + + flag to indicate that skipSiblings() has been called. + + + flag to indicate that skipSiblings() has been called. + + + the node iterator doing the work + + + Constructor with optionsl initial values. + + Constructor with optionsl initial values. If propName is provided, + schemaNS has also be provided. + + the iterated metadata object. + the iteration is reduced to this schema (optional) + the iteration is redurce to this property within the schemaNS + + + advanced iteration options, see + + + If the node defined by the paramters is not existing. + + + + + + + + + + + + + Exposes the options for inner class. + + + Exposes the options for inner class. + + + sets the baseNS from the inner class. + + + + + + The XMPIterator implementation. + + The XMPIterator implementation. + It first returns the node itself, then recursivly the children and qualifier of the node. + + 29.06.2006 + + + + iteration state + + + + iteration state + + + + iteration state + + + + the recursively accumulated path + + + + the currently visited node + + + + the iterator that goes through the children and qualifier list + + + + index of node with parent, only interesting for arrays + + + + the cached PropertyInfo to return + + + + the state of the iteration + + + + the iterator for each child + + + + Constructor for the node iterator. + the currently visited node + the accumulated path of the node + the index within the parent node (only for arrays) + + + the childrenIterator + + + Returns the returnProperty. + + + + + Sets the returnProperty as next item or recurses into hasNext(). + Returns if there is a next item to return. + + + + Handles the iteration of the children or qualfier + an iterator + Returns if there are more elements available. + + + the node that will be added to the path. + the path up to this node. + the current array index if an arrey is traversed + Returns the updated path. + + + + Creates a property info object from an XMPNode. + an XMPNode + the base namespace to report + the full property path + Returns a XMPProperty-object that serves representation of the node. + + + This interface is used to return a property together with its path and namespace. + + This interface is used to return a property together with its path and namespace. + It is returned when properties are iterated with the XMPIterator. + + 06.07.2006 + + + This interface is used to return a text property together with its and options. + 23.01.2006 + + + Returns the value of the property. + + + Returns the options of the property. + + + + Only set by + + . + + Returns the language of the alt-text item. + + + Returns the namespace of the property + + + Returns the path of the property, but only if returned by the iterator. + + + + This iterator is derived from the default NodeIterator, + and is only used for the option . + + @since 02.10.2006 + + + + + Constructor + the node which children shall be iterated. + the full path of the former node without the leaf node. + + + + + Implementation for + + . + + 17.02.2006 + + + This class represents the set of XMP metadata as a DOM representation. + + This class represents the set of XMP metadata as a DOM representation. It has methods to read and + modify all kinds of properties, create an iterator over all properties and serialize the metadata + to a String, byte-array or OutputStream. + + 20.01.2006 + + + + Provides access to items within an array. + + Provides access to items within an array. The index is passed as an integer, you need not + worry about the path string syntax for array items, convert a loop index to a string, etc. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant + + always refers to the last existing array + item. + + + Returns a XMPProperty containing the value and the options or + null if the property does not exist. + + Wraps all errors and exceptions that may occur. + + + + Returns the number of items in the array. + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + Returns the number of items in the array. + Wraps all errors and exceptions that may occur. + + + + + + + + The namespace URI + The name of the property + the value for the property + Wraps all errors and exceptions + + + + Replaces an item within an array. + + Replaces an item within an array. The index is passed as an integer, you need not worry about + the path string syntax for array items, convert a loop index to a string, etc. The array + passed must already exist. In normal usage the selected array item is modified. A new item is + automatically appended if the index is the array size plus 1. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The index of the desired item. Arrays in XMP are indexed from 1. To address + the last existing item, use + + to find + out the length of the array. + + + the new value of the array item. Has the same usage as propValue in + setProperty(). + + the set options for the item. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI + The name of the array + The index to insert the new item + the new value of the array item + Wraps all errors and exceptions + + + + Inserts an item into an array previous to the given index. + + Inserts an item into an array previous to the given index. The index is passed as an integer, + you need not worry about the path string syntax for array items, convert a loop index to a + string, etc. The array passed must already exist. In normal usage the selected array item is + modified. A new item is automatically appended if the index is the array size plus 1. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The index to insert the new item. Arrays in XMP are indexed from 1. Use + XMPConst.ARRAY_LAST_ITEM to append items. + + + the new value of the array item. Has the same usage as + propValue in setProperty(). + + the set options that decide about the kind of the node. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the array + The name of the array + The index to insert the new item + the value of the array item + Wraps all errors and exceptions + + + + + + The namespace URI for the array + The name of the array + the value of the array item + Wraps all errors and exceptions + + + + Provides access to fields within a nested structure. + + Provides access to fields within a nested structure. The namespace for the field is passed as + a URI, you need not worry about the path string syntax. The names of fields should be XML + qualified names, that is within an XML namespace. The path syntax for a qualified name uses + the namespace prefix, which is unreliable because the prefix is never guaranteed. The URI is + the formal name, the prefix is just a local shorthand in a given sequence of XML text. + + The namespace URI for the struct. Has the same usage as in getProperty. + + The name of the struct. May be a general path expression, must not be null + or the empty string. Has the same namespace prefix usage as propName in getProperty. + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be null or the + empty string. Has the same namespace prefix usage as the structName parameter. + + + the value of thefield, if the field has a value. + Has the same usage as propValue in getProperty. + + Option flags describing the field. See the earlier description. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the struct + The name of the struct + The namespace URI for the field + The name of the field + the value of the field + Wraps all errors and exceptions + + + + Provides access to a qualifier attached to a property. + + Provides access to a qualifier attached to a property. The namespace for the qualifier is + passed as a URI, you need not worry about the path string syntax. In many regards qualifiers + are like struct fields. See the introductory discussion of qualified properties for more + information. The names of qualifiers should be XML qualified names, that is within an XML + namespace. The path syntax for a qualified name uses the namespace prefix, which is + unreliable because the prefix is never guaranteed. The URI is the formal name, the prefix is + just a local shorthand in a given sequence of XML text. The property the qualifier + will be attached has to exist. + + The namespace URI for the struct. Has the same usage as in getProperty. + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty. + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + + A pointer to the null terminated UTF-8 string that is the + value of the qualifier, if the qualifier has a value. Has the same usage as propValue + in getProperty. + + Option flags describing the qualifier. See the earlier description. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the struct + The name of the property to which the qualifier is attached + The namespace URI for the qualifier + The name of the qualifier + the value of the qualifier + Wraps all errors and exceptions + + + + Deletes the given XMP subtree rooted at the given property. + + Deletes the given XMP subtree rooted at the given property. It is not an error if the + property does not exist. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + The name of the property. Has the same usage as in getProperty. + + + Deletes the given XMP subtree rooted at the given array item. + + Deletes the given XMP subtree rooted at the given array item. It is not an error if the array + item does not exist. + + The namespace URI for the array. Has the same usage as in getProperty. + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant XMPConst.ARRAY_LAST_ITEM always refers to the last + existing array item. + + + + Deletes the given XMP subtree rooted at the given struct field. + + Deletes the given XMP subtree rooted at the given struct field. It is not an error if the + field does not exist. + + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the struct. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty. + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + structName parameter. + + + + Deletes the given XMP subtree rooted at the given qualifier. + + Deletes the given XMP subtree rooted at the given qualifier. It is not an error if the + qualifier does not exist. + + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty. + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + + + Returns whether the property exists. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + Returns true if the property exists. + + + Tells if the array item exists. + + The namespace URI for the array. Has the same usage as in + getProperty(). + + + The name of the array. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The index of the desired item. Arrays in XMP are indexed from 1. The + constant XMPConst.ARRAY_LAST_ITEM always refers to the last + existing array item. + + Returns true if the array exists, false otherwise. + + + DoesStructFieldExist tells if the struct field exists. + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the struct. May be a general path expression, must not be + null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The namespace URI for the field. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the field. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + structName parameter. + + Returns true if the field exists. + + + DoesQualifierExist tells if the qualifier exists. + + The namespace URI for the struct. Has the same usage as in + getProperty(). + + + The name of the property to which the qualifier is attached. Has the same + usage as in getProperty(). + + + The namespace URI for the qualifier. Has the same URI and prefix usage as the + schemaNS parameter. + + + The name of the qualifier. Must be a single XML name, must not be + null or the empty string. Has the same namespace prefix usage as the + propName parameter. + + Returns true if the qualifier exists. + + + + Modifies the value of a selected item in an alt-text array. + + Modifies the value of a selected item in an alt-text array. Creates an appropriate array item + if necessary, and handles special cases for the x-default item. If the selected item is from + a match with the specific language, the value of that item is modified. If the existing value + of that item matches the existing value of the x-default item, the x-default item is also + modified. If the array only has 1 existing item (which is not x-default), an x-default item + is added with the given value. If the selected item is from a match with the generic language + and there are no other generic matches, the value of that item is modified. If the existing + value of that item matches the existing value of the x-default item, the x-default item is + also modified. If the array only has 1 existing item (which is not x-default), an x-default + item is added with the given value. If the selected item is from a partial match with the + generic language and there are other partial matches, a new item is created for the specific + language. The x-default item is not modified. If the selected item is from the last 2 rules + then a new item is created for the specific language. If the array only had an x-default + item, the x-default item is also modified. If the array was empty, items are created for the + specific language and x-default. + Note: In a future version of this API a method + using Java java.lang.Locale will be added. + + + The namespace URI for the alt-text array. Has the same usage as in + getProperty(). + + + The name of the alt-text array. May be a general path expression, must not + be null or the empty string. Has the same namespace prefix usage as + propName in getProperty(). + + + The name of the generic language as an RFC 3066 primary subtag. May be + null or the empty string if no generic language is wanted. + + + The name of the specific language as an RFC 3066 tag. Must not be + null or the empty string. + + + A pointer to the null terminated UTF-8 string that is the new + value for the appropriate array item. + + Option flags, none are defined at present. + Wraps all errors and exceptions that may occur. + + + + + The namespace URI for the alt-text array + The name of the alt-text array + The name of the generic language + The name of the specific language + the new value for the appropriate array item + Wraps all errors and exceptions + + + + + These are very similar to getProperty() and SetProperty() above, + but the value is returned or provided in a literal form instead of as a UTF-8 string. + + + These are very similar to getProperty() and SetProperty() above, + but the value is returned or provided in a literal form instead of as a UTF-8 string. + The path composition functions in XMPPathFactory may be used to compose an path + expression for fields in nested structures, items in arrays, or qualifiers. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Boolean value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns an Integer value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Long value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Double value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a XMPDateTime-object or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a Java Calendar-object or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a byte[]-array contained the decoded base64 value + or null if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to retrieve the literal value of a property. + + Convenience method to retrieve the literal value of a property. + Note: There is no setPropertyString(), + because setProperty() sets a string value. + + + The namespace URI for the property. Has the same usage as in + getProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + + Returns a String value or null + if the property does not exist. + + + Wraps all exceptions that may occur, + especially conversion errors. + + + + + Convenience method to set a property to a literal boolean value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as boolean. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as boolean + Wraps all exceptions + + + + Convenience method to set a property to a literal int value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as int. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as int + Wraps all exceptions + + + + Convenience method to set a property to a literal long value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as long. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as long + Wraps all exceptions + + + + Convenience method to set a property to a literal double value. + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as double. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as double + Wraps all exceptions + + + + + Convenience method to set a property with an XMPDateTime-object, + which is serialized to an ISO8601 date. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the property value as XMPDateTime. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the property value as XMPDateTime + Wraps all exceptions + + + + + Convenience method to set a property with a Java Calendar-object, + which is serialized to an ISO8601 date. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the property value as Java Calendar. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the property value as Calendar + Wraps all exceptions + + + + + Convenience method to set a property from a binary byte[]-array, + which is serialized as base64-string. + + + The namespace URI for the property. Has the same usage as in + setProperty(). + + + The name of the property. + Has the same usage as in getProperty(). + + the literal property value as byte array. + options of the property to set (optional). + Wraps all exceptions that may occur. + + + + + The namespace URI for the property + The name of the property + the literal property value as byte array + Wraps all exceptions + + + + Constructs an iterator for the properties within this XMP object. + Returns an XMPIterator. + + Wraps all errors and exceptions that may occur. + + + + Constructs an iterator for the properties within this XMP object using some options. + Option flags to control the iteration. + Returns an XMPIterator. + + Wraps all errors and exceptions that may occur. + + + + Construct an iterator for the properties within an XMP object. + + Construct an iterator for the properties within an XMP object. According to the parameters it iterates the entire data tree, + properties within a specific schema, or a subtree rooted at a specific node. + + + Optional schema namespace URI to restrict the iteration. Omitted (visit all + schema) by passing null or empty String. + + + Optional property name to restrict the iteration. May be an arbitrary path + expression. Omitted (visit all properties) by passing null or empty + String. If no schema URI is given, it is ignored. + + + Option flags to control the iteration. See + + for + details. + + + Returns an XMPIterator for this XMPMeta-object + considering the given options. + + Wraps all errors and exceptions that may occur. + + + + + This correlates to the about-attribute, + returns the empty String if no name is set. + + Returns the name of the XMP object. + + + Sets the name of the XMP object. + + + + Returns the unparsed content of the <?xpacket> processing instruction. + This contains normally the attribute-like elements 'begin="<BOM>" + id="W5M0MpCehiHzreSzNTczkc9d"' and possibly the deprecated elements 'bytes="1234"' or + 'encoding="XXX"'. If the parsed packet has not been wrapped into an xpacket, + null is returned. + + + + Clones the complete metadata tree. + Returns a deep copy of this instance. + + + + Perform the normalization as a separate parsing step. + + Perform the normalization as a separate parsing step. + Normally it is done during parsing, unless the parsing option + + is set to true. + Note: It does no harm to call this method to an already normalized xmp object. + It was a PDF/A requirement to get hand on the unnormalized XMPMeta object. + + optional parsing options. + Wraps all errors and exceptions that may occur. + + + + Renders this node and the tree unter this node in a human readable form. + Returns a multiline string containing the dump. + + + Property values are Strings by default + + + root of the metadata tree + + + the xpacket processing instructions content + + + Constructor for an empty metadata object. + + + Constructor for a cloned metadata tree. + + an prefilled metadata tree which fulfills all + XMPNode contracts. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a property, but the result value can be requested. + + Returns a property, but the result value can be requested. It can be one + of + + , + + , + + , + + , + + , + + , + + , + + . + + + a schema namespace + a property name or path + the type of the value, see VALUE_... + Returns an XMPProperty + Collects any exception that occurs. + + + + Returns a property, but the result value can be requested. + + a schema namespace + a property name or path + the type of the value, see VALUE_... + + Returns the node value as an object according to the + valueType. + + Collects any exception that occurs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the packetHeader attributes, only used by the parser. + the processing instruction content + + + Performs a deep clone of the XMPMeta-object + + + + + + + + + + + + + + Returns the root node of the XMP tree. + + + Locate or create the item node and set the value. + + Locate or create the item node and set the value. Note the index + parameter is one-based! The index can be in the range [1..size + 1] or + "last()", normalize it and check the insert flags. The order of the + normalization checks is important. If the array is empty we end up with + an index and location to set item size + 1. + + an array node + the index where to insert the item + the item value + the options for the new item + insert oder overwrite at index position? + + + + + The internals for setProperty() and related calls, used after the node is + found or created. + + the newly created node + the node value, can be null + options for the new node, must not be null. + + flag if the existing value is to be overwritten + thrown if options and value do not correspond + + + + + Evaluates a raw node value to the given value type, apply special + conversions for defined types in XMP. + + an int indicating the value type + the node containing the value + Returns a literal value for the node. + + + + + This class replaces the ExpatAdapter.cpp and does the + XML-parsing and fixes the prefix. + + + This class replaces the ExpatAdapter.cpp and does the + XML-parsing and fixes the prefix. After the parsing several normalisations + are applied to the XMPTree. + + 01.02.2006 + + + Hidden constructor, initialises the SAX parser handler. + + + + Parses the input source into an XMP metadata object, including + de-aliasing and normalisation. + + + the input can be an InputStream, a String or + a byte buffer containing the XMP packet. + + the parse options + Returns the resulting XMP metadata object + Thrown if parsing or normalisation fails. + + + + + + Parses XML from an , + fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally. + + an InputStream + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + Parses XML from a byte buffer, + fixing the encoding (Latin-1 to UTF-8) and illegal control character optionally. + + a byte buffer containing the XMP packet + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + + Parses XML from a + + , + fixing the illegal control character optionally. + + a String containing the XMP packet + the parsing options + Returns an XML DOM-Document. + Thrown when the parsing fails. + + + + + + A node in the internally XMP tree, which can be a schema node, a property node, an array node, + an array item, a struct node or a qualifier node (without '?'). + + + A node in the internally XMP tree, which can be a schema node, a property node, an array node, + an array item, a struct node or a qualifier node (without '?'). + Possible improvements: + 1. The kind Node of node might be better represented by a class-hierarchy of different nodes. + 2. The array type should be an enum + 3. isImplicitNode should be removed completely and replaced by return values of fi. + 4. hasLanguage, hasType should be automatically maintained by XMPNode + + 21.02.2006 + + + name of the node, contains different information depending of the node kind + + + + value of the node, contains different information depending of the node kind + + + + link to the parent node + + + list of child nodes, lazy initialized + + + list of qualifier of the node, lazy initialized + + + options describing the kind of the node + + + flag if the node is implicitly created + + + flag if the node has aliases + + + flag if the node is an alias + + + flag if the node has an "rdf:value" child node. + + + Creates an XMPNode with initial values. + the name of the node + the value of the node + the options of the node + + + Constructor for the node without value. + the name of the node + the options of the node + + + Resets the node. + + + Returns the parent node. + + + an index [1..size] + Returns the child with the requested index. + + + Adds a node as child to this node. + an XMPNode + + + + Adds a node as child to this node. + + the index of the node before which the new one is inserted. + Note: The node children are indexed from [1..size]! + An index of size + 1 appends a node. + + an XMPNode + + + + Replaces a node with another one. + + the index of the node that will be replaced. + Note: The node children are indexed from [1..size]! + + the replacement XMPNode + + + Removes a child at the requested index. + the index to remove [1..size] + + + Removes a child node. + + Removes a child node. + If its a schema node and doesn't have any children anymore, its deleted. + + the child node to delete. + + + + Removes the children list if this node has no children anymore; + checks if the provided node is a schema node and doesn't have any children anymore, + its deleted. + + + + Removes all children from the node. + + + Returns the number of children without neccessarily creating a list. + + + child node name to look for + Returns an XMPNode if node has been found, null otherwise. + + + + an index [1..size] + Returns the qualifier with the requested index. + + + Returns the number of qualifier without neccessarily creating a list. + + + Appends a qualifier to the qualifier list and sets respective options. + a qualifier node. + + + + Removes one qualifier node and fixes the options. + qualifier to remove + + + Removes all qualifiers from the node and sets the options appropriate. + + + qualifier node name to look for + + Returns a qualifier XMPNode if node has been found, + null otherwise. + + + + Returns whether the node has children. + + + + Returns an iterator for the children. + Note: take care to use it.remove(), as the flag are not adjusted in that case. + + + + Returns whether the node has qualifier attached. + + + + Returns an iterator for the qualifier. + Note: take care to use it.remove(), as the flag are not adjusted in that case. + + + + Performs a deep clone of the node and the complete subtree. + + + + + Performs a deep clone of the complete subtree (children and + qualifier )into and add it to the destination node. + + the node to add the cloned subtree + + + Renders this node and the tree unter this node in a human readable form. + + Flag is qualifier and child nodes shall be rendered too + Returns a multiline string containing the dump. + + + + + + Returns the name. + + + The name to set. + + + Returns the value. + + + The value to set. + + + Returns the options. + + + Updates the options of the node. + the options to set. + + + Returns the implicit flag + + + Sets the implicit node flag + + + Returns if the node contains aliases (applies only to schema nodes) + + + sets the flag that the node contains aliases + + + Returns if the node contains aliases (applies only to schema nodes) + + + sets the flag that the node is an alias + + + the hasValueChild + + + the hasValueChild to set + + + + Dumps this node and its qualifier and children recursively. + + Dumps this node and its qualifier and children recursively. + Note: It creats empty options on every node. + + the buffer to append the dump. + Flag is qualifier and child nodes shall be rendered too + the current indent level. + the index within the parent node (important for arrays) + + + Returns whether this node is a language qualifier. + + + Returns whether this node is a type qualifier. + + + + Note: This method should always be called when accessing 'children' to be sure + that its initialized. + + Returns list of children that is lazy initialized. + + + Returns a read-only copy of child nodes list. + + + Returns list of qualifier that is lazy initialized. + + + + Sets the parent node, this is solely done by addChild(...) + and addQualifier(). + + Sets the parent node. + + + Internal find. + the list to search in + the search expression + Returns the found node or nulls. + + + Checks that a node name is not existing on the same level, except for array items. + + the node name to check + Thrown if a node with the same name is existing. + + + + Checks that a qualifier name is not existing on the same level. + the new qualifier name + Thrown if a node with the same name is existing. + + + + Utilities for XMPNode. + Aug 28, 2006 + + + Private Constructor + + + Find or create a schema node if createNodes is false and + the root of the xmp tree. + a namespace + + a flag indicating if the node shall be created if not found. + Note: The namespace must be registered prior to this call. + + + Returns the schema node if found, null otherwise. + Note: If createNodes is true, it is always + returned a valid node. + + + An exception is only thrown if an error occurred, not if a + node was not found. + + + + Find or create a schema node if createNodes is true. + the root of the xmp tree. + a namespace + If a prefix is suggested, the namespace is allowed to be registered. + + + a flag indicating if the node shall be created if not found. + Note: The namespace must be registered prior to this call. + + + Returns the schema node if found, null otherwise. + Note: If createNodes is true, it is always + returned a valid node. + + + An exception is only thrown if an error occurred, not if a + node was not found. + + + + Find or create a child node under a given parent node. + + Find or create a child node under a given parent node. If the parent node is no + Returns the found or created child node. + + the parent node + the node name to find + flag, if new nodes shall be created. + Returns the found or created node or null. + Thrown if + + + Follow an expanded path expression to find or create a node. + the node to begin the search. + the complete xpath + + flag if nodes shall be created + (when called by setProperty()) + + + the options for the created leaf nodes (only when + createNodes == true). + + Returns the node if found or created or null. + + An exception is only thrown if an error occurred, + not if a node was not found. + + + + Deletes the the given node and its children from its parent. + + Deletes the the given node and its children from its parent. + Takes care about adjusting the flags. + + the top-most node to delete. + + + This is setting the value of a leaf node. + an XMPNode + a value + + + Verifies the PropertyOptions for consistancy and updates them as needed. + + + Verifies the PropertyOptions for consistancy and updates them as needed. + If options are null they are created with default values. + + the PropertyOptions + the node value to set + Returns the updated options. + If the options are not consistant. + + + + + Converts the node value to String, apply special conversions for defined + types in XMP. + + the node value to set + Returns the String representation of the node value. + + + + Find or create a qualifier node under a given parent node. + + Find or create a qualifier node under a given parent node. Returns a pointer to the + qualifier node, and optionally an iterator for the node's position in + the parent's vector of qualifiers. The iterator is unchanged if no qualifier node (null) + is returned. + Note: On entry, the qualName parameter must not have the leading '?' from the + XMPPath step. + + the parent XMPNode + the qualifier name + flag if nodes shall be created + Returns the qualifier node if found or created, null otherwise. + + + + + an array node + the segment containing the array index + flag if new nodes are allowed to be created. + Returns the index or index = -1 if not found + Throws Exceptions + + + + Searches for a field selector in a node: + [fieldName="value] - an element in an array of structs, chosen by a field value. + + + Searches for a field selector in a node: + [fieldName="value] - an element in an array of structs, chosen by a field value. + No implicit nodes are created by field selectors. + + + + + Returns the index of the field if found, otherwise -1. + + + + + Searches for a qualifier selector in a node: + [?qualName="value"] - an element in an array, chosen by a qualifier value. + + + Searches for a qualifier selector in a node: + [?qualName="value"] - an element in an array, chosen by a qualifier value. + No implicit nodes are created for qualifier selectors, + except for an alias to an x-default item. + + an array node + the qualifier name + the qualifier value + + in case the qual selector results from an alias, + an x-default node is created if there has not been one. + + Returns the index of th + + + + Make sure the x-default item is first. + + Make sure the x-default item is first. Touch up "single value" + arrays that have a default plus one real language. This case should have + the same value for both items. Older Adobe apps were hardwired to only + use the "x-default" item, so we copy that value to the other + item. + + an alt text array node + + + See if an array is an alt-text array. + + See if an array is an alt-text array. If so, make sure the x-default item + is first. + + the array node to check if its an alt-text array + + + Appends a language item to an alt text array. + the language array + the language of the item + the content of the item + Thrown if a duplicate property is added + + + + + Looks for the appropriate language item in a text alternative array.item + + an array node + the requested language + Returns the index if the language has been found, -1 otherwise. + + + + Aug 18, 2006 + + + caches the correct dc-property array forms + + + Hidden constructor + + + Normalizes a raw parsed XMPMeta-Object + the raw metadata object + the parsing options + Returns the normalized metadata object + Collects all severe processing errors. + + + + + Tweak old XMP: Move an instance ID from rdf:about to the + xmpMM:InstanceID property. + + + Tweak old XMP: Move an instance ID from rdf:about to the + xmpMM:InstanceID property. An old instance ID usually looks + like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign + 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If + the name looks like a UUID simply move it to xmpMM:InstanceID, + don't worry about any existing xmpMM:InstanceID. Both will + only be present when a newer file with the xmpMM:InstanceID + property is updated by an old app that uses rdf:about. + + the root of the metadata tree + Thrown if tweaking fails. + + + Visit all schemas to do general fixes and handle special cases. + the metadata object implementation + Thrown if the normalisation fails. + + + + + Undo the denormalization performed by the XMP used in Acrobat 5.
    + If a Dublin Core array had only one item, it was serialized as a simple + property. +
    + + Undo the denormalization performed by the XMP used in Acrobat 5.
    + If a Dublin Core array had only one item, it was serialized as a simple + property.
    + The xml:lang attribute was dropped from an + alt-text item if the language was x-default. +
    + the DC schema node + Thrown if normalization fails + +
    + + Make sure that the array is well-formed AltText. + + Make sure that the array is well-formed AltText. Each item must be simple + and have an "xml:lang" qualifier. If repairs are needed, keep simple + non-empty items by adding the "xml:lang" with value "x-repair". + + the property node of the array to repair. + Forwards unexpected exceptions. + + + + Visit all of the top level nodes looking for aliases. + + Visit all of the top level nodes looking for aliases. If there is + no base, transplant the alias subtree. If there is a base and strict + aliasing is on, make sure the alias and base subtrees match. + + the root of the metadata tree + th parsing options + Forwards XMP errors + + + + Moves an alias node of array form to another schema into an array + the node to be moved + the base array for the array item + Forwards XMP errors + + + Fixes the GPS Timestamp in EXIF. + the EXIF schema node + Thrown if the date conversion fails. + + + + Remove all empty schemas from the metadata tree that were generated during the rdf parsing. + + the root of the metadata tree + + + The outermost call is special. + + The outermost call is special. The names almost certainly differ. The + qualifiers (and hence options) will differ for an alias to the x-default + item of a langAlt array. + + the alias node + the base node of the alias + marks the outer call of the recursion + Forwards XMP errors + + + + The initial support for WAV files mapped a legacy ID3 audio copyright + into a new xmpDM:copyright property. + + + The initial support for WAV files mapped a legacy ID3 audio copyright + into a new xmpDM:copyright property. This is special case code to migrate + that into dc:rights['x-default']. The rules: +
    +            1. If there is no dc:rights array, or an empty array -
    +            Create one with dc:rights['x-default'] set from double linefeed and xmpDM:copyright.
    +            2. If there is a dc:rights array but it has no x-default item -
    +            Create an x-default item as a copy of the first item then apply rule #3.
    +            3. If there is a dc:rights array with an x-default item,
    +            Look for a double linefeed in the value.
    +            A. If no double linefeed, compare the x-default value to the xmpDM:copyright value.
    +            A1. If they match then leave the x-default value alone.
    +            A2. Otherwise, append a double linefeed and
    +            the xmpDM:copyright value to the x-default value.
    +            B. If there is a double linefeed, compare the trailing text to the xmpDM:copyright value.
    +            B1. If they match then leave the x-default value alone.
    +            B2. Otherwise, replace the trailing x-default text with the xmpDM:copyright value.
    +            4. In all cases, delete the xmpDM:copyright property.
    +            
    +
    + the metadata object + the "dm:copyright"-property +
    + + + Initializes the map that contains the known arrays, that are fixed by + + . + + + + The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. + + + The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. There + is only one single instance used by the toolkit. + + 27.01.2006 + + + + + + + + Returns the registered prefix/namespace-pairs as map, where the keys are the + namespaces and the values are the prefixes. + + + + + Returns the registered namespace/prefix-pairs as map, where the keys are the + prefixes and the values are the namespaces. + + + + + Determines if a name is an alias, and what it is aliased to. + + The namespace URI of the alias. Must not be null or the empty + string. + + + The name of the alias. May be an arbitrary path expression + path, must not be null or the empty string. + + + Returns the XMPAliasInfo for the given alias namespace and property or + null if there is no such alias. + + + + Collects all aliases that are contained in the provided namespace. + + Collects all aliases that are contained in the provided namespace. + If nothing is found, an empty array is returned. + + a schema namespace URI + Returns all alias infos from aliases that are contained in the provided namespace. + + + Searches for registered aliases. + an XML conform qname + + Returns if an alias definition for the given qname to another + schema and property is registered. + + + + + Returns the registered aliases as map, where the key is the "qname" (prefix and name) + and the value an XMPAliasInfo-object. + + + + a map from a namespace URI to its registered prefix + + + a map from a prefix to the associated namespace URI + + + a map of all registered aliases. + + a map of all registered aliases. + The map is a relationship from a qname to an XMPAliasInfo-object. + + + + The pattern that must not be contained in simple properties + + + + Performs the initialisation of the registry with the default namespaces, aliases and global + options. + + + + + + + + + + + + + + + + + + + + + + + + Register the standard namespaces of schemas and types that are included in the XMP + Specification and some other Adobe private namespaces. + + + Register the standard namespaces of schemas and types that are included in the XMP + Specification and some other Adobe private namespaces. + Note: This method is not lock because only called by the constructor. + + Forwards processing exceptions + + + + + + + + + + + + + + + Register the standard aliases. + + Register the standard aliases. + Note: This method is not lock because only called by the constructor. + + If the registrations of at least one alias fails. + + + + This interface is used to return info about an alias. + 27.01.2006 + + + Returns Returns the namespace URI for the base property. + + + Returns the default prefix for the given base property. + + + Returns the path of the base property. + + + + Returns the kind of the alias. This can be a direct alias + (ARRAY), a simple property to an ordered array + (ARRAY_ORDERED), to an alternate array + (ARRAY_ALTERNATE) or to an alternate text array + (ARRAY_ALT_TEXT). + + + + + + + + + + + + + + + + + + Serializes the XMPMeta-object to an OutputStream according to the + SerializeOptions. + + 11.07.2006 + + + Static method to serialize the metadata object. + + Static method to serialize the metadata object. For each serialisation, a new XMPSerializer + instance is created, either XMPSerializerRDF or XMPSerializerPlain so thats its possible to + serialialize the same XMPMeta objects in two threads. + + a metadata implementation object + the output stream to serialize to + serialization options, can be null for default. + + + + + Serializes an XMPMeta-object as RDF into a string. + + Serializes an XMPMeta-object as RDF into a string. + Note: Encoding is forced to UTF-16 when serializing to a + string to ensure the correctness of "exact packet size". + + a metadata implementation object + + Options to control the serialization (see + + ). + + Returns a string containing the serialized RDF. + on serializsation errors. + + + Serializes an XMPMeta-object as RDF into a byte buffer. + a metadata implementation object + + Options to control the serialization (see + + ). + + Returns a byte buffer containing the serialized RDF. + on serializsation errors. + + + Serializes the XMPMeta-object using the standard RDF serialization format. + + + Serializes the XMPMeta-object using the standard RDF serialization format. + The output is written to an OutputStream + according to the SerializeOptions. + + 11.07.2006 + + + default padding + + + The w/r is missing inbetween + + + a set of all rdf attribute qualifier + + + the metadata object to be serialized. + + + the output stream to serialize to + + + this writer is used to do the actual serialization + + + the stored serialization options + + + + the size of one unicode char, for UTF-8 set to 1 + (Note: only valid for ASCII chars lower than 0x80), + set to 2 in case of UTF-16 + + + + + the padding in the XMP Packet, or the length of the complete packet in + case of option exactPacketLength. + + + + The actual serialization. + the metadata object to be serialized + outputStream the output stream to serialize to + the serialization options + If case of wrong options or any other serialization error. + + + + Calculates the padding according to the options and write it to the stream. + + the length of the tail string + thrown if packet size is to small to fit the padding + + forwards writer errors + + + Checks if the supplied options are consistent. + Thrown if options are conflicting + + + + Writes the (optional) packet header and the outer rdf-tags. + Returns the packet end processing instraction to be written after the padding. + + Forwarded writer exceptions. + + + + Serializes the metadata in pretty-printed manner. + indent level + Forwarded writer exceptions + + + + + + + Serializes the metadata in compact manner. + indent level to start with + Forwarded writer exceptions + + + + Write each of the parent's simple unqualified properties as an attribute. + + + Write each of the parent's simple unqualified properties as an attribute. Returns true if all + of the properties are written as attributes. + + the parent property node + the current indent level + Returns true if all properties can be rendered as RDF attribute. + + + + + Recursively handles the "value" for a node that must be written as an RDF + property element. + + + Recursively handles the "value" for a node that must be written as an RDF + property element. It does not matter if it is a top level property, a + field of a struct, or an item of an array. The indent is that for the + property element. The patterns bwlow ignore attribute qualifiers such as + xml:lang, they don't affect the output form. +
    +
    +            <ns:UnqualifiedStructProperty-1
    +            ... The fields as attributes, if all are simple and unqualified
    +            />
    +            <ns:UnqualifiedStructProperty-2 rdf:parseType="Resource">
    +            ... The fields as elements, if none are simple and unqualified
    +            </ns:UnqualifiedStructProperty-2>
    +            <ns:UnqualifiedStructProperty-3>
    +            <rdf:Description
    +            ... The simple and unqualified fields as attributes
    +            >
    +            ... The compound or qualified fields as elements
    +            </rdf:Description>
    +            </ns:UnqualifiedStructProperty-3>
    +            <ns:UnqualifiedArrayProperty>
    +            <rdf:Bag> or Seq or Alt
    +            ... Array items as rdf:li elements, same forms as top level properties
    +            </rdf:Bag>
    +            </ns:UnqualifiedArrayProperty>
    +            <ns:QualifiedProperty rdf:parseType="Resource">
    +            <rdf:value> ... Property "value"
    +            following the unqualified forms ... </rdf:value>
    +            ... Qualifiers looking like named struct fields
    +            </ns:QualifiedProperty>
    +            
    +
    + *** Consider numbered array items, but has compatibility problems. + Consider qualified form with rdf:Description and attributes. +
    + the parent node + the current indent level + Forwards writer exceptions + If qualifier and element fields are mixed. + +
    + + Serializes a simple property. + an XMPNode + Returns an array containing the flags emitEndTag and indentEndTag. + Forwards the writer exceptions. + + + Serializes an array property. + an XMPNode + the current indent level + Forwards the writer exceptions. + If qualifier and element fields are mixed. + + + + Serializes a struct property. + an XMPNode + the current indent level + Flag if the element has resource qualifier + Returns true if an end flag shall be emitted. + Forwards the writer exceptions. + If qualifier and element fields are mixed. + + + + Serializes the general qualifier. + the root node of the subtree + the current indent level + Forwards all writer exceptions. + If qualifier and element fields are mixed. + + + + + Serializes one schema with all contained properties in pretty-printed + manner.
    + Each schema's properties are written to a single + rdf:Description element. +
    + + Serializes one schema with all contained properties in pretty-printed + manner.
    + Each schema's properties are written to a single + rdf:Description element. All of the necessary namespaces are declared in + the rdf:Description element. The baseIndent is the base level for the + entire serialization, that of the x:xmpmeta element. An xml:lang + qualifier is written as an attribute of the property start tag, not by + itself forcing the qualified property form. +
    +
    +            <rdf:Description rdf:about="TreeName" xmlns:ns="URI" ... >
    +            ... The actual properties of the schema, see SerializePrettyRDFProperty
    +            <!-- ns1:Alias is aliased to ns2:Actual -->  ... If alias comments are wanted
    +            </rdf:Description>
    +            
    +
    +
    + a schema node + + Forwarded writer exceptions + +
    + + Writes all used namespaces of the subtree in node to the output. + + Writes all used namespaces of the subtree in node to the output. + The subtree is recursivly traversed. + + the root node of the subtree + a set containing currently used prefixes + the current indent level + Forwards all writer exceptions. + + + Writes one namespace declaration to the output. + a namespace prefix (without colon) or a complete qname (when namespace == null) + + the a namespace + a set containing currently used prefixes + the current indent level + Forwards all writer exceptions. + + + Start the outer rdf:Description element, including all needed xmlns attributes. + + + Start the outer rdf:Description element, including all needed xmlns attributes. + Leave the element open so that the compact form can add property attributes. + + If the writing to + + + + Recursively handles the "value" for a node. + + Recursively handles the "value" for a node. It does not matter if it is a + top level property, a field of a struct, or an item of an array. The + indent is that for the property element. An xml:lang qualifier is written + as an attribute of the property start tag, not by itself forcing the + qualified property form. The patterns below mostly ignore attribute + qualifiers like xml:lang. Except for the one struct case, attribute + qualifiers don't affect the output form. +
    +
    +            <ns:UnqualifiedSimpleProperty>value</ns:UnqualifiedSimpleProperty>
    +            <ns:UnqualifiedStructProperty> (If no rdf:resource qualifier)
    +            <rdf:Description>
    +            ... Fields, same forms as top level properties
    +            </rdf:Description>
    +            </ns:UnqualifiedStructProperty>
    +            <ns:ResourceStructProperty rdf:resource="URI"
    +            ... Fields as attributes
    +            >
    +            <ns:UnqualifiedArrayProperty>
    +            <rdf:Bag> or Seq or Alt
    +            ... Array items as rdf:li elements, same forms as top level properties
    +            </rdf:Bag>
    +            </ns:UnqualifiedArrayProperty>
    +            <ns:QualifiedProperty>
    +            <rdf:Description>
    +            <rdf:value> ... Property "value" following the unqualified
    +            forms ... </rdf:value>
    +            ... Qualifiers looking like named struct fields
    +            </rdf:Description>
    +            </ns:QualifiedProperty>
    +            
    +
    +
    + the property node + property shall be rendered as attribute rather than tag + + + use canonical form with inner description tag or + the compact form with rdf:ParseType="resource" attribute. + + the current indent level + Forwards all writer exceptions. + If "rdf:resource" and general qualifiers are mixed. + +
    + + Writes the array start and end tags. + an array node + flag if its the start or end tag + the current indent level + forwards writer exceptions + + + Serializes the node value in XML encoding. + + Serializes the node value in XML encoding. Its used for tag bodies and + attributes. Note: The attribute is always limited by quotes, + thats why &apos; is never serialized. Note: + Control chars are written unescaped, but if the user uses others than tab, LF + and CR the resulting XML will become invalid. + + the value of the node + flag if value is an attribute value + + + + + Writes indents and automatically includes the baseindend from the options. + + number of indents to write + forwards exception + + + Writes a char to the output. + a char + forwards writer exceptions + + + Writes a String to the output. + a String + forwards writer exceptions + + + Writes an amount of chars, mostly spaces + number of chars + a char + + + + Writes a newline according to the options. + Forwards exception + + + 11.08.2006 + + + + U+0022 ASCII space
    + U+3000, ideographic space
    + U+303F, ideographic half fill space
    + U+2000..U+200B, en quad through zero width space +
    +
    + + + U+002C, ASCII comma
    + U+FF0C, full width comma
    + U+FF64, half width ideographic comma
    + U+FE50, small comma
    + U+FE51, small ideographic comma
    + U+3001, ideographic comma
    + U+060C, Arabic comma
    + U+055D, Armenian comma +
    +
    + + + U+003B, ASCII semicolon
    + U+FF1B, full width semicolon
    + U+FE54, small semicolon
    + U+061B, Arabic semicolon
    + U+037E, Greek "semicolon" (really a question mark) +
    +
    + + + U+0022 ASCII quote
    + The square brackets are not interpreted as quotes anymore (bug #2674672) + (ASCII '[' (0x5B) and ']' (0x5D) are used as quotes in Chinese and + Korean.)
    + U+00AB and U+00BB, guillemet quotes
    + U+3008..U+300F, various quotes.
    + U+301D..U+301F, double prime quotes.
    + U+2015, dash quote.
    + U+2018..U+201F, various quotes.
    + U+2039 and U+203A, guillemet quotes. +
    +
    + + + U+0000..U+001F ASCII controls
    + U+2028, line separator.
    + U+2029, paragraph separator. +
    +
    + + Private constructor, as + + + + The XMP object containing the array to be catenated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + + The string to be used to separate the items in the catenated + string. Defaults to "; ", ASCII semicolon and space + (U+003B, U+0020). + + + The characters to be used as quotes around array items that + contain a separator. Defaults to '"' + + Option flag to control the catenation. + Returns the string containing the catenated array items. + Forwards the Exceptions from the metadata processing + + + + + see + + + The XMP object containing the array to be updated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + The string to be separated into the array items. + Option flags to control the separation. + Flag if commas shall be preserved + Forwards the Exceptions from the metadata processing + + + + Utility to find or create the array used by separateArrayItems(). + + a the namespace fo the array + the name of the array + the options for the array if newly created + the xmp object + Returns the array node. + Forwards exceptions + + + + The XMP object containing the properties to be removed. + + Optional schema namespace URI for the properties to be + removed. + + Optional path expression for the property to be removed. + + Option flag to control the deletion: do internal properties in + addition to external properties. + + + Option flag to control the deletion: Include aliases in the + "named schema" case above. + + If metadata processing fails + + + + + The source XMP object. + The destination XMP object. + Do internal properties in addition to external properties. + + Replace the values of existing properties. + Delete destination values if source property is empty. + + Forwards the Exceptions from the metadata processing + + + + + Remove all schema children according to the flag + doAllProperties. + + + Remove all schema children according to the flag + doAllProperties. Empty schemas are automatically remove + by XMPNode + + a schema node + flag if all properties or only externals shall be removed. + + Returns true if the schema is empty after the operation. + + + + The destination XMP object. + the source node + the parent of the destination node + Replace the values of existing properties. + + flag if properties with empty values should be deleted + in the destination object. + + + + + Compares two nodes including its children and qualifier. + an XMPNode + an XMPNode + Returns true if the nodes are equal, false otherwise. + Forwards exceptions to the calling method. + + + + Make sure the separator is OK. + + Make sure the separator is OK. It must be one semicolon surrounded by + zero or more spaces. Any of the recognized semicolons or spaces are + allowed. + + + + + + + Make sure the open and close quotes are a legitimate pair and return the + correct closing quote or an exception. + + opened and closing quote in a string + the open quote + Returns a corresponding closing quote. + + + + + Classifies the character into normal chars, spaces, semicola, quotes, + control chars. + + a char + Return the character kind. + + + the open quote char + Returns the matching closing quote for an open quote. + + + Add quotes to the item. + the array item + the open quote character + the closing quote character + flag if commas are allowed + Returns the value in quotes. + + + a character + the opening quote char + the closing quote char + Return it the character is a surrounding quote. + + + a character + the opening quote char + the closing quote char + Returns true if the character is a closing quote. + + + Representates an XMP XMPPath with segment accessor methods. + 28.02.2006 + + + Marks a struct field step , also for top level nodes (schema "fields"). + + + Marks a qualifier step. + + Marks a qualifier step. + Note: Order is significant to separate struct/qual from array kinds! + + + + Marks an array index step + + + stores the segments of an XMPPath + + + Append a path segment + the segment to add + + + the index of the segment to return + Returns a path segment. + + + Returns the size of the xmp path. + + + Return a single String explaining which certificate was verified, how and why. + + + + Parser for XMP XPaths. + 01.03.2006 + + + Private constructor + + + + + + + + + Parses a struct segment + the current position in the path + Retusn the segment or an errror + If the sement is empty + + + Parses an array index segment. + the xmp path + Returns the segment or an error + thrown on xmp path errors + + + + Parses the root node of an XMP Path, checks if namespace and prefix fit together + and resolve the property to the base property if it is an alias. + + the root namespace + the parsing position helper + the path to contribute to + If the path is not valid. + + + + Verifies whether the qualifier name is not XML conformant or the + namespace prefix has not been registered. + + a qualifier name + If the name is not conformant + + + Verify if an XML name is conformant. + an XML name + When the name is not XML conformant + + + + This objects contains all needed char positions to parse. + + + the complete path + + + the start of a segment name + + + the end of a segment name + + + the begin of a step + + + the end of a step + + + A segment of a parsed XMPPath. + 23.06.2006 + + + name of the path segment + + + kind of the path segment + + + flag if segment is an alias + + + alias form if applicable + + + Constructor with initial values. + the name of the segment + + + Constructor with initial values. + the name of the segment + the kind of the segment + + + Returns the kind. + + + The kind to set. + + + Returns the name. + + + The name to set. + + + the flag to set + + + Returns the alias. + + + Returns the aliasForm if this segment has been created by an alias. + + + the aliasForm to set + + + + + + Options for XMPSchemaRegistryImpl#registerAlias. + 20.02.2006 + + + The base class for a collection of 32 flag bits. + + The base class for a collection of 32 flag bits. Individual flags are defined as enum value bit + masks. Inheriting classes add convenience accessor methods. + + 24.01.2006 + + + the internal int containing all options + + + a map containing the bit names + + + The default constructor. + + + Constructor with the options bit mask. + the options bit mask + If the options are not correct + + + Resets the options. + + + an option bitmask + Returns true, if this object is equal to the given options. + + + an option bitmask + Returns true, if this object contains all given options. + + + an option bitmask + Returns true, if this object contain at least one of the given options. + + + the binary bit or bits that are requested + Returns if all of the requested bits are set or not. + + + the binary bit or bits that shall be set to the given value + the boolean value to set + + + Is friendly to access it during the tests. + Returns the options. + + + The options to set. + + + + + + + + + + Creates a human readable string from the set options. + + Creates a human readable string from the set options. Note: This method is quite + expensive and should only be used within tests or as + + + Returns a String listing all options that are set to true by their name, + like "option1 | option4". + + + + Returns the options as hex bitmask. + + + To be implemeted by inheritants. + Returns a bit mask where all valid option bits are set. + + + To be implemeted by inheritants. + a single, valid option bit. + Returns a human readable name for an option bit. + + + The inheriting option class can do additional checks on the options. + + The inheriting option class can do additional checks on the options. + Note: For performance reasons this method is only called + when setting bitmasks directly. + When get- and set-methods are used, this method must be called manually, + normally only when the Options-object has been created from a client + (it has to be made public therefore). + + the bitmask to check. + Thrown if the options are not consistent. + + + Checks options before they are set. + + Checks options before they are set. + First it is checked if only defined options are used, + second the additional + + -method is called. + + the options to check + Thrown if the options are invalid. + + + Looks up or asks the inherited class for the name of an option bit. + + Looks up or asks the inherited class for the name of an option bit. + Its save that there is only one valid option handed into the method. + + a single option bit + Returns the option name or undefined. + + + Returns the optionNames map and creates it if required. + + + This is a direct mapping. + This is a direct mapping. The actual data type does not matter. + + + The actual is an unordered array, the alias is to the first element of the array. + + + The actual is an ordered array, the alias is to the first element of the array. + + + The actual is an alternate array, the alias is to the first element of the array. + + + The actual is an alternate text array, the alias is to the 'x-default' element of the array. + + + + + + the options to init with + If options are not consistant + + + Returns if the alias is of the simple form. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + + returns a + + s object + + If the options are not consistant. + + + + + + + + + Options for XMPIterator construction. + 24.01.2006 + + + Just do the immediate children of the root, default is subtree. + + + Just do the leaf nodes, default is all nodes in the subtree. + + Just do the leaf nodes, default is all nodes in the subtree. + Bugfix #2658965: If this option is set the Iterator returns the namespace + of the leaf instead of the namespace of the base property. + + + + Return just the leaf part of the path, default is the full path. + + + Omit all qualifiers. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Returns whether the option is set. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + Sets the option and returns the instance. + the value to set + Returns the instance to call more set-methods. + + + + + + + + + + Options for + + . + + 24.01.2006 + + + Require a surrounding "x:xmpmeta" element in the xml-document. + + + Do not reconcile alias differences, throw an exception instead. + + + Convert ASCII control characters 0x01 - 0x1F (except tab, cr, and lf) to spaces. + + + If the input is not unicode, try to parse it as ISO-8859-1. + + + Do not carry run the XMPNormalizer on a packet, leave it as it is. + + + Sets the options to the default values. + + + Returns the requireXMPMeta. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the strictAliasing. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option "omit normalization". + + + the value to set + Returns the instance to call more set-methods. + + + + + + + + + + The property flags are used when properties are fetched from the XMPMeta-object + and provide more detailed information about the property. + + 03.07.2006 + + + may be used in the future + + + Updated by iText. + Updated by iText. Indicates if the property should be writted as a separate node + + + Default constructor + + + Intialization constructor + the initialization options + If the options are not valid + + + + Return whether the property value is a URI. It is serialized to RDF using the + rdf:resource attribute. Not mandatory for URIs, but considered RDF-savvy. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether the property has qualifiers. These could be an xml:lang + attribute, an rdf:type property, or a general qualifier. See the + introductory discussion of qualified properties for more information. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is a qualifier for some other property. Note that if the + qualifier itself has a structured value, this flag is only set for the top node of + the qualifier's subtree. Qualifiers may have arbitrary structure, and may even have + qualifiers. + + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property has an xml:lang qualifier. + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property has an rdf:type qualifier. + + + the value to set + Returns this to enable cascaded options. + + + Return whether this property contains nested fields. + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an array. By itself this indicates a general + unordered array. It is serialized using an rdf:Bag container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an ordered array. Appears in conjunction with + getPropValueIsArray(). It is serialized using an rdf:Seq container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an alternative array. Appears in conjunction with + getPropValueIsArray(). It is serialized using an rdf:Alt container. + + + + the value to set + Returns this to enable cascaded options. + + + + Return whether this property is an alt-text array. Appears in conjunction with + getPropArrayIsAlternate(). It is serialized using an rdf:Alt container. + Each array element is a simple property with an xml:lang attribute. + + + + the value to set + Returns this to enable cascaded options. + + + Returns whether the SCHEMA_NODE option is set. + + + the option DELETE_EXISTING to set + Returns this to enable cascaded options. + + + Returns whether the property is of composite type - an array or a struct. + + + Returns whether the property is of composite type - an array or a struct. + + + Compares two options set for array compatibility. + other options + Returns true if the array options of the sets are equal. + + + Merges the set options of a another options object with this. + + Merges the set options of a another options object with this. + If the other options set is null, this objects stays the same. + + other options + If illegal options are provided + + + Returns true if only array options are set. + + + + + + + + + + Checks that a node not a struct and array at the same time; + and URI cannot be a struct. + + the bitmask to check. + Thrown if the options are not consistent. + + + + Omit the XML packet wrapper. + + + Mark packet as read-only. + Mark packet as read-only. Default is a writeable packet. + + + Use a compact form of RDF. + + Use a compact form of RDF. + The compact form is the default serialization format (this flag is technically ignored). + To serialize to the canonical form, set the flag USE_CANONICAL_FORMAT. + If both flags "compact" and "canonical" are set, canonical is used. + + + + Use the canonical form of RDF if set. + Use the canonical form of RDF if set. By default the compact form is used + + + Include a padding allowance for a thumbnail image. + + Include a padding allowance for a thumbnail image. If no xmp:Thumbnails property + is present, the typical space for a JPEG thumbnail is used. + + + + The padding parameter provides the overall packet length. + + The padding parameter provides the overall packet length. The actual amount of padding is + computed. An exception is thrown if the packet exceeds this length with no padding. + + + + + Sort the struct properties and qualifier before serializing + + + Bit indicating little endian encoding, unset is big endian + + + Bit indication UTF16 encoding. + + + UTF8 encoding; this is the default + + + UTF16BE encoding + + + UTF16LE encoding + + + The amount of padding to be added if a writeable XML packet is created. + + The amount of padding to be added if a writeable XML packet is created. If zero is passed + (the default) an appropriate amount of padding is computed. + + + + The string to be used as a line terminator. + + The string to be used as a line terminator. If empty it defaults to; linefeed, U+000A, the + standard XML newline. + + + + + The string to be used for each level of indentation in the serialized + RDF. + + + The string to be used for each level of indentation in the serialized + RDF. If empty it defaults to two ASCII spaces, U+0020. + + + + + The number of levels of indentation to be used for the outermost XML element in the + serialized RDF. + + + The number of levels of indentation to be used for the outermost XML element in the + serialized RDF. This is convenient when embedding the RDF in other text, defaults to 0. + + + + Omits the Toolkit version attribute, not published, only used for Unit tests. + + + Default constructor. + + + Constructor using inital options + the inital options + Thrown if options are not consistant. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the option. + + + the value to set + Returns the instance to call more set-methods. + + + Returns the baseIndent. + + + The baseIndent to set. + Returns the instance to call more set-methods. + + + Returns the indent. + + + The indent to set. + Returns the instance to call more set-methods. + + + Returns the newline. + + + The newline to set. + Returns the instance to call more set-methods. + + + Returns the padding. + + + The padding to set. + Returns the instance to call more set-methods. + + + + Returns whether the Toolkit version attribute shall be omitted. + Note: This options can only be set by unit tests. + + + + Returns the encoding as Java encoding String. + + + Returns clone of this SerializeOptions-object with the same options set. + Cannot happen in this place. + + + + + + + + + Class that contains several constants. + + + External Contributors to the resource (other than the authors). + + + The extent or scope of the resource. + + + The authors of the resource (listed in order of precedence, if significant). + + + Date(s) that something interesting happened to the resource. + + + A textual description of the content of the resource. + A textual description of the content of the resource. Multiple values may be present for different languages. + + + + The file format used when saving the resource. + The file format used when saving the resource. Tools and applications should set this property to the save format of the data. It may include appropriate qualifiers. + + + + An unordered array of text strings that unambiguously identify the resource within a given context. + + + + An unordered array specifying the languages used in the resource. + + + Publishers. + + + Relationships to other documents. + + + Informal rights statement, selected by language. + + + Unique identifier of the work from which this resource was derived. + + + An unordered array of descriptive phrases or keywords that specify the topic of the content of the resource. + + + + The title of the document, or the name given to the resource. + The title of the document, or the name given to the resource. Typically, it will be a name by which the resource is formally known. + + + + A document type; for example, novel, poem, or working paper. + + + Keywords. + + + The PDF file version (for example: 1.0, 1.3, and so on). + + + The Producer. + + + The part + + + An unordered array specifying properties that were edited outside the authoring application. + An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single namespace and XPath separated by one ASCII space (U+0020). + + + + The base URL for relative URLs in the document content. + The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. Web authoring tools should set the value based on their notion of where URLs will be interpreted. + + + + The date and time the resource was originally created. + + + The name of the first known tool used to create the resource. + The name of the first known tool used to create the resource. If history is present in the metadata, this value should be equivalent to that of xmpMM:History's softwareAgent property. + + + + The date and time that any metadata for this resource was last changed. + + + The date and time the resource was last modified. + + + A short informal name for the resource. + + + An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding. + + + + + A factory to create XMPDateTime-instances from a Calendar or an + ISO 8601 string or for the current time. + + 16.02.2006 + + + Private constructor + + + Creates an XMPDateTime from a Calendar-object. + + a Calendar-object. + An XMPDateTime-object. + + + Creates an empty XMPDateTime-object. + Returns an XMPDateTime-object. + + + Creates an XMPDateTime-object from initial values. + years + + months from 1 to 12
    + Note: Remember that the month in + + is defined from 0 to 11. + + days + Returns an XMPDateTime-object. +
    + + Creates an XMPDateTime-object from initial values. + years + + months from 1 to 12
    + Note: Remember that the month in + + is defined from 0 to 11. + + days + hours + minutes + seconds + nanoseconds + Returns an XMPDateTime-object. +
    + + Creates an XMPDateTime from an ISO 8601 string. + The ISO 8601 string representation of the date/time. + An XMPDateTime-object. + When the ISO 8601 string is non-conform + + + + Obtain the current date and time. + + Returns The returned time is UTC, properly adjusted for the local time zone. The + resolution of the time is not guaranteed to be finer than seconds. + + + + + Sets the local time zone without touching any other Any existing time zone value is replaced, + the other date/time fields are not adjusted in any way. + + the XMPDateTime variable containing the value to be modified. + + Returns an updated XMPDateTime-object. + + + Make sure a time is UTC. + + Make sure a time is UTC. If the time zone is not UTC, the time is + adjusted and the time zone set to be UTC. + + + the XMPDateTime variable containing the time to + be modified. + + Returns an updated XMPDateTime-object. + + + Make sure a time is local. + + Make sure a time is local. If the time zone is not the local zone, the time is adjusted and + the time zone set to be local. + + the XMPDateTime variable containing the time to be modified. + + Returns an updated XMPDateTime-object. + + + 21.09.2006 + + + Note: This is an error code introduced by Java. + + + This exception wraps all errors that occur in the XMP Toolkit. + 16.02.2006 + + + the errorCode of the XMP toolkit + + + Constructs an exception with a message and an error code. + the message + the error code + + + Constructs an exception with a message, an error code and a Throwable + the error message. + the error code + the exception source + + + Returns the errorCode. + + + Creates XMPMeta-instances from an InputStream + 30.01.2006 + + + The singleton instance of the XMPSchemaRegistry. + + + cache for version info + + + Hides public constructor + + + Returns the singleton instance of the XMPSchemaRegistry. + + + Returns an empty XMPMeta-object. + + + Parsing with default options. + an InputStream + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + + Parsing with default options. + a String contain an XMP-file. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Creates an XMPMeta-object from a string. + a String contain an XMP-file. + Options controlling the parsing. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Parsing with default options. + a String contain an XMP-file. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + Creates an XMPMeta-object from a byte-buffer. + a String contain an XMP-file. + Options controlling the parsing. + Returns the XMPMeta-object created from the input. + If the file is not well-formed XML or if the parsing fails. + + + + + + Serializes an XMPMeta-object as RDF into an OutputStream + with default options. + + a metadata object + an OutputStream to write the serialized RDF to. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into an OutputStream. + a metadata object + + Options to control the serialization (see + + ). + + an OutputStream to write the serialized RDF to. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into a byte buffer. + a metadata object + + Options to control the serialization (see + + ). + + Returns a byte buffer containing the serialized RDF. + on serializsation errors. + + + + Serializes an XMPMeta-object as RDF into a string. + + Serializes an XMPMeta-object as RDF into a string. Note: Encoding + is ignored when serializing to a string. + + a metadata object + + Options to control the serialization (see + + ). + + Returns a string containing the serialized RDF. + on serializsation errors. + + + + Asserts that xmp is compatible to XMPMetaImpl.s + + + Resets the schema registry to its original state (creates a new one). + + Resets the schema registry to its original state (creates a new one). + Be careful this might break all existing XMPMeta-objects and should be used + only for testing purpurses. + + + + Obtain version information. + + Obtain version information. The XMPVersionInfo singleton is created the first time + its requested. + + Returns the version information. + + + + Returns the primary release number, the "1" in version "1.2.3". + + + Returns the secondary release number, the "2" in version "1.2.3". + + + Returns the tertiary release number, the "3" in version "1.2.3". + + + Returns a rolling build number, monotonically increasing in a release. + + + Returns true if this is a debug build. + + + Returns a comprehensive version information string. + + + + Private constructor + + + Compose the path expression for an item in an array. + + The name of the array. May be a general path expression, must not be + null or the empty string. + + + The index of the desired item. Arrays in XMP are indexed from 1. + 0 and below means last array item and renders as [last()]. + + + Returns the composed path basing on fullPath. This will be of the form + ns:arrayName[i], where "ns" is the prefix for schemaNS and + "i" is the decimal representation of itemIndex. + + Throws exeption if index zero is used. + + + + Compose the path expression for a field in a struct. + + Compose the path expression for a field in a struct. The result can be added to the + path of + + + The namespace URI for the field. Must not be null or the empty + string. + + + The name of the field. Must be a simple XML name, must not be + null or the empty string. + + + Returns the composed path. This will be of the form + ns:structName/fNS:fieldName, where "ns" is the prefix for + schemaNS and "fNS" is the prefix for fieldNS. + + Thrown if the path to create is not valid. + + + + Compose the path expression for a qualifier. + + The namespace URI for the qualifier. May be null or the empty + string if the qualifier is in the XML empty namespace. + + + The name of the qualifier. Must be a simple XML name, must not be + null or the empty string. + + + Returns the composed path. This will be of the form + ns:propName/?qNS:qualName, where "ns" is the prefix for + schemaNS and "qNS" is the prefix for qualNS. + + Thrown if the path to create is not valid. + + + + Compose the path expression to select an alternate item by language. + + Compose the path expression to select an alternate item by language. The + path syntax allows two forms of "content addressing" that may + be used to select an item in an array of alternatives. The form used in + ComposeLangSelector lets you select an item in an alt-text array based on + the value of its xml:lang qualifier. The other form of content + addressing is shown in ComposeFieldSelector. \note ComposeLangSelector + does not supplant SetLocalizedText or GetLocalizedText. They should + generally be used, as they provide extra logic to choose the appropriate + language and maintain consistency with the 'x-default' value. + ComposeLangSelector gives you an path expression that is explicitly and + only for the language given in the langName parameter. + + + The name of the array. May be a general path expression, must + not be null or the empty string. + + The RFC 3066 code for the desired language. + + Returns the composed path. This will be of the form + ns:arrayName[@xml:lang='langName'], where + "ns" is the prefix for schemaNS. + + + + + ParameterAsserts that a qualifier namespace is set. + a qualifier namespace + Qualifier schema is null or empty + + + + ParameterAsserts that a qualifier name is set. + a qualifier name or path + Qualifier name is null or empty + + + + ParameterAsserts that a struct field namespace is set. + a struct field namespace + Struct field schema is null or empty + + + + ParameterAsserts that a struct field name is set. + a struct field name or path + Struct field name is null or empty + + + + Utility methods for XMP. + + Utility methods for XMP. I included only those that are different from the + Java default conversion utilities. + + 21.02.2006 + + + Private constructor + + + Create a single edit string from an array of strings. + The XMP object containing the array to be catenated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + + The string to be used to separate the items in the catenated + string. Defaults to "; ", ASCII semicolon and space + (U+003B, U+0020). + + + The characters to be used as quotes around array items that + contain a separator. Defaults to '"' + + Option flag to control the catenation. + Returns the string containing the catenated array items. + Forwards the Exceptions from the metadata processing + + + + Separate a single edit string into an array of strings. + The XMP object containing the array to be updated. + + The schema namespace URI for the array. Must not be null or + the empty string. + + + The name of the array. May be a general path expression, must + not be null or the empty string. Each item in the array must + be a simple string value. + + The string to be separated into the array items. + Option flags to control the separation. + Flag if commas shall be preserved + Forwards the Exceptions from the metadata processing + + + + + Alias without the new option deleteEmptyValues. + The source XMP object. + The destination XMP object. + Do internal properties in addition to external properties. + Replace the values of existing properties. + Forwards the Exceptions from the metadata processing + + + + + + Convert from boolean to string. + a boolean value + + The XMP string representation of the boolean. The values used are + given by the constnts + + and + + . + + + + Converts a string value to an int. + the string value + Returns an int. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from int to string. + an int value + The string representation of the int. + + + Converts a string value to a long. + the string value + Returns a long. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from long to string. + a long value + The string representation of the long. + + + Converts a string value to a double. + the string value + Returns a double. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from long to string. + a long value + The string representation of the long. + + + Converts a string value to an XMPDateTime. + the string value + Returns an XMPDateTime-object. + + If the rawValue is null or empty or the + conversion fails. + + + + + Convert from XMPDateTime to string. + an XMPDateTime + The string representation of the long. + + + Convert from a byte array to a base64 encoded string. + the byte array to be converted + Returns the base64 string. + + + Decode from Base64 encoded string to raw data. + a base64 encoded string + Returns a byte array containg the decoded string. + Thrown if the given string is not property base64 encoded + + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + Return the DER encoding of the object, null if the DER encoding can not be made. + + @return a DER byte array, null otherwise. + + + a general purpose ASN.1 decoder - note: this class differs from the + others in that it returns null after it has read the last object in + the stream. If an ASN.1 Null is encountered a Der/BER Null object is + returned. + + + Create an ASN1InputStream where no DER object will be longer than limit. + + @param input stream containing ASN.1 encoded data. + @param limit maximum size of a DER encoded object. + + + Create an ASN1InputStream based on the input byte array. The length of DER objects in + the stream is automatically limited to the length of the input array. + + @param input array containing ASN.1 encoded data. + + + build an object given its tag and the number of bytes to construct it from. + + + A Null object. + + + Create a base ASN.1 object from a byte array. + The byte array to parse. + The base ASN.1 object represented by the byte array. + If there is a problem parsing the data. + + + Read a base ASN.1 object from a stream. + The stream to parse. + The base ASN.1 object represented by the byte array. + If there is a problem parsing the data. + + + return an Octet string from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return an Octet string from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + @param string the octets making up the octet string. + + + return an Asn1Sequence from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Return an ASN1 sequence from a tagged object. There is a special + case here, if an object appears to have been explicitly tagged on + reading but we were expecting it to be implicitly tagged in the + normal course of events it indicates that we lost the surrounding + sequence - so we need to add it back (this will happen if the tagged + object is a sequence that contains other sequences). If you are + dealing with implicitly tagged sequences you really should + be using this method. + + @param obj the tagged object. + @param explicitly true if the object is meant to be explicitly tagged, + false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return the object at the sequence position indicated by index. + + @param index the sequence number (starting at zero) of the object + @return the object at the sequence position indicated by index. + + + return an ASN1Set from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Return an ASN1 set from a tagged object. There is a special + case here, if an object appears to have been explicitly tagged on + reading but we were expecting it to be implicitly tagged in the + normal course of events it indicates that we lost the surrounding + set - so we need to add it back (this will happen if the tagged + object is a sequence that contains other sequences). If you are + dealing with implicitly tagged sets you really should + be using this method. + + @param obj the tagged object. + @param explicitly true if the object is meant to be explicitly tagged + false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return the object at the set position indicated by index. + + @param index the set number (starting at zero) of the object + @return the object at the set position indicated by index. + + + ASN.1 TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if the object is explicitly tagged. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + return whether or not the object may be explicitly tagged. +

    + Note: if the object has been read from an input stream, the only + time you can be sure if isExplicit is returning the true state of + affairs is if it returns false. An implicitly tagged object may appear + to be explicitly tagged, so you need to understand the context under + which the reading was done as well, see GetObject below.

    +
    + + return whatever was following the tag. +

    + Note: tagged objects are generally context dependent if you're + trying to extract a tagged object you should be going via the + appropriate GetInstance method.

    +
    + + Return the object held in this tagged object as a parser assuming it has + the type of the passed in tag. If the object doesn't have a parser + associated with it, the base object is returned. + + + Base class for an application specific object + + + Return the enclosed object assuming explicit tagging. + + @return the resulting object + @throws IOException if reconstruction fails. + + + Return the enclosed object assuming implicit tagging. + + @param derTagNo the type tag that should be applied to the object's contents. + @return the resulting object + @throws IOException if reconstruction fails. + + + basic interface for Der string objects. + + + return a Bit string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return a Bit string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + @param data the octets making up the bit string. + @param padBits the number of extra bits at the end of the string. + + + Return the octets contained in this BIT STRING, checking that this BIT STRING really + does represent an octet aligned string. Only use this method when the standard you are + following dictates that the BIT STRING will be octet aligned. + + @return a copy of the octet aligned data. + + + @return the value of the bit string as an int (truncating if necessary) + + + A BER Null object. + + + A Null object. + + + The octets making up the octet string. + + + convert a vector of octet strings into a single byte string + + + The octets making up the octet string. + + + return the DER octets that make up this string. + + + create an empty sequence + + + create a sequence containing one object + + + create a sequence containing a vector of objects. + + + create an empty sequence + + + create a sequence containing one object + + + create a sequence containing a vector of objects. + + + A Der encoded set object + + + create an empty set + + + @param obj - a single object that makes up the set. + + + @param v - a vector of objects making up the set. + + + create an empty sequence + + + create a set containing one object + + + create a set containing a vector of objects. + + + BER TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + DER TaggedObject - in ASN.1 notation this is any object preceded by + a [n] where n is some number - these are assumed to follow the construction + rules (as with sequences). + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if an explicitly tagged object. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + create an implicitly tagged object that contains a zero + length sequence. + + + @param tagNo the tag number for this object. + @param obj the tagged object. + + + @param explicitly true if an explicitly tagged object. + @param tagNo the tag number for this object. + @param obj the tagged object. + + + create an implicitly tagged object that contains a zero + length sequence. + + +
    +            CAKeyUpdAnnContent ::= SEQUENCE {
    +                                        oldWithNew   CmpCertificate, -- old pub signed with new priv
    +                                        newWithOld   CmpCertificate, -- new pub signed with old priv
    +                                        newWithNew   CmpCertificate  -- new pub signed with new priv
    +             }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertConfirmContent ::= SEQUENCE OF CertStatus
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertifiedKeyPair ::= SEQUENCE {
    +                                             certOrEncCert       CertOrEncCert,
    +                                             privateKey      [0] EncryptedValue      OPTIONAL,
    +                                             -- see [CRMF] for comment on encoding
    +                                             publicationInfo [1] PKIPublicationInfo  OPTIONAL
    +                  }
    +            
    + @return a basic ASN.1 object representation. +
    + + Marker interface for CHOICE objects - if you implement this in a roll-your-own + object, any attempt to tag the object implicitly will convert the tag to an + explicit one as the encoding rules require. +

    + If you use this interface your class should also implement the getInstance + pattern which takes a tag object and the tagging mode used. +

    +
    + +
    +            CertOrEncCert ::= CHOICE {
    +                                 certificate     [0] CMPCertificate,
    +                                 encryptedCert   [1] EncryptedValue
    +                      }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertRepMessage ::= SEQUENCE {
    +                                     caPubs       [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
    +                                                                                        OPTIONAL,
    +                                     response         SEQUENCE OF CertResponse
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertResponse ::= SEQUENCE {
    +                                       certReqId           INTEGER,
    +                                       -- to match this response with corresponding request (a value
    +                                       -- of -1 is to be used if certReqId is not specified in the
    +                                       -- corresponding request)
    +                                       status              PKIStatusInfo,
    +                                       certifiedKeyPair    CertifiedKeyPair    OPTIONAL,
    +                                       rspInfo             OCTET STRING        OPTIONAL
    +                                       -- analogous to the id-regInfo-utf8Pairs string defined
    +                                       -- for regInfo in CertReqMsg [CRMF]
    +                        }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertStatus ::= SEQUENCE {
    +                              certHash    OCTET STRING,
    +                              -- the hash of the certificate, using the same hash algorithm
    +                              -- as is used to create and verify the certificate signature
    +                              certReqId   INTEGER,
    +                              -- to match this confirmation with the corresponding req/rep
    +                              statusInfo  PKIStatusInfo OPTIONAL
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +             Challenge ::= SEQUENCE {
    +                             owf                 AlgorithmIdentifier  OPTIONAL,
    +            
    +                             -- MUST be present in the first Challenge; MAY be omitted in
    +                             -- any subsequent Challenge in POPODecKeyChallContent (if
    +                             -- omitted, then the owf used in the immediately preceding
    +                             -- Challenge is to be used).
    +            
    +                             witness             OCTET STRING,
    +                             -- the result of applying the one-way function (owf) to a
    +                             -- randomly-generated INTEGER, A.  [Note that a different
    +                             -- INTEGER MUST be used for each Challenge.]
    +                             challenge           OCTET STRING
    +                             -- the encryption (under the public key for which the cert.
    +                             -- request is being made) of Rand, where Rand is specified as
    +                             --   Rand ::= SEQUENCE {
    +                             --      int      INTEGER,
    +                             --       - the randomly-generated INTEGER A (above)
    +                             --      sender   GeneralName
    +                             --       - the sender's name (as included in PKIHeader)
    +                             --   }
    +                  }
    +             
    + @return a basic ASN.1 object representation. +
    + + Note: the addition of attribute certificates is a BC extension. + + +
    +             CMPCertificate ::= CHOICE {
    +                        x509v3PKCert        Certificate
    +                        x509v2AttrCert      [1] AttributeCertificate
    +              }
    +             
    + Note: the addition of attribute certificates is a BC extension. + + @return a basic ASN.1 object representation. +
    + +
    +            CrlAnnContent ::= SEQUENCE OF CertificateList
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            ErrorMsgContent ::= SEQUENCE {
    +                                   pKIStatusInfo          PKIStatusInfo,
    +                                   errorCode              INTEGER           OPTIONAL,
    +                                   -- implementation-specific error codes
    +                                   errorDetails           PKIFreeText       OPTIONAL
    +                                   -- implementation-specific error details
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            GenRepContent ::= SEQUENCE OF InfoTypeAndValue
    +            
    + @return a basic ASN.1 object representation. +
    + + Example InfoTypeAndValue contents include, but are not limited + to, the following (un-comment in this ASN.1 module and use as + appropriate for a given environment): +
    +               id-it-caProtEncCert    OBJECT IDENTIFIER ::= {id-it 1}
    +                  CAProtEncCertValue      ::= CMPCertificate
    +               id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2}
    +                 SignKeyPairTypesValue   ::= SEQUENCE OF AlgorithmIdentifier
    +               id-it-encKeyPairTypes  OBJECT IDENTIFIER ::= {id-it 3}
    +                 EncKeyPairTypesValue    ::= SEQUENCE OF AlgorithmIdentifier
    +               id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4}
    +                  PreferredSymmAlgValue   ::= AlgorithmIdentifier
    +               id-it-caKeyUpdateInfo  OBJECT IDENTIFIER ::= {id-it 5}
    +                  CAKeyUpdateInfoValue    ::= CAKeyUpdAnnContent
    +               id-it-currentCRL       OBJECT IDENTIFIER ::= {id-it 6}
    +                  CurrentCRLValue         ::= CertificateList
    +               id-it-unsupportedOIDs  OBJECT IDENTIFIER ::= {id-it 7}
    +                  UnsupportedOIDsValue    ::= SEQUENCE OF OBJECT IDENTIFIER
    +               id-it-keyPairParamReq  OBJECT IDENTIFIER ::= {id-it 10}
    +                  KeyPairParamReqValue    ::= OBJECT IDENTIFIER
    +               id-it-keyPairParamRep  OBJECT IDENTIFIER ::= {id-it 11}
    +                  KeyPairParamRepValue    ::= AlgorithmIdentifer
    +               id-it-revPassphrase    OBJECT IDENTIFIER ::= {id-it 12}
    +                  RevPassphraseValue      ::= EncryptedValue
    +               id-it-implicitConfirm  OBJECT IDENTIFIER ::= {id-it 13}
    +                  ImplicitConfirmValue    ::= NULL
    +               id-it-confirmWaitTime  OBJECT IDENTIFIER ::= {id-it 14}
    +                  ConfirmWaitTimeValue    ::= GeneralizedTime
    +               id-it-origPKIMessage   OBJECT IDENTIFIER ::= {id-it 15}
    +                  OrigPKIMessageValue     ::= PKIMessages
    +               id-it-suppLangTags     OBJECT IDENTIFIER ::= {id-it 16}
    +                  SuppLangTagsValue       ::= SEQUENCE OF UTF8String
    +            
    +             where
    +            
    +               id-pkix OBJECT IDENTIFIER ::= {
    +                  iso(1) identified-organization(3)
    +                  dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
    +             and
    +                  id-it   OBJECT IDENTIFIER ::= {id-pkix 4}
    +             
    +
    + +
    +            InfoTypeAndValue ::= SEQUENCE {
    +                                    infoType               OBJECT IDENTIFIER,
    +                                    infoValue              ANY DEFINED BY infoType  OPTIONAL
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            KeyRecRepContent ::= SEQUENCE {
    +                                    status                  PKIStatusInfo,
    +                                    newSigCert          [0] CMPCertificate OPTIONAL,
    +                                    caCerts             [1] SEQUENCE SIZE (1..MAX) OF
    +                                                                      CMPCertificate OPTIONAL,
    +                                    keyPairHist         [2] SEQUENCE SIZE (1..MAX) OF
    +                                                                      CertifiedKeyPair OPTIONAL
    +                         }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            OobCertHash ::= SEQUENCE {
    +                                 hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
    +                                 certId      [1] CertId                  OPTIONAL,
    +                                 hashVal         BIT STRING
    +                                 -- hashVal is calculated over the Der encoding of the
    +                                 -- self-signed certificate with the identifier certID.
    +                  }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +             PbmParameter ::= SEQUENCE {
    +                                   salt                OCTET STRING,
    +                                   -- note:  implementations MAY wish to limit acceptable sizes
    +                                   -- of this string to values appropriate for their environment
    +                                   -- in order to reduce the risk of denial-of-service attacks
    +                                   owf                 AlgorithmIdentifier,
    +                                   -- AlgId for a One-Way Function (SHA-1 recommended)
    +                                   iterationCount      INTEGER,
    +                                   -- number of times the OWF is applied
    +                                   -- note:  implementations MAY wish to limit acceptable sizes
    +                                   -- of this integer to values appropriate for their environment
    +                                   -- in order to reduce the risk of denial-of-service attacks
    +                                   mac                 AlgorithmIdentifier
    +                                   -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
    +               }   -- or HMAC [RFC2104, RFC2202])
    +            
    + @return a basic ASN.1 object representation. +
    + + Creates a new PkiBody. + @param type one of the TYPE_* constants + @param content message content + + +
    +            PkiBody ::= CHOICE {       -- message-specific body elements
    +                   ir       [0]  CertReqMessages,        --Initialization Request
    +                   ip       [1]  CertRepMessage,         --Initialization Response
    +                   cr       [2]  CertReqMessages,        --Certification Request
    +                   cp       [3]  CertRepMessage,         --Certification Response
    +                   p10cr    [4]  CertificationRequest,   --imported from [PKCS10]
    +                   popdecc  [5]  POPODecKeyChallContent, --pop Challenge
    +                   popdecr  [6]  POPODecKeyRespContent,  --pop Response
    +                   kur      [7]  CertReqMessages,        --Key Update Request
    +                   kup      [8]  CertRepMessage,         --Key Update Response
    +                   krr      [9]  CertReqMessages,        --Key Recovery Request
    +                   krp      [10] KeyRecRepContent,       --Key Recovery Response
    +                   rr       [11] RevReqContent,          --Revocation Request
    +                   rp       [12] RevRepContent,          --Revocation Response
    +                   ccr      [13] CertReqMessages,        --Cross-Cert. Request
    +                   ccp      [14] CertRepMessage,         --Cross-Cert. Response
    +                   ckuann   [15] CAKeyUpdAnnContent,     --CA Key Update Ann.
    +                   cann     [16] CertAnnContent,         --Certificate Ann.
    +                   rann     [17] RevAnnContent,          --Revocation Ann.
    +                   crlann   [18] CRLAnnContent,          --CRL Announcement
    +                   pkiconf  [19] PKIConfirmContent,      --Confirmation
    +                   nested   [20] NestedMessageContent,   --Nested Message
    +                   genm     [21] GenMsgContent,          --General Message
    +                   genp     [22] GenRepContent,          --General Response
    +                   error    [23] ErrorMsgContent,        --Error Message
    +                   certConf [24] CertConfirmContent,     --Certificate confirm
    +                   pollReq  [25] PollReqContent,         --Polling request
    +                   pollRep  [26] PollRepContent          --Polling response
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PkiConfirmContent ::= NULL
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PKIFailureInfo ::= BIT STRING {
    +            badAlg               (0),
    +              -- unrecognized or unsupported Algorithm Identifier
    +            badMessageCheck      (1), -- integrity check failed (e.g., signature did not verify)
    +            badRequest           (2),
    +              -- transaction not permitted or supported
    +            badTime              (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
    +            badCertId            (4), -- no certificate could be found matching the provided criteria
    +            badDataFormat        (5),
    +              -- the data submitted has the wrong format
    +            wrongAuthority       (6), -- the authority indicated in the request is different from the one creating the response token
    +            incorrectData        (7), -- the requester's data is incorrect (for notary services)
    +            missingTimeStamp     (8), -- when the timestamp is missing but should be there (by policy)
    +            badPOP               (9)  -- the proof-of-possession failed
    +            certRevoked         (10),
    +            certConfirmed       (11),
    +            wrongIntegrity      (12),
    +            badRecipientNonce   (13), 
    +            timeNotAvailable    (14),
    +              -- the TSA's time source is not available
    +            unacceptedPolicy    (15),
    +              -- the requested TSA policy is not supported by the TSA
    +            unacceptedExtension (16),
    +              -- the requested extension is not supported by the TSA
    +            addInfoNotAvailable (17)
    +              -- the additional information requested could not be understood
    +              -- or is not available
    +            badSenderNonce      (18),
    +            badCertTemplate     (19),
    +            signerNotTrusted    (20),
    +            transactionIdInUse  (21),
    +            unsupportedVersion  (22),
    +            notAuthorized       (23),
    +            systemUnavail       (24),    
    +            systemFailure       (25),
    +              -- the request cannot be handled due to system failure
    +            duplicateCertReq    (26) 
    +            
    +
    + + Basic constructor. + + +
    +            PkiFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
    +            
    +
    + + Return the number of string elements present. + + @return number of elements present. + + + Return the UTF8STRING at index. + + @param index index of the string of interest + @return the string at index. + + + Value for a "null" recipient or sender. + + +
    +             PkiHeader ::= SEQUENCE {
    +                       pvno                INTEGER     { cmp1999(1), cmp2000(2) },
    +                       sender              GeneralName,
    +                       -- identifies the sender
    +                       recipient           GeneralName,
    +                       -- identifies the intended recipient
    +                       messageTime     [0] GeneralizedTime         OPTIONAL,
    +                       -- time of production of this message (used when sender
    +                       -- believes that the transport will be "suitable"; i.e.,
    +                       -- that the time will still be meaningful upon receipt)
    +                       protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
    +                       -- algorithm used for calculation of protection bits
    +                       senderKID       [2] KeyIdentifier           OPTIONAL,
    +                       recipKID        [3] KeyIdentifier           OPTIONAL,
    +                       -- to identify specific keys used for protection
    +                       transactionID   [4] OCTET STRING            OPTIONAL,
    +                       -- identifies the transaction; i.e., this will be the same in
    +                       -- corresponding request, response, certConf, and PKIConf
    +                       -- messages
    +                       senderNonce     [5] OCTET STRING            OPTIONAL,
    +                       recipNonce      [6] OCTET STRING            OPTIONAL,
    +                       -- nonces used to provide replay protection, senderNonce
    +                       -- is inserted by the creator of this message; recipNonce
    +                       -- is a nonce previously inserted in a related message by
    +                       -- the intended recipient of this message
    +                       freeText        [7] PKIFreeText             OPTIONAL,
    +                       -- this may be used to indicate context-specific instructions
    +                       -- (this field is intended for human consumption)
    +                       generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
    +                                            InfoTypeAndValue     OPTIONAL
    +                       -- this may be used to convey context-specific information
    +                       -- (this field not primarily intended for human consumption)
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +             PKIHeader ::= SEQUENCE {
    +                       pvno                INTEGER     { cmp1999(1), cmp2000(2) },
    +                       sender              GeneralName,
    +                       -- identifies the sender
    +                       recipient           GeneralName,
    +                       -- identifies the intended recipient
    +                       messageTime     [0] GeneralizedTime         OPTIONAL,
    +                       -- time of production of this message (used when sender
    +                       -- believes that the transport will be "suitable"; i.e.,
    +                       -- that the time will still be meaningful upon receipt)
    +                       protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
    +                       -- algorithm used for calculation of protection bits
    +                       senderKID       [2] KeyIdentifier           OPTIONAL,
    +                       recipKID        [3] KeyIdentifier           OPTIONAL,
    +                       -- to identify specific keys used for protection
    +                       transactionID   [4] OCTET STRING            OPTIONAL,
    +                       -- identifies the transaction; i.e., this will be the same in
    +                       -- corresponding request, response, certConf, and PKIConf
    +                       -- messages
    +                       senderNonce     [5] OCTET STRING            OPTIONAL,
    +                       recipNonce      [6] OCTET STRING            OPTIONAL,
    +                       -- nonces used to provide replay protection, senderNonce
    +                       -- is inserted by the creator of this message; recipNonce
    +                       -- is a nonce previously inserted in a related message by
    +                       -- the intended recipient of this message
    +                       freeText        [7] PKIFreeText             OPTIONAL,
    +                       -- this may be used to indicate context-specific instructions
    +                       -- (this field is intended for human consumption)
    +                       generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
    +                                            InfoTypeAndValue     OPTIONAL
    +                       -- this may be used to convey context-specific information
    +                       -- (this field not primarily intended for human consumption)
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + + Creates a new PkiMessage. + + @param header message header + @param body message body + @param protection message protection (may be null) + @param extraCerts extra certificates (may be null) + + +
    +            PkiMessage ::= SEQUENCE {
    +                             header           PKIHeader,
    +                             body             PKIBody,
    +                             protection   [0] PKIProtection OPTIONAL,
    +                             extraCerts   [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
    +                                                                                OPTIONAL
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PkiMessages ::= SEQUENCE SIZE (1..MAX) OF PkiMessage
    +            
    + @return a basic ASN.1 object representation. +
    + + @param status + + + @param status + @param statusString + + +
    +             PkiStatusInfo ::= SEQUENCE {
    +                 status        PKIStatus,                (INTEGER)
    +                 statusString  PkiFreeText     OPTIONAL,
    +                 failInfo      PkiFailureInfo  OPTIONAL  (BIT STRING)
    +             }
    +            
    +             PKIStatus:
    +               granted                (0), -- you got exactly what you asked for
    +               grantedWithMods        (1), -- you got something like what you asked for
    +               rejection              (2), -- you don't get it, more information elsewhere in the message
    +               waiting                (3), -- the request body part has not yet been processed, expect to hear more later
    +               revocationWarning      (4), -- this message contains a warning that a revocation is imminent
    +               revocationNotification (5), -- notification that a revocation has occurred
    +               keyUpdateWarning       (6)  -- update already done for the oldCertId specified in CertReqMsg
    +            
    +             PkiFailureInfo:
    +               badAlg           (0), -- unrecognized or unsupported Algorithm Identifier
    +               badMessageCheck  (1), -- integrity check failed (e.g., signature did not verify)
    +               badRequest       (2), -- transaction not permitted or supported
    +               badTime          (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
    +               badCertId        (4), -- no certificate could be found matching the provided criteria
    +               badDataFormat    (5), -- the data submitted has the wrong format
    +               wrongAuthority   (6), -- the authority indicated in the request is different from the one creating the response token
    +               incorrectData    (7), -- the requester's data is incorrect (for notary services)
    +               missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
    +               badPOP           (9)  -- the proof-of-possession failed
    +            
    +             
    +
    + +
    +            PollRepContent ::= SEQUENCE OF SEQUENCE {
    +                    certReqId              INTEGER,
    +                    checkAfter             INTEGER,  -- time in seconds
    +                    reason                 PKIFreeText OPTIONAL
    +                }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PollReqContent ::= SEQUENCE OF SEQUENCE {
    +                                   certReqId              INTEGER
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PopoDecKeyChallContent ::= SEQUENCE OF Challenge
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PopoDecKeyRespContent ::= SEQUENCE OF INTEGER
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            ProtectedPart ::= SEQUENCE {
    +                               header    PKIHeader,
    +                               body      PKIBody
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            RevAnnContent ::= SEQUENCE {
    +                  status              PKIStatus,
    +                  certId              CertId,
    +                  willBeRevokedAt     GeneralizedTime,
    +                  badSinceDate        GeneralizedTime,
    +                  crlDetails          Extensions  OPTIONAL
    +                   -- extra CRL details (e.g., crl number, reason, location, etc.)
    +            }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            RevDetails ::= SEQUENCE {
    +                             certDetails         CertTemplate,
    +                              -- allows requester to specify as much as they can about
    +                              -- the cert. for which revocation is requested
    +                              -- (e.g., for cases in which serialNumber is not available)
    +                              crlEntryDetails     Extensions       OPTIONAL
    +                              -- requested crlEntryExtensions
    +                        }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            RevRepContent ::= SEQUENCE {
    +                   status       SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
    +                   -- in same order as was sent in RevReqContent
    +                   revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
    +                   -- IDs for which revocation was requested
    +                   -- (same order as status)
    +                   crls     [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
    +                   -- the resulting CRLs (there may be more than one)
    +              }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            RevReqContent ::= SEQUENCE OF RevDetails
    +            
    + @return a basic ASN.1 object representation. +
    + + return an Attribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Attribute ::= SEQUENCE {
    +                attrType OBJECT IDENTIFIER,
    +                attrValues SET OF AttributeValue
    +            }
    +            
    +
    + +
    +            Attributes ::=
    +              SET SIZE(1..MAX) OF Attribute -- according to RFC 5652
    +            
    + @return +
    + + Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be + empty if there are no attributes of the required type present. + + @param oid type of attribute required. + @return a vector of all the attributes found of type oid. + + + Return a new table with the passed in attribute added. + + @param attrType + @param attrValue + @return + + + Return the first attribute matching the given OBJECT IDENTIFIER + + + return an AuthenticatedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthenticatedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +             AuthenticatedData ::= SEQUENCE {
    +                   version CMSVersion,
    +                   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +                   recipientInfos RecipientInfos,
    +                   macAlgorithm MessageAuthenticationCodeAlgorithm,
    +                   digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
    +                   encapContentInfo EncapsulatedContentInfo,
    +                   authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
    +                   mac MessageAuthenticationCode,
    +                   unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
    +            
    +             AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
    +            
    +             UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
    +            
    +             MessageAuthenticationCode ::= OCTET STRING
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +             AuthenticatedData ::= SEQUENCE {
    +                   version CMSVersion,
    +                   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +                   recipientInfos RecipientInfos,
    +                   macAlgorithm MessageAuthenticationCodeAlgorithm,
    +                   digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
    +                   encapContentInfo EncapsulatedContentInfo,
    +                   authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
    +                   mac MessageAuthenticationCode,
    +                   unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
    +            
    +             AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
    +            
    +             UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
    +            
    +             MessageAuthenticationCode ::= OCTET STRING
    +             
    +
    + + return an AuthEnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthEnvelopedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            AuthEnvelopedData ::= SEQUENCE {
    +              version CMSVersion,
    +              originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +              recipientInfos RecipientInfos,
    +              authEncryptedContentInfo EncryptedContentInfo,
    +              authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
    +              mac MessageAuthenticationCode,
    +              unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. + +
    +            AuthEnvelopedData ::= SEQUENCE {
    +              version CMSVersion,
    +              originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +              recipientInfos RecipientInfos,
    +              authEncryptedContentInfo EncryptedContentInfo,
    +              authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
    +              mac MessageAuthenticationCode,
    +              unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
    +            
    +
    + + The other Revocation Info arc + id-ri OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) + dod(6) internet(1) security(5) mechanisms(5) pkix(7) ri(16) } + + + RFC 3274 - CMS Compressed Data. +
    +            CompressedData ::= Sequence {
    +             version CMSVersion,
    +             compressionAlgorithm CompressionAlgorithmIdentifier,
    +             encapContentInfo EncapsulatedContentInfo
    +            }
    +            
    +
    + + return a CompressedData object from a tagged object. + + @param ato the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a CompressedData object from the given object. + + @param _obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + RFC 3274 - CMS Compressed Data. +
    +            CompressedData ::= SEQUENCE {
    +             version CMSVersion,
    +             compressionAlgorithm CompressionAlgorithmIdentifier,
    +             encapContentInfo EncapsulatedContentInfo
    +            }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ContentInfo ::= Sequence {
    +                     contentType ContentType,
    +                     content
    +                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ContentInfo ::= SEQUENCE {
    +                     contentType ContentType,
    +                     content
    +                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
    +            
    +
    + + return an AuthEnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @throws ArgumentException if the object held by the + tagged object cannot be converted. + + + return an AuthEnvelopedData object from the given object. + + @param obj the object we want converted. + @throws ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            MQVuserKeyingMaterial ::= SEQUENCE {
    +              ephemeralPublicKey OriginatorPublicKey,
    +              addedukm [0] EXPLICIT UserKeyingMaterial OPTIONAL  }
    +            
    +
    + + return an EncryptedContentInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            EncryptedContentInfo ::= Sequence {
    +                contentType ContentType,
    +                contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
    +                encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
    +            }
    +            
    +
    + +
    +            EncryptedContentInfo ::= SEQUENCE {
    +                contentType ContentType,
    +                contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
    +                encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
    +            }
    +            
    +
    + +
    +                  EncryptedData ::= SEQUENCE {
    +                                version CMSVersion,
    +                                encryptedContentInfo EncryptedContentInfo,
    +                                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
    +            
    + @return a basic ASN.1 object representation. +
    + + return an EnvelopedData object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an EnvelopedData object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            EnvelopedData ::= Sequence {
    +                version CMSVersion,
    +                originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +                recipientInfos RecipientInfos,
    +                encryptedContentInfo EncryptedContentInfo,
    +                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
    +            }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            EnvelopedData ::= SEQUENCE {
    +                version CMSVersion,
    +                originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
    +                recipientInfos RecipientInfos,
    +                encryptedContentInfo EncryptedContentInfo,
    +                unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
    +            }
    +            
    +
    + + return a KekIdentifier object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KekIdentifier object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            KekIdentifier ::= Sequence {
    +                keyIdentifier OCTET STRING,
    +                date GeneralizedTime OPTIONAL,
    +                other OtherKeyAttribute OPTIONAL
    +            }
    +            
    +
    + + return a KekRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KekRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            KekRecipientInfo ::= Sequence {
    +                version CMSVersion,  -- always set to 4
    +                kekID KekIdentifier,
    +                keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
    +                encryptedKey EncryptedKey
    +            }
    +            
    +
    + + return an KeyAgreeRecipientIdentifier object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an KeyAgreeRecipientIdentifier object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            KeyAgreeRecipientIdentifier ::= CHOICE {
    +                issuerAndSerialNumber IssuerAndSerialNumber,
    +                rKeyId [0] IMPLICIT RecipientKeyIdentifier
    +            }
    +            
    +
    + + return a KeyAgreeRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a KeyAgreeRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + * Produce an object suitable for an Asn1OutputStream. + *
    +                     * KeyAgreeRecipientInfo ::= Sequence {
    +                     *     version CMSVersion,  -- always set to 3
    +                     *     originator [0] EXPLICIT OriginatorIdentifierOrKey,
    +                     *     ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
    +                     *     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
    +                     *     recipientEncryptedKeys RecipientEncryptedKeys
    +                     * }
    +            		 *
    +            		 * UserKeyingMaterial ::= OCTET STRING
    +                     * 
    +
    + + return a KeyTransRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            KeyTransRecipientInfo ::= Sequence {
    +                version CMSVersion,  -- always set to 0 or 2
    +                rid RecipientIdentifier,
    +                keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
    +                encryptedKey EncryptedKey
    +            }
    +            
    +
    + +
    +            MetaData ::= SEQUENCE {
    +              hashProtected        BOOLEAN,
    +              fileName             UTF8String OPTIONAL,
    +              mediaType            IA5String OPTIONAL,
    +              otherMetaData        Attributes OPTIONAL
    +            }
    +            
    + @return +
    + + return an OriginatorIdentifierOrKey object from a tagged object. + + @param o the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorIdentifierOrKey object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +             OriginatorIdentifierOrKey ::= CHOICE {
    +                 issuerAndSerialNumber IssuerAndSerialNumber,
    +                 subjectKeyIdentifier [0] SubjectKeyIdentifier,
    +                 originatorKey [1] OriginatorPublicKey
    +             }
    +            
    +             SubjectKeyIdentifier ::= OCTET STRING
    +             
    +
    + + return an OriginatorInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            OriginatorInfo ::= Sequence {
    +                certs [0] IMPLICIT CertificateSet OPTIONAL,
    +                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL
    +            }
    +            
    +
    + + return an OriginatorPublicKey object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return an OriginatorPublicKey object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            OriginatorPublicKey ::= Sequence {
    +                algorithm AlgorithmIdentifier,
    +                publicKey BIT STRING
    +            }
    +            
    +
    + + return an OtherKeyAttribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            OtherKeyAttribute ::= Sequence {
    +                keyAttrId OBJECT IDENTIFIER,
    +                keyAttr ANY DEFINED BY keyAttrId OPTIONAL
    +            }
    +            
    +
    + + return a OtherRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a OtherRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            OtherRecipientInfo ::= Sequence {
    +               oriType OBJECT IDENTIFIER,
    +               oriValue ANY DEFINED BY oriType }
    +            
    +
    + + return a OtherRevocationInfoFormat object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the object held by the + tagged object cannot be converted. + + + return a OtherRevocationInfoFormat object from the given object. + + @param obj the object we want converted. + @exception IllegalArgumentException if the object cannot be converted. + + + Produce an object suitable for an ASN1OutputStream. +
    +            OtherRevocationInfoFormat ::= SEQUENCE {
    +                 otherRevInfoFormat OBJECT IDENTIFIER,
    +                 otherRevInfo ANY DEFINED BY otherRevInfoFormat }
    +            
    +
    + + return a PasswordRecipientInfo object from a tagged object. + + @param obj the tagged object holding the object we want. + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a PasswordRecipientInfo object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            PasswordRecipientInfo ::= Sequence {
    +              version CMSVersion,   -- Always set to 0
    +              keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier
    +                                        OPTIONAL,
    +             keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
    +             encryptedKey EncryptedKey }
    +            
    +
    + + return an RecipientEncryptedKey object from a tagged object. + + @param obj the tagged object holding the object we want. + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a RecipientEncryptedKey object from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            RecipientEncryptedKey ::= SEQUENCE {
    +                rid KeyAgreeRecipientIdentifier,
    +                encryptedKey EncryptedKey
    +            }
    +            
    +
    + + return a RecipientIdentifier object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +             RecipientIdentifier ::= CHOICE {
    +                 issuerAndSerialNumber IssuerAndSerialNumber,
    +                 subjectKeyIdentifier [0] SubjectKeyIdentifier
    +             }
    +            
    +             SubjectKeyIdentifier ::= OCTET STRING
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            RecipientInfo ::= CHOICE {
    +                ktri KeyTransRecipientInfo,
    +                kari [1] KeyAgreeRecipientInfo,
    +                kekri [2] KekRecipientInfo,
    +                pwri [3] PasswordRecipientInfo,
    +                ori [4] OtherRecipientInfo }
    +            
    +
    + + return a RecipientKeyIdentifier object from a tagged object. + + @param _ato the tagged object holding the object we want. + @param _explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the object held by the + tagged object cannot be converted. + + + return a RecipientKeyIdentifier object from the given object. + + @param _obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +             RecipientKeyIdentifier ::= Sequence {
    +                 subjectKeyIdentifier SubjectKeyIdentifier,
    +                 date GeneralizedTime OPTIONAL,
    +                 other OtherKeyAttribute OPTIONAL
    +             }
    +            
    +             SubjectKeyIdentifier ::= OCTET STRING
    +             
    +
    + +
    +               ScvpReqRes ::= SEQUENCE {
    +               request  [0] EXPLICIT ContentInfo OPTIONAL,
    +               response     ContentInfo }
    +            
    + @return the ASN.1 primitive representation. +
    + + a signed data object. + + + Produce an object suitable for an Asn1OutputStream. +
    +            SignedData ::= Sequence {
    +                version CMSVersion,
    +                digestAlgorithms DigestAlgorithmIdentifiers,
    +                encapContentInfo EncapsulatedContentInfo,
    +                certificates [0] IMPLICIT CertificateSet OPTIONAL,
    +                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
    +                signerInfos SignerInfos
    +              }
    +            
    +
    + +
    +            SignedData ::= SEQUENCE {
    +                version CMSVersion,
    +                digestAlgorithms DigestAlgorithmIdentifiers,
    +                encapContentInfo EncapsulatedContentInfo,
    +                certificates [0] IMPLICIT CertificateSet OPTIONAL,
    +                crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
    +                signerInfos SignerInfos
    +              }
    +            
    +
    + + return a SignerIdentifier object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +             SignerIdentifier ::= CHOICE {
    +                 issuerAndSerialNumber IssuerAndSerialNumber,
    +                 subjectKeyIdentifier [0] SubjectKeyIdentifier
    +             }
    +            
    +             SubjectKeyIdentifier ::= OCTET STRING
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +              SignerInfo ::= Sequence {
    +                  version Version,
    +                  SignerIdentifier sid,
    +                  digestAlgorithm DigestAlgorithmIdentifier,
    +                  authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
    +                  digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
    +                  encryptedDigest EncryptedDigest,
    +                  unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
    +              }
    +            
    +              EncryptedDigest ::= OCTET STRING
    +            
    +              DigestAlgorithmIdentifier ::= AlgorithmIdentifier
    +            
    +              DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
    +             
    +
    + + creates a time object from a given date - if the date is between 1950 + and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + is used. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Time ::= CHOICE {
    +                        utcTime        UTCTime,
    +                        generalTime    GeneralizedTime }
    +            
    +
    + +
    +            TimeStampAndCRL ::= SEQUENCE {
    +                timeStamp   TimeStampToken,          -- according to RFC 3161
    +                crl         CertificateList OPTIONAL -- according to RFC 5280
    +             }
    +            
    + @return +
    + +
    +            TimeStampedData ::= SEQUENCE {
    +              version              INTEGER { v1(1) },
    +              dataUri              IA5String OPTIONAL,
    +              metaData             MetaData OPTIONAL,
    +              content              OCTET STRING OPTIONAL,
    +              temporalEvidence     Evidence
    +            }
    +            
    + @return +
    + +
    +            TimeStampTokenEvidence ::=
    +               SEQUENCE SIZE(1..MAX) OF TimeStampAndCrl
    +            
    + @return +
    + +
    +            AttributeTypeAndValue ::= SEQUENCE {
    +                      type         OBJECT IDENTIFIER,
    +                      value        ANY DEFINED BY type }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertId ::= SEQUENCE {
    +                            issuer           GeneralName,
    +                            serialNumber     INTEGER }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertReqMessages ::= SEQUENCE SIZE (1..MAX) OF CertReqMsg
    +            
    + @return a basic ASN.1 object representation. +
    + + Creates a new CertReqMsg. + @param certReq CertRequest + @param popo may be null + @param regInfo may be null + + +
    +            CertReqMsg ::= SEQUENCE {
    +                               certReq   CertRequest,
    +                               pop       ProofOfPossession  OPTIONAL,
    +                               -- content depends upon key type
    +                               regInfo   SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue OPTIONAL }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            CertRequest ::= SEQUENCE {
    +                                 certReqId     INTEGER,          -- ID for matching request and reply
    +                                 certTemplate  CertTemplate,  -- Selected fields of cert to be issued
    +                                 controls      Controls OPTIONAL }   -- Attributes affecting issuance
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +             CertTemplate ::= SEQUENCE {
    +                 version      [0] Version               OPTIONAL,
    +                 serialNumber [1] INTEGER               OPTIONAL,
    +                 signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
    +                 issuer       [3] Name                  OPTIONAL,
    +                 validity     [4] OptionalValidity      OPTIONAL,
    +                 subject      [5] Name                  OPTIONAL,
    +                 publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
    +                 issuerUID    [7] UniqueIdentifier      OPTIONAL,
    +                 subjectUID   [8] UniqueIdentifier      OPTIONAL,
    +                 extensions   [9] Extensions            OPTIONAL }
    +            
    + @return a basic ASN.1 object representation. +
    + + Sets the X.509 version. Note: for X509v3, use 2 here. + + + Sets the issuer unique ID (deprecated in X.509v3) + + + Sets the subject unique ID (deprecated in X.509v3) + + +
    +             CertTemplate ::= SEQUENCE {
    +                 version      [0] Version               OPTIONAL,
    +                 serialNumber [1] INTEGER               OPTIONAL,
    +                 signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
    +                 issuer       [3] Name                  OPTIONAL,
    +                 validity     [4] OptionalValidity      OPTIONAL,
    +                 subject      [5] Name                  OPTIONAL,
    +                 publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
    +                 issuerUID    [7] UniqueIdentifier      OPTIONAL,
    +                 subjectUID   [8] UniqueIdentifier      OPTIONAL,
    +                 extensions   [9] Extensions            OPTIONAL }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            Controls  ::= SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            EncKeyWithID ::= SEQUENCE {
    +                 privateKey           PrivateKeyInfo,
    +                 identifier CHOICE {
    +                    string               UTF8String,
    +                    generalName          GeneralName
    +                } OPTIONAL
    +            }
    +            
    + @return +
    + +
    +               EncryptedKey ::= CHOICE {
    +                   encryptedValue        EncryptedValue, -- deprecated
    +                   envelopedData     [0] EnvelopedData }
    +                   -- The encrypted private key MUST be placed in the envelopedData
    +                   -- encryptedContentInfo encryptedContent OCTET STRING.
    +            
    +
    + +
    +            EncryptedValue ::= SEQUENCE {
    +                                intendedAlg   [0] AlgorithmIdentifier  OPTIONAL,
    +                                -- the intended algorithm for which the value will be used
    +                                symmAlg       [1] AlgorithmIdentifier  OPTIONAL,
    +                                -- the symmetric algorithm used to encrypt the value
    +                                encSymmKey    [2] BIT STRING           OPTIONAL,
    +                                -- the (encrypted) symmetric key used to encrypt the value
    +                                keyAlg        [3] AlgorithmIdentifier  OPTIONAL,
    +                                -- algorithm used to encrypt the symmetric key
    +                                valueHint     [4] OCTET STRING         OPTIONAL,
    +                                -- a brief description or identifier of the encValue content
    +                                -- (may be meaningful only to the sending entity, and used only
    +                                -- if EncryptedValue might be re-examined by the sending entity
    +                                -- in the future)
    +                                encValue       BIT STRING }
    +                                -- the encrypted value itself
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            OptionalValidity ::= SEQUENCE {
    +                                   notBefore  [0] Time OPTIONAL,
    +                                   notAfter   [1] Time OPTIONAL } --at least one MUST be present
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +             PkiArchiveOptions ::= CHOICE {
    +                 encryptedPrivKey     [0] EncryptedKey,
    +                 -- the actual value of the private key
    +                 keyGenParameters     [1] KeyGenParameters,
    +                 -- parameters which allow the private key to be re-generated
    +                 archiveRemGenPrivKey [2] BOOLEAN }
    +                 -- set to TRUE if sender wishes receiver to archive the private
    +                 -- key of a key pair that the receiver generates in response to
    +                 -- this request; set to FALSE if no archival is desired.
    +            
    +
    + +
    +            PkiPublicationInfo ::= SEQUENCE {
    +                             action     INTEGER {
    +                                            dontPublish (0),
    +                                            pleasePublish (1) },
    +                             pubInfos  SEQUENCE SIZE (1..MAX) OF SinglePubInfo OPTIONAL }
    +            -- pubInfos MUST NOT be present if action is "dontPublish"
    +            -- (if action is "pleasePublish" and pubInfos is omitted,
    +            -- "dontCare" is assumed)
    +            
    + @return a basic ASN.1 object representation. +
    + + Password-based MAC value for use with POPOSigningKeyInput. + + + Creates a new PKMACValue. + @param params parameters for password-based MAC + @param value MAC of the DER-encoded SubjectPublicKeyInfo + + + Creates a new PKMACValue. + @param aid CMPObjectIdentifiers.passwordBasedMAC, with PBMParameter + @param value MAC of the DER-encoded SubjectPublicKeyInfo + + +
    +            PKMACValue ::= SEQUENCE {
    +                 algId  AlgorithmIdentifier,
    +                 -- algorithm value shall be PasswordBasedMac 1.2.840.113533.7.66.13
    +                 -- parameter value is PBMParameter
    +                 value  BIT STRING }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            PopoPrivKey ::= CHOICE {
    +                   thisMessage       [0] BIT STRING,         -- Deprecated
    +                    -- possession is proven in this message (which contains the private
    +                    -- key itself (encrypted for the CA))
    +                   subsequentMessage [1] SubsequentMessage,
    +                    -- possession will be proven in a subsequent message
    +                   dhMAC             [2] BIT STRING,         -- Deprecated
    +                   agreeMAC          [3] PKMACValue,
    +                   encryptedKey      [4] EnvelopedData }
    +            
    +
    + + Creates a new Proof of Possession object for a signing key. + @param poposkIn the PopoSigningKeyInput structure, or null if the + CertTemplate includes both subject and publicKey values. + @param aid the AlgorithmIdentifier used to sign the proof of possession. + @param signature a signature over the DER-encoded value of poposkIn, + or the DER-encoded value of certReq if poposkIn is null. + + +
    +            PopoSigningKey ::= SEQUENCE {
    +                                 poposkInput           [0] PopoSigningKeyInput OPTIONAL,
    +                                 algorithmIdentifier   AlgorithmIdentifier,
    +                                 signature             BIT STRING }
    +             -- The signature (using "algorithmIdentifier") is on the
    +             -- DER-encoded value of poposkInput.  NOTE: If the CertReqMsg
    +             -- certReq CertTemplate contains the subject and publicKey values,
    +             -- then poposkInput MUST be omitted and the signature MUST be
    +             -- computed on the DER-encoded value of CertReqMsg certReq.  If
    +             -- the CertReqMsg certReq CertTemplate does not contain the public
    +             -- key and subject values, then poposkInput MUST be present and
    +             -- MUST be signed.  This strategy ensures that the public key is
    +             -- not present in both the poposkInput and CertReqMsg certReq
    +             -- CertTemplate fields.
    +            
    + @return a basic ASN.1 object representation. +
    + + Creates a new PopoSigningKeyInput with sender name as authInfo. + + + Creates a new PopoSigningKeyInput using password-based MAC. + + +
    +            PopoSigningKeyInput ::= SEQUENCE {
    +                   authInfo             CHOICE {
    +                                            sender              [0] GeneralName,
    +                                            -- used only if an authenticated identity has been
    +                                            -- established for the sender (e.g., a DN from a
    +                                            -- previously-issued and currently-valid certificate
    +                                            publicKeyMac        PKMacValue },
    +                                            -- used if no authenticated GeneralName currently exists for
    +                                            -- the sender; publicKeyMac contains a password-based MAC
    +                                            -- on the DER-encoded value of publicKey
    +                   publicKey           SubjectPublicKeyInfo }  -- from CertTemplate
    +            
    + @return a basic ASN.1 object representation. +
    + + Returns the sender field, or null if authInfo is publicKeyMac + + + Returns the publicKeyMac field, or null if authInfo is sender + + + Creates a ProofOfPossession with type raVerified. + + + Creates a ProofOfPossession for a signing key. + + + Creates a ProofOfPossession for key encipherment or agreement. + @param type one of TYPE_KEY_ENCIPHERMENT or TYPE_KEY_AGREEMENT + + +
    +            ProofOfPossession ::= CHOICE {
    +                                      raVerified        [0] NULL,
    +                                      -- used if the RA has already verified that the requester is in
    +                                      -- possession of the private key
    +                                      signature         [1] PopoSigningKey,
    +                                      keyEncipherment   [2] PopoPrivKey,
    +                                      keyAgreement      [3] PopoPrivKey }
    +            
    + @return a basic ASN.1 object representation. +
    + +
    +            SinglePubInfo ::= SEQUENCE {
    +                   pubMethod    INTEGER {
    +                      dontCare    (0),
    +                      x500        (1),
    +                      web         (2),
    +                      ldap        (3) },
    +                  pubLocation  GeneralName OPTIONAL }
    +            
    + @return a basic ASN.1 object representation. +
    + + return an integer from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Integer from a tagged object. + + @param obj the tagged object holding the object we want + @param isExplicit true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + in some cases positive values Get crammed into a space, + that's not quite big enough... + + + table of the available named parameters for GOST 3410-2001. + + + return the ECDomainParameters object for the given OID, null if it + isn't present. + + @param oid an object identifier representing a named parameters, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + +
    +             Gost28147-89-Parameters ::=
    +                           SEQUENCE {
    +                                   iv                   Gost28147-89-IV,
    +                                   encryptionParamSet   OBJECT IDENTIFIER
    +                            }
    +            
    +               Gost28147-89-IV ::= OCTET STRING (SIZE (8))
    +             
    +
    + + table of the available named parameters for GOST 3410-94. + + + return the GOST3410ParamSetParameters object for the given OID, null if it + isn't present. + + @param oid an object identifier representing a named parameters, if present. + + + returns an enumeration containing the name strings for parameters + contained in this structure. + + + Der BMPString object. + + + return a BMP string from the given object. + + @param obj the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + return a BMP string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + return a bool from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a DerBoolean from the passed in bool. + + + return a Boolean from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + return an integer from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Enumerated from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + Class representing the DER-type External + + + Creates a new instance of DerExternal + See X.690 for more informations about the meaning of these parameters + @param directReference The direct reference or null if not set. + @param indirectReference The indirect reference or null if not set. + @param dataValueDescriptor The data value descriptor or null if not set. + @param externalData The external data in its encoded form. + + + Creates a new instance of DerExternal. + See X.690 for more informations about the meaning of these parameters + @param directReference The direct reference or null if not set. + @param indirectReference The indirect reference or null if not set. + @param dataValueDescriptor The data value descriptor or null if not set. + @param encoding The encoding to be used for the external data + @param externalData The external data + + + The encoding of the content. Valid values are +
      +
    • 0 single-ASN1-type
    • +
    • 1 OCTET STRING
    • +
    • 2 BIT STRING
    • +
    +
    + + Generalized time object. + + + return a generalized time from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return a Generalized Time object from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z + for local time, or Z+-HHMM on the end, for difference between local + time and UTC time. The fractional second amount f must consist of at + least one number with trailing zeroes removed. + + @param time the time string. + @exception ArgumentException if string is an illegal format. + + + base constructor from a local time object + + + return the time - always in the form of + YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). +

    + Normally in a certificate we would expect "Z" rather than "GMT", + however adding the "GMT" means we can just use: +

    +                dateF = new SimpleDateFormat("yyyyMMddHHmmssz");
    +            
    + To read in the time and Get a date which is compatible with our local + time zone.

    +
    + + Return the time. + @return The time string as it appeared in the encoded object. + + + return a Graphic String from the passed in object + + @param obj a DerGraphicString or an object that can be converted into one. + @exception IllegalArgumentException if the object cannot be converted. + @return a DerGraphicString instance, or null. + + + return a Graphic String from a tagged object. + + @param obj the tagged object holding the object we want + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the tagged object cannot + be converted. + @return a DerGraphicString instance, or null. + + + basic constructor - with bytes. + @param string the byte encoding of the characters making up the string. + + + Der IA5String object - this is an ascii string. + + + return a IA5 string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an IA5 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - without validation. + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in an IA5String. + + + return true if the passed in String can be represented without + loss as an IA5String, false otherwise. + + @return true if in printable set, false otherwise. + + + Der NumericString object - this is an ascii string of characters {0,1,2,3,4,5,6,7,8,9, }. + + + return a Numeric string from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an Numeric string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - without validation.. + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in a NumericString. + + + Return true if the string can be represented as a NumericString ('0'..'9', ' ') + + @param str string to validate. + @return true if numeric, fale otherwise. + + + return an Oid from the passed in object + + @exception ArgumentException if the object cannot be converted. + + + return an object Identifier from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + Return true if this oid is an extension of the passed in branch, stem. + @param stem the arc or branch that is a possible parent. + @return true if the branch is on the passed in stem, false otherwise. + + + Der PrintableString object. + + + return a printable string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Printable string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor - this does not validate the string + + + Constructor with optional validation. + + @param string the base string to wrap. + @param validate whether or not to check the string. + @throws ArgumentException if validate is true and the string + contains characters that should not be in a PrintableString. + + + return true if the passed in String can be represented without + loss as a PrintableString, false otherwise. + + @return true if in printable set, false otherwise. + + + Der T61String (also the teletex string) - 8-bit characters + + + return a T61 string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an T61 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - with bytes. + + + basic constructor - with string. + + + Der UniversalString object. + + + return a Universal string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Universal string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + UTC time object. + + + return an UTC Time from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an UTC Time from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + The correct format for this is YYMMDDHHMMSSZ (it used to be that seconds were + never encoded. When you're creating one of these objects from scratch, that's + what you want to use, otherwise we'll try to deal with whatever Gets read from + the input stream... (this is why the input format is different from the GetTime() + method output). +

    + @param time the time string.

    +
    + + base constructor from a DateTime object + + + return the time as a date based on whatever a 2 digit year will return. For + standardised processing use ToAdjustedDateTime(). + + @return the resulting date + @exception ParseException if the date string cannot be parsed. + + + return the time as an adjusted date + in the range of 1950 - 2049. + + @return a date in the range of 1950 to 2049. + @exception ParseException if the date string cannot be parsed. + + + return the time - always in the form of + YYMMDDhhmmssGMT(+hh:mm|-hh:mm). +

    + Normally in a certificate we would expect "Z" rather than "GMT", + however adding the "GMT" means we can just use: +

    +                dateF = new SimpleDateFormat("yyMMddHHmmssz");
    +            
    + To read in the time and Get a date which is compatible with our local + time zone.

    +

    + Note: In some cases, due to the local date processing, this + may lead to unexpected results. If you want to stick the normal + convention of 1950 to 2049 use the GetAdjustedTime() method.

    +
    + + + Return a time string as an adjusted date with a 4 digit year. + This goes in the range of 1950 - 2049. + + + + Der UTF8String object. + + + return an UTF8 string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return an UTF8 string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + return a Videotex String from the passed in object + + @param obj a DERVideotexString or an object that can be converted into one. + @exception IllegalArgumentException if the object cannot be converted. + @return a DERVideotexString instance, or null. + + + return a Videotex String from a tagged object. + + @param obj the tagged object holding the object we want + @param explicit true if the object is meant to be explicitly + tagged false otherwise. + @exception IllegalArgumentException if the tagged object cannot + be converted. + @return a DERVideotexString instance, or null. + + + basic constructor - with bytes. + @param string the byte encoding of the characters making up the string. + + + Der VisibleString object. + + + return a Visible string from the passed in object. + + @exception ArgumentException if the object cannot be converted. + + + return a Visible string from a tagged object. + + @param obj the tagged object holding the object we want + @param explicitly true if the object is meant to be explicitly + tagged false otherwise. + @exception ArgumentException if the tagged object cannot + be converted. + + + basic constructor - byte encoded string. + + + basic constructor + + + + RFC 3126: 4.3.1 Certificate Values Attribute Definition + + CertificateValues ::= SEQUENCE OF Certificate + + + + +
    +            CommitmentTypeIndication ::= SEQUENCE {
    +                 commitmentTypeId   CommitmentTypeIdentifier,
    +                 commitmentTypeQualifier   SEQUENCE SIZE (1..MAX) OF
    +                         CommitmentTypeQualifier OPTIONAL }
    +            
    +
    + + Commitment type qualifiers, used in the Commitment-Type-Indication attribute (RFC3126). + +
    +               CommitmentTypeQualifier ::= SEQUENCE {
    +                   commitmentTypeIdentifier  CommitmentTypeIdentifier,
    +                   qualifier          ANY DEFINED BY commitmentTypeIdentifier OPTIONAL }
    +             
    +
    + + Creates a new CommitmentTypeQualifier instance. + + @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + + + Creates a new CommitmentTypeQualifier instance. + + @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + @param qualifier the qualifier, defined by the above field. + + + Creates a new CommitmentTypeQualifier instance. + + @param as CommitmentTypeQualifier structure + encoded as an Asn1Sequence. + + + Returns a DER-encodable representation of this instance. + + @return a Asn1Object value + + + + RFC 3126: 4.2.1 Complete Certificate Refs Attribute Definition + + CompleteCertificateRefs ::= SEQUENCE OF OtherCertID + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CompleteRevocationRefs ::= SEQUENCE OF CrlOcspRef + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlIdentifier ::= SEQUENCE + { + crlissuer Name, + crlIssuedTime UTCTime, + crlNumber INTEGER OPTIONAL + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CRLListID ::= SEQUENCE + { + crls SEQUENCE OF CrlValidatedID + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlOcspRef ::= SEQUENCE { + crlids [0] CRLListID OPTIONAL, + ocspids [1] OcspListID OPTIONAL, + otherRev [2] OtherRevRefs OPTIONAL + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + CrlValidatedID ::= SEQUENCE { + crlHash OtherHash, + crlIdentifier CrlIdentifier OPTIONAL} + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspIdentifier ::= SEQUENCE { + ocspResponderID ResponderID, + -- As in OCSP response data + producedAt GeneralizedTime + -- As in OCSP response data + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspListID ::= SEQUENCE { + ocspResponses SEQUENCE OF OcspResponsesID + } + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OcspResponsesID ::= SEQUENCE { + ocspIdentifier OcspIdentifier, + ocspRepHash OtherHash OPTIONAL + } + + + + + + + OtherCertID ::= SEQUENCE { + otherCertHash OtherHash, + issuerSerial IssuerSerial OPTIONAL + } + + + + + + + OtherHash ::= CHOICE { + sha1Hash OtherHashValue, -- This contains a SHA-1 hash + otherHash OtherHashAlgAndValue + } + + OtherHashValue ::= OCTET STRING + + + + + + Summary description for OtherHashAlgAndValue. + + + + OtherHashAlgAndValue ::= SEQUENCE { + hashAlgorithm AlgorithmIdentifier, + hashValue OtherHashValue + } + + OtherHashValue ::= OCTET STRING + + + + + + RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + + OtherRevRefs ::= SEQUENCE + { + otherRevRefType OtherRevRefType, + otherRevRefs ANY DEFINED BY otherRevRefType + } + + OtherRevRefType ::= OBJECT IDENTIFIER + + + + + + RFC 3126: 4.3.2 Revocation Values Attribute Definition + + OtherRevVals ::= SEQUENCE + { + otherRevValType OtherRevValType, + otherRevVals ANY DEFINED BY otherRevValType + } + + OtherRevValType ::= OBJECT IDENTIFIER + + + + + + + OtherSigningCertificate ::= SEQUENCE { + certs SEQUENCE OF OtherCertID, + policies SEQUENCE OF PolicyInformation OPTIONAL + } + + + + + + RFC 5126: 6.3.4. revocation-values Attribute Definition + + RevocationValues ::= SEQUENCE { + crlVals [0] SEQUENCE OF CertificateList OPTIONAL, + ocspVals [1] SEQUENCE OF BasicOCSPResponse OPTIONAL, + otherRevVals [2] OtherRevVals OPTIONAL + } + + + + + + + SignaturePolicyId ::= SEQUENCE { + sigPolicyIdentifier SigPolicyId, + sigPolicyHash SigPolicyHash, + sigPolicyQualifiers SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo OPTIONAL + } + + SigPolicyId ::= OBJECT IDENTIFIER + + SigPolicyHash ::= OtherHashAlgAndValue + + + + + + + SignaturePolicyIdentifier ::= CHOICE { + SignaturePolicyId SignaturePolicyId, + SignaturePolicyImplied SignaturePolicyImplied + } + + SignaturePolicyImplied ::= NULL + + + + + +
    +              SignerAttribute ::= SEQUENCE OF CHOICE {
    +                  claimedAttributes   [0] ClaimedAttributes,
    +                  certifiedAttributes [1] CertifiedAttributes }
    +            
    +              ClaimedAttributes ::= SEQUENCE OF Attribute
    +              CertifiedAttributes ::= AttributeCertificate -- as defined in RFC 3281: see clause 4.1.
    +             
    +
    + + Signer-Location attribute (RFC3126). + +
    +               SignerLocation ::= SEQUENCE {
    +                   countryName        [0] DirectoryString OPTIONAL,
    +                   localityName       [1] DirectoryString OPTIONAL,
    +                   postalAddress      [2] PostalAddress OPTIONAL }
    +            
    +               PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
    +             
    +
    + +
    +               SignerLocation ::= SEQUENCE {
    +                   countryName        [0] DirectoryString OPTIONAL,
    +                   localityName       [1] DirectoryString OPTIONAL,
    +                   postalAddress      [2] PostalAddress OPTIONAL }
    +            
    +               PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
    +            
    +               DirectoryString ::= CHOICE {
    +                     teletexString           TeletexString (SIZE (1..MAX)),
    +                     printableString         PrintableString (SIZE (1..MAX)),
    +                     universalString         UniversalString (SIZE (1..MAX)),
    +                     utf8String              UTF8String (SIZE (1.. MAX)),
    +                     bmpString               BMPString (SIZE (1..MAX)) }
    +             
    +
    + + + + SigPolicyQualifierInfo ::= SEQUENCE { + sigPolicyQualifierId SigPolicyQualifierId, + sigQualifier ANY DEFINED BY sigPolicyQualifierId + } + + SigPolicyQualifierId ::= OBJECT IDENTIFIER + + + + + constructor + + +
    +            ContentHints ::= SEQUENCE {
    +              contentDescription UTF8String (SIZE (1..MAX)) OPTIONAL,
    +              contentType ContentType }
    +            
    +
    + + Create from OCTET STRING whose octets represent the identifier. + + + Create from byte array representing the identifier. + + + The definition of ContentIdentifier is +
    +            ContentIdentifier ::=  OCTET STRING
    +            
    + id-aa-contentIdentifier OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 7 } +
    + + constructor + + +
    +            EssCertID ::= SEQUENCE {
    +                certHash Hash,
    +                issuerSerial IssuerSerial OPTIONAL }
    +            
    +
    + +
    +             EssCertIDv2 ::=  SEQUENCE {
    +                 hashAlgorithm     AlgorithmIdentifier
    +                          DEFAULT {algorithm id-sha256},
    +                 certHash          Hash,
    +                 issuerSerial      IssuerSerial OPTIONAL
    +             }
    +            
    +             Hash ::= OCTET STRING
    +            
    +             IssuerSerial ::= SEQUENCE {
    +                 issuer         GeneralNames,
    +                 serialNumber   CertificateSerialNumber
    +             }
    +             
    +
    + + constructor + + +
    +             OtherCertID ::= SEQUENCE {
    +                 otherCertHash    OtherHash,
    +                 issuerSerial     IssuerSerial OPTIONAL }
    +            
    +             OtherHash ::= CHOICE {
    +                 sha1Hash     OCTET STRING,
    +                 otherHash    OtherHashAlgAndValue }
    +            
    +             OtherHashAlgAndValue ::= SEQUENCE {
    +                 hashAlgorithm    AlgorithmIdentifier,
    +                 hashValue        OCTET STRING }
    +            
    +             
    +
    + + constructors + + + The definition of OtherSigningCertificate is +
    +            OtherSigningCertificate ::=  SEQUENCE {
    +                 certs        SEQUENCE OF OtherCertID,
    +                 policies     SEQUENCE OF PolicyInformation OPTIONAL
    +            }
    +            
    + id-aa-ets-otherSigCert OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 19 } +
    + + constructors + + + The definition of SigningCertificate is +
    +            SigningCertificate ::=  SEQUENCE {
    +                 certs        SEQUENCE OF EssCertID,
    +                 policies     SEQUENCE OF PolicyInformation OPTIONAL
    +            }
    +            
    + id-aa-signingCertificate OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 12 } +
    + + The definition of SigningCertificateV2 is +
    +            SigningCertificateV2 ::=  SEQUENCE {
    +                 certs        SEQUENCE OF EssCertIDv2,
    +                 policies     SEQUENCE OF PolicyInformation OPTIONAL
    +            }
    +            
    + id-aa-signingCertificateV2 OBJECT IDENTIFIER ::= { iso(1) + member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + smime(16) id-aa(2) 47 } +
    + + The CscaMasterList object. This object can be wrapped in a + CMSSignedData to be published in LDAP. + +
    +             CscaMasterList ::= SEQUENCE {
    +               version                CscaMasterListVersion,
    +               certList               SET OF Certificate }
    +               
    +             CscaMasterListVersion :: INTEGER {v0(0)}
    +             
    +
    + + The DataGroupHash object. +
    +             DataGroupHash  ::=  SEQUENCE {
    +                  dataGroupNumber         DataGroupNumber,
    +                  dataGroupHashValue     OCTET STRING }
    +            
    +             DataGroupNumber ::= INTEGER {
    +                     dataGroup1    (1),
    +                     dataGroup1    (2),
    +                     dataGroup1    (3),
    +                     dataGroup1    (4),
    +                     dataGroup1    (5),
    +                     dataGroup1    (6),
    +                     dataGroup1    (7),
    +                     dataGroup1    (8),
    +                     dataGroup1    (9),
    +                     dataGroup1    (10),
    +                     dataGroup1    (11),
    +                     dataGroup1    (12),
    +                     dataGroup1    (13),
    +                     dataGroup1    (14),
    +                     dataGroup1    (15),
    +                     dataGroup1    (16) }
    +            
    +             
    +
    + + The LDSSecurityObject object (V1.8). +
    +             LDSSecurityObject ::= SEQUENCE {
    +               version                LDSSecurityObjectVersion,
    +               hashAlgorithm          DigestAlgorithmIdentifier,
    +               dataGroupHashValues    SEQUENCE SIZE (2..ub-DataGroups) OF DataHashGroup,
    +               ldsVersionInfo         LDSVersionInfo OPTIONAL
    +                 -- if present, version MUST be v1 }
    +            
    +             DigestAlgorithmIdentifier ::= AlgorithmIdentifier,
    +            
    +             LDSSecurityObjectVersion :: INTEGER {V0(0)}
    +             
    +
    + +
    +            LDSVersionInfo ::= SEQUENCE {
    +               ldsVersion PRINTABLE STRING
    +               unicodeVersion PRINTABLE STRING
    +             }
    +            
    + @return +
    + + The id-isismtt-cp-accredited OID indicates that the certificate is a + qualified certificate according to Directive 1999/93/EC of the European + Parliament and of the Council of 13 December 1999 on a Community + Framework for Electronic Signatures, which additionally conforms the + special requirements of the SigG and has been issued by an accredited CA. + + + Certificate extensionDate of certificate generation + +
    +            		DateOfCertGenSyntax ::= GeneralizedTime
    +             
    +
    + + Attribute to indicate that the certificate holder may sign in the name of + a third person. May also be used as extension in a certificate. + + + Attribute to indicate admissions to certain professions. May be used as + attribute in attribute certificate or as extension in a certificate + + + Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST + be used in new certificates in place of the extension/attribute + MonetaryLimit since January 1, 2004. For the sake of backward + compatibility with certificates already in use, SigG conforming + components MUST support MonetaryLimit (as well as QcEuLimitValue). + + + A declaration of majority. May be used as attribute in attribute + certificate or as extension in a certificate + + + + Serial number of the smart card containing the corresponding private key + +
    +            		ICCSNSyntax ::= OCTET STRING (SIZE(8..20))
    +             
    +
    + + + Reference for a file of a smartcard that stores the public key of this + certificate and that is used as �security anchor�. + +
    +            		PKReferenceSyntax ::= OCTET STRING (SIZE(20))
    +             
    +
    + + Some other restriction regarding the usage of this certificate. May be + used as attribute in attribute certificate or as extension in a + certificate. + +
    +            		RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
    +             
    + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.Restriction +
    + + + (Single)Request extension: Clients may include this extension in a + (single) Request to request the responder to send the certificate in the + response message along with the status information. Besides the LDAP + service, this extension provides another mechanism for the distribution + of certificates, which MAY optionally be provided by certificate + repositories. + +
    +            		RetrieveIfAllowed ::= BOOLEAN
    +             
    +
    + + SingleOCSPResponse extension: The certificate requested by the client by + inserting the RetrieveIfAllowed extension in the request, will be + returned in this extension. + + @see Org.BouncyCastle.Asn1.IsisMtt.Ocsp.RequestedCertificate + + + Base ObjectIdentifier for naming authorities + + + SingleOCSPResponse extension: Date, when certificate has been published + in the directory and status information has become available. Currently, + accrediting authorities enforce that SigG-conforming OCSP servers include + this extension in the responses. + +
    +            		CertInDirSince ::= GeneralizedTime
    +             
    +
    + + Hash of a certificate in OCSP. + + @see Org.BouncyCastle.Asn1.IsisMtt.Ocsp.CertHash + + +
    +            		NameAtBirth ::= DirectoryString(SIZE(1..64)
    +             
    + + Used in + {@link Org.BouncyCastle.Asn1.X509.SubjectDirectoryAttributes SubjectDirectoryAttributes} +
    + + Some other information of non-restrictive nature regarding the usage of + this certificate. May be used as attribute in atribute certificate or as + extension in a certificate. + +
    +                          AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
    +            
    + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdditionalInformationSyntax +
    + + Indicates that an attribute certificate exists, which limits the + usability of this public key certificate. Whenever verifying a signature + with the help of this certificate, the content of the corresponding + attribute certificate should be concerned. This extension MUST be + included in a PKC, if a corresponding attribute certificate (having the + PKC as base certificate) contains some attribute that restricts the + usability of the PKC too. Attribute certificates with restricting content + MUST always be included in the signed document. + +
    +            		LiabilityLimitationFlagSyntax ::= BOOLEAN
    +             
    +
    + + ISIS-MTT PROFILE: The responder may include this extension in a response to + send the hash of the requested certificate to the responder. This hash is + cryptographically bound to the certificate and serves as evidence that the + certificate is known to the responder (i.e. it has been issued and is present + in the directory). Hence, this extension is a means to provide a positive + statement of availability as described in T8.[8]. As explained in T13.[1], + clients may rely on this information to be able to validate signatures after + the expiry of the corresponding certificate. Hence, clients MUST support this + extension. If a positive statement of availability is to be delivered, this + extension syntax and OID MUST be used. +

    +

    +

    +                CertHash ::= SEQUENCE {
    +                  hashAlgorithm AlgorithmIdentifier,
    +                  certificateHash OCTET STRING
    +                }
    +            
    +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type CertHash: +

    +

    +                 CertHash ::= SEQUENCE {
    +                   hashAlgorithm AlgorithmIdentifier,
    +                   certificateHash OCTET STRING
    +                 }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. + + @param hashAlgorithm The hash algorithm identifier. + @param certificateHash The hash of the whole DER encoding of the certificate. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                 CertHash ::= SEQUENCE {
    +                   hashAlgorithm AlgorithmIdentifier,
    +                   certificateHash OCTET STRING
    +                 }
    +             
    + + @return an Asn1Object +
    + + ISIS-MTT-Optional: The certificate requested by the client by inserting the + RetrieveIfAllowed extension in the request, will be returned in this + extension. +

    + ISIS-MTT-SigG: The signature act allows publishing certificates only then, + when the certificate owner gives his isExplicit permission. Accordingly, there + may be �nondownloadable� certificates, about which the responder must provide + status information, but MUST NOT include them in the response. Clients may + get therefore the following three kind of answers on a single request + including the RetrieveIfAllowed extension: +

      +
    • a) the responder supports the extension and is allowed to publish the + certificate: RequestedCertificate returned including the requested + certificate
    • +
    • b) the responder supports the extension but is NOT allowed to publish + the certificate: RequestedCertificate returned including an empty OCTET + STRING
    • +
    • c) the responder does not support the extension: RequestedCertificate is + not included in the response
    • +
    + Clients requesting RetrieveIfAllowed MUST be able to handle these cases. If + any of the OCTET STRING options is used, it MUST contain the DER encoding of + the requested certificate. +

    +

    +                       RequestedCertificate ::= CHOICE {
    +                         Certificate Certificate,
    +                         publicKeyCertificate [0] EXPLICIT OCTET STRING,
    +                         attributeCertificate [1] EXPLICIT OCTET STRING
    +                       }
    +            
    +
    + + Constructor from a given details. +

    + Only one parameter can be given. All other must be null. + + @param certificate Given as Certificate + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                        RequestedCertificate ::= CHOICE {
    +                          Certificate Certificate,
    +                          publicKeyCertificate [0] EXPLICIT OCTET STRING,
    +                          attributeCertificate [1] EXPLICIT OCTET STRING
    +                        }
    +             
    + + @return an Asn1Object +
    + + Some other information of non-restrictive nature regarding the usage of this + certificate. + +
    +               AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
    +            
    +
    + + Constructor from a given details. + + @param information The describtion of the information. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +               AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
    +             
    + + @return an Asn1Object +
    + + An Admissions structure. +

    +

    +                        Admissions ::= SEQUENCE
    +                        {
    +                          admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
    +                          namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
    +                          professionInfos SEQUENCE OF ProfessionInfo
    +                        }
    +             

    +

    + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type ProcurationSyntax: +

    +

    +                        Admissions ::= SEQUENCE
    +                        {
    +                          admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
    +                          namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
    +                          professionInfos SEQUENCE OF ProfessionInfo
    +                        }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. +

    + Parameter professionInfos is mandatory. + + @param admissionAuthority The admission authority. + @param namingAuthority The naming authority. + @param professionInfos The profession infos. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                   Admissions ::= SEQUENCE
    +                   {
    +                     admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
    +                     namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
    +                     professionInfos SEQUENCE OF ProfessionInfo
    +                   }
    +             

    +

    + + @return an Asn1Object +
    + + Attribute to indicate admissions to certain professions. +

    +

    +                 AdmissionSyntax ::= SEQUENCE
    +                 {
    +                   admissionAuthority GeneralName OPTIONAL,
    +                   contentsOfAdmissions SEQUENCE OF Admissions
    +                 }
    +             

    + Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

    + NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

    + ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

    +

    +

    + ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax + supports the following concepts and requirements: +

      +
    • External institutions (e.g. professional associations, chambers, unions, + administrative bodies, companies, etc.), which are responsible for granting + and verifying professional admissions, are indicated by means of the data + field admissionAuthority. An admission authority is indicated by a + GeneralName object. Here an X.501 directory name (distinguished name) can be + indicated in the field directoryName, a URL address can be indicated in the + field uniformResourceIdentifier, and an object identifier can be indicated in + the field registeredId.
    • +
    • The names of authorities which are responsible for the administration of + title registers are indicated in the data field namingAuthority. The name of + the authority can be identified by an object identifier in the field + namingAuthorityId, by means of a text string in the field + namingAuthorityText, by means of a URL address in the field + namingAuthorityUrl, or by a combination of them. For example, the text string + can contain the name of the authority, the country and the name of the title + register. The URL-option refers to a web page which contains lists with + officially registered professions (text and possibly OID) as well as + further information on these professions. Object identifiers for the + component namingAuthorityId are grouped under the OID-branch + id-isis-at-namingAuthorities and must be applied for.
    • +
    • See http://www.teletrust.de/anwend.asp?Id=30200&Sprache=E_&HomePG=0 + for an application form and http://www.teletrust.de/links.asp?id=30220,11 + for an overview of registered naming authorities.
    • +
    • By means of the data type ProfessionInfo certain professions, + specializations, disciplines, fields of activity, etc. are identified. A + profession is represented by one or more text strings, resp. profession OIDs + in the fields professionItems and professionOIDs and by a registration number + in the field registrationNumber. An indication in text form must always be + present, whereas the other indications are optional. The component + addProfessionInfo may contain additional applicationspecific information in + DER-encoded form.
    • +
    +

    + By means of different namingAuthority-OIDs or profession OIDs hierarchies of + professions, specializations, disciplines, fields of activity, etc. can be + expressed. The issuing admission authority should always be indicated (field + admissionAuthority), whenever a registration number is presented. Still, + information on admissions can be given without indicating an admission or a + naming authority by the exclusive use of the component professionItems. In + this case the certification authority is responsible for the verification of + the admission information. +

    +

    +

    + This attribute is single-valued. Still, several admissions can be captured in + the sequence structure of the component contentsOfAdmissions of + AdmissionSyntax or in the component professionInfos of Admissions. The + component admissionAuthority of AdmissionSyntax serves as default value for + the component admissionAuthority of Admissions. Within the latter component + the default value can be overwritten, in case that another authority is + responsible. The component namingAuthority of Admissions serves as a default + value for the component namingAuthority of ProfessionInfo. Within the latter + component the default value can be overwritten, in case that another naming + authority needs to be recorded. +

    + The length of the string objects is limited to 128 characters. It is + recommended to indicate a namingAuthorityURL in all issued attribute + certificates. If a namingAuthorityURL is indicated, the field professionItems + of ProfessionInfo should contain only registered titles. If the field + professionOIDs exists, it has to contain the OIDs of the professions listed + in professionItems in the same order. In general, the field professionInfos + should contain only one entry, unless the admissions that are to be listed + are logically connected (e.g. they have been issued under the same admission + number). + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions + @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority + + + Constructor from Asn1Sequence. +

    + The sequence is of type ProcurationSyntax: +

    +

    +                 AdmissionSyntax ::= SEQUENCE
    +                 {
    +                   admissionAuthority GeneralName OPTIONAL,
    +                   contentsOfAdmissions SEQUENCE OF Admissions
    +                 }
    +             

    + Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

    + NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

    + ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

    + + @param seq The ASN.1 sequence. +
    + + Constructor from given details. + + @param admissionAuthority The admission authority. + @param contentsOfAdmissions The admissions. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                 AdmissionSyntax ::= SEQUENCE
    +                 {
    +                   admissionAuthority GeneralName OPTIONAL,
    +                   contentsOfAdmissions SEQUENCE OF Admissions
    +                 }
    +             

    + Admissions ::= SEQUENCE + { + admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + professionInfos SEQUENCE OF ProfessionInfo + } +

    + NamingAuthority ::= SEQUENCE + { + namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + namingAuthorityUrl IA5String OPTIONAL, + namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + } +

    + ProfessionInfo ::= SEQUENCE + { + namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + addProfessionInfo OCTET STRING OPTIONAL + } +

    + + @return an Asn1Object +
    + + @return Returns the contentsOfAdmissions. + + + @return Returns the admissionAuthority if present, null otherwise. + + + A declaration of majority. +

    +

    +                      DeclarationOfMajoritySyntax ::= CHOICE
    +                      {
    +                        notYoungerThan [0] IMPLICIT INTEGER,
    +                        fullAgeAtCountry [1] IMPLICIT SEQUENCE
    +                        {
    +                          fullAge BOOLEAN DEFAULT TRUE,
    +                          country PrintableString (SIZE(2))
    +                        }
    +                        dateOfBirth [2] IMPLICIT GeneralizedTime
    +                      }
    +            
    +

    + fullAgeAtCountry indicates the majority of the owner with respect to the laws + of a specific country. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                       DeclarationOfMajoritySyntax ::= CHOICE
    +                       {
    +                         notYoungerThan [0] IMPLICIT INTEGER,
    +                         fullAgeAtCountry [1] IMPLICIT SEQUENCE
    +                         {
    +                           fullAge BOOLEAN DEFAULT TRUE,
    +                           country PrintableString (SIZE(2))
    +                         }
    +                         dateOfBirth [2] IMPLICIT GeneralizedTime
    +                       }
    +             
    + + @return an Asn1Object +
    + + @return notYoungerThan if that's what we are, -1 otherwise + + + Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST be + used in new certificates in place of the extension/attribute MonetaryLimit + since January 1, 2004. For the sake of backward compatibility with + certificates already in use, components SHOULD support MonetaryLimit (as well + as QcEuLimitValue). +

    + Indicates a monetary limit within which the certificate holder is authorized + to act. (This value DOES NOT express a limit on the liability of the + certification authority). +

    +

    +               MonetaryLimitSyntax ::= SEQUENCE
    +               {
    +                 currency PrintableString (SIZE(3)),
    +                 amount INTEGER,
    +                 exponent INTEGER
    +               }
    +            
    +

    + currency must be the ISO code. +

    + value = amount�10*exponent + + + Constructor from a given details. +

    +

    + value = amount�10^exponent + + @param currency The currency. Must be the ISO code. + @param amount The amount + @param exponent The exponent + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                MonetaryLimitSyntax ::= SEQUENCE
    +                {
    +                  currency PrintableString (SIZE(3)),
    +                  amount INTEGER,
    +                  exponent INTEGER
    +                }
    +             
    + + @return an Asn1Object +
    + + Names of authorities which are responsible for the administration of title + registers. + +
    +                        NamingAuthority ::= SEQUENCE 
    +                        {
    +                          namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
    +                          namingAuthorityUrl IA5String OPTIONAL,
    +                          namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
    +                        }
    +            
    + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + +
    + + Profession OIDs should always be defined under the OID branch of the + responsible naming authority. At the time of this writing, the work group + �Recht, Wirtschaft, Steuern� (�Law, Economy, Taxes�) is registered as the + first naming authority under the OID id-isismtt-at-namingAuthorities. + + + Constructor from Asn1Sequence. +

    +

    +

    +                         NamingAuthority ::= SEQUENCE
    +                         {
    +                           namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
    +                           namingAuthorityUrl IA5String OPTIONAL,
    +                           namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
    +                         }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from given details. +

    + All parameters can be combined. + + @param namingAuthorityID ObjectIdentifier for naming authority. + @param namingAuthorityUrl URL for naming authority. + @param namingAuthorityText Textual representation of naming authority. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                         NamingAuthority ::= SEQUENCE
    +                         {
    +                           namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
    +                           namingAuthorityUrl IA5String OPTIONAL,
    +                           namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
    +                         }
    +             
    + + @return an Asn1Object +
    + + @return Returns the namingAuthorityID. + + + @return Returns the namingAuthorityText. + + + @return Returns the namingAuthorityUrl. + + + Attribute to indicate that the certificate holder may sign in the name of a + third person. +

    + ISIS-MTT PROFILE: The corresponding ProcurationSyntax contains either the + name of the person who is represented (subcomponent thirdPerson) or a + reference to his/her base certificate (in the component signingFor, + subcomponent certRef), furthermore the optional components country and + typeSubstitution to indicate the country whose laws apply, and respectively + the type of procuration (e.g. manager, procuration, custody). +

    +

    + ISIS-MTT PROFILE: The GeneralName MUST be of type directoryName and MAY only + contain: - RFC3039 attributes, except pseudonym (countryName, commonName, + surname, givenName, serialNumber, organizationName, organizationalUnitName, + stateOrProvincename, localityName, postalAddress) and - SubjectDirectoryName + attributes (title, dateOfBirth, placeOfBirth, gender, countryOfCitizenship, + countryOfResidence and NameAtBirth). +

    +
    +                          ProcurationSyntax ::= SEQUENCE {
    +                            country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
    +                            typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
    +                            signingFor [3] EXPLICIT SigningFor 
    +                          }
    +                          
    +                          SigningFor ::= CHOICE 
    +                          { 
    +                            thirdPerson GeneralName,
    +                            certRef IssuerSerial 
    +                          }
    +            
    + +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type ProcurationSyntax: +

    +

    +                           ProcurationSyntax ::= SEQUENCE {
    +                             country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
    +                             typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
    +                             signingFor [3] EXPLICIT SigningFor
    +                           }
    +             

    + SigningFor ::= CHOICE + { + thirdPerson GeneralName, + certRef IssuerSerial + } +

    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. +

    +

    + Either generalName or certRef MUST be + null. + + @param country The country code whose laws apply. + @param typeOfSubstitution The type of procuration. + @param certRef Reference to certificate of the person who is represented. + + + Constructor from a given details. +

    +

    + Either generalName or certRef MUST be + null. + + @param country The country code whose laws apply. + @param typeOfSubstitution The type of procuration. + @param thirdPerson The GeneralName of the person who is represented. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                           ProcurationSyntax ::= SEQUENCE {
    +                             country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
    +                             typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
    +                             signingFor [3] EXPLICIT SigningFor
    +                           }
    +             

    + SigningFor ::= CHOICE + { + thirdPerson GeneralName, + certRef IssuerSerial + } +

    + + @return an Asn1Object +
    + + Professions, specializations, disciplines, fields of activity, etc. + +
    +                          ProfessionInfo ::= SEQUENCE 
    +                          {
    +                            namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
    +                            professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
    +                            professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
    +                            registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
    +                            addProfessionInfo OCTET STRING OPTIONAL 
    +                          }
    +            
    + + @see Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax +
    + + Rechtsanw�ltin + + + Rechtsanwalt + + + Rechtsbeistand + + + Steuerberaterin + + + Steuerberater + + + Steuerbevollm�chtigte + + + Steuerbevollm�chtigter + + + Notarin + + + Notar + + + Notarvertreterin + + + Notarvertreter + + + Notariatsverwalterin + + + Notariatsverwalter + + + Wirtschaftspr�ferin + + + Wirtschaftspr�fer + + + Vereidigte Buchpr�ferin + + + Vereidigter Buchpr�fer + + + Patentanw�ltin + + + Patentanwalt + + + Constructor from Asn1Sequence. +

    +

    +

    +                           ProfessionInfo ::= SEQUENCE
    +                           {
    +                             namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
    +                             professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
    +                             professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
    +                             registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
    +                             addProfessionInfo OCTET STRING OPTIONAL
    +                           }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from given details. +

    + professionItems is mandatory, all other parameters are + optional. + + @param namingAuthority The naming authority. + @param professionItems Directory strings of the profession. + @param professionOids DERObjectIdentfier objects for the + profession. + @param registrationNumber Registration number. + @param addProfessionInfo Additional infos in encoded form. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                           ProfessionInfo ::= SEQUENCE
    +                           {
    +                             namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
    +                             professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
    +                             professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
    +                             registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
    +                             addProfessionInfo OCTET STRING OPTIONAL
    +                           }
    +             
    + + @return an Asn1Object +
    + + @return Returns the professionItems. + + + @return Returns the professionOids. + + + @return Returns the addProfessionInfo. + + + @return Returns the namingAuthority. + + + @return Returns the registrationNumber. + + + Some other restriction regarding the usage of this certificate. +

    +

    +             RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
    +            
    +
    + + Constructor from DirectoryString. +

    + The DirectoryString is of type RestrictionSyntax: +

    +

    +                  RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
    +             
    + + @param restriction A IAsn1String. +
    + + Constructor from a given details. + + @param restriction The description of the restriction. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                  RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
    +             

    +

    + + @return an Asn1Object +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            cast5CBCParameters ::= Sequence {
    +                                      iv         OCTET STRING DEFAULT 0,
    +                                             -- Initialization vector
    +                                      keyLength  Integer
    +                                             -- Key length, in bits
    +                                 }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            IDEA-CBCPar ::= Sequence {
    +                                 iv    OCTET STRING OPTIONAL -- exactly 8 octets
    +                             }
    +            
    +
    + + The NetscapeCertType object. +
    +               NetscapeCertType ::= BIT STRING {
    +                    SSLClient               (0),
    +                    SSLServer               (1),
    +                    S/MIME                  (2),
    +                    Object Signing          (3),
    +                    Reserved                (4),
    +                    SSL CA                  (5),
    +                    S/MIME CA               (6),
    +                    Object Signing CA       (7) }
    +            
    +
    + + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (X509NetscapeCertType.sslCA | X509NetscapeCertType.smimeCA) + + + This is designed to parse + the PublicKeyAndChallenge created by the KEYGEN tag included by + Mozilla based browsers. +
    +              PublicKeyAndChallenge ::= SEQUENCE {
    +                spki SubjectPublicKeyInfo,
    +                challenge IA5STRING
    +              }
    +            
    +              
    +
    + + Utility class for fetching curves using their NIST names as published in FIPS-PUB 186-3 + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + From RFC 3657 + + + Produce an object suitable for an Asn1OutputStream. +
    +            BasicOcspResponse       ::= Sequence {
    +                 tbsResponseData      ResponseData,
    +                 signatureAlgorithm   AlgorithmIdentifier,
    +                 signature            BIT STRING,
    +                 certs                [0] EXPLICIT Sequence OF Certificate OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            CertID          ::=     Sequence {
    +                hashAlgorithm       AlgorithmIdentifier,
    +                issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
    +                issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
    +                serialNumber        CertificateSerialNumber }
    +            
    +
    + + create a CertStatus object with a tag of zero. + + + Produce an object suitable for an Asn1OutputStream. +
    +             CertStatus ::= CHOICE {
    +                             good        [0]     IMPLICIT Null,
    +                             revoked     [1]     IMPLICIT RevokedInfo,
    +                             unknown     [2]     IMPLICIT UnknownInfo }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            CrlID ::= Sequence {
    +                crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
    +                crlNum               [1]     EXPLICIT Integer OPTIONAL,
    +                crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            OcspRequest     ::=     Sequence {
    +                tbsRequest                  TBSRequest,
    +                optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            OcspResponse ::= Sequence {
    +                responseStatus         OcspResponseStatus,
    +                responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
    +            
    +
    + + The OcspResponseStatus enumeration. +
    +            OcspResponseStatus ::= Enumerated {
    +                successful            (0),  --Response has valid confirmations
    +                malformedRequest      (1),  --Illegal confirmation request
    +                internalError         (2),  --Internal error in issuer
    +                tryLater              (3),  --Try again later
    +                                            --(4) is not used
    +                sigRequired           (5),  --Must sign the request
    +                unauthorized          (6)   --Request unauthorized
    +            }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            Request         ::=     Sequence {
    +                reqCert                     CertID,
    +                singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ResponderID ::= CHOICE {
    +                 byName          [1] Name,
    +                 byKey           [2] KeyHash }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ResponseBytes ::=       Sequence {
    +                responseType   OBJECT IDENTIFIER,
    +                response       OCTET STRING }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ResponseData ::= Sequence {
    +                version              [0] EXPLICIT Version DEFAULT v1,
    +                responderID              ResponderID,
    +                producedAt               GeneralizedTime,
    +                responses                Sequence OF SingleResponse,
    +                responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            RevokedInfo ::= Sequence {
    +                 revocationTime              GeneralizedTime,
    +                 revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ServiceLocator ::= Sequence {
    +                issuer    Name,
    +                locator   AuthorityInfoAccessSyntax OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            Signature       ::=     Sequence {
    +                signatureAlgorithm      AlgorithmIdentifier,
    +                signature               BIT STRING,
    +                certs               [0] EXPLICIT Sequence OF Certificate OPTIONAL}
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +             SingleResponse ::= Sequence {
    +                     certID                       CertID,
    +                     certStatus                   CertStatus,
    +                     thisUpdate                   GeneralizedTime,
    +                     nextUpdate         [0]       EXPLICIT GeneralizedTime OPTIONAL,
    +                     singleExtensions   [1]       EXPLICIT Extensions OPTIONAL }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            TBSRequest      ::=     Sequence {
    +                version             [0]     EXPLICIT Version DEFAULT v1,
    +                requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
    +                requestList                 Sequence OF Request,
    +                requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
    +            
    +
    + + class for breaking up an Oid into it's component tokens, ala + java.util.StringTokenizer. We need this class as some of the + lightweight Java environment don't support classes like + StringTokenizer. + + + return an Attribute object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Attr ::= Sequence {
    +                attrType OBJECT IDENTIFIER,
    +                attrValues Set OF AttributeValue
    +            }
    +            
    +
    + + Pkcs10 Certfication request object. +
    +            CertificationRequest ::= Sequence {
    +              certificationRequestInfo  CertificationRequestInfo,
    +              signatureAlgorithm        AlgorithmIdentifier{{ SignatureAlgorithms }},
    +              signature                 BIT STRING
    +            }
    +            
    +
    + + Pkcs10 CertificationRequestInfo object. +
    +              CertificationRequestInfo ::= Sequence {
    +               version             Integer { v1(0) } (v1,...),
    +               subject             Name,
    +               subjectPKInfo   SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
    +               attributes          [0] Attributes{{ CRIAttributes }}
    +              }
    +            
    +              Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }}
    +            
    +              Attr { ATTRIBUTE:IOSet } ::= Sequence {
    +                type    ATTRIBUTE.&id({IOSet}),
    +                values  Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type})
    +              }
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +            ContentInfo ::= Sequence {
    +                     contentType ContentType,
    +                     content
    +                     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
    +            
    +
    + + The EncryptedData object. +
    +                  EncryptedData ::= Sequence {
    +                       version Version,
    +                       encryptedContentInfo EncryptedContentInfo
    +                  }
    +            
    +            
    +                  EncryptedContentInfo ::= Sequence {
    +                      contentType ContentType,
    +                      contentEncryptionAlgorithm  ContentEncryptionAlgorithmIdentifier,
    +                      encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
    +                }
    +            
    +                EncryptedContent ::= OCTET STRING
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +             EncryptedPrivateKeyInfo ::= Sequence {
    +                  encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
    +                  encryptedData EncryptedData
    +             }
    +            
    +             EncryptedData ::= OCTET STRING
    +            
    +             KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
    +                      ... -- For local profiles
    +             }
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +                 AlgorithmIdentifier ::= Sequence {
    +                                       algorithm OBJECT IDENTIFIER,
    +                                       parameters ANY DEFINED BY algorithm OPTIONAL }
    +            
    +
    + + + Return the OID in the Algorithm entry of this identifier. + + + + + Return the parameters structure in the Parameters entry of this identifier. + + + +
    +            MacData ::= SEQUENCE {
    +                mac      DigestInfo,
    +                macSalt  OCTET STRING,
    +                iterations INTEGER DEFAULT 1
    +                -- Note: The default is for historic reasons and its use is deprecated. A
    +                -- higher value, like 1024 is recommended.
    +            
    + @return the basic DERObject construction. +
    + + the infamous Pfx from Pkcs12 + + + write out an RSA private key with its associated information + as described in Pkcs8. +
    +                  PrivateKeyInfo ::= Sequence {
    +                                          version Version,
    +                                          privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
    +                                          privateKey PrivateKey,
    +                                          attributes [0] IMPLICIT Attributes OPTIONAL
    +                                      }
    +                  Version ::= Integer {v1(0)} (v1,...)
    +            
    +                  PrivateKey ::= OCTET STRING
    +            
    +                  Attributes ::= Set OF Attr
    +             
    +
    + + The default version + + +
    +              RSAES-OAEP-params ::= SEQUENCE {
    +                 hashAlgorithm      [0] OAEP-PSSDigestAlgorithms     DEFAULT sha1,
    +                 maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
    +                 pSourceAlgorithm   [2] PKCS1PSourceAlgorithms  DEFAULT pSpecifiedEmpty
    +               }
    +            
    +               OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
    +                 { OID id-sha1 PARAMETERS NULL   }|
    +                 { OID id-sha256 PARAMETERS NULL }|
    +                 { OID id-sha384 PARAMETERS NULL }|
    +                 { OID id-sha512 PARAMETERS NULL },
    +                 ...  -- Allows for future expansion --
    +               }
    +               PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
    +                 { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
    +                ...  -- Allows for future expansion --
    +               }
    +               PKCS1PSourceAlgorithms    ALGORITHM-IDENTIFIER ::= {
    +                 { OID id-pSpecified PARAMETERS OCTET STRING },
    +                 ...  -- Allows for future expansion --
    +              }
    +             
    + @return the asn1 primitive representing the parameters. +
    + + This outputs the key in Pkcs1v2 format. +
    +                  RsaPrivateKey ::= Sequence {
    +                                      version Version,
    +                                      modulus Integer, -- n
    +                                      publicExponent Integer, -- e
    +                                      privateExponent Integer, -- d
    +                                      prime1 Integer, -- p
    +                                      prime2 Integer, -- q
    +                                      exponent1 Integer, -- d mod (p-1)
    +                                      exponent2 Integer, -- d mod (q-1)
    +                                      coefficient Integer -- (inverse of q) mod p
    +                                  }
    +            
    +                  Version ::= Integer
    +             
    +

    This routine is written to output Pkcs1 version 0, private keys.

    +
    + + The default version + + +
    +             RSASSA-PSS-params ::= SEQUENCE {
    +               hashAlgorithm      [0] OAEP-PSSDigestAlgorithms  DEFAULT sha1,
    +                maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
    +                saltLength         [2] INTEGER  DEFAULT 20,
    +                trailerField       [3] TrailerField  DEFAULT trailerFieldBC
    +              }
    +            
    +             OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
    +                { OID id-sha1 PARAMETERS NULL   }|
    +                { OID id-sha256 PARAMETERS NULL }|
    +                { OID id-sha384 PARAMETERS NULL }|
    +                { OID id-sha512 PARAMETERS NULL },
    +                ...  -- Allows for future expansion --
    +             }
    +            
    +             PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
    +               { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
    +                ...  -- Allows for future expansion --
    +             }
    +            
    +             TrailerField ::= INTEGER { trailerFieldBC(1) }
    +             
    + @return the asn1 primitive representing the parameters. +
    + + a Pkcs#7 signed data object. + + + Produce an object suitable for an Asn1OutputStream. +
    +             SignedData ::= Sequence {
    +                 version Version,
    +                 digestAlgorithms DigestAlgorithmIdentifiers,
    +                 contentInfo ContentInfo,
    +                 certificates
    +                     [0] IMPLICIT ExtendedCertificatesAndCertificates
    +                              OPTIONAL,
    +                 crls
    +                     [1] IMPLICIT CertificateRevocationLists OPTIONAL,
    +                 signerInfos SignerInfos }
    +            
    +
    + + a Pkcs#7 signer info object. + + + Produce an object suitable for an Asn1OutputStream. +
    +              SignerInfo ::= Sequence {
    +                  version Version,
    +                  issuerAndSerialNumber IssuerAndSerialNumber,
    +                  digestAlgorithm DigestAlgorithmIdentifier,
    +                  authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
    +                  digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
    +                  encryptedDigest EncryptedDigest,
    +                  unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
    +              }
    +            
    +              EncryptedDigest ::= OCTET STRING
    +            
    +              DigestAlgorithmIdentifier ::= AlgorithmIdentifier
    +            
    +              DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
    +             
    +
    + + the elliptic curve private key object from SEC 1 + + + ECPrivateKey ::= SEQUENCE { + version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), + privateKey OCTET STRING, + parameters [0] Parameters OPTIONAL, + publicKey [1] BIT STRING OPTIONAL } + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + EllipticCurve OBJECT IDENTIFIER ::= { + iso(1) identified-organization(3) certicom(132) curve(0) + } + + + Handler class for dealing with S/MIME Capabilities + + + general preferences + + + encryption algorithms preferences + + + return an Attr object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + returns an ArrayList with 0 or more objects of all the capabilities + matching the passed in capability Oid. If the Oid passed is null the + entire set is returned. + + + Produce an object suitable for an Asn1OutputStream. +
    +            SMIMECapabilities ::= Sequence OF SMIMECapability
    +            
    +
    + + return an Attr object from the given object. + + @param o the object we want converted. + @exception ArgumentException if the object cannot be converted. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Attr ::= Sequence {
    +                attrType OBJECT IDENTIFIER,
    +                attrValues Set OF AttributeValue
    +            }
    +            
    +
    + + general preferences + + + encryption algorithms preferences + + + Produce an object suitable for an Asn1OutputStream. +
    +            SMIMECapability ::= Sequence {
    +                capabilityID OBJECT IDENTIFIER,
    +                parameters ANY DEFINED BY capabilityID OPTIONAL
    +            }
    +            
    +
    + + Handler for creating a vector S/MIME Capabilities + + + The SmimeEncryptionKeyPreference object. +
    +            SmimeEncryptionKeyPreference ::= CHOICE {
    +                issuerAndSerialNumber   [0] IssuerAndSerialNumber,
    +                receipentKeyId          [1] RecipientKeyIdentifier,
    +                subjectAltKeyIdentifier [2] SubjectKeyIdentifier
    +            }
    +            
    +
    + + @param sKeyId the subjectKeyIdentifier value (normally the X.509 one) + + + elliptic curves defined in "ECC Brainpool Standard Curves and Curve Generation" + http://www.ecc-brainpool.org/download/draft_pkix_additional_ecc_dp.txt + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + +
    +            Accuracy ::= SEQUENCE {
    +                        seconds        INTEGER              OPTIONAL,
    +                        millis     [0] INTEGER  (1..999)    OPTIONAL,
    +                        micros     [1] INTEGER  (1..999)    OPTIONAL
    +                        }
    +            
    +
    + + @param o + @return a MessageImprint object. + + +
    +               MessageImprint ::= SEQUENCE  {
    +                  hashAlgorithm                AlgorithmIdentifier,
    +                  hashedMessage                OCTET STRING  }
    +            
    +
    + +
    +            TimeStampReq ::= SEQUENCE  {
    +             version                      INTEGER  { v1(1) },
    +             messageImprint               MessageImprint,
    +               --a hash algorithm OID and the hash value of the data to be
    +               --time-stamped
    +             reqPolicy             TSAPolicyId              OPTIONAL,
    +             nonce                 INTEGER                  OPTIONAL,
    +             certReq               BOOLEAN                  DEFAULT FALSE,
    +             extensions            [0] IMPLICIT Extensions  OPTIONAL
    +            }
    +            
    +
    + +
    +            TimeStampResp ::= SEQUENCE  {
    +              status                  PkiStatusInfo,
    +              timeStampToken          TimeStampToken     OPTIONAL  }
    +            
    +
    + +
    +            
    +                 TstInfo ::= SEQUENCE  {
    +                    version                      INTEGER  { v1(1) },
    +                    policy                       TSAPolicyId,
    +                    messageImprint               MessageImprint,
    +                      -- MUST have the same value as the similar field in
    +                      -- TimeStampReq
    +                    serialNumber                 INTEGER,
    +                     -- Time-Stamping users MUST be ready to accommodate integers
    +                     -- up to 160 bits.
    +                    genTime                      GeneralizedTime,
    +                    accuracy                     Accuracy                 OPTIONAL,
    +                    ordering                     BOOLEAN             DEFAULT FALSE,
    +                    nonce                        INTEGER                  OPTIONAL,
    +                      -- MUST be present if the similar field was present
    +                      -- in TimeStampReq.  In that case it MUST have the same value.
    +                    tsa                          [0] GeneralName          OPTIONAL,
    +                    extensions                   [1] IMPLICIT Extensions   OPTIONAL  }
    +            
    +             
    +
    + + dump a Der object as a formatted string with indentation + + @param obj the Asn1Object to be dumped out. + + + dump out a DER object as a formatted string, in non-verbose mode + + @param obj the Asn1Encodable to be dumped out. + @return the resulting string. + + + Dump out the object as a string + + @param obj the Asn1Encodable to be dumped out. + @param verbose if true, dump out the contents of octet and bit strings. + @return the resulting string. + + +
    +             DirectoryString ::= CHOICE {
    +               teletexString               TeletexString (SIZE (1..MAX)),
    +               printableString             PrintableString (SIZE (1..MAX)),
    +               universalString             UniversalString (SIZE (1..MAX)),
    +               utf8String                  UTF8String (SIZE (1..MAX)),
    +               bmpString                   BMPString (SIZE (1..MAX))  }
    +            
    +
    + + The AccessDescription object. +
    +            AccessDescription  ::=  SEQUENCE {
    +                  accessMethod          OBJECT IDENTIFIER,
    +                  accessLocation        GeneralName  }
    +            
    +
    + + create an AccessDescription with the oid and location provided. + + + + @return the access method. + + + + @return the access location + + + + Don't use this one if you are trying to be RFC 3281 compliant. + Use it for v1 attribute certificates only. + + Our GeneralNames structure + + + Produce an object suitable for an Asn1OutputStream. +
    +             AttCertIssuer ::= CHOICE {
    +                  v1Form   GeneralNames,  -- MUST NOT be used in this
    +                                          -- profile
    +                  v2Form   [0] V2Form     -- v2 only
    +             }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +             AttCertValidityPeriod  ::= Sequence {
    +                  notBeforeTime  GeneralizedTime,
    +                  notAfterTime   GeneralizedTime
    +             }
    +            
    +
    + + @param obj + @return + + + Produce an object suitable for an Asn1OutputStream. +
    +             AttributeCertificate ::= Sequence {
    +                  acinfo               AttributeCertificateInfo,
    +                  signatureAlgorithm   AlgorithmIdentifier,
    +                  signatureValue       BIT STRING
    +             }
    +            
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +              AttributeCertificateInfo ::= Sequence {
    +                   version              AttCertVersion -- version is v2,
    +                   holder               Holder,
    +                   issuer               AttCertIssuer,
    +                   signature            AlgorithmIdentifier,
    +                   serialNumber         CertificateSerialNumber,
    +                   attrCertValidityPeriod   AttCertValidityPeriod,
    +                   attributes           Sequence OF Attr,
    +                   issuerUniqueID       UniqueIdentifier OPTIONAL,
    +                   extensions           Extensions OPTIONAL
    +              }
    +            
    +              AttCertVersion ::= Integer { v2(1) }
    +             
    +
    + + The AuthorityInformationAccess object. +
    +             id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
    +            
    +             AuthorityInfoAccessSyntax  ::=
    +                  Sequence SIZE (1..MAX) OF AccessDescription
    +             AccessDescription  ::=  Sequence {
    +                   accessMethod          OBJECT IDENTIFIER,
    +                   accessLocation        GeneralName  }
    +            
    +             id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
    +             id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
    +             id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
    +             
    +
    + + create an AuthorityInformationAccess with the oid and location provided. + + + The AuthorityKeyIdentifier object. +
    +             id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
    +            
    +               AuthorityKeyIdentifier ::= Sequence {
    +                  keyIdentifier             [0] IMPLICIT KeyIdentifier           OPTIONAL,
    +                  authorityCertIssuer       [1] IMPLICIT GeneralNames            OPTIONAL,
    +                  authorityCertSerialNumber [2] IMPLICIT CertificateSerialNumber OPTIONAL  }
    +            
    +               KeyIdentifier ::= OCTET STRING
    +             
    + +
    + + * + * Calulates the keyidentifier using a SHA1 hash over the BIT STRING + * from SubjectPublicKeyInfo as defined in RFC2459. + * + * Example of making a AuthorityKeyIdentifier: + *
    +            	     *   SubjectPublicKeyInfo apki = new SubjectPublicKeyInfo((ASN1Sequence)new ASN1InputStream(
    +            		 *       publicKey.getEncoded()).readObject());
    +                     *   AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(apki);
    +                     * 
    + * + * +
    + + create an AuthorityKeyIdentifier with the GeneralNames tag and + the serial number provided as well. + + + create an AuthorityKeyIdentifier with the GeneralNames tag and + the serial number provided. + + + create an AuthorityKeyIdentifier with a precomputed key identifier + + + create an AuthorityKeyIdentifier with a precomupted key identifier + and the GeneralNames tag and the serial number provided as well. + + + Produce an object suitable for an Asn1OutputStream. + + + create a cA=true object for the given path length constraint. + + @param pathLenConstraint + + + Produce an object suitable for an Asn1OutputStream. +
    +            BasicConstraints := Sequence {
    +               cA                  Boolean DEFAULT FALSE,
    +               pathLenConstraint   Integer (0..MAX) OPTIONAL
    +            }
    +            
    +
    + + PKIX RFC-2459 + + The X.509 v2 CRL syntax is as follows. For signature calculation, + the data that is to be signed is ASN.1 Der encoded. + +
    +             CertificateList  ::=  Sequence  {
    +                  tbsCertList          TbsCertList,
    +                  signatureAlgorithm   AlgorithmIdentifier,
    +                  signatureValue       BIT STRING  }
    +             
    +
    + + This class helps to support crossCerfificatePairs in a LDAP directory + according RFC 2587 + +
    +                 crossCertificatePairATTRIBUTE::={
    +                   WITH SYNTAX   CertificatePair
    +                   EQUALITY MATCHING RULE certificatePairExactMatch
    +                   ID joint-iso-ccitt(2) ds(5) attributeType(4) crossCertificatePair(40)}
    +             
    + +
    The forward elements of the crossCertificatePair attribute of a + CA's directory entry shall be used to store all, except self-issued + certificates issued to this CA. Optionally, the reverse elements of the + crossCertificatePair attribute, of a CA's directory entry may contain a + subset of certificates issued by this CA to other CAs. When both the forward + and the reverse elements are present in a single attribute value, issuer name + in one certificate shall match the subject name in the other and vice versa, + and the subject public key in one certificate shall be capable of verifying + the digital signature on the other certificate and vice versa. + + When a reverse element is present, the forward element value and the reverse + element value need not be stored in the same attribute value; in other words, + they can be stored in either a single attribute value or two attribute + values.
    + +
    +                   CertificatePair ::= SEQUENCE {
    +                     forward		[0]	Certificate OPTIONAL,
    +                     reverse		[1]	Certificate OPTIONAL,
    +                     -- at least one of the pair shall be present -- }
    +             
    +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type CertificatePair: +

    +

    +                   CertificatePair ::= SEQUENCE {
    +                     forward		[0]	Certificate OPTIONAL,
    +                     reverse		[1]	Certificate OPTIONAL,
    +                     -- at least one of the pair shall be present -- }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. + + @param forward Certificates issued to this CA. + @param reverse Certificates issued by this CA to other CAs. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                   CertificatePair ::= SEQUENCE {
    +                     forward		[0]	Certificate OPTIONAL,
    +                     reverse		[1]	Certificate OPTIONAL,
    +                     -- at least one of the pair shall be present -- }
    +             
    + + @return a DERObject +
    + + @return Returns the forward. + + + @return Returns the reverse. + + + Construct a CertificatePolicies object containing one PolicyInformation. + + @param name the name to be contained. + + + Produce an object suitable for an ASN1OutputStream. +
    +            CertificatePolicies ::= SEQUENCE SIZE {1..MAX} OF PolicyInformation
    +            
    +
    + + CertPolicyId, used in the CertificatePolicies and PolicyMappings + X509V3 Extensions. + +
    +                 CertPolicyId ::= OBJECT IDENTIFIER
    +             
    +
    + + Return the distribution points making up the sequence. + + @return DistributionPoint[] + + + Produce an object suitable for an Asn1OutputStream. +
    +            CrlDistPoint ::= Sequence SIZE {1..MAX} OF DistributionPoint
    +            
    +
    + + The CRLNumber object. +
    +            CRLNumber::= Integer(0..MAX)
    +            
    +
    + + The CRLReason enumeration. +
    +            CRLReason ::= Enumerated {
    +             unspecified             (0),
    +             keyCompromise           (1),
    +             cACompromise            (2),
    +             affiliationChanged      (3),
    +             superseded              (4),
    +             cessationOfOperation    (5),
    +             certificateHold         (6),
    +             removeFromCRL           (8),
    +             privilegeWithdrawn      (9),
    +             aACompromise           (10)
    +            }
    +            
    +
    + + The DigestInfo object. +
    +            DigestInfo::=Sequence{
    +                     digestAlgorithm  AlgorithmIdentifier,
    +                     digest OCTET STRING }
    +            
    +
    + + DisplayText class, used in + CertificatePolicies X509 V3 extensions (in policy qualifiers). + +

    It stores a string in a chosen encoding. +

    +             DisplayText ::= CHOICE {
    +                  ia5String        IA5String      (SIZE (1..200)),
    +                  visibleString    VisibleString  (SIZE (1..200)),
    +                  bmpString        BMPString      (SIZE (1..200)),
    +                  utf8String       UTF8String     (SIZE (1..200)) }
    +             

    + @see PolicyQualifierInfo + @see PolicyInformation +
    + + Constant corresponding to ia5String encoding. + + + + Constant corresponding to bmpString encoding. + + + + Constant corresponding to utf8String encoding. + + + + Constant corresponding to visibleString encoding. + + + + Describe constant DisplayTextMaximumSize here. + + + + Creates a new DisplayText instance. + + @param type the desired encoding type for the text. + @param text the text to store. Strings longer than 200 + characters are truncated. + + + Creates a new DisplayText instance. + + @param text the text to encapsulate. Strings longer than 200 + characters are truncated. + + + Creates a new DisplayText instance. +

    Useful when reading back a DisplayText class + from it's Asn1Encodable form.

    + + @param contents an Asn1Encodable instance. +
    + + Returns the stored string object. + + @return the stored text as a string. + + + The DistributionPoint object. +
    +            DistributionPoint ::= Sequence {
    +                 distributionPoint [0] DistributionPointName OPTIONAL,
    +                 reasons           [1] ReasonFlags OPTIONAL,
    +                 cRLIssuer         [2] GeneralNames OPTIONAL
    +            }
    +            
    +
    + + The DistributionPointName object. +
    +            DistributionPointName ::= CHOICE {
    +                fullName                 [0] GeneralNames,
    +                nameRelativeToCRLIssuer  [1] RDN
    +            }
    +            
    +
    + + The extendedKeyUsage object. +
    +                 extendedKeyUsage ::= Sequence SIZE (1..MAX) OF KeyPurposeId
    +            
    +
    + + Returns all extended key usages. + The returned ArrayList contains DerObjectIdentifier instances. + @return An ArrayList with all key purposes. + + + The GeneralName object. +
    +             GeneralName ::= CHOICE {
    +                  otherName                       [0]     OtherName,
    +                  rfc822Name                      [1]     IA5String,
    +                  dNSName                         [2]     IA5String,
    +                  x400Address                     [3]     ORAddress,
    +                  directoryName                   [4]     Name,
    +                  ediPartyName                    [5]     EDIPartyName,
    +                  uniformResourceIdentifier       [6]     IA5String,
    +                  iPAddress                       [7]     OCTET STRING,
    +                  registeredID                    [8]     OBJECT IDENTIFIER}
    +            
    +             OtherName ::= Sequence {
    +                  type-id    OBJECT IDENTIFIER,
    +                  value      [0] EXPLICIT ANY DEFINED BY type-id }
    +            
    +             EDIPartyName ::= Sequence {
    +                  nameAssigner            [0]     DirectoryString OPTIONAL,
    +                  partyName               [1]     DirectoryString }
    +             
    +
    + + When the subjectAltName extension contains an Internet mail address, + the address MUST be included as an rfc822Name. The format of an + rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. + + When the subjectAltName extension contains a domain name service + label, the domain name MUST be stored in the dNSName (an IA5String). + The name MUST be in the "preferred name syntax," as specified by RFC + 1034 [RFC 1034]. + + When the subjectAltName extension contains a URI, the name MUST be + stored in the uniformResourceIdentifier (an IA5String). The name MUST + be a non-relative URL, and MUST follow the URL syntax and encoding + rules specified in [RFC 1738]. The name must include both a scheme + (e.g., "http" or "ftp") and a scheme-specific-part. The scheme- + specific-part must include a fully qualified domain name or IP + address as the host. + + When the subjectAltName extension contains a iPAddress, the address + MUST be stored in the octet string in "network byte order," as + specified in RFC 791 [RFC 791]. The least significant bit (LSB) of + each octet is the LSB of the corresponding byte in the network + address. For IP Version 4, as specified in RFC 791, the octet string + MUST contain exactly four octets. For IP Version 6, as specified in + RFC 1883, the octet string MUST contain exactly sixteen octets [RFC + 1883]. + + + Create a GeneralName for the given tag from the passed in string. +

    + This constructor can handle: +

      +
    • rfc822Name
    • +
    • iPAddress
    • +
    • directoryName
    • +
    • dNSName
    • +
    • uniformResourceIdentifier
    • +
    • registeredID
    • +
    + For x400Address, otherName and ediPartyName there is no common string + format defined. +

    + Note: A directory name can be encoded in different ways into a byte + representation. Be aware of this if the byte representation is used for + comparing results. +

    + + @param tag tag number + @param name string representation of name + @throws ArgumentException if the string encoding is not correct or + not supported. +
    + + Construct a GeneralNames object containing one GeneralName. + The name to be contained. + + + Produce an object suitable for an Asn1OutputStream. +
    +            GeneralNames ::= Sequence SIZE {1..MAX} OF GeneralName
    +            
    +
    + + Class for containing a restriction object subtrees in NameConstraints. See + RFC 3280. + +
    +            
    +                   GeneralSubtree ::= SEQUENCE
    +                   {
    +                     baseName                    GeneralName,
    +                     minimum         [0]     BaseDistance DEFAULT 0,
    +                     maximum         [1]     BaseDistance OPTIONAL
    +                   }
    +             
    + + @see org.bouncycastle.asn1.x509.NameConstraints + +
    + + Constructor from a given details. + + According RFC 3280, the minimum and maximum fields are not used with any + name forms, thus minimum MUST be zero, and maximum MUST be absent. +

    + If minimum is null, zero is assumed, if + maximum is null, maximum is absent.

    + + @param baseName + A restriction. + @param minimum + Minimum + + @param maximum + Maximum +
    + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
    +                   GeneralSubtree ::= SEQUENCE
    +                   {
    +                     baseName                    GeneralName,
    +                     minimum         [0]     BaseDistance DEFAULT 0,
    +                     maximum         [1]     BaseDistance OPTIONAL
    +                   }
    +             
    + + @return a DERObject +
    + + The Holder object. +

    + For an v2 attribute certificate this is: + +

    +                       Holder ::= SEQUENCE {
    +                             baseCertificateID   [0] IssuerSerial OPTIONAL,
    +                                      -- the issuer and serial number of
    +                                      -- the holder's Public Key Certificate
    +                             entityName          [1] GeneralNames OPTIONAL,
    +                                      -- the name of the claimant or role
    +                             objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
    +                                      -- used to directly authenticate the holder,
    +                                      -- for example, an executable
    +                       }
    +            
    +

    +

    + For an v1 attribute certificate this is: + +

    +                    subject CHOICE {
    +                     baseCertificateID [0] IssuerSerial,
    +                     -- associated with a Public Key Certificate
    +                     subjectName [1] GeneralNames },
    +                     -- associated with a name
    +            
    +

    +
    + + Constructor for a holder for an v1 attribute certificate. + + @param tagObj The ASN.1 tagged holder object. + + + Constructor for a holder for an v2 attribute certificate. * + + @param seq The ASN.1 sequence. + + + Constructs a holder from a IssuerSerial. + @param baseCertificateID The IssuerSerial. + @param version The version of the attribute certificate. + + + Constructs a holder with an entityName for v2 attribute certificates or + with a subjectName for v1 attribute certificates. + + @param entityName The entity or subject name. + + + Constructs a holder with an entityName for v2 attribute certificates or + with a subjectName for v1 attribute certificates. + + @param entityName The entity or subject name. + @param version The version of the attribute certificate. + + + Constructs a holder from an object digest info. + + @param objectDigestInfo The object digest info object. + + + The Holder object. +
    +             Holder ::= Sequence {
    +                   baseCertificateID   [0] IssuerSerial OPTIONAL,
    +                            -- the issuer and serial number of
    +                            -- the holder's Public Key Certificate
    +                   entityName          [1] GeneralNames OPTIONAL,
    +                            -- the name of the claimant or role
    +                   objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
    +                            -- used to directly authenticate the holder,
    +                            -- for example, an executable
    +             }
    +            
    +
    + + Returns 1 for v2 attribute certificates or 0 for v1 attribute + certificates. + @return The version of the attribute certificate. + + + Returns the entityName for an v2 attribute certificate or the subjectName + for an v1 attribute certificate. + + @return The entityname or subjectname. + + + Implementation of IetfAttrSyntax as specified by RFC3281. + + + + + + +
    +            
    +              IetfAttrSyntax ::= Sequence {
    +                policyAuthority [0] GeneralNames OPTIONAL,
    +                values Sequence OF CHOICE {
    +                  octets OCTET STRING,
    +                  oid OBJECT IDENTIFIER,
    +                  string UTF8String
    +                }
    +              }
    +            
    +             
    +
    + + Produce an object suitable for an Asn1OutputStream. +
    +             IssuerSerial  ::=  Sequence {
    +                  issuer         GeneralNames,
    +                  serial         CertificateSerialNumber,
    +                  issuerUid      UniqueIdentifier OPTIONAL
    +             }
    +            
    +
    + +
    +            IssuingDistributionPoint ::= SEQUENCE { 
    +              distributionPoint          [0] DistributionPointName OPTIONAL, 
    +              onlyContainsUserCerts      [1] BOOLEAN DEFAULT FALSE, 
    +              onlyContainsCACerts        [2] BOOLEAN DEFAULT FALSE, 
    +              onlySomeReasons            [3] ReasonFlags OPTIONAL, 
    +              indirectCRL                [4] BOOLEAN DEFAULT FALSE,
    +              onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
    +            
    +
    + + Constructor from given details. + + @param distributionPoint + May contain an URI as pointer to most current CRL. + @param onlyContainsUserCerts Covers revocation information for end certificates. + @param onlyContainsCACerts Covers revocation information for CA certificates. + + @param onlySomeReasons + Which revocation reasons does this point cover. + @param indirectCRL + If true then the CRL contains revocation + information about certificates ssued by other CAs. + @param onlyContainsAttributeCerts Covers revocation information for attribute certificates. + + + Constructor from Asn1Sequence + + + @return Returns the distributionPoint. + + + @return Returns the onlySomeReasons. + + + The KeyPurposeID object. +
    +                KeyPurposeID ::= OBJECT IDENTIFIER
    +            
    +
    + + The KeyUsage object. +
    +                id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +            
    +                KeyUsage ::= BIT STRING {
    +                     digitalSignature        (0),
    +                     nonRepudiation          (1),
    +                     keyEncipherment         (2),
    +                     dataEncipherment        (3),
    +                     keyAgreement            (4),
    +                     keyCertSign             (5),
    +                     cRLSign                 (6),
    +                     encipherOnly            (7),
    +                     decipherOnly            (8) }
    +             
    +
    + + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment) + + + Constructor from a given details. + +

    permitted and excluded are Vectors of GeneralSubtree objects.

    + + @param permitted Permitted subtrees + @param excluded Excluded subtrees +
    + + NoticeReference class, used in + CertificatePolicies X509 V3 extensions + (in policy qualifiers). + +
    +              NoticeReference ::= Sequence {
    +                  organization     DisplayText,
    +                  noticeNumbers    Sequence OF Integer }
    +            
    +             
    + + @see PolicyQualifierInfo + @see PolicyInformation +
    + + Creates a new NoticeReference instance. + + @param organization a String value + @param numbers a Vector value + + + Creates a new NoticeReference instance. + + @param organization a String value + @param noticeNumbers an ASN1EncodableVector value + + + Creates a new NoticeReference instance. + + @param organization displayText + @param noticeNumbers an ASN1EncodableVector value + + + Creates a new NoticeReference instance. +

    Useful for reconstructing a NoticeReference + instance from its encodable/encoded form.

    + + @param as an Asn1Sequence value obtained from either + calling @{link ToAsn1Object()} for a NoticeReference + instance or from parsing it from a Der-encoded stream. +
    + + Describe ToAsn1Object method here. + + @return a Asn1Object value + + + ObjectDigestInfo ASN.1 structure used in v2 attribute certificates. + +
    +             
    +               ObjectDigestInfo ::= SEQUENCE {
    +                    digestedObjectType  ENUMERATED {
    +                            publicKey            (0),
    +                            publicKeyCert        (1),
    +                            otherObjectTypes     (2) },
    +                                    -- otherObjectTypes MUST NOT
    +                                    -- be used in this profile
    +                    otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
    +                    digestAlgorithm     AlgorithmIdentifier,
    +                    objectDigest        BIT STRING
    +               }
    +              
    +            
    + +
    + + The public key is hashed. + + + The public key certificate is hashed. + + + An other object is hashed. + + + Constructor from given details. +

    + If digestedObjectType is not {@link #publicKeyCert} or + {@link #publicKey} otherObjectTypeID must be given, + otherwise it is ignored.

    + + @param digestedObjectType The digest object type. + @param otherObjectTypeID The object type ID for + otherObjectDigest. + @param digestAlgorithm The algorithm identifier for the hash. + @param objectDigest The hash value. +
    + + Produce an object suitable for an Asn1OutputStream. + +
    +             
    +               ObjectDigestInfo ::= SEQUENCE {
    +                    digestedObjectType  ENUMERATED {
    +                            publicKey            (0),
    +                            publicKeyCert        (1),
    +                            otherObjectTypes     (2) },
    +                                    -- otherObjectTypes MUST NOT
    +                                    -- be used in this profile
    +                    otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
    +                    digestAlgorithm     AlgorithmIdentifier,
    +                    objectDigest        BIT STRING
    +               }
    +              
    +            
    +
    + + PolicyMappings V3 extension, described in RFC3280. +
    +                PolicyMappings ::= Sequence SIZE (1..MAX) OF Sequence {
    +                  issuerDomainPolicy      CertPolicyId,
    +                  subjectDomainPolicy     CertPolicyId }
    +             
    + + @see RFC 3280, section 4.2.1.6 +
    + + Creates a new PolicyMappings instance. + + @param seq an Asn1Sequence constructed as specified + in RFC 3280 + + + Creates a new PolicyMappings instance. + + @param mappings a HashMap value that maps + string oids + to other string oids. + + + PolicyQualifierId, used in the CertificatePolicies + X509V3 extension. + +
    +                id-qt          OBJECT IDENTIFIER ::=  { id-pkix 2 }
    +                id-qt-cps      OBJECT IDENTIFIER ::=  { id-qt 1 }
    +                id-qt-unotice  OBJECT IDENTIFIER ::=  { id-qt 2 }
    +              PolicyQualifierId ::=
    +                   OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    +             
    +
    + + Policy qualifiers, used in the X509V3 CertificatePolicies + extension. + +
    +               PolicyQualifierInfo ::= Sequence {
    +                   policyQualifierId  PolicyQualifierId,
    +                   qualifier          ANY DEFINED BY policyQualifierId }
    +             
    +
    + + Creates a new PolicyQualifierInfo instance. + + @param policyQualifierId a PolicyQualifierId value + @param qualifier the qualifier, defined by the above field. + + + Creates a new PolicyQualifierInfo containing a + cPSuri qualifier. + + @param cps the CPS (certification practice statement) uri as a + string. + + + Creates a new PolicyQualifierInfo instance. + + @param as PolicyQualifierInfo X509 structure + encoded as an Asn1Sequence. + + + Returns a Der-encodable representation of this instance. + + @return a Asn1Object value + + + +
    +            PrivateKeyUsagePeriod ::= SEQUENCE
    +            {
    +            notBefore       [0]     GeneralizedTime OPTIONAL,
    +            notAfter        [1]     GeneralizedTime OPTIONAL }
    +            
    +
    +
    + + The BiometricData object. +
    +            BiometricData  ::=  SEQUENCE {
    +                  typeOfBiometricData  TypeOfBiometricData,
    +                  hashAlgorithm        AlgorithmIdentifier,
    +                  biometricDataHash    OCTET STRING,
    +                  sourceDataUri        IA5String OPTIONAL  }
    +            
    +
    + + The Iso4217CurrencyCode object. +
    +            Iso4217CurrencyCode  ::=  CHOICE {
    +                  alphabetic              PrintableString (SIZE 3), --Recommended
    +                  numeric              INTEGER (1..999) }
    +            -- Alphabetic or numeric currency code as defined in ISO 4217
    +            -- It is recommended that the Alphabetic form is used
    +            
    +
    + + The MonetaryValue object. +
    +            MonetaryValue  ::=  SEQUENCE {
    +                  currency              Iso4217CurrencyCode,
    +                  amount               INTEGER,
    +                  exponent             INTEGER }
    +            -- value = amount * 10^exponent
    +            
    +
    + + The QCStatement object. +
    +            QCStatement ::= SEQUENCE {
    +              statementId        OBJECT IDENTIFIER,
    +              statementInfo      ANY DEFINED BY statementId OPTIONAL}
    +            
    +
    + + The SemanticsInformation object. +
    +                   SemanticsInformation ::= SEQUENCE {
    +                     semanticsIdentifier        OBJECT IDENTIFIER   OPTIONAL,
    +                     nameRegistrationAuthorities NameRegistrationAuthorities
    +                                                                     OPTIONAL }
    +                     (WITH COMPONENTS {..., semanticsIdentifier PRESENT}|
    +                      WITH COMPONENTS {..., nameRegistrationAuthorities PRESENT})
    +            
    +                 NameRegistrationAuthorities ::=  SEQUENCE SIZE (1..MAX) OF
    +                     GeneralName
    +             
    +
    + + The TypeOfBiometricData object. +
    +             TypeOfBiometricData ::= CHOICE {
    +               predefinedBiometricType   PredefinedBiometricType,
    +               biometricDataOid          OBJECT IDENTIFIER }
    +            
    +             PredefinedBiometricType ::= INTEGER {
    +               picture(0),handwritten-signature(1)}
    +               (picture|handwritten-signature)
    +             
    +
    + + The ReasonFlags object. +
    +            ReasonFlags ::= BIT STRING {
    +               unused(0),
    +               keyCompromise(1),
    +               cACompromise(2),
    +               affiliationChanged(3),
    +               superseded(4),
    +               cessationOfOperation(5),
    +               certficateHold(6)
    +            }
    +            
    +
    + + @param reasons - the bitwise OR of the Key Reason flags giving the + allowed uses for the key. + + + Implementation of the RoleSyntax object as specified by the RFC3281. + +
    +             RoleSyntax ::= SEQUENCE {
    +                             roleAuthority  [0] GeneralNames OPTIONAL,
    +                             roleName       [1] GeneralName
    +                       }
    +             
    +
    + + RoleSyntax factory method. + @param obj the object used to construct an instance of + RoleSyntax. It must be an instance of RoleSyntax + or Asn1Sequence. + @return the instance of RoleSyntax built from the + supplied object. + @throws java.lang.ArgumentException if the object passed + to the factory is not an instance of RoleSyntax or + Asn1Sequence. + + + Constructor. + @param roleAuthority the role authority of this RoleSyntax. + @param roleName the role name of this RoleSyntax. + + + Constructor. Invoking this constructor is the same as invoking + new RoleSyntax(null, roleName). + @param roleName the role name of this RoleSyntax. + + + Utility constructor. Takes a string argument representing + the role name, builds a GeneralName to hold the role name + and calls the constructor that takes a GeneralName. + @param roleName + + + Constructor that builds an instance of RoleSyntax by + extracting the encoded elements from the Asn1Sequence + object supplied. + @param seq an instance of Asn1Sequence that holds + the encoded elements used to build this RoleSyntax. + + + Gets the role name as a java.lang.string object. + @return the role name of this RoleSyntax represented as a + string object. + + + Gets the role authority as a string[] object. + @return the role authority of this RoleSyntax represented as a + string[] array. + + + Implementation of the method ToAsn1Object as + required by the superclass ASN1Encodable. + +
    +             RoleSyntax ::= SEQUENCE {
    +                             roleAuthority  [0] GeneralNames OPTIONAL,
    +                             roleName       [1] GeneralName
    +                       }
    +             
    +
    + + Gets the role authority of this RoleSyntax. + @return an instance of GeneralNames holding the + role authority of this RoleSyntax. + + + Gets the role name of this RoleSyntax. + @return an instance of GeneralName holding the + role name of this RoleSyntax. + + + This outputs the key in Pkcs1v2 format. +
    +                 RSAPublicKey ::= Sequence {
    +                                     modulus Integer, -- n
    +                                     publicExponent Integer, -- e
    +                                 }
    +            
    +
    + + Structure for a name or pseudonym. + +
    +                  NameOrPseudonym ::= CHOICE {
    +                	   surAndGivenName SEQUENCE {
    +                	     surName DirectoryString,
    +                	     givenName SEQUENCE OF DirectoryString 
    +                    },
    +                	   pseudonym DirectoryString 
    +                  }
    +            
    + + @see org.bouncycastle.asn1.x509.sigi.PersonalData + +
    + + Constructor from DERString. +

    + The sequence is of type NameOrPseudonym: +

    +

    +                  NameOrPseudonym ::= CHOICE {
    +                	   surAndGivenName SEQUENCE {
    +                	     surName DirectoryString,
    +                	     givenName SEQUENCE OF DirectoryString
    +                    },
    +                	   pseudonym DirectoryString
    +                  }
    +            
    + @param pseudonym pseudonym value to use. +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type NameOrPseudonym: +

    +

    +                   NameOrPseudonym ::= CHOICE {
    +                 	   surAndGivenName SEQUENCE {
    +                 	     surName DirectoryString,
    +                 	     givenName SEQUENCE OF DirectoryString
    +                     },
    +                 	   pseudonym DirectoryString
    +                   }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. + + @param pseudonym The pseudonym. + + + Constructor from a given details. + + @param surname The surname. + @param givenName A sequence of directory strings making up the givenName + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                   NameOrPseudonym ::= CHOICE {
    +                 	   surAndGivenName SEQUENCE {
    +                 	     surName DirectoryString,
    +                 	     givenName SEQUENCE OF DirectoryString
    +                     },
    +                 	   pseudonym DirectoryString
    +                   }
    +             
    + + @return an Asn1Object +
    + + Contains personal data for the otherName field in the subjectAltNames + extension. +

    +

    +                 PersonalData ::= SEQUENCE {
    +                   nameOrPseudonym NameOrPseudonym,
    +                   nameDistinguisher [0] INTEGER OPTIONAL,
    +                   dateOfBirth [1] GeneralizedTime OPTIONAL,
    +                   placeOfBirth [2] DirectoryString OPTIONAL,
    +                   gender [3] PrintableString OPTIONAL,
    +                   postalAddress [4] DirectoryString OPTIONAL
    +                   }
    +             
    + + @see org.bouncycastle.asn1.x509.sigi.NameOrPseudonym + @see org.bouncycastle.asn1.x509.sigi.SigIObjectIdentifiers +
    + + Constructor from Asn1Sequence. +

    + The sequence is of type NameOrPseudonym: +

    +

    +                 PersonalData ::= SEQUENCE {
    +                   nameOrPseudonym NameOrPseudonym,
    +                   nameDistinguisher [0] INTEGER OPTIONAL,
    +                   dateOfBirth [1] GeneralizedTime OPTIONAL,
    +                   placeOfBirth [2] DirectoryString OPTIONAL,
    +                   gender [3] PrintableString OPTIONAL,
    +                   postalAddress [4] DirectoryString OPTIONAL
    +                   }
    +             
    + + @param seq The ASN.1 sequence. +
    + + Constructor from a given details. + + @param nameOrPseudonym Name or pseudonym. + @param nameDistinguisher Name distinguisher. + @param dateOfBirth Date of birth. + @param placeOfBirth Place of birth. + @param gender Gender. + @param postalAddress Postal Address. + + + Produce an object suitable for an Asn1OutputStream. +

    + Returns: +

    +

    +                 PersonalData ::= SEQUENCE {
    +                   nameOrPseudonym NameOrPseudonym,
    +                   nameDistinguisher [0] INTEGER OPTIONAL,
    +                   dateOfBirth [1] GeneralizedTime OPTIONAL,
    +                   placeOfBirth [2] DirectoryString OPTIONAL,
    +                   gender [3] PrintableString OPTIONAL,
    +                   postalAddress [4] DirectoryString OPTIONAL
    +                   }
    +             
    + + @return an Asn1Object +
    + + Object Identifiers of SigI specifciation (German Signature Law + Interoperability specification). + + + Key purpose IDs for German SigI (Signature Interoperability + Specification) + + + Certificate policy IDs for German SigI (Signature Interoperability + Specification) + + + Other Name IDs for German SigI (Signature Interoperability Specification) + + + To be used for for the generation of directory service certificates. + + + ID for PersonalData + + + Certificate is conform to german signature law. + + + This extension may contain further X.500 attributes of the subject. See also + RFC 3039. + +
    +                 SubjectDirectoryAttributes ::= Attributes
    +                 Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
    +                 Attribute ::= SEQUENCE
    +                 {
    +                   type AttributeType
    +                   values SET OF AttributeValue
    +                 }
    +            
    +                 AttributeType ::= OBJECT IDENTIFIER
    +                 AttributeValue ::= ANY DEFINED BY AttributeType
    +             
    + + @see org.bouncycastle.asn1.x509.X509Name for AttributeType ObjectIdentifiers. +
    + + Constructor from Asn1Sequence. + + The sequence is of type SubjectDirectoryAttributes: + +
    +                  SubjectDirectoryAttributes ::= Attributes
    +                  Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
    +                  Attribute ::= SEQUENCE
    +                  {
    +                    type AttributeType
    +                    values SET OF AttributeValue
    +                  }
    +            
    +                  AttributeType ::= OBJECT IDENTIFIER
    +                  AttributeValue ::= ANY DEFINED BY AttributeType
    +             
    + + @param seq + The ASN.1 sequence. +
    + + Constructor from an ArrayList of attributes. + + The ArrayList consists of attributes of type {@link Attribute Attribute} + + @param attributes The attributes. + + + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
    +                  SubjectDirectoryAttributes ::= Attributes
    +                  Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
    +                  Attribute ::= SEQUENCE
    +                  {
    +                    type AttributeType
    +                    values SET OF AttributeValue
    +                  }
    +            
    +                  AttributeType ::= OBJECT IDENTIFIER
    +                  AttributeValue ::= ANY DEFINED BY AttributeType
    +             
    + + @return a DERObject +
    + + @return Returns the attributes. + + + The SubjectKeyIdentifier object. +
    +            SubjectKeyIdentifier::= OCTET STRING
    +            
    +
    + + Calculates the keyIdentifier using a SHA1 hash over the BIT STRING + from SubjectPublicKeyInfo as defined in RFC3280. + + @param spki the subject public key info. + + + Return a RFC 3280 type 1 key identifier. As in: +
    +            (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the
    +            value of the BIT STRING subjectPublicKey (excluding the tag,
    +            length, and number of unused bits).
    +            
    + @param keyInfo the key info object containing the subjectPublicKey field. + @return the key identifier. +
    + + Return a RFC 3280 type 2 key identifier. As in: +
    +            (2) The keyIdentifier is composed of a four bit type field with
    +            the value 0100 followed by the least significant 60 bits of the
    +            SHA-1 hash of the value of the BIT STRING subjectPublicKey.
    +            
    + @param keyInfo the key info object containing the subjectPublicKey field. + @return the key identifier. +
    + + The object that contains the public key stored in a certficate. +

    + The GetEncoded() method in the public keys in the JCE produces a DER + encoded one of these.

    +
    + + for when the public key is an encoded object - if the bitstring + can't be decoded this routine raises an IOException. + + @exception IOException - if the bit string doesn't represent a Der + encoded object. + + + Produce an object suitable for an Asn1OutputStream. +
    +            SubjectPublicKeyInfo ::= Sequence {
    +                                     algorithm AlgorithmIdentifier,
    +                                     publicKey BIT STRING }
    +            
    +
    + + for when the public key is raw bits... + + + Target structure used in target information extension for attribute + certificates from RFC 3281. + +
    +                Target  ::= CHOICE {
    +                  targetName          [0] GeneralName,
    +                  targetGroup         [1] GeneralName,
    +                  targetCert          [2] TargetCert
    +                }
    +            
    + +

    + The targetCert field is currently not supported and must not be used + according to RFC 3281.

    +
    + + Creates an instance of a Target from the given object. +

    + obj can be a Target or a {@link Asn1TaggedObject}

    + + @param obj The object. + @return A Target instance. + @throws ArgumentException if the given object cannot be + interpreted as Target. +
    + + Constructor from Asn1TaggedObject. + + @param tagObj The tagged object. + @throws ArgumentException if the encoding is wrong. + + + Constructor from given details. +

    + Exactly one of the parameters must be not null.

    + + @param type the choice type to apply to the name. + @param name the general name. + @throws ArgumentException if type is invalid. +
    + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
    +                Target  ::= CHOICE {
    +                  targetName          [0] GeneralName,
    +                  targetGroup         [1] GeneralName,
    +                  targetCert          [2] TargetCert
    +                }
    +            
    + + @return an Asn1Object +
    + + @return Returns the targetGroup. + + + @return Returns the targetName. + + + Target information extension for attributes certificates according to RFC + 3281. + +
    +                      SEQUENCE OF Targets
    +            
    + +
    + + Creates an instance of a TargetInformation from the given object. +

    + obj can be a TargetInformation or a {@link Asn1Sequence}

    + + @param obj The object. + @return A TargetInformation instance. + @throws ArgumentException if the given object cannot be interpreted as TargetInformation. +
    + + Constructor from a Asn1Sequence. + + @param seq The Asn1Sequence. + @throws ArgumentException if the sequence does not contain + correctly encoded Targets elements. + + + Returns the targets in this target information extension. +

    + The ArrayList is cloned before it is returned.

    + + @return Returns the targets. +
    + + Constructs a target information from a single targets element. + According to RFC 3281 only one targets element must be produced. + + @param targets A Targets instance. + + + According to RFC 3281 only one targets element must be produced. If + multiple targets are given they must be merged in + into one targets element. + + @param targets An array with {@link Targets}. + + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
    +                     SEQUENCE OF Targets
    +            
    + +

    + According to RFC 3281 only one targets element must be produced. If + multiple targets are given in the constructor they are merged into one + targets element. If this was produced from a + {@link Org.BouncyCastle.Asn1.Asn1Sequence} the encoding is kept.

    + + @return an Asn1Object +
    + + Targets structure used in target information extension for attribute + certificates from RFC 3281. + +
    +                       Targets ::= SEQUENCE OF Target
    +                      
    +                       Target  ::= CHOICE {
    +                         targetName          [0] GeneralName,
    +                         targetGroup         [1] GeneralName,
    +                         targetCert          [2] TargetCert
    +                       }
    +                      
    +                       TargetCert  ::= SEQUENCE {
    +                         targetCertificate    IssuerSerial,
    +                         targetName           GeneralName OPTIONAL,
    +                         certDigestInfo       ObjectDigestInfo OPTIONAL
    +                       }
    +            
    + + @see org.bouncycastle.asn1.x509.Target + @see org.bouncycastle.asn1.x509.TargetInformation +
    + + Creates an instance of a Targets from the given object. +

    + obj can be a Targets or a {@link Asn1Sequence}

    + + @param obj The object. + @return A Targets instance. + @throws ArgumentException if the given object cannot be interpreted as Target. +
    + + Constructor from Asn1Sequence. + + @param targets The ASN.1 SEQUENCE. + @throws ArgumentException if the contents of the sequence are + invalid. + + + Constructor from given targets. +

    + The ArrayList is copied.

    + + @param targets An ArrayList of {@link Target}s. + @see Target + @throws ArgumentException if the ArrayList contains not only Targets. +
    + + Returns the targets in an ArrayList. +

    + The ArrayList is cloned before it is returned.

    + + @return Returns the targets. +
    + + Produce an object suitable for an Asn1OutputStream. + + Returns: + +
    +                       Targets ::= SEQUENCE OF Target
    +            
    + + @return an Asn1Object +
    + + The TbsCertificate object. +
    +            TbsCertificate ::= Sequence {
    +                 version          [ 0 ]  Version DEFAULT v1(0),
    +                 serialNumber            CertificateSerialNumber,
    +                 signature               AlgorithmIdentifier,
    +                 issuer                  Name,
    +                 validity                Validity,
    +                 subject                 Name,
    +                 subjectPublicKeyInfo    SubjectPublicKeyInfo,
    +                 issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
    +                 subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
    +                 extensions        [ 3 ] Extensions OPTIONAL
    +                 }
    +            
    +

    + Note: issuerUniqueID and subjectUniqueID are both deprecated by the IETF. This class + will parse them, but you really shouldn't be creating new ones.

    +
    + + PKIX RFC-2459 - TbsCertList object. +
    +            TbsCertList  ::=  Sequence  {
    +                 version                 Version OPTIONAL,
    +                                              -- if present, shall be v2
    +                 signature               AlgorithmIdentifier,
    +                 issuer                  Name,
    +                 thisUpdate              Time,
    +                 nextUpdate              Time OPTIONAL,
    +                 revokedCertificates     Sequence OF Sequence  {
    +                      userCertificate         CertificateSerialNumber,
    +                      revocationDate          Time,
    +                      crlEntryExtensions      Extensions OPTIONAL
    +                                                    -- if present, shall be v2
    +                                           }  OPTIONAL,
    +                 crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    +                                                    -- if present, shall be v2
    +                                           }
    +            
    +
    + + creates a time object from a given date - if the date is between 1950 + and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + is used. + + + + Return our time as DateTime. + + A date time. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Time ::= CHOICE {
    +                        utcTime        UTCTime,
    +                        generalTime    GeneralizedTime }
    +            
    +
    + + UserNotice class, used in + CertificatePolicies X509 extensions (in policy + qualifiers). +
    +             UserNotice ::= Sequence {
    +                  noticeRef        NoticeReference OPTIONAL,
    +                  explicitText     DisplayText OPTIONAL}
    +            
    +             
    + + @see PolicyQualifierId + @see PolicyInformation +
    + + Creates a new UserNotice instance. + + @param noticeRef a NoticeReference value + @param explicitText a DisplayText value + + + Creates a new UserNotice instance. + + @param noticeRef a NoticeReference value + @param str the explicitText field as a string. + + + Creates a new UserNotice instance. +

    Useful from reconstructing a UserNotice instance + from its encodable/encoded form. + + @param as an ASN1Sequence value obtained from either + calling @{link toASN1Object()} for a UserNotice + instance or from parsing it from a DER-encoded stream.

    +
    + + Generator for Version 1 TbsCertificateStructures. +
    +             TbsCertificate ::= Sequence {
    +                  version          [ 0 ]  Version DEFAULT v1(0),
    +                  serialNumber            CertificateSerialNumber,
    +                  signature               AlgorithmIdentifier,
    +                  issuer                  Name,
    +                  validity                Validity,
    +                  subject                 Name,
    +                  subjectPublicKeyInfo    SubjectPublicKeyInfo,
    +                  }
    +             
    + +
    + + Generator for Version 2 AttributeCertificateInfo +
    +             AttributeCertificateInfo ::= Sequence {
    +                   version              AttCertVersion -- version is v2,
    +                   holder               Holder,
    +                   issuer               AttCertIssuer,
    +                   signature            AlgorithmIdentifier,
    +                   serialNumber         CertificateSerialNumber,
    +                   attrCertValidityPeriod   AttCertValidityPeriod,
    +                   attributes           Sequence OF Attr,
    +                   issuerUniqueID       UniqueIdentifier OPTIONAL,
    +                   extensions           Extensions OPTIONAL
    +             }
    +             
    + +
    + + @param attribute + + + Produce an object suitable for an Asn1OutputStream. +
    +             V2Form ::= Sequence {
    +                  issuerName            GeneralNames  OPTIONAL,
    +                  baseCertificateID     [0] IssuerSerial  OPTIONAL,
    +                  objectDigestInfo      [1] ObjectDigestInfo  OPTIONAL
    +                    -- issuerName MUST be present in this profile
    +                    -- baseCertificateID and objectDigestInfo MUST NOT
    +                    -- be present in this profile
    +             }
    +            
    +
    + + Generator for Version 2 TbsCertList structures. +
    +              TbsCertList  ::=  Sequence  {
    +                   version                 Version OPTIONAL,
    +                                                -- if present, shall be v2
    +                   signature               AlgorithmIdentifier,
    +                   issuer                  Name,
    +                   thisUpdate              Time,
    +                   nextUpdate              Time OPTIONAL,
    +                   revokedCertificates     Sequence OF Sequence  {
    +                        userCertificate         CertificateSerialNumber,
    +                        revocationDate          Time,
    +                        crlEntryExtensions      Extensions OPTIONAL
    +                                                      -- if present, shall be v2
    +                                             }  OPTIONAL,
    +                   crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    +                                                      -- if present, shall be v2
    +                                             }
    +             
    + + Note: This class may be subject to change +
    + + Generator for Version 3 TbsCertificateStructures. +
    +             TbsCertificate ::= Sequence {
    +                  version          [ 0 ]  Version DEFAULT v1(0),
    +                  serialNumber            CertificateSerialNumber,
    +                  signature               AlgorithmIdentifier,
    +                  issuer                  Name,
    +                  validity                Validity,
    +                  subject                 Name,
    +                  subjectPublicKeyInfo    SubjectPublicKeyInfo,
    +                  issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
    +                  subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
    +                  extensions        [ 3 ] Extensions OPTIONAL
    +                  }
    +             
    + +
    + + an X509Certificate structure. +
    +             Certificate ::= Sequence {
    +                 tbsCertificate          TbsCertificate,
    +                 signatureAlgorithm      AlgorithmIdentifier,
    +                 signature               BIT STRING
    +             }
    +            
    +
    + + The default converter for X509 DN entries when going from their + string value to ASN.1 strings. + + + * It turns out that the number of standard ways the fields in a DN should be + * encoded into their ASN.1 counterparts is rapidly approaching the + * number of machines on the internet. By default the X509Name class + * will produce UTF8Strings in line with the current recommendations (RFC 3280). + *

    + * An example of an encoder look like below: + *

    +                 * public class X509DirEntryConverter
    +                 *     : X509NameEntryConverter
    +                 * {
    +                 *     public Asn1Object GetConvertedValue(
    +                 *         DerObjectIdentifier  oid,
    +                 *         string               value)
    +                 *     {
    +                 *         if (str.Length() != 0 && str.charAt(0) == '#')
    +                 *         {
    +                 *             return ConvertHexEncoded(str, 1);
    +                 *         }
    +                 *         if (oid.Equals(EmailAddress))
    +                 *         {
    +                 *             return new DerIA5String(str);
    +                 *         }
    +                 *         else if (CanBePrintable(str))
    +                 *         {
    +                 *             return new DerPrintableString(str);
    +                 *         }
    +                 *         else if (CanBeUTF8(str))
    +                 *         {
    +                 *             return new DerUtf8String(str);
    +                 *         }
    +                 *         else
    +                 *         {
    +                 *             return new DerBmpString(str);
    +                 *         }
    +                 *     }
    +                 * }
    +            	 * 
    + *

    +
    + + Convert an inline encoded hex string rendition of an ASN.1 + object back into its corresponding ASN.1 object. + + @param str the hex encoded object + @param off the index at which the encoding starts + @return the decoded object + + + return true if the passed in string can be represented without + loss as a PrintableString, false otherwise. + + + Convert the passed in string value into the appropriate ASN.1 + encoded object. + + @param oid the oid associated with the value in the DN. + @param value the value of the particular DN component. + @return the ASN.1 equivalent for the value. + + + Apply default conversion for the given value depending on the oid + and the character range of the value. + + @param oid the object identifier for the DN entry + @param value the value associated with it + @return the ASN.1 equivalent for the string value. + + + an object for the elements in the X.509 V3 extension block. + + + Convert the value of the passed in extension to an object. + The extension to parse. + The object the value string contains. + If conversion is not possible. + + + Subject Directory Attributes + + + Subject Key Identifier + + + Key Usage + + + Private Key Usage Period + + + Subject Alternative Name + + + Issuer Alternative Name + + + Basic Constraints + + + CRL Number + + + Reason code + + + Hold Instruction Code + + + Invalidity Date + + + Delta CRL indicator + + + Issuing Distribution Point + + + Certificate Issuer + + + Name Constraints + + + CRL Distribution Points + + + Certificate Policies + + + Policy Mappings + + + Authority Key Identifier + + + Policy Constraints + + + Extended Key Usage + + + Freshest CRL + + + Inhibit Any Policy + + + Authority Info Access + + + Subject Info Access + + + Logo Type + + + BiometricInfo + + + QCStatements + + + Audit identity extension in attribute certificates. + + + NoRevAvail extension in attribute certificates. + + + TargetInformation extension in attribute certificates. + + + Constructor from Asn1Sequence. + + the extensions are a list of constructed sequences, either with (Oid, OctetString) or (Oid, Boolean, OctetString) + + + constructor from a table of extensions. +

    + it's is assumed the table contains Oid/string pairs.

    +
    + + Constructor from a table of extensions with ordering. +

    + It's is assumed the table contains Oid/string pairs.

    +
    + + Constructor from two vectors + + @param objectIDs an ArrayList of the object identifiers. + @param values an ArrayList of the extension values. + + + constructor from a table of extensions. +

    + it's is assumed the table contains Oid/string pairs.

    +
    + + Constructor from a table of extensions with ordering. +

    + It's is assumed the table contains Oid/string pairs.

    +
    + + Constructor from two vectors + + @param objectIDs an ArrayList of the object identifiers. + @param values an ArrayList of the extension values. + + + return the extension represented by the object identifier + passed in. + + @return the extension if it's present, null otherwise. + + +
    +                 Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
    +            
    +                 Extension         ::=   SEQUENCE {
    +                    extnId            EXTENSION.&id ({ExtensionSet}),
    +                    critical          BOOLEAN DEFAULT FALSE,
    +                    extnValue         OCTET STRING }
    +             
    +
    + + return an Enumeration of the extension field's object ids. + + + Generator for X.509 extensions + + + Reset the generator + + + + Add an extension with the given oid and the passed in value to be included + in the OCTET STRING associated with the extension. + + OID for the extension. + True if critical, false otherwise. + The ASN.1 object to be included in the extension. + + + + Add an extension with the given oid and the passed in byte array to be wrapped + in the OCTET STRING associated with the extension. + + OID for the extension. + True if critical, false otherwise. + The byte array to be wrapped. + + + Generate an X509Extensions object based on the current state of the generator. + An X509Extensions object + + + Return true if there are no extension present in this generator. + True if empty, false otherwise + + +
    +                 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    +            
    +                 RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
    +            
    +                 AttributeTypeAndValue ::= SEQUENCE {
    +                                               type  OBJECT IDENTIFIER,
    +                                               value ANY }
    +             
    +
    + + country code - StringType(SIZE(2)) + + + organization - StringType(SIZE(1..64)) + + + organizational unit name - StringType(SIZE(1..64)) + + + Title + + + common name - StringType(SIZE(1..64)) + + + street - StringType(SIZE(1..64)) + + + device serial number name - StringType(SIZE(1..64)) + + + locality name - StringType(SIZE(1..64)) + + + state, or province name - StringType(SIZE(1..64)) + + + Naming attributes of type X520name + + + businessCategory - DirectoryString(SIZE(1..128) + + + postalCode - DirectoryString(SIZE(1..40) + + + dnQualifier - DirectoryString(SIZE(1..64) + + + RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) + + + RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z + + + RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) + + + RFC 3039 DateOfBirth - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" + + + RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + codes only + + + RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + codes only + + + ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) + + + RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF + DirectoryString(SIZE(1..30)) + + + RFC 2256 dmdName + + + id-at-telephoneNumber + + + id-at-name + + + Email address (RSA PKCS#9 extension) - IA5String. +

    Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.

    +
    + + more from PKCS#9 + + + email address in Verisign certificates + + + LDAP User id. + + + default look up table translating OID values into their common symbols following + the convention in RFC 2253 with a few extras + + + look up table translating OID values into their common symbols following the convention in RFC 2253 + + + look up table translating OID values into their common symbols following the convention in RFC 1779 + + + + look up table translating common symbols into their OIDS. + + + Return a X509Name based on the passed in tagged object. + + @param obj tag object holding name. + @param explicitly true if explicitly tagged false otherwise. + @return the X509Name + + + Constructor from Asn1Sequence + + the principal will be a list of constructed sets, each containing an (OID, string) pair. + + + Constructor from a table of attributes with ordering. +

    + it's is assumed the table contains OID/string pairs, and the contents + of the table are copied into an internal table as part of the + construction process. The ordering ArrayList should contain the OIDs + in the order they are meant to be encoded or printed in ToString.

    +
    + + Constructor from a table of attributes with ordering. +

    + it's is assumed the table contains OID/string pairs, and the contents + of the table are copied into an internal table as part of the + construction process. The ordering ArrayList should contain the OIDs + in the order they are meant to be encoded or printed in ToString.

    +

    + The passed in converter will be used to convert the strings into their + ASN.1 counterparts.

    +
    + + Takes two vectors one of the oids and the other of the values. + + + Takes two vectors one of the oids and the other of the values. +

    + The passed in converter will be used to convert the strings into their + ASN.1 counterparts.

    +
    + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes with each + string value being converted to its associated ASN.1 type using the passed + in converter. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. If reverse + is true, create the encoded version of the sequence starting from the + last element in the string. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes with each + string value being converted to its associated ASN.1 type using the passed + in converter. If reverse is true the ASN.1 sequence representing the DN will + be built by starting at the end of the string, rather than the start. + + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. lookUp + should provide a table of lookups, indexed by lowercase only strings and + yielding a DerObjectIdentifier, other than that OID. and numeric oids + will be processed automatically. +
    + If reverse is true, create the encoded version of the sequence + starting from the last element in the string. + @param reverse true if we should start scanning from the end (RFC 2553). + @param lookUp table of names and their oids. + @param dirName the X.500 string to be parsed. +
    + + Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + some such, converting it into an ordered set of name attributes. lookUp + should provide a table of lookups, indexed by lowercase only strings and + yielding a DerObjectIdentifier, other than that OID. and numeric oids + will be processed automatically. The passed in converter is used to convert the + string values to the right of each equals sign to their ASN.1 counterparts. +
    + @param reverse true if we should start scanning from the end, false otherwise. + @param lookUp table of names and oids. + @param dirName the string dirName + @param converter the converter to convert string values into their ASN.1 equivalents +
    + + return an IList of the oids in the name, in the order they were found. + + + return an IList of the values found in the name, in the order they + were found. + + + return an IList of the values found in the name, in the order they + were found, with the DN label corresponding to passed in oid. + + + The X509Name object to test equivalency against. + If true, the order of elements must be the same, + as well as the values associated with each element. + + + test for equivalence - note: case is ignored. + + + convert the structure to a string - if reverse is true the + oids and values are listed out starting with the last element + in the sequence (ala RFC 2253), otherwise the string will begin + with the first element of the structure. If no string definition + for the oid is found in oidSymbols the string value of the oid is + added. Two standard symbol tables are provided DefaultSymbols, and + RFC2253Symbols as part of this class. + + @param reverse if true start at the end of the sequence and work back. + @param oidSymbols look up table strings for oids. + + + determines whether or not strings should be processed and printed + from back to front. + + + class for breaking up an X500 Name into it's component tokens, ala + java.util.StringTokenizer. We need this class as some of the + lightweight Java environment don't support classes like + StringTokenizer. + + + A general class that reads all X9.62 style EC curve tables. + + + return a X9ECParameters object representing the passed in named + curve. The routine returns null if the curve is not present. + + @param name the name of the curve requested + @return an X9ECParameters object or null if the curve is not available. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return a X9ECParameters object representing the passed in named + curve. + + @param oid the object id of the curve requested + @return an X9ECParameters object or null if the curve is not available. + + + return an enumeration of the names of the available curves. + + @return an enumeration of the names of the available curves. + + + ASN.1 def for Diffie-Hellman key exchange KeySpecificInfo structure. See + RFC 2631, or X9.42, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
    +             KeySpecificInfo ::= Sequence {
    +                 algorithm OBJECT IDENTIFIER,
    +                 counter OCTET STRING SIZE (4..4)
    +             }
    +            
    +
    + + ANS.1 def for Diffie-Hellman key exchange OtherInfo structure. See + RFC 2631, or X9.42, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
    +             OtherInfo ::= Sequence {
    +                 keyInfo KeySpecificInfo,
    +                 partyAInfo [0] OCTET STRING OPTIONAL,
    +                 suppPubInfo [2] OCTET STRING
    +             }
    +            
    +
    + + table of the current named curves defined in X.962 EC-DSA. + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + Produce an object suitable for an Asn1OutputStream. +
    +            Parameters ::= CHOICE {
    +               ecParameters ECParameters,
    +               namedCurve   CURVES.&id({CurveNames}),
    +               implicitlyCA Null
    +            }
    +            
    +
    + + ASN.1 def for Elliptic-Curve Curve structure. See + X9.62, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
    +             Curve ::= Sequence {
    +                 a               FieldElement,
    +                 b               FieldElement,
    +                 seed            BIT STRING      OPTIONAL
    +             }
    +            
    +
    + + ASN.1 def for Elliptic-Curve ECParameters structure. See + X9.62, for further details. + + + Produce an object suitable for an Asn1OutputStream. +
    +             ECParameters ::= Sequence {
    +                 version         Integer { ecpVer1(1) } (ecpVer1),
    +                 fieldID         FieldID {{FieldTypes}},
    +                 curve           X9Curve,
    +                 base            X9ECPoint,
    +                 order           Integer,
    +                 cofactor        Integer OPTIONAL
    +             }
    +            
    +
    + + Return the ASN.1 entry representing the Curve. + + @return the X9Curve for the curve in these parameters. + + + Return the ASN.1 entry representing the FieldID. + + @return the X9FieldID for the FieldID in these parameters. + + + Return the ASN.1 entry representing the base point G. + + @return the X9ECPoint for the base point in these parameters. + + + class for describing an ECPoint as a Der object. + + + Produce an object suitable for an Asn1OutputStream. +
    +             ECPoint ::= OCTET STRING
    +            
    +

    + Octet string produced using ECPoint.GetEncoded().

    +
    + + Class for processing an ECFieldElement as a DER object. + + + Produce an object suitable for an Asn1OutputStream. +
    +             FieldElement ::= OCTET STRING
    +            
    +

    +

      +
    1. if q is an odd prime then the field element is + processed as an Integer and converted to an octet string + according to x 9.62 4.3.1.
    2. +
    3. if q is 2m then the bit string + contained in the field element is converted into an octet + string with the same ordering padded at the front if necessary. +
    4. +
    +

    +
    + + ASN.1 def for Elliptic-Curve Field ID structure. See + X9.62, for further details. + + + Constructor for elliptic curves over prime fields + F2. + @param primeP The prime p defining the prime field. + + + Constructor for elliptic curves over binary fields + F2m. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk1 + 1 + represents the reduction polynomial f(z). + + + Constructor for elliptic curves over binary fields + F2m. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).. + + + Produce a Der encoding of the following structure. +
    +             FieldID ::= Sequence {
    +                 fieldType       FIELD-ID.&id({IOSet}),
    +                 parameters      FIELD-ID.&Type({IOSet}{@fieldType})
    +             }
    +            
    +
    + + id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) + us(840) x9-57 (10040) x9cm(4) 3 } + + + X9.63 + + + X9.42 + + + reader for Base64 armored objects - read the headers and then start returning + bytes when the data is reached. An IOException is thrown if the CRC check + fails. + + + decode the base 64 encoded input data. + + @return the offset the data starts in out. + + + Create a stream for reading a PGP armoured message, parsing up to a header + and then reading the data that follows. + + @param input + + + Create an armoured input stream which will assume the data starts + straight away, or parse for headers first depending on the value of + hasHeaders. + + @param input + @param hasHeaders true if headers are to be looked for, false otherwise. + + + @return true if we are inside the clear text section of a PGP + signed message. + + + @return true if the stream is actually at end of file. + + + Return the armor header line (if there is one) + @return the armor header line, null if none present. + + + Return the armor headers (the lines after the armor header line), + @return an array of armor headers, null if there aren't any. + + + Basic output stream. + + + encode the input data producing a base 64 encoded byte array. + + + Set an additional header entry. + + @param name the name of the header entry. + @param v the value of the header entry. + + + Reset the headers to only contain a Version string. + + + Start a clear text signed message. + @param hashAlgorithm + + + Note: Close() does not close the underlying stream. So it is possible to write + multiple objects using armoring to a single stream. + + + Basic type for a image attribute packet. + + + Basic type for a user attribute sub-packet. + + + return the generic data making up the packet. + + + Reader for PGP objects. + + + Returns the next packet tag in the stream. + + + + A stream that overlays our input stream, allowing the user to only read a segment of it. + NB: dataLength will be negative if the segment length is in the upper range above 2**31. + + + + Base class for a PGP object. + + + Basic output stream. + + + Create a stream representing a general packet. + Output stream to write to. + + + Create a stream representing an old style partial object. + Output stream to write to. + The packet tag for the object. + + + Create a stream representing a general packet. + Output stream to write to. + Packet tag. + Size of chunks making up the packet. + If true, the header is written out in old format. + + + Create a new style partial input stream buffered into chunks. + Output stream to write to. + Packet tag. + Size of chunks making up the packet. + + + Create a new style partial input stream buffered into chunks. + Output stream to write to. + Packet tag. + Buffer to use for collecting chunks. + + + Flush the underlying stream. + + + Finish writing out the current packet without closing the underlying stream. + + + Generic compressed data object. + + + Note: you can only read from this once... + + + The algorithm tag value. + + + Basic tags for compression algorithms. + + + Basic type for a PGP packet. + + + Base class for a DSA public key. + + + Base interface for a PGP key. + + + + The base format for this key - in the case of the symmetric keys it will generally + be raw indicating that the key is just a straight byte representation, for an asymmetric + key the format will be PGP, indicating the key is a string of MPIs encoded in PGP format. + + "RAW" or "PGP". + + + The stream to read the packet from. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for a DSA secret key. + + + @param in + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + @return x + + + Base class for an ECDH Public Key. + + + Base class for an EC Public Key. + + + The stream to read the packet from. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + The stream to read the packet from. + + + Base class for an ECDSA Public Key. + + + The stream to read the packet from. + + + Base class for an EC Secret Key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an ElGamal public key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an ElGamal secret key. + + + @param in + + + @param x + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Basic packet for an experimental packet. + + + Basic tags for hash algorithms. + + + Generic literal data packet. + + + The format tag value. + + + The modification time of the file in milli-seconds (since Jan 1, 1970 UTC) + + + Basic type for a marker packet. + + + Basic packet for a modification detection code packet. + + + A multiple precision integer + + + Generic signature object + + + The encryption algorithm tag. + + + The hash algorithm tag. + + + Basic PGP packet tag types. + + + Public Key Algorithm tag numbers. + + + Basic packet for a PGP public key. + + + Basic packet for a PGP public key. + + + Construct a version 4 public key packet. + + + Basic packet for a PGP public subkey + + + Construct a version 4 public subkey packet. + + + Base class for an RSA public key. + + + Construct an RSA public key from the passed in stream. + + + The modulus. + The public exponent. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + Base class for an RSA secret (or priate) key. + + + Return the standard PGP encoding of the key. + + + The format, as a string, always "PGP". + + + The string to key specifier class. + + + The IV for the key generation algorithm. + + + The hash algorithm. + + + The iteration count + + + The protection mode - only if GnuDummyS2K + + + Basic packet for a PGP secret key. + + + Basic packet for a PGP secret key. + + + Generic signature packet. + + + Generate a version 4 signature packet. + + @param signatureType + @param keyAlgorithm + @param hashAlgorithm + @param hashedData + @param unhashedData + @param fingerprint + @param signature + + + Generate a version 2/3 signature packet. + + @param signatureType + @param keyAlgorithm + @param hashAlgorithm + @param fingerprint + @param signature + + + return the signature trailer that must be included with the data + to reconstruct the signature + + @return byte[] + + + * return the signature as a set of integers - note this is normalised to be the + * ASN.1 encoding of what appears in the signature packet. + + + Return the byte encoding of the signature section. + @return uninterpreted signature bytes. + + + return the keyId + @return the keyId that created the signature. + + + Return the creation time in milliseconds since 1 Jan., 1970 UTC. + + + Basic type for a PGP Signature sub-packet. + + + Return the generic data making up the packet. + + + reader for signature sub-packets + + + Basic PGP signature sub-packet tag types. + + + Packet embedded signature + + + packet giving signature creation time. + + + packet giving signature expiration time. + + + Identifier for the modification detection feature + + + Returns if a particular feature is supported. + + + Sets support for a particular feature. + + + Returns if modification detection is supported. + + + packet giving signature creation time. + + + packet giving time after creation at which the key expires. + + + Return the number of seconds after creation time a key is valid for. + + @return second count for key validity. + + + Packet holding the key flag values. + + + + Return the flag values contained in the first 4 octets (note: at the moment + the standard only uses the first one). + + + + Class provided a NotationData object according to + RFC2440, Chapter 5.2.3.15. Notation Data + + + packet giving signature creation time. + + + packet giving whether or not the signature is signed using the primary user ID for the key. + + + packet giving whether or not is revocable. + + + + Represents revocation key OpenPGP signature sub packet. + + + + + Represents revocation reason OpenPGP signature sub packet. + + + + packet giving signature creation time. + + + packet giving signature expiration time. + + + return time in seconds before signature expires after creation time. + + + packet giving the User ID of the signer. + + + packet giving trust. + + + Basic type for a symmetric key encrypted packet. + + + Basic tags for symmetric key algorithms + + + Basic type for a symmetric encrypted session key packet + + + @return byte[] + + + @return int + + + @return S2k + + + @return int + + + Basic type for a trust packet. + + + Basic type for a user attribute packet. + + + reader for user attribute sub-packets + + + Basic PGP user attribute sub-packet tag types. + + + Basic type for a user ID packet. + + + Base class for both the compress and decompress classes. + Holds common arrays, and static data. + + @author Keiron Liddle + + + An input stream that decompresses from the BZip2 format (with the file + header chars) to be read as any other stream. + + @author Keiron Liddle + + NB: note this class has been modified to read the leading BZ from the + start of the BZIP2 stream to make it compatible with other PGP programs. + + + An output stream that compresses into the BZip2 format (with the file + header chars) into another stream. + + @author Keiron Liddle + + TODO: Update to BZip2 1.0.1 + NB: note this class has been modified to add a leading BZ to the + start of the BZIP2 stream to make it compatible with other PGP programs. + + + + modified by Oliver Merkel, 010128 + + + + A simple class the hold and calculate the CRC for sanity checking + of the data. + + @author Keiron Liddle + + + + The 'Signature' parameter is only available when generating unsigned attributes. + + + + containing class for an CMS Authenticated Data object + + + return a store of the intended recipients for this message + + + return a table of the digested attributes indexed by + the OID of the attribute. + + + return a table of the undigested attributes indexed by + the OID of the attribute. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier for the content MAC algorithm. + + + return the ContentInfo + + + General class for generating a CMS authenticated-data message. + + A simple example of usage. + +
    +                  CMSAuthenticatedDataGenerator  fact = new CMSAuthenticatedDataGenerator();
    +            
    +                  fact.addKeyTransRecipient(cert);
    +            
    +                  CMSAuthenticatedData         data = fact.generate(content, algorithm, "BC");
    +             
    +
    + + General class for generating a CMS enveloped-data message. + + A simple example of usage. + +
    +                  CMSEnvelopedDataGenerator  fact = new CMSEnvelopedDataGenerator();
    +            
    +                  fact.addKeyTransRecipient(cert);
    +            
    +                  CMSEnvelopedData         data = fact.generate(content, algorithm, "BC");
    +             
    +
    + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + add a recipient. + + @param cert recipient's public key certificate + @exception ArgumentException if there is a problem with the certificate + + + add a recipient + + @param key the public key used by the recipient + @param subKeyId the identifier for the recipient's public key + @exception ArgumentException if there is a problem with the key + + + add a KEK recipient. + @param key the secret key to use for wrapping + @param keyIdentifier the byte string that identifies the key + + + add a KEK recipient. + @param key the secret key to use for wrapping + @param keyIdentifier the byte string that identifies the key + + + Add a key agreement based recipient. + + @param agreementAlgorithm key agreement algorithm to use. + @param senderPrivateKey private key to initialise sender side of agreement with. + @param senderPublicKey sender public key to include with message. + @param recipientCert recipient's public key certificate. + @param cekWrapAlgorithm OID for key wrapping algorithm to use. + @exception SecurityUtilityException if the algorithm requested cannot be found + @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + + + Add multiple key agreement based recipients (sharing a single KeyAgreeRecipientInfo structure). + + @param agreementAlgorithm key agreement algorithm to use. + @param senderPrivateKey private key to initialise sender side of agreement with. + @param senderPublicKey sender public key to include with message. + @param recipientCerts recipients' public key certificates. + @param cekWrapAlgorithm OID for key wrapping algorithm to use. + @exception SecurityUtilityException if the algorithm requested cannot be found + @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + + + base constructor + + + constructor allowing specific source of randomness + + @param rand instance of SecureRandom to use + + + base constructor + + + constructor allowing specific source of randomness + @param rand instance of SecureRandom to use + + + generate an enveloped object that contains an CMS Enveloped Data + object using the given provider and the passed in key generator. + + + generate an authenticated object that contains an CMS Authenticated Data object + + + Parsing class for an CMS Authenticated Data object from an input stream. +

    + Note: that because we are in a streaming mode only one recipient can be tried and it is important + that the methods on the parser are called in the appropriate order. +

    +

    + Example of use - assuming the first recipient matches the private key we have. +

    +                  CMSAuthenticatedDataParser     ad = new CMSAuthenticatedDataParser(inputStream);
    +            
    +                  RecipientInformationStore  recipients = ad.getRecipientInfos();
    +            
    +                  Collection  c = recipients.getRecipients();
    +                  Iterator    it = c.iterator();
    +            
    +                  if (it.hasNext())
    +                  {
    +                      RecipientInformation   recipient = (RecipientInformation)it.next();
    +            
    +                      CMSTypedStream recData = recipient.getContentStream(privateKey, "BC");
    +            
    +                      processDataStream(recData.getContentStream());
    +            
    +                      if (!Arrays.equals(ad.getMac(), recipient.getMac())
    +                      {
    +                          System.err.println("Data corrupted!!!!");
    +                      }
    +                  }
    +              
    + Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
    +                      CMSAuthenticatedDataParser     ep = new CMSAuthenticatedDataParser(new BufferedInputStream(inputStream, bufSize));
    +              
    + where bufSize is a suitably large buffer size. +

    +
    + + Close the underlying data stream. + @throws IOException if the close fails. + + + return a store of the intended recipients for this message + + + return a table of the unauthenticated attributes indexed by + the OID of the attribute. + @exception java.io.IOException + + + return a table of the unauthenticated attributes indexed by + the OID of the attribute. + @exception java.io.IOException + + + return the object identifier for the mac algorithm. + + + return the ASN.1 encoded encryption algorithm parameters, or null if + there aren't any. + + + General class for generating a CMS authenticated-data message stream. +

    + A simple example of usage. +

    +                  CMSAuthenticatedDataStreamGenerator edGen = new CMSAuthenticatedDataStreamGenerator();
    +            
    +                  edGen.addKeyTransRecipient(cert);
    +            
    +                  ByteArrayOutputStream  bOut = new ByteArrayOutputStream();
    +            
    +                  OutputStream out = edGen.open(
    +                                          bOut, CMSAuthenticatedDataGenerator.AES128_CBC, "BC");*
    +                  out.write(data);
    +            
    +                  out.close();
    +             
    +

    +
    + + base constructor + + + constructor allowing specific source of randomness + @param rand instance of SecureRandom to use + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + Use a BER Set to store the recipient information + + + generate an enveloped object that contains an CMS Enveloped Data + object using the given provider and the passed in key generator. + @throws java.io.IOException + + + generate an enveloped object that contains an CMS Enveloped Data object + + + generate an enveloped object that contains an CMS Enveloped Data object + + + containing class for an CMS AuthEnveloped Data object + + + containing class for an CMS Compressed Data object + + + Return the uncompressed content. + + @return the uncompressed content + @throws CmsException if there is an exception uncompressing the data. + + + Return the uncompressed content, throwing an exception if the data size + is greater than the passed in limit. If the content is exceeded getCause() + on the CMSException will contain a StreamOverflowException + + @param limit maximum number of bytes to read + @return the content read + @throws CMSException if there is an exception uncompressing the data. + + + return the ASN.1 encoded representation of this object. + + + return the ContentInfo + + + * General class for generating a compressed CMS message. + *

    + * A simple example of usage.

    + *

    + *

    +                *      CMSCompressedDataGenerator fact = new CMSCompressedDataGenerator();
    +                *      CMSCompressedData data = fact.Generate(content, algorithm);
    +                * 
    + *

    +
    + + Generate an object that contains an CMS Compressed Data + + + Class for reading a CMS Compressed Data stream. +
    +                 CMSCompressedDataParser cp = new CMSCompressedDataParser(inputStream);
    +            
    +                 process(cp.GetContent().GetContentStream());
    +             
    + Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
    +                  CMSCompressedDataParser     ep = new CMSCompressedDataParser(new BufferedInputStream(inputStream, bufSize));
    +              
    + where bufSize is a suitably large buffer size. +
    + + General class for generating a compressed CMS message stream. +

    + A simple example of usage. +

    +
    +                  CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator();
    +            
    +                  Stream cOut = gen.Open(outputStream, CMSCompressedDataStreamGenerator.ZLIB);
    +            
    +                  cOut.Write(data);
    +            
    +                  cOut.Close();
    +             
    +
    + + base constructor + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + containing class for an CMS Enveloped Data object + + + return a store of the intended recipients for this message + + + return a table of the unprotected attributes indexed by + the OID of the attribute. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier for the content encryption algorithm. + + + return the ContentInfo + + + + General class for generating a CMS enveloped-data message. + + A simple example of usage. + +
    +                  CmsEnvelopedDataGenerator  fact = new CmsEnvelopedDataGenerator();
    +            
    +                  fact.AddKeyTransRecipient(cert);
    +            
    +                  CmsEnvelopedData         data = fact.Generate(content, algorithm);
    +             
    +
    +
    + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + + Generate an enveloped object that contains a CMS Enveloped Data + object using the passed in key generator. + + + + Generate an enveloped object that contains an CMS Enveloped Data object. + + + Generate an enveloped object that contains an CMS Enveloped Data object. + + + Parsing class for an CMS Enveloped Data object from an input stream. +

    + Note: that because we are in a streaming mode only one recipient can be tried and it is important + that the methods on the parser are called in the appropriate order. +

    +

    + Example of use - assuming the first recipient matches the private key we have. +

    +                  CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(inputStream);
    +            
    +                  RecipientInformationStore  recipients = ep.GetRecipientInfos();
    +            
    +                  Collection  c = recipients.getRecipients();
    +                  Iterator    it = c.iterator();
    +            
    +                  if (it.hasNext())
    +                  {
    +                      RecipientInformation   recipient = (RecipientInformation)it.next();
    +            
    +                      CMSTypedStream recData = recipient.getContentStream(privateKey);
    +            
    +                      processDataStream(recData.getContentStream());
    +                  }
    +              
    + Note: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
    +                      CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(new BufferedInputStream(inputStream, bufSize));
    +              
    + where bufSize is a suitably large buffer size. +

    +
    + + return a store of the intended recipients for this message + + + return a table of the unprotected attributes indexed by + the OID of the attribute. + @throws IOException + + + return the object identifier for the content encryption algorithm. + + + return the ASN.1 encoded encryption algorithm parameters, or null if + there aren't any. + + + General class for generating a CMS enveloped-data message stream. +

    + A simple example of usage. +

    +                  CmsEnvelopedDataStreamGenerator edGen = new CmsEnvelopedDataStreamGenerator();
    +            
    +                  edGen.AddKeyTransRecipient(cert);
    +            
    +                  MemoryStream  bOut = new MemoryStream();
    +            
    +                  Stream out = edGen.Open(
    +                                          bOut, CMSEnvelopedDataGenerator.AES128_CBC);*
    +                  out.Write(data);
    +            
    +                  out.Close();
    +             
    +

    +
    + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Set the underlying string size for encapsulated data. + Length of octet strings to buffer the data. + + + Use a BER Set to store the recipient information. + + + + Generate an enveloped object that contains an CMS Enveloped Data + object using the passed in key generator. + + + + generate an enveloped object that contains an CMS Enveloped Data object + @throws IOException + + + generate an enveloped object that contains an CMS Enveloped Data object + @throws IOException + + + all parameter classes implement this. + + + + Generic routine to copy out the data we want processed. + + + This routine may be called multiple times. + + + + a holding class for a byte array of data to be processed. + + + A clone of the byte array + + + a holding class for a file of data to be processed. + + + The file handle + + + general class for handling a pkcs7-signature message. + + A simple example of usage - note, in the example below the validity of + the certificate isn't verified, just the fact that one of the certs + matches the given signer... + +
    +              IX509Store              certs = s.GetCertificates();
    +              SignerInformationStore  signers = s.GetSignerInfos();
    +            
    +              foreach (SignerInformation signer in signers.GetSigners())
    +              {
    +                  ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
    +                  X509Certificate cert = (X509Certificate) certList[0];
    +            
    +                  if (signer.Verify(cert.GetPublicKey()))
    +                  {
    +                      verified++;
    +                  }
    +              }
    +             
    +
    + + Content with detached signature, digests precomputed + + @param hashes a map of precomputed digests for content indexed by name of hash. + @param sigBlock the signature object. + + + base constructor - content with detached signature. + + @param signedContent the content that was signed. + @param sigData the signature object. + + + base constructor - with encapsulated content + + + return the collection of signers that are associated with the + signatures for the message. + + + return a X509Store containing the attribute certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of attribute certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing the public key certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of public key certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing CRLs, if any, contained + in this message. + + @param type type of store to create + @return a store of CRLs + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return the ASN.1 encoded representation of this object. + + + Replace the signerinformation store associated with this + CmsSignedData object with the new one passed in. You would + probably only want to do this if you wanted to change the unsigned + attributes associated with a signer, or perhaps delete one. + + @param signedData the signed data object to be used as a base. + @param signerInformationStore the new signer information store to use. + @return a new signed data object. + + + Replace the certificate and CRL information associated with this + CmsSignedData object with the new one passed in. + + @param signedData the signed data object to be used as a base. + @param x509Certs the new certificates to be used. + @param x509Crls the new CRLs to be used. + @return a new signed data object. + @exception CmsException if there is an error processing the stores + + + Return the version number for this object. + + + + Return the DerObjectIdentifier associated with the encapsulated + content info structure carried in the signed data. + + + + return the ContentInfo + + + * general class for generating a pkcs7-signature message. + *

    + * A simple example of usage. + * + *

    +                 *      IX509Store certs...
    +                 *      IX509Store crls...
    +                 *      CmsSignedDataGenerator gen = new CmsSignedDataGenerator();
    +                 *
    +                 *      gen.AddSigner(privKey, cert, CmsSignedGenerator.DigestSha1);
    +                 *      gen.AddCertificates(certs);
    +                 *      gen.AddCrls(crls);
    +                 *
    +                 *      CmsSignedData data = gen.Generate(content);
    +                 * 
    + *

    +
    + + Default type for the signed data. + + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Add the attribute certificates contained in the passed in store to the + generator. + + @param store a store of Version 2 attribute certificates + @throws CmsException if an error occurse processing the store. + + + Add a store of precalculated signers to the generator. + + @param signerStore store of signers + + + Return a map of oids and byte arrays representing the digests calculated on the content during + the last generate. + + @return a map of oids (as String objects) and byte[] representing digests. + + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + * add a signer - no attributes other than the default ones will be + * provided here. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + + + add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + provided here. + + @param key signing key to use + @param cert certificate containing corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + + + add a signer - no attributes other than the default ones will be + provided here. + + + add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + provided here. + + + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + + @param key signing key to use + @param cert certificate containing corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + @param signedAttr table of attributes to be included in signature + @param unsignedAttr table of attributes to be included as unsigned + + + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param subjectKeyID subjectKeyID of corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + + @param key signing key to use + @param subjectKeyID subjectKeyID of corresponding public key + @param encryptionOID digest encryption algorithm OID + @param digestOID digest algorithm OID + @param signedAttr table of attributes to be included in signature + @param unsignedAttr table of attributes to be included as unsigned + + + add a signer with extra signed/unsigned attributes based on generators. + + + add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes based on generators. + + + add a signer with extra signed/unsigned attributes based on generators. + + + add a signer, including digest encryption algorithm, with extra signed/unsigned attributes based on generators. + + + generate a signed object that for a CMS Signed Data object + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". + + + generate a set of one or more SignerInformation objects representing counter signatures on + the passed in SignerInformation object. + + @param signer the signer to be countersigned + @param sigProvider the provider to be used for counter signing. + @return a store containing the signers. + + + Parsing class for an CMS Signed Data object from an input stream. +

    + Note: that because we are in a streaming mode only one signer can be tried and it is important + that the methods on the parser are called in the appropriate order. +

    +

    + A simple example of usage for an encapsulated signature. +

    +

    + Two notes: first, in the example below the validity of + the certificate isn't verified, just the fact that one of the certs + matches the given signer, and, second, because we are in a streaming + mode the order of the operations is important. +

    +
    +                  CmsSignedDataParser     sp = new CmsSignedDataParser(encapSigData);
    +            
    +                  sp.GetSignedContent().Drain();
    +            
    +                  IX509Store              certs = sp.GetCertificates();
    +                  SignerInformationStore  signers = sp.GetSignerInfos();
    +            
    +                  foreach (SignerInformation signer in signers.GetSigners())
    +                  {
    +                      ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
    +                      X509Certificate cert = (X509Certificate) certList[0];
    +            
    +                      Console.WriteLine("verify returns: " + signer.Verify(cert));
    +                  }
    +             
    + Note also: this class does not introduce buffering - if you are processing large files you should create + the parser with: +
    +                      CmsSignedDataParser     ep = new CmsSignedDataParser(new BufferedInputStream(encapSigData, bufSize));
    +              
    + where bufSize is a suitably large buffer size. +
    + + base constructor - with encapsulated content + + + base constructor + + @param signedContent the content that was signed. + @param sigData the signature object. + + + return the collection of signers that are associated with the + signatures for the message. + @throws CmsException + + + return a X509Store containing the attribute certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of attribute certificates + @exception org.bouncycastle.x509.NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing the public key certificates, if any, contained + in this message. + + @param type type of store to create + @return a store of public key certificates + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + return a X509Store containing CRLs, if any, contained + in this message. + + @param type type of store to create + @return a store of CRLs + @exception NoSuchStoreException if the store type isn't available. + @exception CmsException if a general exception prevents creation of the X509Store + + + Replace the signerinformation store associated with the passed + in message contained in the stream original with the new one passed in. + You would probably only want to do this if you wanted to change the unsigned + attributes associated with a signer, or perhaps delete one. +

    + The output stream is returned unclosed. +

    + @param original the signed data stream to be used as a base. + @param signerInformationStore the new signer information store to use. + @param out the stream to Write the new signed data object to. + @return out. +
    + + Replace the certificate and CRL information associated with this + CMSSignedData object with the new one passed in. +

    + The output stream is returned unclosed. +

    + @param original the signed data stream to be used as a base. + @param certsAndCrls the new certificates and CRLs to be used. + @param out the stream to Write the new signed data object to. + @return out. + @exception CmsException if there is an error processing the CertStore +
    + + Return the version number for the SignedData object + + @return the version number + + + + Return the DerObjectIdentifier associated with the encapsulated + content info structure carried in the signed data. + + + + General class for generating a pkcs7-signature message stream. +

    + A simple example of usage. +

    +
    +                  IX509Store                   certs...
    +                  CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator();
    +            
    +                  gen.AddSigner(privateKey, cert, CmsSignedDataStreamGenerator.DIGEST_SHA1);
    +            
    +                  gen.AddCertificates(certs);
    +            
    +                  Stream sigOut = gen.Open(bOut);
    +            
    +                  sigOut.Write(Encoding.UTF8.GetBytes("Hello World!"));
    +            
    +                  sigOut.Close();
    +             
    +
    + + Constructor allowing specific source of randomness + Instance of SecureRandom to use. + + + Set the underlying string size for encapsulated data + + @param bufferSize length of octet strings to buffer the data. + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer, specifying the digest encryption algorithm - no attributes other than the default ones will be + provided here. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes - specifying digest + encryption algorithm. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer - no attributes other than the default ones will be + provided here. + @throws NoSuchProviderException + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + add a signer with extra signed/unsigned attributes. + @throws NoSuchAlgorithmException + @throws InvalidKeyException + + + generate a signed object that for a CMS Signed Data object + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". + + + generate a signed object that for a CMS Signed Data + object using the given provider - if encapsulate is true a copy + of the message will be included in the signature with the + default content type "data". If dataOutputStream is non null the data + being signed will be written to the stream as it is processed. + @param out stream the CMS object is to be written to. + @param encapsulate true if data should be encapsulated. + @param dataOutputStream output stream to copy the data being signed to. + + + generate a signed object that for a CMS Signed Data + object - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + + + generate a signed object that for a CMS Signed Data + object using the given provider - if encapsulate is true a copy + of the message will be included in the signature. The content type + is set according to the OID represented by the string signedContentType. + @param out stream the CMS object is to be written to. + @param signedContentType OID for data to be signed. + @param encapsulate true if data should be encapsulated. + @param dataOutputStream output stream to copy the data being signed to. + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + Return the digest encryption algorithm using one of the standard + JCA string representations rather than the algorithm identifier (if + possible). + + + Default authenticated attributes generator. + + + Initialise to use all defaults + + + Initialise with some extra attributes or overrides. + + @param attributeTable initial attribute table to use. + + + Create a standard attribute table from the passed in parameters - this will + normally include contentType and messageDigest. If the constructor + using an AttributeTable was used, entries in it for contentType and + messageDigest will override the generated ones. + + @param parameters source parameters for table generation. + + @return a filled in IDictionary of attributes. + + + @param parameters source parameters + @return the populated attribute table + + + Default signed attributes generator. + + + Initialise to use all defaults + + + Initialise with some extra attributes or overrides. + + @param attributeTable initial attribute table to use. + + + Create a standard attribute table from the passed in parameters - this will + normally include contentType, signingTime, and messageDigest. If the constructor + using an AttributeTable was used, entries in it for contentType, signingTime, and + messageDigest will override the generated ones. + + @param parameters source parameters for table generation. + + @return a filled in Hashtable of attributes. + + + @param parameters source parameters + @return the populated attribute table + + + + Generate a RecipientInfo object for the given key. + + + A + + + A + + + A + + + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using a secret key known to the other side. + + + Return the MAC calculated for the content stream. Note: this call is only meaningful once all + the content has been read. + + @return byte array containing the mac. + + + * return the object identifier for the key encryption algorithm. + * + * @return OID for key encryption algorithm. + + + * return the ASN.1 encoded key encryption algorithm parameters, or null if + * there aren't any. + * + * @return ASN.1 encoding of key encryption algorithm parameters. + + + decrypt the content and return an input stream. + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using key agreement. + + + decrypt the content and return an input stream. + + + the KeyTransRecipientInformation class for a recipient who has been sent a secret + key encrypted using their public key that needs to be used to + extract the message. + + + decrypt the content and return it as a byte array. + + + a basic index for an originator. + + + + An ISet of DerObjectIdentifier objects. + + + + Return the certificates stored in the underlying OriginatorInfo object. + + @return a Store of X509CertificateHolder objects. + + + Return the CRLs stored in the underlying OriginatorInfo object. + + @return a Store of X509CRLHolder objects. + + + Return the underlying ASN.1 object defining this SignerInformation object. + + @return a OriginatorInfo. + + + the RecipientInfo class for a recipient who has been sent a message + encrypted using a password. + + + decrypt the content and return an input stream. + + + return the object identifier for the key derivation algorithm, or null + if there is none present. + + @return OID for key derivation algorithm, if present. + + + + PKCS5 scheme-2 - password converted to bytes assuming ASCII. + + + + PKCS5 scheme-2 - password converted to bytes using UTF-8. + + + Return the first RecipientInformation object that matches the + passed in selector. Null if there are no matches. + + @param selector to identify a recipient + @return a single RecipientInformation object. Null if none matches. + + + Return all recipients in the collection + + @return a collection of recipients. + + + Return possible empty collection with recipients matching the passed in RecipientID + + @param selector a recipient id to select against. + @return a collection of RecipientInformation objects. + + + Return the number of recipients in the collection. + + @return number of recipients identified. + + + a basic index for a signer. + + + If the passed in flag is true, the signer signature will be based on the data, not + a collection of signed attributes, and no signed attributes will be included. + + @return the builder object + + + Provide a custom signed attribute generator. + + @param signedGen a generator of signed attributes. + @return the builder object + + + Provide a generator of unsigned attributes. + + @param unsignedGen a generator for signed attributes. + @return the builder object + + + Build a generator with the passed in certHolder issuer and serial number as the signerIdentifier. + + @param contentSigner operator for generating the final signature in the SignerInfo with. + @param certHolder carrier for the X.509 certificate related to the contentSigner. + @return a SignerInfoGenerator + @throws OperatorCreationException if the generator cannot be built. + + + Build a generator with the passed in subjectKeyIdentifier as the signerIdentifier. If used you should + try to follow the calculation described in RFC 5280 section 4.2.1.2. + + @param signerFactory operator factory for generating the final signature in the SignerInfo with. + @param subjectKeyIdentifier key identifier to identify the public key for verifying the signature. + @return a SignerInfoGenerator + + + an expanded SignerInfo block from a CMS Signed message + + + return the content digest that was calculated during verification. + + + return the encoded signature + + + Return a SignerInformationStore containing the counter signatures attached to this + signer. If no counter signatures are present an empty store is returned. + + + return the DER encoding of the signed attributes. + @throws IOException if an encoding error occurs. + + + verify that the given public key successfully handles and confirms the + signature associated with this signer. + + + verify that the given certificate successfully handles and confirms + the signature associated with this signer and, if a signingTime + attribute is available, that the certificate was valid at the time the + signature was generated. + + + Return the base ASN.1 CMS structure that this object contains. + + @return an object containing a CMS SignerInfo structure. + + + Return a signer information object with the passed in unsigned + attributes replacing the ones that are current associated with + the object passed in. + + @param signerInformation the signerInfo to be used as the basis. + @param unsignedAttributes the unsigned attributes to add. + @return a copy of the original SignerInformationObject with the changed attributes. + + + Return a signer information object with passed in SignerInformationStore representing counter + signatures attached as an unsigned attribute. + + @param signerInformation the signerInfo to be used as the basis. + @param counterSigners signer info objects carrying counter signature. + @return a copy of the original SignerInformationObject with the changed attributes. + + + return the version number for this objects underlying SignerInfo structure. + + + return the object identifier for the signature. + + + return the signature parameters, or null if there aren't any. + + + return the object identifier for the signature. + + + return the signature/encryption algorithm parameters, or null if + there aren't any. + + + return a table of the signed attributes - indexed by + the OID of the attribute. + + + return a table of the unsigned attributes indexed by + the OID of the attribute. + + + Create a store containing a single SignerInformation object. + + @param signerInfo the signer information to contain. + + + Create a store containing a collection of SignerInformation objects. + + @param signerInfos a collection signer information objects to contain. + + + Return the first SignerInformation object that matches the + passed in selector. Null if there are no matches. + + @param selector to identify a signer + @return a single SignerInformation object. Null if none matches. + + + An ICollection of all signers in the collection + + + Return possible empty collection with signers matching the passed in SignerID + + @param selector a signer id to select against. + @return a collection of SignerInformation objects. + + + The number of signers in the collection. + + + Basic generator that just returns a preconstructed attribute table + + + a Diffie-Hellman key exchange engine. +

    + note: This uses MTI/A0 key agreement in order to make the key agreement + secure against passive attacks. If you're doing Diffie-Hellman and both + parties have long term public keys you should look at using this. For + further information have a look at RFC 2631.

    +

    + It's possible to extend this to more than two parties as well, for the moment + that is left as an exercise for the reader.

    +
    + + calculate our initial message. + + + given a message from a given party and the corresponding public key + calculate the next message in the agreement sequence. In this case + this will represent the shared secret. + + + a Diffie-Hellman key agreement class. +

    + note: This is only the basic algorithm, it doesn't take advantage of + long term public keys if they are available. See the DHAgreement class + for a "better" implementation.

    +
    + + The basic interface that basic Diffie-Hellman implementations + conforms to. + + + initialise the agreement engine. + + + return the field size for the agreement algorithm in bytes. + + + given a public key from a given party calculate the next + message in the agreement sequence. + + + given a short term public key from a given party calculate the next + message in the agreement sequence. + + + Standard Diffie-Hellman groups from various IETF specifications. + + + P1363 7.2.1 ECSVDP-DH + + ECSVDP-DH is Elliptic Curve Secret Value Derivation Primitive, + Diffie-Hellman version. It is based on the work of [DH76], [Mil86], + and [Kob87]. This primitive derives a shared secret value from one + party's private key and another party's public key, where both have + the same set of EC domain parameters. If two parties correctly + execute this primitive, they will produce the same output. This + primitive can be invoked by a scheme to derive a shared secret key; + specifically, it may be used with the schemes ECKAS-DH1 and + DL/ECKAS-DH2. It assumes that the input keys are valid (see also + Section 7.2.2). + + + P1363 7.2.2 ECSVDP-DHC + + ECSVDP-DHC is Elliptic Curve Secret Value Derivation Primitive, + Diffie-Hellman version with cofactor multiplication. It is based on + the work of [DH76], [Mil86], [Kob87], [LMQ98] and [Kal98a]. This + primitive derives a shared secret value from one party's private key + and another party's public key, where both have the same set of EC + domain parameters. If two parties correctly execute this primitive, + they will produce the same output. This primitive can be invoked by a + scheme to derive a shared secret key; specifically, it may be used + with the schemes ECKAS-DH1 and DL/ECKAS-DH2. It does not assume the + validity of the input public key (see also Section 7.2.1). +

    + Note: As stated P1363 compatibility mode with ECDH can be preset, and + in this case the implementation doesn't have a ECDH compatibility mode + (if you want that just use ECDHBasicAgreement and note they both implement + BasicAgreement!).

    +
    + + + A participant in a Password Authenticated Key Exchange by Juggling (J-PAKE) exchange. + + The J-PAKE exchange is defined by Feng Hao and Peter Ryan in the paper + + "Password Authenticated Key Exchange by Juggling, 2008." + + The J-PAKE protocol is symmetric. + There is no notion of a client or server, but rather just two participants. + An instance of JPakeParticipant represents one participant, and + is the primary interface for executing the exchange. + + To execute an exchange, construct a JPakeParticipant on each end, + and call the following 7 methods + (once and only once, in the given order, for each participant, sending messages between them as described): + + CreateRound1PayloadToSend() - and send the payload to the other participant + ValidateRound1PayloadReceived(JPakeRound1Payload) - use the payload received from the other participant + CreateRound2PayloadToSend() - and send the payload to the other participant + ValidateRound2PayloadReceived(JPakeRound2Payload) - use the payload received from the other participant + CalculateKeyingMaterial() + CreateRound3PayloadToSend(BigInteger) - and send the payload to the other participant + ValidateRound3PayloadReceived(JPakeRound3Payload, BigInteger) - use the payload received from the other participant + + Each side should derive a session key from the keying material returned by CalculateKeyingMaterial(). + The caller is responsible for deriving the session key using a secure key derivation function (KDF). + + Round 3 is an optional key confirmation process. + If you do not execute round 3, then there is no assurance that both participants are using the same key. + (i.e. if the participants used different passwords, then their session keys will differ.) + + If the round 3 validation succeeds, then the keys are guaranteed to be the same on both sides. + + The symmetric design can easily support the asymmetric cases when one party initiates the communication. + e.g. Sometimes the round1 payload and round2 payload may be sent in one pass. + Also, in some cases, the key confirmation payload can be sent together with the round2 payload. + These are the trivial techniques to optimize the communication. + + The key confirmation process is implemented as specified in + NIST SP 800-56A Revision 1, + Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + + This class is stateful and NOT threadsafe. + Each instance should only be used for ONE complete J-PAKE exchange + (i.e. a new JPakeParticipant should be constructed for each new J-PAKE exchange). + + + + + Convenience constructor for a new JPakeParticipant that uses + the JPakePrimeOrderGroups#NIST_3072 prime order group, + a SHA-256 digest, and a default SecureRandom implementation. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + + + + Convenience constructor for a new JPakeParticipant that uses + a SHA-256 digest, and a default SecureRandom implementation. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + Prime order group. See JPakePrimeOrderGroups for standard groups. + + + + Constructor for a new JPakeParticipant. + + After construction, the State state will be STATE_INITIALIZED. + + Throws NullReferenceException if any argument is null. Throws + ArgumentException if password is empty. + + Unique identifier of this participant. + The two participants in the exchange must NOT share the same id. + Shared secret. + A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + Caller should clear the input password as soon as possible. + Prime order group. See JPakePrimeOrderGroups for standard groups. + Digest to use during zero knowledge proofs and key confirmation + (SHA-256 or stronger preferred). + Source of secure random data for x1 and x2, and for the zero knowledge proofs. + + + + Creates and returns the payload to send to the other participant during round 1. + + After execution, the State state} will be STATE_ROUND_1_CREATED}. + + + + + Validates the payload received from the other participant during round 1. + + Must be called prior to CreateRound2PayloadToSend(). + + After execution, the State state will be STATE_ROUND_1_VALIDATED. + + Throws CryptoException if validation fails. Throws InvalidOperationException + if called multiple times. + + + + + Creates and returns the payload to send to the other participant during round 2. + + ValidateRound1PayloadReceived(JPakeRound1Payload) must be called prior to this method. + + After execution, the State state will be STATE_ROUND_2_CREATED. + + Throws InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + + + + + Validates the payload received from the other participant during round 2. + Note that this DOES NOT detect a non-common password. + The only indication of a non-common password is through derivation + of different keys (which can be detected explicitly by executing round 3 and round 4) + + Must be called prior to CalculateKeyingMaterial(). + + After execution, the State state will be STATE_ROUND_2_VALIDATED. + + Throws CryptoException if validation fails. Throws + InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + + + + + Calculates and returns the key material. + A session key must be derived from this key material using a secure key derivation function (KDF). + The KDF used to derive the key is handled externally (i.e. not by JPakeParticipant). + + The keying material will be identical for each participant if and only if + each participant's password is the same. i.e. If the participants do not + share the same password, then each participant will derive a different key. + Therefore, if you immediately start using a key derived from + the keying material, then you must handle detection of incorrect keys. + If you want to handle this detection explicitly, you can optionally perform + rounds 3 and 4. See JPakeParticipant for details on how to execute + rounds 3 and 4. + + The keying material will be in the range [0, p-1]. + + ValidateRound2PayloadReceived(JPakeRound2Payload) must be called prior to this method. + + As a side effect, the internal password array is cleared, since it is no longer needed. + + After execution, the State state will be STATE_KEY_CALCULATED. + + Throws InvalidOperationException if called prior to ValidateRound2PayloadReceived(JPakeRound2Payload), + or if called multiple times. + + + + + Creates and returns the payload to send to the other participant during round 3. + + See JPakeParticipant for more details on round 3. + + After execution, the State state} will be STATE_ROUND_3_CREATED. + Throws InvalidOperationException if called prior to CalculateKeyingMaterial, or multiple + times. + + The keying material as returned from CalculateKeyingMaterial(). + + + + Validates the payload received from the other participant during round 3. + + See JPakeParticipant for more details on round 3. + + After execution, the State state will be STATE_ROUND_3_VALIDATED. + + Throws CryptoException if validation fails. Throws InvalidOperationException if called prior to + CalculateKeyingMaterial or multiple times + + The round 3 payload received from the other participant. + The keying material as returned from CalculateKeyingMaterial(). + + + + Gets the current state of this participant. + See the STATE_* constants for possible values. + + + + + A pre-computed prime order group for use during a J-PAKE exchange. + + Typically a Schnorr group is used. In general, J-PAKE can use any prime order group + that is suitable for public key cryptography, including elliptic curve cryptography. + + See JPakePrimeOrderGroups for convenient standard groups. + + NIST publishes + many groups that can be used for the desired level of security. + + + + + Constructs a new JPakePrimeOrderGroup. + + In general, you should use one of the pre-approved groups from + JPakePrimeOrderGroups, rather than manually constructing one. + + The following basic checks are performed: + + p-1 must be evenly divisible by q + g must be in [2, p-1] + g^q mod p must equal 1 + p must be prime (within reasonably certainty) + q must be prime (within reasonably certainty) + + The prime checks are performed using BigInteger#isProbablePrime(int), + and are therefore subject to the same probability guarantees. + + These checks prevent trivial mistakes. + However, due to the small uncertainties if p and q are not prime, + advanced attacks are not prevented. + Use it at your own risk. + + Throws NullReferenceException if any argument is null. Throws + InvalidOperationException is any of the above validations fail. + + + + + Constructor used by the pre-approved groups in JPakePrimeOrderGroups. + These pre-approved groups can avoid the expensive checks. + User-specified groups should not use this constructor. + + + + + Standard pre-computed prime order groups for use by J-PAKE. + (J-PAKE can use pre-computed prime order groups, same as DSA and Diffie-Hellman.) +

    + This class contains some convenient constants for use as input for + constructing {@link JPAKEParticipant}s. +

    + The prime order groups below are taken from Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB), + and from the prime order groups + published by NIST. +

    +
    + + + From Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB) + 1024-bit p, 160-bit q and 1024-bit g for 80-bit security. + + + + + From NIST. + 2048-bit p, 224-bit q and 2048-bit g for 112-bit security. + + + + + From NIST. + 3072-bit p, 256-bit q and 3072-bit g for 128-bit security. + + + + + The payload sent/received during the first round of a J-PAKE exchange. + + Each JPAKEParticipant creates and sends an instance of this payload to + the other. The payload to send should be created via + JPAKEParticipant.CreateRound1PayloadToSend(). + + Each participant must also validate the payload received from the other. + The received payload should be validated via + JPAKEParticipant.ValidateRound1PayloadReceived(JPakeRound1Payload). + + + + + The id of the JPAKEParticipant who created/sent this payload. + + + + + The value of g^x1 + + + + + The value of g^x2 + + + + + The zero knowledge proof for x1. + + This is a two element array, containing {g^v, r} for x1. + + + + + The zero knowledge proof for x2. + + This is a two element array, containing {g^v, r} for x2. + + + + + The payload sent/received during the second round of a J-PAKE exchange. + + Each JPAKEParticipant creates and sends an instance + of this payload to the other JPAKEParticipant. + The payload to send should be created via + JPAKEParticipant#createRound2PayloadToSend() + + Each JPAKEParticipant must also validate the payload + received from the other JPAKEParticipant. + The received payload should be validated via + JPAKEParticipant#validateRound2PayloadReceived(JPakeRound2Payload) + + + + + The id of the JPAKEParticipant who created/sent this payload. + + + + + The value of A, as computed during round 2. + + + + + The zero knowledge proof for x2 * s. + + This is a two element array, containing {g^v, r} for x2 * s. + + + + + The payload sent/received during the optional third round of a J-PAKE exchange, + which is for explicit key confirmation. + + Each JPAKEParticipant creates and sends an instance + of this payload to the other JPAKEParticipant. + The payload to send should be created via + JPAKEParticipant#createRound3PayloadToSend(BigInteger) + + Eeach JPAKEParticipant must also validate the payload + received from the other JPAKEParticipant. + The received payload should be validated via + JPAKEParticipant#validateRound3PayloadReceived(JPakeRound3Payload, BigInteger) + + + + + The id of the {@link JPAKEParticipant} who created/sent this payload. + + + + + The value of MacTag, as computed by round 3. + + See JPAKEUtil#calculateMacTag(string, string, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, org.bouncycastle.crypto.Digest) + + + + + Primitives needed for a J-PAKE exchange. + + The recommended way to perform a J-PAKE exchange is by using + two JPAKEParticipants. Internally, those participants + call these primitive operations in JPakeUtilities. + + The primitives, however, can be used without a JPAKEParticipant if needed. + + + + + Return a value that can be used as x1 or x3 during round 1. + The returned value is a random value in the range [0, q-1]. + + + + + Return a value that can be used as x2 or x4 during round 1. + The returned value is a random value in the range [1, q-1]. + + + + + Converts the given password to a BigInteger + for use in arithmetic calculations. + + + + + Calculate g^x mod p as done in round 1. + + + + + Calculate ga as done in round 2. + + + + + Calculate x2 * s as done in round 2. + + + + + Calculate A as done in round 2. + + + + + Calculate a zero knowledge proof of x using Schnorr's signature. + The returned array has two elements {g^v, r = v-x*h} for x. + + + + + Validates that g^x4 is not 1. + throws CryptoException if g^x4 is 1 + + + + + Validates that ga is not 1. + + As described by Feng Hao... + Alice could simply check ga != 1 to ensure it is a generator. + In fact, as we will explain in Section 3, (x1 + x3 + x4 ) is random over Zq even in the face of active attacks. + Hence, the probability for ga = 1 is extremely small - on the order of 2^160 for 160-bit q. + + throws CryptoException if ga is 1 + + + + + Validates the zero knowledge proof (generated by + calculateZeroKnowledgeProof(BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, string, Digest, SecureRandom) + is correct. + + throws CryptoException if the zero knowledge proof is not correct + + + + + Calculates the keying material, which can be done after round 2 has completed. + A session key must be derived from this key material using a secure key derivation function (KDF). + The KDF used to derive the key is handled externally (i.e. not by JPAKEParticipant). + + KeyingMaterial = (B/g^{x2*x4*s})^x2 + + + + + Validates that the given participant ids are not equal. + (For the J-PAKE exchange, each participant must use a unique id.) + + Throws CryptoException if the participantId strings are equal. + + + + + Validates that the given participant ids are equal. + This is used to ensure that the payloads received from + each round all come from the same participant. + + + + + Validates that the given object is not null. + throws NullReferenceException if the object is null. + + object in question + name of the object (to be used in exception message) + + + + Calculates the MacTag (to be used for key confirmation), as defined by + NIST SP 800-56A Revision 1, + Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + + MacTag = HMAC(MacKey, MacLen, MacData) + MacKey = H(K || "JPAKE_KC") + MacData = "KC_1_U" || participantId || partnerParticipantId || gx1 || gx2 || gx3 || gx4 + + Note that both participants use "KC_1_U" because the sender of the round 3 message + is always the initiator for key confirmation. + + HMAC = {@link HMac} used with the given {@link Digest} + H = The given {@link Digest} + MacLen = length of MacTag + + + + + Calculates the MacKey (i.e. the key to use when calculating the MagTag for key confirmation). + + MacKey = H(K || "JPAKE_KC") + + + + + Validates the MacTag received from the partner participant. + + throws CryptoException if the participantId strings are equal. + + + + Parameters for key/byte stream derivation classes + + + RFC 2631 Diffie-hellman KEK derivation function. + + + base interface for general purpose byte derivation functions. + + + return the message digest used as the basis for the function + + + X9.63 based key derivation function for ECDH CMS. + + + Implements the client side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + + + Initialises the client to begin new authentication attempt + @param N The safe prime associated with the client's verifier + @param g The group parameter associated with the client's verifier + @param digest The digest algorithm associated with the client's verifier + @param random For key generation + + + Generates client's credentials given the client's salt, identity and password + @param salt The salt used in the client's verifier. + @param identity The user's identity (eg. username) + @param password The user's password + @return Client's public value to send to server + + + Generates client's verification message given the server's credentials + @param serverB The server's credentials + @return Client's verification message for the server + @throws CryptoException If server's credentials are invalid + + + Computes the client evidence message M1 using the previously received values. + To be called after calculating the secret S. + @return M1: the client side generated evidence message + @throws CryptoException + + + Authenticates the server evidence message M2 received and saves it only if correct. + @param M2: the server side generated evidence message + @return A boolean indicating if the server message M2 was the expected one. + @throws CryptoException + + + Computes the final session key as a result of the SRP successful mutual authentication + To be called after verifying the server evidence message M2. + @return Key: the mutually authenticated symmetric session key + @throws CryptoException + + + Implements the server side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + + + Initialises the server to accept a new client authentication attempt + @param N The safe prime associated with the client's verifier + @param g The group parameter associated with the client's verifier + @param v The client's verifier + @param digest The digest algorithm associated with the client's verifier + @param random For key generation + + + Generates the server's credentials that are to be sent to the client. + @return The server's public value to the client + + + Processes the client's credentials. If valid the shared secret is generated and returned. + @param clientA The client's credentials + @return A shared secret BigInteger + @throws CryptoException If client's credentials are invalid + + + Authenticates the received client evidence message M1 and saves it only if correct. + To be called after calculating the secret S. + @param M1: the client side generated evidence message + @return A boolean indicating if the client message M1 was the expected one. + @throws CryptoException + + + Computes the server evidence message M2 using the previously verified values. + To be called after successfully verifying the client evidence message M1. + @return M2: the server side generated evidence message + @throws CryptoException + + + Computes the final session key as a result of the SRP successful mutual authentication + To be called after calculating the server evidence message M2. + @return Key: the mutual authenticated symmetric session key + @throws CryptoException + + + Computes the client evidence message (M1) according to the standard routine: + M1 = H( A | B | S ) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param A The public client value + @param B The public server value + @param S The secret calculated by both sides + @return M1 The calculated client evidence message + + + Computes the server evidence message (M2) according to the standard routine: + M2 = H( A | M1 | S ) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param A The public client value + @param M1 The client evidence message + @param S The secret calculated by both sides + @return M2 The calculated server evidence message + + + Computes the final Key according to the standard routine: Key = H(S) + @param digest The Digest used as the hashing function H + @param N Modulus used to get the pad length + @param S The secret calculated by both sides + @return + + + Generates new SRP verifier for user + + + Initialises generator to create new verifiers + @param N The safe prime to use (see DHParametersGenerator) + @param g The group parameter to use (see DHParametersGenerator) + @param digest The digest to use. The same digest type will need to be used later for the actual authentication + attempt. Also note that the final session key size is dependent on the chosen digest. + + + Creates a new SRP verifier + @param salt The salt to use, generally should be large and random + @param identity The user's identifying information (eg. username) + @param password The user's password + @return A new verifier for use in future SRP authentication + + + a holding class for public/private parameter pairs. + + + basic constructor. + + @param publicParam a public key parameters object. + @param privateParam the corresponding private key parameters. + + + return the public key parameters. + + @return the public key parameters. + + + return the private key parameters. + + @return the private key parameters. + + + The AEAD block ciphers already handle buffering internally, so this class + just takes care of implementing IBufferedCipher methods. + + + Block cipher engines are expected to conform to this interface. + + + Initialise the cipher. + If true the cipher is initialised for encryption, + if false for decryption. + The key and other data required by the cipher. + + + + Reset the cipher. After resetting the cipher is in the same state + as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the blocksize for the underlying cipher. + + @return the blocksize for the underlying cipher. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output, or the input is not block size aligned and should be. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + @exception DataLengthException if the input is not block size + aligned. + + + Reset the buffer and cipher. After resetting the object is in the same + state as it was after the last init (if there was one). + + + a buffer wrapper for an asymmetric block cipher, allowing input + to be accumulated in a piecemeal fashion until final processing. + + + base constructor. + + @param cipher the cipher this buffering object wraps. + + + return the amount of data sitting in the buffer. + + @return the amount of data sitting in the buffer. + + + initialise the buffer and the underlying cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + + + process the contents of the buffer using the underlying + cipher. + + @return the result of the encryption/decryption process on the + buffer. + @exception InvalidCipherTextException if we are given a garbage block. + + + Reset the buffer + + + A wrapper class that allows block ciphers to be used to process data in + a piecemeal fashion. The BufferedBlockCipher outputs a block only when the + buffer is full and more data is being added, or on a doFinal. +

    + Note: in the case where the underlying cipher is either a CFB cipher or an + OFB one the last block may not be a multiple of the block size. +

    +
    + + constructor for subclasses + + + Create a buffered block cipher without padding. + + @param cipher the underlying block cipher this buffering object wraps. + false otherwise. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the blocksize for the underlying cipher. + + @return the blocksize for the underlying cipher. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output, or the input is not block size aligned and should be. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + @exception DataLengthException if the input is not block size + aligned. + + + Reset the buffer and cipher. After resetting the object is in the same + state as it was after the last init (if there was one). + + + The base class for symmetric, or secret, cipher key generators. + + + initialise the key generator. + + @param param the parameters to be used for key generation + + + Generate a secret key. + + @return a byte array containing the key value. + + + this exception is thrown if a buffer that is meant to have output + copied into it turns out to be too short, or if we've been given + insufficient input. In general this exception will Get thrown rather + than an ArrayOutOfBounds exception. + + + base constructor. + + + create a DataLengthException with the given message. + + @param message the message to be carried with the exception. + + + base implementation of MD4 family style digest as outlined in + "Handbook of Applied Cryptography", pages 344 - 347. + + + interface that a message digest conforms to. + + + return the size, in bytes, of the digest produced by this message digest. + + @return the size, in bytes, of the digest produced by this message digest. + + + return the size, in bytes, of the internal buffer used by this digest. + + @return the size, in bytes, of the internal buffer used by this digest. + + + update the message digest with a single byte. + + @param inByte the input byte to be entered. + + + update the message digest with a block of bytes. + + @param input the byte array containing the data. + @param inOff the offset into the byte array where the data starts. + @param len the length of the data. + + + Close the digest, producing the final digest value. The doFinal + call leaves the digest reset. + + @param output the array the digest is to be copied into. + @param outOff the offset into the out array the digest is to start at. + + + reset the digest back to it's initial state. + + + return the algorithm name + + @return the algorithm name + + + + Produce a copy of this object with its configuration and in its current state. + + + The returned object may be used simply to store the state, or may be used as a similar object + starting from the copied state. + + + + + Restore a copied object state into this object. + + + Implementations of this method should try to avoid or minimise memory allocation to perform the reset. + + an object originally {@link #copy() copied} from an object of the same type as this instance. + if the provided object is not of the correct type. + if the other parameter is in some other way invalid. + + + implementation of GOST R 34.11-94 + + + Standard constructor + + + Constructor to allow use of a particular sbox with GOST28147 + @see GOST28147Engine#getSBox(String) + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + + Implementation of Keccak based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + Return the size of block that the compression function is applied to in bytes. + + @return internal byte length of a block. + + + Base class for SHA-384 and SHA-512. + + + Constructor for variable length word + + + Copy constructor. We are using copy constructors in place + of the object.Clone() interface as this interface is not + supported by J2ME. + + + adjust the byte counts so that byteCount2 represents the + upper long (less 3 bits) word of the byte count. + + + implementation of MD2 + as outlined in RFC1319 by B.Kaliski from RSA Laboratories April 1992 + + + Close the digest, producing the final digest value. The doFinal + call leaves the digest reset. + + @param out the array the digest is to be copied into. + @param outOff the offset into the out array the digest is to start at. + + + reset the digest back to it's initial state. + + + update the message digest with a single byte. + + @param in the input byte to be entered. + + + update the message digest with a block of bytes. + + @param in the byte array containing the data. + @param inOff the offset into the byte array where the data starts. + @param len the length of the data. + + + return the algorithm name + + @return the algorithm name + + + implementation of MD4 as RFC 1320 by R. Rivest, MIT Laboratory for + Computer Science and RSA Data Security, Inc. +

    + NOTE: This algorithm is only included for backwards compatibility + with legacy applications, it's not secure, don't use it for anything new!

    +
    + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + implementation of MD5 as outlined in "Handbook of Applied Cryptography", pages 346 - 347. + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + Wrapper removes exposure to the IMemoable interface on an IDigest implementation. + + + Base constructor. + + @param baseDigest underlying digest to use. + @exception IllegalArgumentException if baseDigest is null + + + implementation of RipeMD128 + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + implementation of RipeMD see, + http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables to the IV values. + + + +

    Implementation of RipeMD256.

    +

    Note: this algorithm offers the same level of security as RipeMD128.

    +
    +
    + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + + reset the chaining variables to the IV values. + + + +

    Implementation of RipeMD 320.

    +

    Note: this algorithm offers the same level of security as RipeMD160.

    +
    +
    + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + + reset the chaining variables to the IV values. + + + implementation of SHA-1 as outlined in "Handbook of Applied Cryptography", pages 346 - 349. + + It is interesting to ponder why the, apart from the extra IV, the other difference here from MD5 + is the "endianness" of the word processing! + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + SHA-224 as described in RFC 3874 +
    +                    block  word  digest
    +            SHA-1   512    32    160
    +            SHA-224 512    32    224
    +            SHA-256 512    32    256
    +            SHA-384 1024   64    384
    +            SHA-512 1024   64    512
    +            
    +
    + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Draft FIPS 180-2 implementation of SHA-256. Note: As this is + based on a draft this implementation is subject to change. + +
    +                     block  word  digest
    +             SHA-1   512    32    160
    +             SHA-256 512    32    256
    +             SHA-384 1024   64    384
    +             SHA-512 1024   64    512
    +             
    +
    + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Draft FIPS 180-2 implementation of SHA-384. Note: As this is + based on a draft this implementation is subject to change. + +
    +                     block  word  digest
    +             SHA-1   512    32    160
    +             SHA-256 512    32    256
    +             SHA-384 1024   64    384
    +             SHA-512 1024   64    512
    +             
    +
    + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + + Implementation of SHA-3 based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + Draft FIPS 180-2 implementation of SHA-512. Note: As this is + based on a draft this implementation is subject to change. + +
    +                     block  word  digest
    +             SHA-1   512    32    160
    +             SHA-256 512    32    256
    +             SHA-384 1024   64    384
    +             SHA-512 1024   64    512
    +             
    +
    + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + FIPS 180-4 implementation of SHA-512/t + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + + Implementation of SHAKE based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + + + Following the naming conventions used in the C source code to enable easy review of the implementation. + + + + + With FIPS PUB 202 a new kind of message digest was announced which supported extendable output, or variable digest sizes. + This interface provides the extra method required to support variable output on a digest implementation. + + + + + Output the results of the final calculation for this digest to outLen number of bytes. + + output array to write the output bytes to. + offset to start writing the bytes at. + the number of output bytes requested. + the number of bytes written + + + + Start outputting the results of the final calculation for this digest. Unlike DoFinal, this method + will continue producing output until the Xof is explicitly reset, or signals otherwise. + + output array to write the output bytes to. + offset to start writing the bytes at. + the number of output bytes requested. + the number of bytes written + + + Wrapper class that reduces the output length of a particular digest to + only the first n bytes of the digest function. + + + Base constructor. + + @param baseDigest underlying digest to use. + @param length length in bytes of the output of doFinal. + @exception ArgumentException if baseDigest is null, or length is greater than baseDigest.GetDigestSize(). + + + + Implementation of the Skein parameterised hash function in 256, 512 and 1024 bit block sizes, + based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

    + Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + + + + + +

    + 256 bit block size - Skein-256 + +
    + + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + + Constructs a Skein digest with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/digest size to produce in bits, which must be an integral number of + bytes. + + + + Optionally initialises the Skein digest with the provided parameters. + + See for details on the parameterisation of the Skein hash function. + the parameters to apply to this engine, or null to use no parameters. + + + + Implementation of the Skein family of parameterised hash functions in 256, 512 and 1024 bit block + sizes, based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

    + Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. +

    + This implementation is the basis for and , implementing the + parameter based configuration system that allows Skein to be adapted to multiple applications.
    + Initialising the engine with allows standard and arbitrary parameters to + be applied during the Skein hash function. +

    + Implemented: +

      +
    • 256, 512 and 1024 bit internal states.
    • +
    • Full 96 bit input length.
    • +
    • Parameters defined in the Skein specification, and arbitrary other pre and post message + parameters.
    • +
    • Arbitrary output size in 1 byte intervals.
    • +
    +

    + Not implemented: +

      +
    • Sub-byte length input (bit padding).
    • +
    • Tree hashing.
    • +
    +
    + +
    + + + 256 bit block size - Skein-256 + + + + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + The parameter type for the Skein key. + + + The parameter type for the Skein configuration block. + + + The parameter type for the message. + + + The parameter type for the output transformation. + + + Precalculated UBI(CFG) states for common state/output combinations without key or other + pre-message params. + + + Underlying Threefish tweakable block cipher + + + Size of the digest output, in bytes + + + The current chaining/state value + + + The initial state value + + + The (optional) key parameter + + + Parameters to apply prior to the message + + + Parameters to apply after the message, but prior to output + + + The current UBI operation + + + Buffer for single byte update method + + + + Constructs a Skein digest with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/digest size to produce in bits, which must be an integral number of + bytes. + + + + Creates a SkeinEngine as an exact copy of an existing instance. + + + + + Initialises the Skein engine with the provided parameters. See for + details on the parameterisation of the Skein hash function. + + the parameters to apply to this engine, or null to use no parameters. + + + Calculate the initial (pre message block) chaining state. + + + + Reset the engine to the initial state (with the key and any pre-message parameters , ready to + accept message input. + + + + Point at which position might overflow long, so switch to add with carry logic + + + Bit 127 = final + + + Bit 126 = first + + + UBI uses a 128 bit tweak + + + Whether 64 bit position exceeded + + + Advances the position in the tweak by the specified value. + + + The Unique Block Iteration chaining mode. + + + Buffer for the current block of message data + + + Offset into the current message block + + + Buffer for message words for feedback into encrypted block + + + + Implementation of Chinese SM3 digest as described at + http://tools.ietf.org/html/draft-shen-sm3-hash-00 + and at .... ( Chinese PDF ) + + + The specification says "process a bit stream", + but this is written to process bytes in blocks of 4, + meaning this will process 32-bit word groups. + But so do also most other digest specifications, + including the SHA-256 which was a origin for + this specification. + + + + + Standard constructor + + + + + Copy constructor. This will copy the state of the provided + message digest. + + + + + reset the chaining variables + + + + implementation of Tiger based on: + + http://www.cs.technion.ac.il/~biham/Reports/Tiger + + + Standard constructor + + + Copy constructor. This will copy the state of the provided + message digest. + + + reset the chaining variables + + + Implementation of WhirlpoolDigest, based on Java source published by Barreto + and Rijmen. + + + + Copy constructor. This will copy the state of the provided message + digest. + + + Reset the chaining variables + + + return the X9ECParameters object for the named curve represented by + the passed in object identifier. Null if the curve isn't present. + + @param oid an object identifier representing a named curve, if present. + + + return the object identifier signified by the passed in name. Null + if there is no object identifier associated with name. + + @return the object identifier associated with name, if present. + + + return the named curve name represented by the given object identifier. + + + returns an enumeration containing the name strings for curves + contained in this structure. + + + ISO 9796-1 padding. Note in the light of recent results you should + only use this with RSA (rather than the "simpler" Rabin keys) and you + should never use it with anything other than a hash (ie. even if the + message is small don't sign the message, sign it's hash) or some "random" + value. See your favorite search engine for details. + + + Base interface for a public/private key block cipher. + + + Initialise the cipher. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The maximum size, in bytes, an input block may be. + + + The maximum size, in bytes, an output block will be. + + + Process a block. + The input buffer. + The offset into inBuf that the input block begins. + The length of the input block. + Input decrypts improperly. + Input is too large for the cipher. + + + The name of the algorithm this cipher implements. + + + return the input block size. The largest message we can process + is (key_size_in_bits + 3)/16, which in our world comes to + key_size_in_bytes / 2. + + + return the maximum possible size for the output. + + + set the number of bits in the next message to be treated as + pad bits. + + + retrieve the number of pad bits in the last decoded message. + + + @exception InvalidCipherTextException if the decrypted block is not a valid ISO 9796 bit string + + + Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2. + + + @exception InvalidCipherTextException if the decrypted block turns out to + be badly formatted. + + + int to octet string. + + + mask generator function, as described in PKCS1v2. + + + this does your basic Pkcs 1 v1.5 padding - whether or not you should be using this + depends on your application - see Pkcs1 Version 2 for details. + + + some providers fail to include the leading zero in PKCS1 encoded blocks. If you need to + work with one of these set the system property Org.BouncyCastle.Pkcs1.Strict to false. + + + Basic constructor. + @param cipher + + + Constructor for decryption with a fixed plaintext length. + + @param cipher The cipher to use for cryptographic operation. + @param pLen Length of the expected plaintext. + + + Constructor for decryption with a fixed plaintext length and a fallback + value that is returned, if the padding is incorrect. + + @param cipher + The cipher to use for cryptographic operation. + @param fallback + The fallback value, we don't to a arraycopy here. + + + Checks if the argument is a correctly PKCS#1.5 encoded Plaintext + for encryption. + + @param encoded The Plaintext. + @param pLen Expected length of the plaintext. + @return Either 0, if the encoding is correct, or -1, if it is incorrect. + + + Decode PKCS#1.5 encoding, and return a random value if the padding is not correct. + + @param in The encrypted block. + @param inOff Offset in the encrypted block. + @param inLen Length of the encrypted block. + @param pLen Length of the desired output. + @return The plaintext without padding, or a random value if the padding was incorrect. + + @throws InvalidCipherTextException + + + @exception InvalidCipherTextException if the decrypted block is not in Pkcs1 format. + + + The same effect can be achieved by setting the static property directly +

    + The static property is checked during construction of the encoding object, it is set to + true by default. +

    +
    + + an implementation of the AES (Rijndael), from FIPS-197. +

    + For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor, they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first. + + The slowest version uses no static tables at all and computes the values in each round. +

    +

    + This file contains the middle performance version with 2Kbytes of static tables for round precomputation. +

    +
    + + Base interface for a symmetric key block cipher. + + + Initialise the cipher. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The block size for this cipher, in bytes. + + + Process a block. + The input buffer. + The offset into inBuf that the input block begins. + The output buffer. + The offset into outBuf to write the output block. + If input block is wrong size, or outBuf too small. + The number of bytes processed and produced. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Indicates whether this cipher can handle partial blocks. + + + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + an implementation of the AES (Rijndael)), from FIPS-197. +

    + For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor), they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations), 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each), for a total of 2Kbytes), + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first + + The slowest version uses no static tables at all and computes the values in each round +

    +

    + This file contains the fast version with 8Kbytes of static tables for round precomputation +

    +
    + + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + an implementation of the AES (Rijndael), from FIPS-197. +

    + For further details see: http://csrc.nist.gov/encryption/aes/. + + This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + http://fp.gladman.plus.com/cryptography_technology/rijndael/ + + There are three levels of tradeoff of speed vs memory + Because java has no preprocessor, they are written as three separate classes from which to choose + + The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + and 4 for decryption. + + The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + adding 12 rotate operations per round to compute the values contained in the other tables from + the contents of the first + + The slowest version uses no static tables at all and computes the values + in each round. +

    +

    + This file contains the slowest performance version with no static tables + for round precomputation, but it has the smallest foot print. +

    +
    + + Calculate the necessary round keys + The number of calculations depends on key size and block size + AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + This code is written assuming those are the only possible values + + + default constructor - 128 bit block size. + + + initialise an AES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + + An implementation of the AES Key Wrapper from the NIST Key Wrap Specification. +

    + For further details see: http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + + + + + An implementation of the AES Key Wrapper from the NIST Key Wrap + Specification as described in RFC 3394. +

    + For further details see: http://www.ietf.org/rfc/rfc3394.txt + and http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + + + +

    The name of the algorithm this cipher implements. +
    + + A class that provides Blowfish key encryption operations, + such as encoding data and generating keys. + All the algorithms herein are from Applied Cryptography + and implement a simplified cryptography interface. + + + initialise a Blowfish cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + apply the encryption cycle to each value pair in the table. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Camellia - based on RFC 3713. + + + Camellia - based on RFC 3713, smaller implementation, about half the size of CamelliaEngine. + + + + An implementation of the Camellia key wrapper based on RFC 3657/RFC 3394. +

    + For further details see: http://www.ietf.org/rfc/rfc3657.txt. + + + + A class that provides CAST key encryption operations, + such as encoding data and generating keys. + + All the algorithms herein are from the Internet RFC's + + RFC2144 - Cast5 (64bit block, 40-128bit key) + RFC2612 - CAST6 (128bit block, 128-256bit key) + + and implement a simplified cryptography interface. + + + initialise a CAST cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + The first of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + The second of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + The third of the three processing functions for the + encryption and decryption. + + @param D the input to be processed + @param Kmi the mask to be used from Km[n] + @param Kri the rotation value to be used + + + + Does the 16 rounds to encrypt the block. + + @param L0 the LH-32bits of the plaintext block + @param R0 the RH-32bits of the plaintext block + + + A class that provides CAST6 key encryption operations, + such as encoding data and generating keys. + + All the algorithms herein are from the Internet RFC + + RFC2612 - CAST6 (128bit block, 128-256bit key) + + and implement a simplified cryptography interface. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param src The plaintext buffer + @param srcIndex An offset into src + @param dst The ciphertext buffer + @param dstIndex An offset into dst + + + Does the 12 quad rounds rounds to encrypt the block. + + @param A the 00-31 bits of the plaintext block + @param B the 32-63 bits of the plaintext block + @param C the 64-95 bits of the plaintext block + @param D the 96-127 bits of the plaintext block + @param result the resulting ciphertext + + + Does the 12 quad rounds rounds to decrypt the block. + + @param A the 00-31 bits of the ciphertext block + @param B the 32-63 bits of the ciphertext block + @param C the 64-95 bits of the ciphertext block + @param D the 96-127 bits of the ciphertext block + @param result the resulting plaintext + + +

    + Implementation of Daniel J. Bernstein's ChaCha stream cipher. + +
    + + + Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005 + + + + The interface stream ciphers conform to. + + + Initialise the cipher. + If true the cipher is initialised for encryption, + if false for decryption. + The key and other data required by the cipher. + + If the parameters argument is inappropriate. + + + + encrypt/decrypt a single byte returning the result. + the byte to be processed. + the result of processing the input byte. + + + + Process a block of bytes from input putting the result into output. + + The input byte array. + + The offset into input where the data to be processed starts. + + The number of bytes to be processed. + The output buffer the processed bytes go into. + + The offset into output the processed data starts at. + + If the output buffer is too small. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Constants + + + + Creates a 20 round Salsa20 engine. + + + + + Creates a Salsa20 engine with a specific number of rounds. + + the number of rounds (must be an even number). + + + Rotate left + + @param x value to rotate + @param y amount to rotate x + + @return rotated x + + + + Creates a 20 rounds ChaCha engine. + + + + + Implementation of Daniel J. Bernstein's ChaCha stream cipher. + + + + + Creates a 20 rounds ChaCha engine. + + + + + Creates a ChaCha engine with a specific number of rounds. + + the number of rounds (must be an even number). + + + + ChaCha function. + + The number of ChaCha rounds to execute + The input words. + The ChaCha state to modify. + + + A class that provides a basic DESede (or Triple DES) engine. + + + A class that provides a basic DES engine. + + + initialise a DES cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + what follows is mainly taken from "Applied Cryptography", by + Bruce Schneier, however it also bears great resemblance to Richard + Outerbridge's D3DES... + + + Generate an integer based working key based on our secret key + and what we processing we are planning to do. + + Acknowledgements for this routine go to James Gillogly and Phil Karn. + (whoever, and wherever they are!). + + + the DES engine. + + + initialise a DESede cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + * Wrap keys according to + * + * draft-ietf-smime-key-wrap-01.txt. + *

    + * Note: + *

      + *
    • this is based on a draft, and as such is subject to change - don't use this class for anything requiring long term storage.
    • + *
    • if you are using this to wrap triple-des keys you need to set the + * parity bits on the key and, if it's a two-key triple-des key, pad it + * yourself.
    • + *
    + *

    +
    + + Field engine + + + Field param + + + Field paramPlusIV + + + Field iv + + + Field forWrapping + + + Field IV2 + + + Method init + + @param forWrapping + @param param + + + Method wrap + + @param in + @param inOff + @param inLen + @return + + + Method unwrap + + @param in + @param inOff + @param inLen + @return + @throws InvalidCipherTextException + + + Some key wrap algorithms make use of the Key Checksum defined + in CMS [CMS-Algorithms]. This is used to provide an integrity + check value for the key being wrapped. The algorithm is + + - Compute the 20 octet SHA-1 hash on the key being wrapped. + - Use the first 8 octets of this hash as the checksum value. + + @param key + @return + @throws Exception + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + @param key + @param checksum + @return + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + Method GetAlgorithmName + + @return + + + this does your basic ElGamal algorithm. + + + initialise the ElGamal engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary ElGamal key parameters. + + + Return the maximum size for an input block to this engine. + For ElGamal this is always one byte less than the size of P on + encryption, and twice the length as the size of P on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For ElGamal this is always one byte less than the size of P on + decryption, and twice the length as the size of P on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic ElGamal algorithm. + + @param in the input array. + @param inOff the offset into the input buffer where the data starts. + @param length the length of the data to be processed. + @return the result of the ElGamal process. + @exception DataLengthException the input block is too large. + + + implementation of GOST 28147-89 + + + standard constructor. + + + initialise an Gost28147 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is inappropriate. + + + Return the S-Box associated with SBoxName + @param sBoxName name of the S-Box + @return byte array representing the S-Box + + + HC-128 is a software-efficient stream cipher created by Hongjun Wu. It + generates keystream from a 128-bit secret key and a 128-bit initialization + vector. +

    + http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf +

    + It is a third phase candidate in the eStream contest, and is patent-free. + No attacks are known as of today (April 2007). See + + http://www.ecrypt.eu.org/stream/hcp3.html +

    +
    + + Initialise a HC-128 cipher. + + @param forEncryption whether or not we are for encryption. Irrelevant, as + encryption and decryption are the same. + @param params the parameters required to set up the cipher. + @throws ArgumentException if the params argument is + inappropriate (ie. the key is not 128 bit long). + + + HC-256 is a software-efficient stream cipher created by Hongjun Wu. It + generates keystream from a 256-bit secret key and a 256-bit initialization + vector. +

    + http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc256_p3.pdf +

    + Its brother, HC-128, is a third phase candidate in the eStream contest. + The algorithm is patent-free. No attacks are known as of today (April 2007). + See + + http://www.ecrypt.eu.org/stream/hcp3.html +

    +
    + + Initialise a HC-256 cipher. + + @param forEncryption whether or not we are for encryption. Irrelevant, as + encryption and decryption are the same. + @param params the parameters required to set up the cipher. + @throws ArgumentException if the params argument is + inappropriate (ie. the key is not 256 bit long). + + + A class that provides a basic International Data Encryption Algorithm (IDEA) engine. +

    + This implementation is based on the "HOWTO: INTERNATIONAL DATA ENCRYPTION ALGORITHM" + implementation summary by Fauzan Mirza (F.U.Mirza@sheffield.ac.uk). (baring 1 typo at the + end of the mulinv function!). +

    +

    + It can be found at ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/idea/ +

    +

    + Note 1: This algorithm is patented in the USA, Japan, and Europe including + at least Austria, France, Germany, Italy, Netherlands, Spain, Sweden, Switzerland + and the United Kingdom. Non-commercial use is free, however any commercial + products are liable for royalties. Please see + www.mediacrypt.com for + further details. This announcement has been included at the request of + the patent holders. +

    +

    + Note 2: Due to the requests concerning the above, this algorithm is now only + included in the extended assembly. It is not included in the default distributions. +

    +
    + + standard constructor. + + + initialise an IDEA cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return x = x * y where the multiplication is done modulo + 65537 (0x10001) (as defined in the IDEA specification) and + a zero input is taken to be 65536 (0x10000). + + @param x the x value + @param y the y value + @return x = x * y + + + The following function is used to expand the user key to the encryption + subkey. The first 16 bytes are the user key, and the rest of the subkey + is calculated by rotating the previous 16 bytes by 25 bits to the left, + and so on until the subkey is completed. + + + This function computes multiplicative inverse using Euclid's Greatest + Common Divisor algorithm. Zero and one are self inverse. +

    + i.e. x * MulInv(x) == 1 (modulo BASE) +

    +
    + + Return the additive inverse of x. +

    + i.e. x + AddInv(x) == 0 +

    +
    + + The function to invert the encryption subkey to the decryption subkey. + It also involves the multiplicative inverse and the additive inverse functions. + + + support class for constructing intergrated encryption ciphers + for doing basic message exchanges on top of key agreement ciphers + + + set up for use with stream mode, where the key derivation function + is used to provide a stream of bytes to xor with the message. + + @param agree the key agreement used as the basis for the encryption + @param kdf the key derivation function used for byte generation + @param mac the message authentication code generator for the message + + + set up for use in conjunction with a block cipher to handle the + message. + + @param agree the key agreement used as the basis for the encryption + @param kdf the key derivation function used for byte generation + @param mac the message authentication code generator for the message + @param cipher the cipher to used for encrypting the message + + + Initialise the encryptor. + + @param forEncryption whether or not this is encryption/decryption. + @param privParam our private key parameters + @param pubParam the recipient's/sender's public key parameters + @param param encoding and derivation parameters. + + + Implementation of Bob Jenkin's ISAAC (Indirection Shift Accumulate Add and Count). + see: http://www.burtleburtle.net/bob/rand/isaacafa.html + + + initialise an ISAAC cipher. + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + NaccacheStern Engine. For details on this cipher, please see + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Initializes this algorithm. Must be called before all other Functions. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#init(bool, + org.bouncycastle.crypto.CipherParameters) + + + Returns the input block size of this algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetInputBlockSize() + + + Returns the output block size of this algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetOutputBlockSize() + + + Process a single Block using the Naccache-Stern algorithm. + + @see org.bouncycastle.crypto.AsymmetricBlockCipher#ProcessBlock(byte[], + int, int) + + + Encrypts a BigInteger aka Plaintext with the public key. + + @param plain + The BigInteger to encrypt + @return The byte[] representation of the encrypted BigInteger (i.e. + crypted.toByteArray()) + + + Adds the contents of two encrypted blocks mod sigma + + @param block1 + the first encrypted block + @param block2 + the second encrypted block + @return encrypt((block1 + block2) mod sigma) + @throws InvalidCipherTextException + + + Convenience Method for data exchange with the cipher. + + Determines blocksize and splits data to blocksize. + + @param data the data to be processed + @return the data after it went through the NaccacheSternEngine. + @throws InvalidCipherTextException + + + Computes the integer x that is expressed through the given primes and the + congruences with the chinese remainder theorem (CRT). + + @param congruences + the congruences c_i + @param primes + the primes p_i + @return an integer x for that x % p_i == c_i + + + A Noekeon engine, using direct-key mode. + + + Create an instance of the Noekeon encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + The no-op engine that just copies bytes through, irrespective of whether encrypting and decrypting. + Provided for the sake of completeness. + + + an implementation of RC2 as described in RFC 2268 + "A Description of the RC2(r) Encryption Algorithm" R. Rivest. + + + initialise a RC2 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the result rotating the 16 bit number in x left by y + + + Wrap keys according to RFC 3217 - RC2 mechanism + + + Field engine + + + Field param + + + Field paramPlusIV + + + Field iv + + + Field forWrapping + + + Field IV2 + + + Method init + + @param forWrapping + @param param + + + Method wrap + + @param in + @param inOff + @param inLen + @return + + + Method unwrap + + @param in + @param inOff + @param inLen + @return + @throws InvalidCipherTextException + + + Some key wrap algorithms make use of the Key Checksum defined + in CMS [CMS-Algorithms]. This is used to provide an integrity + check value for the key being wrapped. The algorithm is + + - Compute the 20 octet SHA-1 hash on the key being wrapped. + - Use the first 8 octets of this hash as the checksum value. + + @param key + @return + @throws Exception + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + @param key + @param checksum + @return + @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + + + Method GetAlgorithmName + + @return + + + initialise a RC4 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + The specification for RC5 came from the RC5 Encryption Algorithm + publication in RSA CryptoBytes, Spring of 1995. + http://www.rsasecurity.com/rsalabs/cryptobytes. +

    + This implementation has a word size of 32 bits.

    +
    + + Create an instance of the RC5 encryption algorithm + and set some defaults + + + initialise a RC5-32 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Encrypt the given block starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param in in byte buffer containing data to encrypt + @param inOff offset into src buffer + @param out out buffer where encrypted data is written + @param outOff offset into out buffer + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(32) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % 32 + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(32) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % 32 + + + The specification for RC5 came from the RC5 Encryption Algorithm + publication in RSA CryptoBytes, Spring of 1995. + http://www.rsasecurity.com/rsalabs/cryptobytes. +

    + This implementation is set to work with a 64 bit word size.

    +
    + + Create an instance of the RC5 encryption algorithm + and set some defaults + + + initialise a RC5-64 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Encrypt the given block starting at the given offset and place + the result in the provided buffer starting at the given offset. + + @param in in byte buffer containing data to encrypt + @param inOff offset into src buffer + @param out out buffer where encrypted data is written + @param outOff offset into out buffer + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + An RC6 engine. + + + Create an instance of the RC6 encryption algorithm + and set some defaults + + + initialise a RC5-32 cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Re-key the cipher. + + @param inKey the key to be used + + + Perform a left "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + Perform a right "spin" of the word. The rotation of the given + word x is rotated left by y bits. + Only the lg(wordSize) low-order bits of y + are used to determine the rotation amount. Here it is + assumed that the wordsize used is a power of 2. + + @param x word to rotate + @param y number of bits to rotate % wordSize + + + an implementation of the RFC 3211 Key Wrap + Specification. + + + an implementation of Rijndael, based on the documentation and reference implementation + by Paulo Barreto, Vincent Rijmen, for v2.0 August '99. +

    + Note: this implementation is based on information prior to readonly NIST publication. +

    +
    + + multiply two elements of GF(2^m) + needed for MixColumn and InvMixColumn + + + xor corresponding text input and round key input bytes + + + Row 0 remains unchanged + The other three rows are shifted a variable amount + + + Replace every byte of the input by the byte at that place + in the nonlinear S-box + + + Mix the bytes of every column in a linear way + + + Mix the bytes of every column in a linear way + This is the opposite operation of Mixcolumn + + + Calculate the necessary round keys + The number of calculations depends on keyBits and blockBits + + + default constructor - 128 bit block size. + + + basic constructor - set the cipher up for a given blocksize + + @param blocksize the blocksize in bits, must be 128, 192, or 256. + + + initialise a Rijndael cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + this does your basic RSA algorithm with blinding + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic RSA algorithm. + + @param inBuf the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @exception DataLengthException the input block is too large. + + + This does your basic RSA Chaum's blinding and unblinding as outlined in + "Handbook of Applied Cryptography", page 475. You need to use this if you are + trying to get another party to generate signatures without them being aware + of the message they are signing. + + + Initialise the blinding engine. + + @param forEncryption true if we are encrypting (blinding), false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the RSA blinding algorithm. + + @param in the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @throws DataLengthException the input block is too large. + + + this does your basic RSA algorithm. + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + this does your basic RSA algorithm. + + + initialise the RSA engine. + + @param forEncryption true if we are encrypting, false otherwise. + @param param the necessary RSA key parameters. + + + Return the maximum size for an input block to this engine. + For RSA this is always one byte less than the key size on + encryption, and the same length as the key size on decryption. + + @return maximum size for an input block. + + + Return the maximum size for an output block to this engine. + For RSA this is always one byte less than the key size on + decryption, and the same length as the key size on encryption. + + @return maximum size for an output block. + + + Process a single block using the basic RSA algorithm. + + @param inBuf the input array. + @param inOff the offset into the input buffer where the data starts. + @param inLen the length of the data to be processed. + @return the result of the RSA process. + @exception DataLengthException the input block is too large. + + + Implementation of the SEED algorithm as described in RFC 4009 + + + + An implementation of the SEED key wrapper based on RFC 4010/RFC 3394. +

    + For further details see: http://www.ietf.org/rfc/rfc4010.txt. + + + + * Serpent is a 128-bit 32-round block cipher with variable key lengths, + * including 128, 192 and 256 bit keys conjectured to be at least as + * secure as three-key triple-DES. + *

    + * Serpent was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + * candidate algorithm for the NIST AES Quest. + *

    + *

    + * For full details see The Serpent home page + *

    +
    + + initialise a Serpent cipher. + + @param encrypting whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @throws IllegalArgumentException if the params argument is + inappropriate. + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @return the number of bytes processed and produced. + @throws DataLengthException if there isn't enough data in in, or + space in out. + @throws IllegalStateException if the cipher isn't initialised. + + + InvSO - {13, 3,11, 0,10, 6, 5,12, 1,14, 4, 7,15, 9, 8, 2 } - 15 terms. + + + S1 - {15,12, 2, 7, 9, 0, 5,10, 1,11,14, 8, 6,13, 3, 4 } - 14 terms. + + + InvS1 - { 5, 8, 2,14,15, 6,12, 3,11, 4, 7, 9, 1,13,10, 0 } - 14 steps. + + + S2 - { 8, 6, 7, 9, 3,12,10,15,13, 1,14, 4, 0,11, 5, 2 } - 16 terms. + + + InvS2 - {12, 9,15, 4,11,14, 1, 2, 0, 3, 6,13, 5, 8,10, 7 } - 16 steps. + + + S3 - { 0,15,11, 8,12, 9, 6, 3,13, 1, 2, 4,10, 7, 5,14 } - 16 terms. + + + InvS3 - { 0, 9,10, 7,11,14, 6,13, 3, 5,12, 2, 4, 8,15, 1 } - 15 terms + + + S4 - { 1,15, 8, 3,12, 0,11, 6, 2, 5, 4,10, 9,14, 7,13 } - 15 terms. + + + InvS4 - { 5, 0, 8, 3,10, 9, 7,14, 2,12,11, 6, 4,15,13, 1 } - 15 terms. + + + S5 - {15, 5, 2,11, 4,10, 9,12, 0, 3,14, 8,13, 6, 7, 1 } - 16 terms. + + + InvS5 - { 8,15, 2, 9, 4, 1,13,14,11, 6, 5, 3, 7,12,10, 0 } - 16 terms. + + + S6 - { 7, 2,12, 5, 8, 4, 6,11,14, 9, 1,15,13, 3,10, 0 } - 15 terms. + + + InvS6 - {15,10, 1,13, 5, 3, 6, 0, 4, 9,14, 7, 2,12, 8,11 } - 15 terms. + + + S7 - { 1,13,15, 0,14, 8, 2,11, 7, 4,12,10, 9, 3, 5, 6 } - 16 terms. + + + InvS7 - { 3, 0, 6,13, 9,14,15, 8, 5,12,11, 7,10, 1, 4, 2 } - 17 terms. + + + Apply the linear transformation to the register set. + + + Apply the inverse of the linear transformation to the register set. + + + Expand a user-supplied key material into a session key. + + @param key The user-key bytes (multiples of 4) to use. + @exception ArgumentException + + + Encrypt one block of plaintext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + Decrypt one block of ciphertext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + a class that provides a basic SKIPJACK engine. + + + initialise a SKIPJACK cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + The G permutation + + + the inverse of the G permutation. + + + An TEA engine. + + + Create an instance of the TEA encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + + Implementation of the Threefish tweakable large block cipher in 256, 512 and 1024 bit block + sizes. + + + This is the 1.3 version of Threefish defined in the Skein hash function submission to the NIST + SHA-3 competition in October 2010. +

    + Threefish was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. +

    + This implementation inlines all round functions, unrolls 8 rounds, and uses 1.2k of static tables + to speed up key schedule injection.
    + 2 x block size state is retained by each cipher instance. + + + +

    + 256 bit block size - Threefish-256 + +
    + + + 512 bit block size - Threefish-512 + + + + + 1024 bit block size - Threefish-1024 + + + + Size of the tweak in bytes (always 128 bit/16 bytes) + + + Rounds in Threefish-256 + + + Rounds in Threefish-512 + + + Rounds in Threefish-1024 + + + Max rounds of any of the variants + + + Key schedule parity constant + + + Block size in bytes + + + Block size in 64 bit words + + + Buffer for byte oriented processBytes to call internal word API + + + Tweak bytes (2 byte t1,t2, calculated t3 and repeat of t1,t2 for modulo free lookup + + + Key schedule words + + + The internal cipher implementation (varies by blocksize) + + + + Constructs a new Threefish cipher, with a specified block size. + + the block size in bits, one of , , + . + + + + Initialise the engine. + + Initialise for encryption if true, for decryption if false. + an instance of or (to + use a 0 tweak) + + + + Initialise the engine, specifying the key and tweak directly. + + the cipher mode. + the words of the key, or null to use the current key. + the 2 word (128 bit) tweak, or null to use the current tweak. + + + + Process a block of data represented as 64 bit words. + + the number of 8 byte words processed (which will be the same as the block size). + a block sized buffer of words to process. + a block sized buffer of words to receive the output of the operation. + if either the input or output is not block sized + if this engine is not initialised + + + + Read a single 64 bit word from input in LSB first order. + + + + + Write a 64 bit word to output in LSB first order. + + + + Rotate left + xor part of the mix operation. + + + Rotate xor + rotate right part of the unmix operation. + + + The extended + repeated tweak words + + + The extended + repeated key words + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Mix rotation constants defined in Skein 1.3 specification + + + Tnepres is a 128-bit 32-round block cipher with variable key lengths, + including 128, 192 and 256 bit keys conjectured to be at least as + secure as three-key triple-DES. +

    + Tnepres is based on Serpent which was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + candidate algorithm for the NIST AES Quest. Unfortunately there was an endianness issue + with test vectors in the AES submission and the resulting confusion lead to the Tnepres cipher + as well, which is a byte swapped version of Serpent. +

    +

    + For full details see The Serpent home page +

    +
    + + Expand a user-supplied key material into a session key. + + @param key The user-key bytes (multiples of 4) to use. + @exception ArgumentException + + + Encrypt one block of plaintext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + Decrypt one block of ciphertext. + + @param input the array containing the input data. + @param inOff offset into the in array the data starts at. + @param output the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + + + A class that provides Twofish encryption operations. + + This Java implementation is based on the Java reference + implementation provided by Bruce Schneier and developed + by Raif S. Naffah. + + + Define the fixed p0/p1 permutations used in keyed S-box lookup. + By changing the following constant definitions, the S-boxes will + automatically Get changed in the Twofish engine. + + + gSubKeys[] and gSBox[] are eventually used in the + encryption and decryption methods. + + + initialise a Twofish cipher. + + @param forEncryption whether or not we are for encryption. + @param parameters the parameters required to set up the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + encryptBlock uses the pre-calculated gSBox[] and subKey[] + arrays. + + + Decrypt the given input starting at the given offset and place + the result in the provided buffer starting at the given offset. + The input will be an exact multiple of our blocksize. + + + Use (12, 8) Reed-Solomon code over GF(256) to produce + a key S-box 32-bit entity from 2 key material 32-bit + entities. + + @param k0 first 32-bit entity + @param k1 second 32-bit entity + @return Remainder polynomial Generated using RS code + + + * Reed-Solomon code parameters: (12,8) reversible code: + *

    + *

    +                    * G(x) = x^4 + (a+1/a)x^3 + ax^2 + (a+1/a)x + 1
    +                    * 
    + * where a = primitive root of field generator 0x14D + *

    +
    + + initialise a VMPC cipher. + + @param forEncryption + whether or not we are for encryption. + @param params + the parameters required to set up the cipher. + @exception ArgumentException + if the params argument is inappropriate. + + + + Implementation of Daniel J. Bernstein's XSalsa20 stream cipher - Salsa20 with an extended nonce. + + + XSalsa20 requires a 256 bit key, and a 192 bit nonce. + + + + + XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce + using a core Salsa20 function without input addition to produce 256 bit working key + and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state. + + + + An XTEA engine. + + + Create an instance of the TEA encryption algorithm + and set some defaults + + + initialise + + @param forEncryption whether or not we are for encryption. + @param params the parameters required to set up the cipher. + @exception ArgumentException if the params argument is + inappropriate. + + + Re-key the cipher. + + @param key the key to be used + + + Basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
    + This implementation is based on ISO 18033/P1363a. +
    + + Construct a KDF Parameters generator. + + @param counterStart value of counter. + @param digest the digest to be used as the source of derived keys. + + + fill len bytes of the output buffer with bytes generated from + the derivation function. + + @throws ArgumentException if the size of the request will cause an overflow. + @throws DataLengthException if the out buffer is too small. + + + return the underlying digest. + + + Core of password hashing scheme Bcrypt, + designed by Niels Provos and David Mazières, + corresponds to the C reference implementation. +

    + This implementation does not correspondent to the 1999 published paper + "A Future-Adaptable Password Scheme" of Niels Provos and David Mazières, + see: https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node1.html. + In contrast to the paper, the order of key setup and salt setup is reversed: + state <- ExpandKey(state, 0, key) + state %lt;- ExpandKey(state, 0, salt) + This corresponds to the OpenBSD reference implementation of Bcrypt. +

    + Note: + There is no successful cryptanalysis (status 2015), but + the amount of memory and the band width of Bcrypt + may be insufficient to effectively prevent attacks + with custom hardware like FPGAs, ASICs +

    + This implementation uses some parts of Bouncy Castle's BlowfishEngine. +

    +
    + + Size of the salt parameter in bytes + + + Minimum value of cost parameter, equal to log2(bytes of salt) + + + Maximum value of cost parameter (31 == 2,147,483,648) + + + Maximum size of password == max (unrestricted) size of Blowfish key + + + Derives a raw 192 bit Bcrypt key + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param psw the password + @return a 192 bit key + + + Calculates the bcrypt hash of a password. +

    + This implements the raw bcrypt function as defined in the bcrypt specification, not + the crypt encoded version implemented in OpenBSD. +

    + @param password the password bytes (up to 72 bytes) to use for this invocation. + @param salt the 128 bit salt to use for this invocation. + @param cost the bcrypt cost parameter. The cost of the bcrypt function grows as + 2^cost. Legal values are 4..31 inclusive. + @return the output of the raw bcrypt operation: a 192 bit (24 byte) hash. +
    + + initialise the key generator - if strength is set to zero + the key generated will be 64 bits in size, otherwise + strength can be 64 or 56 bits (if you don't count the parity bits). + + @param param the parameters to be used for key generation + + + initialise the key generator - if strength is set to zero + the key Generated will be 192 bits in size, otherwise + strength can be 128 or 192 (or 112 or 168 if you don't count + parity bits), depending on whether you wish to do 2-key or 3-key + triple DES. + + @param param the parameters to be used for key generation + + + a basic Diffie-Hellman key pair generator. + + This generates keys consistent for use with the basic algorithm for + Diffie-Hellman. + + + interface that a public/private key pair generator should conform to. + + + intialise the key pair generator. + + @param the parameters the key pair is to be initialised with. + + + return an AsymmetricCipherKeyPair containing the Generated keys. + + @return an AsymmetricCipherKeyPair containing the Generated keys. + + + a Diffie-Hellman key pair generator. + + This generates keys consistent for use in the MTI/A0 key agreement protocol + as described in "Handbook of Applied Cryptography", Pages 516-519. + + + which Generates the p and g values from the given parameters, + returning the DHParameters object. +

    + Note: can take a while...

    +
    + + a DSA key pair generator. + + This Generates DSA keys in line with the method described + in FIPS 186-3 B.1 FFC Key Pair Generation. + + + Generate suitable parameters for DSA, in line with FIPS 186-2, or FIPS 186-3. + + + Initialise the generator + This form can only be used for older DSA (pre-DSA2) parameters + the size of keys in bits (from 512 up to 1024, and a multiple of 64) + measure of robustness of primes (at least 80 for FIPS 186-2 compliance) + the source of randomness to use + + + Initialise the generator for DSA 2 + You must use this Init method if you need to generate parameters for DSA 2 keys + An instance of DsaParameterGenerationParameters used to configure this generator + + + Generates a set of DsaParameters + Can take a while... + + + generate suitable parameters for DSA, in line with + FIPS 186-3 A.1 Generation of the FFC Primes p and q. + + + Given the domain parameters this routine generates an EC key + pair in accordance with X9.62 section 5.2.1 pages 26, 27. + + + a ElGamal key pair generator. +

    + This Generates keys consistent for use with ElGamal as described in + page 164 of "Handbook of Applied Cryptography".

    +
    + + * which Generates the p and g values from the given parameters, + * returning the ElGamalParameters object. + *

    + * Note: can take a while... + *

    +
    + + a GOST3410 key pair generator. + This generates GOST3410 keys in line with the method described + in GOST R 34.10-94. + + + generate suitable parameters for GOST3410. + + + initialise the key generator. + + @param size size of the key + @param typeProcedure type procedure A,B = 1; A',B' - else + @param random random byte source. + + + Procedure C + procedure generates the a value from the given p,q, + returning the a value. + + + which generates the p , q and a values from the given parameters, + returning the Gost3410Parameters object. + + + HMAC-based Extract-and-Expand Key Derivation Function (HKDF) implemented + according to IETF RFC 5869, May 2010 as specified by H. Krawczyk, IBM + Research & P. Eronen, Nokia. It uses a HMac internally to compute de OKM + (output keying material) and is likely to have better security properties + than KDF's based on just a hash function. + + + Creates a HKDFBytesGenerator based on the given hash function. + + @param hash the digest to be used as the source of generatedBytes bytes + + + Performs the extract part of the key derivation function. + + @param salt the salt to use + @param ikm the input keying material + @return the PRK as KeyParameter + + + Performs the expand part of the key derivation function, using currentT + as input and output buffer. + + @throws DataLengthException if the total number of bytes generated is larger than the one + specified by RFC 5869 (255 * HashLen) + + + KFD2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
    + This implementation is based on IEEE P1363/ISO 18033. +
    + + Construct a KDF1 byte generator. + + @param digest the digest to be used as the source of derived keys. + + + KDF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 +
    + This implementation is based on IEEE P1363/ISO 18033. +
    + + Construct a KDF2 bytes generator. Generates key material + according to IEEE P1363 or ISO 18033 depending on the initialisation. + + @param digest the digest to be used as the source of derived keys. + + + Generator for MGF1 as defined in Pkcs 1v2 + + + @param digest the digest to be used as the source of Generated bytes + + + int to octet string. + + + fill len bytes of the output buffer with bytes Generated from + the derivation function. + + @throws DataLengthException if the out buffer is too small. + + + return the underlying digest. + + + Key generation parameters for NaccacheStern cipher. For details on this cipher, please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Generates a permuted ArrayList from the original one. The original List + is not modified + + @param arr + the ArrayList to be permuted + @param rand + the source of Randomness for permutation + @return a new IList with the permuted elements. + + + Finds the first 'count' primes starting with 3 + + @param count + the number of primes to find + @return a vector containing the found primes as Integer + + + Password hashing scheme BCrypt, + designed by Niels Provos and David Mazières, using the + String format and the Base64 encoding + of the reference implementation on OpenBSD + + + Creates a 60 character Bcrypt String, including + version, cost factor, salt and hash, separated by '$' + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param password the password + @return a 60 character Bcrypt String + + + Creates a 60 character Bcrypt String, including + version, cost factor, salt and hash, separated by '$' + + @param cost the cost factor, treated as an exponent of 2 + @param salt a 16 byte salt + @param password the password + @return a 60 character Bcrypt String + + + Checks if a password corresponds to a 60 character Bcrypt String + + @param bcryptString a 60 character Bcrypt String, including + version, cost factor, salt and hash, + separated by '$' + @param password the password as an array of chars + @return true if the password corresponds to the + Bcrypt String, otherwise false + + + Generator for PBE derived keys and ivs as usd by OpenSSL. +

    + The scheme is a simple extension of PKCS 5 V2.0 Scheme 1 using MD5 with an + iteration count of 1. +

    +
    + + super class for all Password Based Encyrption (Pbe) parameter generator classes. + + + base constructor. + + + initialise the Pbe generator. + + @param password the password converted into bytes (see below). + @param salt the salt to be mixed with the password. + @param iterationCount the number of iterations the "mixing" function + is to be applied for. + + + return the password byte array. + + @return the password byte array. + + + return the salt byte array. + + @return the salt byte array. + + + Generate derived parameters for a key of length keySize. + + @param keySize the length, in bits, of the key required. + @return a parameters object representing a key. + + + Generate derived parameters for a key of length keySize, and + an initialisation vector (IV) of length ivSize. + + @param keySize the length, in bits, of the key required. + @param ivSize the length, in bits, of the iv required. + @return a parameters object representing a key and an IV. + + + Generate derived parameters for a key of length keySize, specifically + for use with a MAC. + + @param keySize the length, in bits, of the key required. + @return a parameters object representing a key. + + + converts a password to a byte array according to the scheme in + Pkcs5 (ascii, no padding) + + @param password a character array representing the password. + @return a byte array representing the password. + + + converts a password to a byte array according to the scheme in + PKCS5 (UTF-8, no padding) + + @param password a character array representing the password. + @return a byte array representing the password. + + + converts a password to a byte array according to the scheme in + Pkcs12 (unicode, big endian, 2 zero pad bytes at the end). + + @param password a character array representing the password. + @return a byte array representing the password. + + + return the iteration count. + + @return the iteration count. + + + Construct a OpenSSL Parameters generator. + + + Initialise - note the iteration count for this algorithm is fixed at 1. + + @param password password to use. + @param salt salt to use. + + + the derived key function, the ith hash of the password and the salt. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + @exception ArgumentException if keySize + ivSize is larger than the base hash size. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 12 V1.0. +

    + The document this implementation is based on can be found at + + RSA's Pkcs12 Page +

    +
    + + Construct a Pkcs 12 Parameters generator. + + @param digest the digest to be used as the source of derived keys. + @exception ArgumentException if an unknown digest is passed in. + + + add a + b + 1, returning the result in a. The a value is treated + as a BigInteger of length (b.Length * 8) bits. The result is + modulo 2^b.Length in case of overflow. + + + generation of a derived key ala Pkcs12 V1.0. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 1. + Note this generator is limited to the size of the hash produced by the + digest used to drive it. +

    + The document this implementation is based on can be found at + + RSA's Pkcs5 Page +

    +
    + + Construct a Pkcs 5 Scheme 1 Parameters generator. + + @param digest the digest to be used as the source of derived keys. + + + the derived key function, the ith hash of the mPassword and the mSalt. + + + Generate a key parameter derived from the mPassword, mSalt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generate a key with initialisation vector parameter derived from + the mPassword, mSalt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + @exception ArgumentException if keySize + ivSize is larger than the base hash size. + + + Generate a key parameter for use with a MAC derived from the mPassword, + mSalt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + @exception ArgumentException if the key length larger than the base hash size. + + + Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 2. + This generator uses a SHA-1 HMac as the calculation function. +

    + The document this implementation is based on can be found at + + RSA's Pkcs5 Page

    +
    + + construct a Pkcs5 Scheme 2 Parameters generator. + + + Generate a key parameter derived from the password, salt, and iteration + count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + Generate a key with initialisation vector parameter derived from + the password, salt, and iteration count we are currently initialised + with. + + @param keySize the size of the key we want (in bits) + @param ivSize the size of the iv we want (in bits) + @return a ParametersWithIV object. + + + Generate a key parameter for use with a MAC derived from the password, + salt, and iteration count we are currently initialised with. + + @param keySize the size of the key we want (in bits) + @return a KeyParameter object. + + + + Generates keys for the Poly1305 MAC. + + + Poly1305 keys are 256 bit keys consisting of a 128 bit secret key used for the underlying block + cipher followed by a 128 bit {@code r} value used for the polynomial portion of the Mac.
    + The {@code r} value has a specific format with some bits required to be cleared, resulting in an + effective 106 bit key.
    + A separately generated 256 bit key can be modified to fit the Poly1305 key format by using the + {@link #clamp(byte[])} method to clear the required bits. +
    + +
    + + + Initialises the key generator. + + + Poly1305 keys are always 256 bits, so the key length in the provided parameters is ignored. + + + + + Generates a 256 bit key in the format required for Poly1305 - e.g. + k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + as per . + + + + + Modifies an existing 32 byte key value to comply with the requirements of the Poly1305 key by + clearing required bits in the r (second 16 bytes) portion of the key.
    + Specifically: +
      +
    • r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15})
    • +
    • r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252})
    • +
    +
    + a 32 byte key value k[0] ... k[15], r[0] ... r[15] +
    + + + Checks a 32 byte key for compliance with the Poly1305 key requirements, e.g. + k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + as per . + + Key. + if the key is of the wrong length, or has invalid bits set + in the r portion of the key. + + + Generate a random factor suitable for use with RSA blind signatures + as outlined in Chaum's blinding and unblinding as outlined in + "Handbook of Applied Cryptography", page 475. + + + Initialise the factor generator + + @param param the necessary RSA key parameters. + + + Generate a suitable blind factor for the public key the generator was initialised with. + + @return a random blind factor + + + an RSA key pair generator. + + + Choose a random prime value for use with RSA + the bit-length of the returned prime + the RSA public exponent + a prime p, with (p-1) relatively prime to e + + + + Operators that reduce their input to a single block return an object + of this type. + + + + + Return the final result of the operation. + + A block of bytes, representing the result of an operation. + + + + Store the final result of the operation by copying it into the destination array. + + The number of bytes copied into destination. + The byte array to copy the result into. + The offset into destination to start copying the result at. + + + interface for classes implementing the Digital Signature Algorithm + + + initialise the signer for signature generation or signature + verification. + + @param forSigning true if we are generating a signature, false + otherwise. + @param param key parameters for signature generation. + + + sign the passed in message (usually the output of a hash function). + + @param message the message to be signed. + @return two big integers representing the r and s values respectively. + + + verify the message message against the signature values r and s. + + @param message the message that was supposed to have been signed. + @param r the r signature value. + @param s the s signature value. + + + + Base interface describing an entropy source for a DRBG. + + + + + Return a byte array of entropy. + + The entropy bytes. + + + + Return whether or not this entropy source is regarded as prediction resistant. + + true if this instance is prediction resistant; otherwise, false. + + + + Return the number of bits of entropy this source can produce. + + The size, in bits, of the return value of getEntropy. + + + + Base interface describing a provider of entropy sources. + + + + + Return an entropy source providing a block of entropy. + + The size of the block of entropy required. + An entropy source providing bitsRequired blocks of entropy. + + + The base interface for implementations of message authentication codes (MACs). + + + Initialise the MAC. + + @param param the key and other data required by the MAC. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Return the block size for this MAC (in bytes). + + @return the block size for this MAC in bytes. + + + add a single byte to the mac for processing. + + @param in the byte to be processed. + @exception InvalidOperationException if the MAC is not initialised. + + + @param in the array containing the input. + @param inOff the index in the array the data begins at. + @param len the length of the input starting at inOff. + @exception InvalidOperationException if the MAC is not initialised. + @exception DataLengthException if there isn't enough data in in. + + + Compute the final stage of the MAC writing the output to the out + parameter. +

    + doFinal leaves the MAC in the same state it was after the last init. +

    + @param out the array the MAC is to be output to. + @param outOff the offset into the out buffer the output is to start at. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the MAC is not initialised. +
    + + Reset the MAC. At the end of resetting the MAC should be in the + in the same state it was after the last init (if there was one). + + + Return the name of the algorithm the MAC implements. + + @return the name of the algorithm the MAC implements. + + + this exception is thrown whenever we find something we don't expect in a + message. + + + base constructor. + + + create a InvalidCipherTextException with the given message. + + @param message the message to be carried with the exception. + + + + Base interface for operators that serve as stream-based signature calculators. + + + + + Create a stream calculator for this signature calculator. The stream + calculator is used for the actual operation of entering the data to be signed + and producing the signature block. + + A calculator producing an IBlockResult with a signature in it. + + + The algorithm details object for this calculator. + + + Initialise the signer for signing or verification. + + @param forSigning true if for signing, false otherwise + @param param necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + return true if the internal state represents the signature described + in the passed in array. + + + reset the internal state + + + Return the name of the algorithm the signer implements. + + @return the name of the algorithm the signer implements. + + + Signer with message recovery. + + + Returns true if the signer has recovered the full message as + part of signature verification. + + @return true if full message recovered. + + + Returns a reference to what message was recovered (if any). + + @return full/partial message, null if nothing. + + + Perform an update with the recovered message before adding any other data. This must + be the first update method called, and calling it will result in the signer assuming + that further calls to update will include message content past what is recoverable. + + @param signature the signature that we are in the process of verifying. + @throws IllegalStateException + + + + Base interface for cryptographic operations such as Hashes, MACs, and Signatures which reduce a stream of data + to a single value. + + + + + Return the result of processing the stream. This value is only available once the stream + has been closed. + + The result of processing the stream. + + + Return a "sink" stream which only exists to update the implementing object. + A stream to write to in order to update the implementing object. + + + + Operators that reduce their input to the validation of a signature produce this type. + + + + + Return true if the passed in data matches what is expected by the verification result. + + The bytes representing the signature. + true if the signature verifies, false otherwise. + + + + Return true if the length bytes from off in the source array match the signature + expected by the verification result. + + Byte array containing the signature. + The offset into the source array where the signature starts. + The number of bytes in source making up the signature. + true if the signature verifies, false otherwise. + + + + Base interface for operators that serve as stream-based signature verifiers. + + + + + Create a stream calculator for this verifier. The stream + calculator is used for the actual operation of entering the data to be verified + and producing a result which can be used to verify the original signature. + + A calculator producing an IVerifier which can verify the signature. + + + The algorithm details object for this verifier. + + + + Base interface for a provider to support the dynamic creation of signature verifiers. + + + + + Return a signature verfier for signature algorithm described in the passed in algorithm details object. + + The details of the signature algorithm verification is required for. + A new signature verifier. + + + The base class for parameters to key generators. + + + initialise the generator with a source of randomness + and a strength (in bits). + + @param random the random byte source. + @param strength the size, in bits, of the keys we want to produce. + + + return the random source associated with this + generator. + + @return the generators random source. + + + return the bit strength for keys produced by this generator, + + @return the strength of the keys this generator produces (in bits). + + + standard CBC Block Cipher MAC - if no padding is specified the default of + pad of zeroes is used. + + + create a standard MAC based on a CBC block cipher. This will produce an + authentication code half the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a CBC block cipher. This will produce an + authentication code half the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used to complete the last block. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CBC mode as the basis for the + MAC generation. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
    + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CBC mode as the basis for the + MAC generation. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding the padding to be used to complete the last block. +
    + + Reset the mac generator. + + + implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CFB" + and the block size in bits. + + + create a standard MAC based on a CFB block cipher. This will produce an + authentication code half the length of the block size of the cipher, with + the CFB mode set to 8 bits. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a CFB block cipher. This will produce an + authentication code half the length of the block size of the cipher, with + the CFB mode set to 8 bits. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CFB mode as the basis for the + MAC generation. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param cfbBitSize the size of an output block produced by the CFB mode. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
    + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses CFB mode as the basis for the + MAC generation. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param cfbBitSize the size of an output block produced by the CFB mode. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding a padding to be used. +
    + + Reset the mac generator. + + + CMAC - as specified at www.nuee.nagoya-u.ac.jp/labs/tiwata/omac/omac.html +

    + CMAC is analogous to OMAC1 - see also en.wikipedia.org/wiki/CMAC +

    + CMAC is a NIST recomendation - see + csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38B.pdf +

    + CMAC/OMAC1 is a blockcipher-based message authentication code designed and + analyzed by Tetsu Iwata and Kaoru Kurosawa. +

    + CMAC/OMAC1 is a simple variant of the CBC MAC (Cipher Block Chaining Message + Authentication Code). OMAC stands for One-Key CBC MAC. +

    + It supports 128- or 64-bits block ciphers, with any key size, and returns + a MAC with dimension less or equal to the block size of the underlying + cipher. +

    +
    + + create a standard MAC based on a CBC block cipher (64 or 128 bit block). + This will produce an authentication code the length of the block size + of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). + + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8 and @lt;= 128. + + + Reset the mac generator. + + +

    + The GMAC specialisation of Galois/Counter mode (GCM) detailed in NIST Special Publication + 800-38D. + + + GMac is an invocation of the GCM mode where no data is encrypted (i.e. all input data to the Mac + is processed as additional authenticated data with the underlying GCM block cipher). + +
    + + + Creates a GMAC based on the operation of a block cipher in GCM mode. + + + This will produce an authentication code the length of the block size of the cipher. + + the cipher to be used in GCM mode to generate the MAC. + + + + Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode. + + + This will produce an authentication code the length of the block size of the cipher. + + the cipher to be used in GCM mode to generate the MAC. + the mac size to generate, in bits. Must be a multiple of 8, between 32 and 128 (inclusive). + Sizes less than 96 are not recommended, but are supported for specialized applications. + + + + Initialises the GMAC - requires a + providing a and a nonce. + + + + implementation of GOST 28147-89 MAC + + + HMAC implementation based on RFC2104 + + H(K XOR opad, H(K XOR ipad, text)) + + + Reset the mac generator. + + + DES based CBC Block Cipher MAC according to ISO9797, algorithm 3 (ANSI X9.19 Retail MAC) + + This could as well be derived from CBCBlockCipherMac, but then the property mac in the base + class must be changed to protected + + + create a Retail-MAC based on a CBC block cipher. This will produce an + authentication code of the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. This must + be DESEngine. + + + create a Retail-MAC based on a CBC block cipher. This will produce an + authentication code of the length of the block size of the cipher. + + @param cipher the cipher to be used as the basis of the MAC generation. + @param padding the padding to be used to complete the last block. + + + create a Retail-MAC based on a block cipher with the size of the + MAC been given in bits. This class uses single DES CBC mode as the basis for the + MAC generation. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. +
    + + create a standard MAC based on a block cipher with the size of the + MAC been given in bits. This class uses single DES CBC mode as the basis for the + MAC generation. The final block is decrypted and then encrypted using the + middle and right part of the key. +

    + Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + or 16 bits if being used as a data authenticator (FIPS Publication 113), + and in general should be less than the size of the block cipher as it reduces + the chance of an exhaustive attack (see Handbook of Applied Cryptography). +

    + @param cipher the cipher to be used as the basis of the MAC generation. + @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + @param padding the padding to be used to complete the last block. +
    + + Reset the mac generator. + + + + Poly1305 message authentication code, designed by D. J. Bernstein. + + + Poly1305 computes a 128-bit (16 bytes) authenticator, using a 128 bit nonce and a 256 bit key + consisting of a 128 bit key applied to an underlying cipher, and a 128 bit key (with 106 + effective key bits) used in the authenticator. + + The polynomial calculation in this implementation is adapted from the public domain poly1305-donna-unrolled C implementation + by Andrew M (@floodyberry). + + + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Polynomial key + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Precomputed 5 * r[1..4] + + + Encrypted nonce + + + Encrypted nonce + + + Encrypted nonce + + + Encrypted nonce + + + Current block of buffered input + + + Current offset in input buffer + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Polynomial accumulator + + + Constructs a Poly1305 MAC, where the key passed to init() will be used directly. + + + Constructs a Poly1305 MAC, using a 128 bit block cipher. + + + + Initialises the Poly1305 MAC. + + a {@link ParametersWithIV} containing a 128 bit nonce and a {@link KeyParameter} with + a 256 bit key complying to the {@link Poly1305KeyGenerator Poly1305 key format}. + + + + Implementation of SipHash as specified in "SipHash: a fast short-input PRF", by Jean-Philippe + Aumasson and Daniel J. Bernstein (https://131002.net/siphash/siphash.pdf). + + + "SipHash is a family of PRFs SipHash-c-d where the integer parameters c and d are the number of + compression rounds and the number of finalization rounds. A compression round is identical to a + finalization round and this round function is called SipRound. Given a 128-bit key k and a + (possibly empty) byte string m, SipHash-c-d returns a 64-bit value..." + + + + SipHash-2-4 + + + SipHash-c-d + the number of compression rounds + the number of finalization rounds + + + + Implementation of the Skein parameterised MAC function in 256, 512 and 1024 bit block sizes, + based on the Threefish tweakable block cipher. + + + This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + competition in October 2010. +

    + Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + + + + + +

    + 256 bit block size - Skein-256 + +
    + + + 512 bit block size - Skein-512 + + + + + 1024 bit block size - Skein-1024 + + + + + Constructs a Skein MAC with an internal state size and output size. + + the internal state size in bits - one of or + . + the output/MAC size to produce in bits, which must be an integral number of + bytes. + + + + Optionally initialises the Skein digest with the provided parameters. + + See for details on the parameterisation of the Skein hash function. + the parameters to apply to this engine, or null to use no parameters. + + + + This exception is thrown whenever a cipher requires a change of key, iv + or similar after x amount of bytes enciphered + + + + implements Cipher-Block-Chaining (CBC) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of chaining. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size of the underlying cipher. + + @return the block size of the underlying cipher. + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + Do the appropriate chaining step for CBC mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate chaining step for CBC mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the decrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CBC". + + + Implements the Counter with Cipher Block Chaining mode (CCM) detailed in + NIST Special Publication 800-38C. +

    + Note: this mode is a packet mode - it needs all the data up front. +

    +
    + + + A block cipher mode that includes authenticated encryption with a streaming mode + and optional associated data. + + + + The block cipher underlying this algorithm. + + + Initialise the cipher. + Parameter can either be an AeadParameters or a ParametersWithIV object. + Initialise for encryption if true, for decryption if false. + The key or other data required by the cipher. + + + The block size for this cipher, in bytes. + + + Add a single byte to the associated data check. + If the implementation supports it, this will be an online operation and will not retain the associated data. + The byte to be processed. + + + Add a sequence of bytes to the associated data check. + If the implementation supports it, this will be an online operation and will not retain the associated data. + The input byte array. + The offset into the input array where the data to be processed starts. + The number of bytes to be processed. + + + Encrypt/decrypt a single byte. + + @param input the byte to be processed. + @param outBytes the output buffer the processed byte goes into. + @param outOff the offset into the output byte array the processed data starts at. + @return the number of bytes written to out. + @exception DataLengthException if the output buffer is too small. + + + Process a block of bytes from in putting the result into out. + + @param inBytes the input byte array. + @param inOff the offset into the in array where the data to be processed starts. + @param len the number of bytes to be processed. + @param outBytes the output buffer the processed bytes go into. + @param outOff the offset into the output byte array the processed data starts at. + @return the number of bytes written to out. + @exception DataLengthException if the output buffer is too small. + + + Finish the operation either appending or verifying the MAC at the end of the data. + + @param outBytes space for any resulting output data. + @param outOff offset into out to start copying the data at. + @return number of bytes written into out. + @throws InvalidOperationException if the cipher is in an inappropriate state. + @throws InvalidCipherTextException if the MAC fails to match. + + + Return the value of the MAC associated with the last stream processed. + + @return MAC for plaintext data. + + + Return the size of the output buffer required for a ProcessBytes + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to ProcessBytes + with len bytes of input. + + + Return the size of the output buffer required for a ProcessBytes plus a + DoFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to ProcessBytes and DoFinal + with len bytes of input. + + + + Reset the cipher to the same state as it was after the last init (if there was one). + + + + The name of the algorithm this cipher implements. + + + Basic constructor. + + @param cipher the block cipher to be used. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Returns a byte array containing the mac calculated as part of the + last encrypt or decrypt operation. + + @return the last mac calculated. + + + Process a packet of data for either CCM decryption or encryption. + + @param in data for processing. + @param inOff offset at which data starts in the input array. + @param inLen length of the data in the input array. + @return a byte array containing the processed input.. + @throws IllegalStateException if the cipher is not appropriately set up. + @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + + + Process a packet of data for either CCM decryption or encryption. + + @param in data for processing. + @param inOff offset at which data starts in the input array. + @param inLen length of the data in the input array. + @param output output array. + @param outOff offset into output array to start putting processed bytes. + @return the number of bytes added to output. + @throws IllegalStateException if the cipher is not appropriately set up. + @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + @throws DataLengthException if output buffer too short. + + + implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/CFB" + and the block size in bits. + + + A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to + be used to produce cipher text which is the same outLength as the plain text. + + + Create a buffered block cipher that uses Cipher Text Stealing + + @param cipher the underlying block cipher this buffering object wraps. + + + return the size of the output buffer required for an update of 'length' bytes. + + @param length the outLength of the input. + @return the space required to accommodate a call to update + with length bytes of input. + + + return the size of the output buffer required for an update plus a + doFinal with an input of length bytes. + + @param length the outLength of the input. + @return the space required to accommodate a call to update and doFinal + with length bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param length the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if cipher text decrypts wrongly (in + case the exception will never Get thrown). + + + A Two-Pass Authenticated-Encryption Scheme Optimized for Simplicity and + Efficiency - by M. Bellare, P. Rogaway, D. Wagner. + + http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf + + EAX is an AEAD scheme based on CTR and OMAC1/CMAC, that uses a single block + cipher to encrypt and authenticate data. It's on-line (the length of a + message isn't needed to begin processing it), has good performances, it's + simple and provably secure (provided the underlying block cipher is secure). + + Of course, this implementations is NOT thread-safe. + + + Constructor that accepts an instance of a block cipher engine. + + @param cipher the engine to use + + + + Implements the Galois/Counter mode (GCM) detailed in + NIST Special Publication 800-38D. + + + + + MAC sizes from 32 bits to 128 bits (must be a multiple of 8) are supported. The default is 128 bits. + Sizes less than 96 are not recommended, but are supported for specialized applications. + + + + implements the GOST 28147 OFB counter mode (GCTR). + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + counter mode (must have a 64 bit block size). + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param encrypting if true the cipher is initialised for + encryption, if false for decryption. + @param parameters the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is inappropriate. + + + return the block size we are operating at (in bytes). + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the feedback vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/GCTR" + and the block size in bits + + + An implementation of RFC 7253 on The OCB + Authenticated-Encryption Algorithm, licensed per: + +

    License for + Open-Source Software Implementations of OCB (Jan 9, 2013) - 'License 1'
    + Under this license, you are authorized to make, use, and distribute open-source software + implementations of OCB. This license terminates for you if you sue someone over their open-source + software implementation of OCB claiming that you have a patent covering their implementation. +

    + This is a non-binding summary of a legal document (the link above). The parameters of the license + are specified in the license document and that document is controlling.

    +
    + + implements a Output-FeedBack (OFB) mode on top of a simple cipher. + + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + @param blockSize the block size in bits (note: a multiple of 8) + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the block size we are operating at (in bytes). + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the feedback vector back to the IV and reset the underlying + cipher. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/OFB" + and the block size in bits + + + * Implements OpenPGP's rather strange version of Cipher-FeedBack (CFB) mode + * on top of a simple cipher. This class assumes the IV has been prepended + * to the data stream already, and just accomodates the reset after + * (blockSize + 2) bytes have been read. + *

    + * For further info see RFC 2440. + *

    +
    + + Basic constructor. + + @param cipher the block cipher to be used as the basis of the + feedback mode. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + return the block size we are operating at. + + @return the block size we are operating at (in bytes). + + + Process one block of input from the array in and write it to + the out array. + + @param in the array containing the input data. + @param inOff offset into the in array the data starts at. + @param out the array the output data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + reset the chaining vector back to the IV and reset the underlying + cipher. + + + Initialise the cipher and, possibly, the initialisation vector (IV). + If an IV isn't passed as part of the parameter, the IV will be all zeros. + An IV which is too short is handled in FIPS compliant fashion. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param parameters the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + Encrypt one byte of data according to CFB mode. + @param data the byte to encrypt + @param blockOff offset in the current block + @returns the encrypted byte + + + Do the appropriate processing for CFB IV mode encryption. + + @param in the array containing the data to be encrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + Do the appropriate processing for CFB IV mode decryption. + + @param in the array containing the data to be decrypted. + @param inOff offset into the in array the data starts at. + @param out the array the encrypted data will be copied into. + @param outOff the offset into the out array the output will start at. + @exception DataLengthException if there isn't enough data in in, or + space in out. + @exception InvalidOperationException if the cipher isn't initialised. + @return the number of bytes processed and produced. + + + return the algorithm name and mode. + + @return the name of the underlying algorithm followed by "/PGPCFB" + and the block size in bits. + + + Implements the Segmented Integer Counter (SIC) mode on top of a simple + block cipher. + + + Basic constructor. + + @param c the block cipher to be used. + + + return the underlying block cipher that we are wrapping. + + @return the underlying block cipher that we are wrapping. + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Calculator factory class for signature generation in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + signature algorithm details. + + + + + Base constructor. + + The name of the signature algorithm to use. + The private key to be used in the signing operation. + + + + Constructor which also specifies a source of randomness to be used if one is required. + + The name of the signature algorithm to use. + The private key to be used in the signing operation. + The source of randomness to be used in signature calculation. + + + + Allows enumeration of the signature names supported by the verifier provider. + + + + + Verifier class for signature verification in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + signature algorithm details. + + + + + Base constructor. + + The name of the signature algorithm to use. + The public key to be used in the verification operation. + + + + Provider class which supports dynamic creation of signature verifiers. + + + + + Base constructor - specify the public key to be used in verification. + + The public key to be used in creating verifiers provided by this object. + + + + Allows enumeration of the signature names supported by the verifier provider. + + + + Block cipher padders are expected to conform to this interface + + + Initialise the padder. + + @param param parameters, if any required. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + @exception InvalidCipherTextException if the padding is badly formed + or invalid. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds ISO10126-2 padding to a block. + + + Initialise the padder. + + @param random a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds the padding according to the scheme referenced in + ISO 7814-4 - scheme 2 from ISO 9797-1. The first byte is 0x80, rest is 0x00 + + + Initialise the padder. + + @param random - a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the padder implements. + + @return the name of the algorithm the padder implements. + + + A wrapper class that allows block ciphers to be used to process data in + a piecemeal fashion with padding. The PaddedBufferedBlockCipher + outputs a block only when the buffer is full and more data is being added, + or on a doFinal (unless the current block in the buffer is a pad block). + The default padding mechanism used is the one outlined in Pkcs5/Pkcs7. + + + Create a buffered block cipher with the desired padding. + + @param cipher the underlying block cipher this buffering object wraps. + @param padding the padding type. + + + Create a buffered block cipher Pkcs7 padding + + @param cipher the underlying block cipher this buffering object wraps. + + + initialise the cipher. + + @param forEncryption if true the cipher is initialised for + encryption, if false for decryption. + @param param the key and other data required by the cipher. + @exception ArgumentException if the parameters argument is + inappropriate. + + + return the minimum size of the output buffer required for an update + plus a doFinal with an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update and doFinal + with len bytes of input. + + + return the size of the output buffer required for an update + an input of len bytes. + + @param len the length of the input. + @return the space required to accommodate a call to update + with len bytes of input. + + + process a single byte, producing an output block if necessary. + + @param in the input byte. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + process an array of bytes, producing output if necessary. + + @param in the input byte array. + @param inOff the offset at which the input data starts. + @param len the number of bytes to be copied out of the input array. + @param out the space for any output that might be produced. + @param outOff the offset from which the output will be copied. + @return the number of output bytes copied to out. + @exception DataLengthException if there isn't enough space in out. + @exception InvalidOperationException if the cipher isn't initialised. + + + Process the last block in the buffer. If the buffer is currently + full and padding needs to be added a call to doFinal will produce + 2 * GetBlockSize() bytes. + + @param out the array the block currently being held is copied into. + @param outOff the offset at which the copying starts. + @return the number of output bytes copied to out. + @exception DataLengthException if there is insufficient space in out for + the output or we are decrypting and the input is not block size aligned. + @exception InvalidOperationException if the underlying cipher is not + initialised. + @exception InvalidCipherTextException if padding is expected and not found. + + + A padder that adds Pkcs7/Pkcs5 padding to a block. + + + Initialise the padder. + + @param random - a SecureRandom if available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds Trailing-Bit-Compliment padding to a block. +

    + This padding pads the block out compliment of the last bit + of the plain text. +

    +
    +
    + + Initialise the padder. + - a SecureRandom if available. + + + + add the pad bytes to the passed in block, returning the + number of bytes added. +

    + Note: this assumes that the last block of plain text is always + passed to it inside in. i.e. if inOff is zero, indicating the + entire block is to be overwritten with padding the value of in + should be the same as the last block of plain text. +

    +
    +
    + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + the name of the algorithm the cipher implements. + + + + A padder that adds X9.23 padding to a block - if a SecureRandom is + passed in random padding is assumed, otherwise padding with zeros is used. + + + Initialise the padder. + + @param random a SecureRandom if one is available. + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + @return the name of the algorithm the cipher implements. + + + A padder that adds Null byte padding to a block. + + + Initialise the padder. + + + - a SecureRandom if available. + + + + add the pad bytes to the passed in block, returning the + number of bytes added. + + + + return the number of pad bytes present in the block. + + + Return the name of the algorithm the cipher implements. + + + the name of the algorithm the cipher implements. + + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + @param associatedText associated text, if any + + + Base constructor. + + @param key key to be used by underlying cipher + @param macSize macSize in bits + @param nonce nonce to be used + @param associatedText associated text, if any + + + DES has 16 weak keys. This method will check + if the given DES key material is weak or semi-weak. + Key material that is too short is regarded as weak. +

    + See "Applied + Cryptography" by Bruce Schneier for more information. +

    + @return true if the given DES key material is weak or semi-weak, + false otherwise. +
    + + DES Keys use the LSB as the odd parity bit. This can + be used to check for corrupt keys. + + @param bytes the byte array to set the parity on. + + + return true if the passed in key is a DES-EDE weak key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + @param length number of bytes making up the key + + + return true if the passed in key is a DES-EDE weak key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 2/3 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 2 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + return true if the passed in key is a real 3 part DES-EDE key. + + @param key bytes making up the key + @param offset offset into the byte array the key starts at + + + The minimum bitlength of the private value. + + + The bitlength of the private value. + + + Construct without a usage index, this will do a random construction of G. + + @param L desired length of prime P in bits (the effective key size). + @param N desired length of prime Q in bits. + @param certainty certainty level for prime number generation. + @param random the source of randomness to use. + + + Construct for a specific usage index - this has the effect of using verifiable canonical generation of G. + + @param L desired length of prime P in bits (the effective key size). + @param N desired length of prime Q in bits. + @param certainty certainty level for prime number generation. + @param random the source of randomness to use. + @param usageIndex a valid usage index. + + + return the generator - g + + + return private value limit - l + + + Parameter class for the HkdfBytesGenerator class. + + + Generates parameters for HKDF, specifying both the optional salt and + optional info. Step 1: Extract won't be skipped. + + @param ikm the input keying material or seed + @param salt the salt to use, may be null for a salt for hashLen zeros + @param info the info to use, may be null for an info field of zero bytes + + + Factory method that makes the HKDF skip the extract part of the key + derivation function. + + @param ikm the input keying material or seed, directly used for step 2: + Expand + @param info the info to use, may be null for an info field of zero bytes + @return HKDFParameters that makes the implementation skip step 1 + + + Returns the input keying material or seed. + + @return the keying material + + + Returns the salt, or null if the salt should be generated as a byte array + of HashLen zeros. + + @return the salt, or null + + + Returns the info field, which may be empty (null is converted to empty). + + @return the info field, never null + + + Returns if step 1: extract has to be skipped or not + + @return true for skipping, false for no skipping of step 1 + + + parameters for using an integrated cipher in stream mode. + + + @param derivation the derivation parameter for the KDF function. + @param encoding the encoding parameter for the KDF function. + @param macKeySize the size of the MAC key (in bits). + + + @param derivation the derivation parameter for the KDF function. + @param encoding the encoding parameter for the KDF function. + @param macKeySize the size of the MAC key (in bits). + @param cipherKeySize the size of the associated Cipher key (in bits). + + + parameters for Key derivation functions for ISO-18033 + + + parameters for Key derivation functions for IEEE P1363a + + + Parameters for mask derivation functions. + + + Parameters for NaccacheStern public private key generation. For details on + this cipher, please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Parameters for generating a NaccacheStern KeyPair. + + @param random + The source of randomness + @param strength + The desired strength of the Key in Bits + @param certainty + the probability that the generated primes are not really prime + as integer: 2^(-certainty) is then the probability + @param countSmallPrimes + How many small key factors are desired + + + * Parameters for a NaccacheStern KeyPair. + * + * @param random + * The source of randomness + * @param strength + * The desired strength of the Key in Bits + * @param certainty + * the probability that the generated primes are not really prime + * as integer: 2^(-certainty) is then the probability + * @param cntSmallPrimes + * How many small key factors are desired + * @param debug + * Ignored + + + @return Returns the certainty. + + + @return Returns the countSmallPrimes. + + + Public key parameters for NaccacheStern cipher. For details on this cipher, + please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + @param privateKey + + + @return Returns the g. + + + @return Returns the lowerSigmaBound. + + + @return Returns the n. + + + Private key parameters for NaccacheStern cipher. For details on this cipher, + please see + + http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + + + Constructs a NaccacheSternPrivateKey + + @param g + the public enryption parameter g + @param n + the public modulus n = p*q + @param lowerSigmaBound + the public lower sigma bound up to which data can be encrypted + @param smallPrimes + the small primes, of which sigma is constructed in the right + order + @param phi_n + the private modulus phi(n) = (p-1)(q-1) + + + Cipher parameters with a fixed salt value associated with them. + + + + Parameters for the Skein hash function - a series of byte[] strings identified by integer tags. + + + Parameterised Skein can be used for: +
      +
    • MAC generation, by providing a key.
    • +
    • Randomised hashing, by providing a nonce.
    • +
    • A hash function for digital signatures, associating a + public key with the message digest.
    • +
    • A key derivation function, by providing a + key identifier.
    • +
    • Personalised hashing, by providing a + recommended format or + arbitrary personalisation string.
    • +
    +
    + + + +
    + + + The parameter type for a secret key, supporting MAC or KDF functions: 0 + + + + + The parameter type for the Skein configuration block: 4 + + + + + The parameter type for a personalisation string: 8 + + + + + The parameter type for a public key: 12 + + + + + The parameter type for a key identifier string: 16 + + + + + The parameter type for a nonce: 20 + + + + + The parameter type for the message: 48 + + + + + The parameter type for the output transformation: 63 + + + + + Obtains a map of type (int) to value (byte[]) for the parameters tracked in this object. + + + + + Obtains the value of the key parameter, or null if not + set. + + The key. + + + + Obtains the value of the personalisation parameter, or + null if not set. + + + + + Obtains the value of the public key parameter, or + null if not set. + + + + + Obtains the value of the key identifier parameter, or + null if not set. + + + + + Obtains the value of the nonce parameter, or null if + not set. + + + + + A builder for . + + + + + Sets a parameters to apply to the Skein hash function. + + + Parameter types must be in the range 0,5..62, and cannot use the value 48 + (reserved for message body). +

    + Parameters with type < 48 are processed before + the message content, parameters with type > 48 + are processed after the message and prior to output. + + the type of the parameter, in the range 5..62. + the byte sequence of the parameter. + + +

    + Sets the parameter. + +
    + + + Sets the parameter. + + + + + Implements the recommended personalisation format for Skein defined in Section 4.11 of + the Skein 1.3 specification. + + + The format is YYYYMMDD email@address distinguisher, encoded to a byte + sequence using UTF-8 encoding. + + the date the personalised application of the Skein was defined. + the email address of the creation of the personalised application. + an arbitrary personalisation string distinguishing the application. + + + + Sets the parameter. + + + + + Sets the parameter. + + + + + Sets the parameter. + + + + + Constructs a new instance with the parameters provided to this + builder. + + + + + Parameters for tweakable block ciphers. + + + + + Gets the key. + + the key to use, or null to use the current key. + + + + Gets the tweak value. + + The tweak to use, or null to use the current tweak. + + + An EntropySourceProvider where entropy generation is based on a SecureRandom output using SecureRandom.generateSeed(). + + + Create a entropy source provider based on the passed in SecureRandom. + + @param secureRandom the SecureRandom to base EntropySource construction on. + @param isPredictionResistant boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is). + + + Return an entropy source that will create bitsRequired bits of entropy on + each invocation of getEntropy(). + + @param bitsRequired size (in bits) of entropy to be created by the provided source. + @return an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method. + + + + Uses Microsoft's RNGCryptoServiceProvider + + + + Generic interface for objects generating random bytes. + + + Add more seed material to the generator. + A byte array to be mixed into the generator's state. + + + Add more seed material to the generator. + A long value to be mixed into the generator's state. + + + Fill byte array with random values. + Array to be filled. + + + Fill byte array with random values. + Array to receive bytes. + Index to start filling at. + Length of segment to fill. + + + Random generation based on the digest with counter. Calling AddSeedMaterial will + always increase the entropy of the hash. +

    + Internal access to the digest is synchronized so a single one of these can be shared. +

    +
    + + A SP800-90A CTR DRBG. + + + Interface to SP800-90A deterministic random bit generators. + + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size of the DRBG. + + @return the block size (in bits) produced by each round of the DRBG. + + + Construct a SP800-90A CTR DRBG. +

    + Minimum entropy requirement is the security strength requested. +

    + @param engine underlying block cipher to use to support DRBG + @param keySizeInBits size of the key to use with the block cipher. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
    + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Pad out a key for TDEA, setting odd parity for each byte. + + @param keyMaster + @param keyOff + @param tmp + @param tmpOff + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each internal round of the DRBG. + + + Used by both Dual EC and Hash. + + + A SP800-90A Hash DRBG. + + + Construct a SP800-90A Hash DRBG. +

    + Minimum entropy requirement is the security strength requested. +

    + @param digest source digest to use for DRB stream. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
    + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each internal round of the DRBG. + + + A SP800-90A HMAC DRBG. + + + Construct a SP800-90A Hash DRBG. +

    + Minimum entropy requirement is the security strength requested. +

    + @param hMac Hash MAC to base the DRBG on. + @param securityStrength security strength required (in bits) + @param entropySource source of entropy to use for seeding/reseeding. + @param personalizationString personalization string to distinguish this DRBG (may be null). + @param nonce nonce to further distinguish this DRBG (may be null). +
    + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param additionalInput additional input to be added to the DRBG in this step. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the DRBG. + + @param additionalInput additional input to be added to the DRBG in this step. + + + Return the block size (in bits) of the DRBG. + + @return the number of bits produced on each round of the DRBG. + + + Generate numBytes worth of entropy from the passed in entropy source. + + @param entropySource the entropy source to request the data from. + @param numBytes the number of bytes of entropy requested. + @return a byte array populated with the random data. + + + + Takes bytes generated by an underling RandomGenerator and reverses the order in + each small window (of configurable size). +

    + Access to internals is synchronized so a single one of these can be shared. +

    +
    +
    + + Add more seed material to the generator. + A byte array to be mixed into the generator's state. + + + Add more seed material to the generator. + A long value to be mixed into the generator's state. + + + Fill byte array with random values. + Array to be filled. + + + Fill byte array with random values. + Array to receive bytes. + Index to start filling at. + Length of segment to fill. + + + + Create and auto-seed an instance based on the given algorithm. + + Equivalent to GetInstance(algorithm, true) + e.g. "SHA256PRNG" + + + + Create an instance based on the given algorithm, with optional auto-seeding + + e.g. "SHA256PRNG" + If true, the instance will be auto-seeded. + + + + To replicate existing predictable output, replace with GetInstance("SHA1PRNG", false), followed by SetSeed(seed) + + + + Use the specified instance of IRandomGenerator as random source. + + This constructor performs no seeding of either the IRandomGenerator or the + constructed SecureRandom. It is the responsibility of the client to provide + proper seed material as necessary/appropriate for the given IRandomGenerator + implementation. + + The source to generate all random bytes from. + + + Builder class for making SecureRandom objects based on SP 800-90A Deterministic Random Bit Generators (DRBG). + + + Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + predictionResistant set to false. +

    + Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the default SecureRandom does for its generateSeed() call. +

    +
    + + Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + for prediction resistance. +

    + Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the passed in SecureRandom does for its generateSeed() call. +

    + @param entropySource + @param predictionResistant +
    + + Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. +

    + Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. +

    + @param entropySourceProvider a provider of EntropySource objects. +
    + + Set the personalization string for DRBG SecureRandoms created by this builder + @param personalizationString the personalisation string for the underlying DRBG. + @return the current builder. + + + Set the security strength required for DRBGs used in building SecureRandom objects. + + @param securityStrength the security strength (in bits) + @return the current builder. + + + Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects. + + @param entropyBitsRequired the number of bits of entropy to be requested from the entropy source on each seed/reseed. + @return the current builder. + + + Build a SecureRandom based on a SP 800-90A Hash DRBG. + + @param digest digest algorithm to use in the DRBG underneath the SecureRandom. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a Hash DRBG. + + + Build a SecureRandom based on a SP 800-90A CTR DRBG. + + @param cipher the block cipher to base the DRBG on. + @param keySizeInBits key size in bits to be used with the block cipher. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a CTR DRBG. + + + Build a SecureRandom based on a SP 800-90A HMAC DRBG. + + @param hMac HMAC algorithm to use in the DRBG underneath the SecureRandom. + @param nonce nonce value to use in DRBG construction. + @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + @return a SecureRandom supported by a HMAC DRBG. + + + A thread based seed generator - one source of randomness. +

    + Based on an idea from Marcus Lippert. +

    +
    + + Generate seed bytes. Set fast to false for best quality. +

    + If fast is set to true, the code should be round about 8 times faster when + generating a long sequence of random bytes. 20 bytes of random values using + the fast mode take less than half a second on a Nokia e70. If fast is set to false, + it takes round about 2500 ms. +

    + @param numBytes the number of bytes to generate + @param fast true if fast mode should be used +
    + + + Permutation generated by code: + + // First 1850 fractional digit of Pi number. + byte[] key = new BigInteger("14159265358979323846...5068006422512520511").ToByteArray(); + s = 0; + P = new byte[256]; + for (int i = 0; i < 256; i++) + { + P[i] = (byte) i; + } + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + key[m % key.length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + + + Value generated in the same way as P. + + + + @param engine + @param entropySource + + + Populate a passed in array with random data. + + @param output output array for generated bits. + @param predictionResistant true if a reseed should be forced, false otherwise. + + @return number of bits generated, -1 if a reseed required. + + + Reseed the RNG. + + + Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + predictionResistant set to false. +

    + Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the default SecureRandom does for its generateSeed() call. +

    +
    + + Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + for prediction resistance. +

    + Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + the passed in SecureRandom does for its generateSeed() call. +

    + @param entropySource + @param predictionResistant +
    + + Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. +

    + Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. +

    + @param entropySourceProvider a provider of EntropySource objects. +
    + + Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the + generator will be reseeded on each request. + + @param engine a block cipher to use as the operator. + @param key the block cipher key to initialise engine with. + @param predictionResistant true if engine to be reseeded on each use, false otherwise. + @return a SecureRandom. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + true if the internal state represents the signature described in the passed in array. + + + Reset the internal state + + + The Digital Signature Algorithm - as described in "Handbook of Applied + Cryptography", pages 452 - 453. + + + Default configuration, random K values. + + + Configuration with an alternate, possibly deterministic calculator of K. + + @param kCalculator a K value calculator. + + + Generate a signature for the given message using the key we were + initialised with. For conventional DSA the message should be a SHA-1 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a DSA signature for + the passed in message for standard DSA the message should be a + SHA-1 hash of the real message to be verified. + + + EC-DSA as described in X9.62 + + + Default configuration, random K values. + + + Configuration with an alternate, possibly deterministic calculator of K. + + @param kCalculator a K value calculator. + + + Generate a signature for the given message using the key we were + initialised with. For conventional DSA the message should be a SHA-1 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a DSA signature for + the passed in message (for standard DSA the message should be + a SHA-1 hash of the real message to be verified). + + + GOST R 34.10-2001 Signature Algorithm + + + generate a signature for the given message using the key we were + initialised with. For conventional GOST3410 the message should be a GOST3411 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a GOST3410 signature for + the passed in message (for standard GOST3410 the message should be + a GOST3411 hash of the real message to be verified). + + + EC-NR as described in IEEE 1363-2000 + + + generate a signature for the given message using the key we were + initialised with. Generally, the order of the curve should be at + least as long as the hash of the message of interest, and with + ECNR it *must* be at least as long. + + @param digest the digest to be signed. + @exception DataLengthException if the digest is longer than the key allows + + + return true if the value r and s represent a signature for the + message passed in. Generally, the order of the curve should be at + least as long as the hash of the message of interest, and with + ECNR, it *must* be at least as long. But just in case the signer + applied mod(n) to the longer digest, this implementation will + apply mod(n) during verification. + + @param digest the digest to be verified. + @param r the r value of the signature. + @param s the s value of the signature. + @exception DataLengthException if the digest is longer than the key allows + + + initialise the signer for signing or verification. + + @param forSigning + true if for signing, false otherwise + @param parameters + necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using the key + we were initialised with. + + + return true if the internal state represents the signature described in + the passed in array. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + true if the internal state represents the signature described in the passed in array. + + + Reset the internal state + + + Gost R 34.10-94 Signature Algorithm + + + generate a signature for the given message using the key we were + initialised with. For conventional Gost3410 the message should be a Gost3411 + hash of the message of interest. + + @param message the message that will be verified later. + + + return true if the value r and s represent a Gost3410 signature for + the passed in message for standard Gost3410 the message should be a + Gost3411 hash of the real message to be verified. + + + A deterministic K calculator based on the algorithm in section 3.2 of RFC 6979. + + + Interface define calculators of K values for DSA/ECDSA. + + + Non-deterministic initialiser. + + @param n the order of the DSA group. + @param random a source of randomness. + + + Deterministic initialiser. + + @param n the order of the DSA group. + @param d the DSA private value. + @param message the message being signed. + + + Return the next valid value of K. + + @return a K value. + + + Return true if this calculator is deterministic, false otherwise. + + @return true if deterministic, otherwise false. + + + Base constructor. + + @param digest digest to build the HMAC on. + + + ISO9796-2 - mechanism using a hash function with recovery (scheme 2 and 3). +

    + Note: the usual length for the salt is the length of the hash + function used in bytes.

    +
    +
    + + + Return a reference to the recoveredMessage message. + + The full/partial recoveredMessage message. + + + + + Generate a signer with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3. + + base cipher to use for signature creation/verification + digest to use. + length of salt in bytes. + whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + + cipher to use. + + digest to sign with. + + length of salt in bytes. + + + + Initialise the signer. + true if for signing, false if for verification. + parameters for signature generation/verification. If the + parameters are for generation they should be a ParametersWithRandom, + a ParametersWithSalt, or just an RsaKeyParameters object. If RsaKeyParameters + are passed in a SecureRandom will be created. + + if wrong parameter type or a fixed + salt is passed in which is the wrong length. + + + + compare two byte arrays - constant time. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the loaded message using the key we were + initialised with. + + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + + + Return true if the full message was recoveredMessage. + + true on full message recovery, false otherwise, or if not sure. + + + + int to octet string. + int to octet string. + + + long to octet string. + + + mask generator function, as described in Pkcs1v2. + + + ISO9796-2 - mechanism using a hash function with recovery (scheme 1) + + + + Return a reference to the recoveredMessage message. + + The full/partial recoveredMessage message. + + + + + Generate a signer with either implicit or explicit trailers for ISO9796-2. + + base cipher to use for signature creation/verification + digest to use. + whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + + cipher to use. + + digest to sign with. + + + + compare two byte arrays - constant time. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the loaded message using the key we were + initialised with. + + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + + + Return true if the full message was recoveredMessage. + + true on full message recovery, false otherwise. + + + + RSA-PSS as described in Pkcs# 1 v 2.1. +

    + Note: the usual value for the salt length is the number of + bytes in the hash function.

    +
    +
    + + Basic constructor + the asymmetric cipher to use. + the digest to use. + the length of the salt to use (in bytes). + + + Basic constructor + the asymmetric cipher to use. + the digest to use. + the fixed salt to be used. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + + return true if the internal state represents the signature described + in the passed in array. + + + + int to octet string. + + + mask generator function, as described in Pkcs1v2. + + + + Load oid table. + + + + Initialise the signer for signing or verification. + + @param forSigning true if for signing, false otherwise + @param param necessary parameters. + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + Generate a signature for the message we've been loaded with using + the key we were initialised with. + + + return true if the internal state represents the signature described + in the passed in array. + + + X9.31-1998 - signing using a hash. +

    + The message digest hash, H, is encapsulated to form a byte string as follows +

    +
    +            EB = 06 || PS || 0xBA || H || TRAILER
    +            
    + where PS is a string of bytes all of value 0xBB of length such that |EB|=|n|, and TRAILER is the ISO/IEC 10118 part number† for the digest. The byte string, EB, is converted to an integer value, the message representative, f. +
    + + Generate a signer with either implicit or explicit trailers for X9.31. + + @param cipher base cipher to use for signature creation/verification + @param digest digest to use. + @param implicit whether or not the trailer is implicit or gives the hash. + + + Constructor for a signer with an explicit digest trailer. + + @param cipher cipher to use. + @param digest digest to sign with. + + + clear possible sensitive data + + + update the internal digest with the byte b + + + update the internal digest with the byte array in + + + reset the internal state + + + generate a signature for the loaded message using the key we were + initialised with. + + + return true if the signature represents a ISO9796-2 signature + for the passed in message. + + + a wrapper for block ciphers with a single byte block size, so that they + can be treated like stream ciphers. + + + basic constructor. + + @param cipher the block cipher to be wrapped. + @exception ArgumentException if the cipher has a block size other than + one. + + + initialise the underlying cipher. + + @param forEncryption true if we are setting up for encryption, false otherwise. + @param param the necessary parameters for the underlying cipher to be initialised. + + + encrypt/decrypt a single byte returning the result. + + @param in the byte to be processed. + @return the result of processing the input byte. + + + process a block of bytes from in putting the result into out. + + @param in the input byte array. + @param inOff the offset into the in array where the data to be processed starts. + @param len the number of bytes to be processed. + @param out the output buffer the processed bytes go into. + @param outOff the offset into the output byte array the processed data stars at. + @exception DataLengthException if the output buffer is too small. + + + reset the underlying cipher. This leaves it in the same state + it was at after the last init (if there was one). + + + return the name of the algorithm we are wrapping. + + @return the name of the algorithm we are wrapping. + + + + + + + + + + + + + + + + draft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on + gmt_unix_time containing the current time, we recommend that implementors MAY provide the + ability to set gmt_unix_time as an option only, off by default." + + + true if the current time should be used in the gmt_unix_time field of + Random, or false if gmt_unix_time should contain a cryptographically + random value. + + + + + Report whether the server supports secure renegotiation + + + The protocol handler automatically processes the relevant extensions + + + A , true if the server supports secure renegotiation + + + + + + Return an implementation of to handle record compression. + + A + + + + + Return an implementation of to use for encryption/decryption. + + A + + + + This method will be called when an alert is raised by the protocol. + + + A human-readable message explaining what caused this alert. May be null. + The Exception that caused this alert to be raised. May be null. + + + This method will be called when an alert is received from the remote peer. + + + + + Notifies the peer that the handshake has been successfully completed. + + + + + Called at the start of a new TLS session, before any other methods. + + + A + + + + Return the session this client wants to resume, if any. + Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated. + + A representing the resumable session to be used for this connection, + or null to use a new session. + + + + + Get the list of cipher suites that this client supports. + + + An array of values, each specifying a supported cipher suite. + + + + + Get the list of compression methods that this client supports. + + + An array of values, each specifying a supported compression method. + + + + + Get the (optional) table of client extensions to be included in (extended) client hello. + + + A (Int32 -> byte[]). May be null. + + + + + + + + + Notifies the client of the session_id sent in the ServerHello. + + An array of + + + + Report the cipher suite that was selected by the server. + + + The protocol handler validates this value against the offered cipher suites + + + + A + + + + + Report the compression method that was selected by the server. + + + The protocol handler validates this value against the offered compression methods + + + + A + + + + + Report the extensions from an extended server hello. + + + Will only be called if we returned a non-null result from . + + + A (Int32 -> byte[]) + + + + A list of + + + + + Return an implementation of to negotiate the key exchange + part of the protocol. + + + A + + + + + + Return an implementation of to handle authentication + part of the protocol. + + + + + A list of + + + + RFC 5077 3.3. NewSessionTicket Handshake Message + + This method will be called (only) when a NewSessionTicket handshake message is received. The + ticket is opaque to the client and clients MUST NOT examine the ticket under the assumption + that it complies with e.g. RFC 5077 4. Recommended Ticket Construction. + + The ticket + + + + + Return the to use for the TLSPlaintext.version field prior to + receiving the server version. NOTE: This method is not called for DTLS. + + + See RFC 5246 E.1.: "TLS clients that wish to negotiate with older servers MAY send any value + {03,XX} as the record layer version number. Typical values would be {03,00}, the lowest + version number supported by the client, and the value of ClientHello.client_version. No + single value will guarantee interoperability with all old servers, but this is a complex + topic beyond the scope of this document." + + The to use. + + + Export keying material according to RFC 5705: "Keying Material Exporters for TLS". + + @param asciiLabel indicates which application will use the exported keys. + @param context_value allows the application using the exporter to mix its own data with the TLS PRF for + the exporter output. + @param length the number of bytes to generate + @return a pseudorandom bit string of 'length' bytes generated from the master_secret. + + + Used to get the resumable session, if any, used by this connection. Only available after the + handshake has successfully completed. + + @return A {@link TlsSession} representing the resumable session used by this connection, or + null if no resumable session available. + @see TlsPeer#NotifyHandshakeComplete() + + + + + + + + + + A generic interface for key exchange implementations in (D)TLS. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A (Int32 -> byte[]). Will never be null. + + + + + + + + + + + + + + Get the (optional) table of server extensions to be included in (extended) server hello. + + + A (Int32 -> byte[]). May be null. + + + + + + A (). May be null. + + + + + + + + + This method will be called (only) if the server included an extension of type + "status_request" with empty "extension_data" in the extended server hello. See RFC 3546 + 3.6. Certificate Status Request. If a non-null is returned, it + is sent to the client as a handshake message of type "certificate_status". + + A to be sent to the client (or null for none). + + + + + + + + + + () + + + + + Called by the protocol handler to report the client certificate, only if GetCertificateRequest + returned non-null. + + Note: this method is responsible for certificate verification and validation. + the effective client certificate (may be an empty chain). + + + + RFC 5077 3.3. NewSessionTicket Handshake Message. + + This method will be called (only) if a NewSessionTicket extension was sent by the server. See + RFC 5077 4. Recommended Ticket Construction for recommended format and protection. + + The ticket) + + + + + + + + + + + RFC 5246 7.2 + + + + This message notifies the recipient that the sender will not send any more messages on this + connection. Note that as of TLS 1.1, failure to properly close a connection no longer + requires that a session not be resumed. This is a change from TLS 1.0 ("The session becomes + unresumable if any connection is terminated without proper close_notify messages with level + equal to warning.") to conform with widespread implementation practice. + + + An inappropriate message was received. This alert is always fatal and should never be + observed in communication between proper implementations. + + + This alert is returned if a record is received with an incorrect MAC. This alert also MUST be + returned if an alert is sent because a TLSCiphertext decrypted in an invalid way: either it + wasn't an even multiple of the block length, or its padding values, when checked, weren't + correct. This message is always fatal and should never be observed in communication between + proper implementations (except when messages were corrupted in the network). + + + This alert was used in some earlier versions of TLS, and may have permitted certain attacks + against the CBC mode [CBCATT]. It MUST NOT be sent by compliant implementations. + + + A TLSCiphertext record was received that had a length more than 2^14+2048 bytes, or a record + decrypted to a TLSCompressed record with more than 2^14+1024 bytes. This message is always + fatal and should never be observed in communication between proper implementations (except + when messages were corrupted in the network). + + + The decompression function received improper input (e.g., data that would expand to excessive + length). This message is always fatal and should never be observed in communication between + proper implementations. + + + Reception of a handshake_failure alert message indicates that the sender was unable to + negotiate an acceptable set of security parameters given the options available. This is a + fatal error. + + + This alert was used in SSLv3 but not any version of TLS. It MUST NOT be sent by compliant + implementations. + + + A certificate was corrupt, contained signatures that did not verify correctly, etc. + + + A certificate was of an unsupported type. + + + A certificate was revoked by its signer. + + + A certificate has expired or is not currently valid. + + + Some other (unspecified) issue arose in processing the certificate, rendering it + unacceptable. + + + A field in the handshake was out of range or inconsistent with other fields. This message is + always fatal. + + + A valid certificate chain or partial chain was received, but the certificate was not accepted + because the CA certificate could not be located or couldn't be matched with a known, trusted + CA. This message is always fatal. + + + A valid certificate was received, but when access control was applied, the sender decided not + to proceed with negotiation. This message is always fatal. + + + A message could not be decoded because some field was out of the specified range or the + length of the message was incorrect. This message is always fatal and should never be + observed in communication between proper implementations (except when messages were corrupted + in the network). + + + A handshake cryptographic operation failed, including being unable to correctly verify a + signature or validate a Finished message. This message is always fatal. + + + This alert was used in some earlier versions of TLS. It MUST NOT be sent by compliant + implementations. + + + The protocol version the client has attempted to negotiate is recognized but not supported. + (For example, old protocol versions might be avoided for security reasons.) This message is + always fatal. + + + Returned instead of handshake_failure when a negotiation has failed specifically because the + server requires ciphers more secure than those supported by the client. This message is + always fatal. + + + An internal error unrelated to the peer or the correctness of the protocol (such as a memory + allocation failure) makes it impossible to continue. This message is always fatal. + + + This handshake is being canceled for some reason unrelated to a protocol failure. If the user + cancels an operation after the handshake is complete, just closing the connection by sending + a close_notify is more appropriate. This alert should be followed by a close_notify. This + message is generally a warning. + + + Sent by the client in response to a hello request or by the server in response to a client + hello after initial handshaking. Either of these would normally lead to renegotiation; when + that is not appropriate, the recipient should respond with this alert. At that point, the + original requester can decide whether to proceed with the connection. One case where this + would be appropriate is where a server has spawned a process to satisfy a request; the + process might receive security parameters (key length, authentication, etc.) at startup, and + it might be difficult to communicate changes to these parameters after that point. This + message is always a warning. + + + Sent by clients that receive an extended server hello containing an extension that they did + not put in the corresponding client hello. This message is always fatal. + + + This alert is sent by servers who are unable to retrieve a certificate chain from the URL + supplied by the client (see Section 3.3). This message MAY be fatal - for example if client + authentication is required by the server for the handshake to continue and the server is + unable to retrieve the certificate chain, it may send a fatal alert. + + + This alert is sent by servers that receive a server_name extension request, but do not + recognize the server name. This message MAY be fatal. + + + This alert is sent by clients that receive an invalid certificate status response (see + Section 3.6). This message is always fatal. + + + This alert is sent by servers when a certificate hash does not match a client provided + certificate_hash. This message is always fatal. + + + If the server does not recognize the PSK identity, it MAY respond with an + "unknown_psk_identity" alert message. + + + If TLS_FALLBACK_SCSV appears in ClientHello.cipher_suites and the highest protocol version + supported by the server is higher than the version indicated in ClientHello.client_version, + the server MUST respond with a fatal inappropriate_fallback alert [..]. + + + + RFC 5246 7.2 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + A queue for bytes. +

    + This file could be more optimized. +

    +
    +
    + + The initial size for our buffer. + + + The smallest number which can be written as 2^x which is bigger than i. + + + The buffer where we store our data. + + + How many bytes at the beginning of the buffer are skipped. + + + How many bytes in the buffer are valid data. + + + Read data from the buffer. + The buffer where the read data will be copied to. + How many bytes to skip at the beginning of buf. + How many bytes to read at all. + How many bytes from our data to skip. + + + Add some data to our buffer. + A byte-array to read data from. + How many bytes to skip at the beginning of the array. + How many bytes to read from the array. + + + Remove some bytes from our data from the beginning. + How many bytes to remove. + + + The number of bytes which are available in this buffer. + + + Parsing and encoding of a Certificate struct from RFC 4346. +

    +

    +             opaque ASN.1Cert<2^24-1>;
    +            
    +             struct {
    +                 ASN.1Cert certificate_list<0..2^24-1>;
    +             } Certificate;
    +             
    + + @see Org.BouncyCastle.Asn1.X509.X509CertificateStructure +
    + + The certificates. + + + @return an array of {@link org.bouncycastle.asn1.x509.Certificate} representing a certificate + chain. + + + Encode this {@link Certificate} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link Certificate} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link Certificate} object. + @throws IOException + + + @return true if this certificate chain contains no certificates, or + false otherwise. + + + Parsing and encoding of a CertificateRequest struct from RFC 4346. +

    +

    +             struct {
    +                 ClientCertificateType certificate_types<1..2^8-1>;
    +                 DistinguishedName certificate_authorities<3..2^16-1>
    +             } CertificateRequest;
    +             
    + + @see ClientCertificateType + @see X509Name +
    + + @param certificateTypes see {@link ClientCertificateType} for valid constants. + @param certificateAuthorities an {@link IList} of {@link X509Name}. + + + Encode this {@link CertificateRequest} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateRequest} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link CertificateRequest} object. + @throws IOException + + + @return an array of certificate types + @see {@link ClientCertificateType} + + + @return an {@link IList} of {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + + + @return an {@link IList} of {@link X509Name} + + + Encode this {@link CertificateStatus} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateStatus} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link CertificateStatus} object. + @throws IOException + + + Encode this {@link CertificateStatusRequest} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateStatusRequest} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link CertificateStatusRequest} object. + @throws IOException + + + RFC 6091 + + + @param type + see {@link CertChainType} for valid constants. + @param urlAndHashList + a {@link IList} of {@link UrlAndHash}. + + + Encode this {@link CertificateUrl} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link CertificateUrl} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link CertificateUrl} object. + @throws IOException + + + @return {@link CertChainType} + + + @return an {@link IList} of {@link UrlAndHash} + + + draft-ietf-tls-chacha20-poly1305-04 + + + + + + + + + + + + + + + + + + + + + + RFC 2246 A.5 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + A combined hash, which implements md5(m) || sha1(m). + + + @see org.bouncycastle.crypto.Digest#update(byte[], int, int) + + + @see org.bouncycastle.crypto.Digest#doFinal(byte[], int) + + + @see org.bouncycastle.crypto.Digest#reset() + + + + RFC 2246 6.1 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 2246 6.2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check whether the given SRP group parameters are acceptable for use. + + @param group the {@link SRP6GroupParameters} to check + @return true if (and only if) the specified group parameters are acceptable + + + Accept only the group parameters specified in RFC 5054 Appendix A. + + + Specify a custom set of acceptable group parameters. + + @param groups a {@link Vector} of acceptable {@link SRP6GroupParameters} + + + Buffers input until the hash algorithm is determined. + + + Encode this {@link DigitallySigned} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link DigitallySigned} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link DigitallySigned} object. + @throws IOException + + + @return a {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there are no "extra" messages left in the current inbound flight + + + RFC 4347 4.1.2.5 Anti-replay +

    + Support fast rejection of duplicate records by maintaining a sliding receive window + + + Check whether a received record with the given sequence number should be rejected as a duplicate. + + @param seq the 48-bit DTLSPlainText.sequence_number field of a received record. + @return true if the record should be discarded without further processing. + + + Report that a received record with the given sequence number passed authentication checks. + + @param seq the 48-bit DTLSPlainText.sequence_number field of an authenticated record. + + + When a new epoch begins, sequence numbers begin again at 0 + + +

    RFC 4492 5.4. (Errata ID: 2389) +
    + + + RFC 4492 5.4 + + + + Indicates the elliptic curve domain parameters are conveyed verbosely, and the + underlying finite field is a prime field. + + + Indicates the elliptic curve domain parameters are conveyed verbosely, and the + underlying finite field is a characteristic-2 field. + + + Indicates that a named curve is used. This option SHOULD be used when applicable. + + + + RFC 4492 5.1.2 + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 5705 + + + RFC 5246 7.4.1.4.1 + + + Encode this {@link HeartbeatExtension} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link HeartbeatExtension} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link HeartbeatExtension} object. + @throws IOException + + + Encode this {@link HeartbeatMessage} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link HeartbeatMessage} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link HeartbeatMessage} object. + @throws IOException + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + RFC 2246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + RFC 4492 5.1.1 + The named curves defined here are those specified in SEC 2 [13]. Note that many of + these curves are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00 + through 0xFEFF are reserved for private use. Values 0xFF01 and 0xFF02 indicate that the + client supports arbitrary prime and characteristic-2 curves, respectively (the curve + parameters must be encoded explicitly in ECParameters). + + + + Encode this {@link NewSessionTicket} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link NewSessionTicket} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link NewSessionTicket} object. + @throws IOException + + + RFC 3546 3.6 + + + @param responderIDList + an {@link IList} of {@link ResponderID}, specifying the list of trusted OCSP + responders. An empty list has the special meaning that the responders are + implicitly known to the server - e.g., by prior arrangement. + @param requestExtensions + OCSP request extensions. A null value means that there are no extensions. + + + Encode this {@link OcspStatusRequest} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link OcspStatusRequest} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return an {@link OcspStatusRequest} object. + @throws IOException + + + @return an {@link IList} of {@link ResponderID} + + + @return OCSP request extensions + + + RFC 5246 + + Note that the values here are implementation-specific and arbitrary. It is recommended not to + depend on the particular values (e.g. serialization). + + + + + + + An implementation of the TLS 1.0/1.1/1.2 record layer, allowing downgrade to SSLv3. + + + RFC 5246 E.1. "Earlier versions of the TLS specification were not fully clear on what the + record layer version number (TLSPlaintext.version) should contain when sending ClientHello + (i.e., before it is known which version of the protocol will be employed). Thus, TLS servers + compliant with this specification MUST accept any value {03,XX} as the record layer version + number for ClientHello." + + + @return {@link ConnectionEnd} + + + @return {@link CipherSuite} + + + @return {@link CompressionMethod} + + + @return {@link PRFAlgorithm} + + + Encode this {@link ServerDHParams} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerDHParams} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerDHParams} object. + @throws IOException + + + Encode this {@link ServerName} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerName} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerName} object. + @throws IOException + + + @param serverNameList an {@link IList} of {@link ServerName}. + + + Encode this {@link ServerNameList} to a {@link Stream}. + + @param output + the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link ServerNameList} from a {@link Stream}. + + @param input + the {@link Stream} to parse from. + @return a {@link ServerNameList} object. + @throws IOException + + + @return an {@link IList} of {@link ServerName}. + + + + Called by the protocol handler to report the server certificate. + + + This method is responsible for certificate verification and validation + + The server received + + + + + Return client credentials in response to server's certificate request + + + A containing server certificate request details + + + A to be used for client authentication + (or null for no client authentication) + + + + + Encode this {@link ServerSRPParams} to an {@link OutputStream}. + + @param output + the {@link OutputStream} to encode to. + @throws IOException + + + Parse a {@link ServerSRPParams} from an {@link InputStream}. + + @param input + the {@link InputStream} to parse from. + @return a {@link ServerSRPParams} object. + @throws IOException + + + RFC 5246 7.4.1.4.1 (in RFC 2246, there were no specific values assigned) + + + RFC 5246 7.4.1.4.1 + + + @param hash {@link HashAlgorithm} + @param signature {@link SignatureAlgorithm} + + + Encode this {@link SignatureAndHashAlgorithm} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link SignatureAndHashAlgorithm} from a {@link Stream}. + + @param input the {@link Stream} to parse from. + @return a {@link SignatureAndHashAlgorithm} object. + @throws IOException + + + @return {@link HashAlgorithm} + + + @return {@link SignatureAlgorithm} + + + An implementation of {@link TlsSRPIdentityManager} that simulates the existence of "unknown" identities + to obscure the fact that there is no verifier for them. + + + Lookup the {@link TlsSRPLoginParameters} corresponding to the specified identity. + + NOTE: To avoid "identity probing", unknown identities SHOULD be handled as recommended in RFC + 5054 2.5.1.3. {@link SimulatedTlsSRPIdentityManager} is provided for this purpose. + + @param identity + the SRP identity sent by the connecting client + @return the {@link TlsSRPLoginParameters} for the specified identity, or else 'simulated' + parameters if the identity is not recognized. A null value is also allowed, but not + recommended. + + + Create a {@link SimulatedTlsSRPIdentityManager} that implements the algorithm from RFC 5054 2.5.1.3 + + @param group the {@link SRP6GroupParameters} defining the group that SRP is operating in + @param seedKey the secret "seed key" referred to in RFC 5054 2.5.1.3 + @return an instance of {@link SimulatedTlsSRPIdentityManager} + + + HMAC implementation based on original internet draft for HMAC (RFC 2104) + + The difference is that padding is concatentated versus XORed with the key + + H(K + opad, H(K + ipad, text)) + + + Base constructor for one of the standard digest algorithms that the byteLength of + the algorithm is know for. Behaviour is undefined for digests other than MD5 or SHA1. + + @param digest the digest. + + + Reset the mac generator. + + + RFC 4680 + + + + + + + + + + + + + + + + + + + A generic TLS 1.0-1.2 / SSLv3 block cipher. This can be used for AES or 3DES for example. + + + + + + + + + + This method is called, when a change cipher spec message is received. + + @throws IOException If the message has an invalid content or the handshake is not in the correct + state. + + + Read data from the network. The method will return immediately, if there is still some data + left in the buffer, or block until some application data has been read from the network. + + @param buf The buffer where the data will be copied to. + @param offset The position where the data will be placed in the buffer. + @param len The maximum number of bytes to read. + @return The number of bytes read. + @throws IOException If something goes wrong during reading data. + + + Send some application data to the remote system. +

    + The method will handle fragmentation internally. + + @param buf The buffer with the data. + @param offset The position in the buffer where the data is placed. + @param len The length of the data. + @throws IOException If something goes wrong during sending. + + + Offer input from an arbitrary source. Only allowed in non-blocking mode.
    +
    + After this method returns, the input buffer is "owned" by this object. Other code + must not attempt to do anything with it.
    +
    + This method will decrypt and process all records that are fully available. + If only part of a record is available, the buffer will be retained until the + remainder of the record is offered.
    +
    + If any records containing application data were processed, the decrypted data + can be obtained using {@link #readInput(byte[], int, int)}. If any records + containing protocol data were processed, a response may have been generated. + You should always check to see if there is any available output after calling + this method by calling {@link #getAvailableOutputBytes()}. + @param input The input buffer to offer + @throws IOException If an error occurs while decrypting or processing a record +
    + + Gets the amount of received application data. A call to {@link #readInput(byte[], int, int)} + is guaranteed to be able to return at least this much data.
    +
    + Only allowed in non-blocking mode. + @return The number of bytes of available application data +
    + + Retrieves received application data. Use {@link #getAvailableInputBytes()} to check + how much application data is currently available. This method functions similarly to + {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + is available, nothing will be copied and zero will be returned.
    +
    + Only allowed in non-blocking mode. + @param buffer The buffer to hold the application data + @param offset The start offset in the buffer at which the data is written + @param length The maximum number of bytes to read + @return The total number of bytes copied to the buffer. May be less than the + length specified if the length was greater than the amount of available data. +
    + + Offer output from an arbitrary source. Only allowed in non-blocking mode.
    +
    + After this method returns, the specified section of the buffer will have been + processed. Use {@link #readOutput(byte[], int, int)} to get the bytes to + transmit to the other peer.
    +
    + This method must not be called until after the handshake is complete! Attempting + to call it before the handshake is complete will result in an exception. + @param buffer The buffer containing application data to encrypt + @param offset The offset at which to begin reading data + @param length The number of bytes of data to read + @throws IOException If an error occurs encrypting the data, or the handshake is not complete +
    + + Gets the amount of encrypted data available to be sent. A call to + {@link #readOutput(byte[], int, int)} is guaranteed to be able to return at + least this much data.
    +
    + Only allowed in non-blocking mode. + @return The number of bytes of available encrypted data +
    + + Retrieves encrypted data to be sent. Use {@link #getAvailableOutputBytes()} to check + how much encrypted data is currently available. This method functions similarly to + {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + is available, nothing will be copied and zero will be returned.
    +
    + Only allowed in non-blocking mode. + @param buffer The buffer to hold the encrypted data + @param offset The start offset in the buffer at which the data is written + @param length The maximum number of bytes to read + @return The total number of bytes copied to the buffer. May be less than the + length specified if the length was greater than the amount of available data. +
    + + Terminate this connection with an alert. Can be used for normal closure too. + + @param alertLevel + See {@link AlertLevel} for values. + @param alertDescription + See {@link AlertDescription} for values. + @throws IOException + If alert was fatal. + + + Closes this connection. + + @throws IOException If something goes wrong during closing. + + + Make sure the InputStream 'buf' now empty. Fail otherwise. + + @param buf The InputStream to check. + @throws IOException If 'buf' is not empty. + + + 'sender' only relevant to SSLv3 + + +

    The secure bidirectional stream for this connection + Only allowed in blocking mode. +
    + + Constructor for blocking mode. + @param stream The bi-directional stream of data to/from the server + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for blocking mode. + @param input The stream of data from the server + @param output The stream of data to the server + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for non-blocking mode.
    +
    + When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + provide the received ciphertext, then use + {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
    +
    + Similarly, when data needs to be sent, use + {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + {@link #readOutput(byte[], int, int)} to get the corresponding + ciphertext. + + @param secureRandom + Random number generator for various cryptographic functions +
    + + Initiates a TLS handshake in the role of client.
    +
    + In blocking mode, this will not return until the handshake is complete. + In non-blocking mode, use {@link TlsPeer#NotifyHandshakeComplete()} to + receive a callback when the handshake is complete. + + @param tlsClient The {@link TlsClient} to use for the handshake. + @throws IOException If in blocking mode and handshake was not successful. +
    + + (D)TLS DH key exchange. + + + (D)TLS ECDHE key exchange (see RFC 4492). + + + (D)TLS ECDH key exchange (see RFC 4492). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest. + + + + Generate a new instance of an TlsMac. + + @param context the TLS client context + @param digest The digest to use. + @param key A byte-array where the key for this MAC is located. + @param keyOff The number of bytes to skip, before the key starts in the buffer. + @param keyLen The length of the key. + + + Calculate the MAC for some given data. + + @param type The message type of the message. + @param message A byte-buffer containing the message. + @param offset The number of bytes to skip, before the message starts. + @param length The length of the message. + @return A new byte-buffer containing the MAC value. + + + @return the MAC write secret + + + @return The output length of this MAC. + + + + A NULL CipherSuite, with optional MAC. + + + + + + + + + + + + + Both streams can be the same object + + + (D)TLS PSK key exchange (RFC 4279). + + + (D)TLS and SSLv3 RSA key exchange. + + + + + + Constructor for blocking mode. + @param stream The bi-directional stream of data to/from the client + @param output The stream of data to the client + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for blocking mode. + @param input The stream of data from the client + @param output The stream of data to the client + @param secureRandom Random number generator for various cryptographic functions + + + Constructor for non-blocking mode.
    +
    + When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + provide the received ciphertext, then use + {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
    +
    + Similarly, when data needs to be sent, use + {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + {@link #readOutput(byte[], int, int)} to get the corresponding + ciphertext. + + @param secureRandom + Random number generator for various cryptographic functions +
    + + Receives a TLS handshake in the role of server.
    +
    + In blocking mode, this will not return until the handshake is complete. + In non-blocking mode, use {@link TlsPeer#notifyHandshakeComplete()} to + receive a callback when the handshake is complete. + + @param tlsServer + @throws IOException If in blocking mode and handshake was not successful. +
    + + (D)TLS SRP key exchange (RFC 5054). + + + RFC 5764 DTLS Extension to Establish Keys for SRTP. + + + + + + + + + + + + Some helper functions for MicroTLS. + + + Add a 'signature_algorithms' extension to existing extensions. + + @param extensions A {@link Hashtable} to add the extension to. + @param supportedSignatureAlgorithms {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @throws IOException + + + Get a 'signature_algorithms' extension from extensions. + + @param extensions A {@link Hashtable} to get the extension from, if it is present. + @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}, or null. + @throws IOException + + + Create a 'signature_algorithms' extension value. + + @param supportedSignatureAlgorithms A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @return A byte array suitable for use as an extension value. + @throws IOException + + + Read 'signature_algorithms' extension data. + + @param extensionData The extension data. + @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + @throws IOException + + + RFC 6066 5. + + + Encode this {@link UrlAndHash} to a {@link Stream}. + + @param output the {@link Stream} to encode to. + @throws IOException + + + Parse a {@link UrlAndHash} from a {@link Stream}. + + @param context + the {@link TlsContext} of the current connection. + @param input + the {@link Stream} to parse from. + @return a {@link UrlAndHash} object. + @throws IOException + + + RFC 4681 + + + RFC 5764 4.1.1 + + + @param protectionProfiles see {@link SrtpProtectionProfile} for valid constants. + @param mki valid lengths from 0 to 255. + + + @return see {@link SrtpProtectionProfile} for valid constants. + + + @return valid lengths from 0 to 255. + + + return a = a + b - b preserved. + + + unsigned comparison on two arrays - note the arrays may + start with leading zeros. + + + return z = x / y - done in place (z value preserved, x contains the + remainder) + + + return whether or not a BigInteger is probably prime with a + probability of 1 - (1/2)**certainty. +

    From Knuth Vol 2, pg 395.

    +
    + + Calculate the numbers u1, u2, and u3 such that: + + u1 * a + u2 * b = u3 + + where u3 is the greatest common divider of a and b. + a and b using the extended Euclid algorithm (refer p. 323 + of The Art of Computer Programming vol 2, 2nd ed). + This also seems to have the side effect of calculating + some form of multiplicative inverse. + + @param a First number to calculate gcd for + @param b Second number to calculate gcd for + @param u1Out the return object for the u1 value + @return The greatest common divisor of a and b + + + return w with w = x * x - w is assumed to have enough space. + + + return x with x = y * z - x is assumed to have enough space. + + + Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size) + + + Montgomery multiplication: a = x * y * R^(-1) mod m +
    + Based algorithm 14.36 of Handbook of Applied Cryptography. +
    +
  • m, x, y should have length n
  • +
  • a should have length (n + 1)
  • +
  • b = 2^32, R = b^n
  • +
    + The result is put in x +
    + NOTE: the indices of x, y, m, a different in HAC and in Java +
    + + return x = x % y - done in place (y value preserved) + + + do a left shift - this returns a new array. + + + do a right shift - this does it in place. + + + do a right shift by one - this does it in place. + + + returns x = x - y - we assume x is >= y + + + Class representing a simple version of a big decimal. A + SimpleBigDecimal is basically a + {@link java.math.BigInteger BigInteger} with a few digits on the right of + the decimal point. The number of (binary) digits on the right of the decimal + point is called the scale of the SimpleBigDecimal. + Unlike in {@link java.math.BigDecimal BigDecimal}, the scale is not adjusted + automatically, but must be set manually. All SimpleBigDecimals + taking part in the same arithmetic operation must have equal scale. The + result of a multiplication of two SimpleBigDecimals returns a + SimpleBigDecimal with double scale. + + + Returns a SimpleBigDecimal representing the same numerical + value as value. + @param value The value of the SimpleBigDecimal to be + created. + @param scale The scale of the SimpleBigDecimal to be + created. + @return The such created SimpleBigDecimal. + + + Constructor for SimpleBigDecimal. The value of the + constructed SimpleBigDecimal Equals bigInt / + 2scale. + @param bigInt The bigInt value parameter. + @param scale The scale of the constructed SimpleBigDecimal. + + + Class holding methods for point multiplication based on the window + τ-adic nonadjacent form (WTNAF). The algorithms are based on the + paper "Improved Algorithms for Arithmetic on Anomalous Binary Curves" + by Jerome A. Solinas. The paper first appeared in the Proceedings of + Crypto 1997. + + + The window width of WTNAF. The standard value of 4 is slightly less + than optimal for running time, but keeps space requirements for + precomputation low. For typical curves, a value of 5 or 6 results in + a better running time. When changing this value, the + αu's must be computed differently, see + e.g. "Guide to Elliptic Curve Cryptography", Darrel Hankerson, + Alfred Menezes, Scott Vanstone, Springer-Verlag New York Inc., 2004, + p. 121-122 + + + 24 + + + The αu's for a=0 as an array + of ZTauElements. + + + The αu's for a=0 as an array + of TNAFs. + + + The αu's for a=1 as an array + of ZTauElements. + + + The αu's for a=1 as an array + of TNAFs. + + + Computes the norm of an element λ of + Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The norm of λ. + + + Computes the norm of an element λ of + R[τ], where λ = u + vτ + and u and u are real numbers (elements of + R). + @param mu The parameter μ of the elliptic curve. + @param u The real part of the element λ of + R[τ]. + @param v The τ-adic part of the element + λ of R[τ]. + @return The norm of λ. + + + Rounds an element λ of R[τ] + to an element of Z[τ], such that their difference + has minimal norm. λ is given as + λ = λ0 + λ1τ. + @param lambda0 The component λ0. + @param lambda1 The component λ1. + @param mu The parameter μ of the elliptic curve. Must + equal 1 or -1. + @return The rounded element of Z[τ]. + @throws ArgumentException if lambda0 and + lambda1 do not have same scale. + + + Approximate division by n. For an integer + k, the value λ = s k / n is + computed to c bits of accuracy. + @param k The parameter k. + @param s The curve parameter s0 or + s1. + @param vm The Lucas Sequence element Vm. + @param a The parameter a of the elliptic curve. + @param m The bit length of the finite field + Fm. + @param c The number of bits of accuracy, i.e. the scale of the returned + SimpleBigDecimal. + @return The value λ = s k / n computed to + c bits of accuracy. + + + Computes the τ-adic NAF (non-adjacent form) of an + element λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The τ-adic NAF of λ. + + + Applies the operation τ() to an + AbstractF2mPoint. + @param p The AbstractF2mPoint to which τ() is applied. + @return τ(p) + + + Returns the parameter μ of the elliptic curve. + @param curve The elliptic curve from which to obtain μ. + The curve must be a Koblitz curve, i.e. a Equals + 0 or 1 and b Equals + 1. + @return μ of the elliptic curve. + @throws ArgumentException if the given ECCurve is not a Koblitz + curve. + + + Calculates the Lucas Sequence elements Uk-1 and + Uk or Vk-1 and + Vk. + @param mu The parameter μ of the elliptic curve. + @param k The index of the second element of the Lucas Sequence to be + returned. + @param doV If set to true, computes Vk-1 and + Vk, otherwise Uk-1 and + Uk. + @return An array with 2 elements, containing Uk-1 + and Uk or Vk-1 + and Vk. + + + Computes the auxiliary value tw. If the width is + 4, then for mu = 1, tw = 6 and for + mu = -1, tw = 10 + @param mu The parameter μ of the elliptic curve. + @param w The window width of the WTNAF. + @return the auxiliary value tw + + + Computes the auxiliary values s0 and + s1 used for partial modular reduction. + @param curve The elliptic curve for which to compute + s0 and s1. + @throws ArgumentException if curve is not a + Koblitz curve (Anomalous Binary Curve, ABC). + + + Partial modular reduction modulo + m - 1)/(τ - 1). + @param k The integer to be reduced. + @param m The bitlength of the underlying finite field. + @param a The parameter a of the elliptic curve. + @param s The auxiliary values s0 and + s1. + @param mu The parameter μ of the elliptic curve. + @param c The precision (number of bits of accuracy) of the partial + modular reduction. + @return ρ := k partmod (τm - 1)/(τ - 1) + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by a BigInteger using the reduced τ-adic + NAF (RTNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param k The BigInteger by which to Multiply p. + @return k * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param lambda The element λ of + Z[τ]. + @return λ * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method, given the TNAF + of λ. + @param p The AbstractF2mPoint to Multiply. + @param u The the TNAF of λ.. + @return λ * p + + + Computes the [τ]-adic window NAF of an element + λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @param width The window width of the resulting WNAF. + @param pow2w 2width. + @param tw The auxiliary value tw. + @param alpha The αu's for the window width. + @return The [τ]-adic window NAF of + λ. + + + Does the precomputation for WTNAF multiplication. + @param p The ECPoint for which to do the precomputation. + @param a The parameter a of the elliptic curve. + @return The precomputation array for p. + + + Class representing an element of Z[τ]. Let + λ be an element of Z[τ]. Then + λ is given as λ = u + vτ. The + components u and v may be used directly, there + are no accessor methods. + Immutable class. + + + The "real" part of λ. + + + The "τ-adic" part of λ. + + + Constructor for an element λ of + Z[τ]. + @param u The "real" part of λ. + @param v The "τ-adic" part of + λ. + + + Base class for an elliptic curve. + + + Adds PreCompInfo for a point on this curve, under a given name. Used by + ECMultipliers to save the precomputation for this ECPoint for use + by subsequent multiplication. + + @param point + The ECPoint to store precomputations for. + @param name + A String used to index precomputations of different types. + @param preCompInfo + The values precomputed by the ECMultiplier. + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. An (optional) z-scaling factor can be applied; effectively + each z coordinate is scaled by this value prior to normalization (but only one + actual multiplication is needed). + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + @param off + The start of the range of points to normalize + @param len + The length of the range of points to normalize + @param iso + The (optional) z-scaling factor - can be null + + + Sets the default ECMultiplier, unless already set. + + + Decode a point on this curve from its ASN.1 encoding. The different + encodings are taken account of, including point compression for + Fp (X9.62 s 4.2.1 pg 17). + @return The decoded point. + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + base class for points on elliptic curves. + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. + + @return a new ECPoint instance representing the same point, but with normalized coordinates + + + Normalizes this point, and then returns the affine x-coordinate. + + Note: normalization can be expensive, this method is deprecated in favour + of caller-controlled normalization. + + + Normalizes this point, and then returns the affine y-coordinate. + + Note: normalization can be expensive, this method is deprecated in favour + of caller-controlled normalization. + + + Returns the affine x-coordinate after checking that this point is normalized. + + @return The affine x-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the affine y-coordinate after checking that this point is normalized + + @return The affine y-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the x-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineXCoord if you expect the point to already have been normalized. + + @return the x-coordinate of this point + + + Returns the y-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineYCoord if you expect the point to already have been normalized. + + @return the y-coordinate of this point + + + return the field element encoded with point compression. (S 4.3.6) + + + Multiplies this ECPoint by the given number. + @param k The multiplicator. + @return k * this. + + + Create a point which encodes with point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + @param withCompression if true encode with point compression + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(boolean)} + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.CreatePoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + return a sqrt root - the routine verifies that the calculation returns the right value - if + none exists it returns null. + + + Create a point which encodes with point compression. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + + @deprecated Use ECCurve.createPoint to construct points + + + Create a point that encodes with or without point compresion. + + @param curve + the curve to use + @param x + affine x co-ordinate + @param y + affine y co-ordinate + @param withCompression + if true encode with point compression + + @deprecated per-point compression property will be removed, refer + {@link #getEncoded(bool)} + + + The auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Solves a quadratic equation z2 + z = beta(X9.62 + D.1.6) The other solution is z + 1. + + @param beta + The value to solve the qradratic equation for. + @return the solution for z2 + z = beta or + null if no solution exists. + + + @return the auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Returns true if this is a Koblitz curve (ABC curve). + @return true if this is a Koblitz curve (ABC curve), false otherwise + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + @deprecated Use ECCurve.createPoint to construct points + + + @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + + + Simple shift-and-add multiplication. Serves as reference implementation + to verify (possibly faster) implementations, and for very small scalars. + + @param p + The point to multiply. + @param k + The multiplier. + @return The result of the point multiplication kP. + + + Elliptic curve over Fp + + + Elliptic curves over F2m. The Weierstrass equation is given by + y2 + xy = x3 + ax2 + b. + + + The exponent m of F2m. + + + TPB: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + PPB: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + The point at infinity on this curve. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Return true if curve uses a Trinomial basis. + + @return true if curve Trinomial, false otherwise. + + + return a sqrt root - the routine verifies that the calculation + returns the right value - if none exists it returns null. + + + return the field name for this field. + + @return the string "Fp". + + + Class representing the Elements of the finite field + F2m in polynomial basis (PB) + representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial + basis representations are supported. Gaussian normal basis (GNB) + representation is not supported. + + + Indicates gaussian normal basis representation (GNB). Number chosen + according to X9.62. GNB is not implemented at present. + + + Indicates trinomial basis representation (Tpb). Number chosen + according to X9.62. + + + Indicates pentanomial basis representation (Ppb). Number chosen + according to X9.62. + + + Tpb or Ppb. + + + The exponent m of F2m. + + + The LongArray holding the bits. + + + Constructor for Ppb. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Constructor for Tpb. + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Checks, if the ECFieldElements a and b + are elements of the same field F2m + (having the same representation). + @param a field element. + @param b field element to be compared. + @throws ArgumentException if a and b + are not elements of the same field + F2m (having the same + representation). + + + @return the representation of the field + F2m, either of + {@link F2mFieldElement.Tpb} (trinomial + basis representation) or + {@link F2mFieldElement.Ppb} (pentanomial + basis representation). + + + @return the degree m of the reduction polynomial + f(z). + + + @return Tpb: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + Ppb: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always returns 0
    + Ppb: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always set to 0
    + Ppb: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + Elliptic curve points over Fp + + + Create a point which encodes without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + + + Create a point that encodes with or without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + @param withCompression if true encode with point compression + + + Elliptic curve points over F2m + + + @param curve base curve + @param x x point + @param y y point + + + @param curve base curve + @param x x point + @param y y point + @param withCompression true if encode with point compression. + + + Constructor for point at infinity + + + Interface for classes encapsulating a point multiplication algorithm + for ECPoints. + + + Multiplies the ECPoint p by k, i.e. + p is added k times to itself. + @param p The ECPoint to be multiplied. + @param k The factor by which p is multiplied. + @return p multiplied by k. + + + Joye's double-add algorithm. + + + Class holding precomputation data for fixed-point multiplications. + + + Interface for classes storing precomputation data for multiplication + algorithms. Used as a Memento (see GOF patterns) for + WNafMultiplier. + + + Array holding the precomputed ECPoints used for a fixed + point multiplication. + + + The width used for the precomputation. If a larger width precomputation + is already available this may be larger than was requested, so calling + code should refer to the actual width. + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left) using + mixed coordinates. + + + By default, addition will be done in Jacobian coordinates, and doubling will be done in + Modified Jacobian coordinates (independent of the original coordinate system of each point). + + + Montgomery ladder. + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (left-to-right). + + + Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left). + + + Class implementing the WNAF (Window Non-Adjacent Form) multiplication + algorithm. + + + Multiplies this by an integer k using the + Window NAF method. + @param k The integer by which this is multiplied. + @return A new ECPoint which equals this + multiplied by k. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Class holding precomputation data for the WNAF (Window Non-Adjacent Form) + algorithm. + + + Array holding the precomputed ECPoints used for a Window + NAF multiplication. + + + Array holding the negations of the precomputed ECPoints used + for a Window NAF multiplication. + + + Holds an ECPoint representing Twice(this). Used for the + Window NAF multiplication to create or extend the precomputed values. + + + Computes the Window NAF (non-adjacent Form) of an integer. + @param width The width w of the Window NAF. The width is + defined as the minimal number w, such that for any + w consecutive digits in the resulting representation, at + most one is non-zero. + @param k The integer of which the Window NAF is computed. + @return The Window NAF of the given width, such that the following holds: + k = &sum;i=0l-1 ki2i + , where the ki denote the elements of the + returned byte[]. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @param windowSizeCutoffs a monotonically increasing list of bit sizes at which to increment the window width + @return the window size to use + + + Class implementing the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by k using the reduced τ-adic NAF (RTNAF) + method. + @param p The AbstractF2mPoint to multiply. + @param k The integer by which to multiply k. + @return p multiplied by k. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] using + the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to multiply. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @return p multiplied by λ. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the window τ-adic NAF (TNAF) method, given the + WTNAF of λ. + @param p The AbstractF2mPoint to multiply. + @param u The the WTNAF of λ.. + @return λ * p + + + Class holding precomputation data for the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Array holding the precomputed AbstractF2mPoints used for the + WTNAF multiplication in + {@link org.bouncycastle.math.ec.multiplier.WTauNafMultiplier.multiply() + WTauNafMultiplier.multiply()}. + + + 'Zeroless' Signed Digit Left-to-Right. + + + 'Zeroless' Signed Digit Right-to-Left. + + + Utility methods for generating primes and testing for primality. + + + FIPS 186-4 C.6 Shawe-Taylor Random_Prime Routine + + Construct a provable prime number using a hash function. + + @param hash + the {@link Digest} instance to use (as "Hash()"). Cannot be null. + @param length + the length (in bits) of the prime to be generated. Must be at least 2. + @param inputSeed + the seed to be used for the generation of the requested prime. Cannot be null or + empty. + @return an {@link STOutput} instance containing the requested prime. + + + FIPS 186-4 C.3.2 Enhanced Miller-Rabin Probabilistic Primality Test + + Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. This is an + alternative to {@link #isMRProbablePrime(BigInteger, SecureRandom, int)} that provides more + information about a composite candidate, which may be useful when generating or validating + RSA moduli. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param random + the source of randomness to use to choose bases. + @param iterations + the number of randomly-chosen bases to perform the test for. + @return an {@link MROutput} instance that can be further queried for details. + + + A fast check for small divisors, up to some implementation-specific limit. + + @param candidate + the {@link BigInteger} instance to test for division by small factors. + + @return true if the candidate is found to have any small factors, + false otherwise. + + + FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test + + Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param random + the source of randomness to use to choose bases. + @param iterations + the number of randomly-chosen bases to perform the test for. + @return false if any witness to compositeness is found amongst the chosen bases + (so candidate is definitely NOT prime), or else true + (indicating primality with some probability dependent on the number of iterations + that were performed). + + + FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test (to a fixed base). + + Run a single iteration of the Miller-Rabin algorithm against the specified base. + + @param candidate + the {@link BigInteger} instance to test for primality. + @param baseValue + the base value to use for this iteration. + @return false if the specified base is a witness to compositeness (so + candidate is definitely NOT prime), or else true. + + + Used to return the output from the + {@linkplain Primes#enhancedMRProbablePrimeTest(BigInteger, SecureRandom, int) Enhanced + Miller-Rabin Probabilistic Primality Test} + + + Used to return the output from the {@linkplain Primes#generateSTRandomPrime(Digest, int, byte[]) Shawe-Taylor Random_Prime Routine} + + + + + BasicOcspResponse ::= SEQUENCE { + tbsResponseData ResponseData, + signatureAlgorithm AlgorithmIdentifier, + signature BIT STRING, + certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL + } + + + + + + Get all critical extension values, by oid + + IDictionary with string (OID) keys and Asn1OctetString values + + + + Get all non-critical extension values, by oid + + IDictionary with string (OID) keys and Asn1OctetString values + + + + Get non critical extensions. + + A set of non critical extension oids. + + + + Get any critical extensions. + + A sorted list of critical entension. + + + + Get the value of a given extension. + + The object ID of the extension. + An Asn1OctetString object if that extension is found or null if not. + + + The DER encoding of the tbsResponseData field. + In the event of an encoding error. + + + The certificates, if any, associated with the response. + In the event of an encoding error. + + + + Verify the signature against the tbsResponseData object we contain. + + + + The ASN.1 encoded representation of this object. + + + Generator for basic OCSP response objects. + + + basic constructor + + + construct with the responderID to be the SHA-1 keyHash of the passed in public key. + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param certStatus status of the certificate - null if okay + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param nextUpdate date when next update should be requested + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Add a response for a particular Certificate ID. + + @param certID certificate ID details + @param thisUpdate date this response was valid on + @param nextUpdate date when next update should be requested + @param certStatus status of the certificate - null if okay + @param singleExtensions optional extensions + + + Set the extensions for the response. + + @param responseExtensions the extension object to carry. + + + + Generate the signed response using the passed in signature calculator. + + Implementation of signing calculator factory. + The certificate chain associated with the response signer. + "produced at" date. + + + + Return an IEnumerable of the signature names supported by the generator. + + @return an IEnumerable containing recognised names. + + + create from an issuer certificate and the serial number of the + certificate it signed. + @exception OcspException if any problems occur creating the id fields. + + + Create a new CertificateID for a new serial number derived from a previous one + calculated for the same CA certificate. + + @param original the previously calculated CertificateID for the CA. + @param newSerialNumber the serial number for the new certificate of interest. + + @return a new CertificateID for newSerialNumber + + + return the serial number for the certificate associated + with this request. + + +
    +             OcspRequest     ::=     SEQUENCE {
    +                   tbsRequest                  TBSRequest,
    +                   optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
    +            
    +               TBSRequest      ::=     SEQUENCE {
    +                   version             [0]     EXPLICIT Version DEFAULT v1,
    +                   requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
    +                   requestList                 SEQUENCE OF Request,
    +                   requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
    +            
    +               Signature       ::=     SEQUENCE {
    +                   signatureAlgorithm      AlgorithmIdentifier,
    +                   signature               BIT STRING,
    +                   certs               [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL}
    +            
    +               Version         ::=             INTEGER  {  v1(0) }
    +            
    +               Request         ::=     SEQUENCE {
    +                   reqCert                     CertID,
    +                   singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
    +            
    +               CertID          ::=     SEQUENCE {
    +                   hashAlgorithm       AlgorithmIdentifier,
    +                   issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
    +                   issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
    +                   serialNumber        CertificateSerialNumber }
    +             
    +
    + + Return the DER encoding of the tbsRequest field. + @return DER encoding of tbsRequest + @throws OcspException in the event of an encoding error. + + + If the request is signed return a possibly empty CertStore containing the certificates in the + request. If the request is not signed the method returns null. + + @return null if not signed, a CertStore otherwise + @throws OcspException + + + Verify the signature against the TBSRequest object we contain. + + + return the ASN.1 encoded representation of this object. + + + return the object identifier representing the signature algorithm + + + Return whether or not this request is signed. + + @return true if signed false otherwise. + + + Add a request for the given CertificateID. + + @param certId certificate ID of interest + + + Add a request with extensions + + @param certId certificate ID of interest + @param singleRequestExtensions the extensions to attach to the request + + + Set the requestor name to the passed in X509Principal + + @param requestorName a X509Principal representing the requestor name. + + + Generate an unsigned request + + @return the OcspReq + @throws OcspException + + + Return an IEnumerable of the signature names supported by the generator. + + @return an IEnumerable containing recognised names. + + + return the ASN.1 encoded representation of this object. + + + base generator for an OCSP response - at the moment this only supports the + generation of responses containing BasicOCSP responses. + + + note 4 is not used. + + + Carrier for a ResponderID. + + + wrapper for the RevokedInfo object + + + return the revocation reason. Note: this field is optional, test for it + with hasRevocationReason() first. + @exception InvalidOperationException if a reason is asked for and none is avaliable + + + Return the status object for the response - null indicates good. + + @return the status object for the response, null if it is good. + + + return the NextUpdate value - note: this is an optional field so may + be returned as null. + + @return nextUpdate, or null if not present. + + + wrapper for the UnknownInfo object + + + Compressed data objects + + + Get the raw input stream contained in the object. + + + Return an uncompressed input stream which allows reading of the compressed data. + + + The algorithm used for compression + + + Class for producing compressed data packets. + + + +

    + Return an output stream which will save the data being written to + the compressed object. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + Stream to be used for output. + A Stream for output of the compressed data. + + + +
    + + +

    + Return an output stream which will compress the data as it is written to it. + The stream will be written out in chunks according to the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used. +

    +

    + Note: using this may break compatibility with RFC 1991 compliant tools. + Only recent OpenPGP implementations are capable of accepting these streams. +

    +
    + Stream to be used for output. + The buffer to use. + A Stream for output of the compressed data. + + + + +
    + + Close the compressed object.summary> + + + + Thrown if the IV at the start of a data stream indicates the wrong key is being used. + + + + Generic exception class for PGP encoding/decoding problems. + + + Return the raw input stream for the data stream. + + + Return true if the message is integrity protected. + True, if there is a modification detection code namespace associated + with this stream. + + + Note: This can only be called after the message has been read. + True, if the message verifies, false otherwise + + + Generator for encrypted objects. + + + Existing SecureRandom constructor. + The symmetric algorithm to use. + Source of randomness. + + + Creates a cipher stream which will have an integrity packet associated with it. + + + Base constructor. + The symmetric algorithm to use. + Source of randomness. + PGP 2.6.x compatibility required. + + + + Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1). + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Add a PBE encryption method to the encrypted object. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Add a PBE encryption method to the encrypted object. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Add a PBE encryption method to the encrypted object. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Add a public key encrypted session key to the encrypted object. + + + +

    + If buffer is non null stream assumed to be partial, otherwise the length will be used + to output a fixed length packet. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    +
    + + +

    + Return an output stream which will encrypt the data as it is written to it. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    +
    + + +

    + Return an output stream which will encrypt the data as it is written to it. + The stream will be written out in chunks according to the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used. +

    +
    +
    + + +

    + Close off the encrypted object - this is equivalent to calling Close() on the stream + returned by the Open() method. +

    +

    + Note: This does not close the underlying output stream, only the stream on top of + it created by the Open() method. +

    +
    +
    + + A holder for a list of PGP encryption method packets. + + + Key flag values for the KeyFlags subpacket. + + + + General class to handle JCA key pairs and convert them into OpenPGP ones. +

    + A word for the unwary, the KeyId for an OpenPGP public key is calculated from + a hash that includes the time of creation, if you pass a different date to the + constructor below with the same public private key pair the KeyIs will not be the + same as for previous generations of the key, so ideally you only want to do + this once. +

    +
    +
    + + Create a key pair from a PgpPrivateKey and a PgpPublicKey. + The public key. + The private key. + + + The keyId associated with this key pair. + + + + Generator for a PGP master and subkey ring. + This class will generate both the secret and public key rings + + + + + Create a new key ring generator using old style checksumming. It is recommended to use + SHA1 checksumming where possible. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + + If true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + + If true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + + Create a new key ring generator. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + The certification level for keys on this ring. + The master key pair. + The id to be associated with the ring. + The algorithm to be used to protect secret keys. + The hash algorithm. + The passPhrase to be used to protect secret keys. + Checksum the secret keys with SHA1 rather than the older 16 bit checksum. + Packets to be included in the certification hash. + Packets to be attached unhashed to the certification. + input secured random. + + + Add a subkey to the key ring to be generated with default certification. + + + + Add a subkey to the key ring to be generated with default certification. + + The key pair. + The hash algorithm. + + + + Add a subkey with specific hashed and unhashed packets associated with it and + default certification. + + Public/private key pair. + Hashed packet values to be included in certification. + Unhashed packets values to be included in certification. + + + + + Add a subkey with specific hashed and unhashed packets associated with it and + default certification. + + Public/private key pair. + Hashed packet values to be included in certification. + Unhashed packets values to be included in certification. + The hash algorithm. + exception adding subkey: + + + + Return the secret key ring. + + + Return the public key ring that corresponds to the secret key ring. + + + + Thrown if the key checksum is invalid. + + + + Class for processing literal data objects. + + + The special name indicating a "for your eyes only" packet. + + + Return the file name as an unintrepreted byte array. + + + The raw input stream for the data stream. + + + The input stream representing the data stream. + + + The format of the data stream - Binary or Text + + + The file name that's associated with the data stream. + + + The modification time for the file. + + + Class for producing literal data packets. + + + The special name indicating a "for your eyes only" packet. + + + + Generates literal data objects in the old format. + This is important if you need compatibility with PGP 2.6.x. + + If true, uses old format. + + + +

    + Open a literal data packet, returning a stream to store the data inside the packet. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + The stream we want the packet in. + The format we are using. + The name of the 'file'. + The length of the data we will write. + The time of last modification we want stored. +
    + + +

    + Open a literal data packet, returning a stream to store the data inside the packet, + as an indefinite length stream. The stream is written out as a series of partial + packets with a chunk size determined by the size of the passed in buffer. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +

    + Note: if the buffer is not a power of 2 in length only the largest power of 2 + bytes worth of the buffer will be used.

    +
    + The stream we want the packet in. + The format we are using. + The name of the 'file'. + The time of last modification we want stored. + The buffer to use for collecting data to put into chunks. +
    + + +

    + Open a literal data packet for the passed in FileInfo object, returning + an output stream for saving the file contents. +

    +

    + The stream created can be closed off by either calling Close() + on the stream or Close() on the generator. Closing the returned + stream does not close off the Stream parameter outStr. +

    +
    + The stream we want the packet in. + The format we are using. + The FileInfo object containg the packet details. +
    + + + Close the literal data packet - this is equivalent to calling Close() + on the stream returned by the Open() method. + + + + + A PGP marker packet - in general these should be ignored other than where + the idea is to preserve the original input stream. + + + + + General class for reading a PGP object stream. +

    + Note: if this class finds a PgpPublicKey or a PgpSecretKey it + will create a PgpPublicKeyRing, or a PgpSecretKeyRing for each + key found. If all you are trying to do is read a key ring file use + either PgpPublicKeyRingBundle or PgpSecretKeyRingBundle.

    +
    +
    + + Return the next object in the stream, or null if the end is reached. + On a parse error + + + + Return all available objects in a list. + + An IList containing all objects from this factory, in order. + + + A one pass signature object. + + + Initialise the signature object for verification. + + + Verify the calculated signature against the passed in PgpSignature. + + + Holder for a list of PgpOnePassSignature objects. + + + Padding functions. + + + A password based encryption object. + + + Return the raw input stream for the data stream. + + + Return the decrypted input stream, using the passed in passphrase. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Return the decrypted input stream, using the passed in passphrase. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Return the decrypted input stream, using the passed in passphrase. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + General class to contain a private key for use with other OpenPGP objects. + + + + Create a PgpPrivateKey from a keyID, the associated public data packet, and a regular private key. + + ID of the corresponding public key. + the public key data packet to be associated with this private key. + the private key data packet to be associated with this private key. + + + The keyId associated with the contained private key. + + + The public key packet associated with this private key, if available. + + + The contained private key. + + + General class to handle a PGP public key object. + + + + Create a PgpPublicKey from the passed in lightweight one. + + + Note: the time passed in affects the value of the key's keyId, so you probably only want + to do this once for a lightweight key, or make sure you keep track of the time you used. + + Asymmetric algorithm type representing the public key. + Actual public key to associate. + Date of creation. + If pubKey is not public. + On key creation problem. + + + Constructor for a sub-key. + + + Copy constructor. + The public key to copy. + + + Return the trust data associated with the public key, if present. + A byte array with trust data, null otherwise. + + + The number of valid seconds from creation time - zero means no expiry. + + + The fingerprint of the key + + + The public key contained in the object. + A lightweight public key. + If the key algorithm is not recognised. + + + Allows enumeration of any user IDs associated with the key. + An IEnumerable of string objects. + + + Allows enumeration of any user attribute vectors associated with the key. + An IEnumerable of PgpUserAttributeSubpacketVector objects. + + + Allows enumeration of any signatures associated with the passed in id. + The ID to be matched. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of signatures associated with the passed in user attributes. + The vector of user attributes to be matched. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of signatures of the passed in type that are on this key. + The type of the signature to be returned. + An IEnumerable of PgpSignature objects. + + + Allows enumeration of all signatures/certifications associated with this key. + An IEnumerable with all signatures/certifications. + + + Return all signatures/certifications directly associated with this key (ie, not to a user id). + + @return an iterator (possibly empty) with all signatures/certifications. + + + Check whether this (sub)key has a revocation signature on it. + True, if this (sub)key has been revoked. + + + Add a certification for an id to the given public key. + The key the certification is to be added to. + The ID the certification is associated with. + The new certification. + The re-certified key. + + + Add a certification for the given UserAttributeSubpackets to the given public key. + The key the certification is to be added to. + The attributes the certification is associated with. + The new certification. + The re-certified key. + + + + Remove any certifications associated with a user attribute subpacket on a key. + + The key the certifications are to be removed from. + The attributes to be removed. + + The re-certified key, or null if the user attribute subpacket was not found on the key. + + + + Remove any certifications associated with a given ID on a key. + The key the certifications are to be removed from. + The ID that is to be removed. + The re-certified key, or null if the ID was not found on the key. + + + Remove a certification associated with a given ID on a key. + The key the certifications are to be removed from. + The ID that the certfication is to be removed from. + The certfication to be removed. + The re-certified key, or null if the certification was not found. + + + Remove a certification associated with a given user attributes on a key. + The key the certifications are to be removed from. + The user attributes that the certfication is to be removed from. + The certification to be removed. + The re-certified key, or null if the certification was not found. + + + Add a revocation or some other key certification to a key. + The key the revocation is to be added to. + The key signature to be added. + The new changed public key object. + + + Remove a certification from the key. + The key the certifications are to be removed from. + The certfication to be removed. + The modified key, null if the certification was not found. + + + The version of this key. + + + The creation time of this key. + + + The number of valid days from creation time - zero means no expiry. + WARNING: This method will return 1 for keys with version > 3 that expire in less than 1 day + + + The keyId associated with the public key. + + + + Check if this key has an algorithm type that makes it suitable to use for encryption. + + + Note: with version 4 keys KeyFlags subpackets should also be considered when present for + determining the preferred use of the key. + + + true if this key algorithm is suitable for encryption. + + + + True, if this is a master key. + + + The algorithm code associated with the public key. + + + The strength of the key in bits. + + + A public key encrypted data object. + + + + Return the algorithm code for the symmetric algorithm used to encrypt the data. + + + + Return the decrypted data stream for the packet. + + + The key ID for the key used to encrypt the data. + + + + Class to hold a single master public key and its subkeys. +

    + Often PGP keyring files consist of multiple master keys, if you are trying to process + or construct one of these you should use the PgpPublicKeyRingBundle class. +

    +
    +
    + + Return the first public key in the ring. + + + Return the public key referred to by the passed in key ID if it is present. + + + Allows enumeration of all the public keys. + An IEnumerable of PgpPublicKey objects. + + + + Returns a new key ring with the public key passed in either added or + replacing an existing one. + + The public key ring to be modified. + The public key to be inserted. + A new PgpPublicKeyRing + + + Returns a new key ring with the public key passed in removed from the key ring. + The public key ring to be modified. + The public key to be removed. + A new PgpPublicKeyRing, or null if pubKey is not found. + + + + Often a PGP key ring file is made up of a succession of master/sub-key key rings. + If you want to read an entire public key file in one hit this is the class for you. + + + + Build a PgpPublicKeyRingBundle from the passed in input stream. + Input stream containing data. + If a problem parsing the stream occurs. + If an object is encountered which isn't a PgpPublicKeyRing. + + + Allow enumeration of the public key rings making up this collection. + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + If true, case is ignored in user ID comparisons. + An IEnumerable of key rings which matched (possibly none). + + + Return the PGP public key associated with the given key id. + The ID of the public key to return. + + + Return the public key ring which contains the key referred to by keyId + key ID to match against + + + + Return true if a key matching the passed in key ID is present, false otherwise. + + key ID to look for. + + + + Return a new bundle containing the contents of the passed in bundle and + the passed in public key ring. + + The PgpPublicKeyRingBundle the key ring is to be added to. + The key ring to be added. + A new PgpPublicKeyRingBundle merging the current one with the passed in key ring. + If the keyId for the passed in key ring is already present. + + + + Return a new bundle containing the contents of the passed in bundle with + the passed in public key ring removed. + + The PgpPublicKeyRingBundle the key ring is to be removed from. + The key ring to be removed. + A new PgpPublicKeyRingBundle not containing the passed in key ring. + If the keyId for the passed in key ring is not present. + + + Return the number of key rings in this collection. + + + General class to handle a PGP secret key object. + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + If utf8PassPhrase is true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + If utf8PassPhrase is true, conversion of the passphrase to bytes uses Encoding.UTF8.GetBytes(), otherwise the conversion + is performed using Convert.ToByte(), which is the historical behaviour of the library (1.7 and earlier). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + Extract a PgpPrivateKey from this secret key's encrypted contents. + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Return a copy of the passed in secret key, encrypted using a new password + and the passed in algorithm. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + The PgpSecretKey to be copied. + The current password for the key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + Replace the passed the public key on the passed in secret key. + Secret key to change. + New public key. + A new secret key. + If KeyId's do not match. + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Parse a secret key from one of the GPG S expression keys associating it with the passed in public key. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Parse a secret key from one of the GPG S expression keys. + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + Parse a secret key from one of the GPG S expression keys. + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Parse a secret key from one of the GPG S expression keys. + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + + Parse a secret key from one of the GPG S expression keys. + + + + + Check if this key has an algorithm type that makes it suitable to use for signing. + + + Note: with version 4 keys KeyFlags subpackets should also be considered when present for + determining the preferred use of the key. + + + true if this key algorithm is suitable for use with signing. + + + + True, if this is a master key. + + + Detect if the Secret Key's Private Key is empty or not + + + The algorithm the key is encrypted with. + + + The key ID of the public key associated with this key. + + + Return the S2K usage associated with this key. + + + Return the S2K used to process this key. + + + The public key associated with this key. + + + Allows enumeration of any user IDs associated with the key. + An IEnumerable of string objects. + + + Allows enumeration of any user attribute vectors associated with the key. + An IEnumerable of string objects. + + + + Class to hold a single master secret key and its subkeys. +

    + Often PGP keyring files consist of multiple master keys, if you are trying to process + or construct one of these you should use the PgpSecretKeyRingBundle class. +

    +
    +
    + + Return the public key for the master key. + + + Return the master private key. + + + Allows enumeration of the secret keys. + An IEnumerable of PgpSecretKey objects. + + + + Return an iterator of the public keys in the secret key ring that + have no matching private key. At the moment only personal certificate data + appears in this fashion. + + An IEnumerable of unattached, or extra, public keys. + + + + Replace the public key set on the secret ring with the corresponding key off the public ring. + + Secret ring to be changed. + Public ring containing the new public key set. + + + + Return a copy of the passed in secret key ring, with the master key and sub keys encrypted + using a new password and the passed in algorithm. + + The PgpSecretKeyRing to be copied. + The current password for key. + The new password for the key. + The algorithm to be used for the encryption. + Source of randomness. + + + + Returns a new key ring with the secret key passed in either added or + replacing an existing one with the same key ID. + + The secret key ring to be modified. + The secret key to be inserted. + A new PgpSecretKeyRing + + + Returns a new key ring with the secret key passed in removed from the key ring. + The secret key ring to be modified. + The secret key to be removed. + A new PgpSecretKeyRing, or null if secKey is not found. + + + + Often a PGP key ring file is made up of a succession of master/sub-key key rings. + If you want to read an entire secret key file in one hit this is the class for you. + + + + Build a PgpSecretKeyRingBundle from the passed in input stream. + Input stream containing data. + If a problem parsing the stream occurs. + If an object is encountered which isn't a PgpSecretKeyRing. + + + Allow enumeration of the secret key rings making up this collection. + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + An IEnumerable of key rings which matched (possibly none). + + + Allow enumeration of the key rings associated with the passed in userId. + The user ID to be matched. + If true, userId need only be a substring of an actual ID string to match. + If true, case is ignored in user ID comparisons. + An IEnumerable of key rings which matched (possibly none). + + + Return the PGP secret key associated with the given key id. + The ID of the secret key to return. + + + Return the secret key ring which contains the key referred to by keyId + The ID of the secret key + + + + Return true if a key matching the passed in key ID is present, false otherwise. + + key ID to look for. + + + + Return a new bundle containing the contents of the passed in bundle and + the passed in secret key ring. + + The PgpSecretKeyRingBundle the key ring is to be added to. + The key ring to be added. + A new PgpSecretKeyRingBundle merging the current one with the passed in key ring. + If the keyId for the passed in key ring is already present. + + + + Return a new bundle containing the contents of the passed in bundle with + the passed in secret key ring removed. + + The PgpSecretKeyRingBundle the key ring is to be removed from. + The key ring to be removed. + A new PgpSecretKeyRingBundle not containing the passed in key ring. + If the keyId for the passed in key ring is not present. + + + Return the number of rings in this collection. + + + A PGP signature object. + + + Return true if this signature represents a certification. + + + + Verify the signature as certifying the passed in public key as associated + with the passed in user attributes. + + User attributes the key was stored under. + The key to be verified. + True, if the signature matches, false otherwise. + + + + Verify the signature as certifying the passed in public key as associated + with the passed in ID. + + ID the key was stored under. + The key to be verified. + True, if the signature matches, false otherwise. + + + Verify a certification for the passed in key against the passed in master key. + The key we are verifying against. + The key we are verifying. + True, if the certification is valid, false otherwise. + + + Verify a key certification, such as revocation, for the passed in key. + The key we are checking. + True, if the certification is valid, false otherwise. + + + + Return true if the passed in signature type represents a certification, false if the signature type is not. + + + true if signatureType is a certification, false otherwise. + + + The OpenPGP version number for this signature. + + + The key algorithm associated with this signature. + + + The hash algorithm associated with this signature. + + + The ID of the key that created the signature. + + + The creation time of this signature. + + + + Return true if the signature has either hashed or unhashed subpackets. + + + + Generator for PGP signatures. + + + Create a generator for the passed in keyAlgorithm and hashAlgorithm codes. + + + Initialise the generator for signing. + + + Initialise the generator for signing. + + + Return the one pass header associated with the current signature. + + + Return a signature object containing the current signature state. + + + Generate a certification for the passed in ID and key. + The ID we are certifying against the public key. + The key we are certifying against the ID. + The certification. + + + Generate a certification for the passed in userAttributes. + The ID we are certifying against the public key. + The key we are certifying against the ID. + The certification. + + + Generate a certification for the passed in key against the passed in master key. + The key we are certifying against. + The key we are certifying. + The certification. + + + Generate a certification, such as a revocation, for the passed in key. + The key we are certifying. + The certification. + + + A list of PGP signatures - normally in the signature block after literal data. + + + Generator for signature subpackets. + + + + Add a TrustSignature packet to the signature. The values for depth and trust are largely + installation dependent but there are some guidelines in RFC 4880 - 5.2.3.13. + + true if the packet is critical. + depth level. + trust amount. + + + + Set the number of seconds a key is valid for after the time of its creation. + A value of zero means the key never expires. + + True, if should be treated as critical, false otherwise. + The number of seconds the key is valid, or zero if no expiry. + + + + Set the number of seconds a signature is valid for after the time of its creation. + A value of zero means the signature never expires. + + True, if should be treated as critical, false otherwise. + The number of seconds the signature is valid, or zero if no expiry. + + + + Set the creation time for the signature. +

    + Note: this overrides the generation of a creation time when the signature + is generated.

    +
    +
    + + + Sets revocation reason sub packet + + + + + Sets revocation key sub packet + + + + + Sets issuer key sub packet + + + + Container for a list of signature subpackets. + + + Return true if a particular subpacket type exists. + + @param type type to look for. + @return true if present, false otherwise. + + + Return all signature subpackets of the passed in type. + @param type subpacket type code + @return an array of zero or more matching subpackets. + + + + Return the number of seconds a signature is valid for after its creation date. + A value of zero means the signature never expires. + + Seconds a signature is valid for. + + + + Return the number of seconds a key is valid for after its creation date. + A value of zero means the key never expires. + + Seconds a signature is valid for. + + + Return the number of packets this vector contains. + + + Container for a list of user attribute subpackets. + + + Basic utility class. + + + + Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is + the historical behaviour of the library (1.7 and earlier). + + + + + The passphrase is encoded to bytes using UTF8 (Encoding.UTF8.GetBytes). + + + + + Allows the caller to handle the encoding of the passphrase to bytes. + + + + Write out the passed in file as a literal data packet. + + + Write out the passed in file as a literal data packet in partial packet format. + + + + Return either an ArmoredInputStream or a BcpgInputStream based on whether + the initial characters of the stream are binary PGP encodings or not. + + + + Generator for old style PGP V3 Signatures. + + + Create a generator for the passed in keyAlgorithm and hashAlgorithm codes. + + + Initialise the generator for signing. + + + Initialise the generator for signing. + + + Return the one pass header associated with the current signature. + + + Return a V3 signature object containing the current signature state. + + + Utility functions for looking a S-expression keys. This class will move when it finds a better home! +

    + Format documented here: + http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=agent/keyformat.txt;h=42c4b1f06faf1bbe71ffadc2fee0fad6bec91a97;hb=refs/heads/master +

    +
    + + PEM generator for the original set of PEM objects used in Open SSL. + + + + A + + + + + Class for reading OpenSSL PEM encoded streams containing + X509 certificates, PKCS8 encoded keys and PKCS7 objects. +

    + In the case of PKCS7 objects the reader will return a CMS ContentInfo object. Keys and + Certificates will be returned using the appropriate java.security type.

    +
    + + + A + + + + + Create a new PemReader + + @param reader the Reader + + + Create a new PemReader with a password finder + + @param reader the Reader + @param pFinder the password finder + + + Reads in a X509Certificate. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Reads in a X509CRL. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Reads in a PKCS10 certification request. + + @return the certificate request. + @throws IOException if an I/O error occured + + + Reads in a X509 Attribute Certificate. + + @return the X509 Attribute Certificate + @throws IOException if an I/O error occured + + + Reads in a PKCS7 object. This returns a ContentInfo object suitable for use with the CMS + API. + + @return the X509Certificate + @throws IOException if an I/O error occured + + + Read a Key Pair + + + General purpose writer for OpenSSL PEM objects. + + + A generic PEM writer, based on RFC 1421 + + + Base constructor. + + @param out output stream to use. + + + Return the number of bytes or characters required to contain the + passed in object if it is PEM encoded. + + @param obj pem object to be output + @return an estimate of the number of bytes + + + The TextWriter object to write the output to. + + + Constructor for an unencrypted private key PEM object. + + @param key private key to be encoded. + + + Constructor for an encrypted private key PEM object. + + @param key private key to be encoded + @param algorithm encryption algorithm to use + @param provider provider to use + @throws NoSuchAlgorithmException if algorithm/mode cannot be found + + + + A class for verifying and creating Pkcs10 Certification requests. + + + CertificationRequest ::= Sequence { + certificationRequestInfo CertificationRequestInfo, + signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + signature BIT STRING + } + + CertificationRequestInfo ::= Sequence { + version Integer { v1(0) } (v1,...), + subject Name, + subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + attributes [0] Attributes{{ CRIAttributes }} + } + + Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + + Attr { ATTRIBUTE:IOSet } ::= Sequence { + type ATTRIBUTE.&id({IOSet}), + values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + } + + see + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + Name of Sig Alg. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + Matching Private key for nominated (above) public key to be used to sign the request. + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + The factory for signature calculators to sign the PKCS#10 request with. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + Matching Private key for nominated (above) public key to be used to sign the request. + + + + Get the public key. + + The public key. + + + + Verify Pkcs10 Cert Request is valid. + + true = valid. + + + + A class for creating and verifying Pkcs10 Certification requests (this is an extension on ). + The requests are made using delay signing. This is useful for situations where + the private key is in another environment and not directly accessible (e.g. HSM) + So the first step creates the request, then the signing is done outside this + object and the signature is then used to complete the request. + + + CertificationRequest ::= Sequence { + certificationRequestInfo CertificationRequestInfo, + signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + signature BIT STRING + } + + CertificationRequestInfo ::= Sequence { + version Integer { v1(0) } (v1,...), + subject Name, + subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + attributes [0] Attributes{{ CRIAttributes }} + } + + Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + + Attr { ATTRIBUTE:IOSet } ::= Sequence { + type ATTRIBUTE.&id({IOSet}), + values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + } + + see + + + + Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + + Name of Sig Alg. + X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + Public Key to be included in cert reqest. + ASN1Set of Attributes. + + After the object is constructed use the and finally the + SignRequest methods to finalize the request. + + + + simply return the cert entry for the private key + + + Utility class for reencoding PKCS#12 files to definite length. + + + Just re-encode the outer layer of the PKCS#12 file to definite length encoding. + + @param berPKCS12File - original PKCS#12 file + @return a byte array representing the DER encoding of the PFX structure + @throws IOException + + + Re-encode the PKCS#12 structure to definite length encoding at the inner layer + as well, recomputing the MAC accordingly. + + @param berPKCS12File - original PKCS12 file. + @param provider - provider to use for MAC calculation. + @return a byte array representing the DER encoding of the PFX structure. + @throws IOException on parsing, encoding errors. + + + + Returns the revocationDate. + + + + + Returns the certStatus. + + + + Returns an immutable Set of X.509 attribute certificate + extensions that this PkixAttrCertChecker supports or + null if no extensions are supported. +

    + Each element of the set is a String representing the + Object Identifier (OID) of the X.509 extension that is supported. +

    +

    + All X.509 attribute certificate extensions that a + PkixAttrCertChecker might possibly be able to process + should be included in the set. +

    + + @return an immutable Set of X.509 extension OIDs (in + String format) supported by this + PkixAttrCertChecker, or null if no + extensions are supported +
    + + Performs checks on the specified attribute certificate. Every handled + extension is rmeoved from the unresolvedCritExts + collection. + + @param attrCert The attribute certificate to be checked. + @param certPath The certificate path which belongs to the attribute + certificate issuer public key certificate. + @param holderCertPath The certificate path which belongs to the holder + certificate. + @param unresolvedCritExts a Collection of OID strings + representing the current set of unresolved critical extensions + @throws CertPathValidatorException if the specified attribute certificate + does not pass the check. + + + Returns a clone of this object. + + @return a copy of this PkixAttrCertChecker + + + Build and validate a CertPath using the given parameter. + + @param params PKIXBuilderParameters object containing all information to + build the CertPath + + + CertPathValidatorSpi implementation for X.509 Attribute Certificates la RFC 3281. + + @see org.bouncycastle.x509.ExtendedPkixParameters + + + Validates an attribute certificate with the given certificate path. + +

    + params must be an instance of + ExtendedPkixParameters. +

    + The target constraints in the params must be an + X509AttrCertStoreSelector with at least the attribute + certificate criterion set. Obey that also target informations may be + necessary to correctly validate this attribute certificate. +

    + The attribute certificate issuer must be added to the trusted attribute + issuers with {@link ExtendedPkixParameters#setTrustedACIssuers(Set)}. +

    + @param certPath The certificate path which belongs to the attribute + certificate issuer public key certificate. + @param params The PKIX parameters. + @return A PKIXCertPathValidatorResult of the result of + validating the certPath. + @throws InvalidAlgorithmParameterException if params is + inappropriate for this validator. + @throws CertPathValidatorException if the verification fails. +
    + + + Summary description for PkixBuilderParameters. + + + + + Summary description for PkixParameters. + + + + This is the default PKIX validity model. Actually there are two variants + of this: The PKIX model and the modified PKIX model. The PKIX model + verifies that all involved certificates must have been valid at the + current time. The modified PKIX model verifies that all involved + certificates were valid at the signing time. Both are indirectly choosen + with the {@link PKIXParameters#setDate(java.util.Date)} method, so this + methods sets the Date when all certificates must have been + valid. + + + This model uses the following validity model. Each certificate must have + been valid at the moment where is was used. That means the end + certificate must have been valid at the time the signature was done. The + CA certificate which signed the end certificate must have been valid, + when the end certificate was signed. The CA (or Root CA) certificate must + have been valid, when the CA certificate was signed and so on. So the + {@link PKIXParameters#setDate(java.util.Date)} method sets the time, when + the end certificate must have been valid.

    It is used e.g. + in the German signature law. + + + Creates an instance of PKIXParameters with the specified Set of + most-trusted CAs. Each element of the set is a TrustAnchor.
    +
    + Note that the Set is copied to protect against subsequent modifications. + + @param trustAnchors + a Set of TrustAnchors + + @exception InvalidAlgorithmParameterException + if the specified Set is empty + (trustAnchors.isEmpty() == true) + @exception NullPointerException + if the specified Set is null + @exception ClassCastException + if any of the elements in the Set are not of type + java.security.cert.TrustAnchor +
    + + Returns the required constraints on the target certificate. The + constraints are returned as an instance of CertSelector. If + null, no constraints are defined.
    +
    + Note that the CertSelector returned is cloned to protect against + subsequent modifications. + + @return a CertSelector specifying the constraints on the target + certificate (or null) + + @see #setTargetCertConstraints(CertSelector) +
    + + Sets the required constraints on the target certificate. The constraints + are specified as an instance of CertSelector. If null, no constraints are + defined.
    +
    + Note that the CertSelector specified is cloned to protect against + subsequent modifications. + + @param selector + a CertSelector specifying the constraints on the target + certificate (or null) + + @see #getTargetCertConstraints() +
    + + Returns an immutable Set of initial policy identifiers (OID strings), + indicating that any one of these policies would be acceptable to the + certificate user for the purposes of certification path processing. The + default return value is an empty Set, which is + interpreted as meaning that any policy would be acceptable. + + @return an immutable Set of initial policy OIDs in String + format, or an empty Set (implying any policy is + acceptable). Never returns null. + + @see #setInitialPolicies(java.util.Set) + + + Sets the Set of initial policy identifiers (OID strings), + indicating that any one of these policies would be acceptable to the + certificate user for the purposes of certification path processing. By + default, any policy is acceptable (i.e. all policies), so a user that + wants to allow any policy as acceptable does not need to call this + method, or can call it with an empty Set (or + null).
    +
    + Note that the Set is copied to protect against subsequent modifications.
    +
    + + @param initialPolicies + a Set of initial policy OIDs in String format (or + null) + + @exception ClassCastException + if any of the elements in the set are not of type String + + @see #getInitialPolicies() +
    + + Sets a List of additional certification path checkers. If + the specified List contains an object that is not a PKIXCertPathChecker, + it is ignored.
    +
    + Each PKIXCertPathChecker specified implements additional + checks on a certificate. Typically, these are checks to process and + verify private extensions contained in certificates. Each + PKIXCertPathChecker should be instantiated with any + initialization parameters needed to execute the check.
    +
    + This method allows sophisticated applications to extend a PKIX + CertPathValidator or CertPathBuilder. Each + of the specified PKIXCertPathCheckers will be called, in turn, by a PKIX + CertPathValidator or CertPathBuilder for + each certificate processed or validated.
    +
    + Regardless of whether these additional PKIXCertPathCheckers are set, a + PKIX CertPathValidator or CertPathBuilder + must perform all of the required PKIX checks on each certificate. The one + exception to this rule is if the RevocationEnabled flag is set to false + (see the {@link #setRevocationEnabled(boolean) setRevocationEnabled} + method).
    +
    + Note that the List supplied here is copied and each PKIXCertPathChecker + in the list is cloned to protect against subsequent modifications. + + @param checkers + a List of PKIXCertPathCheckers. May be null, in which case no + additional checkers will be used. + @exception ClassCastException + if any of the elements in the list are not of type + java.security.cert.PKIXCertPathChecker + @see #getCertPathCheckers() +
    + + Returns the List of certification path checkers. Each PKIXCertPathChecker + in the returned IList is cloned to protect against subsequent modifications. + + @return an immutable List of PKIXCertPathCheckers (may be empty, but not + null) + + @see #setCertPathCheckers(java.util.List) + + + Adds a PKIXCertPathChecker to the list of certification + path checkers. See the {@link #setCertPathCheckers setCertPathCheckers} + method for more details. +

    + Note that the PKIXCertPathChecker is cloned to protect + against subsequent modifications.

    + + @param checker a PKIXCertPathChecker to add to the list of + checks. If null, the checker is ignored (not added to list). +
    + + Method to support Clone() under J2ME. + super.Clone() does not exist and fields are not copied. + + @param params Parameters to set. If this are + ExtendedPkixParameters they are copied to. + + + Sets the Bouncy Castle Stores for finding CRLs, certificates, attribute + certificates or cross certificates. +

    + The IList is cloned. +

    + + @param stores A list of stores to use. + @see #getStores + @throws ClassCastException if an element of stores is not + a {@link Store}. +
    + + Adds a Bouncy Castle {@link Store} to find CRLs, certificates, attribute + certificates or cross certificates. +

    + This method should be used to add local stores, like collection based + X.509 stores, if available. Local stores should be considered first, + before trying to use additional (remote) locations, because they do not + need possible additional network traffic. +

    + If store is null it is ignored. +

    + + @param store The store to add. + @see #getStores +
    + + Adds an additional Bouncy Castle {@link Store} to find CRLs, certificates, + attribute certificates or cross certificates. +

    + You should not use this method. This method is used for adding additional + X.509 stores, which are used to add (remote) locations, e.g. LDAP, found + during X.509 object processing, e.g. in certificates or CRLs. This method + is used in PKIX certification path processing. +

    + If store is null it is ignored. +

    + + @param store The store to add. + @see #getStores() +
    + + Returns an IList of additional Bouncy Castle + Stores used for finding CRLs, certificates, attribute + certificates or cross certificates. + + @return an immutable IList of additional Bouncy Castle + Stores. Never null. + + @see #addAddionalStore(Store) + + + Returns an IList of Bouncy Castle + Stores used for finding CRLs, certificates, attribute + certificates or cross certificates. + + @return an immutable IList of Bouncy Castle + Stores. Never null. + + @see #setStores(IList) + + + Sets if additional {@link X509Store}s for locations like LDAP found in + certificates or CRLs should be used. + + @param enabled true if additional stores are used. + + + Returns the required constraints on the target certificate or attribute + certificate. The constraints are returned as an instance of + IX509Selector. If null, no constraints are + defined. + +

    + The target certificate in a PKIX path may be a certificate or an + attribute certificate. +

    + Note that the IX509Selector returned is cloned to protect + against subsequent modifications. +

    + @return a IX509Selector specifying the constraints on the + target certificate or attribute certificate (or null) + @see #setTargetConstraints + @see X509CertStoreSelector + @see X509AttributeCertStoreSelector +
    + + Sets the required constraints on the target certificate or attribute + certificate. The constraints are specified as an instance of + IX509Selector. If null, no constraints are + defined. +

    + The target certificate in a PKIX path may be a certificate or an + attribute certificate. +

    + Note that the IX509Selector specified is cloned to protect + against subsequent modifications. +

    + + @param selector a IX509Selector specifying the constraints on + the target certificate or attribute certificate (or + null) + @see #getTargetConstraints + @see X509CertStoreSelector + @see X509AttributeCertStoreSelector +
    + + Returns the trusted attribute certificate issuers. If attribute + certificates is verified the trusted AC issuers must be set. +

    + The returned ISet consists of TrustAnchors. +

    + The returned ISet is immutable. Never null +

    + + @return Returns an immutable set of the trusted AC issuers. +
    + + Sets the trusted attribute certificate issuers. If attribute certificates + is verified the trusted AC issuers must be set. +

    + The trustedACIssuers must be a ISet of + TrustAnchor +

    + The given set is cloned. +

    + + @param trustedACIssuers The trusted AC issuers to set. Is never + null. + @throws ClassCastException if an element of stores is not + a TrustAnchor. +
    + + Returns the necessary attributes which must be contained in an attribute + certificate. +

    + The returned ISet is immutable and contains + Strings with the OIDs. +

    + + @return Returns the necessary AC attributes. +
    + + Sets the necessary which must be contained in an attribute certificate. +

    + The ISet must contain Strings with the + OIDs. +

    + The set is cloned. +

    + + @param necessaryACAttributes The necessary AC attributes to set. + @throws ClassCastException if an element of + necessaryACAttributes is not a + String. +
    + + Returns the attribute certificates which are not allowed. +

    + The returned ISet is immutable and contains + Strings with the OIDs. +

    + + @return Returns the prohibited AC attributes. Is never null. +
    + + Sets the attribute certificates which are not allowed. +

    + The ISet must contain Strings with the + OIDs. +

    + The set is cloned. +

    + + @param prohibitedACAttributes The prohibited AC attributes to set. + @throws ClassCastException if an element of + prohibitedACAttributes is not a + String. +
    + + Returns the attribute certificate checker. The returned set contains + {@link PKIXAttrCertChecker}s and is immutable. + + @return Returns the attribute certificate checker. Is never + null. + + + Sets the attribute certificate checkers. +

    + All elements in the ISet must a {@link PKIXAttrCertChecker}. +

    +

    + The given set is cloned. +

    + + @param attrCertCheckers The attribute certificate checkers to set. Is + never null. + @throws ClassCastException if an element of attrCertCheckers + is not a PKIXAttrCertChecker. +
    + + Whether delta CRLs should be used for checking the revocation status. + Defaults to false. + + + The validity model. + @see #CHAIN_VALIDITY_MODEL + @see #PKIX_VALIDITY_MODEL + + + Returns if additional {@link X509Store}s for locations like LDAP found + in certificates or CRLs should be used. + + @return Returns true if additional stores are used. + + + Returns an instance of PkixBuilderParameters. +

    + This method can be used to get a copy from other + PKIXBuilderParameters, PKIXParameters, + and ExtendedPKIXParameters instances. +

    + + @param pkixParams The PKIX parameters to create a copy of. + @return An PkixBuilderParameters instance. +
    + + + Excluded certificates are not used for building a certification path. + + the excluded certificates. + + + + Sets the excluded certificates which are not used for building a + certification path. If the ISet is null an + empty set is assumed. + + + The given set is cloned to protect it against subsequent modifications. + + The excluded certificates to set. + + + Can alse handle ExtendedPKIXBuilderParameters and + PKIXBuilderParameters. + + @param params Parameters to set. + @see org.bouncycastle.x509.ExtendedPKIXParameters#setParams(java.security.cert.PKIXParameters) + + + Makes a copy of this PKIXParameters object. Changes to the + copy will not affect the original and vice versa. + + @return a copy of this PKIXParameters object + + + An immutable sequence of certificates (a certification path).
    +
    + This is an abstract class that defines the methods common to all CertPaths. + Subclasses can handle different kinds of certificates (X.509, PGP, etc.).
    +
    + All CertPath objects have a type, a list of Certificates, and one or more + supported encodings. Because the CertPath class is immutable, a CertPath + cannot change in any externally visible way after being constructed. This + stipulation applies to all public fields and methods of this class and any + added or overridden by subclasses.
    +
    + The type is a string that identifies the type of Certificates in the + certification path. For each certificate cert in a certification path + certPath, cert.getType().equals(certPath.getType()) must be true.
    +
    + The list of Certificates is an ordered List of zero or more Certificates. + This List and all of the Certificates contained in it must be immutable.
    +
    + Each CertPath object must support one or more encodings so that the object + can be translated into a byte array for storage or transmission to other + parties. Preferably, these encodings should be well-documented standards + (such as PKCS#7). One of the encodings supported by a CertPath is considered + the default encoding. This encoding is used if no encoding is explicitly + requested (for the {@link #getEncoded()} method, for instance).
    +
    + All CertPath objects are also Serializable. CertPath objects are resolved + into an alternate {@link CertPathRep} object during serialization. This + allows a CertPath object to be serialized into an equivalent representation + regardless of its underlying implementation.
    +
    + CertPath objects can be created with a CertificateFactory or they can be + returned by other classes, such as a CertPathBuilder.
    +
    + By convention, X.509 CertPaths (consisting of X509Certificates), are ordered + starting with the target certificate and ending with a certificate issued by + the trust anchor. That is, the issuer of one certificate is the subject of + the following one. The certificate representing the + {@link TrustAnchor TrustAnchor} should not be included in the certification + path. Unvalidated X.509 CertPaths may not follow these conventions. PKIX + CertPathValidators will detect any departure from these conventions that + cause the certification path to be invalid and throw a + CertPathValidatorException.
    +
    + Concurrent Access
    +
    + All CertPath objects must be thread-safe. That is, multiple threads may + concurrently invoke the methods defined in this class on a single CertPath + object (or more than one) with no ill effects. This is also true for the List + returned by CertPath.getCertificates.
    +
    + Requiring CertPath objects to be immutable and thread-safe allows them to be + passed around to various pieces of code without worrying about coordinating + access. Providing this thread-safety is generally not difficult, since the + CertPath and List objects in question are immutable. + + @see CertificateFactory + @see CertPathBuilder + + CertPath implementation for X.509 certificates. + +
    + + @param certs + + + Creates a CertPath of the specified type. + This constructor is protected because most users should use + a CertificateFactory to create CertPaths. + @param type the standard name of the type of Certificatesin this path + + + + Creates a CertPath of the specified type. + This constructor is protected because most users should use + a CertificateFactory to create CertPaths. + + @param type the standard name of the type of Certificatesin this path + + + + Compares this certification path for equality with the specified object. + Two CertPaths are equal if and only if their types are equal and their + certificate Lists (and by implication the Certificates in those Lists) + are equal. A CertPath is never equal to an object that is not a CertPath.
    +
    + This algorithm is implemented by this method. If it is overridden, the + behavior specified here must be maintained. + + @param other + the object to test for equality with this certification path + + @return true if the specified object is equal to this certification path, + false otherwise + + @see Object#hashCode() Object.hashCode() +
    + + Returns the encoded form of this certification path, using + the default encoding. + + @return the encoded bytes + @exception CertificateEncodingException if an encoding error occurs + + + + Returns the encoded form of this certification path, using + the specified encoding. + + @param encoding the name of the encoding to use + @return the encoded bytes + @exception CertificateEncodingException if an encoding error + occurs or the encoding requested is not supported + + + + Return a DERObject containing the encoded certificate. + + @param cert the X509Certificate object to be encoded + + @return the DERObject + + + + Returns an iteration of the encodings supported by this + certification path, with the default encoding + first. Attempts to modify the returned Iterator via its + remove method result in an UnsupportedOperationException. + + @return an Iterator over the names of the supported encodings (as Strings) + + + + + Returns the list of certificates in this certification + path. + + + + Implements the PKIX CertPathBuilding algorithm for BouncyCastle. + + @see CertPathBuilderSpi + + + Build and validate a CertPath using the given parameter. + + @param params PKIXBuilderParameters object containing all information to + build the CertPath + + + + Summary description for PkixCertPathBuilderException. + + + + + Summary description for PkixCertPathBuilderResult. + + + + + Summary description for PkixCertPathValidatorResult. + + + + * Initializes the internal state of this PKIXCertPathChecker. + *

    + * The forward flag specifies the order that certificates + * will be passed to the {@link #check check} method (forward or reverse). A + * PKIXCertPathChecker must support reverse checking + * and may support forward checking. + *

    + * + * @param forward + * the order that certificates are presented to the + * check method. If true, + * certificates are presented from target to most-trusted CA + * (forward); if false, from most-trusted CA to + * target (reverse). + * @exception CertPathValidatorException + * if this PKIXCertPathChecker is unable to + * check certificates in the specified order; it should never + * be thrown if the forward flag is false since reverse + * checking must be supported +
    + + Indicates if forward checking is supported. Forward checking refers to + the ability of the PKIXCertPathChecker to perform its + checks when certificates are presented to the check method + in the forward direction (from target to most-trusted CA). + + @return true if forward checking is supported, + false otherwise + + + * Returns an immutable Set of X.509 certificate extensions + * that this PKIXCertPathChecker supports (i.e. recognizes, + * is able to process), or null if no extensions are + * supported. + *

    + * Each element of the set is a String representing the + * Object Identifier (OID) of the X.509 extension that is supported. The OID + * is represented by a set of nonnegative integers separated by periods. + *

    + * All X.509 certificate extensions that a PKIXCertPathChecker + * might possibly be able to process should be included in the set. + *

    + * + * @return an immutable Set of X.509 extension OIDs (in + * String format) supported by this + * PKIXCertPathChecker, or null if no + * extensions are supported +
    + + Performs the check(s) on the specified certificate using its internal + state and removes any critical extensions that it processes from the + specified collection of OID strings that represent the unresolved + critical extensions. The certificates are presented in the order + specified by the init method. + + @param cert + the Certificate to be checked + @param unresolvedCritExts + a Collection of OID strings representing the + current set of unresolved critical extensions + @exception CertPathValidatorException + if the specified certificate does not pass the check + + + Returns a clone of this object. Calls the Object.clone() + method. All subclasses which maintain state must support and override + this method, if necessary. + + @return a copy of this PKIXCertPathChecker + + + The Service Provider Interface (SPI) + for the {@link CertPathValidator CertPathValidator} class. All + CertPathValidator implementations must include a class (the + SPI class) that extends this class (CertPathValidatorSpi) + and implements all of its methods. In general, instances of this class + should only be accessed through the CertPathValidator class. + For details, see the Java Cryptography Architecture.
    +
    + Concurrent Access
    +
    + Instances of this class need not be protected against concurrent + access from multiple threads. Threads that need to access a single + CertPathValidatorSpi instance concurrently should synchronize + amongst themselves and provide the necessary locking before calling the + wrapping CertPathValidator object.
    +
    + However, implementations of CertPathValidatorSpi may still + encounter concurrency issues, since multiple threads each + manipulating a different CertPathValidatorSpi instance need not + synchronize. + + CertPathValidatorSpi implementation for X.509 Certificate validation a la RFC + 3280. + +
    + + An exception indicating one of a variety of problems encountered when + validating a certification path.
    +
    + A CertPathValidatorException provides support for wrapping + exceptions. The {@link #getCause getCause} method returns the throwable, + if any, that caused this exception to be thrown.
    +
    + A CertPathValidatorException may also include the + certification path that was being validated when the exception was thrown + and the index of the certificate in the certification path that caused the + exception to be thrown. Use the {@link #getCertPath getCertPath} and + {@link #getIndex getIndex} methods to retrieve this information.
    +
    + Concurrent Access
    +
    + Unless otherwise specified, the methods defined in this class are not + thread-safe. Multiple threads that need to access a single + object concurrently should synchronize amongst themselves and + provide the necessary locking. Multiple threads each manipulating + separate objects need not synchronize. + + @see CertPathValidator + +
    + + + Creates a PkixCertPathValidatorException with the given detail + message. A detail message is a String that describes this + particular exception. + + the detail message + + + + Creates a PkixCertPathValidatorException with the specified + detail message and cause. + + the detail message + the cause (which is saved for later retrieval by the + {@link #getCause getCause()} method). (A null + value is permitted, and indicates that the cause is + nonexistent or unknown.) + + + + Creates a PkixCertPathValidatorException with the specified + detail message, cause, certification path, and index. + + the detail message (or null if none) + the cause (or null if none) + the certification path that was in the process of being + validated when the error was encountered + the index of the certificate in the certification path that * + + + + Returns the detail message for this CertPathValidatorException. + + the detail message, or null if neither the message nor cause were specified + + + Returns the certification path that was being validated when the + exception was thrown. + + @return the CertPath that was being validated when the + exception was thrown (or null if not specified) + + + Returns the index of the certificate in the certification path that + caused the exception to be thrown. Note that the list of certificates in + a CertPath is zero based. If no index has been set, -1 is + returned. + + @return the index that has been set, or -1 if none has been set + + + + Summary description for PkixCertPathValidatorUtilities. + + + + + key usage bits + + + + + Search the given Set of TrustAnchor's for one that is the + issuer of the given X509 certificate. + + the X509 certificate + a Set of TrustAnchor's + the TrustAnchor object if found or + null if not. + + @exception + + + + Returns the issuer of an attribute certificate or certificate. + + The attribute certificate or certificate. + The issuer as X500Principal. + + + Return the next working key inheriting DSA parameters if necessary. +

    + This methods inherits DSA parameters from the indexed certificate or + previous certificates in the certificate chain to the returned + PublicKey. The list is searched upwards, meaning the end + certificate is at position 0 and previous certificates are following. +

    +

    + If the indexed certificate does not contain a DSA key this method simply + returns the public key. If the DSA key already contains DSA parameters + the key is also only returned. +

    + + @param certs The certification path. + @param index The index of the certificate which contains the public key + which should be extended with DSA parameters. + @return The public key of the certificate in list position + index extended with DSA parameters if applicable. + @throws Exception if DSA parameters cannot be inherited. +
    + + + Return a Collection of all certificates or attribute certificates found + in the X509Store's that are matching the certSelect criteriums. + + a {@link Selector} object that will be used to select + the certificates + a List containing only X509Store objects. These + are used to search for certificates. + a Collection of all found or + objects. + May be empty but never null. + + + + Add the CRL issuers from the cRLIssuer field of the distribution point or + from the certificate if not given to the issuer criterion of the + selector. +

    + The issuerPrincipals are a collection with a single + X500Principal for X509Certificates. For + {@link X509AttributeCertificate}s the issuer may contain more than one + X500Principal. +

    + + @param dp The distribution point. + @param issuerPrincipals The issuers of the certificate or attribute + certificate which contains the distribution point. + @param selector The CRL selector. + @param pkixParams The PKIX parameters containing the cert stores. + @throws Exception if an exception occurs while processing. + @throws ClassCastException if issuerPrincipals does not + contain only X500Principals. +
    + + Fetches complete CRLs according to RFC 3280. + + @param dp The distribution point for which the complete CRL + @param cert The X509Certificate or + {@link org.bouncycastle.x509.X509AttributeCertificate} for + which the CRL should be searched. + @param currentDate The date for which the delta CRLs must be valid. + @param paramsPKIX The extended PKIX parameters. + @return A Set of X509CRLs with complete + CRLs. + @throws Exception if an exception occurs while picking the CRLs + or no CRLs are found. + + + Fetches delta CRLs according to RFC 3280 section 5.2.4. + + @param currentDate The date for which the delta CRLs must be valid. + @param paramsPKIX The extended PKIX parameters. + @param completeCRL The complete CRL the delta CRL is for. + @return A Set of X509CRLs with delta CRLs. + @throws Exception if an exception occurs while picking the delta + CRLs. + + + Find the issuer certificates of a given certificate. + + @param cert + The certificate for which an issuer should be found. + @param pkixParams + @return A Collection object containing the issuer + X509Certificates. Never null. + + @exception Exception + if an error occurs. + + + + Extract the value of the given extension, if it exists. + + The extension object. + The object identifier to obtain. + Asn1Object + if the extension cannot be read. + + + + crl checking + Return a Collection of all CRLs found in the X509Store's that are + matching the crlSelect criteriums. + + a {@link X509CRLStoreSelector} object that will be used + to select the CRLs + a List containing only {@link org.bouncycastle.x509.X509Store + X509Store} objects. These are used to search for CRLs + a Collection of all found {@link X509CRL X509CRL} objects. May be + empty but never null. + + + + Returns the intersection of the permitted IP ranges in + permitted with ip. + + @param permitted A Set of permitted IP addresses with + their subnet mask as byte arrays. + @param ips The IP address with its subnet mask. + @return The Set of permitted IP ranges intersected with + ip. + + + Returns the union of the excluded IP ranges in excluded + with ip. + + @param excluded A Set of excluded IP addresses with their + subnet mask as byte arrays. + @param ip The IP address with its subnet mask. + @return The Set of excluded IP ranges unified with + ip as byte arrays. + + + Calculates the union if two IP ranges. + + @param ipWithSubmask1 The first IP address with its subnet mask. + @param ipWithSubmask2 The second IP address with its subnet mask. + @return A Set with the union of both addresses. + + + Calculates the interesction if two IP ranges. + + @param ipWithSubmask1 The first IP address with its subnet mask. + @param ipWithSubmask2 The second IP address with its subnet mask. + @return A Set with the single IP address with its subnet + mask as a byte array or an empty Set. + + + Concatenates the IP address with its subnet mask. + + @param ip The IP address. + @param subnetMask Its subnet mask. + @return The concatenated IP address with its subnet mask. + + + Splits the IP addresses and their subnet mask. + + @param ipWithSubmask1 The first IP address with the subnet mask. + @param ipWithSubmask2 The second IP address with the subnet mask. + @return An array with two elements. Each element contains the IP address + and the subnet mask in this order. + + + Based on the two IP addresses and their subnet masks the IP range is + computed for each IP address - subnet mask pair and returned as the + minimum IP address and the maximum address of the range. + + @param ip1 The first IP address. + @param subnetmask1 The subnet mask of the first IP address. + @param ip2 The second IP address. + @param subnetmask2 The subnet mask of the second IP address. + @return A array with two elements. The first/second element contains the + min and max IP address of the first/second IP address and its + subnet mask. + + + Checks if the IP ip is included in the permitted ISet + permitted. + + @param permitted A Set of permitted IP addresses with + their subnet mask as byte arrays. + @param ip The IP address. + @throws PkixNameConstraintValidatorException + if the IP is not permitted. + + + Checks if the IP ip is included in the excluded ISet + excluded. + + @param excluded A Set of excluded IP addresses with their + subnet mask as byte arrays. + @param ip The IP address. + @throws PkixNameConstraintValidatorException + if the IP is excluded. + + + Checks if the IP address ip is constrained by + constraint. + + @param ip The IP address. + @param constraint The constraint. This is an IP address concatenated with + its subnetmask. + @return true if constrained, false + otherwise. + + + The common part of email1 and email2 is + added to the union union. If email1 and + email2 have nothing in common they are added both. + + @param email1 Email address constraint 1. + @param email2 Email address constraint 2. + @param union The union. + + + The most restricting part from email1 and + email2 is added to the intersection intersect. + + @param email1 Email address constraint 1. + @param email2 Email address constraint 2. + @param intersect The intersection. + + + Checks if the given GeneralName is in the permitted ISet. + + @param name The GeneralName + @throws PkixNameConstraintValidatorException + If the name + + + Check if the given GeneralName is contained in the excluded ISet. + + @param name The GeneralName. + @throws PkixNameConstraintValidatorException + If the name is + excluded. + + + Updates the permitted ISet of these name constraints with the intersection + with the given subtree. + + @param permitted The permitted subtrees + + + Adds a subtree to the excluded ISet of these name constraints. + + @param subtree A subtree with an excluded GeneralName. + + + Returns the maximum IP address. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The maximum IP address. + + + Returns the minimum IP address. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The minimum IP address. + + + Compares IP address ip1 with ip2. If ip1 + is equal to ip2 0 is returned. If ip1 is bigger 1 is returned, -1 + otherwise. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return 0 if ip1 is equal to ip2, 1 if ip1 is bigger, -1 otherwise. + + + Returns the logical OR of the IP addresses ip1 and + ip2. + + @param ip1 The first IP address. + @param ip2 The second IP address. + @return The OR of ip1 and ip2. + + + Stringifies an IPv4 or v6 address with subnet mask. + + @param ip The IP with subnet mask. + @return The stringified IP address. + + + + Summary description for PkixPolicyNode. + + + + Constructors + + + + This class helps to handle CRL revocation reasons mask. Each CRL handles a + certain set of revocation reasons. + + + + + Constructs are reason mask with the reasons. + + The reasons. + + + + A reason mask with no reason. + + + + + A mask with all revocation reasons. + + + + Adds all reasons from the reasons mask to this mask. + + @param mask The reasons mask to add. + + + + Intersects this mask with the given reasons mask. + + mask The mask to intersect with. + The intersection of this and teh given mask. + + + + Returns true if the passed reasons mask has new reasons. + + The reasons mask which should be tested for new reasons. + true if the passed reasons mask has new reasons. + + + + Returns true if this reasons mask contains all possible + reasons. + + true if this reasons mask contains all possible reasons. + + + + + Returns the reasons in this mask. + + + + If the complete CRL includes an issuing distribution point (IDP) CRL + extension check the following: +

    + (i) If the distribution point name is present in the IDP CRL extension + and the distribution field is present in the DP, then verify that one of + the names in the IDP matches one of the names in the DP. If the + distribution point name is present in the IDP CRL extension and the + distribution field is omitted from the DP, then verify that one of the + names in the IDP matches one of the names in the cRLIssuer field of the + DP. +

    +

    + (ii) If the onlyContainsUserCerts boolean is asserted in the IDP CRL + extension, verify that the certificate does not include the basic + constraints extension with the cA boolean asserted. +

    +

    + (iii) If the onlyContainsCACerts boolean is asserted in the IDP CRL + extension, verify that the certificate includes the basic constraints + extension with the cA boolean asserted. +

    +

    + (iv) Verify that the onlyContainsAttributeCerts boolean is not asserted. +

    + + @param dp The distribution point. + @param cert The certificate. + @param crl The CRL. + @throws AnnotatedException if one of the conditions is not met or an error occurs. +
    + + If the DP includes cRLIssuer, then verify that the issuer field in the + complete CRL matches cRLIssuer in the DP and that the complete CRL + contains an + g distribution point extension with the indirectCRL + boolean asserted. Otherwise, verify that the CRL issuer matches the + certificate issuer. + + @param dp The distribution point. + @param cert The certificate ot attribute certificate. + @param crl The CRL for cert. + @throws AnnotatedException if one of the above conditions does not apply or an error + occurs. + + + Obtain and validate the certification path for the complete CRL issuer. + If a key usage extension is present in the CRL issuer's certificate, + verify that the cRLSign bit is set. + + @param crl CRL which contains revocation information for the certificate + cert. + @param cert The attribute certificate or certificate to check if it is + revoked. + @param defaultCRLSignCert The issuer certificate of the certificate cert. + @param defaultCRLSignKey The public key of the issuer certificate + defaultCRLSignCert. + @param paramsPKIX paramsPKIX PKIX parameters. + @param certPathCerts The certificates on the certification path. + @return A Set with all keys of possible CRL issuer + certificates. + @throws AnnotatedException if the CRL is not valid or the status cannot be checked or + some error occurs. + + + Checks a distribution point for revocation information for the + certificate cert. + + @param dp The distribution point to consider. + @param paramsPKIX PKIX parameters. + @param cert Certificate to check if it is revoked. + @param validDate The date when the certificate revocation status should be + checked. + @param defaultCRLSignCert The issuer certificate of the certificate cert. + @param defaultCRLSignKey The public key of the issuer certificate + defaultCRLSignCert. + @param certStatus The current certificate revocation status. + @param reasonMask The reasons mask which is already checked. + @param certPathCerts The certificates of the certification path. + @throws AnnotatedException if the certificate is revoked or the status cannot be checked + or some error occurs. + + + Checks a certificate if it is revoked. + + @param paramsPKIX PKIX parameters. + @param cert Certificate to check if it is revoked. + @param validDate The date when the certificate revocation status should be + checked. + @param sign The issuer certificate of the certificate cert. + @param workingPublicKey The public key of the issuer certificate sign. + @param certPathCerts The certificates of the certification path. + @throws AnnotatedException if the certificate is revoked or the status cannot be checked + or some error occurs. + + + If use-deltas is set, verify the issuer and scope of the delta CRL. + + @param deltaCRL The delta CRL. + @param completeCRL The complete CRL. + @param pkixParams The PKIX paramaters. + @throws AnnotatedException if an exception occurs. + + + Checks if an attribute certificate is revoked. + + @param attrCert Attribute certificate to check if it is revoked. + @param paramsPKIX PKIX parameters. + @param issuerCert The issuer certificate of the attribute certificate + attrCert. + @param validDate The date when the certificate revocation status should + be checked. + @param certPathCerts The certificates of the certification path to be + checked. + + @throws CertPathValidatorException if the certificate is revoked or the + status cannot be checked or some error occurs. + + + Searches for a holder public key certificate and verifies its + certification path. + + @param attrCert the attribute certificate. + @param pkixParams The PKIX parameters. + @return The certificate path of the holder certificate. + @throws Exception if +
      +
    • no public key certificate can be found although holder + information is given by an entity name or a base certificate + ID
    • +
    • support classes cannot be created
    • +
    • no certification path for the public key certificate can + be built
    • +
    +
    + + + Checks a distribution point for revocation information for the + certificate attrCert. + + @param dp The distribution point to consider. + @param attrCert The attribute certificate which should be checked. + @param paramsPKIX PKIX parameters. + @param validDate The date when the certificate revocation status should + be checked. + @param issuerCert Certificate to check if it is revoked. + @param reasonMask The reasons mask which is already checked. + @param certPathCerts The certificates of the certification path to be + checked. + @throws Exception if the certificate is revoked or the status + cannot be checked or some error occurs. + + + + A trust anchor or most-trusted Certification Authority (CA). + + This class represents a "most-trusted CA", which is used as a trust anchor + for validating X.509 certification paths. A most-trusted CA includes the + public key of the CA, the CA's name, and any constraints upon the set of + paths which may be validated using this key. These parameters can be + specified in the form of a trusted X509Certificate or as individual + parameters. + + + + + Creates an instance of TrustAnchor with the specified X509Certificate and + optional name constraints, which are intended to be used as additional + constraints when validating an X.509 certification path. + The name constraints are specified as a byte array. This byte array + should contain the DER encoded form of the name constraints, as they + would appear in the NameConstraints structure defined in RFC 2459 and + X.509. The ASN.1 definition of this structure appears below. + +
    +            	NameConstraints ::= SEQUENCE {
    +            		permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
    +            		excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }
    +            	   
    +             GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
    +             
    +            		GeneralSubtree ::= SEQUENCE {
    +            		base                    GeneralName,
    +            		minimum         [0]     BaseDistance DEFAULT 0,
    +            		maximum         [1]     BaseDistance OPTIONAL }
    +            		
    +            		BaseDistance ::= INTEGER (0..MAX)
    +            
    +            		GeneralName ::= CHOICE {
    +            		otherName                       [0]     OtherName,
    +            		rfc822Name                      [1]     IA5String,
    +            		dNSName                         [2]     IA5String,
    +            		x400Address                     [3]     ORAddress,
    +            		directoryName                   [4]     Name,
    +            		ediPartyName                    [5]     EDIPartyName,
    +            		uniformResourceIdentifier       [6]     IA5String,
    +            		iPAddress                       [7]     OCTET STRING,
    +            		registeredID                    [8]     OBJECT IDENTIFIER}
    +            	
    + + Note that the name constraints byte array supplied is cloned to protect + against subsequent modifications. +
    + a trusted X509Certificate + a byte array containing the ASN.1 DER encoding of a + NameConstraints extension to be used for checking name + constraints. Only the value of the extension is included, not + the OID or criticality flag. Specify null to omit the + parameter. + if the specified X509Certificate is null +
    + + + Creates an instance of TrustAnchor where the + most-trusted CA is specified as an X500Principal and public key. + + +

    + Name constraints are an optional parameter, and are intended to be used + as additional constraints when validating an X.509 certification path. +

    + The name constraints are specified as a byte array. This byte array + contains the DER encoded form of the name constraints, as they + would appear in the NameConstraints structure defined in RFC 2459 + and X.509. The ASN.1 notation for this structure is supplied in the + documentation for the other constructors. +

    + Note that the name constraints byte array supplied here is cloned to + protect against subsequent modifications. +

    +
    + the name of the most-trusted CA as X509Name + the public key of the most-trusted CA + + a byte array containing the ASN.1 DER encoding of a NameConstraints extension to + be used for checking name constraints. Only the value of the extension is included, + not the OID or criticality flag. Specify null to omit the parameter. + + + if caPrincipal or pubKey is null + +
    + + + Creates an instance of TrustAnchor where the most-trusted + CA is specified as a distinguished name and public key. Name constraints + are an optional parameter, and are intended to be used as additional + constraints when validating an X.509 certification path. +
    + The name constraints are specified as a byte array. This byte array + contains the DER encoded form of the name constraints, as they would + appear in the NameConstraints structure defined in RFC 2459 and X.509. +
    + the X.500 distinguished name of the most-trusted CA in RFC + 2253 string format + the public key of the most-trusted CA + a byte array containing the ASN.1 DER encoding of a + NameConstraints extension to be used for checking name + constraints. Only the value of the extension is included, not + the OID or criticality flag. Specify null to omit the + parameter. + throws NullPointerException, IllegalArgumentException +
    + + + Decode the name constraints and clone them if not null. + + + + + Returns a formatted string describing the TrustAnchor. + + a formatted string describing the TrustAnchor + + + + Returns the most-trusted CA certificate. + + + + + Returns the name of the most-trusted CA as an X509Name. + + + + + Returns the name of the most-trusted CA in RFC 2253 string format. + + + + + Returns the public key of the most-trusted CA. + + + + + Utility class for creating IBasicAgreement objects from their names/Oids + + + + + Cipher Utility class contains methods that can not be specifically grouped into other classes. + + + + + Returns a ObjectIdentifier for a give encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the Oid is not available. + + + + Utility class for creating IDigest objects from their names/Oids + + + + + Returns a ObjectIdentifier for a given digest mechanism. + + A string representation of the digest meanism. + A DerObjectIdentifier, null if the Oid is not available. + + + + A class containing methods to interface the BouncyCastle world to the .NET Crypto world. + + + + + Create an System.Security.Cryptography.X509Certificate from an X509Certificate Structure. + + + A System.Security.Cryptography.X509Certificate. + + + + Utility class for creating HMac object from their names/Oids + + + + + + + + + + Returns a ObjectIdentifier for a give encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the Oid is not available. + + + base constructor. + + + create a SecurityUtilityException with the given message. + + @param message the message to be carried with the exception. + + + + Signer Utility class contains methods that can not be specifically grouped into other classes. + + + + + Returns an ObjectIdentifier for a given encoding. + + A string representation of the encoding. + A DerObjectIdentifier, null if the OID is not available. + + + + Utility class for creating IWrapper objects from their names/Oids + + + + Base class for an RFC 3161 Time Stamp Request. + + + Create a TimeStampRequest from the past in byte array. + + @param req byte array containing the request. + @throws IOException if the request is malformed. + + + Create a TimeStampRequest from the past in input stream. + + @param in input stream containing the request. + @throws IOException if the request is malformed. + + + Validate the timestamp request, checking the digest to see if it is of an + accepted type and whether it is of the correct length for the algorithm specified. + + @param algorithms a set of string OIDS giving accepted algorithms. + @param policies if non-null a set of policies we are willing to sign under. + @param extensions if non-null a set of extensions we are willing to accept. + @throws TspException if the request is invalid, or processing fails. + + + return the ASN.1 encoded representation of this object. + + + Generator for RFC 3161 Time Stamp Request objects. + + + add a given extension field for the standard extensions tag (tag 3) + @throws IOException + + + add a given extension field for the standard extensions tag + The value parameter becomes the contents of the octet string associated + with the extension. + + + add a given extension field for the standard extensions tag (tag 3) + @throws IOException + + + add a given extension field for the standard extensions tag + The value parameter becomes the contents of the octet string associated + with the extension. + + + Base class for an RFC 3161 Time Stamp Response object. + + + Create a TimeStampResponse from a byte array containing an ASN.1 encoding. + + @param resp the byte array containing the encoded response. + @throws TspException if the response is malformed. + @throws IOException if the byte array doesn't represent an ASN.1 encoding. + + + Create a TimeStampResponse from an input stream containing an ASN.1 encoding. + + @param input the input stream containing the encoded response. + @throws TspException if the response is malformed. + @throws IOException if the stream doesn't represent an ASN.1 encoding. + + + Check this response against to see if it a well formed response for + the passed in request. Validation will include checking the time stamp + token if the response status is GRANTED or GRANTED_WITH_MODS. + + @param request the request to be checked against + @throws TspException if the request can not match this response. + + + return the ASN.1 encoded representation of this object. + + + Generator for RFC 3161 Time Stamp Responses. + + + Return an appropriate TimeStampResponse. +

    + If genTime is null a timeNotAvailable error response will be returned. + + @param request the request this response is for. + @param serialNumber serial number for the response token. + @param genTime generation time for the response token. + @param provider provider to use for signature calculation. + @return + @throws NoSuchAlgorithmException + @throws NoSuchProviderException + @throws TSPException +

    +
    + + Generate a TimeStampResponse with chosen status and FailInfoField. + + @param status the PKIStatus to set. + @param failInfoField the FailInfoField to set. + @param statusString an optional string describing the failure. + @return a TimeStampResponse with a failInfoField and optional statusString + @throws TSPException in case the response could not be created + + + Validate the time stamp token. +

    + To be valid the token must be signed by the passed in certificate and + the certificate must be the one referred to by the SigningCertificate + attribute included in the hashed attributes of the token. The + certificate must also have the ExtendedKeyUsageExtension with only + KeyPurposeID.IdKPTimeStamping and have been valid at the time the + timestamp was created. +

    +

    + A successful call to validate means all the above are true. +

    +
    + + Return the underlying CmsSignedData object. + + @return the underlying CMS structure. + + + Return a ASN.1 encoded byte stream representing the encoded object. + + @throws IOException if encoding fails. + + + basic creation - only the default attributes will be included here. + + + create with a signer with extra signed/unsigned attributes. + + + @return the nonce value, null if there isn't one. + + + Recognised hash algorithms for the time stamp protocol. + + + Fetches the signature time-stamp attributes from a SignerInformation object. + Checks that the MessageImprint for each time-stamp matches the signature field. + (see RFC 3161 Appendix A). + + @param signerInfo a SignerInformation to search for time-stamps + @return a collection of TimeStampToken objects + @throws TSPValidationException + + + Validate the passed in certificate as being of the correct type to be used + for time stamping. To be valid it must have an ExtendedKeyUsage extension + which has a key purpose identifier of id-kp-timeStamping. + + @param cert the certificate of interest. + @throws TspValidationException if the certicate fails on one of the check points. + + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Exception thrown if a TSP request or response fails to validate. +

    + If a failure code is associated with the exception it can be retrieved using + the getFailureCode() method.

    +
    + + Return the failure code associated with this exception - if one is set. + + @return the failure code if set, -1 otherwise. + + + General array utilities. + + + + Are two arrays equal. + + Left side. + Right side. + True if equal. + + + + A constant time equals comparison - does not terminate early if + test will fail. + + first array + second array + true if arrays equal, false otherwise. + + + Make a copy of a range of bytes from the passed in data array. The range can + extend beyond the end of the input array, in which case the return array will + be padded with zeroes. + + @param data the array from which the data is to be copied. + @param from the start index at which the copying should take place. + @param to the final index of the range (exclusive). + + @return a new byte array containing the range given. + + + BigInteger utilities. + + + Return the passed in value as an unsigned byte array. + + @param value value to be converted. + @return a byte array without a leading zero byte if present in the signed encoding. + + + Return the passed in value as an unsigned byte array of specified length, zero-extended as necessary. + + @param length desired length of result array. + @param n value to be converted. + @return a byte array of specified length, with leading zeroes as necessary given the size of n. + + + Return a random BigInteger not less than 'min' and not greater than 'max' + + @param min the least value that may be generated + @param max the greatest value that may be generated + @param random the source of randomness + @return a random BigInteger value in the range [min,max] + + + + Return the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC) for a given DateTime value. + + A UTC DateTime value not before epoch. + Number of whole milliseconds after epoch. + 'dateTime' is before epoch. + + + + Create a DateTime value from the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + + Number of milliseconds since the epoch. + A UTC DateTime value + + + + Return the current number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + + + + encode the input data producing a base 64 encoded byte array. + + @return a byte array containing the base 64 encoded data. + + + encode the input data producing a base 64 encoded byte array. + + @return a byte array containing the base 64 encoded data. + + + Encode the byte data to base 64 writing it to the given output stream. + + @return the number of bytes produced. + + + Encode the byte data to base 64 writing it to the given output stream. + + @return the number of bytes produced. + + + decode the base 64 encoded input data. It is assumed the input data is valid. + + @return a byte array representing the decoded data. + + + decode the base 64 encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + decode the base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + Encode and decode byte arrays (typically from binary to 7-bit ASCII + encodings). + + + encode the input data producing a base 64 output stream. + + @return the number of bytes produced. + + + decode the base 64 encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + + A buffering class to allow translation from one format to another to + be done in discrete chunks. + + + + + Create a buffered Decoder. + + The translater to use. + The size of the buffer. + + + + Process one byte of data. + + Data in. + Byte array for the output. + The offset in the output byte array to start writing from. + The amount of output bytes. + + + + Process data from a byte array. + + The input data. + Start position within input data array. + Amount of data to process from input data array. + Array to store output. + Position in output array to start writing from. + The amount of output bytes. + + + + A class that allows encoding of data using a specific encoder to be processed in chunks. + + + + + Create. + + The translator to use. + Size of the chunks. + + + + Process one byte of data. + + The byte. + An array to store output in. + Offset within output array to start writing from. + + + + + Process data from a byte array. + + Input data Byte array containing data to be processed. + Start position within input data array. + Amount of input data to be processed. + Output data array. + Offset within output data array to start writing to. + The amount of data written. + + + + Class to decode and encode Hex. + + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + decode the Hex encoded input data. It is assumed the input data is valid. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + encode the input data producing a Hex output stream. + + @return the number of bytes produced. + + + decode the Hex encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + + A hex translator. + + + + + Translator interface. + + + + + Return encoded block size. + + 2 + + + + Encode some data. + + Input data array. + Start position within input data array. + The amount of data to process. + The output data array. + The offset within the output data array to start writing from. + Amount of data encoded. + + + + Returns the decoded block size. + + 1 + + + + Decode data from a byte array. + + The input data array. + Start position within input data array. + The amounty of data to process. + The output data array. + The position within the output data array to start writing from. + The amount of data written. + + + Convert binary data to and from UrlBase64 encoding. This is identical to + Base64 encoding, except that the padding character is "." and the other + non-alphanumeric characters are "-" and "_" instead of "+" and "/". +

    + The purpose of UrlBase64 encoding is to provide a compact encoding of binary + data that is safe for use as an URL parameter. Base64 encoding does not + produce encoded values that are safe for use in URLs, since "/" can be + interpreted as a path delimiter; "+" is the encoded form of a space; and + "=" is used to separate a name from the corresponding value in an URL + parameter. +

    +
    + + Encode the input data producing a URL safe base 64 encoded byte array. + + @return a byte array containing the URL safe base 64 encoded data. + + + Encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + Decode the URL safe base 64 encoded input data - white space will be ignored. + + @return a byte array representing the decoded data. + + + decode the URL safe base 64 encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the URL safe base 64 encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + Decode the URL safe base 64 encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + Convert binary data to and from UrlBase64 encoding. This is identical to + Base64 encoding, except that the padding character is "." and the other + non-alphanumeric characters are "-" and "_" instead of "+" and "/". +

    + The purpose of UrlBase64 encoding is to provide a compact encoding of binary + data that is safe for use as an URL parameter. Base64 encoding does not + produce encoded values that are safe for use in URLs, since "/" can be + interpreted as a path delimiter; "+" is the encoded form of a space; and + "=" is used to separate a name from the corresponding value in an URL + parameter. +

    +
    + + + A + + + A + + + + + + Pipe all bytes from inStr to outStr, throwing StreamFlowException if greater + than limit bytes in inStr. + + + A + + + A + + + A + + The number of bytes actually transferred, if not greater than limit + + + + Exception to be thrown on a failure to reset an object implementing Memoable. +

    + The exception extends InvalidCastException to enable users to have a single handling case, + only introducing specific handling of this one if required. +

    +
    + + Basic Constructor. + + @param msg message to be associated with this exception. + + + Validate the given IPv4 or IPv6 address. + + @param address the IP address as a string. + + @return true if a valid address, false otherwise + + + Validate the given IPv4 or IPv6 address and netmask. + + @param address the IP address as a string. + + @return true if a valid address with netmask, false otherwise + + + Validate the given IPv4 address. + + @param address the IP address as a string. + + @return true if a valid IPv4 address, false otherwise + + + Validate the given IPv6 address. + + @param address the IP address as a string. + + @return true if a valid IPv4 address, false otherwise + + + General string utilities. + + + + Summary description for DeflaterOutputStream. + + + + + Summary description for DeflaterOutputStream. + + + + + The Holder object. +
    +            Holder ::= SEQUENCE {
    +            	baseCertificateID   [0] IssuerSerial OPTIONAL,
    +            		-- the issuer and serial number of
    +            		-- the holder's Public Key Certificate
    +            	entityName          [1] GeneralNames OPTIONAL,
    +            		-- the name of the claimant or role
    +            	objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
    +            		-- used to directly authenticate the holder,
    +            		-- for example, an executable
    +            }
    +            
    +
    +
    + + Constructs a holder for v2 attribute certificates with a hash value for + some type of object. +

    + digestedObjectType can be one of the following: +

      +
    • 0 - publicKey - A hash of the public key of the holder must be + passed.
    • +
    • 1 - publicKeyCert - A hash of the public key certificate of the + holder must be passed.
    • +
    • 2 - otherObjectDigest - A hash of some other object type must be + passed. otherObjectTypeID must not be empty.
    • +
    +

    +

    This cannot be used if a v1 attribute certificate is used.

    + + @param digestedObjectType The digest object type. + @param digestAlgorithm The algorithm identifier for the hash. + @param otherObjectTypeID The object type ID if + digestedObjectType is + otherObjectDigest. + @param objectDigest The hash value. +
    + + Returns the hash if an object digest info is used. + + @return The hash or null if no object digest info is set. + + + Return any principal objects inside the attribute certificate holder entity names field. + + @return an array of IPrincipal objects (usually X509Name), null if no entity names field is set. + + + Return the principals associated with the issuer attached to this holder + + @return an array of principals, null if no BaseCertificateID is set. + + + Returns the digest object type if an object digest info is used. +

    +

      +
    • 0 - publicKey - A hash of the public key of the holder must be + passed.
    • +
    • 1 - publicKeyCert - A hash of the public key certificate of the + holder must be passed.
    • +
    • 2 - otherObjectDigest - A hash of some other object type must be + passed. otherObjectTypeID must not be empty.
    • +
    +

    + + @return The digest object type or -1 if no object digest info is set. +
    + + Returns the other object type ID if an object digest info is used. + + @return The other object type ID or null if no object + digest info is set. + + + Returns the digest algorithm ID if an object digest info is used. + + @return The digest algorithm ID or null if no object + digest info is set. + + + Return the serial number associated with the issuer attached to this holder. + + @return the certificate serial number, null if no BaseCertificateID is set. + + + Carrying class for an attribute certificate issuer. + + + Set the issuer directly with the ASN.1 structure. + + @param issuer The issuer + + + Return any principal objects inside the attribute certificate issuer object. + An array of IPrincipal objects (usually X509Principal). + + + A high level authority key identifier. + + + Constructor which will take the byte[] returned from getExtensionValue() + + @param encodedValue a DER octet encoded string with the extension structure in it. + @throws IOException on parsing errors. + + + Create an AuthorityKeyIdentifier using the passed in certificate's public + key, issuer and serial number. + + @param certificate the certificate providing the information. + @throws CertificateParsingException if there is a problem processing the certificate + + + Create an AuthorityKeyIdentifier using just the hash of the + public key. + + @param pubKey the key to generate the hash from. + @throws InvalidKeyException if there is a problem using the key. + + + A high level subject key identifier. + + + Constructor which will take the byte[] returned from getExtensionValue() + + @param encodedValue a DER octet encoded string with the extension structure in it. + @throws IOException on parsing errors. + + + Interface for an X.509 Attribute Certificate. + + + Return the attributes contained in the attribute block in the certificate. + An array of attributes. + + + Return the attributes with the same type as the passed in oid. + The object identifier we wish to match. + An array of matched attributes, null if there is no match. + + + Return an ASN.1 encoded byte array representing the attribute certificate. + An ASN.1 encoded byte array. + If the certificate cannot be encoded. + + + The version number for the certificate. + + + The serial number for the certificate. + + + The UTC DateTime before which the certificate is not valid. + + + The UTC DateTime after which the certificate is not valid. + + + The holder of the certificate. + + + The issuer details for the certificate. + + + + A utility class that will extract X509Principal objects from X.509 certificates. +

    + Use this in preference to trying to recreate a principal from a string, not all + DNs are what they should be, so it's best to leave them encoded where they + can be.

    +
    +
    + + Return the issuer of the given cert as an X509Principal. + + + Return the subject of the given cert as an X509Principal. + + + Return the issuer of the given CRL as an X509Principal. + + + This class is an Selector like implementation to select + attribute certificates from a given set of criteria. + + @see org.bouncycastle.x509.X509AttributeCertificate + @see org.bouncycastle.x509.X509Store + + + + Decides if the given attribute certificate should be selected. + + The attribute certificate to be checked. + true if the object matches this selector. + + + Adds a target name criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target names. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name The name as a GeneralName (not null) +
    + + Adds a target name criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target names. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name a byte array containing the name in ASN.1 DER encoded form of a GeneralName + @throws IOException if a parsing error occurs. +
    + + Adds a collection with target names criteria. If null is + given any will do. +

    + The collection consists of either GeneralName objects or byte[] arrays representing + DER encoded GeneralName structures. +

    + + @param names A collection of target names. + @throws IOException if a parsing error occurs. + @see #AddTargetName(byte[]) + @see #AddTargetName(GeneralName) +
    + + Gets the target names. The collection consists of Lists + made up of an Integer in the first entry and a DER encoded + byte array or a String in the second entry. +

    The returned collection is immutable.

    + + @return The collection of target names + @see #setTargetNames(Collection) +
    + + Adds a target group criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target groups. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param group The group as GeneralName form (not null) +
    + + Adds a target group criterion for the attribute certificate to the target + information extension criteria. The X509AttributeCertificate + must contain at least one of the specified target groups. +

    + Each attribute certificate may contain a target information extension + limiting the servers where this attribute certificate can be used. If + this extension is not present, the attribute certificate is not targeted + and may be accepted by any server. +

    + + @param name a byte array containing the group in ASN.1 DER encoded form of a GeneralName + @throws IOException if a parsing error occurs. +
    + + Adds a collection with target groups criteria. If null is + given any will do. +

    + The collection consists of GeneralName objects or byte[] + representing DER encoded GeneralNames. +

    + + @param names A collection of target groups. + @throws IOException if a parsing error occurs. + @see #AddTargetGroup(byte[]) + @see #AddTargetGroup(GeneralName) +
    + + Gets the target groups. The collection consists of Lists + made up of an Integer in the first entry and a DER encoded + byte array or a String in the second entry. +

    The returned collection is immutable.

    + + @return The collection of target groups. + @see #setTargetGroups(Collection) +
    + + The attribute certificate which must be matched. + If null is given, any will do. + + + The criteria for validity + If null is given any will do. + + + The holder. + If null is given any will do. + + + The issuer. + If null is given any will do. + + + The serial number. + If null is given any will do. + + + + This class is an IX509Selector implementation to select + certificate pairs, which are e.g. used for cross certificates. The set of + criteria is given from two X509CertStoreSelector objects, + each of which, if present, must match the respective component of a pair. + + + + + Decides if the given certificate pair should be selected. If + obj is not a X509CertificatePair, this method + returns false. + + The X509CertificatePair to be tested. + true if the object matches this selector. + + + The certificate pair which is used for testing on equality. + + + The certificate selector for the forward part. + + + The certificate selector for the reverse part. + + + A simple collection backed store. + + + Basic constructor. + + @param collection - initial contents for the store, this is copied. + + + Return the matches in the collection for the passed in selector. + + @param selector the selector to match against. + @return a possibly empty collection of matching objects. + + + This class contains a collection for collection based X509Stores. + + + + Constructor. +

    + The collection is copied. +

    +
    + The collection containing X.509 object types. + If collection is null. +
    + + Returns a copy of the ICollection. + + + Returns a formatted string describing the parameters. + + + + An ICollection of X509Name objects + + + + The attribute certificate being checked. This is not a criterion. + Rather, it is optional information that may help a {@link X509Store} find + CRLs that would be relevant when checking revocation for the specified + attribute certificate. If null is specified, then no such + optional information is provided. + + @param attrCert the IX509AttributeCertificate being checked (or + null) + @see #getAttrCertificateChecking() + + + If true only complete CRLs are returned. Defaults to + false. + + @return true if only complete CRLs are returned. + + + Returns if this selector must match CRLs with the delta CRL indicator + extension set. Defaults to false. + + @return Returns true if only CRLs with the delta CRL + indicator extension are selected. + + + The issuing distribution point. +

    + The issuing distribution point extension is a CRL extension which + identifies the scope and the distribution point of a CRL. The scope + contains among others information about revocation reasons contained in + the CRL. Delta CRLs and complete CRLs must have matching issuing + distribution points.

    +

    + The byte array is cloned to protect against subsequent modifications.

    +

    + You must also enable or disable this criteria with + {@link #setIssuingDistributionPointEnabled(bool)}.

    + + @param issuingDistributionPoint The issuing distribution point to set. + This is the DER encoded OCTET STRING extension value. + @see #getIssuingDistributionPoint() +
    + + Whether the issuing distribution point criteria should be applied. + Defaults to false. +

    + You may also set the issuing distribution point criteria if not a missing + issuing distribution point should be assumed.

    + + @return Returns if the issuing distribution point check is enabled. +
    + + The maximum base CRL number. Defaults to null. + + @return Returns the maximum base CRL number. + @see #setMaxBaseCRLNumber(BigInteger) + + + + A factory to produce Public Key Info Objects. + + + + + Create a Subject Public Key Info object for a given public key. + + One of ElGammalPublicKeyParameters, DSAPublicKeyParameter, DHPublicKeyParameters, RsaKeyParameters or ECPublicKeyParameters + A subject public key info object. + Throw exception if object provided is not one of the above. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate object and initializes it with the data + read from the input stream inStream. + + + Returns a (possibly empty) collection view of the certificates + read from the given input stream inStream. + + + Class for carrying the values in an X.509 Attribute. + + + @param at an object representing an attribute. + + + Create an X.509 Attribute with the type given by the passed in oid and + the value represented by an ASN.1 Set containing value. + + @param oid type of the attribute + @param value value object to go into the atribute's value set. + + + Create an X.59 Attribute with the type given by the passed in oid and the + value represented by an ASN.1 Set containing the objects in value. + + @param oid type of the attribute + @param value vector of values to go in the attribute's value set. + + + + An Object representing an X509 Certificate. + Has static methods for loading Certificates encoded in many forms that return X509Certificate Objects. + + + + + Return true if the nominated time is within the start and end times nominated on the certificate. + + The time to test validity against. + True if certificate is valid for nominated time. + + + + Checks if the current date is within certificate's validity period. + + + + + Checks if the given date is within certificate's validity period. + + if the certificate is expired by given date + if the certificate is not yet valid on given date + + + + Return the Der encoded TbsCertificate data. + This is the certificate component less the signature. + To Get the whole certificate call the GetEncoded() member. + + A byte array containing the Der encoded Certificate component. + + + + The signature. + + A byte array containg the signature of the certificate. + + + + Get the signature algorithms parameters. (EG DSA Parameters) + + A byte array containing the Der encoded version of the parameters or null if there are none. + + + + Get a key usage guidlines. + + + + + Get the public key of the subject of the certificate. + + The public key parameters. + + + + Return a Der encoded version of this certificate. + + A byte array. + + + + Verify the certificate's signature using the nominated public key. + + An appropriate public key parameter object, RsaPublicKeyParameters, DsaPublicKeyParameters or ECDsaPublicKeyParameters + True if the signature is valid. + If key submitted is not of the above nominated types. + + + + Verify the certificate's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the certificate's signature. + True if the signature is valid. + If verifier provider is not appropriate or the certificate algorithm is invalid. + + + + Return true if the current time is within the start and end times nominated on the certificate. + + true id certificate is valid for the current time. + + + + Return the certificate's version. + + An integer whose value Equals the version of the cerficate. + + + + Return a BigInteger containing the serial number. + + The Serial number. + + + + Get the Issuer Distinguished Name. (Who signed the certificate.) + + And X509Object containing name and value pairs. + + + + Get the subject of this certificate. + + An X509Name object containing name and value pairs. + + + + The time that this certificate is valid from. + + A DateTime object representing that time in the local time zone. + + + + The time that this certificate is valid up to. + + A DateTime object representing that time in the local time zone. + + + + A meaningful version of the Signature Algorithm. (EG SHA1WITHRSA) + + A sting representing the signature algorithm. + + + + Get the Signature Algorithms Object ID. + + A string containg a '.' separated object id. + + + + Get the issuers UID. + + A DerBitString. + + + + Get the subjects UID. + + A DerBitString. + + + + This class contains a cross certificate pair. Cross certificates pairs may + contain two cross signed certificates from two CAs. A certificate from the + other CA to this CA is contained in the forward certificate, the certificate + from this CA to the other CA is contained in the reverse certificate. + + + + Constructor + Certificate from the other CA to this CA. + Certificate from this CA to the other CA. + + + Constructor from a ASN.1 CertificatePair structure. + The CertificatePair ASN.1 object. + + + Returns the certificate from the other CA to this CA. + + + Returns the certificate from this CA to the other CA. + + + class for dealing with X509 certificates. +

    + At the moment this will deal with "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----" + base 64 encoded certs, as well as the BER binaries of certificates and some classes of PKCS#7 + objects.

    +
    + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate object and initializes it with the data + read from the input stream inStream. + + + Returns a (possibly empty) collection view of the certificates + read from the given input stream inStream. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + The following extensions are listed in RFC 2459 as relevant to CRLs + + Authority Key Identifier + Issuer Alternative Name + CRL Number + Delta CRL Indicator (critical) + Issuing Distribution Point (critical) + + + + Verify the CRL's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the CRL's signature. + True if the signature is valid. + If verifier provider is not appropriate or the CRL algorithm is invalid. + + + Returns a string representation of this CRL. + + @return a string representation of this CRL. + + + Checks whether the given certificate is on this CRL. + + @param cert the certificate to check for. + @return true if the given certificate is on this CRL, + false otherwise. + + + The following extensions are listed in RFC 2459 as relevant to CRL Entries + + ReasonCode Hode Instruction Code Invalidity Date Certificate Issuer + (critical) + + + Constructor for CRLEntries of indirect CRLs. If isIndirect + is false {@link #getCertificateIssuer()} will always + return null, previousCertificateIssuer is + ignored. If this isIndirect is specified and this CrlEntry + has no certificate issuer CRL entry extension + previousCertificateIssuer is returned by + {@link #getCertificateIssuer()}. + + @param c + TbsCertificateList.CrlEntry object. + @param isIndirect + true if the corresponding CRL is a indirect + CRL. + @param previousCertificateIssuer + Certificate issuer of the previous CrlEntry. + + + + Create loading data from byte array. + + + + + + Create loading data from byte array. + + + + + Generates a certificate revocation list (CRL) object and initializes + it with the data read from the input stream inStream. + + + Returns a (possibly empty) collection view of the CRLs read from + the given input stream inStream. + + The inStream may contain a sequence of DER-encoded CRLs, or + a PKCS#7 CRL set. This is a PKCS#7 SignedData object, with the + only significant field being crls. In particular the signature + and the contents are ignored. + + + A holding class for constructing an X509 Key Usage extension. + +
    +                id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +            
    +                KeyUsage ::= BIT STRING {
    +                     digitalSignature        (0),
    +                     nonRepudiation          (1),
    +                     keyEncipherment         (2),
    +                     dataEncipherment        (3),
    +                     keyAgreement            (4),
    +                     keyCertSign             (5),
    +                     cRLSign                 (6),
    +                     encipherOnly            (7),
    +                     decipherOnly            (8) }
    +             
    +
    + + Basic constructor. + + @param usage - the bitwise OR of the Key Usage flags giving the + allowed uses for the key. + e.g. (X509KeyUsage.keyEncipherment | X509KeyUsage.dataEncipherment) + + + Return the digest algorithm using one of the standard JCA string + representations rather than the algorithm identifier (if possible). + + + + Class to Generate X509V1 Certificates. + + + + + Default Constructor. + + + + + Reset the generator. + + + + + Set the certificate's serial number. + + Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + You will be surprised how ugly a serial number collision can get. + The serial number. + + + + Set the issuer distinguished name. + The issuer is the entity whose private key is used to sign the certificate. + + The issuers DN. + + + + Set the date that this certificate is to be valid from. + + + + + + Set the date after which this certificate will no longer be valid. + + + + + + Set the subject distinguished name. + The subject describes the entity associated with the public key. + + + + + + Set the public key that this certificate identifies. + + + + + + Set the signature algorithm that will be used to sign this certificate. + This can be either a name or an OID, names are treated as case insensitive. + + string representation of the algorithm name + + + + Generate a new X509Certificate. + + The private key of the issuer used to sign this certificate. + An X509Certificate. + + + + Generate a new X509Certificate specifying a SecureRandom instance that you would like to use. + + The private key of the issuer used to sign this certificate. + The Secure Random you want to use. + An X509Certificate. + + + + Generate a new X509Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Certificate. + + + + Allows enumeration of the signature names supported by the generator. + + + + An implementation of a version 2 X.509 Attribute Certificate. + + + + Verify the certificate's signature using a verifier created using the passed in verifier provider. + + An appropriate provider for verifying the certificate's signature. + True if the signature is valid. + If verifier provider is not appropriate or the certificate algorithm is invalid. + + + Class to produce an X.509 Version 2 AttributeCertificate. + + + Reset the generator + + + Set the Holder of this Attribute Certificate. + + + Set the issuer. + + + Set the serial number for the certificate. + + + + Set the signature algorithm. This can be either a name or an OID, names + are treated as case insensitive. + + The algorithm name. + + + Add an attribute. + + + Add a given extension field for the standard extensions tag. + + + + Add a given extension field for the standard extensions tag. + The value parameter becomes the contents of the octet string associated + with the extension. + + + + + Generate an X509 certificate, based on the current issuer and subject. + + + + + Generate an X509 certificate, based on the current issuer and subject, + using the supplied source of randomness, if required. + + + + + Generate a new X.509 Attribute Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An IX509AttributeCertificate. + + + + Allows enumeration of the signature names supported by the generator. + + + + class to produce an X.509 Version 2 CRL. + + + reset the generator + + + Set the issuer distinguished name - the issuer is the entity whose private key is used to sign the + certificate. + + + Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + or 0 if CrlReason is not to be used + + + + Add a CRL entry with an Invalidity Date extension as well as a CrlReason extension. + Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + or 0 if CrlReason is not to be used + + + + Add a CRL entry with extensions. + + + + Add the CRLEntry objects contained in a previous CRL. + + @param other the X509Crl to source the other entries from. + + + + Set the signature algorithm that will be used to sign this CRL. + + + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + add a given extension field for the standard extensions tag (tag 0) + + + + Generate an X.509 CRL, based on the current issuer and subject. + + The private key of the issuer that is signing this certificate. + An X509Crl. + + + + Generate an X.509 CRL, based on the current issuer and subject using the specified secure random. + + The private key of the issuer that is signing this certificate. + Your Secure Random instance. + An X509Crl. + + + + Generate a new X509Crl using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Crl. + + + + Allows enumeration of the signature names supported by the generator. + + + + + A class to Generate Version 3 X509Certificates. + + + + + Reset the Generator. + + + + + Set the certificate's serial number. + + Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + You will be surprised how ugly a serial number collision can Get. + The serial number. + + + + Set the distinguished name of the issuer. + The issuer is the entity which is signing the certificate. + + The issuer's DN. + + + + Set the date that this certificate is to be valid from. + + + + + + Set the date after which this certificate will no longer be valid. + + + + + + Set the DN of the entity that this certificate is about. + + + + + + Set the public key that this certificate identifies. + + + + + + Set the signature algorithm that will be used to sign this certificate. + + + + + + Set the subject unique ID - note: it is very rare that it is correct to do this. + + + + + + Set the issuer unique ID - note: it is very rare that it is correct to do this. + + + + + + Add a given extension field for the standard extensions tag (tag 3). + + string containing a dotted decimal Object Identifier. + Is it critical. + The value. + + + + Add an extension to this certificate. + + Its Object Identifier. + Is it critical. + The value. + + + + Add an extension using a string with a dotted decimal OID. + + string containing a dotted decimal Object Identifier. + Is it critical. + byte[] containing the value of this extension. + + + + Add an extension to this certificate. + + Its Object Identifier. + Is it critical. + byte[] containing the value of this extension. + + + + Add a given extension field for the standard extensions tag (tag 3), + copying the extension value from another certificate. + + + + add a given extension field for the standard extensions tag (tag 3) + copying the extension value from another certificate. + @throws CertificateParsingException if the extension cannot be extracted. + + + + Generate an X509Certificate. + + The private key of the issuer that is signing this certificate. + An X509Certificate. + + + + Generate an X509Certificate using your own SecureRandom. + + The private key of the issuer that is signing this certificate. + You Secure Random instance. + An X509Certificate. + + + + Generate a new X509Certificate using the passed in SignatureCalculator. + + A signature calculator factory with the necessary algorithm details. + An X509Certificate. + + + + Allows enumeration of the signature names supported by the generator. + + + + + IMPORTANT: USE THIS METHOD CAREFULLY. + This method serves as replacement for the java method MessageDigest#digest(byte[] buf, int offset, int len). + However for now, we simply omit len parameter, because it doesn't affect anything for all current usages + (there are two of them at the moment of the method addition which are in StandardHandlerUsingAes256 class). + This may be not true for future possible usages, so be aware. + + +
    +
    diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.layout.dll b/src/packages/itext7.7.0.2/lib/net40/itext.layout.dll new file mode 100644 index 00000000000..1b81b29f7fc Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.layout.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.layout.xml b/src/packages/itext7.7.0.2/lib/net40/itext.layout.xml new file mode 100644 index 00000000000..243d24e08d5 --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.layout.xml @@ -0,0 +1,6776 @@ + + + + itext.layout + + + + Represents a border. + + + The solid border. + + + + The dashed border. + + + + The dotted border. + + + + The double border. + + + + The round-dots border. + + + + The 3D groove border. + + + + The 3D inset border. + + + + The 3D outset border. + + + + The 3D ridge border. + + + + The null Border, i.e. + The null Border, i.e. the presence of such border is equivalent to the absence of the border + + + The color of the border. + + + + The color of the border. + + + + The width of the border. + + + The type of the border. + + + The hash value for the border. + + + + Creates a + border + with the given width. + The + color + to be set by default is black + + the width which the border should have + + + + Creates a + border + with given width and + color + . + + the color which the border should have + the width which the border should have + + + + Creates a + border + with given width, + color + and opacity. + + the color which the border should have + the width which the border should have + the opacity which border should have; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + + + + + Draws the border of a cell. + PdfCanvas to be written to + x coordinate of the beginning point of the element side, that should be bordered + y coordinate of the beginning point of the element side, that should be bordered + x coordinate of the ending point of the element side, that should be bordered + y coordinate of the ending point of the element side, that should be bordered + + + + Returns the type of the + border + + + + + Gets the + color + of the + border + + + the + color + + + + + Gets the opacity of the + border + + the border opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + + + + Gets the width of the + border + + the width + + + + Sets the + color + of the + border + + + + + Sets the width of the + border + + + + Indicates whether the border is equal to the given border. + + Indicates whether the border is equal to the given border. + The border type, width and color are considered during the comparison. + + + + + + + + Returns the + side + corresponded to the line between two points. + Notice that we consider the rectangle traversal to be clockwise. + If the rectangle sides are not parallel to the corresponding page sides + the result is Side.NONE + + the abscissa of the left-bottom point + the ordinate of the left-bottom point + the abscissa of the right-top point + the ordinate of the right-top point + + the corresponded + side + + + + Enumerates the different sides of the rectangle. + + Enumerates the different sides of the rectangle. + The rectangle sides are expected to be parallel to corresponding page sides + Otherwise the result is Side.NONE + + + + Represents a border that is displayed using a 3D effect. + + + + Predefined gray + RGB-color + + + + Creates a Border3D instance with the specified width. + Creates a Border3D instance with the specified width. Also sets the color to gray. + with of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + width of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + width of the border + + + Creates a Border3D instance with the specified width and color. + color of the border + width of the border + + + Creates a Border3D instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a Border3D instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a Border3D instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + + + + + + + + Makes the + color of the border + darker and returns the result + + + + + Sets the fill color for the inner half of + 3D Border + + PdfCanvas the color will be applied on + + the + side + the color will be applied on + + + + + Sets the fill color for the outer half of + 3D Border + + PdfCanvas the color will be applied on + + the + side + the color will be applied on + + + + Draws a border with dashes around the element it's been set to. + + + The modifier to be applied on the width to have the dash size + + + The modifier to be applied on the width to have the initial gap size + + + Creates a DashedBorder with the specified width and sets the color to black. + width of the border + + + Creates a DashedBorder with the specified width and the specified color. + color of the border + width of the border + + + Creates a DashedBorder with the specified width, color and opacity. + color of the border + width of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Draws a dotted border around the element it has been set to. + + Draws a dotted border around the element it has been set to. Do note that this border draw square dots, + if you want to draw round dots, see + + . + + + + The modifier to be applied on the width to have the initial gap size + + + Creates a DottedBorder instance with the specified width. + Creates a DottedBorder instance with the specified width. The color is set to the default: black. + + width of the border + + + Creates a DottedBorder instance with the specified width and color. + color of the border + width of the border + + + Creates a DottedBorder with the specified width, color and opacity. + color of the border + width of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Creates a double border around the element it's set to. + + Creates a double border around the element it's set to. The space between the two border lines has + the same width as the two borders. If a background has been set on the element the color will show in + between the two borders. + + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them. + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them. + The color is set to the default: black. + + width of the borders and the space between them + + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. The space in between the two borders is either colorless or will + be filled with the background color of the element, if a color has been set. + + width of the borders and the space between them + + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. + + + Creates a DoubleBorder with the specified width for both the two borders as the space in between them and + the specified color for the two borders. The space in between the two borders is either colorless or will + be filled with the background color of the element, if a color has been set. + + width of the borders and the space between them + + + + + + + + + + + + Creates a GrooveBorder instance with the specified width. + + Creates a GrooveBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a GrooveBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a GrooveBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a GrooveBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + Creates a GrooveBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a GrooveBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a GrooveBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + + + + + + + + + + Creates a InsetBorder instance with the specified width. + + Creates a InsetBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a InsetBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a InsetBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a InsetBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + Creates a InsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a InsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a InsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + + + + + + + + + + Creates a OutsetBorder instance with the specified width. + + Creates a OutsetBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a OutsetBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a OutsetBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a OutsetBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + Creates a OutsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a OutsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a OutsetBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + + + + + + + + + + Creates a RidgeBorder instance with the specified width. + + Creates a RidgeBorder instance with the specified width. The color is set to the default: + gray + . + + width of the border + + + + Creates a RidgeBorder instance with the specified width and the + rgb color + . + + width of the border + + the + rgb color + of the border + + + + + Creates a RidgeBorder instance with the specified width and the + cmyk color + . + + width of the border + + the + cmyk color + of the border + + + + + Creates a RidgeBorder instance with the specified width and the + gray color + . + + width of the border + + the + gray color + of the border + + + + Creates a RidgeBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a RidgeBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + Creates a RidgeBorder instance with the specified width, color and opacity. + color of the border + width of the border + opacity of the border + + + + + + + + + + + + Draws a border with rounded dots around the element it's been set to. + + Draws a border with rounded dots around the element it's been set to. For square dots see + + . + + + + The modifier to be applied on the width to have the initial gap size + + + Creates a RoundDotsBorder with the specified wit?dth and sets the color to black. + width of the border + + + Creates a RoundDotsBorder with the specified wit?dth and the specified color. + color of the border + width of the border + + + Creates a RoundDotsBorder with the specified width, color and opacity. + color of the border + width of the border + width of the border + + + + + + + + + + + + Adjusts the size of the gap between dots + + the + border + length + + the initial size of the gap + the adjusted size of the gap + + + Draws a solid border around the element it's set to. + + + Creates a SolidBorder with the specified width and sets the color to black. + width of the border + + + Creates a SolidBorder with the specified width and the specified color. + color of the border + width of the border + + + Creates a SolidBorder with the specified width, color and opacity. + color of the border + width of the border + width of the border + + + + + + + + + + + + + This class is used for adding content directly onto a specified + + . + + does not know the concept of a page, so it can't reflow to a 'next' + + . + This class effectively acts as a bridge between the high-level layout + API and the low-level kernel API. + + + + A generic abstract root element for a PDF layout object hierarchy. + + + + A generic abstract element that fits in a PDF layout object hierarchy. + + A generic abstract element that fits in a PDF layout object hierarchy. + A superclass of all + layout object + implementations. + + + + + + A generic Map-like interface that defines methods for storing and retrieving + objects by an enum key of the + + type. + + + + Checks if this entity has the specified property. + + Checks if this entity has the specified property. Compared to + + , + this method can check parent's properties, styles, etc, depending on the origin of the instance + + the property to be checked + + + + if this instance has given property, + + otherwise + + + + Checks if this entity has the specified property, i.e. + Checks if this entity has the specified property, i.e. if it was set to this very element earlier + + the property to be checked + + + + if this instance has given own property, + + otherwise + + + + Gets the property from this entity. + + Gets the property from this entity. Compared to + + , + this method can check parent's properties, styles, etc, depending on the origin of the instance + + + the property to be retrieved + + the value of the given property. + + will be returned if the property value was not found + + + + Gets own property from this entity. + + Gets own property from this entity. The property must have been set earlier to this entity. + If the property is not found, + + will be returned. + + + the property to be retrieved + + the value of the given own property. + + will be returned if the property value was not found + + + + Gets the default property from this entity. + + the property to be retrieved + + the default property value. If the default property is not defined, + + will be returned + + + + Sets a property for this entity. + the property to be set + the value of the property + + + Deletes the own property of this entity. + the property to be deleted + + + Gets the width property of the Element. + the width of the element, with a value and a measurement unit. + + + + Sets the width property of the Element, measured in points. + a value measured in points. + this Element. + + + Sets the width property of the Element, measured in percentage. + a value measured in percentage. + this Element. + + + + Sets the width property of the Element with a + + . + + + a + + object + + this Element. + + + Gets the height property of the Element. + the height of the element, as a floating point value. + + + Sets the height property of the Element. + a floating point value for the new height + this Element. + + + Sets values for a relative repositioning of the Element. + + Sets values for a relative repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + relative + . + The default implementation in + + treats + left and top as the most important values. Only + if left == 0 will right be used for the + calculation; ditto for top vs. bottom. + + movement to the left + movement upwards on the page + movement to the right + movement downwards on the page + this Element. + + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + + a + + + this Element. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + a floating point value measured in points. + this Element. + + + Sets the horizontal alignment of this Element. + + an enum value of type + + + this Element. + + + Sets the font of this Element. + + a + font + + this Element. + + + Sets the font of this Element. + + Sets the font of this Element. Note that + + shall be set as well. + See + + + + a font name to fetch from + + + this Element. + + + Sets the font color of this Element. + + a + + for the text in this Element. + + this Element. + + + Sets the font color of this Element and the opacity of the text. + + a + + for the text in this Element. + + an opacity for the text in this Element; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent. + + this Element. + + + Sets the font size of this Element. + a floating point value + this Element. + + + Sets the text alignment of this Element. + + an enum value of type + + + this Element. + + + Defines a custom spacing distance between all characters of a textual element. + + Defines a custom spacing distance between all characters of a textual element. + The character-spacing parameter is added to the glyph???s horizontal or vertical displacement (depending on the writing mode). + + a floating point value + this Element. + + + Defines a custom spacing distance between words of a textual element. + + Defines a custom spacing distance between words of a textual element. + This value works exactly like the character spacing, but only kicks in at word boundaries. + + a floating point value + this Element. + + + Enable or disable kerning. + + Enable or disable kerning. + Some fonts may specify kern pairs, i.e. pair of glyphs, between which the amount of horizontal space is adjusted. + This adjustment is typically negative, e.g. in "AV" pair the glyphs will typically be moved closer to each other. + + an enum value as a boolean wrapper specifying whether or not to apply kerning + this Element. + + + Specifies a background color for the Element. + the background color + this Element. + + + Specifies a background color for the Element. + the background color + the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent. + + this Element. + + + + Specifies a background color for the Element, and extra space that + must be counted as part of the background and therefore colored. + + the background color + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + this Element. + + + + Specifies a background color for the Element, and extra space that + must be counted as part of the background and therefore colored. + + the background color + the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + this Element. + + + Sets a border for all four edges of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the upper limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the right limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the bottom limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a border for the left limit of this Element with customizable color, width, pattern type. + + a customized + + + this Element. + + + Sets a rule for splitting strings when they don't fit into one line. + + Sets a rule for splitting strings when they don't fit into one line. + The default implementation is + + + + an implementation of + + + this Element. + + + Gets a rule for splitting strings when they don't fit into one line. + + the current string splitting rule, an implementation of + + + + + + Gets the text rendering mode, a variable that determines whether showing + text causes glyph outlines to be stroked, filled, used as a clipping + boundary, or some combination of the three. + + the current text rendering mode + + + + + Sets the text rendering mode, a variable that determines whether showing + text causes glyph outlines to be stroked, filled, used as a clipping + boundary, or some combination of the three. + + an int value + this Element. + + + + Gets the stroke color for the current element. + + Gets the stroke color for the current element. + The stroke color is the color of the outlines or edges of a shape. + + the current stroke color + + + Sets the stroke color for the current element. + + Sets the stroke color for the current element. + The stroke color is the color of the outlines or edges of a shape. + + a new stroke color + this Element. + + + Gets the stroke width for the current element. + + Gets the stroke width for the current element. + The stroke width is the width of the outlines or edges of a shape. + + the current stroke width + + + Sets the stroke width for the current element. + + Sets the stroke width for the current element. + The stroke width is the width of the outlines or edges of a shape. + + a new stroke width + this Element. + + + Switch on the simulation of bold style for a font. + + Switch on the simulation of bold style for a font. + Be aware that using correct bold font is highly preferred over this option. + + this element + + + Switch on the simulation of italic style for a font. + + Switch on the simulation of italic style for a font. + Be aware that using correct italic (oblique) font is highly preferred over this option. + + this element + + + Sets default line-through attributes for text. + + Sets default line-through attributes for text. + See + + for more fine tuning. + + this element + + + + This attribute specifies the base direction of directionally neutral text + (i.e., text that doesn't have inherent directionality as defined in Unicode) + in an element's content and attribute values. + + base direction + this element + + + Sets default underline attributes for text. + + Sets default underline attributes for text. + See other overloads for more fine tuning. + + this element + + + Sets an horizontal line that can be an underline or a strikethrough. + + Sets an horizontal line that can be an underline or a strikethrough. + Actually, the line can be anywhere vertically and has always the text width. + Multiple call to this method will produce multiple lines. + + the absolute thickness of the line + the absolute y position relative to the baseline + this element + + + + + + This attribute specifies the base direction of directionally neutral text + (i.e., text that doesn't have inherent directionality as defined in Unicode) + in an element's content and attribute values. + + base direction + this element + + + + Sets a custom hyphenation configuration which will hyphenate words automatically accordingly to the + language and country. + + + this element + + + Sets the writing system for this text element. + a new script type + this Element. + + + Sets a destination name that will be created when this element is drawn to content. + the destination name to be created + this Element. + + + Sets an opacity of the given element. + + Sets an opacity of the given element. It will affect element content, borders and background. Note, that it will also + affect all element children, as they are the content of the given element. + + a float between 0 and 1, where 1 stands for fully opaque element and 0 - for fully transparent + + this Element. + + + Adds an element to the root. + Adds an element to the root. The element is immediately placed in the contents. + an element with spacial margins, tabbing, and alignment + this element + + + + Adds an image to the root. + Adds an image to the root. The element is immediately placed in the contents. + a graphical image element + this element + + + + + Gets + + if presents. + + + instance of + + if exists, otherwise null. + + + + + Sets + + . + Note, font provider is inherited property. + + + instance of + + . + + + + + Gets the rootRenderer attribute, a specialized + + that + acts as the root object that other + renderers + descend + from. + + + the + + attribute + + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a kerned text aligned about the specified point + text to be placed to the page + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + horizontal alignment about the specified point + vertical alignment about the specified point + this object + + + Convenience method to write a text aligned about the specified point + + paragraph of text to be placed to the page. By default it has no leading and is written in single line. + Set width to write multiline text. + + the point about which the text will be aligned and rotated + the point about which the text will be aligned and rotated + the page number to write the text + horizontal alignment about the specified point + vertical alignment about the specified point + the angle of rotation applied to the text, in radians + this object + + + + Is initialized and used only when Canvas element autotagging is enabled, see + + . + It is also used to determine if autotagging is enabled. + + + + Creates a new Canvas to manipulate a specific document and page. + the low-level content stream writer + the document that the resulting content stream will be written to + the maximum area that the Canvas may write upon + + + Creates a new Canvas to manipulate a specific document and page. + the low-level content stream writer + the document that the resulting content stream will be written to + the maximum area that the Canvas may write upon + + + + Creates a new Canvas to manipulate a specific + + . + + the form + the document that the resulting content stream will be written to + + + + Gets the + + for this canvas. + + the document that the resulting content stream will be written to + + + Gets the root area rectangle. + the maximum area that the Canvas may write upon + + + + Gets the + + . + + the low-level content stream writer + + + + Sets the + + for this Canvas. + + a renderer specific for canvas operations + + + Returned value is not null only in case when autotagging is enabled. + the page, on which this canvas will be rendered, or null if autotagging is not enabled. + + + Enables canvas content autotagging. + Enables canvas content autotagging. By default it is disabled. + the page, on which this canvas will be rendered. + + + true if autotagging of canvas content is enabled. Default value - false. + + + + Performs an entire recalculation of the element flow on the canvas, + taking into account all its current child elements. + + + Performs an entire recalculation of the element flow on the canvas, + taking into account all its current child elements. May become very + resource-intensive for large documents. + Do not use when you have set + + to true. + + + + + Forces all registered renderers (including child element renderers) to + flush their contents to the content stream. + + + + + Closes the + + . Although not completely necessary in all cases, it is still recommended to call this + method when you are done working with + + object, as due to some properties set there might be some + 'hanging' elements, which are waiting other elements to be added and processed. + + tells the + + that no more elements will be added and it is time to finish processing all the elements. + + + + This class is used for convenient multi-column Document Layouting + + + + Defines the most common properties and behavior that are shared by most + + implementations. All default Renderers are subclasses of + this default implementation. + + + + + A renderer object is responsible for drawing a corresponding layout object on + a document or canvas. + + + A renderer object is responsible for drawing a corresponding layout object on + a document or canvas. Every layout object has a renderer, by default one of + the corresponding type, e.g. you can ask an + + for its + + . + Renderers are designed to be extensible, and custom implementations can be + seeded to layout objects (or their custom subclasses) at runtime. + + + + Adds a child to the current renderer + a child to be added + + + + This method simulates positioning of the renderer, including all of its children, and returns + the + + , representing the layout result, including occupied area, status, i.e. + if there was enough place to fit the renderer subtree, etc. + + can be extended to return custom layout results for custom elements, e.g. + + uses + + as its result. + This method can be called standalone to learn how much area the renderer subtree needs, or can be called + before + + , to prepare the renderer to be flushed to the output stream. + + the description of layout area and any other additional information + result of the layout process + + + Flushes the renderer subtree contents, i.e. + + Flushes the renderer subtree contents, i.e. draws itself on canvas, + adds necessary objects to the + + etc. + + + contains the + + to which the renderer subtree if flushed, + the + + on which the renderer subtree is drawn and other additional parameters + needed to perform drawing + + + + + Gets the resultant occupied area after the last call to the + + method. + + + + + instance + + + + Gets a property from this entity or one of its hierarchical parents. + + Gets a property from this entity or one of its hierarchical parents. + If the property is not found, + + will be returned. + + + the property to be retrieved + a fallback value + the value of the given property + + + + Explicitly sets this object as the child of another + + in + the renderer hierarchy. Some implementations also use this method + internally to create a consistent hierarchy tree. + + the object to place higher in the renderer hierarchy + by default, this object + + + Gets the model element associated with this renderer. + + the model element, as a + container of properties + + + + + Gets the child + + s. + + + a list of direct child + renderers + of this instance + + + + Indicates whether this renderer is flushed or not, i.e. + + Indicates whether this renderer is flushed or not, i.e. if + + has already + been called. + + whether the renderer has been flushed + + + Moves the renderer subtree by the specified offset. + Moves the renderer subtree by the specified offset. This method affects occupied area of the renderer. + + the x-axis offset in points. Positive value will move the renderer subtree to the right. + the y-axis offset in points. Positive value will move the renderer subtree to the top. + + + + Gets a new instance of this class to be used as a next renderer, after this renderer is used, if + + is called more than once. + + new renderer instance + + + + The maximum difference between + + coordinates to consider rectangles equal + + + + The infinity value which is used while layouting + + + Creates a renderer. + + + Creates a renderer for the specified layout element. + the layout element that will be drawn by this renderer + + + + + + + + + + + + + + + + + + + Checks if this renderer or its model element have the specified property, + i.e. + + + Checks if this renderer or its model element have the specified property, + i.e. if it was set to this very element or its very model element earlier. + + the property to be checked + + + + if this instance or its model element have given own property, + + otherwise + + + + + + + + Deletes property from this very renderer, or in case the property is specified on its model element, the + property of the model element is deleted + + the property key to be deleted + + + + + + + + + + + + + + + + + + Returns a property with a certain key, as a font object. + + an + enum value + + + a + + + + + Returns a property with a certain key, as a color. + + an + enum value + + + a + + + + + + Returns a property with a certain key, as a + + . + + + an + enum value + + + a + + + + + Returns a property with a certain key, as a boolean value. + + an + enum value + + + a + + + + + Returns a string representation of the renderer. + + a + + + + + + + + + + + + + Draws a background layer if it is defined by a key + + in either the layout element or this + + itself. + + the context (canvas, document, etc) of this drawing operation. + + + + Performs the drawing operation for all + children + of this renderer. + + the context (canvas, document, etc) of this drawing operation. + + + + Performs the drawing operation for the border of this renderer, if + defined by any of the + + values in either the layout + element or this + + itself. + + the context (canvas, document, etc) of this drawing operation. + + + Indicates whether this renderer is flushed or not, i.e. + + Indicates whether this renderer is flushed or not, i.e. if + + has already + been called. + + whether the renderer has been flushed + + + + + + + + + + + Gets all rectangles that this + + can draw upon in the given area. + + + a physical area on the + + + + a list of + rectangles + + + + + Gets the bounding box that contains all content written to the + + by this + + . + + + the smallest + + that surrounds the content + + + + Gets the border box of a renderer. + + Gets the border box of a renderer. + This is a box used to draw borders. + + border box of a renderer + + + Gets the first yLine of the nested children recursively. + + Gets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the + first item (if the first item is indeed a paragraph). + NOTE: this method will no go further than the first child. + Returns null if there is no text found. + + + + Applies margins of the renderer on the given rectangle + a rectangle margins will be applied on. + + indicates whether margins will be applied + inside (in case of false) or outside (in case of true) the rectangle. + + + a + border box + of the renderer + + + + + Applies given margins on the given rectangle + a rectangle margins will be applied on. + the margins to be applied on the given rectangle + + indicates whether margins will be applied + inside (in case of false) or outside (in case of true) the rectangle. + + + a + border box + of the renderer + + + + Returns margins of the renderer + + a + float[] margins + of the renderer + + + + Returns paddings of the renderer + + a + float[] paddings + of the renderer + + + + Applies paddings of the renderer on the given rectangle + a rectangle paddings will be applied on. + + indicates whether paddings will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies given paddings on the given rectangle + a rectangle paddings will be applied on. + the paddings to be applied on the given rectangle + + indicates whether paddings will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies the border box of the renderer on the given rectangle + If the border of a certain side is null, the side will remain as it was. + + a rectangle the border box will be applied on. + + indicates whether the border box will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + + Applies the given border box (borders) on the given rectangle + a rectangle paddings will be applied on. + + the + borders + to be applied on the given rectangle + + + indicates whether the border box will be applied + inside (in case of false) or outside (in case of false) the rectangle. + + + a + border box + of the renderer + + + + Indicates whether the renderer's position is fixed or not. + + a + boolean + + + + Indicates whether the renderer's position is fixed or not. + + a + boolean + + + + + + Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, + e.g. + + + Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, + e.g. document page or form xObject. This is particularly useful for the cases when element is nested in the rotated + element. + + + a + + which is a bbox of the content not relative to the parent's layout area but rather to + the some pdf entity coordinate system. + + + + Calculates bounding box around points. + list of the points calculated bbox will enclose. + array of float values which denote left, bottom, right, top lines of bbox in this specific order + + + + This method calculates the shift needed to be applied to the points in order to position + upper and left borders of their bounding box at the given lines. + + x coordinate at which points bbox left border is to be aligned + y coordinate at which points bbox upper border is to be aligned + the points, which bbox will be aligned at the given position + + array of two floats, where first element denotes x-coordinate shift and the second + element denotes y-coordinate shift which are needed to align points bbox at the given lines. + + + + Draws (flushes) the content. + + + + + This method correctly closes the + + instance. + There might be hanging elements, like in case of + + is set to true + and when no consequent element has been added. This method addresses such situations. + + + + + + + Adds some pages so that the overall number is at least n. + + Adds some pages so that the overall number is at least n. + Returns the page size of the n'th page. + + + + Creates a ColumnDocumentRenderer. + + Creates a ColumnDocumentRenderer. Sets + + to true. + + + the + + on which this Renderer will calculate + and execute element placements + + + an array of + + specifying the acceptable + positions for elements on a page + + + + + Creates a ColumnDocumentRenderer whose elements need not be flushed + immediately. + + + the + + on which this Renderer will calculate + and execute element placements + + whether or not to flush contents as soon as possible + + an array of + + specifying the acceptable + positions for elements on a page + + + + + Gets the array index of the next area that will be written on after the + current one is full (overflowed). + + the array index of the next area that will be written on + + + + + Creates a document from a + + . Initializes the first page + with the + + 's current default + + . + + the in-memory representation of the PDF document + + + + Creates a document from a + + with a manually set + + . + + the in-memory representation of the PDF document + the page size + + + + Creates a document from a + + with a manually set + + . + + the in-memory representation of the PDF document + the page size + + if true, write pages and page-related instructions + to the + + as soon as possible. + + + + Closes the document and associated PdfDocument. + + + Terminates the current element, usually a page. + + Terminates the current element, usually a page. Sets the next element + to be the size specified in the argument. + + + an + + , optionally with a specified size + + this element + + + Gets PDF document. + the in-memory representation of the PDF document + + + + Changes the + + at runtime. Use this to customize + the Document's + + behavior. + + + + + + Forces all registered renderers (including child element renderers) to + flush their contents to the content stream. + + + + + Gets the left margin, measured in points + a float containing the left margin value + + + Sets the left margin, measured in points + a float containing the new left margin value + + + Gets the right margin, measured in points + a float containing the right margin value + + + Sets the right margin, measured in points + a float containing the new right margin value + + + Gets the top margin, measured in points + a float containing the top margin value + + + Sets the top margin, measured in points + a float containing the new top margin value + + + Gets the bottom margin, measured in points + a float containing the bottom margin value + + + Sets the bottom margin, measured in points + a float containing the new bottom margin value + + + Convenience method to set all margins with one method. + the upper margin + the right margin + the left margin + the lower margin + + + + Returns the area that will actually be used to write on the page, given + the current margins. + + + Returns the area that will actually be used to write on the page, given + the current margins. Does not have any side effects on the document. + + the size of the page to + + a + + with the required dimensions and origin point + + + + Checks whether a method is invoked at the closed document + + + + Defines the most common properties that most + + implementations + share. + + + + + This class represents a layout element, i.e. + + This class represents a layout element, i.e. a piece of content that will + take up 'physical' space on a canvas or document. Its presence and positioning + may influence the position of other + + s on the layout surface. + + + + + Overrides the + IRenderer + instance which will be returned by the next call to the + + . + + the renderer instance + + + Gets a renderer for this element. + + Gets a renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a renderer for this element + + + Creates a renderer subtree with root in the current element. + + Creates a renderer subtree with root in the current element. + Compared to + + , the renderer returned by this method should contain all the child + renderers for children of the current element. + + a renderer subtree for this element + + + Add a new style to this element. + + Add a new style to this element. A style can be used as an effective way + to define multiple equal properties to several elements. + + the style to be added + this element + + + Gets the child elements of this elements + a list of children + + + Marks all child elements as artifacts recursively. + + + Returns true if this list contains no elements. + true if this list contains no elements + + + Sets an action on this Element. + + Sets an action on this Element. An action is a general PDF concept that + signifies anything that makes the document interactive, e.g. a hyperlink + or a button. + + + the + + that should be performed + + this Element + + + Explicitly sets the page number this element should be put on. + + Explicitly sets the page number this element should be put on. The location + on the page will be the same as if it were added at the end of the document, + but it will be located on the specified page. + This method should be used very carefully in client code. + + the page number of the page this element should be placed on + this Element + + + + A layout object that terminates the current content area and creates a new + one. + + + A layout object that terminates the current content area and creates a new + one. If no + + is given, the new content area will have the same + size as the current one. + + + + Creates an AreaBreak. + + Creates an AreaBreak. The new content area will have the same size as the + current one. + + + + Creates an AreaBreak that terminates a specified area type. + + an + area break type + + + + Creates an AreaBreak. + + Creates an AreaBreak. The new content area will have the specified page + size. + + the size of the new content area + + + Gets the page size. + + the + page size + of the next content area. + + + + Sets the page size. + + the new + page size + of the next content area. + + + + Gets the type of area that this AreaBreak will terminate. + + the current + area break type + + + + + A + + will try to take up as much horizontal space as + available to it on the canvas or page. The concept is comparable to the block + element in HTML. Also like in HTML, the visual representation of the object + can be delimited by padding, a border, and/or a margin. + + + + + Creates a BlockElement. + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets all margins around the element to the same width. + the new margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Gets the current left padding width of the element. + the left padding width, as a float + + + Sets the left padding width of the element. + the new left padding width + this element + + + Gets the current right padding width of the element. + the right padding width, as a float + + + Sets the right padding width of the element. + the new right padding width + this element + + + Gets the current top padding width of the element. + the top padding width, as a float + + + Sets the top padding width of the element. + the new top padding width + this element + + + Gets the current bottom padding width of the element. + the bottom padding width, as a float + + + Sets the bottom padding width of the element. + the new bottom padding width + this element + + + Sets all paddings around the element to the same width. + the new padding width + this element + + + Sets the paddings around the element to a series of new widths. + the new padding top width + the new padding right width + the new padding bottom width + the new padding left width + this element + + + Sets the vertical alignment of the element. + the vertical alignment setting + this element + + + + Sets a ratio which determines in which proportion will word spacing and character spacing + be applied when horizontal alignment is justified. + + + the ratio coefficient. It must be between 0 and 1, inclusive. + It means that ratio part of the free space will + be compensated by word spacing, and 1-ratio part of the free space will + be compensated by character spacing. + If ratio is 1, additional character spacing will not be applied. + If ratio is 0, additional word spacing will not be applied. + + + + + Returns whether the + + should be kept together as much + as possible. + + + the current value of the + + property + + + + + Sets whether the + + should be kept together as much + as possible. + + + the new value of the + + property + + this element + + + + Returns whether the end of this + + and the start of the next sibling of this element + should be placed in the same area. + + + the current value of the + + property + + + + + Sets whether the end of this + + and the start of the next sibling of this element + should be placed in the same area. + Note that this will only work for high-level elements, i.e. elements added to the + + . + + + the new value of the + + property + + this element + + + Sets the rotation radAngle. + the new rotation radAngle, as a float, in radians + this element + + + Sets the rotation angle. + the new rotation angle, as a double, in radians + this element + + + + A + + is one piece of data in an enclosing grid, the + + . + This object is a + + , giving it a number of visual layout + properties. + A cell can act as a container for a number of layout elements; it can only + contain other + + objects or images. Other types of layout + elements must be wrapped in a + + . + + + + Creates a cell which takes a custom amount of cell spaces in the table. + the number of rows this cell must occupy. Negative numbers will make the argument default to 1. + + the number of columns this cell must occupy. Negative numbers will make the argument default to 1. + + + + Creates a cell. + + + Gets a cell renderer for this element. + + Gets a cell renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a cell renderer for this element + + + + Gets + the number of the row + in which the cell is located. + + the row number + + + + Gets + the number of the column + in which the cell is located. + + the column number + + + + Gets the + rowspan + of the cell. + + the rowspan + + + + Gets the + colspan + of the cell. + + the colspan + + + Adds any block element to the cell's contents. + + a + + + this Element + + + Adds an image to the cell's contents. + + an + + + this Element + + + Directly adds a String of text to this cell. + + Directly adds a String of text to this cell. The content is wrapped in a + layout element. + + + a + + + this Element + + + Clones a cell with its position, properties, and optionally its contents. + whether or not to also include the contents of the cell. + a clone of this Element + + + + A + + is a container object that defines a section in a document, + which will have some shared layout properties. Like all + + types, it will try to take up as much horizontal space as possible. + The concept is very similar to that of the div tag in HTML. + + + + Adds any block element to the div's contents. + + a + + + this Element + + + Adds an image to the div's contents. + + an + + + this Element + + + + A + + is a layout element which may get added to + indefinitely, making the object prohibitively large. + In order to avoid consuming and holding on to undesirable amounts of + resources, the contents of a + + can be flushed regularly + by client code, e.g. at page boundaries or after a certain amount of additions. + + + + Checks whether an element has already been marked as complete. + the completion marker boolean + + + Indicates that all the desired content has been added to this large element. + + + Writes the newly added content to the document. + + + Flushes the content which has just been added to the document. + + Flushes the content which has just been added to the document. + This is a method for internal usage and is called automatically by the document. + + + + Sets the document this element is bound to. + + Sets the document this element is bound to. + We cannot write a large element into several documents simultaneously because we would need + more bulky interfaces for this feature. For now we went for simplicity. + + the document + + + + A marker subinterface of + + that specifies that the layout object + is, by definition, on the lowest tier in the object hierarchy. A + leaf element + must not act as a container for other + elements. + + + + A layout element that represents an image for inclusion in the document model. + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax. + + + an internal + + + + + + Creates an + + from a form XObject, the representation of a + form in PDF syntax. + + + an internal + + + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, with a custom width. + + + an internal + + + a float value + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, with a custom width and on a fixed position. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + a float value + + + + Creates an + + from an image XObject, the representation of an + image in PDF syntax, on a fixed position. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + + + + Creates an + + from a form XObject, the representation of a + form in PDF syntax. + + + an internal + + + a float value representing the horizontal offset of the lower left corner of the form + a float value representing the vertical offset of the lower left corner of the form + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module. + + + an internal representation of the + image resource + + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module, on a fixed position. + + + an internal representation of the + image resource + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + + + + Creates an + + from an image resource, read in from a file + with the iText I/O module, with a custom width and on a fixed position. + + + an internal representation of the + image resource + + a float value representing the horizontal offset of the lower left corner of the image + a float value representing the vertical offset of the lower left corner of the image + a float value + + + Gets the XObject contained in this image object + + a + + + + + Sets the rotation radAngle. + a value in radians + this element + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Scale the image relative to its default size. + the horizontal scaling coefficient. default value 1 = 100% + the vertical scaling coefficient. default value 1 = 100% + this element + + + Scale the image to an absolute size. + + Scale the image to an absolute size. This method will preserve the + width-height ratio of the image. + + the new maximum width of the image + the new maximum height of the image + this element + + + Scale the image to an absolute size. + + Scale the image to an absolute size. This method will not + preserve the width-height ratio of the image. + + the new absolute width of the image + the new absolute height of the image + this element + + + Sets the autoscale property for both width and height. + whether or not to let the image resize automatically + this image + + + Sets the autoscale property for the height of the image. + whether or not to let the image height resize automatically + this image + + + Sets the autoscale property for the width of the image. + whether or not to let the image width resize automatically + this image + + + Sets values for a absolute repositioning of the Element. + + Sets values for a absolute repositioning of the Element. Also has as a + side effect that the Element's + + is changed to + fixed + . + + horizontal position on the page + vertical position on the page + this image. + + + + Sets values for a absolute repositioning of the Element, on a specific + page. + + + Sets values for a absolute repositioning of the Element, on a specific + page. Also has as a side effect that the Element's + + is changed to + fixed + . + + the page where the element must be positioned + horizontal position on the page + vertical position on the page + this Element. + + + Gets width of the image. + + Gets width of the image. It returns width of image or form XObject, + not the width set by one of the #setWidth methods + + the original width of the image + + + Gets height of the image. + + Gets height of the image. It returns height of image or form XObject, + not the height set by one of the #setHeight methods + + the original height of the image + + + Gets scaled width of the image. + the current scaled width + + + Gets scaled height of the image. + the current scaled height + + + + + Creates a custom line separator with line style defined by custom + + interface instance + + line drawer instance + + + + A clickable piece of + + which contains a + link annotation dictionary + . The concept is largely similar to that of the + HTML anchor tag. + + + + + A + + is a piece of text of any length. As a + leaf element + , + it is the smallest piece of content that may bear specific layout attributes. + + + + Constructs a Text with its role initialized. + + the contents, as a + + + + + Gets the contents of the Text object that will be rendered. + the string with the contents + + + Sets the contents of the Text object. + the new contents + + + Gets the text rise. + the vertical distance from the text's default base line, as a float. + + + Sets the text rise. + a vertical distance from the text's default base line. + this Text + + + + Gets the horizontal scaling property, which determines how wide the text + should be stretched. + + the horizontal spacing, as a float + + + Skews the text to simulate italic and other effects. + + Skews the text to simulate italic and other effects. Try alpha=0 + and beta=12. + + the first angle in degrees + the second angle in degrees + this Text + + + + The horizontal scaling parameter adjusts the width of glyphs by stretching or + compressing them in the horizontal direction. + + + the scaling parameter. 1 means no scaling will be applied, + 0.5 means the text will be scaled by half. + 2 means the text will be twice as wide as normal one. + + this Text + + + Creates a Link with a fully constructed link annotation dictionary. + the textual contents of the link + + a + + + + + Creates a Link which can execute an action. + the textual contents of the link + + a + + + + + Creates a Link to another location in the document. + the textual contents of the link + + a + + + + + Gets the link annotation dictionary associated with this link. + + a + + + + + + A List is a layout element representing a series of objects that are vertically + outlined with the same or very similar layout properties, giving it a sense + of unity. + + + A List is a layout element representing a series of objects that are vertically + outlined with the same or very similar layout properties, giving it a sense + of unity. It contains + + objects that can optionally be prefixed + with a symbol and/or numbered. + + + + + Creates a List with the + + as a prefix. + + + + Creates a List with a custom numbering type. + a prefix style + + + + Adds a new + + to the bottom of the List. + + a new list item + this list. + + + + Adds a new + + to the bottom of the List. + + textual contents of the new list item + this list. + + + Customizes the index of the first item in the list. + the custom index, as an int + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + the textual symbol to be used for all items. + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + + the + + object to be used for all items. + + this list. + + + Sets the list symbol to be used. + + Sets the list symbol to be used. This will create an unordered list, i.e. + all + list items + will be shown with the same prefix. + + + the + + object to be used for all items. + + this list. + + + Sets the list numbering type to be used. + + Sets the list numbering type to be used. This will create an ordered list, + i.e. every + + will have a unique prefix. + + + the + + that will generate appropriate prefixes for the + + s. + + this list. + + + A specialized enum containing alignment properties for list symbols. + + A specialized enum containing alignment properties for list symbols. + + means that the items will be aligned as follows: + 9. Item 9 + 10. Item 10 + Whereas + + means the items will be aligned as follows: + 9. Item 9 + 10. Item 10 + + + + + Gets the indent offset of the + + symbols. + + the indent offset as a float. + + + + Sets the indent offset of the + + symbols. + + the new indent offset. + this list. + + + + Gets the piece of text that is added after the + + symbol. + + the post symbol text + + + + Sets a piece of text that should be added after the + + symbol. + + the post symbol text + + + + Gets the piece of text that is added before the + + symbol. + + the pre symbol text + + + + Sets a piece of text that should be added before the + + symbol. + + the pre symbol text + + + + A list item is a layout element that is one entry in a + + . The list + object controls the prefix, postfix, and numbering of the list items. + + + + Creates a ListItem. + + + Creates a list item with text. + the textual contents of the list item + + + Creates a list item with an image. + the graphical contents of the list item + + + Sets the list item symbol to be used. + the textual symbol to be used for the item. + this list item. + + + Sets the list item symbol to be used. + + the + + object to be used for the item. + + this list item. + + + Sets the list item symbol to be used. + + the + + object to be used for the item. + + this list. + + + Sets the list item numbering type to be used. + + the + + that will generate appropriate prefixes for the + + . + + this list item. + + + + A layout element that represents a self-contained block of textual and + graphical information. + + + A layout element that represents a self-contained block of textual and + graphical information. + It is a + + which essentially acts as a container for + leaf elements + . + + + + Creates a Paragraph. + + + Creates a Paragraph, initialized with a piece of text. + + the initial textual content, as a + + + + + Creates a Paragraph, initialized with a piece of text. + + the initial textual content, as a + + + + + Adds a piece of text to the Paragraph + + the content to be added, as a + + + this Paragraph + + + Adds a layout element to the Paragraph. + + the content to be added, any + + + this Paragraph + + + + Adds a + + of layout elements to the Paragraph. + + + the content to be added, any + + + this Paragraph + + + Adds an unspecified amount of tabstop elements as properties to the Paragraph. + + the + tabstop(s) + to be added as properties + + this Paragraph + + + + + Adds a + + of tabstop elements as properties to the Paragraph. + + + the list of + + s to be added as properties + + this Paragraph + + + + + Removes a tabstop position from the Paragraph, if it is present in the + + property. + + + the + + position to be removed. + + this Paragraph + + + + + Sets the indent value for the first line of the + + . + + + the indent value that must be applied to the first line of + the Paragraph, as a float + + this Paragraph + + + + Sets the leading value, using the + + strategy. + + the new leading value + this Paragraph + + + + + Sets the leading value, using the + + strategy. + + the new leading value + this Paragraph + + + + + This class represents the empty space from a + + to the following + + , if any. Using this class will not have any effect unless + there are + + objects defined for the enveloping element. + + + + + A + + is a layout element that represents data in a two-dimensional + grid. It is filled with + cells + , ordered in rows and columns. + It is an implementation of + + , which means it can be flushed + to the canvas, in order to reclaim memory that is locked up. + + + + + Constructs a + Table + with the column widths in points. + Note, since 7.0.2 in case auto layout column width values less than min width will be ignored. + Large table must have valid column widths (>= zero), fixed layout will be used for it. + By default large table has width 100%. + + the relative column widths + whether parts of the table will be written before all data is added. + + + + Constructs a + Table + with the column widths. + Note, since 7.0.2 in case auto layout column width values less than min width will be ignored. + Large table must have valid column widths (>= zero), fixed layout will be used for it. + By default large table has width 100%. + + the relative column widths + whether parts of the table will be written before all data is added. + + + + Constructs a + Table + with column widths. + Note, since 7.0.2 in case auto layout column width values less than min width will be ignored. + + the relative column widths + + + + Constructs a + Table + with point column widths. + Note, since 7.0.2 in case auto layout column width values less than min width will be ignored. + + the column widths in points. + + + + Constructs a + Table + with + + columns. + Large table will have equal column widths, fixed layout will be used for it. + By default large table has width 100%. + + the number of columns, each column will have equal percent width. + whether parts of the table will be written before all data is added. + + + + Constructs a + Table + with + + columns. + + the number of columns, each column will have equal percent width. + + + + Set + + = 100%. + + + + Returns the column width for the specified column. + index of the column + the width of the column + + + Returns the number of columns. + the number of columns. + + + Returns the number of rows. + the number of rows. + + + Adds a new cell to the header of the table. + + Adds a new cell to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a header cell to be added + + + Adds a new cell with received blockElement as a content to the header of the table. + + Adds a new cell with received blockElement as a content to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a header cell + + + Adds a new cell with received image to the header of the table. + + Adds a new cell with received image to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a header cell + + + Adds a new cell with received string as a content to the header of the table. + + Adds a new cell with received string as a content to the header of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a string to be added to a header cell + + + Gets the header of the table. + Gets the header of the table. The header is represented as a distinct table and might have its own properties. + + + table header or + + , if + + hasn't been called. + + + + Adds a new cell to the footer of the table. + + Adds a new cell to the footer of the table. + The footer will be displayed in the bottom of every area of this table. + See also + + . + + a footer cell + + + Adds a new cell with received blockElement as a content to the footer of the table. + + Adds a new cell with received blockElement as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an element to be added to a footer cell + + + Adds a new cell with received image as a content to the footer of the table. + + Adds a new cell with received image as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + an image to be added to a footer cell + + + Adds a new cell with received string as a content to the footer of the table. + + Adds a new cell with received string as a content to the footer of the table. + The header will be displayed in the top of every area of this table. + See also + + . + + a content string to be added to a footer cell + + + Gets the footer of the table. + Gets the footer of the table. The footer is represented as a distinct table and might have its own properties. + + + table footer or + + , if + + hasn't been called. + + + + + Tells you if the first header needs to be skipped (for instance if the + header says "continued from the previous page"). + + Value of property skipFirstHeader. + + + + Tells you if the last footer needs to be skipped (for instance if the + footer says "continued on the next page") + + Value of property skipLastFooter. + + + Skips the printing of the first header. + + Skips the printing of the first header. Used when printing tables in + succession belonging to the same printed table aspect. + + New value of property skipFirstHeader. + this element + + + Skips the printing of the last footer. + + Skips the printing of the last footer. Used when printing tables in + succession belonging to the same printed table aspect. + + New value of property skipLastFooter. + this element + + + Starts new row. + Starts new row. This mean that next cell will be added at the beginning of next line. + this element + + + Adds a new cell to the table. + + Adds a new cell to the table. The implementation decides for itself which + row the cell will be placed on. + + + + Cell + to add. + + this element + + + Adds a new cell with received blockElement as a content. + a blockElement to add to the cell and then to the table + this element + + + Adds a new cell with received image as a content. + an image to add to the cell and then to the table + this element + + + Adds a new cell with received string as a content. + a string to add to the cell and then to the table + this element + + + Returns a cell as specified by its location. + + Returns a cell as specified by its location. If the cell is in a col-span + or row-span and is not the top left cell, then null is returned. + + the row of the cell. indexes are zero-based + the column of the cell. indexes are zero-based + the cell at the specified position. + + + Creates a renderer subtree with root in the current table element. + + Creates a renderer subtree with root in the current table element. + Compared to + + , the renderer returned by this method should contain all the child + renderers for children of the current element. + + + a + + subtree for this element + + + + Gets a table renderer for this element. + + Gets a table renderer for this element. Note that this method can be called more than once. + By default each element should define its own renderer, but the renderer can be overridden by + + method call. + + a table renderer for this element + + + Indicates that all the desired content has been added to this large element. + + Indicates that all the desired content has been added to this large element. + After this method is called, more precise rendering is activated. + For instance, a table may have a + + method set to true, + and in case of large table on + + we do not know if any more content will be added, + so we might not place the content in the bottom of the page where it would fit, but instead add a footer, and + place that content in the start of the page. Technically such result would look all right, but it would be + more concise if we placed the content in the bottom and did not start new page. For such cases to be + renderered more accurately, one can call + + when some content is still there and not flushed. + + + + Writes the newly added content to the document. + + + Flushes the content which has just been added to the document. + + Flushes the content which has just been added to the document. + This is a method for internal usage and is called automatically by the docunent. + + + + Gets the markup properties of the bottom border of the (current) last row. + + an array of + + objects + + + + A simple object which holds the row numbers of a section of a table. + + + + Creates a + + + the start number of the row group, inclusive + the finish number of the row group, inclusive + + + Gets the starting row number of the table section + the start number of the row group, inclusive + + + Gets the finishing row number of the table section + the finish number of the row group, inclusive + + + + A TabStop is the closest location on a line of text that the text will jump + to if a + + is inserted. At least one TabStop must be defined on an + element if you want to use + Tabs + . + This object can be added to a + + with the method + + . + + + + Creates a TabStop at the appropriate position. + a float, measured in points + + + + Creates a TabStop at the appropriate position, with a specified tab + alignment. + + + Creates a TabStop at the appropriate position, with a specified tab + alignment. A tab alignment defines the way the textual content should be + positioned with regards to this tab stop. + + a float, measured in points + + a + + value + + + + + Creates a TabStop at the appropriate position, with a specified tab + alignment and an explicitly given line pattern. + + + Creates a TabStop at the appropriate position, with a specified tab + alignment and an explicitly given line pattern. A tab alignment defines + the way the textual content should be positioned with regards to this tab + stop. The line pattern defines a pattern that should be repeated until + the TabStop is reached. If null, the space leading up to the TabStop will + be empty. + + a float, measured in points + + a + + value + + + the + + value, a pattern drawing object + + + + + Complex FontSelectorStrategy split text based on + + . + If unicode script changes, a new font will be found. + If there is no suitable font, only one notdef glyph from + + will be added. + + + + + + responsible for splitting text into sub texts with font. + + will create next sub text and set current font. + + + + Set font style + shall be 'normal', 'italic' or 'oblique'. + + + + Split css font-family string into list of font-families or generic-families + + + + + Contains all font related data to create + + and + + . + + fetches with + + . + + + + + + Create + + or get from cache. + + target font families + + instance of + + . + + + an instance of + + . + + } + + + + Create a new instance of + + . While caching is main responsibility of + + , + this method just create a new instance of + + . + + Set of all available fonts in current context. + target font families + + instance of + + . + + + an instance of + + . + + + + + Get from cache or create a new instance of + + . + + + font info, to create + + and + + . + + + cached or new instance of + + . + + + on I/O exceptions in + + . + + + + Sort given set of fonts according to font name and style. + + + Create new FontSelector instance. + Unsorted set of all available fonts. + sorted list of preferred font families. + + + The best font match. + + The best font match. + If any font from + + doesn't contain requested glyphs, this font will be used. + + + + Sorted set of fonts. + + + + Key for + + caching. + + FontSet#getFontSelectorCache(). + + + Reusable font set for FontProgram related data. + + + + Add not supported for auto creating FontPrograms. + + + FontEncoding for creating + + . + + false, if fontProgram is null, otherwise true. + + + +

    This class implements a simple byte vector with access to the + underlying array.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Capacity increment size + + + The encapsulated array + + + Points to next free item + + + Construct byte vector instance with default block size. + + + Construct byte vector instance. + initial block size + + + Construct byte vector instance. + + byte array to use + TODO should n should be initialized to a.length to be consistent with + CharVector behavior? [GA] + + + + Construct byte vector instance. + byte array to use + + initial block size + TODO should n should be initialized to a.length to be consistent with + CharVector behavior? [GA] + + + + Obtain byte vector array. + byte array + + + Obtain number of items in array. + number of items + + + Obtain capacity of array. + current capacity of array + + + Pet byte at index. + the index + a byte + + + Get byte at index. + the index + a byte + + + This is to implement memory allocation in the array. + This is to implement memory allocation in the array. Like malloc(). + to allocate + previous length + + + Trim byte vector to current length. + + + +

    This class implements a simple char vector with access to the + underlying array.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Capacity increment size + + + The encapsulated array + + + Points to next free item + + + Construct char vector instance with default block size. + + + Construct char vector instance. + initial block size + + + Construct char vector instance. + char array to use + + + Construct char vector instance. + char array to use + initial block size + + + Copy constructor + the CharVector that should be cloned + + + Reset length of vector, but don't clear contents. + + + Obtain char vector array. + char array + + + Obtain number of items in array. + number of items + + + Obtain capacity of array. + current capacity of array + + + Pet char at index. + the index + a char + + + Get char at index. + the index + a char + + + This is to implement memory allocation in the array. + This is to implement memory allocation in the array. Like malloc(). + to allocate + previous length + + + Trim char vector to current length. + + + Represents a hyphen. + + + pre break string + + + no break string + + + post break string + + + Construct a hyphen. + break string + break string + break string + + + Construct a hyphen. + break string + + + + + + + + + + number of hyphenation points in word + + + + rawWord as made of alternating strings and + Hyphen + instances + + + + the number of hyphenation points in the word + + + an index position + the pre-break text, not including the hyphen character + + + an index position + the post-break text + + + the hyphenation points + + + + + + + + + This is the class used to configure hyphenation on layout level + + + The Hyphenator object. + + + The hyphenation symbol used when hyphenating. + + + + Constructs a new + + . No language hyphenation files will be used. + Only soft hyphen symbols ('\u00ad') will be taken into account. + + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + + Constructs a new + + by a + + which will be used to + find hyphenation points. + + + the + + instance + + + + + Constructs a new + + instance. + + the language + the optional country code (may be null or "none") + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Hyphenates a given word. + + + + object representing possible hyphenation points + or + + if no hyphenation points are found. + + + + Gets the hyphenation symbol. + the hyphenation symbol + + + Sets the hyphenation symbol to the specified value. + the new hyphenation symbol + + + A hyphenation exception. + + A hyphenation exception. +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Construct a hyphenation exception. + a message string + + + + + allocation size for arrays + + + + Pointer to low branch and to rest of the key when it is + stored directly in this node, we don't have unions in java! + + + + Pointer to high branch. + + + Pointer to equal branch and to data when this node is a string terminator. + + + + This vector holds the trailing of the keys when the branch is compressed. + + + root + + + free node + + + number of items in tree + + + default constructor + + + initialize + + + + Branches are initially compressed, needing + one node per key plus the size of the string + key. + + + Branches are initially compressed, needing + one node per key plus the size of the string + key. They are decompressed as needed when + another key with same prefix + is inserted. This saves a lot of space, + specially for long keys. + + the key + a value + + + Insert key. + the key + offset into key array + a value + + + The actual insertion function, recursive version. + + + Compares 2 null terminated char arrays + a character array + an index into character array + a character array + an index into character array + an integer + + + Compares a string with null terminated char array + a string + a character array + an index into character array + an integer + + + a character array + an index into character array + a character array + an index into character array + + + a character array + an index into character array + an integer + + + a character array + an integer + + + Find key. + the key + result + + + Find key. + the key + offset into key array + result + + + a key + trye if key present + + + length + + + + Recursively insert the median first and then the median of the + lower and upper halves, and so on in order to get a balanced + tree. + + + Recursively insert the median first and then the median of the + lower and upper halves, and so on in order to get a balanced + tree. The array of keys is assumed to be sorted in ascending + order. + + array of keys + array of values + where to insert + count to insert + + + Balance the tree for best search performance + + + + Each node stores a character (splitchar) which is part of + some key(s). + + + Each node stores a character (splitchar) which is part of + some key(s). In a compressed branch (one that only contain + a single string key) the trailer of the key which is not + already in nodes is stored externally in the kv array. + As items are inserted, key substrings decrease. + Some substrings may completely disappear when the whole + branch is totally decompressed. + The tree is traversed to find the key substrings actually + used. In addition, duplicate substrings are removed using + a map (implemented with a TernaryTree!). + + + + the keys + + + +

    This interface is used to connect the XML pattern file parser to + the hyphenation tree.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Add a character class. + + Add a character class. + A character class defines characters that are considered + equivalent for the purpose of hyphenation (e.g. "aA"). It + usually means to ignore case. + + character group + + + Add a hyphenation exception. + + Add a hyphenation exception. An exception replaces the + result obtained by the algorithm for cases for which this + fails or the user wants to provide his own hyphenation. + A hyphenatedword is a vector of alternating String's and + Hyphen + instances + + word to add as an exception + pre-hyphenated word + + + Add hyphenation patterns. + the pattern + + interletter values expressed as a string of + digit characters. + + + + value space: stores the interletter values + + + This map stores hyphenation exceptions + + + This map stores the character classes + + + Temporary map to store interletter values on pattern loading. + + + Default constructor. + + + + Packs the values by storing them in 4 bits, two values into a byte + Values range is from 0 to 9. + + + Packs the values by storing them in 4 bits, two values into a byte + Values range is from 0 to 9. We use zero as terminator, + so we'll add 1 to the value. + + + a string of digits from '0' to '9' representing the + interletter values. + + + the index into the vspace array where the packed values + are stored. + + + + Unpack values. + an integer + a string + + + Read hyphenation patterns from an XML file. + the filename + In case the parsing fails + + + + + Read hyphenation patterns from an XML file. + the InputSource for the file + unique key representing country-language combination + In case the parsing fails + + + + Find pattern. + a pattern + a string + + + + String compare, returns 0 if equal or + t is a substring of s. + + first character array + starting index into first array + second character array + starting index into second array + an integer + + + Get values. + an integer + a byte array + + + + Hyphenate word and return a Hyphenation object. + the word to be hyphenated + + Minimum number of characters allowed + before the hyphenation point. + + + Minimum number of characters allowed after + the hyphenation point. + + + a + Hyphenation + object representing + the hyphenated word or null if word is not hyphenated. + + + + Hyphenate word and return an array of hyphenation points. + char array that contains the word + Offset to first character in word + Length of word + + Minimum number of characters allowed + before the hyphenation point. + + + Minimum number of characters allowed after + the hyphenation point. + + + a + Hyphenation + object representing + the hyphenated word or null if word is not hyphenated. + + + + Add a character class to the tree. + + Add a character class to the tree. It is used by + PatternParser + as callback to + add character classes. Character classes define the + valid word characters for hyphenation. If a word contains + a character not defined in any of the classes, it is not hyphenated. + It also defines a way to normalize the characters in order + to compare them with the stored patterns. Usually pattern + files use only lower case characters, in this case a class + for letter 'a', for example, should be defined as "aA", the first + character being the normalization char. + + a character class (group) + + + Add an exception to the tree. + + Add an exception to the tree. It is used by + PatternParser + class as callback to + store the hyphenation exceptions. + + normalized word + + a vector of alternating strings and + hyphen + objects. + + + + Add a pattern to the tree. + + Add a pattern to the tree. Mainly, to be used by + PatternParser + class as callback to + add a pattern to the tree. + + the hyphenation pattern + + interletter weight values indicating the + desirability and priority of hyphenating at a given point + within the pattern. It should contain only digit characters. + (i.e. '0' to '9'). + + + +

    This is a cache for HyphenationTree instances.

    +
    + + Contains the cached hyphenation trees + + + Used to avoid multiple error messages for the same language if a pattern file is missing. + + + Looks in the cache if a hyphenation tree is available and returns it if it is found. + the language + the country (may be null or "none") + the HyhenationTree instance or null if it's not in the cache + + + Constructs the key for the hyphenation pattern file. + the language + the country (may be null or "none") + the resulting key + + + + If the user configured a hyphenation pattern file name + for this (lang,country) value, return it. + + + If the user configured a hyphenation pattern file name + for this (lang,country) value, return it. If not, return null. + + the language + the country (may be null or "none") + the map of user-configured hyphenation pattern file names + the hyphenation pattern file name or null + + + Cache a hyphenation tree under its key. + the key (ex. "de_CH" or "en") + the hyphenation tree + + + Notes a key to a hyphenation tree as missing. + + Notes a key to a hyphenation tree as missing. + This is to avoid searching a second time for a hyphenation pattern file which is not + available. + + the key (ex. "de_CH" or "en") + + + Indicates whether a hyphenation file has been requested before but it wasn't available. + + Indicates whether a hyphenation file has been requested before but it wasn't available. + This is to avoid searching a second time for a hyphenation pattern file which is not + available. + + the key (ex. "de_CH" or "en") + true if the hyphenation tree is unavailable + + + + Logging instance. + + + Creates a new hyphenator. + the language + the optional country code (may be null or "none") + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Creates a new hyphenator. + the language + the optional country code (may be null or "none") + the map with user-configured hyphenation pattern file names + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + + + Registers additional file directories. + directory to register + + + Returns the default hyphenation tree cache. + the default (static) hyphenation tree cache + + + Clears the default hyphenation tree cache. + Clears the default hyphenation tree cache. This method can be used if the underlying data files are changed at runtime. + + + + + Returns a hyphenation tree for a given language and country, + with fallback from (lang,country) to (lang). + + + Returns a hyphenation tree for a given language and country, + with fallback from (lang,country) to (lang). + The hyphenation trees are cached. + + the language + the country (may be null or "none") + the map with user-configured hyphenation pattern file names + the hyphenation tree + + + Returns a hyphenation tree for a given language and country. + Returns a hyphenation tree for a given language and country. The hyphenation trees are cached. + the language + the country (may be null or "none") + the map with user-configured hyphenation pattern file names + the hyphenation tree + + + Load tree from xml file using configuration settings. + the directory to search the file into + language key for the requested hyphenation file + the requested HyphenationTree or null if it is not available + + + Load tree from the stream. + the input stream to load the tree from + unique key representing country-language combination + the requested HyphenationTree or null if it is not available + + + Hyphenates a word. + the language + the optional country code (may be null or "none") + the map with user-configured hyphenation pattern file names + the word to hyphenate + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + the hyphenation result + + + Hyphenates a word. + the language + the optional country code (may be null or "none") + the word to hyphenate + the minimum number of characters before the hyphenation point + the minimum number of characters after the hyphenation point + the hyphenation result + + + Hyphenates a word. + the word to hyphenate + the hyphenation result + + + +

    A SAX document handler to read and parse hyphenation patterns + from a XML file.

    +

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    +
    +
    + + Construct a pattern parser. + if a hyphenation exception is raised + + + + Construct a pattern parser. + a pattern consumer + if a hyphenation exception is raised + + + + Parses a hyphenation pattern file. + the filename + In case of an exception while parsing + + + + + Parses a hyphenation pattern file. + the InputStream for the file + unique key representing country-language combination + In case of an exception while parsing + + + + if not caught + + + + An object that iterates over the + + . + + + + current node index + + + current key + + + Node stack + + + key stack implemented with a StringBuffer + + + default constructor + + + rewind iterator + + + Resets the Iterator to its initial state. + + + value + + + true if more elements + + + traverse upwards + + + traverse the tree to find next key + + + next element + + + parent + + + child + + + default constructor + + + Construct item. + a char + a char + + + + Represents the area for content + layouting + . + + + + The number of page on which the area is located. + + + The area's bounding box + + + Indicates whether the area already has some placed content or not. + + + + Creates the area for content + layouting + . + + the number of page on which the area is located. + the area's bounding box + + + Gets the number of page on which the area is located. + page number + + + + Gets the + box + which bounds the area. + + the bounding box + + + + Sets the + box + which bounds the area. + + + + Indicates whether the area already has some placed content or not. + whether the area is empty or not + + + Defines whether the area already has some placed content or not. + + + + + + + + + + + + + + + + Represents the context for content + layouting + . + + + + + The + area + the content to be placed on. + + + + + Gets the + area + the content to be placed on. + + the area for content layouting. + + + + + + We use a simplified version of CSS positioning. + + We use a simplified version of CSS positioning. + See https://www.webkit.org/blog/117/webcore-rendering-iv-absolutefixed-and-relative-positioning + + + + Default positioning by normal rules of block and line layout. + + + + Relative positioning is exactly like static positioning except that the left, top, right and bottom properties + can be used to apply a translation to the object. + + + Relative positioning is exactly like static positioning except that the left, top, right and bottom properties + can be used to apply a translation to the object. Relative positioning is literally nothing more than a paint-time translation. + As far as layout is concerned, the object is at its original position. + + + + + Absolute positioned objects are positioned relative to the containing block, which is the nearest enclosing + ancestor block with a position other than 'static'. + + + + Fixed positioned objects are positioned relative to the viewport, i.e., the page area of the current page. + + + + Calculates the common rectangle which includes all the input rectangles. + + list of input rectangles. + common rectangle. + + + + Represents the result of content + layouting + . + + + + + The status of + + which indicates that the content was fully placed. + + + + + The status of + + which indicates that the content was placed partially. + + + + + The status of + + which indicates that the content was not placed. + + + + + The status of + + which indicates whether the content was added or not + and, if yes, was it added fully or partially. + + + + + The area occupied by the content during its + layouting + . + which indicates whether the content was added or not and, if yes, was it added fully or partially. + + + + + The split renderer created during + layouting + . + This renderer will be used to draw the splitted part of content. + + + + + The overflow renderer created during + layouting + . + This renderer will be used to draw the overflowed part of content. + + + + + The first renderer to produce + + during + + . + + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + + Gets the status of + + . + + the status + + + + Sets the status of + + . + + + + + Gets the + layout area + occupied by the content during + layouting + . + + + the + layout area + occupied by the content + + + + + Gets the split + renderer + created during + layouting + . + + + the + renderer + + + + + Sets the split + renderer + . + + + + + Gets the overflow renderer created during + layouting + . + + + the + renderer + + + + + Sets the overflow + renderer + . + + + + + Gets the first renderer to produce + + during + + + + the + renderer + + + + + + + + Represents the result of a line + layouting + . + + + + + Represents the result of content + layouting + . + + + + Indicates whether split was forced by new line symbol or not. + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + Indicates whether split was forced by new line symbol in rendered text. + + Indicates whether split was forced by new line symbol in rendered text. + The value will be set as true if, for example, + the rendered text of one of the child renderers contains '\n' symbol. + + whether split was forced by new line or not + + + + Sets + + + indicates that split was forced by new line symbol in rendered text. + + + this layout result + the setting was applied on. + + + + + + Represents the result of a text + layout + . + + + + + Indicates whether some word was splitted during + layout + . + + + + Indicates whether split was forced by new line symbol in text or not. + + + + Creates the + + result of + layouting + }. + The + + will be set as null. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + + + Creates the + + result of + layouting + }. + + + the status of + + + the area occupied by the content + the renderer to draw the splitted part of the content + the renderer to draw the overflowed part of the content + + the first renderer to produce + + + + + + Indicates whether some word in a rendered text was splitted during + layout + . + The value will be set as true if, for example, the rendered words width is bigger than the width of layout area. + + whether some word was splitted or not. + + + + Sets + + + + indicates that some word was splitted during + layout + . + + + + this layout result + the setting was applied on + + + + + Indicates whether split was forced by new line symbol in rendered text. + + Indicates whether split was forced by new line symbol in rendered text. + The value will be set as true if, for example, the rendered text contains '\n' symbol. + This value can also be true even if the text was fully placed, but had line break at the end. + + whether split was forced by new line or not. + + + + Sets + + + indicates that split was forced by new line symbol in rendered text. + + + this layout result + the setting was applied on. + + + + + + Rules of the margins collapsing are taken from Mozilla Developer Network: + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing + See also: + https://www.w3.org/TR/CSS2/box.html#collapsing-margins + + + + + A specialized class holding configurable properties related to an + + 's background. This class is meant to be used as the value for the + + key in an + + . Allows + to define a background color, and positive or negative changes to the + location of the edges of the background coloring. + + + + Creates a background with a specified color. + the background color + + + Creates a background with a specified color and opacity. + the background color + the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + These values are allowed to be negative. + + the background color + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + + + Creates a background with a specified color, and extra space that + must be counted as part of the background and therefore colored. + These values are allowed to be negative. + + the background color + the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + extra coloring to the left side + extra coloring at the top + extra coloring to the right side + extra coloring at the bottom + + + Gets the background's color. + + a + + of any supported kind + + + + Gets the opacity of the background. + a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + + Gets the extra space that must be filled to the left of the Element. + a float value + + + Gets the extra space that must be filled to the right of the Element. + a float value + + + Gets the extra space that must be filled at the top of the Element. + a float value + + + Gets the extra space that must be filled at the bottom of the Element. + a float value + + + + A specialized class that specifies the leading, "the vertical distance between + the baselines of adjacent lines of text" (ISO-32000-1, section 9.3.5). + + + A specialized class that specifies the leading, "the vertical distance between + the baselines of adjacent lines of text" (ISO-32000-1, section 9.3.5). + Allows to use either an absolute (constant) leading value, or one + determined by font size. Pronounce as 'ledding' (cfr. Led Zeppelin). + This class is meant to be used as the value for the + + key in an + + . + + + + A leading type independent of font size. + + + A leading type related to the font size and the resulting bounding box. + + + Creates a Leading object. + + a constant type that defines the calculation of actual + leading distance. Either + + or + + + to be used as a basis for the leading calculation. + + + Gets the calculation type of the Leading object. + + the calculation type. Either + + or + + + + + Gets the value to be used as the basis for the leading calculation. + a calculation value + + + A specialized enum containing alignment properties for list symbols. + + + + An enum of property names that are used for graphical properties of layout + elements. + + + An enum of property names that are used for graphical properties of layout + elements. The + + performs the same function as an + + , with the values of + + as its potential keys. + + + + String value. + + String value. 'normal'|'italic'|'oblique' + Note, this property will be applied only if + + has String value. + + + + String value. + + String value. 'normal'|'bold'|number + Note, this property will be applied only if + + has String value. + + + + Value of 1 is equivalent to no scaling + + + + Use values from + + . + + + + Value of 1 is equivalent to no scaling + + + + Some properties must be passed to + + objects that + are lower in the document's hierarchy. Most inherited properties are + related to textual operations. Indicates whether or not this type of property is inheritable. + + + + + This method checks whether a Property, in order to be picked up by the + rendering engine, must be defined on the current element or renderer + (return false), or may be defined in one of its parent + elements or renderers (return true). + + the ID, defined in this class, of the property to check + whether the property type is inheritable + + + A POJO that describes the underline of a layout element. + + A POJO that describes the underline of a layout element. + This class is to be used as a property for an element or renderer, + as the value for + + + + + Creates an Underline. + + Creates an Underline. Both the thickness and vertical positioning under + the text element's base line can be set to a fixed value, or a variable + one depending on the element's font size. + If you want a fixed-width thickness, set thicknessMul to 0; + if you want a thickness solely dependent on the font size, set + thickness to 0. + Mutatis mutandis for the y-position. + + + the + + of the underline + + a float defining the minimum thickness in points of the underline + a float defining the font size dependent component of the thickness of the underline + + a float defining the default absolute vertical distance in points from the text's base line + + a float defining the font size dependent component of the vertical positioning of the underline + + + the way the underline finishes at its edges. + + + + + Creates an Underline. + + Creates an Underline. Both the thickness and vertical positioning under + the text element's base line can be set to a fixed value, or a variable + one depending on the element's font size. + If you want a fixed-width thickness, set thicknessMul to 0; + if you want a thickness solely dependent on the font size, set + thickness to 0. + Mutatis mutandis for the y-position. + + + the + + of the underline + + a float defining the opacity of the underline; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + a float defining the minimum thickness in points of the underline + a float defining the font size dependent component of the thickness of the underline + + a float defining the default absolute vertical distance in points from the text's base line + + a float defining the font size dependent component of the vertical positioning of the underline + + + the way the underline finishes at its edges. + + + + + Gets the color of the underline. + + a + + + + + Gets the opacity of the underline color. + a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent + + + Gets the total thickness of the underline (fixed + variable part). + the font size for which to calculate the variable thickness + the total thickness, as a float, in points + + + Gets the vertical position of the underline (fixed + variable part). + the font size for which to calculate the variable position + the y-position, as a float, in points + + + Gets the multiplier for the vertical positioning of the text underline. + the Y-position multiplier, as a float + + + + Gets the + + of the text underline. + + + the line cap style, as an int referring to + the values of + + + + + A specialized class that holds a value and the unit it is measured in. + + + Creates a UnitValue object with a specified type and value. + + either + + or a + + + the value to be stored. + + + Creates a copy of UnitValue object. + + + Creates a UnitValue POINT object with a specified value. + the value to be stored. + + a new + + + + + + + Creates a UnitValue PERCENT object with a specified value. + the value to be stored. + + a new + + + + + + + Creates an array of UnitValue PERCENT objects with specified values. + the values to be stored. + + a new normalized (Σ=100%) array of + + + + . + + + + Creates an array of UnitValue POINT objects with specified values. + the values to be stored. + + a new array of + + + + + + + Returns the unit this value is stored in, either points (pt) or percent(%) + + either 1 for + + or 2 for + + + + + Sets the unit this value is stored in, either points (pt) or percent(%) + + either + + or + + + + + Gets the measured value stored in this object + the value, as a float + + + Sets the measured value stored in this object + a float + + + Returns whether or not the value is stored in points (pt) + true if stored in points + + + Returns whether or not the value is stored in percent (%) + true if stored in percent + + + Returns a property with a certain key, as a floating point value. + + an + enum value + + + a + + + + + Returns a property with a certain key, as a floating point value. + + an + enum value + + default value to be returned if property is not found + + a + + + + + Returns a property with a certain key, as an integer value. + + an + enum value + + + a + + + + + + Writes standard structure attributes to the IAccessibleElement based on the layout element properties + and renderer layout result. + + + + The same layout element instance can be added several times to the document. + + The same layout element instance can be added several times to the document. + In that case it will already have attributes which belong to the previous positioning on the page, and because of + that we want to remove those old irrelevant attributes. + + + + + Renderer object for the + + layout element. Will terminate the + current content area and initialize a new one. + + + + Creates an AreaBreakRenderer. + + the + + that will be rendered by this object + + + + + This method creates + + instance that could be used + to rotate content inside the occupied area. Be aware that it should be used only after + layout rendering is finished and correct occupied area for the rotated element is calculated. + + + + + that rotates the content and places it inside occupied area. + + + + Creates a CanvasRenderer from its corresponding layout object. + + Creates a CanvasRenderer from its corresponding layout object. + Sets + + to true. + + + the + + which this object should manage + + + + Creates a CanvasRenderer from its corresponding layout object. + + Creates a CanvasRenderer from its corresponding layout object. + Defines whether the content should be flushed immediately after addition + + or not + + + the + + which this object should manage + + the value which stands for immediate flushing + + + + + + + + + + + + Creates a CellRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + + + + + + Creates a DivRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + Creates an ImageRenderer from its corresponding layout object. + + the + + which this object should manage + + + + Gets the total lengths of characters in this line. + + Gets the total lengths of characters in this line. Other elements (images, tables) are not taken + into account. + + + + Returns the number of base characters, i.e. + Returns the number of base characters, i.e. non-mark characters + + + Calculates and sets encountered tab size. + + Calculates and sets encountered tab size. + Returns null, if processing is finished and layout can be performed for the tab renderer; + otherwise, in case when the tab should be processed after the next element in the line, this method returns corresponding tab stop. + + + + Calculates and sets tab size with the account of the element that is next in the line after the tab. + + + Calculates and sets tab size with the account of the element that is next in the line after the tab. + Returns resulting width of the tab. + + + + Trim first child text renderers. + total number of trimmed glyphs. + + + Apply OTF features and return the last(!) base direction of child renderer + the last(!) base direction of child renderer. + + + While resolving TextRenderer may split into several ones with different fonts. + + + Creates a LineSeparatorRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + This class represents the + renderer + object for a + + object. It will draw the glyphs of the textual content on the + + . + + + + Creates a TextRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + Creates a TextRenderer from its corresponding layout object, with a custom + text to replace the contents of the + + . + + + the + + which this object should manage + + the replacement text + + + + Trims any whitespace characters from the start of the + + to be rendered. + + + + + Trims any whitespace characters from the end of the rendered + + . + + the amount of space in points which the text was trimmed by + + + Gets the maximum offset above the base line that this Text extends to. + + the upwards vertical offset of this + + + + + Gets the maximum offset below the base line that this Text extends to. + + the downwards vertical offset of this + + + + + + Gets the position on the canvas of the imaginary horizontal line upon which + the + + 's contents will be written. + + + the y position of this text on the + + + + + Moves the vertical position to the parameter's value. + the new vertical position of the Text + + + + Manually sets the contents of the Text's representation on the canvas, + regardless of the Text's own contents. + + the replacement text + + + + Manually sets a GlyphLine to be rendered with a specific start and end + point. + + + a + + + the leftmost end of the GlyphLine + the rightmost end of the GlyphLine + + + The length of the whole text assigned to this renderer. + the text length + + + Gets char code at given position for the text belonging to this renderer. + the position in range [0; length()) + Unicode char code + + + + Returns the length of the + line + which is the result of the layout call. + + the length of the line + + + + Resolve + + string value. + + add all processed renderers to. + + true, if new + + has been created. + + + + Creates a LinkRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + Creates a LinkRenderer from its corresponding layout object, with a custom + text to replace the contents of the + + . + + + the + + which this object should manage + + the replacement text + + + Creates a ListItemRenderer from its corresponding layout object. + + the + + which this object should manage + + + + Creates a ListRenderer from its corresponding layout object. + + the + + which this object should manage + + + + +

    + Corrects split and overflow renderers when + + is applied. + We assume that + + is applied when the first + + cannot be fully layouted. + This means that the problem has occurred in one of first list item renderer's child. + We consider the right solution to force placement of all first item renderer's childs before the one, + which was the cause of + + , including this child. +

    +

    + Notice that we do not expect + + to be applied + if we can render the first item renderer and strongly recommend not to set + + manually. +

    +
    + + the + split renderer + before correction + + + the + overflow renderer + before correction + + + the + cause of nothing renderer + + the area occupied by layouting before correction + + corrected + layout result + +
    + + + This class represents the + renderer + object for a + + object. It will draw the glyphs of the textual content on the + + . + + + + Creates a ParagraphRenderer from its corresponding layout object. + + the + + which this object should manage + + + + + + + + + + + + + + + + + + + + + + + Gets the lines which are the result of the + + . + + paragraph lines, or null if layout hasn't been called yet + + + + This class represents the + renderer + object for a + + object. It will delegate its drawing operations on to the + + instances associated with the + table cells + . + + + + True for newly created renderer. + True for newly created renderer. For split renderers this is set to false. Used for tricky layout. + + + + + Creates a TableRenderer from a + + which will partially render + the table. + + the table to be rendered by this renderer + the table rows to be rendered + + + + Creates a TableRenderer from a + + . + + the table to be rendered by this renderer + + + + + + + + + + + + + + + + + + + + + If there is some space left, we move footer up, because initially footer will be at the very bottom of the area. + + + If there is some space left, we move footer up, because initially footer will be at the very bottom of the area. + We also adjust occupied area by footer size if it is present. + + the layout box which represents the area which is left free. + + + Returns the collapsed border. + + Returns the collapsed border. We process collapse + if the table border width is strictly greater than cell border width. + + cell border + table border + the collapsed border + + + This method is used to set row range for table renderer during creating a new renderer. + + This method is used to set row range for table renderer during creating a new renderer. + The purpose to use this method is to remove input argument RowRange from createOverflowRenderer + and createSplitRenderer methods. + + + + Returns minWidth + + + This are a structs used for convenience in layout. + + + Check collusion between min value and point width + + true, if + + greater than + + . + + + + Check collusion between min value and available point width. + additional available point width. + + true, if + + greater than ( + + + additionalWidth). + + + + Creates a TabRenderer from its corresponding layout object + + the + + which this object should manage + + + + + + + + + + + + + + + + The default implementation of + ISplitCharacters interface + . + + + + Interface for customizing the split character. + + + Returns true if the character can split a line. + + Returns true if the character can split a line. The splitting implementation + is free to look ahead or look behind characters to make a decision. + + + the position of + Glyph + in the + GlyphLine + + an array of unicode char codes which represent current text + + + Container object for style properties of an element. + + Container object for style properties of an element. A style can be used as + an effective way to define multiple equal properties to several elements. + Used in + + + + + Gets the current left margin width of the element. + the left margin width, as a float + + + Sets the left margin width of the element. + the new left margin width + this element + + + Gets the current right margin width of the element. + the right margin width, as a float + + + Sets the right margin width of the element. + the new right margin width + this element + + + Gets the current top margin width of the element. + the top margin width, as a float + + + Sets the top margin width of the element. + the new top margin width + this element + + + Gets the current bottom margin width of the element. + the bottom margin width, as a float + + + Sets the bottom margin width of the element. + the new bottom margin width + this element + + + Sets all margins around the element to the same width. + the new margin width + this element + + + Sets the margins around the element to a series of new widths. + the new margin top width + the new margin right width + the new margin bottom width + the new margin left width + this element + + + Gets the current left padding width of the element. + the left padding width, as a float + + + Sets the left padding width of the element. + the new left padding width + this element + + + Gets the current right padding width of the element. + the right padding width, as a float + + + Sets the right padding width of the element. + the new right padding width + this element + + + Gets the current top padding width of the element. + the top padding width, as a float + + + Sets the top padding width of the element. + the new top padding width + this element + + + Gets the current bottom padding width of the element. + the bottom padding width, as a float + + + Sets the bottom padding width of the element. + the new bottom padding width + this element + + + Sets all paddings around the element to the same width. + the new padding width + this element + + + Sets the paddings around the element to a series of new widths. + the new padding top width + the new padding right width + the new padding bottom width + the new padding left width + this element + + + Sets the vertical alignment of the element. + the vertical alignment setting + this element + + + + Sets a ratio which determines in which proportion will word spacing and character spacing + be applied when horizontal alignment is justified. + + + the ratio coefficient. It must be between 0 and 1, inclusive. + It means that ratio part of the free space will + be compensated by word spacing, and 1-ratio part of the free space will + be compensated by character spacing. + If ratio is 1, additional character spacing will not be applied. + If ratio is 0, additional word spacing will not be applied. + + + + + Returns whether the + + should be kept together as much + as possible. + + + the current value of the + + property + + + + + Sets whether the + + should be kept together as much + as possible. + + + the new value of the + + property + + this element + + + Sets the rotation radAngle. + the new rotation radAngle, as a float + this element + + + Sets the rotation angle. + the new rotation angle, as a double + this element + +
    +
    diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.dll b/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.dll new file mode 100644 index 00000000000..0382ef03ef4 Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.xml b/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.xml new file mode 100644 index 00000000000..a1afb4466f7 --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.pdfa.xml @@ -0,0 +1,316 @@ + + + + itext.pdfa + + + + + + An abstract class that will run through all necessary checks defined in the + different PDF/A standards and levels. + + + An abstract class that will run through all necessary checks defined in the + different PDF/A standards and levels. A number of common checks are executed + in this class, while standard-dependent specifications are implemented in the + available subclasses. The standard that is followed is the series of ISO + 19005 specifications, currently generations 1 through 3. The ZUGFeRD standard + is derived from ISO 19005-3. + While it is possible to subclass this method and implement its abstract + methods in client code, this is not encouraged and will have little effect. + It is not possible to plug custom implementations into iText, because iText + should always refuse to create non-compliant PDF/A, which would be possible + with client code implementations. Any future generations of the PDF/A + standard and its derivates will get their own implementation in the + iText 7 - pdfa project. + + + + + The Red-Green-Blue color profile as defined by the International Color + Consortium. + + + + + The Cyan-Magenta-Yellow-Key (black) color profile as defined by the + International Color Consortium. + + + + + The Grayscale color profile as defined by the International Color + Consortium. + + + + The Output device class + + + The Monitor device class + + + The maximum Graphics State stack depth in PDF/A documents, i.e. + + The maximum Graphics State stack depth in PDF/A documents, i.e. the + maximum number of graphics state operators with code q that + may be opened (i.e. not yet closed by a corresponding Q) at + any point in a content stream sequence. + Defined as 28 by PDF/A-1 section 6.1.12, by referring to the PDF spec + Appendix C table 1 "architectural limits". + + + + Contains some objects that are already checked. + + Contains some objects that are already checked. + NOTE: Not all objects that were checked are stored in that set. This set is used for avoiding double checks for + actions, xObjects and page objects; and for letting those objects to be manually flushed. + Use this mechanism carefully: objects that are able to be changed (or at least if object's properties + that shall be checked are able to be changed) shouldn't be marked as checked if they are not to be + flushed immediately. + + + + + This method checks a number of document-wide requirements of the PDF/A + standard. + + + This method checks a number of document-wide requirements of the PDF/A + standard. The algorithms of some of these checks vary with the PDF/A + level and thus are implemented in subclasses; others are implemented + as private methods in this class. + + + + + + This method checks all requirements that must be fulfilled by a page in a + PDF/A document. + + the page that must be checked + + + + This method checks the requirements that must be fulfilled by a COS + object in a PDF/A document. + + the COS object that must be checked + + + + Gets the + + for this file. + + the defined conformance level for this document. + + + + Remembers which objects have already been checked, in order to avoid + redundant checks. + + the object to check + whether or not the object has already been checked + + + + This method checks compliance of the tag structure elements, such as struct elements + or parent tree entries. + + an object that represents tag structure element. + + + + This method checks compliance with the graphics state architectural + limitation, explained by + + . + + the operation to check the graphics state counter for + + + + This method checks compliance with the inline image restrictions in the + PDF/A specs, specifically filter parameters. + + + a + + containing the inline image + + + a + + containing the color spaces used in the document + + + + + This method checks compliance with the color restrictions imposed by the + available color spaces in the document. + + the color to check + + a + + containing the color spaces used in the document + + whether the color is used for fill or stroke operations + + + + This method performs a range of checks on the given color space, depending + on the type and properties of that color space. + + the color space to check + + a + + containing the color spaces used in the document + + whether or not to also check the parent color space + whether the color space is used for fill or stroke operations + + + + Checks whether the rendering intent of the document is within the allowed + range of intents. + + + Checks whether the rendering intent of the document is within the allowed + range of intents. This is defined in ISO 19005-1 section 6.2.9, and + unchanged in newer generations of the PDF/A specification. + + the intent to be analyzed + + + + Performs a number of checks on the graphics state, among others ISO + 19005-1 section 6.2.8 and 6.4 and ISO 19005-2 section 6.2.5 and 6.2.10. + + the graphics state to be checked + + + Performs a number of checks on the font. + + Performs a number of checks on the font. See ISO 19005-1 section 6.3, + ISO 19005-2 and ISO 19005-3 section 6.2.11. + Be aware that not all constraints defined in the ISO are checked in this method, + for most of them we consider that iText always creates valid fonts. + + font to be checked + + + Creates a PdfA1Checker with the required conformance level + + the required conformance level, a or + b + + + + + Creates a PdfA2Checker with the required conformance level + + the required conformance level, a or + u or b + + + + + PdfA3Checker defines the requirements of the PDF/A-3 standard and contains a + number of methods that override the implementations of its superclass + + . + The specification implemented by this class is ISO 19005-3 + + + + Creates a PdfA3Checker with the required conformance level + + the required conformance level, a or + u or b + + + + Exception that is thrown when the PDF Document doesn't adhere to the PDF/A specification. + + + Creates a PdfAConformanceException. + the error message + + + Creates a PdfAConformanceException. + the error message + an object + + + + This class extends + + and is in charge of creating files + that comply with the PDF/A standard. + Client code is still responsible for making sure the file is actually PDF/A + compliant: multiple steps must be undertaken (depending on the + + ) to ensure that the PDF/A standard is followed. + This class will throw exceptions, mostly + + , + and thus refuse to output a PDF/A file if at any point the document does not + adhere to the PDF/A guidelines specified by the + + . + + + + Constructs a new PdfADocument for writing purposes, i.e. + + Constructs a new PdfADocument for writing purposes, i.e. from scratch. A + PDF/A file has a conformance level, and must have an explicit output + intent. + + + the + + object to write to + + the generation and strictness level of the PDF/A that must be followed. + + a + + + + + Opens a PDF/A document in the stamping mode. + PDF reader. + PDF writer. + + + Open a PDF/A document in stamping mode. + PDF reader. + PDF writer. + properties of the stamping process + + + + Gets the PdfAConformanceLevel set in the constructor or in the metadata + of the + + . + + + a + + + + + + + + Utilities to construct an XMP for a PDF/A file. + + + diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.sign.dll b/src/packages/itext7.7.0.2/lib/net40/itext.sign.dll new file mode 100644 index 00000000000..24ba61c301d Binary files /dev/null and b/src/packages/itext7.7.0.2/lib/net40/itext.sign.dll differ diff --git a/src/packages/itext7.7.0.2/lib/net40/itext.sign.xml b/src/packages/itext7.7.0.2/lib/net40/itext.sign.xml new file mode 100644 index 00000000000..2493d23e4c2 --- /dev/null +++ b/src/packages/itext7.7.0.2/lib/net40/itext.sign.xml @@ -0,0 +1,2573 @@ + + + + itext.sign + + + + + This class allows you to sign with either an RSACryptoServiceProvider/DSACryptoServiceProvider from a X509Certificate2, + or from manually created RSACryptoServiceProvider/DSACryptoServiceProvider. + Depending on the certificate's CSP, sometimes you will not be able to sign with SHA-256/SHA-512 hash algorithm with + RSACryptoServiceProvider taken directly from the certificate. + This class allows you to use a workaround in this case and sign with certificate's private key and SHA-256/SHA-512 anyway. + + An example of a workaround for CSP that does not support SHA-256/SHA-512: + + if (certificate.PrivateKey is RSACryptoServiceProvider) + { + RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)certificate.PrivateKey; + + // Modified by J. Arturo + // Workaround for SHA-256 and SHA-512 + + if (rsa.CspKeyContainerInfo.ProviderName == "Microsoft Strong Cryptographic Provider" || + rsa.CspKeyContainerInfo.ProviderName == "Microsoft Enhanced Cryptographic Provider v1.0" || + rsa.CspKeyContainerInfo.ProviderName == "Microsoft Base Cryptographic Provider v1.0") + { + string providerName = "Microsoft Enhanced RSA and AES Cryptographic Provider"; + int providerType = 24; + + Type CspKeyContainerInfo_Type = typeof(CspKeyContainerInfo); + + FieldInfo CspKeyContainerInfo_m_parameters = CspKeyContainerInfo_Type.GetField("m_parameters", BindingFlags.NonPublic | BindingFlags.Instance); + CspParameters parameters = (CspParameters)CspKeyContainerInfo_m_parameters.GetValue(rsa.CspKeyContainerInfo); + + var cspparams = new CspParameters(providerType, providerName, rsa.CspKeyContainerInfo.KeyContainerName); + cspparams.Flags = parameters.Flags; + + using (var rsaKey = new RSACryptoServiceProvider(cspparams)) + { + // use rsaKey now + } + } + else + { + // Use rsa directly + } + } + + + + + + + + + + Interface that needs to be implemented to do the actual signing. + + Interface that needs to be implemented to do the actual signing. + For instance: you'll have to implement this interface if you want + to sign a PDF using a smart card. + + Paulo Soares + + + Returns the hash algorithm. + The hash algorithm (e.g. "SHA-1", "SHA-256,..."). + + + Returns the encryption algorithm used for signing. + The encryption algorithm ("RSA" or "DSA"). + + + + Signs the given message using the encryption algorithm in combination + with the hash algorithm. + + The message you want to be hashed and signed. + A signed message digest. + + + + The hash algorithm. + + + The encryption algorithm (obtained from the private key) + + + + Class containing static methods that allow you to get information from + an X509 Certificate: the issuer and the subject. + + + + Get the issuer fields from an X509 Certificate. + an X509Certificate + an X500Name + + + Get the "issuer" from the TBSCertificate bytes that are passed in. + a TBSCertificate in a byte array + an ASN1Primitive + + + Get the subject fields from an X509 Certificate. + an X509Certificate + an X500Name + + + Get the "subject" from the TBSCertificate bytes that are passed in. + A TBSCertificate in a byte array + a ASN1Primitive + + + Class that holds an X509 name. + + + Country code - StringType(SIZE(2)). + + + Organization - StringType(SIZE(1..64)). + + + Organizational unit name - StringType(SIZE(1..64)). + + + Title. + + + Common name - StringType(SIZE(1..64)). + + + Device serial number name - StringType(SIZE(1..64)). + + + Locality name - StringType(SIZE(1..64)). + + + State, or province name - StringType(SIZE(1..64)). + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Naming attribute of type X520name. + + + Email address (RSA PKCS#9 extension) - IA5String. + + Email address (RSA PKCS#9 extension) - IA5String. +

    Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.

    +
    +
    + + Email address in Verisign certificates. + + + Object identifier. + + + LDAP User id. + + + A Map with default symbols. + + + A Map with values. + + + Constructs an X509 name. + an ASN1 Sequence + + + Constructs an X509 name. + a directory name + + + Gets the first entry from the field array retrieved from the values Map. + the field name + the (first) field value + + + Gets a field array from the values Map. + + List + + + Getter for values. + Map with the fields of the X509 name + + + Class for breaking up an X500 Name into it's component tokens, similar to java.util.StringTokenizer. + + + Class for breaking up an X500 Name into it's component tokens, similar to java.util.StringTokenizer. + We need this class as some of the lightweight Java environments don't support classes such as StringTokenizer. + + + + Creates an X509NameTokenizer. + the oid that needs to be parsed + + + Checks if the tokenizer has any tokens left. + true if there are any tokens left, false if there aren't + + + Returns the next token. + the next token + + + + This class contains a series of static methods that + allow you to retrieve information from a Certificate. + + + + Gets a CRL from a certificate + + the CRL or null if there's no CRL available + + + + + + Gets the URL of the Certificate Revocation List for a Certificate + the Certificate + the String where you can check if the certificate was revoked + + + + + Gets the CRL object using a CRL URL. + the URL where to get the CRL + a CRL object + + + + + + Retrieves the OCSP URL from the given certificate. + the certificate + the URL or null + + + + Gets the URL of the TSA if it's available on the certificate + a certificate + a TSA URL + + + + the certificate from which we need the ExtensionValue + the Object Identifier value for the extension. + the extension value as an ASN1Primitive object + + + + Gets a String from an ASN1Primitive + the ASN1Primitive + a human-readable String + + + + This class consists of some methods that allow you to verify certificates. + + + The Logger instance. + + + Verifies a single certificate for the current date. + the certificate to verify + the certificate revocation list or null + + a String with the error description or null + if no error + + + + Verifies a single certificate. + the certificate to verify + the certificate revocation list or null + the date, shall not be null + + a String with the error description or null + if no error + + + + Verifies a certificate chain against a KeyStore for the current date. + the certificate chain + the KeyStore + the certificate revocation list or null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore. + the certificate chain + the KeyStore + the certificate revocation list or null + the date, shall not be null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore for the current date. + the certificate chain + the KeyStore + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies a certificate chain against a KeyStore. + the certificate chain + the KeyStore + the date, shall not be null + + null if the certificate chain could be validated or a + Object[]{cert,error} where cert is the + failed certificate and error is the error message + + + + Verifies an OCSP response against a KeyStore. + the OCSP response + the KeyStore + the provider or null to use the BouncyCastle provider + true is a certificate was found + + + Verifies a time stamp against a KeyStore. + the time stamp + the KeyStore + the provider or null to use the BouncyCastle provider + true is a certificate was found + + + + Superclass for a series of certificate verifiers that will typically + be used in a chain. + + + Superclass for a series of certificate verifiers that will typically + be used in a chain. It wraps another CertificateVerifier + that is the next element in the chain of which the verify() + method will be called. + + + + The previous CertificateVerifier in the chain of verifiers. + + + Indicates if going online to verify a certificate is allowed. + + + Creates the final CertificateVerifier in a chain of verifiers. + the previous verifier in the chain + + + Decide whether or not online checking is allowed. + + + + + Checks the validity of the certificate, and calls the next + verifier in the chain, if any. + + the certificate that needs to be checked + its issuer + the date the certificate needs to be valid + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + An implementation of the CrlClient that handles offline + Certificate Revocation Lists. + + Paulo Soares + + + + Interface that needs to be implemented if you want to embed + Certificate Revocation Lists (CRL) into your PDF. + + Paulo Soares + + + Gets an encoded byte array. + The certificate which a CRL URL can be obtained from. + A CRL url if you don't want to obtain it from the certificate. + A collection of byte array each representing a crl. It may return null or an empty collection. + + + The CRL as a byte array. + + + + Creates an instance of a CrlClient in case you + have a local cache of the Certificate Revocation List. + + the CRL bytes + + + + Creates an instance of a CrlClient in case you + have a local cache of the Certificate Revocation List. + + a CRL object + + + Returns the CRL bytes (the parameters are ignored). + + + + + An implementation of the CrlClient that fetches the CRL bytes + from an URL. + + Paulo Soares + + + The Logger instance. + + + The URLs of the CRLs. + + + + Creates a CrlClientOnline instance that will try to find + a single CRL by walking through the certificate chain. + + + + Creates a CrlClientOnline instance using one or more URLs. + + + Creates a CrlClientOnline instance using one or more URLs. + + + Creates a CrlClientOnline instance using a certificate chain. + + + Adds an URL to the list of CRL URLs + an URL in the form of a String + + + Adds an URL to the list of CRL URLs + an URL object + + + Fetches the CRL bytes from an URL. + + Fetches the CRL bytes from an URL. + If no url is passed as parameter, the url will be obtained from the certificate. + If you want to load a CRL from a local file, subclass this method and pass an + URL with the path to the local file to this method. An other option is to use + the CrlClientOffline class. + + + + + + Class that allows you to verify a certificate against + one or more Certificate Revocation Lists. + + + + + Verifies a certificate against a KeyStore + containing trusted anchors. + + + + A key store against which certificates can be verified. + + + Creates a RootStoreVerifier in a chain of verifiers. + the next verifier in the chain + + + Sets the Key Store against which a certificate can be checked. + a root store + + + Verifies a single certificate against a key store (if present). + the certificate to verify + the issuer certificate + the date the certificate needs to be valid + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + The Logger instance + + + The list of CRLs to check for revocation date. + + + Creates a CRLVerifier instance. + the next verifier in the chain + a list of CRLs + + + Verifies if a a valid CRL is found for the certificate. + + Verifies if a a valid CRL is found for the certificate. + If this method returns false, it doesn't mean the certificate isn't valid. + It means we couldn't verify it against any CRL that was available. + + the certificate that needs to be checked + its issuer + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Verifies a certificate against a single CRL. + the Certificate Revocation List + a certificate that needs to be verified + its issuer + the sign date + true if the verification succeeded + + + + Fetches a CRL for a specific certificate online (without further checking). + the certificate + its issuer + an X509CRL object + + + Checks if a CRL verifies against the issuer certificate or a trusted anchor. + the CRL + the trusted anchor + true if the CRL can be trusted + + + Class that contains a map with the different message digest algorithms. + + + Algorithm available for signatures since PDF 1.3. + + + Algorithm available for signatures since PDF 1.6. + + + Algorithm available for signatures since PDF 1.7. + + + Algorithm available for signatures since PDF 1.7. + + + Algorithm available for signatures since PDF 1.7. + + + Maps the digest IDs with the human-readable name of the digest algorithm. + + + Maps digest algorithm that are unknown by the JDKs MessageDigest object to a known one. + + + Maps the name of a digest algorithm with its ID. + + + Get a digest algorithm. + oid of the digest algorithm + the provider you want to use to create the hash + MessageDigest object + + + + + Creates a MessageDigest object that can be used to create a hash. + the algorithm you want to use to create a hash + the provider you want to use to create the hash + a MessageDigest object + + + + + Creates a hash using a specific digest algorithm and a provider. + the message of which you want to create a hash + the algorithm used to create the hash + the provider used to create the hash + the hash + + + + + Create a digest based on the inputstream. + data to be digested + algorithm to be used + digest of the data + + + + + Gets the digest name for a certain id + an id (for instance "1.2.840.113549.2.5") + a digest name (for instance "MD5") + + + + Returns the id of a digest algorithms that is allowed in PDF, + or null if it isn't allowed. + + The name of the digest algorithm. + An oid. + + + Class that contains a map with the different encryption algorithms. + + + Maps IDs of encryption algorithms with its human-readable name. + + + Gets the algorithm name for a certain id. + an id (for instance "1.2.840.113549.1.1.1") + an algorithm name (for instance "RSA") + + + Produces a blank (or empty) signature. + + Produces a blank (or empty) signature. Useful for deferred signing with + MakeSignature.signExternalContainer(). + + Paulo Soares + + + Interface to sign a document. + Interface to sign a document. The signing is fully done externally, including the container composition. + + Paulo Soares + + + Produces the container with the signature. + the data to sign + a container with the signature and other objects, like CRL and OCSP. The container will generally be a PKCS7 one. + + + + + Modifies the signature dictionary to suit the container. + + Modifies the signature dictionary to suit the container. At least the keys + + and + + will have to be set. + + the signature dictionary + + + Creates an ExternalBlankSignatureContainer. + PdfDictionary containing signature iformation. /SubFilter and /Filter aren't set in this constructor. + + + + Creates an ExternalBlankSignatureContainer. + + Creates an ExternalBlankSignatureContainer. This constructor will create the PdfDictionary for the + signature information and will insert the /Filter and /SubFilter values into this dictionary. + + PdfName of the signature handler to use when validating this signature + PdfName that describes the encoding of the signature + + + + + + Interface for the Online Certificate Status Protocol (OCSP) Client. + + + Gets an encoded byte array with OCSP validation. + Gets an encoded byte array with OCSP validation. The method should not throw an exception. + Certificate to check. + The parent certificate. + + The url to get the verification. It it's null it will be taken. + from the check cert or from other implementation specific source + + A byte array with the validation or null if the validation could not be obtained + + + + Get the time stamp estimated token size. + + Get the time stamp estimated token size. + Implementation must return value large enough to accommodate the + entire token returned by + + prior + to actual + + call. + + an estimate of the token size + + + + Returns the + + to digest the data imprint + + + The + + object. + + + + + Returns RFC 3161 timeStampToken. + + Returns RFC 3161 timeStampToken. + Method may return null indicating that timestamp should be skipped. + + byte[] - data imprint to be time-stamped + byte[] - encoded, TSA signed data of the timeStampToken + - TSA request failed + + + + Interface you can implement and pass to TSAClientBouncyCastle in case + you want to do something with the information returned + + + + + When a timestamp is created using TSAClientBouncyCastle, + this method is triggered passing an object that contains + info about the timestamp and the time stamping authority. + + a TimeStampTokenInfo object + + + Add verification according to PAdES-LTV (part 4). + Paulo Soares + + + The verification constructor. + + The verification constructor. This class should only be created with + PdfStamper.getLtvVerification() otherwise the information will not be + added to the Pdf. + + + The + + to apply the validation to. + + + + Add verification for a particular signature. + the signature to validate (it may be a timestamp) + the interface to get the OCSP + the interface to get the CRL + options as to how many certificates to include + the validation options to include + certificate inclusion options + true if a validation was generated, false otherwise + + + + + Get the issuing certificate for a child certificate. + the certificate for which we search the parent + an array with certificates that contains the parent + the parent certificate + + + Adds verification to the signature. + name of the signature + collection of ocsp responses + collection of crls + collection of certificates + boolean + + + + + + + + + + + + + + + Merges the validation with any validation already in the document or creates a new one. + + + + + + + + + + + + + Converts an array of bytes to a String of hexadecimal values + a byte array + the same bytes expressed as hexadecimal values + + + What type of verification to include. + + + Options for how many certificates to include. + + + + Certificate inclusion in the DSS and VRI dictionaries in the CERT and CERTS + keys. + + + + Verifies the signatures in an LTV document. + + + The Logger instance + + + Option to specify level of verification; signing certificate only or the entire chain. + + + Verify root. + + + A document object for the revision that is being verified. + + + The fields in the revision that is being verified. + + + The date the revision was signed, or null for the highest revision. + + + The signature that covers the revision. + + + The PdfPKCS7 object for the signature. + + + Indicates if we're working with the latest revision. + + + The document security store for the revision that is being verified + + + Creates a VerificationData object for a PdfReader + The document we want to verify. + + + + Sets an extra verifier. + the verifier to set + + + Sets the certificate option. + Either CertificateOption.SIGNING_CERTIFICATE (default) or CertificateOption.WHOLE_CHAIN + + + + Set the verifyRootCertificate to false if you can't verify the root certificate. + + + + Checks if the signature covers the whole document + and throws an exception if the document was altered + + a PdfPKCS7 object + + + + Verifies all the document-level timestamps and all the signatures in the document. + + + + + Verifies a document level timestamp. + + + + + + Checks the certificates in a certificate chain: + are they valid on a specific date, and + do they chain up correctly? + + the certificate chain + + + + Verifies certificates against a list of CRLs and OCSP responses. + the signing certificate + the issuer's certificate + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Switches to the previous revision. + + + + + Gets a list of X509CRL objects from a Document Security Store. + a list of CRLs + + + + + Gets OCSP responses from the Document Security Store. + a list of BasicOCSPResp objects + + + + + OcspClient implementation using BouncyCastle. + Paulo Soarees + + + The Logger instance. + + + + Create + OcspClient + + + will be used for response verification. + OCSPVerifier + . + + + + Gets OCSP response. + + Gets OCSP response. If + OCSPVerifier + was setted, the response will be checked. + + + + Gets an encoded byte array with OCSP validation. + Gets an encoded byte array with OCSP validation. The method should not throw an exception. + to certificate to check + the parent certificate + + to get the verification. It it's null it will be taken + from the check cert or from other implementation specific source + + a byte array with the validation or null if the validation could not be obtained + + + Generates an OCSP request using BouncyCastle. + certificate of the issues + serial number + an OCSP request + + + + + + + + + + + + + + Class that allows you to verify a certificate against + one or more OCSP responses. + + + + The Logger instance + + + The list of OCSP responses. + + + Creates an OCSPVerifier instance. + the next verifier in the chain + a list of OCSP responses + + + Verifies if a a valid OCSP response is found for the certificate. + + Verifies if a a valid OCSP response is found for the certificate. + If this method returns false, it doesn't mean the certificate isn't valid. + It means we couldn't verify it against any OCSP response that was available. + + the certificate that needs to be checked + its issuer + + a list of VerificationOK objects. + The list will be empty if the certificate couldn't be verified. + + + + + + + Verifies a certificate against a single OCSP response + the OCSP response + the certificate that needs to be checked + the certificate of CA + sign date + + + + , in case successful check, otherwise false. + + + + + + + Verifies if an OCSP response is genuine + If it doesn't verify against the issuer certificate and response's certificates, it may verify + using a trusted anchor or cert. + + the OCSP response + the issuer certificate + + + + + Verifies if the response is valid. + + Verifies if the response is valid. + If it doesn't verify against the issuer certificate and response's certificates, it may verify + using a trusted anchor or cert. + NOTE. Use + isValidResponse() + instead. + + the response object + the issuer certificate + true if the response can be trusted + + + Checks if an OCSP response is genuine + the OCSP response + the responder certificate + true if the OCSP response verifies against the responder certificate + + + + Gets an OCSP response online and returns it if the status is GOOD + (without further checking!). + + the signing certificate + the issuer certificate + an OCSP response + + + + This class does all the processing related to signing + and verifying a PKCS#7 signature. + + + + Holds value of property signName. + + + Holds value of property reason. + + + Holds value of property location. + + + Holds value of property signDate. + + + Assembles all the elements needed to create a signature, except for the data. + the private key + the certificate chain + the interface digest + the hash algorithm + the provider or null for the default provider + true if the sub-filter is adbe.pkcs7.sha1 + on error + on error + on error + + + Use this constructor if you want to verify a signature using the sub-filter adbe.x509.rsa_sha1. + the /Contents key + the /Cert key + the provider or null for the default provider + + + Use this constructor if you want to verify a signature. + the /Contents key + the filtersubtype + the provider or null for the default provider + + + Getter for property sigName. + Value of property sigName. + + + Setter for property sigName. + New value of property sigName. + + + Getter for property reason. + Value of property reason. + + + Setter for property reason. + New value of property reason. + + + Getter for property location. + Value of property location. + + + Setter for property location. + New value of property location. + + + Getter for property signDate. + Value of property signDate. + + + Setter for property signDate. + New value of property signDate. + + + Version of the PKCS#7 object + + + Version of the PKCS#7 "SignerInfo" object. + + + Get the version of the PKCS#7 object. + the version of the PKCS#7 object. + + + Get the version of the PKCS#7 "SignerInfo" object. + the version of the PKCS#7 "SignerInfo" object. + + + The ID of the digest algorithm, e.g. + The ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1". + + + The object that will create the digest + + + The digest algorithms + + + The digest attributes + + + Getter for the ID of the digest algorithm, e.g. + Getter for the ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1" + + + Returns the name of the digest algorithm, e.g. + Returns the name of the digest algorithm, e.g. "SHA256". + the digest algorithm name, e.g. "SHA256" + + + The encryption algorithm. + + + Getter for the digest encryption algorithm + + + Get the algorithm used to calculate the message digest, e.g. + Get the algorithm used to calculate the message digest, e.g. "SHA1withRSA". + the algorithm used to calculate the message digest + + + The signed digest if created outside this class + + + External RSA data + + + Sets the digest/signature to an external calculated value. + the digest. This is the actual signature + the extra data that goes into the data tag in PKCS#7 + + the encryption algorithm. It may must be null if the digest + is also null. If the digest is not null + then it may be "RSA" or "DSA" + + + + Class from the Java SDK that provides the functionality of a digital signature algorithm. + + + The signed digest as calculated by this class (or extracted from an existing PDF) + + + The RSA data + + + + + + + + + + + + + Update the digest with the specified bytes. + + Update the digest with the specified bytes. + This method is used both for signing and verifying + + the data buffer + the offset in the data buffer + the data length + on error + + + Gets the bytes for the PKCS#1 object. + a byte array + + + Gets the bytes for the PKCS7SignedData object. + the bytes for the PKCS7SignedData object + + + Gets the bytes for the PKCS7SignedData object. + + Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes + in the signerInfo can also be set. If either of the parameters is null, none will be used. + + the digest in the authenticatedAttributes + the bytes for the PKCS7SignedData object + + + Gets the bytes for the PKCS7SignedData object. + + Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes + in the signerInfo can also be set, OR a time-stamp-authority client + may be provided. + + the digest in the authenticatedAttributes + TSAClient - null or an optional time stamp authority client + byte[] the bytes for the PKCS7SignedData object + + + + Added by Aiken Sam, 2006-11-15, modifed by Martin Brunecky 07/12/2007 + to start with the timeStampToken (signedData 1.2.840.113549.1.7.2). + + + Added by Aiken Sam, 2006-11-15, modifed by Martin Brunecky 07/12/2007 + to start with the timeStampToken (signedData 1.2.840.113549.1.7.2). + Token is the TSA response without response status, which is usually + handled by the (vendor supplied) TSA request/response interface). + + byte[] - time stamp token, DER encoded signedData + ASN1EncodableVector + + + + + + This method provides that encoding and the parameters must be + exactly the same as in + + . + + the content digest + the byte array representation of the authenticatedAttributes ready to be signed + + + Signature attributes + + + Signature attributes (maybe not necessary, but we use it as fallback) + + + encrypted digest + + + Indicates if a signature has already been verified + + + The result of the verification + + + Verify the digest. + true if the signature checks out, false otherwise + on error + + + + + + + Checks if the timestamp refers to this document. + true if it checks false otherwise + on error + + + All the X.509 certificates in no particular order. + + + All the X.509 certificates used for the main signature. + + + The X.509 certificate that is used to sign the digest. + + + Get all the X.509 certificates associated with this PKCS#7 object in no particular order. + + Get all the X.509 certificates associated with this PKCS#7 object in no particular order. + Other certificates, from OCSP for example, will also be included. + + the X.509 certificates associated with this PKCS#7 object + + + Get the X.509 sign certificate chain associated with this PKCS#7 object. + + Get the X.509 sign certificate chain associated with this PKCS#7 object. + Only the certificates used for the main signature will be returned, with + the signing certificate first. + + the X.509 certificates associated with this PKCS#7 object + + + Get the X.509 certificate actually used to sign the digest. + the X.509 certificate actually used to sign the digest + + + + Helper method that creates the collection of certificates + used for the main signature based on the complete list + of certificates and the sign certificate. + + + + Get the X.509 certificate revocation lists associated with this PKCS#7 object + the X.509 certificate revocation lists associated with this PKCS#7 object + + + Helper method that tries to construct the CRLs. + + + BouncyCastle BasicOCSPResp + + + Gets the OCSP basic response if there is one. + the OCSP basic response or null + + + Checks if OCSP revocation refers to the document signing certificate. + true if it checks, false otherwise + + + Helper method that creates the BasicOCSPResp object. + + + + + True if there's a PAdES LTV time stamp. + + + True if it's a CAdES signature type. + + + BouncyCastle TimeStampToken. + + + Check if it's a PAdES-LTV time stamp. + true if it's a PAdES-LTV time stamp, false otherwise + + + Gets the timestamp token if there is one. + the timestamp token or null + + + Gets the timestamp date + a date + + + Returns the filter subtype. + + + Returns the encryption algorithm + the name of an encryption algorithm + + + Represents the signature dictionary. + Paulo Soares + + + Creates new PdfSignature. + + + Creates new PdfSignature. + PdfName of the signature handler to use when validating this signature + PdfName that describes the encoding of the signature + + + Sets the /ByteRange. + an array of pairs of integers that specifies the byte range used in the digest calculation. A pair consists of the starting byte offset and the length + + + + Sets the /Contents value to the specified byte[]. + a byte[] representing the digest + + + Sets the /Cert value of this signature. + the byte[] representing the certificate chain + + + Sets the /Name of the person signing the document. + name of the person signing the document + + + Sets the /M value. + Sets the /M value. Should only be used if the time of signing is not available in the signature. + time of signing + + + Sets the /Location value. + physical location of signing + + + Sets the /Reason value. + reason for signing + + + + Sets the signature creator name in the + + dictionary. + + name of the signature creator + + + Sets the /ContactInfo value. + information to contact the person who signed this document + + + + Gets the + + instance if it exists, if + not it adds a new one and returns this. + + + + + + + + A dictionary that stores the name of the application that signs the PDF. + + + Creates a new PdfSignatureAppDictionary + + + Creates a new PdfSignatureAppDictionary. + PdfDictionary containing initial values + + + + Sets the signature created property in the Prop_Build dictionary's App + dictionary. + + String name of the application creating the signature + + + Provides convenient methods to make a signature appearance. + + Provides convenient methods to make a signature appearance. Use it in conjunction with + + . + + + + Extra space at the top. + + + Margin for the content inside the signature rectangle. + + + The document to be signed. + + + The page where the signature will appear. + + + + The coordinates of the rectangle for a visible signature, + or a zero-width, zero-height rectangle for an invisible signature. + + + + Rectangle that represent the position and dimension of the signature in the page. + + + Zero level of the signature appearance. + + + Second level of the signature appearance. + + + Form containing all layers drawn on top of each other. + + + The rendering mode chosen for visible signatures. + + + The reason for signing. + + + The caption for the reason for signing. + + + Holds value of property location. + + + The caption for the location of signing. + + + Holds value of the application that creates the signature. + + + The contact name of the signer. + + + Holds value of property signDate. + + + The signing certificate. + + + The image that needs to be used for a visible signature. + + + A background image for the text in layer 2. + + + The scaling to be applied to the background image. + + + The text that goes in Layer 2 of the signature appearance. + + + Font for the text in Layer 2. + + + Font size for the font of Layer 2. + + + + Indicates the field to be signed if it is already presented in the document + (signing existing field). + + + Indicates the field to be signed if it is already presented in the document + (signing existing field). Required for + + option. + + + + Indicates if we need to reuse the existing appearance as layer 0. + + + Creates a PdfSignatureAppearance. + PdfDocument + Rectangle of the appearance + Number of the page the appearance should be on + + + + Provides the page number of the signature field which this signature + appearance is associated with. + + + The page number of the signature field which this signature + appearance is associated with. + + + + + Sets the page number of the signature field which this signature + appearance is associated with. + + + The page number of the signature field which + this signature appearance is associated with. + + + + + Provides the rectangle that represent the position and dimension + of the signature field in the page. + + + the rectangle that represent the position and dimension + of the signature field in the page + + + + + Sets the rectangle that represent the position and dimension of + the signature field in the page. + + + The rectangle that represents the position and + dimension of the signature field in the page. + + + + Get Layer 0 of the appearance. + layer 0 + + + Get Layer 2 of the appearance. + layer 2 + + + Gets the rendering mode for this signature. + the rendering mode for this signature + + + Sets the rendering mode for this signature. + the rendering mode + + + Returns the signing reason. + reason for signing + + + Sets the signing reason. + signing reason. + + + Sets the caption for the signing reason. + A new signing reason caption + + + Returns the signing location. + signing location + + + Sets the signing location. + A new signing location + + + Sets the caption for the signing location. + A new signing location caption + + + Returns the signature creator. + The signature creator + + + Sets the name of the application used to create the signature. + A new name of the application signing a document + + + Returns the signing contact. + The signing contact + + + Sets the signing contact. + A new signing contact + + + Sets the certificate used to provide the text in the appearance. + + Sets the certificate used to provide the text in the appearance. + This certificate doesn't take part in the actual signing process. + + the certificate + + + Get the signing certificate. + the signing certificate + + + Gets the Image object to render. + the image + + + Sets the Image object to render when Render is set to RenderingMode.GRAPHIC or RenderingMode.GRAPHIC_AND_DESCRIPTION. + + image rendered. If null the mode is defaulted to RenderingMode.DESCRIPTION + + + Indicates that the existing appearances needs to be reused as layer 0. + + + Gets the background image for the layer 2. + the background image for the layer 2 + + + Sets the background image for the layer 2. + the background image for the layer 2 + + + Gets the scaling to be applied to the background image. + the scaling to be applied to the background image + + + Sets the scaling to be applied to the background image. + + Sets the scaling to be applied to the background image. If it's zero the image + will fully fill the rectangle. If it's less than zero the image will fill the rectangle but + will keep the proportions. If it's greater than zero that scaling will be applied. + In any of the cases the image will always be centered. It's zero by default. + + the scaling to be applied to the background image + + + Sets the signature text identifying the signer. + + the signature text identifying the signer. If null or not set + a standard description will be used + + + + Gets the signature text identifying the signer if set by setLayer2Text(). + the signature text identifying the signer + + + Gets the n2 and n4 layer font. + the n2 and n4 layer font + + + Sets the n2 and n4 layer font. + Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used. + the n2 and n4 font + + + Sets the n2 and n4 layer font size. + font size + + + Gets the visibility status of the signature. + the visibility status of the signature + + + + Returns the signature date. + the signature date + + + Sets the signature date. + A new signature date + + + Set the field name of the appearance. + name of the field + + + Signature rendering modes. + + + Dictionary that stores signature build properties. + Kwinten Pisman + + + Creates new PdfSignatureBuildProperties. + + + Creates new PdfSignatureBuildProperties with preset values. + PdfDictionary containing preset values + + + + Sets the signatureCreator property in the underlying + + dictionary. + + + + + + Gets the + + from this dictionary. If it + does not exist, it adds a new + + and + returns this instance. + + + + + + + + Takes care of the cryptographic options and appearances that form a signature. + + + Approval signature. + + + Author signature, no changes allowed. + + + Author signature, form filling allowed. + + + Author signature, form filling and annotations allowed. + + + The certification level. + + + The name of the field. + + + The file right before the signature is added (can be null). + + + The bytes of the file right before the signature is added (if raf is null). + + + Array containing the byte positions of the bytes that need to be hashed. + + + The PdfDocument. + + + The crypto dictionary. + + + Holds value of property signatureEvent. + + + OutputStream for the bytes of the document. + + + Outputstream that temporarily holds the output in memory. + + + Tempfile to hold the output temporarily. + + + Name and content of keys that can only be added in the close() method. + + + Indicates if the pdf document has already been pre-closed. + + + Signature field lock dictionary. + + + The signature appearance. + + + Holds value of property signDate. + + + Boolean to check if this PdfSigner instance has been closed already or not. + + + Creates a PdfSigner instance. + + Creates a PdfSigner instance. Uses a + + instead of a temporary file. + + PdfReader that reads the PDF file + OutputStream to write the signed PDF file + boolean to indicate whether the signing should happen in append mode or not + + + + Creates a PdfSigner instance. + + Creates a PdfSigner instance. Uses a + + instead of a temporary file. + + PdfReader that reads the PDF file + OutputStream to write the signed PDF file + File to which the output is temporarily written + boolean to indicate whether the signing should happen in append mode or not + + + + Gets the signature date. + Calendar set to the signature date + + + Sets the signature date. + the signature date + + + Provides access to a signature appearance object. + + Provides access to a signature appearance object. Use it to + customize the appearance of the signature. +

    + Be aware: +

      +
    • If you create new signature field (either use + + with + the name that doesn't exist in the document or don't specify it at all) then + the signature is invisible by default.
    • +
    • If you sign already existing field, then the signature appearance object + is modified to have all the properties (page num., rect etc.) consistent with + the state of the field (if you customized the appearance object + before the + + call you'll have to do it again)
    • +
    +

    +
    + + + + object. + +
    + + Returns the document's certification level. + + Returns the document's certification level. + For possible values see + + . + + The certified status. + + + Sets the document's certification level. + + a new certification level for a document. + Possible values are:
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    + +
    + + Gets the field name. + the field name + + + Returns the user made signature dictionary. + + Returns the user made signature dictionary. This is the dictionary at the /V key + of the signature field. + + The user made signature dictionary. + + + Getter for property signatureEvent. + Value of property signatureEvent. + + + Sets the signature event to allow modification of the signature dictionary. + the signature event + + + Gets a new signature field name that doesn't clash with any existing name. + A new signature field name. + + + Sets the name indicating the field to be signed. + + Sets the name indicating the field to be signed. The field can already be presented in the + document but shall not be signed. If the field is not presented in the document, it will be created. + + The name indicating the field to be signed. + + + Gets the PdfDocument associated with this instance. + the PdfDocument associated with this instance + + + Sets the PdfDocument. + + + Setter for the OutputStream. + + + Getter for the field lock dictionary. + Field lock dictionary. + + + Setter for the field lock dictionary. + + Setter for the field lock dictionary. +

    Be aware: if a signature is created on an existing signature field, + then its /Lock dictionary takes the precedence (if it exists).

    +
    + Field lock dictionary +
    + + Signs the document using the detached mode, CMS or CAdES equivalent. + + Signs the document using the detached mode, CMS or CAdES equivalent. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the certificate chain + the CRL list + the OCSP client + the Timestamp client + an implementation that provides the digest + the reserved size for the signature. It will be estimated if 0 + Either Signature.CMS or Signature.CADES + + +
    + + Signs the document using the detached mode, CMS or CAdES equivalent. + + Signs the document using the detached mode, CMS or CAdES equivalent. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the certificate chain + the CRL list + the OCSP client + the Timestamp client + an implementation that provides the digest + the reserved size for the signature. It will be estimated if 0 + Either Signature.CMS or Signature.CADES + the signature policy (for EPES signatures) + + +
    + + Signs the document using the detached mode, CMS or CAdES equivalent. + + Signs the document using the detached mode, CMS or CAdES equivalent. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the certificate chain + the CRL list + the OCSP client + the Timestamp client + an implementation that provides the digest + the reserved size for the signature. It will be estimated if 0 + Either Signature.CMS or Signature.CADES + the signature policy (for EPES signatures) + + +
    + + Sign the document using an external container, usually a PKCS7. + + Sign the document using an external container, usually a PKCS7. The signature is fully composed + externally, iText will just put the container inside the document. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the interface providing the actual signing + the reserved size for the signature + + +
    + + Signs a document with a PAdES-LTV Timestamp. + + Signs a document with a PAdES-LTV Timestamp. The document is closed at the end. +

    + NOTE: This method closes the underlying pdf document. This means, that current instance + of PdfSigner cannot be used after this method call. +
    + the timestamp generator + + the signature name or null to have a name generated + automatically + + + +
    + + Signs a PDF where space was already reserved. + the original PDF + the field to sign. It must be the last field + the output PDF + + the signature container doing the actual signing. Only the + method ExternalSignatureContainer.sign is used + + + + + + Processes a CRL list. + a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it. + + a list of CrlClient implementations + a collection of CRL bytes that can be embedded in a PDF + + + Checks if the document is in the process of closing. + true if the document is in the process of closing, false otherwise + + + + Gets the document bytes that are hashable when using external signatures. + + Gets the document bytes that are hashable when using external signatures. + The general sequence is: + + , + + and + + . + + + The + + of bytes to be signed. + + + + + + Returns the underlying source. + The underlying source + + + + Adds keys to the signature dictionary that define the certification level and the permissions. + + Adds keys to the signature dictionary that define the certification level and the permissions. + This method is only used for Certifying signatures. + + the signature dictionary + + + Adds keys to the signature dictionary that define the field permissions. + + Adds keys to the signature dictionary that define the field permissions. + This method is only used for signatures that lock fields. + + the signature dictionary + + + Get the rectangle associated to the provided widget. + PdfWidgetAnnotation to extract the rectangle from + Rectangle + + + Get the page number associated to the provided widget. + PdfWidgetAnnotation from which to extract the page number + page number + + + Enum containing the Cryptographic Standards. + Enum containing the Cryptographic Standards. Possible values are "CMS" and "CADES". + + + An interface to retrieve the signature dictionary for modification. + + + Allows modification of the signature dictionary. + The signature dictionary + + + + Implementation of the + + interface that + can be used when you have a + + object. + + Paulo Soares + + + The private key object. + + + The hash algorithm. + + + The encryption algorithm (obtained from the private key) + + + + Creates a + + instance. + + + A + + object. + + A hash algorithm (e.g. "SHA-1", "SHA-256",...). + A security provider (e.g. "BC"). + + + + + + + + + + + + + A list of IDs that are used by the security classes + + + + A helper class that tells you more about the type of signature + (certification or approval) and the signature's DMP settings. + + + + Is the signature a cerification signature (true) or an approval signature (false)? + + + Is form filling allowed by this signature? + + + Is adding annotations allowed by this signature? + + + Does this signature lock specific fields? + + + + Creates an object that can inform you about the type of signature + in a signature dictionary as well as some of the permissions + defined by the signature. + + + + Getter to find out if the signature is a certification signature. + true if the signature is a certification signature, false for an approval signature. + + + Getter to find out if filling out fields is allowed after signing. + true if filling out fields is allowed + + + Getter to find out if adding annotations is allowed after signing. + true if adding annotations is allowed + + + Getter for the field lock actions, and fields that are impacted by the action + an Array with field names + + + + Class that contains a field lock action and + an array of the fields that are involved. + + + + Can be /All, /Exclude or /Include + + + An array of PdfString values with fieldnames + + + Creates a FieldLock instance + + + Getter for the field lock action. + + + Getter for the fields involved in the lock action. + + + toString method + + + + Class that encapsulates the signature policy information + Sample: + SignaturePolicyInfo spi = new SignaturePolicyInfo("2.16.724.1.3.1.1.2.1.9", + "G7roucf600+f03r/o0bAOQ6WAs0=", "SHA-1", "https://sede.060.gob.es/politica_de_firma_anexo_1.pdf"); + + + + + Constructs a new + + instance + + the id of the signature policy + the hash of the signature policy + the digestion algorithm of the signature policy + the uri of the full policy description + + + + Constructs a new + + instance + + the id of the signature policy + the Base64 presentation of the hash of the signature policy + the digestion algorithm of the signature policy + the uri of the full policy description + + + Utility class that provides several convenience methods concerning digital signatures. + + + Creates a SignatureUtil instance. + + Creates a SignatureUtil instance. Sets the acroForm field to the acroForm in the PdfDocument. + iText will create a new AcroForm if the PdfDocument doesn't contain one. + + PdfDocument to be inspected + + + Verifies a signature. + + Verifies a signature. Further verification can be done on the returned + + object. + + the signature field name + the provider or null for the default provider + PdfPKCS7 object to continue the verification + + + Gets the signature dictionary, the one keyed by /V. + the field name + + the signature dictionary keyed by /V or null if the field is not + a signature + + + + Gets the field names that have signatures and are signed. + List containing the field names that have signatures and are signed + + + Gets the field names that have blank signatures. + List containing the field names that have blank signatures + + + Extracts a revision from the document. + the signature field name + an InputStream covering the revision. Returns null if it's not a signature field + + + + Checks if the signature covers the entire document or just part of it. + the signature field name + true if the signature covers the entire document, false if it doesn't + + + Checks whether a name exists as a signature field or not. + Checks whether a name exists as a signature field or not. It checks both signed fields and blank signatures. + + name of the field + boolean does the signature field exist + + + + Converts a + + to an array of longs + + PdfArray to be converted + long[] containing the PdfArray values + + + + + + + + Time Stamp Authority Client interface implementation using Bouncy Castle + org.bouncycastle.tsp package. + + + Time Stamp Authority Client interface implementation using Bouncy Castle + org.bouncycastle.tsp package. +

    + Created by Aiken Sam, 2006-11-15, refactored by Martin Brunecky, 07/15/2007 + for ease of subclassing. +

    +
    +
    + + The default value for the hash algorithm + + + The default value for the hash algorithm + + + The Logger instance. + + + URL of the Time Stamp Authority + + + TSA Username + + + TSA password + + + An interface that allows you to inspect the timestamp info. + + + Estimate of the received time stamp token + + + Hash algorithm + + + Creates an instance of a TSAClient that will use BouncyCastle. + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + + + Creates an instance of a TSAClient that will use BouncyCastle. + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + String - user(account) name + String - password + + + Constructor. + + Constructor. + Note the token size estimate is updated by each call, as the token + size is not likely to change (as long as we call the same TSA using + the same imprint length). + + String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") + String - user(account) name + String - password + int - estimated size of received time stamp token (DER encoded) + + + the tsaInfo to set + + + Get the token size estimate. + + Get the token size estimate. + Returned value reflects the result of the last succesfull call, padded + + an estimate of the token size + + + Gets the MessageDigest to digest the data imprint + the digest algorithm name + + + + Get RFC 3161 timeStampToken. + + Get RFC 3161 timeStampToken. + Method may return null indicating that timestamp should be skipped. + + data imprint to be time-stamped + encoded, TSA signed data of the timeStampToken + + + + + Get timestamp token - communications layer + - byte[] - TSA response, raw bytes (RFC 3161 encoded) + + + + An exception that is thrown when something is wrong with a certificate. + + + Creates a VerificationException + + + + Class that informs you that the verification of a Certificate + succeeded using a specific CertificateVerifier and for a specific + reason. + + + + The certificate that was verified successfully. + + + The CertificateVerifier that was used for verifying. + + + The reason why the certificate verified successfully. + + + Creates a VerificationOK object + the certificate that was successfully verified + the class that was used for verification + the reason why the certificate could be verified + + + Return a single String explaining which certificate was verified, how and why. + + +
    +
    diff --git a/upgradescripts/3.80-the next version/upgrade.sql b/upgradescripts/3.80-the next version/upgrade.sql index e38dbf357ec..33b04cc831a 100644 --- a/upgradescripts/3.80-the next version/upgrade.sql +++ b/upgradescripts/3.80-the next version/upgrade.sql @@ -1,5043 +1,5927 @@ ---upgrade scripts from nopCommerce 3.80 to next version - ---new locale resources -declare @resources xml ---a resource will be deleted if its value is empty -set @resources=' - - - You haven''t written any reviews yet - - - Force entering email twice during registration. - - - Sets a maximum number of products per vendor. - - - Shipping methods used by offline shipping rate computation methods (e.g. "Fixed Rate Shipping" or "Shipping by weight"). - - - The price of the product. You can manage currency by selecting Configuration > Currencies. - - - Choose customer roles of this user. - - - Check if products should be exported/imported with product attributes. - - - Check to display "ship to the same address" option during checkout ("billing address" step). In this case "shipping address" with appropriate options (e.g. pick up in store) will be skipped. Also note that all billing countries should support shipping ("Allow shipping" checkbox ticked). - - - Task period should not exceed 24 days. - - - Payment restrictions - - - Choose a vendor associated with this product. This can be useful when running a multi-vendor store to keep track of goods associated with vendor. - - - You can download a CSV file with a list of states for other countries on the following page: - - - Enter tags ... - - - [None] - - - Hide shipping total if shipping not required - - - Check if you want Hide ''Shipping total'' label if shipping not required. - - - - - - - - - - - - - - - - - - - - - Client ID - - - Specify client ID. - - - Client secret - - - Specify secret key. - - - Webhook ID - - - Specify webhook ID. - - - Get webhook ID - - - Webhook was not created (see details in the log) - - - [None] - - - Default tax category - - - Select default tax category for products. - - - Added a new address attribute (ID = {0}) - - - Added a new address attribute value (ID = {0}) - - - Added a new affiliate (ID = {0}) - - - Added a new blog post (ID = {0}) - - - Added a new campaign (ID = {0}) - - - Added a new country (ID = {0}) - - - Added a new currency (ID = {0}) - - - Added a new customer attribute (ID = {0}) - - - Added a new customer attribute value (ID = {0}) - - - Added a new email account (ID = {0}) - - - Added a new language (ID = {0}) - - - Added a new measure dimension (ID = {0}) - - - Added a new measure weight (ID = {0}) - - - Added a new news (ID = {0}) - - - Installed a new plugin (FriendlyName: ''{0}'') - - - Added a new state province (ID = {0}) - - - Added a new store (ID = {0}) - - - Added a new vendor (ID = {0}) - - - Added a new warehouse (ID = {0}) - - - Deleted an address attribute (ID = {0}) - - - Deleted an address attribute value (ID = {0}) - - - Deleted an affiliate (ID = {0}) - - - Deleted a blog post (ID = {0}) - - - Deleted a blog post comment (ID = {0}) - - - Deleted a campaign (ID = {0}) - - - Deleted a country (ID = {0}) - - - Deleted a currency (ID = {0}) - - - Deleted a customer attribute (ID = {0}) - - - Deleted a customer attribute value (ID = {0}) - - - Deleted an email account (ID = {0}) - - - Deleted a language (ID = {0}) - - - Deleted a measure dimension (ID = {0}) - - - Deleted a measure weight (ID = {0}) - - - Deleted a message template (ID = {0}) - - - Deleted a news (ID = {0}) - - - Deleted a news comment (ID = {0}) - - - Uninstalled a plugin (FriendlyName: ''{0}'') - - - Deleted a product revie (ID = {0}) - - - Deleted a state or province (ID = {0}) - - - Deleted a store (ID = {0}) - - - Deleted a vendor (ID = {0}) - - - Deleted a warehouse (ID = {0}) - - - Edited an address attribute (ID = {0}) - - - Edited an address attribute value (ID = {0}) - - - Edited an affiliate (ID = {0}) - - - Edited a blog post (ID = {0}) - - - Edited a campaign (ID = {0}) - - - Edited a country (ID = {0}) - - - Edited a currency (ID = {0}) - - - Edited a customer attribute (ID = {0}) - - - Edited a customer attribute value (ID = {0}) - - - Edited an email account (ID = {0}) - - - Edited a language (ID = {0}) - - - Edited a measure dimension (ID = {0}) - - - Edited a measure weight (ID = {0}) - - - Edited a message template (ID = {0}) - - - Edited a news (ID = {0}) - - - Edited a plugin (FriendlyName: ''{0}'') - - - Edited a product revie (ID = {0}) - - - Edited a state or province (ID = {0}) - - - Edited a store (ID = {0}) - - - Edited a task (ID = {0}) - - - Edited a vendor (ID = {0}) - - - Edited a warehouse (ID = {0}) - - - Product review possible only after purchasing product - - - Check if product can be reviewed only by customer who have already ordered it. - - - Product can be reviewed only after purchasing it - - - - - - You can use ECB (European central bank) exchange rate provider only when the primary exchange rate currency is supported by ECB - - - Attached static file - - - The attached static file that will be sent in this email. - - - Contract ID - - - Specify contract identifier. - - - Product review possible only after product purchasing - - - Page size should be positive. - - - Page size should be positive. - - - Page size should be positive. - - - Enter tags ... - - - - - - - - - Show SKU on catalog pages - - - Check to show product SKU on catalog pages in public store. - - - Show SKU on product details page - - - Check to show product SKU on the product details page in public store. - - - - - - - - - Customer enters quantity - - - Allow customers enter the quantity of associated product. - - - - quantity {0} - - - {0} [{1}{2}] - - - per item - - - Enter quantity: - - - Email account - - - The email account that will be used to send this campaign. - - - Limited to customer roles - - - Choose one or several customer roles i.e. administrators, vendors, guests, who will be able to use this plugin. If you don''t need this option just leave this field empty. - - - Activate points immediately - - - Activates bonus points immediately after their calculation - - - Reward points activation - - - Specify how many days (hours) must elapse before earned points become active. Points earned by purchase cannot be redeemed until activated. For example, you may set the days before the points become available to 7. In this case, the points earned will be available for spending 7 days after the order gets chosen awarded status. - - - The points will be activated on {0} - - - Days - - - Hours - - - The points will be activated on {0} - - - At least one published currency is required - - - The customer cannot be in both ''Guests'' and ''Registered'' customer roles - - - Add the customer to ''Guests'' or ''Registered'' customer role - - - Valid Email is required for customer to be in ''Registered'' role - - - A non-admin user cannot impersonate as an administrator - - - At least one published language is required - - - This order item has an associated gift card record. Please delete it first - - - Order item is deleted - - - Captcha is enabled but the appropriate keys are not entered - - - The message template has been copied successfully - - - The product has been copied successfully - - - Entered page name already exists, so it will be replaced by ''{0}'' - - - Choose a delivery date which will be displayed in the public store. You can manage delivery dates by selecting Configuration > Shipping > Dates and ranges. - - - Product availability range - - - Choose the product availability range that indicates when the product is expected to be available when out of stock (e.g. Available in 10-14 days). You can manage availability ranges by selecting Configuration > Shipping > Dates and ranges. - - - None - - - Product availability range - - - Dates and ranges - - - List of delivery dates which will be available for choice in product details. - - - Product availability ranges - - - The new product availability range has been added successfully. - - - Add a new product availability range - - - back to product availability range list - - - The product availability range has been deleted successfully. - - - Edit product availability range details - - - Display order - - - The display order of this product availability range. 1 represents the top of the list. - - - Name - - - Enter product availability range name. - - - Please provide a name. - - - List of availability ranges which will be available for choice in product details. - - - The product availability range has been updated successfully. - - - Available in {0} - - - Out of stock - on backorder and will be dispatched once in stock ({0}). - - - Available in {0} - - - Pay by cheque or money order - - - Pay by credit / debit card - - - Pay by credit / debit card - - - You will be redirected to PayPal site to complete the payment - - - Pay by purchase order (PO) number - - - Your account already has been activated - - - Your password already has been changed. For changing it once more, you need to again recover the password. - - - Your subscription already has been deactivated. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - By Weight - - - Fixed Rate - - - Rate - - - Store - - - If an asterisk is selected, then this shipping rate will apply to all stores. - - - Warehouse - - - If an asterisk is selected, then this shipping rate will apply to all warehouses. - - - Country - - - If an asterisk is selected, then this shipping rate will apply to all customers, regardless of the country. - - - State / province - - - If an asterisk is selected, then this shipping rate will apply to all customers from the given country, regardless of the state. - - - Zip - - - Zip / postal code. If zip is empty, then this shipping rate will apply to all customers from the given country or state, regardless of the zip code. - - - Shipping method - - - Choose shipping method - - - Order weight from - - - Order weight from. - - - Order weight to - - - Order weight to. - - - Additional fixed cost - - - Specify an additional fixed cost per shopping cart for this option. Set to 0 if you don''t want an additional fixed cost to be applied. - - - Lower weight limit - - - Lower weight limit. This field can be used for \"per extra weight unit\" scenarios. - - - Charge percentage (of subtotal) - - - Charge percentage (of subtotal). - - - Rate per weight unit - - - Rate per weight unit. - - - Limit shipping methods to configured ones - - - If you check this option, then your customers will be limited to shipping options configured here. Otherwise, they''ll be able to choose any existing shipping options even they''ve not configured here (zero shipping fee in this case). - - - Data - - - Add record - - - Formula to calculate rates - - - [additional fixed cost] + ([order total weight] - [lower weight limit]) * [rate per weight unit] + [order subtotal] * [charge percentage] - - - Allow vendors to import products - - - Check if vendors are allowed to import products. - - - You save: {0} - - - Discounted qty: {0} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Add new tier price - - - Edit tier price details - - - Select customer role for which the tier price will be available. - - - End date - - - The end date of the tier price in Coordinated Universal Time (UTC). - - - Specify the price. - - - Specify quantity for which this tier price will be available. - - - Start date - - - The start date of the tier price in Coordinated Universal Time (UTC). - - - Option to limit this tier price to a certain store. If you have multiple stores, choose one from the list. - - - Deactivate gift cards after deleting of an order - - - Check to deactivate related gift cards when an order is deleted. - - - Complete order when delivered - - - Check if an order status should be set to "Complete" only when its shipping status is "Delivered". Otherwise, "Shipped" status will be enough. - - - order #{1}
    ]]> - - - Edited a news comment (ID = {0}) - - - News comments must be approved - - - Check if news comments must be approved by administrator. - - - Is approved - - - News comment is successfully added. You will see it after approving by a store administrator. - - - Edited a blog comment (ID = {0}) - - - Blog comments must be approved - - - Check if blog comments must be approved by administrator. - - - Is approved - - - Blog comment is successfully added. You will see it after approving by a store administrator. - - - Stock quantity history - - - Here you can see a history of the product stock quantity changes. - - - Attribute combination - - - Created On - - - Message - - - Stock quantity - - - Quantity adjustment - - - Warehouse - - - Stock quantity history - - - The stock quantity has been increased by canceling the order #{0} - - - The stock quantity of combination has been edited - - - The stock quantity has been edited by copying the product #{0} - - - The stock quantity has been increased by deleting the order #{0} - - - The stock quantity has been increased by deleting an order item from the order #{0} - - - The stock quantity has been increased by deleting a shipment from the order #{0} - - - The stock quantity has been edited - - - Multiple warehouses. - - - The stock quantity has been changed by editing the order #{0} - - - The stock quantity has been changed by importing product - - - Products have been moved {0} {1} by importing product - - - Products have been moved {0} {1} - - - to the {0} - - - from the {0} - - - The stock quantity has been reduced by placing the order #{0} - - - The stock quantity has been reduced when an order item of the order #{0} was shipped - - - {0} - copy - - - {0}-copy - - - - - - - - - - - - - - - - - - - - - Deactivate gift cards after cancelling of an order - - - Check to deactivate related gift cards when an order is cancelled. - - - Activate gift cards after completing of an order - - - Check to activate related gift cards when an order is completed. - - - - - - - - - - - - - - - - - - - - - - - - - - - Do not forget to restart the application once a task has been modified. - - - - - - - or - - - - Choose an associated product - - - Store - - - Load products only from a specific store (available in this store). - - - Vendor - - - Load products only by a specific vendor (owned by this vendor). - - - Category - - - Load products only from a specific category. - - - Manufacturer - - - Load products only from a specific manufacturer. - - - Carts shared between storest - - - Determines whether shopping carts (and wishlist) are shared between stores (in multi-store environment). - - - Email validation - - - Your email already has been validated - - - Your email has been validated - - - Email validation - - - Email validation - - - New email - - - (not validated yet) - - - Shipping methods used by offline shipping providers. For example, "Manual (Fixed or By Weight)". - - - Ignored product type IDs (advanced) - - - Allow file uploads - - - Check if you want to allow customers to upload files when submitting return requests. - - - Upload (any additional document, scan, etc) - - - Uploaded file: - - - Download - - - Uploaded file - - - File uploaded by customer - - - Download - - - Reply text - - - The reply text (by a store owner). If specified, then it''ll be visible to a customer. Leave empty to ignore this functionality. - - - A manager responded to this review - - - Blog comments per store - - - Check to display blog comments written in the current store only. - - - News comments per store - - - Check to display news comments written in the current store only. - - - Store name - - - Store name - - - The associated product has attributes, keep in mind that customers can not select them in the product details page. - - - The associated product has required product attributes, so customers won''t be able to choose this product attribute value. - - - The associated product is downloadable, keep in mind that won''t be able to download it. - - - The associated product is a gift card, keep in mind that customers can not specify its details in the product details page. - - - All - - - {0} - {1} of {2} items - - - No items to display - - - Go to the first page - - - items per page - - - Go to the last page - - - More pages - - - Go to the next page - - - of {0} - - - Page - - - Go to the previous page - - - Refresh - - - Address (optional) - - - Maximum login failures - - - Maximum login failures to lockout account. Set 0 to disable this feature. - - - Lockout time (login failures) - - - Enter number of minutes to lockout users (for login failures). - - - Customer is locked out - - - Imported manufacturers are distinguished by ID. If the ID already exists, then its corresponding manufacturer will be updated. You should not specify ID (leave 0) for new manufacturers. - - - Imported categories are distinguished by ID. If the ID already exists, then its corresponding category will be updated. You should not specify ID (leave 0) for new categories. - - - For conditional expressions use the token %if (your conditions ) ... endif% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fixed rate - - - By Country - - - Tax category - - - Rate - - - Store - - - If an asterisk is selected, then this shipping rate will apply to all stores. - - - Country - - - The country. - - - State / province - - - If an asterisk is selected, then this tax rate will apply to all customers from the given country, regardless of the state. - - - Zip - - - Zip / postal code. If zip is empty, then this tax rate will apply to all customers from the given country or state, regardless of the zip code. - - - Tax category - - - The tax category. - - - Percentage - - - The tax rate. - - - Add tax rate - - - New tax rate - - - ID - - - Search by a specific return request identifier. - - - End date - - - The end date for the search. - - - Return status - - - All - - - Search by a specific return request status e.g. Received. - - - Start date - - - The start date for the search. - - - - Product attributes are quantifiable or descriptive aspects of a product (such as, color). For example, if you were to create an attribute for color, with the values of blue, green, yellow, and so on, you may want to apply this attribute to shirts, which you sell in various colors (you can adjust a price or weight for any of existing attribute values). - You can add attribute for your product using existing list of attributes, or if you need to create a new one go to Catalog > Attributes > Product attributes. Please notice that if you want to manage inventory by product attributes (e.g. 5 green shirts and 3 blue ones), then ensure that "Inventory method" is set to "Track inventory by product attributes". - - - - Approve selected - - - Approve selected - - - Disapprove selected - - - Disapprove selected - - - Registered in the store - - - Indicating in which store the customer is registered - - - Consider associated products dimensions and weight - - - Check to consider associated products dimensions and weight on shipping, uncheck for example if the main product already includes them. - - - Created from - - - The creation from date for the search. - - - Created to - - - The creation to date for the search. - - - Message - - - Search in title and comment text. - - - Created from - - - The creation from date for the search. - - - Created to - - - The creation to date for the search. - - - Message - - - Search in comment text. - - - Retry last payment - - - Last payment failed - - - Approved - - - Search by a "Approved" property. - - - All - - - Approved only - - - Disapproved only - - - Approved - - - Search by a "Approved" property. - - - All - - - Approved only - - - Disapproved only - - - Approved - - - Search by a "Approved" property. - - - All - - - Approved only - - - Disapproved only - - - It looks like you have "ShoppingCartSettings.RoundPricesDuringCalculation" setting disabled. Keep in mind that this can lead to a discrepancy of the order total amount, as PayPal only rounds to two decimals. - - - - - - - - - - - - - - - - - - - - - Order ID - - - Order # - - - Order # - - - Order ID - - - Order # - - - Order ID - - - Order # - - - Order # - - - The unique number of this order. - - - Created order ID - - - Created order - - - Order ID - - - Order # - - - Order ID - - - Order # - - - The order associated to this shipment. - - - Order number mask - - - Order number mask, for creating custom order number. For example, RE-{YYYY}-{MM}. Leave this field empty if you don''t want to use custom order numbers. - - - {DD} - day of order creation date - - - {ID} -Order identifier - - - {MM} - month of order creation date - - - {YYYY} - year of order creation date - - - {YY} - last two digits of year of order creation date - - - - - - - - - Order - - - The gift card was purchased with this order. - - - Order - - - The gift card was purchased with this order. - - - Edited an order (Order number = {0}). See order notes for details - - - View order (Order number - {0}) - - - The unique number of the order. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pass purchased items - - - Check to pass information about purchased items to PayPal. - - - Unduplicated passwords number - - - Specify the number of customer passwords that mustn''t be the same as the previous one, enter 0 if the customer can use the same password time after time. - - - You entered the password that is the same as one of the last passwords you used. Please create a new password. - - - Your password has expired, please create a new one - - - Password lifetime - - - Specify number of days for password expiration. Don''t forget to check "EnablePasswordLifetime" property on customer role edit page for those roles, who will have to change passwords. - - - Enable password lifetime - - - Check to force customers to change their passwords after a specified time. - - - ID - - - ID - - - - - - - - - This order is cancelled - - - Notify about new blog comments in Configuration - Settings - Blog settings.]]> - - - Allow back in stock subscriptions in Product info tab - Inventory section.]]> - - - This message template is used when a customer changes an email address in his account. The customer receives a message to confirm an email address used when changing email address. - - - This message template is used the option Email notification from Registration method dropdown list in Configuration - Settings - Customer settings is selected. The customer receives a message to confirm an email address used when registering. - - - This message template is used when the customer gets a notification about a new order being placed from this account. - - - Show alert for PM in Configuration - Settings - Forum settings.]]> - - - This message template is used when a customer forgets a password needed to log in the account. The customer receives a message with a link for entering a new password. - - - This message template is used to welcome a new customer after registration. - - - This message template is used when a new forum post in certain forum topic is created. The message is received by a store owner. - - - This message template is used when a new forum topic is created. The message is received by a store owner. - - - This message template is used to send a notification to a customer about getting a gift card. - - - Notify about new customer registration in Configuration - Settings - Customer settings.]]> - - - This message template is used to notify a customer about a new return request submitted from his/her account. - - - This message template is used when a new return request is created. The message is received by a store owner. - - - Notify about new news comments in Configuration - Settings - News settings.]]> - - - This message template is used when a customer subscribes to the newsletter to confirm the subscription. - - - Newsletter box. Allow to unsubscribe in Configuration - Settings - Customer settings.]]> - - - Notify admin when a new VAT number is submitted in Configuration - Settings - Tax settings.]]> - - - This message template is used to notify a customer that the certain order was canceled. The order can ba canceled by a customer on the account page or by store owner in Customers - Customers in Orders tab or in Sales - Orders. - - - This message template is used to notify a customer that the certain order was completed. The order gets the order status Complete when it''s paid and delivered, or it can be changed manually to Complete in Sales - Orders. - - - This message template is used to notify a customer that the certain order was paid. The order gets the payment status Paid when the amount was charged, or it can be changed manually Sales - Orders by clicking Mark as paid button in Payment status. - - - This message template is used to notify a store owner that the certain order was paid. The order gets the status Paid when the amount was charged, or it can be changed manually Sales - Orders by clicking Mark as paid button in Payment status. - - - This message template is used to notify a vendor that the certain order was paid. The order gets the status Paid when the amount was charged. - - - This message template is used to notify a customer that the certain order was placed. Orders can be viewed by a customer on the account page. - - - This message template is used to notify a store owner that the certain order was placed. Orders can be viewed by a store owner in Sales - Orders or in Customers menu. - - - This message template is used to notify a vendor that the certain order was placed. Orders can be viewed by a vendor in Sales - Orders. You can allow them to access this part of Admin Area in Configuration - Access control list. - - - This message template is used to notify a customer that the certain order was refunded. The customer can submit to refund the order when the payment status is paid on the account page, or it can be done by a store owner in Sales - Orders by clicking "Refund" button. - - - This message template is used to notify a store owner that the certain order was refunded. The customer can submit to refund the order when the payment status is paid on the account page, or it can be done by a store owner in Sales - Orders by clicking "Refund" button. - - - Notify about new product reviews in Configuration - Settings - Catalog settings.]]> - - - This message template is used to notify a store owner that the certain product attribute combination is getting low stock. You can set up the combination minimum quantity when creating or editing the product in Product attribute tab - Attributes combinations tab in Notify admin for quantity below field. - - - Minimum stock qty field.]]> - - - This message template is used to notify a customer that the certain recurring payment is canceled. Payment can be canceled by a customer in the account page or by a store owner in Sales - Recurring payments in History tab by clicking "Cancel recurring payment" button. - - - This message template is used to notify a store owner that the certain recurring payment is canceled. Payment can be canceled by a customer in the account page or by a store owner in Sales - Recurring payments in History tab by clicking "Cancel recurring payment" button. - - - This message template is used to notify a customer that the certain recurring payment is failed. For example, the amount can''t be charged from the provided credit card. - - - This message template is used to notify a customer that the request status to the certain order is changed. You can set up this option in Sales - Return requests by clicking "Notify customer about status change" button. - - - This message template is used to notify a store owner about a message sent through the contact form. - - - This message template is used to notify a vendor about a message sent through the contact form. - - - This message template is used to send "email a friend" message. - - - Display shipment events (customers).]]> - - - Display shipment events (customers).]]> - - - Allow customers to apply for vendor account.]]> - - - Allow vendors to edit info.]]> - - - This message template is used when a customer wants to share some product from the wishlist with a friend by sending an email. You can set up this option by ticking the checkbox Allow customers to email their wishlists in Configuration - Settings - Shopping cart settings. - - - Tax based on pickup point address - - - A value indicating whether to use pickup point address (when pickup point is chosen) for tax calculation. - - - It seems that you use Redis server for caching, keep in mind that enabling this setting create a lot of traffic between the Redis server and the application because of the large number of locales. - - - Export orders with products - - - Check if orders should be exported with products. - - - Requirement group is a useful feature for creating discount requirement templates. You can create a requirement group just once and then use it every time you want this limitation to be applied. You can include one requirement group into another one if needed.]]> - - - Add requirement group - - - You can choose one of the following requirement types, or add a requirement group to use several requirement types simultaneously. - - - Group name - - - Specify name of the requirement group (e.g. "Permitted customer roles"). - - - Add to group - - - Choose the group you want the requirement group you’re creating to be assigned to - - - Group - - - AND - - - OR - - - - - - Requirement - - - Default requirement group - - - Interaction type in this group is - - - The group is empty - - - Remove requirement - - - Remove group - - - Blog comments - - - Common - - - Additional sections - - - Catalog pages - - - Compare products - - - Export/Import - - - Performance - - - Product fields - - - Product page - - - Product sorting - - - Product reviews - - - Search - - - Share - - - Tax - - - Tags - - - Account - - - Common - - - Default fields - - - External authentication - - - Password and security - - - Profile - - - Time zone - - - Common - - - Feeds - - - Page sizes - - - Permissions - - - Full-Text - - - CAPTCHA - - - Common - - - Localization - - - Pdf - - - Security - - - SEO - - - Sitemap - - - Social media - - - Common - - - Other pages - - - Product - - - News comments - - - Common - - - Checkout - - - Common - - - Gift cards - - - Order totals - - - Pdf invoice - - - Common - - - Checkout - - - Common - - - Notifications - - - Common - - - Mini shopping cart - - - Wishlist - - - Common - - - Payment - - - Shipping - - - Tax dispaying - - - VAT - - - Catalog - - - Common - - - In order to use this functionality you have to disable the following setting: Configuration > Catalog settings > Ignore discounts (sitewide). - - -
    • At least two unique product identifiers are required. So each of your product shouldhave manufacturer (brand) and MPN (manufacturer part number) specified
    • Specify default tax values in your Google Merchant Center account settings
    • Specify default shipping values in your Google Merchant Center account settings
    • In order to get more info about required fields look at the following article http://www.google.com/support/merchants/bin/answer.py?answer=188494

    ]]>
    -
    - - You can download the list of allowed Google product category attributes here

    ]]>
    -
    - - If you''re using this gateway ensure that your primary store currency is supported by Paypal.

    To configure plugin follow these steps:
    1. Log into your Developer PayPal account (click here to create your account).
    2. Click on My Apps & Credentials from the Dashboard.
    3. Create new REST API app.
    4. Copy your Client ID and Secret key below.
    5. To be able to use recurring payments you need to set the webhook ID. You can get it manually in your PayPal account (enter the URL https://www.yourStore.com/Plugins/PaymentPayPalDirect/Webhook below REST API application credentials), or automatically by pressing "@T("Plugins.Payments.PayPalDirect.WebhookCreate")" button (not visible when running the site locally).

    ]]>
    -
    - - If you''re using this gateway ensure that your primary store currency is supported by Paypal.

    To use PDT, you must activate PDT and Auto Return in your PayPal account profile. You must also acquire a PDT identity token, which is used in all PDT communication you send to PayPal. Follow these steps to configure your account for PDT:

    1. Log in to your PayPal account (click here to create your account).
    2. Click the Profile subtab.
    3. Click Website Payment Preferences in the Seller Preferences column.
    4. Under Auto Return for Website Payments, click the On radio button.
    5. For the Return URL, enter the URL on your site that will receive the transaction ID posted by PayPal after a customer payment (http://www.yourStore.com/Plugins/PaymentPayPalStandard/PDTHandler).
    6. Under Payment Data Transfer, click the On radio button.
    7. Click Save.
    8. Click Website Payment Preferences in the Seller Preferences column.
    9. Scroll down to the Payment Data Transfer section of the page to view your PDT identity token.

    Two ways to be able to receive IPN messages (optional):

    The first way is to check ''Enable IPN'' below. It will include in the request the url of you IPN handler

    The second way is to confugure your paypal account to activate this service; follow these steps:
    1. Log in to your Premier or Business account.
    2. Click the Profile subtab.
    3. Click Instant Payment Notification in the Selling Preferences column.
    4. Click the ''Edit IPN Settings'' button to update your settings.
    5. Select ''Receive IPN messages'' (Enabled) and enter the URL of your IPN handler (http://www.yourStore.com/Plugins/PaymentPayPalStandard/IPNHandler).
    6. Click Save, and you should get a message that you have successfully activated IPN.

    ]]>
    -
    - - To configure plugin follow one of these steps:
    1. If you are a Canada Post commercial customer, fill Customer number, Contract ID and API key below.
    2. If you are a Solutions for Small Business customer, specify your Customer number and API key below.
    3. If you are a non-contracted customer or you want to use the regular price of shipping paid by customers, fill the API key field only.

    Note: Canada Post gateway returns shipping price in the CAD currency, ensure that you have correctly configured exchange rate from PrimaryStoreCurrency to CAD.

    ]]>
    -
    - - Google Analytics is a free website stats tool from Google. It keeps track of statisticsabout the visitors and ecommerce conversion on your website.

    Follow the next steps to enable Google Analytics integration:
    • Create a Google Analyticsaccount and follow the wizard to add your website
    • Copy the Tracking ID into the ''ID'' box below
    • Click the ''Save'' button below and Google Analytics will be integrated into your store

    If you would like to switch between Google Analytics (used by default) and Universal Analytics, then please use the buttons below:

    ]]>
    -
    - - Please note that {ECOMMERCE} line works only when you have "Disable order completed page" order setting unticked.

    ]]>
    -
    - - Here you can find third-party extensions and themes which are developed by our community and partners.They are also available in our marketplace

    ]]>
    -
    - - A CAPTCHA is a program that can tell whether its user is a human or a computer.You''ve probably seen them — colorful images with distorted text at the bottom ofWeb registration forms. CAPTCHAs are used by many websites to prevent abuse from"bots," or automated programs usually written to generate spam. No computer programcan read distorted text as well as humans can, so bots cannot navigate sites protectedby CAPTCHAs. nopCommerce uses reCAPTCHA.

    ]]>
    -
    - - You can download more nopCommerce plugins in our marketplace

    ]]>
    -
    - - Edit values - - - Edit condition - - - Edit rules - - - {0} categories were imported - - - {0} manufacturers were imported - - - {0} products were imported - - - {0} states and provinces were imported - - - Add to wishlist - - - Update - - - - - - Store - - - Search by a specific store. - - - Rounding type - - - The rounding type. - - - Default rounding - - - Rounding up with 0.05 intervals (0.06 round to 0.10) - - - Rounding down with 0.05 intervals (0.06 round to 0.05) - - - Rounding up with 0.10 intervals (1.05 round to 1.10) - - - Rounding down with 0.10 intervals (1.05 round to 1.00) - - - Rounding with 0.50 intervals - - - Rounding with 1.00 intervals (1.01-1.49 round to 1.00, 1.50-1.99 round to 2.00) - - - Rounding up with 1.00 intervals (1.01–1.99 round to 2.00) - - - Picture zoom - - - Check to enable picture zoom on product details page. - - - Display "Blog" - - - Check if "Blog" menu item should be displayed in the top menu. - - - Display "Forums" - - - Check if "Forums" menu item should be displayed in the top menu. - - - Display "Contact us" - - - Check if "Contact us" menu item should be displayed in the top menu. - - - Display "My account" - - - Check if "My account" menu item should be displayed in the top menu. - - - Display "Home page" - - - Check if "Home page" menu item should be displayed in the top menu. - - - Display "New products" - - - Check if "New products" menu item should be displayed in the top menu. - - - Display "Search" - - - Check if "Search" menu item should be displayed in the top menu. - - - Top menu items - - -' - -CREATE TABLE #LocaleStringResourceTmp - ( - [ResourceName] [nvarchar](200) NOT NULL, - [ResourceValue] [nvarchar](max) NOT NULL - ) - -INSERT INTO #LocaleStringResourceTmp (ResourceName, ResourceValue) -SELECT nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') -FROM @resources.nodes('//Language/LocaleResource') AS R(nref) - ---do it for each existing language -DECLARE @ExistingLanguageId int -DECLARE cur_existinglanguage CURSOR FOR -SELECT [Id] -FROM [Language] -OPEN cur_existinglanguage -FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageId -WHILE @@FETCH_STATUS = 0 -BEGIN - DECLARE @ResourceName nvarchar(200) - DECLARE @ResourceValue nvarchar(MAX) - DECLARE cur_localeresource CURSOR FOR - SELECT ResourceName, ResourceValue - FROM #LocaleStringResourceTmp - OPEN cur_localeresource - FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue - WHILE @@FETCH_STATUS = 0 - BEGIN - IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName)) - BEGIN - UPDATE [LocaleStringResource] - SET [ResourceValue]=@ResourceValue - WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName - END - ELSE - BEGIN - INSERT INTO [LocaleStringResource] - ( - [LanguageId], - [ResourceName], - [ResourceValue] - ) - VALUES - ( - @ExistingLanguageId, - @ResourceName, - @ResourceValue - ) - END - - IF (@ResourceValue is null or @ResourceValue = '') - BEGIN - DELETE [LocaleStringResource] - WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName - END - - FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue - END - CLOSE cur_localeresource - DEALLOCATE cur_localeresource - - --fetch next language identifier - FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageId -END -CLOSE cur_existinglanguage -DEALLOCATE cur_existinglanguage - -DROP TABLE #LocaleStringResourceTmp -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shippingsettings.hideshippingtotal') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'shippingsettings.hideshippingtotal', N'False', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'taxsettings.defaulttaxcategoryid') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'taxsettings.defaulttaxcategoryid', N'0', 0) -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAddressAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewAddressAttribute', N'Add a new address attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAffiliate') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewAffiliate', N'Add a new affiliate', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewBlogPost') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewBlogPost', N'Add a new blog post', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCampaign') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewCampaign', N'Add a new campaign', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCountry') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewCountry', N'Add a new country', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCurrency') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewCurrency', N'Add a new currency', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCustomerAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewCustomerAttribute', N'Add a new customer attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCustomerAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewCustomerAttributeValue', N'Add a new customer attribute value', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewEmailAccount') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewEmailAccount', N'Add a new email account', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewLanguage') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewLanguage', N'Add a new language', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewMeasureDimension') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewMeasureDimension', N'Add a new measure dimension', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewMeasureWeight') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewMeasureWeight', N'Add a new measure weight', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewNews') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewNews', N'Add a new news', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'InstallNewPlugin') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'InstallNewPlugin', N'Install a new plugin', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewStateProvince') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewStateProvince', N'Add a new state or province', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewStore') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewStore', N'Add a new store', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewVendor') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewVendor', N'Add a new vendor', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewWarehouse') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewWarehouse', N'Add a new warehouse', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAddressAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteAddressAttribute', N'Delete an address attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAffiliate') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteAffiliate', N'Delete an affiliate', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteBlogPost') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteBlogPost', N'Delete a blog post', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCampaign') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteCampaign', N'Delete a campaign', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCountry') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteCountry', N'Delete a country', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCurrency') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteCurrency', N'Delete a currency', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCustomerAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteCustomerAttribute', N'Delete a customer attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCustomerAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteCustomerAttributeValue', N'Delete a customer attribute value', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteEmailAccount') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteEmailAccount', N'Delete an email account', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteLanguage') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteLanguage', N'Delete a language', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMeasureDimension') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteMeasureDimension', N'Delete a measure dimension', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMeasureWeight') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteMeasureWeight', N'Delete a measure weight', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMessageTemplate') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteMessageTemplate', N'Delete a message template', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteNews') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteNews', N'Delete a news', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'UninstallPlugin') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'UninstallPlugin', N'Uninstall a plugin', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteProductReview') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteProductReview', N'Delete a product review', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteStateProvince') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteStateProvince', N'Delete a state or province', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteStore') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteStore', N'Delete a store', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteVendor') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteVendor', N'Delete a vendor', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteWarehouse') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteWarehouse', N'Delete a warehouse', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAddressAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditAddressAttribute', N'Edit an address attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAffiliate') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditAffiliate', N'Edit an affiliate', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditBlogPost') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditBlogPost', N'Edit a blog post', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCampaign') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditCampaign', N'Edit a campaign', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCountry') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditCountry', N'Edit a country', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCurrency') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditCurrency', N'Edit a currency', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCustomerAttribute') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditCustomerAttribute', N'Edit a customer attribute', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCustomerAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditCustomerAttributeValue', N'Edit a customer attribute value', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditEmailAccount') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditEmailAccount', N'Edit an email account', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditLanguage') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditLanguage', N'Edit a language', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMeasureDimension') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditMeasureDimension', N'Edit a measure dimension', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMeasureWeight') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditMeasureWeight', N'Edit a measure weight', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMessageTemplate') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditMessageTemplate', N'Edit a message template', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditNews') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditNews', N'Edit a news', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditPlugin') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditPlugin', N'Edit a plugin', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditProductReview') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditProductReview', N'Edit a product review', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditStateProvince') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditStateProvince', N'Edit a state or province', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditStore') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditStore', N'Edit a store', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditTask') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditTask', N'Edit a task', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditVendor') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditVendor', N'Edit a vendor', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditWarehouse') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditWarehouse', N'Edit a warehouse', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteBlogPostComment') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteBlogPostComment', N'Delete a blog post comment', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteNewsComment') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteNewsComment', N'Delete a news comment', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAddressAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'AddNewAddressAttributeValue', N'Add a new address attribute value', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAddressAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditAddressAttributeValue', N'Edit an address attribute value', N'true') -END -GO - ---new activity types -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAddressAttributeValue') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'DeleteAddressAttributeValue', N'Delete an address attribute value', N'true') -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.productreviewpossibleonlyafterpurchasing') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'catalogsettings.productreviewpossibleonlyafterpurchasing', N'False', 0) -END -GO - - --new setting - IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.exportimportusedropdownlistsforassociatedentities') - BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'catalogsettings.exportimportusedropdownlistsforassociatedentities', N'True', 0) - END - GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.showskuoncatalogpages') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'catalogsettings.showskuoncatalogpages', N'False', 0) -END -GO - ---rename settings -UPDATE [Setting] -SET [Name] = N'catalogsettings.showskuonproductdetailspage' -WHERE [Name] = N'catalogsettings.showproductsku' -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductAttributeValue]') and NAME='CustomerEntersQty') -BEGIN - ALTER TABLE [ProductAttributeValue] - ADD [CustomerEntersQty] bit NULL -END -GO - -UPDATE [ProductAttributeValue] -SET [CustomerEntersQty] = 0 -WHERE [CustomerEntersQty] IS NULL -GO - -ALTER TABLE [ProductAttributeValue] ALTER COLUMN [CustomerEntersQty] bit NOT NULL -GO - ---new or update setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shoppingcartsettings.renderassociatedattributevaluequantity') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'shoppingcartsettings.renderassociatedattributevaluequantity', N'True', 0); -END -ELSE -BEGIN - UPDATE [Setting] - SET [Value] = N'True' - WHERE [Name] = N'shoppingcartsettings.renderassociatedattributevaluequantity' -END -GO - ---update column -ALTER TABLE [RewardPointsHistory] ALTER COLUMN [PointsBalance] int NULL -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'rewardpointssettings.activationdelay') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'rewardpointssettings.activationdelay', N'0', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'rewardpointssettings.activationdelayperiodid') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'rewardpointssettings.activationdelayperiodid', N'0', 0) -END -GO - - ---new discount coupon code logic -DELETE FROM [GenericAttribute] -WHERE [KeyGroup] = 'Customer' and [Key] = 'DiscountCouponCode' -GO - ---new table -IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[ProductAvailabilityRange]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) -BEGIN - CREATE TABLE [dbo].[ProductAvailabilityRange]( - [Id] [int] IDENTITY(1,1) NOT NULL, - [Name] nvarchar(400) NOT NULL, - [DisplayOrder] int NOT NULL, - PRIMARY KEY CLUSTERED - ( - [Id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ) -END -GO - ---add a new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='ProductAvailabilityRangeId') -BEGIN - ALTER TABLE [Product] - ADD [ProductAvailabilityRangeId] int NULL -END -GO - -UPDATE [Product] -SET [ProductAvailabilityRangeId] = 0 -WHERE [ProductAvailabilityRangeId] IS NULL -GO - -ALTER TABLE [Product] ALTER COLUMN [ProductAvailabilityRangeId] int NOT NULL -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.showpaymentmethoddescriptions') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'paymentsettings.showpaymentmethoddescriptions', N'True', 0) -END -GO - - ---ensure that dbo is added to existing stored procedures -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[FullText_IsSupported]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [FullText_IsSupported] -GO -CREATE PROCEDURE [dbo].[FullText_IsSupported] -AS -BEGIN - EXEC(' - SELECT CASE SERVERPROPERTY(''IsFullTextInstalled'') - WHEN 1 THEN - CASE DatabaseProperty (DB_NAME(DB_ID()), ''IsFulltextEnabled'') - WHEN 1 THEN 1 - ELSE 0 - END - ELSE 0 - END') -END -GO - - -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[FullText_Enable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [FullText_Enable] -GO -CREATE PROCEDURE [dbo].[FullText_Enable] -AS -BEGIN - --create catalog - EXEC(' - IF NOT EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'') - CREATE FULLTEXT CATALOG [nopCommerceFullTextCatalog] AS DEFAULT') - - --create indexes - DECLARE @create_index_text nvarchar(4000) - SET @create_index_text = ' - IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]'')) - CREATE FULLTEXT INDEX ON [Product]([Name], [ShortDescription], [FullDescription]) - KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('Product') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' - EXEC(@create_index_text) - - SET @create_index_text = ' - IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]'')) - CREATE FULLTEXT INDEX ON [LocalizedProperty]([LocaleValue]) - KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('LocalizedProperty') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' - EXEC(@create_index_text) - - SET @create_index_text = ' - IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]'')) - CREATE FULLTEXT INDEX ON [ProductTag]([Name]) - KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('ProductTag') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' - EXEC(@create_index_text) -END -GO - - - -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[FullText_Disable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [FullText_Disable] -GO -CREATE PROCEDURE [dbo].[FullText_Disable] -AS -BEGIN - EXEC(' - --drop indexes - IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]'')) - DROP FULLTEXT INDEX ON [Product] - ') - - EXEC(' - IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]'')) - DROP FULLTEXT INDEX ON [LocalizedProperty] - ') - - EXEC(' - IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]'')) - DROP FULLTEXT INDEX ON [ProductTag] - ') - - --drop catalog - EXEC(' - IF EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'') - DROP FULLTEXT CATALOG [nopCommerceFullTextCatalog] - ') -END -GO - - - - -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[LanguagePackImport]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [LanguagePackImport] -GO -CREATE PROCEDURE [dbo].[LanguagePackImport] -( - @LanguageId int, - @XmlPackage xml -) -AS -BEGIN - IF EXISTS(SELECT * FROM [Language] WHERE [Id] = @LanguageId) - BEGIN - CREATE TABLE #LocaleStringResourceTmp - ( - [LanguageId] [int] NOT NULL, - [ResourceName] [nvarchar](200) NOT NULL, - [ResourceValue] [nvarchar](MAX) NOT NULL - ) - - INSERT INTO #LocaleStringResourceTmp (LanguageID, ResourceName, ResourceValue) - SELECT @LanguageId, nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') - FROM @XmlPackage.nodes('//Language/LocaleResource') AS R(nref) - - DECLARE @ResourceName nvarchar(200) - DECLARE @ResourceValue nvarchar(MAX) - DECLARE cur_localeresource CURSOR FOR - SELECT LanguageID, ResourceName, ResourceValue - FROM #LocaleStringResourceTmp - OPEN cur_localeresource - FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue - WHILE @@FETCH_STATUS = 0 - BEGIN - IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageID=@LanguageId AND ResourceName=@ResourceName)) - BEGIN - UPDATE [LocaleStringResource] - SET [ResourceValue]=@ResourceValue - WHERE LanguageID=@LanguageId AND ResourceName=@ResourceName - END - ELSE - BEGIN - INSERT INTO [LocaleStringResource] - ( - [LanguageId], - [ResourceName], - [ResourceValue] - ) - VALUES - ( - @LanguageId, - @ResourceName, - @ResourceValue - ) - END - - - FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue - END - CLOSE cur_localeresource - DEALLOCATE cur_localeresource - - DROP TABLE #LocaleStringResourceTmp - END -END - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'fixedorbyweightsettings.shippingbyweightenabled') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'fixedorbyweightsettings.shippingbyweightenabled', N'False', 0) -END -GO - ---rename settings -UPDATE [Setting] -SET [Name] = N'fixedorbyweightsettings.limitmethodstocreated' -WHERE [Name] = N'shippingbyweightsettings.limitmethodstocreated' -GO - ---rename settings -UPDATE [Setting] -SET [Name] = N'shippingratecomputationmethod.fixedorbyweight.rate.shippingmethodid' + SUBSTRING(name, 62, len(name)) -WHERE [Name] like N'shippingratecomputationmethod.fixedrate.rate.shippingmethodid%' -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'vendorsettings.allowvendorstoimportproducts') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'vendorsettings.allowvendorstoimportproducts', N'True', 0) -END -GO - ---add a new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='StartDateTimeUtc') -BEGIN - ALTER TABLE [TierPrice] - ADD [StartDateTimeUtc] datetime NULL -END -GO - ---add a new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='EndDateTimeUtc') -BEGIN - ALTER TABLE [TierPrice] - ADD [EndDateTimeUtc] datetime NULL -END -GO - ---add a tier prices instead of product special prices -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPrice') -BEGIN - EXEC(' - INSERT INTO [dbo].[TierPrice]([ProductId], [StoreId], [CustomerRoleId], [Quantity], [Price], [StartDateTimeUtc], [EndDateTimeUtc]) - SELECT [Id], 0, NULL, 1, [SpecialPrice], [SpecialPriceStartDateTimeUtc], [SpecialPriceEndDateTimeUtc] - FROM [dbo].[Product] - WHERE [SpecialPrice] <> 0') -END -GO - -UPDATE [Product] -SET [HasTierPrices] = 1 -WHERE [Id] IN (SELECT [ProductId] FROM [dbo].[TierPrice]) -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPrice') -BEGIN - ALTER TABLE [Product] DROP COLUMN [SpecialPrice] -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPriceStartDateTimeUtc') -BEGIN - ALTER TABLE [Product] DROP COLUMN [SpecialPriceStartDateTimeUtc] -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPriceEndDateTimeUtc') -BEGIN - ALTER TABLE [Product] DROP COLUMN [SpecialPriceEndDateTimeUtc] -END -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'producteditordettings.specialprice' -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'producteditordettings.specialpricestartdate' -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'producteditordettings.specialpriceenddate' -GO - - --a stored procedure update -IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[ProductLoadAllPaged]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [ProductLoadAllPaged] -GO - -CREATE PROCEDURE [dbo].[ProductLoadAllPaged] -( - @CategoryIds nvarchar(MAX) = null, --a list of category IDs (comma-separated list). e.g. 1,2,3 - @ManufacturerId int = 0, - @StoreId int = 0, - @VendorId int = 0, - @WarehouseId int = 0, - @ProductTypeId int = null, --product type identifier, null - load all products - @VisibleIndividuallyOnly bit = 0, --0 - load all products , 1 - "visible indivially" only - @MarkedAsNewOnly bit = 0, --0 - load all products , 1 - "marked as new" only - @ProductTagId int = 0, - @FeaturedProducts bit = null, --0 featured only , 1 not featured only, null - load all products - @PriceMin decimal(18, 4) = null, - @PriceMax decimal(18, 4) = null, - @Keywords nvarchar(4000) = null, - @SearchDescriptions bit = 0, --a value indicating whether to search by a specified "keyword" in product descriptions - @SearchManufacturerPartNumber bit = 0, -- a value indicating whether to search by a specified "keyword" in manufacturer part number - @SearchSku bit = 0, --a value indicating whether to search by a specified "keyword" in product SKU - @SearchProductTags bit = 0, --a value indicating whether to search by a specified "keyword" in product tags - @UseFullTextSearch bit = 0, - @FullTextMode int = 0, --0 - using CONTAINS with , 5 - using CONTAINS and OR with , 10 - using CONTAINS and AND with - @FilteredSpecs nvarchar(MAX) = null, --filter by specification attribute options (comma-separated list of IDs). e.g. 14,15,16 - @LanguageId int = 0, - @OrderBy int = 0, --0 - position, 5 - Name: A to Z, 6 - Name: Z to A, 10 - Price: Low to High, 11 - Price: High to Low, 15 - creation date - @AllowedCustomerRoleIds nvarchar(MAX) = null, --a list of customer role IDs (comma-separated list) for which a product should be shown (if a subjet to ACL) - @PageIndex int = 0, - @PageSize int = 2147483644, - @ShowHidden bit = 0, - @OverridePublished bit = null, --null - process "Published" property according to "showHidden" parameter, true - load only "Published" products, false - load only "Unpublished" products - @LoadFilterableSpecificationAttributeOptionIds bit = 0, --a value indicating whether we should load the specification attribute option identifiers applied to loaded products (all pages) - @FilterableSpecificationAttributeOptionIds nvarchar(MAX) = null OUTPUT, --the specification attribute option identifiers applied to loaded products (all pages). returned as a comma separated list of identifiers - @TotalRecords int = null OUTPUT -) -AS -BEGIN - - /* Products that filtered by keywords */ - CREATE TABLE #KeywordProducts - ( - [ProductId] int NOT NULL - ) - - DECLARE - @SearchKeywords bit, - @OriginalKeywords nvarchar(4000), - @sql nvarchar(max), - @sql_orderby nvarchar(max) - - SET NOCOUNT ON - - --filter by keywords - SET @Keywords = isnull(@Keywords, '') - SET @Keywords = rtrim(ltrim(@Keywords)) - SET @OriginalKeywords = @Keywords - IF ISNULL(@Keywords, '') != '' - BEGIN - SET @SearchKeywords = 1 - - IF @UseFullTextSearch = 1 - BEGIN - --remove wrong chars (' ") - SET @Keywords = REPLACE(@Keywords, '''', '') - SET @Keywords = REPLACE(@Keywords, '"', '') - - --full-text search - IF @FullTextMode = 0 - BEGIN - --0 - using CONTAINS with - SET @Keywords = ' "' + @Keywords + '*" ' - END - ELSE - BEGIN - --5 - using CONTAINS and OR with - --10 - using CONTAINS and AND with - - --clean multiple spaces - WHILE CHARINDEX(' ', @Keywords) > 0 - SET @Keywords = REPLACE(@Keywords, ' ', ' ') - - DECLARE @concat_term nvarchar(100) - IF @FullTextMode = 5 --5 - using CONTAINS and OR with - BEGIN - SET @concat_term = 'OR' - END - IF @FullTextMode = 10 --10 - using CONTAINS and AND with - BEGIN - SET @concat_term = 'AND' - END - - --now let's build search string - declare @fulltext_keywords nvarchar(4000) - set @fulltext_keywords = N'' - declare @index int - - set @index = CHARINDEX(' ', @Keywords, 0) - - -- if index = 0, then only one field was passed - IF(@index = 0) - set @fulltext_keywords = ' "' + @Keywords + '*" ' - ELSE - BEGIN - DECLARE @first BIT - SET @first = 1 - WHILE @index > 0 - BEGIN - IF (@first = 0) - SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' ' - ELSE - SET @first = 0 - - SET @fulltext_keywords = @fulltext_keywords + '"' + SUBSTRING(@Keywords, 1, @index - 1) + '*"' - SET @Keywords = SUBSTRING(@Keywords, @index + 1, LEN(@Keywords) - @index) - SET @index = CHARINDEX(' ', @Keywords, 0) - end - - -- add the last field - IF LEN(@fulltext_keywords) > 0 - SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' ' + '"' + SUBSTRING(@Keywords, 1, LEN(@Keywords)) + '*"' - END - SET @Keywords = @fulltext_keywords - END - END - ELSE - BEGIN - --usual search by PATINDEX - SET @Keywords = '%' + @Keywords + '%' - END - --PRINT @Keywords - - --product name - SET @sql = ' - INSERT INTO #KeywordProducts ([ProductId]) - SELECT p.Id - FROM Product p with (NOLOCK) - WHERE ' - IF @UseFullTextSearch = 1 - SET @sql = @sql + 'CONTAINS(p.[Name], @Keywords) ' - ELSE - SET @sql = @sql + 'PATINDEX(@Keywords, p.[Name]) > 0 ' - - - --localized product name - SET @sql = @sql + ' - UNION - SELECT lp.EntityId - FROM LocalizedProperty lp with (NOLOCK) - WHERE - lp.LocaleKeyGroup = N''Product'' - AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' - AND lp.LocaleKey = N''Name''' - IF @UseFullTextSearch = 1 - SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' - ELSE - SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' - - - IF @SearchDescriptions = 1 - BEGIN - --product short description - SET @sql = @sql + ' - UNION - SELECT p.Id - FROM Product p with (NOLOCK) - WHERE ' - IF @UseFullTextSearch = 1 - SET @sql = @sql + 'CONTAINS(p.[ShortDescription], @Keywords) ' - ELSE - SET @sql = @sql + 'PATINDEX(@Keywords, p.[ShortDescription]) > 0 ' - - - --product full description - SET @sql = @sql + ' - UNION - SELECT p.Id - FROM Product p with (NOLOCK) - WHERE ' - IF @UseFullTextSearch = 1 - SET @sql = @sql + 'CONTAINS(p.[FullDescription], @Keywords) ' - ELSE - SET @sql = @sql + 'PATINDEX(@Keywords, p.[FullDescription]) > 0 ' - - - - --localized product short description - SET @sql = @sql + ' - UNION - SELECT lp.EntityId - FROM LocalizedProperty lp with (NOLOCK) - WHERE - lp.LocaleKeyGroup = N''Product'' - AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' - AND lp.LocaleKey = N''ShortDescription''' - IF @UseFullTextSearch = 1 - SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' - ELSE - SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' - - - --localized product full description - SET @sql = @sql + ' - UNION - SELECT lp.EntityId - FROM LocalizedProperty lp with (NOLOCK) - WHERE - lp.LocaleKeyGroup = N''Product'' - AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' - AND lp.LocaleKey = N''FullDescription''' - IF @UseFullTextSearch = 1 - SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' - ELSE - SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' - END - - --manufacturer part number (exact match) - IF @SearchManufacturerPartNumber = 1 - BEGIN - SET @sql = @sql + ' - UNION - SELECT p.Id - FROM Product p with (NOLOCK) - WHERE p.[ManufacturerPartNumber] = @OriginalKeywords ' - END - - --SKU (exact match) - IF @SearchSku = 1 - BEGIN - SET @sql = @sql + ' - UNION - SELECT p.Id - FROM Product p with (NOLOCK) - WHERE p.[Sku] = @OriginalKeywords ' - END - - IF @SearchProductTags = 1 - BEGIN - --product tags (exact match) - SET @sql = @sql + ' - UNION - SELECT pptm.Product_Id - FROM Product_ProductTag_Mapping pptm with(NOLOCK) INNER JOIN ProductTag pt with(NOLOCK) ON pt.Id = pptm.ProductTag_Id - WHERE pt.[Name] = @OriginalKeywords ' - - --localized product tags - SET @sql = @sql + ' - UNION - SELECT pptm.Product_Id - FROM LocalizedProperty lp with (NOLOCK) INNER JOIN Product_ProductTag_Mapping pptm with(NOLOCK) ON lp.EntityId = pptm.ProductTag_Id - WHERE - lp.LocaleKeyGroup = N''ProductTag'' - AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' - AND lp.LocaleKey = N''Name'' - AND lp.[LocaleValue] = @OriginalKeywords ' - END - - --PRINT (@sql) - EXEC sp_executesql @sql, N'@Keywords nvarchar(4000), @OriginalKeywords nvarchar(4000)', @Keywords, @OriginalKeywords - - END - ELSE - BEGIN - SET @SearchKeywords = 0 - END - - --filter by category IDs - SET @CategoryIds = isnull(@CategoryIds, '') - CREATE TABLE #FilteredCategoryIds - ( - CategoryId int not null - ) - INSERT INTO #FilteredCategoryIds (CategoryId) - SELECT CAST(data as int) FROM [nop_splitstring_to_table](@CategoryIds, ',') - DECLARE @CategoryIdsCount int - SET @CategoryIdsCount = (SELECT COUNT(1) FROM #FilteredCategoryIds) - - --filter by customer role IDs (access control list) - SET @AllowedCustomerRoleIds = isnull(@AllowedCustomerRoleIds, '') - CREATE TABLE #FilteredCustomerRoleIds - ( - CustomerRoleId int not null - ) - INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId) - SELECT CAST(data as int) FROM [nop_splitstring_to_table](@AllowedCustomerRoleIds, ',') - DECLARE @FilteredCustomerRoleIdsCount int - SET @FilteredCustomerRoleIdsCount = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds) - - --paging - DECLARE @PageLowerBound int - DECLARE @PageUpperBound int - DECLARE @RowsToReturn int - SET @RowsToReturn = @PageSize * (@PageIndex + 1) - SET @PageLowerBound = @PageSize * @PageIndex - SET @PageUpperBound = @PageLowerBound + @PageSize + 1 - - CREATE TABLE #DisplayOrderTmp - ( - [Id] int IDENTITY (1, 1) NOT NULL, - [ProductId] int NOT NULL - ) - - SET @sql = ' - SELECT p.Id - FROM - Product p with (NOLOCK)' - - IF @CategoryIdsCount > 0 - BEGIN - SET @sql = @sql + ' - LEFT JOIN Product_Category_Mapping pcm with (NOLOCK) - ON p.Id = pcm.ProductId' - END - - IF @ManufacturerId > 0 - BEGIN - SET @sql = @sql + ' - LEFT JOIN Product_Manufacturer_Mapping pmm with (NOLOCK) - ON p.Id = pmm.ProductId' - END - - IF ISNULL(@ProductTagId, 0) != 0 - BEGIN - SET @sql = @sql + ' - LEFT JOIN Product_ProductTag_Mapping pptm with (NOLOCK) - ON p.Id = pptm.Product_Id' - END - - --searching by keywords - IF @SearchKeywords = 1 - BEGIN - SET @sql = @sql + ' - JOIN #KeywordProducts kp - ON p.Id = kp.ProductId' - END - - SET @sql = @sql + ' - WHERE - p.Deleted = 0' - - --filter by category - IF @CategoryIdsCount > 0 - BEGIN - SET @sql = @sql + ' - AND pcm.CategoryId IN (SELECT CategoryId FROM #FilteredCategoryIds)' - - IF @FeaturedProducts IS NOT NULL - BEGIN - SET @sql = @sql + ' - AND pcm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max)) - END - END - - --filter by manufacturer - IF @ManufacturerId > 0 - BEGIN - SET @sql = @sql + ' - AND pmm.ManufacturerId = ' + CAST(@ManufacturerId AS nvarchar(max)) - - IF @FeaturedProducts IS NOT NULL - BEGIN - SET @sql = @sql + ' - AND pmm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max)) - END - END - - --filter by vendor - IF @VendorId > 0 - BEGIN - SET @sql = @sql + ' - AND p.VendorId = ' + CAST(@VendorId AS nvarchar(max)) - END - - --filter by warehouse - IF @WarehouseId > 0 - BEGIN - --we should also ensure that 'ManageInventoryMethodId' is set to 'ManageStock' (1) - --but we skip it in order to prevent hard-coded values (e.g. 1) and for better performance - SET @sql = @sql + ' - AND - ( - (p.UseMultipleWarehouses = 0 AND - p.WarehouseId = ' + CAST(@WarehouseId AS nvarchar(max)) + ') - OR - (p.UseMultipleWarehouses > 0 AND - EXISTS (SELECT 1 FROM ProductWarehouseInventory [pwi] - WHERE [pwi].WarehouseId = ' + CAST(@WarehouseId AS nvarchar(max)) + ' AND [pwi].ProductId = p.Id)) - )' - END - - --filter by product type - IF @ProductTypeId is not null - BEGIN - SET @sql = @sql + ' - AND p.ProductTypeId = ' + CAST(@ProductTypeId AS nvarchar(max)) - END - - --filter by "visible individually" - IF @VisibleIndividuallyOnly = 1 - BEGIN - SET @sql = @sql + ' - AND p.VisibleIndividually = 1' - END - - --filter by "marked as new" - IF @MarkedAsNewOnly = 1 - BEGIN - SET @sql = @sql + ' - AND p.MarkAsNew = 1 - AND (getutcdate() BETWEEN ISNULL(p.MarkAsNewStartDateTimeUtc, ''1/1/1900'') and ISNULL(p.MarkAsNewEndDateTimeUtc, ''1/1/2999''))' - END - - --filter by product tag - IF ISNULL(@ProductTagId, 0) != 0 - BEGIN - SET @sql = @sql + ' - AND pptm.ProductTag_Id = ' + CAST(@ProductTagId AS nvarchar(max)) - END - - --"Published" property - IF (@OverridePublished is null) - BEGIN - --process according to "showHidden" - IF @ShowHidden = 0 - BEGIN - SET @sql = @sql + ' - AND p.Published = 1' - END - END - ELSE IF (@OverridePublished = 1) - BEGIN - --published only - SET @sql = @sql + ' - AND p.Published = 1' - END - ELSE IF (@OverridePublished = 0) - BEGIN - --unpublished only - SET @sql = @sql + ' - AND p.Published = 0' - END - - --show hidden - IF @ShowHidden = 0 - BEGIN - SET @sql = @sql + ' - AND p.Deleted = 0 - AND (getutcdate() BETWEEN ISNULL(p.AvailableStartDateTimeUtc, ''1/1/1900'') and ISNULL(p.AvailableEndDateTimeUtc, ''1/1/2999''))' - END - - --min price - IF @PriceMin is not null - BEGIN - SET @sql = @sql + ' - AND (p.Price >= ' + CAST(@PriceMin AS nvarchar(max)) + ')' - END - - --max price - IF @PriceMax is not null - BEGIN - SET @sql = @sql + ' - AND (p.Price <= ' + CAST(@PriceMax AS nvarchar(max)) + ')' - END - - --show hidden and ACL - IF @ShowHidden = 0 and @FilteredCustomerRoleIdsCount > 0 - BEGIN - SET @sql = @sql + ' - AND (p.SubjectToAcl = 0 OR EXISTS ( - SELECT 1 FROM #FilteredCustomerRoleIds [fcr] - WHERE - [fcr].CustomerRoleId IN ( - SELECT [acl].CustomerRoleId - FROM [AclRecord] acl with (NOLOCK) - WHERE [acl].EntityId = p.Id AND [acl].EntityName = ''Product'' - ) - ))' - END - - --filter by store - IF @StoreId > 0 - BEGIN - SET @sql = @sql + ' - AND (p.LimitedToStores = 0 OR EXISTS ( - SELECT 1 FROM [StoreMapping] sm with (NOLOCK) - WHERE [sm].EntityId = p.Id AND [sm].EntityName = ''Product'' and [sm].StoreId=' + CAST(@StoreId AS nvarchar(max)) + ' - ))' - END - - --prepare filterable specification attribute option identifier (if requested) - IF @LoadFilterableSpecificationAttributeOptionIds = 1 - BEGIN - CREATE TABLE #FilterableSpecs - ( - [SpecificationAttributeOptionId] int NOT NULL - ) - DECLARE @sql_filterableSpecs nvarchar(max) - SET @sql_filterableSpecs = ' - INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId]) - SELECT DISTINCT [psam].SpecificationAttributeOptionId - FROM [Product_SpecificationAttribute_Mapping] [psam] WITH (NOLOCK) - WHERE [psam].[AllowFiltering] = 1 - AND [psam].[ProductId] IN (' + @sql + ')' - - EXEC sp_executesql @sql_filterableSpecs - - --build comma separated list of filterable identifiers - SELECT @FilterableSpecificationAttributeOptionIds = COALESCE(@FilterableSpecificationAttributeOptionIds + ',' , '') + CAST(SpecificationAttributeOptionId as nvarchar(4000)) - FROM #FilterableSpecs - - DROP TABLE #FilterableSpecs - END - - --filter by specification attribution options - SET @FilteredSpecs = isnull(@FilteredSpecs, '') - CREATE TABLE #FilteredSpecs - ( - SpecificationAttributeOptionId int not null - ) - INSERT INTO #FilteredSpecs (SpecificationAttributeOptionId) - SELECT CAST(data as int) FROM [nop_splitstring_to_table](@FilteredSpecs, ',') - - CREATE TABLE #FilteredSpecsWithAttributes - ( - SpecificationAttributeId int not null, - SpecificationAttributeOptionId int not null - ) - INSERT INTO #FilteredSpecsWithAttributes (SpecificationAttributeId, SpecificationAttributeOptionId) - SELECT sao.SpecificationAttributeId, fs.SpecificationAttributeOptionId - FROM #FilteredSpecs fs INNER JOIN SpecificationAttributeOption sao ON sao.Id = fs.SpecificationAttributeOptionId - ORDER BY sao.SpecificationAttributeId - - DECLARE @SpecAttributesCount int - SET @SpecAttributesCount = (SELECT COUNT(1) FROM #FilteredSpecsWithAttributes) - IF @SpecAttributesCount > 0 - BEGIN - --do it for each specified specification option - DECLARE @SpecificationAttributeOptionId int - DECLARE @SpecificationAttributeId int - DECLARE @LastSpecificationAttributeId int - SET @LastSpecificationAttributeId = 0 - DECLARE cur_SpecificationAttributeOption CURSOR FOR - SELECT SpecificationAttributeId, SpecificationAttributeOptionId - FROM #FilteredSpecsWithAttributes - - OPEN cur_SpecificationAttributeOption - FOREACH: - FETCH NEXT FROM cur_SpecificationAttributeOption INTO @SpecificationAttributeId, @SpecificationAttributeOptionId - IF (@LastSpecificationAttributeId <> 0 AND @SpecificationAttributeId <> @LastSpecificationAttributeId OR @@FETCH_STATUS <> 0) - SET @sql = @sql + ' - AND p.Id in (select psam.ProductId from [Product_SpecificationAttribute_Mapping] psam with (NOLOCK) where psam.AllowFiltering = 1 and psam.SpecificationAttributeOptionId IN (SELECT SpecificationAttributeOptionId FROM #FilteredSpecsWithAttributes WHERE SpecificationAttributeId = ' + CAST(@LastSpecificationAttributeId AS nvarchar(max)) + '))' - SET @LastSpecificationAttributeId = @SpecificationAttributeId - IF @@FETCH_STATUS = 0 GOTO FOREACH - CLOSE cur_SpecificationAttributeOption - DEALLOCATE cur_SpecificationAttributeOption - END - - --sorting - SET @sql_orderby = '' - IF @OrderBy = 5 /* Name: A to Z */ - SET @sql_orderby = ' p.[Name] ASC' - ELSE IF @OrderBy = 6 /* Name: Z to A */ - SET @sql_orderby = ' p.[Name] DESC' - ELSE IF @OrderBy = 10 /* Price: Low to High */ - SET @sql_orderby = ' p.[Price] ASC' - ELSE IF @OrderBy = 11 /* Price: High to Low */ - SET @sql_orderby = ' p.[Price] DESC' - ELSE IF @OrderBy = 15 /* creation date */ - SET @sql_orderby = ' p.[CreatedOnUtc] DESC' - ELSE /* default sorting, 0 (position) */ - BEGIN - --category position (display order) - IF @CategoryIdsCount > 0 SET @sql_orderby = ' pcm.DisplayOrder ASC' - - --manufacturer position (display order) - IF @ManufacturerId > 0 - BEGIN - IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', ' - SET @sql_orderby = @sql_orderby + ' pmm.DisplayOrder ASC' - END - - --name - IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', ' - SET @sql_orderby = @sql_orderby + ' p.[Name] ASC' - END - - SET @sql = @sql + ' - ORDER BY' + @sql_orderby - - SET @sql = ' - INSERT INTO #DisplayOrderTmp ([ProductId])' + @sql - - --PRINT (@sql) - EXEC sp_executesql @sql - - DROP TABLE #FilteredCategoryIds - DROP TABLE #FilteredSpecs - DROP TABLE #FilteredSpecsWithAttributes - DROP TABLE #FilteredCustomerRoleIds - DROP TABLE #KeywordProducts - - CREATE TABLE #PageIndex - ( - [IndexId] int IDENTITY (1, 1) NOT NULL, - [ProductId] int NOT NULL - ) - INSERT INTO #PageIndex ([ProductId]) - SELECT ProductId - FROM #DisplayOrderTmp - GROUP BY ProductId - ORDER BY min([Id]) - - --total records - SET @TotalRecords = @@rowcount - - DROP TABLE #DisplayOrderTmp - - --return products - SELECT TOP (@RowsToReturn) - p.* - FROM - #PageIndex [pi] - INNER JOIN Product p with (NOLOCK) on p.Id = [pi].[ProductId] - WHERE - [pi].IndexId > @PageLowerBound AND - [pi].IndexId < @PageUpperBound - ORDER BY - [pi].IndexId - - DROP TABLE #PageIndex -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.deactivategiftcardsafterdeletingorder') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.deactivategiftcardsafterdeletingorder', N'False', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.completeorderwhendelivered') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.completeorderwhendelivered', N'True', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[NewsComment]') and NAME='IsApproved') -BEGIN - ALTER TABLE [NewsComment] - ADD [IsApproved] bit NULL -END -GO - -UPDATE [NewsComment] -SET [IsApproved] = 1 -WHERE [IsApproved] IS NULL -GO - -ALTER TABLE [NewsComment] ALTER COLUMN [IsApproved] bit NOT NULL -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditNewsComment') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditNewsComment', N'Edited a news comment', N'true') -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'newssettings.newscommentsmustbeapproved') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'newssettings.newscommentsmustbeapproved', N'False', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogComment]') and NAME='IsApproved') -BEGIN - ALTER TABLE [BlogComment] - ADD [IsApproved] bit NULL -END -GO - -UPDATE [BlogComment] -SET [IsApproved] = 1 -WHERE [IsApproved] IS NULL -GO - -ALTER TABLE [BlogComment] ALTER COLUMN [IsApproved] bit NOT NULL -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditBlogComment') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'EditBlogComment', N'Edited a blog comment', N'true') -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'blogsettings.blogcommentsmustbeapproved') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'blogsettings.blogcommentsmustbeapproved', N'False', 0) -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[News]') and NAME='CommentCount') -BEGIN - ALTER TABLE [News] DROP COLUMN [CommentCount] -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogPost]') and NAME='CommentCount') -BEGIN - ALTER TABLE [BlogPost] DROP COLUMN [CommentCount] -END -GO - --- new message template - IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'NewReturnRequest.CustomerNotification') - BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'NewReturnRequest.CustomerNotification', NULL, N'%Store.Name%. New return request.', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%!' + @NewLine + '
    ' + @NewLine + 'You have just submitted a new return request. Details are below:' + @NewLine + '
    ' + @NewLine + 'Request ID: %ReturnRequest.CustomNumber%' + @NewLine + '
    ' + @NewLine + 'Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%' + @NewLine + '
    ' + @NewLine + 'Reason for return: %ReturnRequest.Reason%' + @NewLine + '
    ' + @NewLine + 'Requested action: %ReturnRequest.RequestedAction%' + @NewLine + '
    ' + @NewLine + 'Customer comments:' + @NewLine + '
    ' + @NewLine + '%ReturnRequest.CustomerComment%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) - END - GO - - --new table -IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StockQuantityHistory]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) -BEGIN - CREATE TABLE [dbo].[StockQuantityHistory] - ( - [Id] int IDENTITY(1,1) NOT NULL, - [ProductId] int NOT NULL, - [CombinationId] int NULL, - [WarehouseId] int NULL, - [QuantityAdjustment] int NOT NULL, - [StockQuantity] int NOT NULL, - [Message] NVARCHAR (MAX) NULL, - [CreatedOnUtc] datetime NOT NULL - PRIMARY KEY CLUSTERED - ( - [Id] ASC - ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ) -END -GO - -IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'StockQuantityHistory_Product' AND parent_object_id = Object_id('StockQuantityHistory') AND Objectproperty(object_id, N'IsForeignKey') = 1) -BEGIN - ALTER TABLE [dbo].StockQuantityHistory - DROP CONSTRAINT StockQuantityHistory_Product -END -GO - -ALTER TABLE [dbo].[StockQuantityHistory] WITH CHECK ADD CONSTRAINT [StockQuantityHistory_Product] FOREIGN KEY([ProductId]) -REFERENCES [dbo].[Product] ([Id]) -ON DELETE CASCADE -GO - ---initial stock quantity history -DECLARE cur_initialhistory CURSOR FOR -SELECT [Product].Id, NULL, [Product].WarehouseId, [Product].StockQuantity, NULL -FROM [Product] -UNION ALL -SELECT [ProductAttributeCombination].ProductId, [ProductAttributeCombination].Id, NULL, [ProductAttributeCombination].StockQuantity, NULL -FROM [ProductAttributeCombination] -UNION ALL -SELECT [ProductWarehouseInventory].ProductId, NULL, [ProductWarehouseInventory].WarehouseId, [ProductWarehouseInventory].StockQuantity, [ProductWarehouseInventory].Id -FROM [ProductWarehouseInventory] - -DECLARE @productId int -DECLARE @combinationId int -DECLARE @warehouseId int -DECLARE @quantity int -DECLARE @warehouseInventoryId int - -OPEN cur_initialhistory -FETCH NEXT FROM cur_initialhistory INTO @productId, @combinationId, @warehouseId, @quantity, @warehouseInventoryId - -WHILE @@FETCH_STATUS = 0 -BEGIN - IF @warehouseId = 0 - BEGIN - SET @warehouseId = NULL; - END - - DECLARE @message nvarchar(200) - SET @message = 'Initialization of history table (original quantity set) during upgrade from a previous version' - IF @warehouseInventoryId IS NOT NULL - BEGIN - SET @message = 'Multiple warehouses. ' + @message; - END - - IF (@quantity IS NOT NULL AND @quantity <> 0 AND - NOT EXISTS (SELECT 1 FROM [StockQuantityHistory] WHERE ProductId = @productId AND - (CombinationId = @combinationId OR (CombinationId IS NULL AND @combinationId IS NULL)) AND (WarehouseId = @warehouseId OR (WarehouseId IS NULL AND @warehouseId IS NULL)))) - BEGIN - INSERT INTO [StockQuantityHistory] - ([ProductId], [CombinationId], [WarehouseId], [QuantityAdjustment], [StockQuantity], [Message], [CreatedOnUtc]) - VALUES - (@productId, @combinationId, @warehouseId, @quantity, @quantity, @message, GETUTCDATE()) - END - - FETCH NEXT FROM cur_initialhistory INTO @productId, @combinationId, @warehouseId, @quantity, @warehouseInventoryId -END - -CLOSE cur_initialhistory -DEALLOCATE cur_initialhistory -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'producteditorsettings.stockquantityhistory') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'producteditorsettings.stockquantityhistory', N'False', 0) -END -GO - - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='RequireReLogin') -BEGIN - ALTER TABLE [Customer] - ADD [RequireReLogin] bit NULL -END -GO - -UPDATE [Customer] -SET [RequireReLogin] = 0 -WHERE [RequireReLogin] IS NULL -GO - -ALTER TABLE [Customer] ALTER COLUMN [RequireReLogin] bit NOT NULL -GO - - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'rewardpointssettings.PointsForPurchases_Awarded' -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'rewardpointssettings.PointsForPurchases_Canceled' -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'ordersettings.GiftCards_Activated_OrderStatusId' -GO - ---delete setting -DELETE FROM [Setting] -WHERE [name] = N'ordersettings.GiftCards_Deactivated_OrderStatusId' -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.activategiftcardsaftercompletingorder') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.activategiftcardsaftercompletingorder', N'False', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.deactivategiftcardsaftercancellingorder') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.deactivategiftcardsaftercancellingorder', N'False', 0) -END -GO - - ---update a stored procedure -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[LanguagePackImport]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [LanguagePackImport] -GO -CREATE PROCEDURE [dbo].[LanguagePackImport] -( - @LanguageId int, - @XmlPackage xml, - @UpdateExistingResources bit -) -AS -BEGIN - IF EXISTS(SELECT * FROM [Language] WHERE [Id] = @LanguageId) - BEGIN - CREATE TABLE #LocaleStringResourceTmp - ( - [LanguageId] [int] NOT NULL, - [ResourceName] [nvarchar](200) NOT NULL, - [ResourceValue] [nvarchar](MAX) NOT NULL - ) - - INSERT INTO #LocaleStringResourceTmp (LanguageId, ResourceName, ResourceValue) - SELECT @LanguageId, nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') - FROM @XmlPackage.nodes('//Language/LocaleResource') AS R(nref) - - DECLARE @ResourceName nvarchar(200) - DECLARE @ResourceValue nvarchar(MAX) - DECLARE cur_localeresource CURSOR FOR - SELECT LanguageId, ResourceName, ResourceValue - FROM #LocaleStringResourceTmp - OPEN cur_localeresource - FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue - WHILE @@FETCH_STATUS = 0 - BEGIN - IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageId=@LanguageId AND ResourceName=@ResourceName)) - BEGIN - IF (@UpdateExistingResources = 1) - BEGIN - UPDATE [LocaleStringResource] - SET [ResourceValue]=@ResourceValue - WHERE LanguageId=@LanguageId AND ResourceName=@ResourceName - END - END - ELSE - BEGIN - INSERT INTO [LocaleStringResource] - ( - [LanguageId], - [ResourceName], - [ResourceValue] - ) - VALUES - ( - @LanguageId, - @ResourceName, - @ResourceValue - ) - END - - - FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue - END - CLOSE cur_localeresource - DEALLOCATE cur_localeresource - - DROP TABLE #LocaleStringResourceTmp - END -END -GO - - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.skippaymentInfostepforredirectionpaymentmethods') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'paymentsettings.skippaymentInfostepforredirectionpaymentmethods', N'False', 0) -END -GO - - ---updated some indexes (required for case sensitive SQL Server collations) -IF EXISTS (SELECT 1 from sys.indexes WHERE [NAME]=N'IX_NewsletterSubscription_Email_StoreId' and object_id=object_id(N'[dbo].[NewsLetterSubscription]')) -BEGIN - DROP INDEX [IX_NewsletterSubscription_Email_StoreId] ON [NewsLetterSubscription] -END -GO -CREATE NONCLUSTERED INDEX [IX_NewsletterSubscription_Email_StoreId] ON [NewsLetterSubscription] ([Email] ASC, [StoreId] ASC) -GO - -IF EXISTS (SELECT 1 from sys.indexes WHERE [NAME]=N'IX_Product_ShowOnHomepage' and object_id=object_id(N'[dbo].[Product]')) -BEGIN - DROP INDEX [IX_Product_ShowOnHomepage] ON [Product] -END -GO -CREATE NONCLUSTERED INDEX [IX_Product_ShowOnHomepage] ON [Product] ([ShowOnHomePage] ASC) -GO - ---update a stored procedure -IF EXISTS ( - SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'[DeleteGuests]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) -DROP PROCEDURE [DeleteGuests] -GO -CREATE PROCEDURE [dbo].[DeleteGuests] -( - @OnlyWithoutShoppingCart bit = 1, - @CreatedFromUtc datetime, - @CreatedToUtc datetime, - @TotalRecordsDeleted int = null OUTPUT -) -AS -BEGIN - CREATE TABLE #tmp_guests (CustomerId int) - - INSERT #tmp_guests (CustomerId) - SELECT [Id] FROM [Customer] c with (NOLOCK) - WHERE - --created from - ((@CreatedFromUtc is null) OR (c.[CreatedOnUtc] > @CreatedFromUtc)) - AND - --created to - ((@CreatedToUtc is null) OR (c.[CreatedOnUtc] < @CreatedToUtc)) - AND - --shopping cart items - ((@OnlyWithoutShoppingCart=0) OR (NOT EXISTS(SELECT 1 FROM [ShoppingCartItem] sci with (NOLOCK) inner join [Customer] with (NOLOCK) on sci.[CustomerId]=c.[Id]))) - AND - --guests only - (EXISTS(SELECT 1 FROM [Customer_CustomerRole_Mapping] ccrm with (NOLOCK) inner join [Customer] with (NOLOCK) on ccrm.[Customer_Id]=c.[Id] inner join [CustomerRole] cr with (NOLOCK) on cr.[Id]=ccrm.[CustomerRole_Id] WHERE cr.[SystemName] = N'Guests')) - AND - --no orders - (NOT EXISTS(SELECT 1 FROM [Order] o with (NOLOCK) inner join [Customer] with (NOLOCK) on o.[CustomerId]=c.[Id])) - AND - --no blog comments - (NOT EXISTS(SELECT 1 FROM [BlogComment] bc with (NOLOCK) inner join [Customer] with (NOLOCK) on bc.[CustomerId]=c.[Id])) - AND - --no news comments - (NOT EXISTS(SELECT 1 FROM [NewsComment] nc with (NOLOCK)inner join [Customer] with (NOLOCK) on nc.[CustomerId]=c.[Id])) - AND - --no product reviews - (NOT EXISTS(SELECT 1 FROM [ProductReview] pr with (NOLOCK) inner join [Customer] with (NOLOCK) on pr.[CustomerId]=c.[Id])) - AND - --no product reviews helpfulness - (NOT EXISTS(SELECT 1 FROM [ProductReviewHelpfulness] prh with (NOLOCK) inner join [Customer] with (NOLOCK) on prh.[CustomerId]=c.[Id])) - AND - --no poll voting - (NOT EXISTS(SELECT 1 FROM [PollVotingRecord] pvr with (NOLOCK) inner join [Customer] with (NOLOCK) on pvr.[CustomerId]=c.[Id])) - AND - --no forum topics - (NOT EXISTS(SELECT 1 FROM [Forums_Topic] ft with (NOLOCK) inner join [Customer] with (NOLOCK) on ft.[CustomerId]=c.[Id])) - AND - --no forum posts - (NOT EXISTS(SELECT 1 FROM [Forums_Post] fp with (NOLOCK) inner join [Customer] with (NOLOCK) on fp.[CustomerId]=c.[Id])) - AND - --no system accounts - (c.IsSystemAccount = 0) - - --delete guests - DELETE [Customer] - WHERE [Id] IN (SELECT [CustomerId] FROM #tmp_guests) - - --delete attributes - DELETE [GenericAttribute] - WHERE ([EntityId] IN (SELECT [CustomerId] FROM #tmp_guests)) - AND - ([KeyGroup] = N'Customer') - - --total records - SELECT @TotalRecordsDeleted = COUNT(1) FROM #tmp_guests - - DROP TABLE #tmp_guests -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.sitemapcustomurls') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'commonsettings.sitemapcustomurls', N'', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shoppingcartsettings.cartssharedbetweenstores') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'shoppingcartsettings.cartssharedbetweenstores', N'False', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='EmailToRevalidate') -BEGIN - ALTER TABLE [Customer] - ADD [EmailToRevalidate] nvarchar(1000) NULL -END -GO - --- new message template - IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Customer.EmailRevalidationMessage') - BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'Customer.EmailRevalidationMessage', NULL, N'%Store.Name%. Email validation.', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%!' + @NewLine + '
    ' + @NewLine + 'To validate your new email address click here .' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + '%Store.Name%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) - END - GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsHistoryEntryId') -BEGIN - ALTER TABLE [Order] - ADD [RewardPointsHistoryEntryId] int NULL -END -GO - -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsWereAdded') -BEGIN - --column RewardPointsWereAdded was replaced with RewardPointsHistoryEntryId - --ensure that the new column value is not null to specify that reward points were added (earned) to an order - EXEC(' - UPDATE [Order] - SET [RewardPointsHistoryEntryId] = 0 - WHERE [RewardPointsWereAdded] = 1') -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsWereAdded') -BEGIN - ALTER TABLE [Order] DROP COLUMN [RewardPointsWereAdded] -END -GO - - ---update plugin locales (renamed) -UPDATE [LocaleStringResource] -SET [ResourceName] = REPLACE([ResourceName], 'Plugins.Feed.Froogle.','Plugins.Feed.GoogleShopping.') -WHERE [ResourceName] like 'Plugins.Feed.Froogle.%' -GO - ---update settings -UPDATE [Setting] -SET [Name] = REPLACE([Name], 'frooglesettings.','googlesShoppingsettings.') -WHERE [Name] like 'frooglesettings.%' -GO - - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductTemplate]') and NAME='IgnoredProductTypes') -BEGIN - ALTER TABLE [ProductTemplate] - ADD [IgnoredProductTypes] nvarchar(MAX) NULL -END -GO - -UPDATE [ProductTemplate] -SET [IgnoredProductTypes] = '10' -WHERE [ViewPath] = N'ProductTemplate.Simple' -GO - -UPDATE [ProductTemplate] -SET [IgnoredProductTypes] = '5' -WHERE [ViewPath] = N'ProductTemplate.Grouped' -GO - - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ReturnRequest]') and NAME='UploadedFileId') -BEGIN - ALTER TABLE [ReturnRequest] - ADD [UploadedFileId] int NULL -END -GO - -UPDATE [ReturnRequest] -SET [UploadedFileId] = 0 -WHERE [UploadedFileId] IS NULL -GO - -ALTER TABLE [ReturnRequest] ALTER COLUMN [UploadedFileId] int NOT NULL -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.returnrequestsallowfiles') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.returnrequestsallowfiles', N'False', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.returnrequestsfilemaximumsize') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.returnrequestsfilemaximumsize', N'2048', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductReview]') and NAME='ReplyText') -BEGIN - ALTER TABLE [ProductReview] - ADD [ReplyText] nvarchar(MAX) NULL -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogComment]') and NAME='StoreId') -BEGIN - ALTER TABLE [dbo].[BlogComment] - ADD [StoreId] int NULL -END -GO - -DECLARE @DefaultStoreId int -SET @DefaultStoreId = (SELECT TOP (1) Id FROM [dbo].[Store]); ---set default value to store column -UPDATE [dbo].[BlogComment] -SET StoreId = @DefaultStoreId -WHERE StoreId IS NULL -GO - -ALTER TABLE [dbo].[BlogComment] ALTER COLUMN [StoreId] int NOT NULL -GO - -IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'BlogComment_Store' AND parent_object_id = Object_id('BlogComment') AND Objectproperty(object_id, N'IsForeignKey') = 1) -ALTER TABLE [dbo].[BlogComment] -DROP CONSTRAINT BlogComment_Store -GO - -ALTER TABLE [dbo].[BlogComment] WITH CHECK ADD CONSTRAINT [BlogComment_Store] FOREIGN KEY([StoreId]) -REFERENCES [dbo].[Store] ([Id]) -ON DELETE CASCADE -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'blogsettings.showblogcommentsperstore') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'blogsettings.showblogcommentsperstore', N'False', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[NewsComment]') and NAME='StoreId') -BEGIN - ALTER TABLE [dbo].[NewsComment] - ADD [StoreId] int NULL -END -GO - -DECLARE @DefaultStoreId int -SET @DefaultStoreId = (SELECT TOP (1) Id FROM [dbo].[Store]); ---set default value to store column -UPDATE [dbo].[NewsComment] -SET StoreId = @DefaultStoreId -WHERE StoreId IS NULL -GO - -ALTER TABLE [dbo].[NewsComment] ALTER COLUMN [StoreId] int NOT NULL -GO - -IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'NewsComment_Store' AND parent_object_id = Object_id('NewsComment') AND Objectproperty(object_id, N'IsForeignKey') = 1) -ALTER TABLE [dbo].[NewsComment] -DROP CONSTRAINT NewsComment_Store -GO - -ALTER TABLE [dbo].[NewsComment] WITH CHECK ADD CONSTRAINT [NewsComment_Store] FOREIGN KEY([StoreId]) -REFERENCES [dbo].[Store] ([Id]) -ON DELETE CASCADE -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'newssettings.shownewscommentsperstore') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'newssettings.shownewscommentsperstore', N'False', 0) -END -GO - - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Vendor]') and NAME='AddressId') -BEGIN - ALTER TABLE [Vendor] - ADD [AddressId] int NULL -END -GO - -UPDATE [Vendor] -SET [AddressId] = 0 -WHERE [AddressId] IS NULL -GO - -ALTER TABLE [Vendor] ALTER COLUMN [AddressId] int NOT NULL -GO - - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.failedpasswordallowedattempts') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'customersettings.failedpasswordallowedattempts', N'0', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.failedpasswordlockoutminutes') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'customersettings.failedpasswordlockoutminutes', N'30', 0) -END -GO - - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='FailedLoginAttempts') -BEGIN - ALTER TABLE [Customer] - ADD [FailedLoginAttempts] int NULL -END -GO - -UPDATE [Customer] -SET [FailedLoginAttempts] = 0 -WHERE [FailedLoginAttempts] IS NULL -GO - -ALTER TABLE [Customer] ALTER COLUMN [FailedLoginAttempts] int NOT NULL -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='CannotLoginUntilDateUtc') -BEGIN - ALTER TABLE [Customer] - ADD [CannotLoginUntilDateUtc] datetime NULL -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'fixedorbycountrystateziptaxsettings.countrystatezipenabled') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'fixedorbycountrystateziptaxsettings.countrystatezipenabled', N'False', 0) -END -GO - ---rename settings -UPDATE [Setting] -SET [Name] = N'tax.taxprovider.fixedorbycountrystatezip.taxcategoryid' + SUBSTRING(name, 40, len(name)) -WHERE [Name] like N'tax.taxprovider.fixedrate.taxcategoryid%' -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='RegisteredInStoreId') -BEGIN - ALTER TABLE [dbo].[Customer] - ADD [RegisteredInStoreId] int NULL -END -GO - -declare @DefaultStoreId int; -if ((select count(id) from [dbo].[Store]) = 1) -set @DefaultStoreId = (select top(1) id from [dbo].[Store]) -else -set @DefaultStoreId = 0; ---set default value to store column -UPDATE [dbo].[Customer] set [RegisteredInStoreId] = @DefaultStoreId where [RegisteredInStoreId] is NULL - -ALTER TABLE [dbo].[Customer] ALTER COLUMN [RegisteredInStoreId] int NOT NULL -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shippingsettings.considerassociatedproductsdimensions') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'shippingsettings.considerassociatedproductsdimensions', N'True', 0) -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.bbcodeeditoropenlinksinnewwindow') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'commonsettings.bbcodeeditoropenlinksinnewwindow', N'false', 0) -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.cancelrecurringpaymentsafterfailedpayment') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'paymentsettings.cancelrecurringpaymentsafterfailedpayment', N'False', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[RecurringPayment]') and NAME='LastPaymentFailed') -BEGIN - ALTER TABLE [RecurringPayment] - ADD [LastPaymentFailed] bit NULL -END -GO - -UPDATE [RecurringPayment] -SET [LastPaymentFailed] = 0 -WHERE [LastPaymentFailed] IS NULL -GO - -ALTER TABLE [RecurringPayment] ALTER COLUMN [LastPaymentFailed] bit NOT NULL -GO - --- new message template -IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'RecurringPaymentCancelled.CustomerNotification') -BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'RecurringPaymentCancelled.CustomerNotification', NULL, N'%Store.Name%. Recurring payment cancelled', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%,' + @NewLine + '
    ' + @NewLine + '%if (%RecurringPayment.CancelAfterFailedPayment%) It appears your credit card didn''t go through for this recurring payment (%Order.OrderURLForCustomer%)' + @NewLine + '
    ' + @NewLine + 'So your subscription has been canceled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) The recurring payment ID=%RecurringPayment.ID% was cancelled. endif%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) -END -GO - --- new message template -IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'RecurringPaymentFailed.CustomerNotification') -BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'RecurringPaymentFailed.CustomerNotification', NULL, N'%Store.Name%. Last recurring payment failed', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%,' + @NewLine + '
    ' + @NewLine + 'It appears your credit card didn''t go through for this recurring payment (%Order.OrderURLForCustomer%)' + @NewLine + '
    %if (%RecurringPayment.RecurringPaymentType% == "Manual") ' + @NewLine + 'You can recharge balance and manually retry payment or cancel it on the order history page. endif% %if (%RecurringPayment.RecurringPaymentType% == "Automatic") ' + @NewLine + 'You can recharge balance and wait, we will try to make the payment again, or you can cancel it on the order history page. endif%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) -END -GO ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='CustomOrderNumber') -BEGIN - ALTER TABLE [Order] - ADD [CustomOrderNumber] nvarchar(MAX) NULL -END -GO - -UPDATE [Order] -SET [CustomOrderNumber] = [id] -WHERE [CustomOrderNumber] IS NULL -GO - -ALTER TABLE [Order] ALTER COLUMN [CustomOrderNumber] nvarchar(MAX) NOT NULL -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.customordernumbermask') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.customordernumbermask', N'{ID}', 0) -END -GO - - --new table -IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CustomerPassword]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) -BEGIN - CREATE TABLE [dbo].[CustomerPassword] - ( - [Id] int IDENTITY(1,1) NOT NULL, - [CustomerId] int NOT NULL, - [Password] NVARCHAR (MAX) NULL, - [PasswordFormatId] INT NOT NULL, - [PasswordSalt] NVARCHAR (MAX) NULL, - [CreatedOnUtc] datetime NOT NULL - PRIMARY KEY CLUSTERED - ( - [Id] ASC - ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ) -END -GO - -IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'CustomerPassword_Customer' AND parent_object_id = Object_id('CustomerPassword') AND Objectproperty(object_id, N'IsForeignKey') = 1) -BEGIN - ALTER TABLE [dbo].CustomerPassword - DROP CONSTRAINT CustomerPassword_Customer -END -GO - -ALTER TABLE [dbo].[CustomerPassword] WITH CHECK ADD CONSTRAINT [CustomerPassword_Customer] FOREIGN KEY([CustomerId]) -REFERENCES [dbo].[Customer] ([Id]) -ON DELETE CASCADE -GO - ---move customer passwords into a new table -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and (NAME='Password' or NAME='PasswordFormatId' or NAME='PasswordSalt')) -BEGIN - EXEC(' - INSERT INTO [dbo].[CustomerPassword]([CustomerId], [Password], [PasswordFormatId], [PasswordSalt], [CreatedOnUtc]) - SELECT [Id], [Password], [PasswordFormatId], [PasswordSalt], [CreatedOnUtc] - FROM [dbo].[Customer]') -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='Password') -BEGIN - ALTER TABLE [Customer] DROP COLUMN [Password] -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='PasswordFormatId') -BEGIN - ALTER TABLE [Customer] DROP COLUMN [PasswordFormatId] -END -GO - ---drop column -IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='PasswordSalt') -BEGIN - ALTER TABLE [Customer] DROP COLUMN [PasswordSalt] -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.unduplicatedpasswordsnumber') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'customersettings.unduplicatedpasswordsnumber', N'4', 0) -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.passwordlifetime') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'customersettings.passwordlifetime', N'90', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[CustomerRole]') and NAME='EnablePasswordLifetime') -BEGIN - ALTER TABLE [CustomerRole] - ADD [EnablePasswordLifetime] bit NULL -END -GO - -UPDATE [CustomerRole] -SET [EnablePasswordLifetime] = 0 -WHERE [EnablePasswordLifetime] IS NULL -GO - -ALTER TABLE [CustomerRole] ALTER COLUMN [EnablePasswordLifetime] bit NOT NULL -GO - --- new message template - IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Service.ContactUs') - BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'Service.ContactUs', NULL, N'%Store.Name%. Contact us', N'

    ' + @NewLine + '%ContactUs.Body%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) - END - GO - --- new message template - IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Service.ContactVendor') - BEGIN - DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) - INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) - VALUES (N'Service.ContactVendor', NULL, N'%Store.Name%. Contact us', N'

    ' + @NewLine + '%ContactUs.Body%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) - END - GO - - --now vendors have "Manage product reviews" permission -IF EXISTS ( - SELECT 1 - FROM [dbo].[PermissionRecord] - WHERE [SystemName] = N'ManageProductReviews') -BEGIN - DECLARE @PermissionRecordId INT - SET @PermissionRecordId = (SELECT [Id] FROM [dbo].[PermissionRecord] WHERE [SystemName] = N'ManageProductReviews') - - --add it to vendor role by default - DECLARE @VendorCustomerRoleId int - SELECT @VendorCustomerRoleId = Id - FROM [CustomerRole] - WHERE IsSystemRole=1 and [SystemName] = N'Vendors' - - IF NOT EXISTS ( - SELECT 1 - FROM [dbo].[PermissionRecord_Role_Mapping] - WHERE [PermissionRecord_Id] = @PermissionRecordId AND [CustomerRole_Id] = @VendorCustomerRoleId) - BEGIN - INSERT [dbo].[PermissionRecord_Role_Mapping] ([PermissionRecord_Id], [CustomerRole_Id]) - VALUES (@PermissionRecordId, @VendorCustomerRoleId) - END -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'taxsettings.taxbasedonpickuppointaddress') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'taxsettings.taxbasedonpickuppointaddress', N'False', 0) -END -GO - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.exportwithproducts') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'ordersettings.exportwithproducts', N'True', 0) -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='InteractionTypeId') -BEGIN - ALTER TABLE [DiscountRequirement] - ADD [InteractionTypeId] int NULL -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='ParentId') -BEGIN - ALTER TABLE [DiscountRequirement] - ADD [ParentId] int NULL -END -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='IsGroup') -BEGIN - ALTER TABLE [DiscountRequirement] - ADD [IsGroup] bit NULL -END -GO - -UPDATE [DiscountRequirement] -SET [IsGroup] = 0 -WHERE [IsGroup] IS NULL -GO - -ALTER TABLE [DiscountRequirement] ALTER COLUMN [IsGroup] bit NOT NULL -GO - ---add default requirement group for existing requirements -DECLARE cursor_defaultGroup CURSOR FOR SELECT [DiscountId] FROM [DiscountRequirement] -DECLARE @discountId int - -OPEN cursor_defaultGroup -FETCH NEXT FROM cursor_defaultGroup INTO @discountId -WHILE @@FETCH_STATUS = 0 -BEGIN - IF NOT EXISTS (SELECT 1 FROM [DiscountRequirement] WHERE [DiscountId] = @discountId AND [ParentId] IS NULL AND [IsGroup] = 1) - BEGIN - INSERT INTO [DiscountRequirement] - ([DiscountId], [DiscountRequirementRuleSystemName], [InteractionTypeId], [ParentId], [IsGroup]) - VALUES - (@discountId, 'Default requirement group', 0, NULL, 1); - - DECLARE @requirementId int = (SELECT SCOPE_IDENTITY()); - - UPDATE [DiscountRequirement] - SET [ParentId] = @requirementId, [InteractionTypeId] = NULL - WHERE [DiscountId] = @discountId AND [Id] <> @requirementId - END - FETCH NEXT FROM cursor_defaultGroup INTO @discountId -END - -CLOSE cursor_defaultGroup -DEALLOCATE cursor_defaultGroup -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'adminareasettings.useisodatetimeconverterinjson') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'adminareasettings.useisodatetimeconverterinjson', N'True', 0) -END -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportCategories') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'ImportCategories', N'Categories were imported', N'True') -END -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportManufacturers') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'ImportManufacturers', N'Manufacturers were imported', N'True') -END -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportProducts') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'ImportProducts', N'Products were imported', N'True') -END -GO - ---new activity type -IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportStates') -BEGIN - INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) - VALUES (N'ImportStates', N'States and provinces were imported', N'True') -END -GO - ---update DownloadActivationType according to the new enum value -UPDATE [Product] -SET [DownloadActivationTypeId] = 0 -WHERE [DownloadActivationTypeId] = 1 -GO - ---new column -IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Currency]') and NAME='RoundingTypeId') -BEGIN - ALTER TABLE [Currency] - ADD [RoundingTypeId] INT NULL -END -GO - -UPDATE [Currency] -SET [RoundingTypeId] = 0 -WHERE [RoundingTypeId] IS NULL -GO - --- Rounding with 1.00 intervals (The system used in Sweden since 30 September 2010. https://en.wikipedia.org/wiki/Cash_rounding#Rounding_with_1.00_intervals) -UPDATE [Currency] -SET [RoundingTypeId] = 60 -WHERE [CurrencyCode] = 'SEK' -GO - -ALTER TABLE [Currency] ALTER COLUMN [RoundingTypeId] INT NOT NULL -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'adminareasettings.usericheditorinmessagetemplates') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'adminareasettings.usericheditorinmessagetemplates', N'False', 0) -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'mediasettings.azurecachecontrolheader') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'mediasettings.azurecachecontrolheader', N'', 0) -END -GO - ---add stored procedure for getting category tree -IF EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[nop_padright]') AND xtype IN (N'FN', N'IF', N'TF')) -DROP FUNCTION [dbo].[nop_padright] -GO - -CREATE FUNCTION [dbo].[nop_padright] -( - @source INT, - @symbol NVARCHAR(MAX), - @length INT -) -RETURNS NVARCHAR(MAX) -AS -BEGIN - RETURN RIGHT(REPLICATE(@symbol, @length)+ RTRIM(CAST(@source AS NVARCHAR(MAX))), @length) -END -GO - -IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[CategoryLoadAllPaged]') AND OBJECTPROPERTY(object_id, N'IsProcedure') = 1) -DROP PROCEDURE [dbo].[CategoryLoadAllPaged] -GO - -CREATE PROCEDURE [dbo].[CategoryLoadAllPaged] -( - @ShowHidden BIT = 0, - @Name NVARCHAR(MAX) = NULL, - @StoreId INT = 0, - @CustomerRoleIds NVARCHAR(MAX) = NULL, - @PageIndex INT = 0, - @PageSize INT = 2147483644, - @TotalRecords INT = NULL OUTPUT -) -AS -BEGIN - SET NOCOUNT ON - - --filter by customer role IDs (access control list) - SET @CustomerRoleIds = ISNULL(@CustomerRoleIds, '') - CREATE TABLE #FilteredCustomerRoleIds - ( - CustomerRoleId INT NOT NULL - ) - INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId) - SELECT CAST(data AS INT) FROM [nop_splitstring_to_table](@CustomerRoleIds, ',') - DECLARE @FilteredCustomerRoleIdsCount INT = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds) - - --ordered categories - CREATE TABLE #OrderedCategoryIds - ( - [Id] int IDENTITY (1, 1) NOT NULL, - [CategoryId] int NOT NULL - ) - - --get max length of DisplayOrder and Id columns (used for padding Order column) - DECLARE @lengthId INT = (SELECT LEN(MAX(Id)) FROM [Category]) - DECLARE @lengthOrder INT = (SELECT LEN(MAX(DisplayOrder)) FROM [Category]) - - --get category tree - ;WITH [CategoryTree] - AS (SELECT [Category].[Id] AS [Id], dbo.[nop_padright] ([Category].[DisplayOrder], '0', @lengthOrder) + '-' + dbo.[nop_padright] ([Category].[Id], '0', @lengthId) AS [Order] - FROM [Category] WHERE [Category].[ParentCategoryId] = 0 - UNION ALL - SELECT [Category].[Id] AS [Id], [CategoryTree].[Order] + '|' + dbo.[nop_padright] ([Category].[DisplayOrder], '0', @lengthOrder) + '-' + dbo.[nop_padright] ([Category].[Id], '0', @lengthId) AS [Order] - FROM [Category] - INNER JOIN [CategoryTree] ON [CategoryTree].[Id] = [Category].[ParentCategoryId]) - INSERT INTO #OrderedCategoryIds ([CategoryId]) - SELECT [Category].[Id] - FROM [CategoryTree] - RIGHT JOIN [Category] ON [CategoryTree].[Id] = [Category].[Id] - - --filter results - WHERE [Category].[Deleted] = 0 - AND (@ShowHidden = 1 OR [Category].[Published] = 1) - AND (@Name IS NULL OR @Name = '' OR [Category].[Name] LIKE ('%' + @Name + '%')) - AND (@ShowHidden = 1 OR @FilteredCustomerRoleIdsCount = 0 OR [Category].[SubjectToAcl] = 0 - OR EXISTS (SELECT 1 FROM #FilteredCustomerRoleIds [roles] WHERE [roles].[CustomerRoleId] IN - (SELECT [acl].[CustomerRoleId] FROM [AclRecord] acl WITH (NOLOCK) WHERE [acl].[EntityId] = [Category].[Id] AND [acl].[EntityName] = 'Category') - ) - ) - AND (@StoreId = 0 OR [Category].[LimitedToStores] = 0 - OR EXISTS (SELECT 1 FROM [StoreMapping] sm WITH (NOLOCK) - WHERE [sm].[EntityId] = [Category].[Id] AND [sm].[EntityName] = 'Category' AND [sm].[StoreId] = @StoreId - ) - ) - ORDER BY ISNULL([CategoryTree].[Order], 1) - - --total records - SET @TotalRecords = @@ROWCOUNT - - --paging - SELECT [Category].* FROM #OrderedCategoryIds AS [Result] INNER JOIN [Category] ON [Result].[CategoryId] = [Category].[Id] - WHERE ([Result].[Id] > @PageSize * @PageIndex AND [Result].[Id] <= @PageSize * (@PageIndex + 1)) - ORDER BY [Result].[Id] - - DROP TABLE #FilteredCustomerRoleIds - DROP TABLE #OrderedCategoryIds -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.usestoredprocedureforloadingcategories') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'commonsettings.usestoredprocedureforloadingcategories', N'False', 0) -END -GO - - --new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'storeinformationsettings.displayminiprofilerforadminonly') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'storeinformationsettings.displayminiprofilerforadminonly', N'False', 0) -END -GO - ---indicating whether to display default menu items -DECLARE @displayMenuItems bit -IF NOT EXISTS (SELECT 1 FROM [Category] where ParentCategoryId=0 and Deleted=0 and Published=1) - set @displayMenuItems = N'True' -ELSE - set @displayMenuItems = N'False' - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayhomepagemenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displayhomepagemenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaynewproductsmenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displaynewproductsmenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayproductsearchmenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displayproductsearchmenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaycustomerinfomenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displaycustomerinfomenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayblogmenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displayblogmenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayforumsmenuitem') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displayforumsmenuitem', @displayMenuItems, 0) -END - ---new setting -IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaycontactusmenuitem ') -BEGIN - INSERT [Setting] ([Name], [Value], [StoreId]) - VALUES (N'displaydefaultmenuitemsettings.displaycontactusmenuitem ', @displayMenuItems, 0) -END +--upgrade scripts from nopCommerce 3.80 to next version + +--new locale resources +declare @resources xml +--a resource will be deleted if its value is empty +set @resources=' + + + Assign Invoice ID from Task + + + Assign invoice id using background task. This assures that the same invoice id isn''t used more than ones and that there are no wholes in the number series. + + + Order total to pay + + + Order total to pay: + + + Total to pay + + + Total + + + Order total to pay + + + Order total amount + + + Order Total to pay + + + Order Total Amount + + + Order Total to pay: + + + Order Total Amount: + + + Order total to pay + + + Order total amount (incl.) + + + Order Total to pay + + + Order Total Amount + + + Included Tax: + + + Amount: + + + Amount incl. Tax: + + + Included Tax + + + Amount + + + Amount incl. Tax + + + Total to pay + + + Invoice Discount + + + + + + Tax % + + + + + + Tax % + + + Invoice + + + Invoice Date + + + Amount + + + Amount incl. tax + + + Discount + + + Discount incl. tax + + + + + + Tax Amount + + + Amount to pay + + + Base Ammount + + + Total Base + + + Continued on next page ... + + + Additional items + + + Invoice discount + + + Currency + + + Page + + + Order No. + + + Orderdate + + + {0} purchased reward points: + + + Invoice No. + + + Invoice Date + + + Order total to pay + + + The total amount to pay for this order (includes discounts, shipping and tax, reward points, gift cards). + + + Order total amount + + + The total amount for this order (includes discounts, shipping and tax). + + + Amount + + + Total order base amount. + + + Amount incl. Tax + + + Total order amount incl. tax + + + Invoice No. + + + Invoice No. + + + Invoice Date + + + Invoice Date + + + + + + + + + Order discount incl. Tax + + + Order discount incl. Tax + + + non taxable + + + non taxable + + + Amount + + + Amount + + + Amount incl. Tax + + + Amount incl. Tax + + + Order total to pay + + + Edit the total amount to pay for this order. + + + Earned reward points base amount incl. Tax + + + Edit earned reward points base amount incl. Tax + + + Earned reward points base amount excl. Tax + + + Edit earned reward points base amount excl. Tax + + + + + + + + + Order discount incl. Tax + + + Order discount incl. Tax + + + non taxable: + + + Order discount incl. Tax + + + Earned reward points base amount incl. Tax + + + Earned reward points base amount excl. Tax + + + Edit Invoice data. + + + Save Invoice Data. + + + A new InvoiceId get''s assigned when saving an Id = null + + + Included Tax + + + Amount + + + Amount incl. Tax + + + Invoice No. + + + Invoice Date + + + + + + Tax % + + + Amount + + + Amount incl. Tax + + + Discount + + + Discount incl. tax + + + Base Amount + + + + + + Tax Amount + + + You haven''t written any reviews yet + + + Last used Invoice No. + + + Invoice ID counter. This is useful if you want your invoices to start from certain number. This only affects invoices henceforward. The value must be greater than the current maximum invoice ID. Please note: Activate the task manually in System/Schedule tasks. + + + Year of last invoice + + + Year of last invoice. If actual year is different from this setting, then InvoiceIdent starts from one. + + + Force entering email twice during registration. + + + Sets a maximum number of products per vendor. + + + Shipping methods used by offline shipping rate computation methods (e.g. "Fixed Rate Shipping" or "Shipping by weight"). + + + The price of the product. You can manage currency by selecting Configuration > Currencies. + + + Choose customer roles of this user. + + + Check if products should be exported/imported with product attributes. + + + Check to display "ship to the same address" option during checkout ("billing address" step). In this case "shipping address" with appropriate options (e.g. pick up in store) will be skipped. Also note that all billing countries should support shipping ("Allow shipping" checkbox ticked). + + + Task period should not exceed 24 days. + + + Payment restrictions + + + Choose a vendor associated with this product. This can be useful when running a multi-vendor store to keep track of goods associated with vendor. + + + You can download a CSV file with a list of states for other countries on the following page: + + + Enter tags ... + + + [None] + + + Hide shipping total if shipping not required + + + Check if you want Hide ''Shipping total'' label if shipping not required. + + + + + + + + + + + + + + + + + + + + + Client ID + + + Specify client ID. + + + Client secret + + + Specify secret key. + + + Webhook ID + + + Specify webhook ID. + + + Get webhook ID + + + Webhook was not created (see details in the log) + + + [None] + + + Default tax category + + + Select default tax category for products. + + + Added a new address attribute (ID = {0}) + + + Added a new address attribute value (ID = {0}) + + + Added a new affiliate (ID = {0}) + + + Added a new blog post (ID = {0}) + + + Added a new campaign (ID = {0}) + + + Added a new country (ID = {0}) + + + Added a new currency (ID = {0}) + + + Added a new customer attribute (ID = {0}) + + + Added a new customer attribute value (ID = {0}) + + + Added a new email account (ID = {0}) + + + Added a new language (ID = {0}) + + + Added a new measure dimension (ID = {0}) + + + Added a new measure weight (ID = {0}) + + + Added a new news (ID = {0}) + + + Installed a new plugin (FriendlyName: ''{0}'') + + + Added a new state province (ID = {0}) + + + Added a new store (ID = {0}) + + + Added a new vendor (ID = {0}) + + + Added a new warehouse (ID = {0}) + + + Deleted an address attribute (ID = {0}) + + + Deleted an address attribute value (ID = {0}) + + + Deleted an affiliate (ID = {0}) + + + Deleted a blog post (ID = {0}) + + + Deleted a blog post comment (ID = {0}) + + + Deleted a campaign (ID = {0}) + + + Deleted a country (ID = {0}) + + + Deleted a currency (ID = {0}) + + + Deleted a customer attribute (ID = {0}) + + + Deleted a customer attribute value (ID = {0}) + + + Deleted an email account (ID = {0}) + + + Deleted a language (ID = {0}) + + + Deleted a measure dimension (ID = {0}) + + + Deleted a measure weight (ID = {0}) + + + Deleted a message template (ID = {0}) + + + Deleted a news (ID = {0}) + + + Deleted a news comment (ID = {0}) + + + Uninstalled a plugin (FriendlyName: ''{0}'') + + + Deleted a product revie (ID = {0}) + + + Deleted a state or province (ID = {0}) + + + Deleted a store (ID = {0}) + + + Deleted a vendor (ID = {0}) + + + Deleted a warehouse (ID = {0}) + + + Edited an address attribute (ID = {0}) + + + Edited an address attribute value (ID = {0}) + + + Edited an affiliate (ID = {0}) + + + Edited a blog post (ID = {0}) + + + Edited a campaign (ID = {0}) + + + Edited a country (ID = {0}) + + + Edited a currency (ID = {0}) + + + Edited a customer attribute (ID = {0}) + + + Edited a customer attribute value (ID = {0}) + + + Edited an email account (ID = {0}) + + + Edited a language (ID = {0}) + + + Edited a measure dimension (ID = {0}) + + + Edited a measure weight (ID = {0}) + + + Edited a message template (ID = {0}) + + + Edited a news (ID = {0}) + + + Edited a plugin (FriendlyName: ''{0}'') + + + Edited a product revie (ID = {0}) + + + Edited a state or province (ID = {0}) + + + Edited a store (ID = {0}) + + + Edited a task (ID = {0}) + + + Edited a vendor (ID = {0}) + + + Edited a warehouse (ID = {0}) + + + Product review possible only after purchasing product + + + Check if product can be reviewed only by customer who have already ordered it. + + + Product can be reviewed only after purchasing it + + + + + + You can use ECB (European central bank) exchange rate provider only when the primary exchange rate currency is supported by ECB + + + Attached static file + + + The attached static file that will be sent in this email. + + + Contract ID + + + Specify contract identifier. + + + Product review possible only after product purchasing + + + Page size should be positive. + + + Page size should be positive. + + + Page size should be positive. + + + Enter tags ... + + + + + + + + + Show SKU on catalog pages + + + Check to show product SKU on catalog pages in public store. + + + Show SKU on product details page + + + Check to show product SKU on the product details page in public store. + + + + + + + + + Customer enters quantity + + + Allow customers enter the quantity of associated product. + + + - quantity {0} + + + {0} [{1}{2}] + + + per item + + + Enter quantity: + + + Email account + + + The email account that will be used to send this campaign. + + + Limited to customer roles + + + Choose one or several customer roles i.e. administrators, vendors, guests, who will be able to use this plugin. If you don''t need this option just leave this field empty. + + + Activate points immediately + + + Activates bonus points immediately after their calculation + + + Reward points activation + + + Specify how many days (hours) must elapse before earned points become active. Points earned by purchase cannot be redeemed until activated. For example, you may set the days before the points become available to 7. In this case, the points earned will be available for spending 7 days after the order gets chosen awarded status. + + + The points will be activated on {0} + + + Days + + + Hours + + + The points will be activated on {0} + + + Your current balance + + + Total + + + Amount + + + Specify if earned reward points are taxable + + + If Earned reward points are taxable, then OrderAmount and tax will be reduced (like discounts do). Otherwise payment amount is reduced like with gift cards. + + + Include shipping + + + Specify if shipping amount should be included in reward points calculation. + + + Include payment method fee + + + Specify if payment method additional fee should be included in reward points calculation. + + + Exclude gift card(s) + + + Specify if gift cards should be excluded in reward points calculation. This setting allows to earn reward points, although order was paid or partially paid with giftcards. + + + Exclude purchased reward points + + + Specify if purchased points should be excluded in reward points calculation. This setting allows to earn reward points, although order total is reduced or zero. + + + Earn points only when using purchased points + + + Specify if reward points can only be earned when using purchased reward points for payment. With this earning of reward points is connected to the use of purchased points. + + + Is reward point(s) + + + If this field is checked, reward points can be pruchased. + + + Overridden reward points exchange rate + + + Use this field to override reward points exchange rate setting when converting product price to reward points (points = [overridden exchange rate] * price). If not specified, then reward points exchange rate will be used. + + + Reward point(s) + + + Reward points + + + Sorry, this discount cannot be used with reward points products in the cart + + + {0} purchased reward points: + + + Purchased with order #{0} + + + Purchased and earned with order #{0} + + + {0} used reward points + + + {0} used purchased reward points + + + {0} used reward points + + + {0} used purchased reward points + + + Redeemed reward points + + + Redeemed reward points. + + + Redeemed reward points amount + + + Redeemed reward points amount. + + + Redeemed reward points purchased + + + Redeemed purchased reward points. + + + Redeemed reward points amount purchased + + + Redeemed purchased reward points amount. + + + Purchased value + + + Indicate if added reward points are purchased points. Negative values are also supported. + + + Points balance purchased + + + Points Purchased + + + Points purchased + + + Points balance purchased + + + Add customer reward points (points = {0}, purchased points = {1}) + + + Edited customer reward points (ID = {0}) + + + Exclude from reward points + + + If this field is checked, product will be excluded from reward points calculation. + + + At least one published currency is required + + + The customer cannot be in both ''Guests'' and ''Registered'' customer roles + + + Add the customer to ''Guests'' or ''Registered'' customer role + + + Valid Email is required for customer to be in ''Registered'' role + + + A non-admin user cannot impersonate as an administrator + + + At least one published language is required + + + This order item has an associated gift card record. Please delete it first + + + Order item is deleted + + + Captcha is enabled but the appropriate keys are not entered + + + The message template has been copied successfully + + + The product has been copied successfully + + + Entered page name already exists, so it will be replaced by ''{0}'' + + + Choose a delivery date which will be displayed in the public store. You can manage delivery dates by selecting Configuration > Shipping > Dates and ranges. + + + Product availability range + + + Choose the product availability range that indicates when the product is expected to be available when out of stock (e.g. Available in 10-14 days). You can manage availability ranges by selecting Configuration > Shipping > Dates and ranges. + + + None + + + Product availability range + + + Dates and ranges + + + List of delivery dates which will be available for choice in product details. + + + Product availability ranges + + + The new product availability range has been added successfully. + + + Add a new product availability range + + + back to product availability range list + + + The product availability range has been deleted successfully. + + + Edit product availability range details + + + Display order + + + The display order of this product availability range. 1 represents the top of the list. + + + Name + + + Enter product availability range name. + + + Please provide a name. + + + List of availability ranges which will be available for choice in product details. + + + The product availability range has been updated successfully. + + + Available in {0} + + + Out of stock - on backorder and will be dispatched once in stock ({0}). + + + Please note that this product is excluded from the reward points program. No points will be earned. + + + Available in {0} + + + {0} point(s) + + + You will earn (based on {0}) + + + (when using purchased points) + + + Pay by cheque or money order + + + Pay by credit / debit card + + + Pay by credit / debit card + + + You will be redirected to PayPal site to complete the payment + + + Pay by purchase order (PO) number + + + Your account already has been activated + + + Your password already has been changed. For changing it once more, you need to again recover the password. + + + Your subscription already has been deactivated. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + By Weight + + + Fixed Rate + + + Rate + + + Store + + + If an asterisk is selected, then this shipping rate will apply to all stores. + + + Warehouse + + + If an asterisk is selected, then this shipping rate will apply to all warehouses. + + + Country + + + If an asterisk is selected, then this shipping rate will apply to all customers, regardless of the country. + + + State / province + + + If an asterisk is selected, then this shipping rate will apply to all customers from the given country, regardless of the state. + + + Zip + + + Zip / postal code. If zip is empty, then this shipping rate will apply to all customers from the given country or state, regardless of the zip code. + + + Shipping method + + + Choose shipping method + + + Order weight from + + + Order weight from. + + + Order weight to + + + Order weight to. + + + Additional fixed cost + + + Specify an additional fixed cost per shopping cart for this option. Set to 0 if you don''t want an additional fixed cost to be applied. + + + Lower weight limit + + + Lower weight limit. This field can be used for \"per extra weight unit\" scenarios. + + + Charge percentage (of subtotal) + + + Charge percentage (of subtotal). + + + Rate per weight unit + + + Rate per weight unit. + + + Limit shipping methods to configured ones + + + If you check this option, then your customers will be limited to shipping options configured here. Otherwise, they''ll be able to choose any existing shipping options even they''ve not configured here (zero shipping fee in this case). + + + Data + + + Add record + + + Formula to calculate rates + + + [additional fixed cost] + ([order total weight] - [lower weight limit]) * [rate per weight unit] + [order subtotal] * [charge percentage] + + + Allow vendors to import products + + + Check if vendors are allowed to import products. + + + You save: {0} + + + Discounted qty: {0} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add new tier price + + + Edit tier price details + + + Select customer role for which the tier price will be available. + + + End date + + + The end date of the tier price in Coordinated Universal Time (UTC). + + + Specify the price. + + + Specify quantity for which this tier price will be available. + + + Start date + + + The start date of the tier price in Coordinated Universal Time (UTC). + + + Option to limit this tier price to a certain store. If you have multiple stores, choose one from the list. + + + Deactivate gift cards after deleting of an order + + + Check to deactivate related gift cards when an order is deleted. + + + Complete order when delivered + + + Check if an order status should be set to "Complete" only when its shipping status is "Delivered". Otherwise, "Shipped" status will be enough. + + + order #{1}]]> + + + Edited a news comment (ID = {0}) + + + News comments must be approved + + + Check if news comments must be approved by administrator. + + + Is approved + + + News comment is successfully added. You will see it after approving by a store administrator. + + + Edited a blog comment (ID = {0}) + + + Blog comments must be approved + + + Check if blog comments must be approved by administrator. + + + Is approved + + + Blog comment is successfully added. You will see it after approving by a store administrator. + + + Stock quantity history + + + Here you can see a history of the product stock quantity changes. + + + Attribute combination + + + Created On + + + Message + + + Stock quantity + + + Quantity adjustment + + + Warehouse + + + Stock quantity history + + + The stock quantity has been increased by canceling the order #{0} + + + The stock quantity of combination has been edited + + + The stock quantity has been edited by copying the product #{0} + + + The stock quantity has been increased by deleting the order #{0} + + + The stock quantity has been increased by deleting an order item from the order #{0} + + + The stock quantity has been increased by deleting a shipment from the order #{0} + + + The stock quantity has been edited + + + Multiple warehouses. + + + The stock quantity has been changed by editing the order #{0} + + + The stock quantity has been changed by importing product + + + Products have been moved {0} {1} by importing product + + + Products have been moved {0} {1} + + + to the {0} + + + from the {0} + + + The stock quantity has been reduced by placing the order #{0} + + + The stock quantity has been reduced when an order item of the order #{0} was shipped + + + {0} - copy + + + {0}-copy + + + + + + + + + + + + + + + + + + + + + Deactivate gift cards after cancelling of an order + + + Check to deactivate related gift cards when an order is cancelled. + + + Activate gift cards after completing of an order + + + Check to activate related gift cards when an order is completed. + + + + + + + + + + + + + + + + + + + + + + + + + + + Do not forget to restart the application once a task has been modified. + + + + + + - or - + + + Choose an associated product + + + Store + + + Load products only from a specific store (available in this store). + + + Vendor + + + Load products only by a specific vendor (owned by this vendor). + + + Category + + + Load products only from a specific category. + + + Manufacturer + + + Load products only from a specific manufacturer. + + + Carts shared between storest + + + Determines whether shopping carts (and wishlist) are shared between stores (in multi-store environment). + + + Email validation + + + Your email already has been validated + + + Your email has been validated + + + Email validation + + + Email validation + + + New email + + + (not validated yet) + + + Shipping methods used by offline shipping providers. For example, "Manual (Fixed or By Weight)". + + + Ignored product type IDs (advanced) + + + Allow file uploads + + + Check if you want to allow customers to upload files when submitting return requests. + + + Upload (any additional document, scan, etc) + + + Uploaded file: + + + Download + + + Uploaded file + + + File uploaded by customer + + + Download + + + Reply text + + + The reply text (by a store owner). If specified, then it''ll be visible to a customer. Leave empty to ignore this functionality. + + + A manager responded to this review + + + Blog comments per store + + + Check to display blog comments written in the current store only. + + + News comments per store + + + Check to display news comments written in the current store only. + + + Store name + + + Store name + + + The associated product has attributes, keep in mind that customers can not select them in the product details page. + + + The associated product has required product attributes, so customers won''t be able to choose this product attribute value. + + + The associated product is downloadable, keep in mind that won''t be able to download it. + + + The associated product is a gift card, keep in mind that customers can not specify its details in the product details page. + + + All + + + {0} - {1} of {2} items + + + No items to display + + + Go to the first page + + + items per page + + + Go to the last page + + + More pages + + + Go to the next page + + + of {0} + + + Page + + + Go to the previous page + + + Refresh + + + Address (optional) + + + Maximum login failures + + + Maximum login failures to lockout account. Set 0 to disable this feature. + + + Lockout time (login failures) + + + Enter number of minutes to lockout users (for login failures). + + + Customer is locked out + + + Imported manufacturers are distinguished by ID. If the ID already exists, then its corresponding manufacturer will be updated. You should not specify ID (leave 0) for new manufacturers. + + + Imported categories are distinguished by ID. If the ID already exists, then its corresponding category will be updated. You should not specify ID (leave 0) for new categories. + + + For conditional expressions use the token %if (your conditions ) ... endif% + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fixed rate + + + By Country + + + Tax category + + + Rate + + + Store + + + If an asterisk is selected, then this shipping rate will apply to all stores. + + + Country + + + The country. + + + State / province + + + If an asterisk is selected, then this tax rate will apply to all customers from the given country, regardless of the state. + + + Zip + + + Zip / postal code. If zip is empty, then this tax rate will apply to all customers from the given country or state, regardless of the zip code. + + + Tax category + + + The tax category. + + + Percentage + + + The tax rate. + + + Add tax rate + + + New tax rate + + + ID + + + Search by a specific return request identifier. + + + End date + + + The end date for the search. + + + Return status + + + All + + + Search by a specific return request status e.g. Received. + + + Start date + + + The start date for the search. + + + + Product attributes are quantifiable or descriptive aspects of a product (such as, color). For example, if you were to create an attribute for color, with the values of blue, green, yellow, and so on, you may want to apply this attribute to shirts, which you sell in various colors (you can adjust a price or weight for any of existing attribute values). + You can add attribute for your product using existing list of attributes, or if you need to create a new one go to Catalog > Attributes > Product attributes. Please notice that if you want to manage inventory by product attributes (e.g. 5 green shirts and 3 blue ones), then ensure that "Inventory method" is set to "Track inventory by product attributes". + + + + Approve selected + + + Approve selected + + + Disapprove selected + + + Disapprove selected + + + Registered in the store + + + Indicating in which store the customer is registered + + + Consider associated products dimensions and weight + + + Check to consider associated products dimensions and weight on shipping, uncheck for example if the main product already includes them. + + + Created from + + + The creation from date for the search. + + + Created to + + + The creation to date for the search. + + + Message + + + Search in title and comment text. + + + Created from + + + The creation from date for the search. + + + Created to + + + The creation to date for the search. + + + Message + + + Search in comment text. + + + Retry last payment + + + Last payment failed + + + Approved + + + Search by a "Approved" property. + + + All + + + Approved only + + + Disapproved only + + + Approved + + + Search by a "Approved" property. + + + All + + + Approved only + + + Disapproved only + + + Approved + + + Search by a "Approved" property. + + + All + + + Approved only + + + Disapproved only + + + It looks like you have "ShoppingCartSettings.RoundPricesDuringCalculation" setting disabled. Keep in mind that this can lead to a discrepancy of the order total amount, as PayPal only rounds to two decimals. + + + + + + + + + + + + + + + + + + + + + Order ID + + + Order # + + + Order # + + + Order ID + + + Order # + + + Order ID + + + Order # + + + Order # + + + The unique number of this order. + + + Reward points base + + + Earned reward points base amount + + + Earned reward points base amount incl. Tax + + + Earned reward points base amount excl. Tax + + + Created order ID + + + Created order + + + Order ID + + + Order # + + + Order ID + + + Order # + + + The order associated to this shipment. + + + Order number mask + + + Order number mask, for creating custom order number. For example, RE-{YYYY}-{MM}. Leave this field empty if you don''t want to use custom order numbers. + + + {DD} - day of order creation date + + + {ID} -Order identifier + + + {MM} - month of order creation date + + + {YYYY} - year of order creation date + + + {YY} - last two digits of year of order creation date + + + + + + + + + Order + + + The gift card was purchased with this order. + + + Order + + + The gift card was purchased with this order. + + + Edited an order (Order number = {0}). See order notes for details + + + View order (Order number - {0}) + + + The unique number of the order. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pass purchased items + + + Check to pass information about purchased items to PayPal. + + + Unduplicated passwords number + + + Specify the number of customer passwords that mustn''t be the same as the previous one, enter 0 if the customer can use the same password time after time. + + + You entered the password that is the same as one of the last passwords you used. Please create a new password. + + + Your password has expired, please create a new one + + + Password lifetime + + + Specify number of days for password expiration. Don''t forget to check "EnablePasswordLifetime" property on customer role edit page for those roles, who will have to change passwords. + + + Enable password lifetime + + + Check to force customers to change their passwords after a specified time. + + + ID + + + ID + + + + + + + + + This order is cancelled + + + Notify about new blog comments in Configuration - Settings - Blog settings.]]> + + + Allow back in stock subscriptions in Product info tab - Inventory section.]]> + + + This message template is used when a customer changes an email address in his account. The customer receives a message to confirm an email address used when changing email address. + + + This message template is used the option Email notification from Registration method dropdown list in Configuration - Settings - Customer settings is selected. The customer receives a message to confirm an email address used when registering. + + + This message template is used when the customer gets a notification about a new order being placed from this account. + + + Show alert for PM in Configuration - Settings - Forum settings.]]> + + + This message template is used when a customer forgets a password needed to log in the account. The customer receives a message with a link for entering a new password. + + + This message template is used to welcome a new customer after registration. + + + This message template is used when a new forum post in certain forum topic is created. The message is received by a store owner. + + + This message template is used when a new forum topic is created. The message is received by a store owner. + + + This message template is used to send a notification to a customer about getting a gift card. + + + Notify about new customer registration in Configuration - Settings - Customer settings.]]> + + + This message template is used to notify a customer about a new return request submitted from his/her account. + + + This message template is used when a new return request is created. The message is received by a store owner. + + + Notify about new news comments in Configuration - Settings - News settings.]]> + + + This message template is used when a customer subscribes to the newsletter to confirm the subscription. + + + Newsletter box. Allow to unsubscribe in Configuration - Settings - Customer settings.]]> + + + Notify admin when a new VAT number is submitted in Configuration - Settings - Tax settings.]]> + + + This message template is used to notify a customer that the certain order was canceled. The order can ba canceled by a customer on the account page or by store owner in Customers - Customers in Orders tab or in Sales - Orders. + + + This message template is used to notify a customer that the certain order was completed. The order gets the order status Complete when it''s paid and delivered, or it can be changed manually to Complete in Sales - Orders. + + + This message template is used to notify a customer that the certain order was paid. The order gets the payment status Paid when the amount was charged, or it can be changed manually Sales - Orders by clicking Mark as paid button in Payment status. + + + This message template is used to notify a store owner that the certain order was paid. The order gets the status Paid when the amount was charged, or it can be changed manually Sales - Orders by clicking Mark as paid button in Payment status. + + + This message template is used to notify a vendor that the certain order was paid. The order gets the status Paid when the amount was charged. + + + This message template is used to notify a customer that the certain order was placed. Orders can be viewed by a customer on the account page. + + + This message template is used to notify a store owner that the certain order was placed. Orders can be viewed by a store owner in Sales - Orders or in Customers menu. + + + This message template is used to notify a vendor that the certain order was placed. Orders can be viewed by a vendor in Sales - Orders. You can allow them to access this part of Admin Area in Configuration - Access control list. + + + This message template is used to notify a customer that the certain order was refunded. The customer can submit to refund the order when the payment status is paid on the account page, or it can be done by a store owner in Sales - Orders by clicking "Refund" button. + + + This message template is used to notify a store owner that the certain order was refunded. The customer can submit to refund the order when the payment status is paid on the account page, or it can be done by a store owner in Sales - Orders by clicking "Refund" button. + + + Notify about new product reviews in Configuration - Settings - Catalog settings.]]> + + + This message template is used to notify a store owner that the certain product attribute combination is getting low stock. You can set up the combination minimum quantity when creating or editing the product in Product attribute tab - Attributes combinations tab in Notify admin for quantity below field. + + + Minimum stock qty field.]]> + + + This message template is used to notify a customer that the certain recurring payment is canceled. Payment can be canceled by a customer in the account page or by a store owner in Sales - Recurring payments in History tab by clicking "Cancel recurring payment" button. + + + This message template is used to notify a store owner that the certain recurring payment is canceled. Payment can be canceled by a customer in the account page or by a store owner in Sales - Recurring payments in History tab by clicking "Cancel recurring payment" button. + + + This message template is used to notify a customer that the certain recurring payment is failed. For example, the amount can''t be charged from the provided credit card. + + + This message template is used to notify a customer that the request status to the certain order is changed. You can set up this option in Sales - Return requests by clicking "Notify customer about status change" button. + + + This message template is used to notify a store owner about a message sent through the contact form. + + + This message template is used to notify a vendor about a message sent through the contact form. + + + This message template is used to send "email a friend" message. + + + Display shipment events (customers).]]> + + + Display shipment events (customers).]]> + + + Allow customers to apply for vendor account.]]> + + + Allow vendors to edit info.]]> + + + This message template is used when a customer wants to share some product from the wishlist with a friend by sending an email. You can set up this option by ticking the checkbox Allow customers to email their wishlists in Configuration - Settings - Shopping cart settings. + + + Tax based on pickup point address + + + A value indicating whether to use pickup point address (when pickup point is chosen) for tax calculation. + + + It seems that you use Redis server for caching, keep in mind that enabling this setting create a lot of traffic between the Redis server and the application because of the large number of locales. + + + Export orders with products + + + Check if orders should be exported with products. + + + Requirement group is a useful feature for creating discount requirement templates. You can create a requirement group just once and then use it every time you want this limitation to be applied. You can include one requirement group into another one if needed.]]> + + + Add requirement group + + + You can choose one of the following requirement types, or add a requirement group to use several requirement types simultaneously. + + + Group name + + + Specify name of the requirement group (e.g. "Permitted customer roles"). + + + Add to group + + + Choose the group you want the requirement group you’re creating to be assigned to + + + Group + + + AND + + + OR + + + + + + Requirement + + + Default requirement group + + + Interaction type in this group is + + + The group is empty + + + Remove requirement + + + Remove group + + + Blog comments + + + Common + + + Additional sections + + + Catalog pages + + + Compare products + + + Export/Import + + + Performance + + + Product fields + + + Product page + + + Product sorting + + + Product reviews + + + Search + + + Share + + + Tax + + + Tags + + + Account + + + Common + + + Default fields + + + External authentication + + + Password and security + + + Profile + + + Time zone + + + Common + + + Feeds + + + Page sizes + + + Permissions + + + Full-Text + + + CAPTCHA + + + Common + + + Localization + + + Pdf + + + Security + + + SEO + + + Sitemap + + + Social media + + + Common + + + Other pages + + + Product + + + News comments + + + Common + + + Checkout + + + Common + + + Gift cards + + + Order totals + + + Pdf invoice + + + Common + + + Checkout + + + Common + + + Notifications + + + Common + + + Mini shopping cart + + + Wishlist + + + Common + + + Payment + + + Shipping + + + Tax dispaying + + + VAT + + + Catalog + + + Common + + + In order to use this functionality you have to disable the following setting: Configuration > Catalog settings > Ignore discounts (sitewide). + + +
    • At least two unique product identifiers are required. So each of your product shouldhave manufacturer (brand) and MPN (manufacturer part number) specified
    • Specify default tax values in your Google Merchant Center account settings
    • Specify default shipping values in your Google Merchant Center account settings
    • In order to get more info about required fields look at the following article http://www.google.com/support/merchants/bin/answer.py?answer=188494

    ]]>
    +
    + + You can download the list of allowed Google product category attributes here

    ]]>
    +
    + + If you''re using this gateway ensure that your primary store currency is supported by Paypal.

    To configure plugin follow these steps:
    1. Log into your Developer PayPal account (click here to create your account).
    2. Click on My Apps & Credentials from the Dashboard.
    3. Create new REST API app.
    4. Copy your Client ID and Secret key below.
    5. To be able to use recurring payments you need to set the webhook ID. You can get it manually in your PayPal account (enter the URL https://www.yourStore.com/Plugins/PaymentPayPalDirect/Webhook below REST API application credentials), or automatically by pressing "@T("Plugins.Payments.PayPalDirect.WebhookCreate")" button (not visible when running the site locally).

    ]]>
    +
    + + If you''re using this gateway ensure that your primary store currency is supported by Paypal.

    To use PDT, you must activate PDT and Auto Return in your PayPal account profile. You must also acquire a PDT identity token, which is used in all PDT communication you send to PayPal. Follow these steps to configure your account for PDT:

    1. Log in to your PayPal account (click here to create your account).
    2. Click the Profile subtab.
    3. Click Website Payment Preferences in the Seller Preferences column.
    4. Under Auto Return for Website Payments, click the On radio button.
    5. For the Return URL, enter the URL on your site that will receive the transaction ID posted by PayPal after a customer payment (http://www.yourStore.com/Plugins/PaymentPayPalStandard/PDTHandler).
    6. Under Payment Data Transfer, click the On radio button.
    7. Click Save.
    8. Click Website Payment Preferences in the Seller Preferences column.
    9. Scroll down to the Payment Data Transfer section of the page to view your PDT identity token.

    Two ways to be able to receive IPN messages (optional):

    The first way is to check ''Enable IPN'' below. It will include in the request the url of you IPN handler

    The second way is to confugure your paypal account to activate this service; follow these steps:
    1. Log in to your Premier or Business account.
    2. Click the Profile subtab.
    3. Click Instant Payment Notification in the Selling Preferences column.
    4. Click the ''Edit IPN Settings'' button to update your settings.
    5. Select ''Receive IPN messages'' (Enabled) and enter the URL of your IPN handler (http://www.yourStore.com/Plugins/PaymentPayPalStandard/IPNHandler).
    6. Click Save, and you should get a message that you have successfully activated IPN.

    ]]>
    +
    + + To configure plugin follow one of these steps:
    1. If you are a Canada Post commercial customer, fill Customer number, Contract ID and API key below.
    2. If you are a Solutions for Small Business customer, specify your Customer number and API key below.
    3. If you are a non-contracted customer or you want to use the regular price of shipping paid by customers, fill the API key field only.

    Note: Canada Post gateway returns shipping price in the CAD currency, ensure that you have correctly configured exchange rate from PrimaryStoreCurrency to CAD.

    ]]>
    +
    + + Google Analytics is a free website stats tool from Google. It keeps track of statisticsabout the visitors and ecommerce conversion on your website.

    Follow the next steps to enable Google Analytics integration:
    • Create a Google Analyticsaccount and follow the wizard to add your website
    • Copy the Tracking ID into the ''ID'' box below
    • Click the ''Save'' button below and Google Analytics will be integrated into your store

    If you would like to switch between Google Analytics (used by default) and Universal Analytics, then please use the buttons below:

    ]]>
    +
    + + Please note that {ECOMMERCE} line works only when you have "Disable order completed page" order setting unticked.

    ]]>
    +
    + + Here you can find third-party extensions and themes which are developed by our community and partners.They are also available in our marketplace

    ]]>
    +
    + + A CAPTCHA is a program that can tell whether its user is a human or a computer.You''ve probably seen them — colorful images with distorted text at the bottom ofWeb registration forms. CAPTCHAs are used by many websites to prevent abuse from"bots," or automated programs usually written to generate spam. No computer programcan read distorted text as well as humans can, so bots cannot navigate sites protectedby CAPTCHAs. nopCommerce uses reCAPTCHA.

    ]]>
    +
    + + You can download more nopCommerce plugins in our marketplace

    ]]>
    +
    + + Edit values + + + Edit condition + + + Edit rules + + + {0} categories were imported + + + {0} manufacturers were imported + + + {0} products were imported + + + {0} states and provinces were imported + + + Add to wishlist + + + Update + + + + + + Store + + + Search by a specific store. + + + Rounding type + + + The rounding type. + + + Default rounding + + + Rounding up with 0.05 intervals (0.06 round to 0.10) + + + Rounding down with 0.05 intervals (0.06 round to 0.05) + + + Rounding up with 0.10 intervals (1.05 round to 1.10) + + + Rounding down with 0.10 intervals (1.05 round to 1.00) + + + Rounding with 0.50 intervals + + + Rounding with 1.00 intervals (1.01-1.49 round to 1.00, 1.50-1.99 round to 2.00) + + + Rounding up with 1.00 intervals (1.01–1.99 round to 2.00) + + + Picture zoom + + + Check to enable picture zoom on product details page. + + + Display "Blog" + + + Check if "Blog" menu item should be displayed in the top menu. + + + Display "Forums" + + + Check if "Forums" menu item should be displayed in the top menu. + + + Display "Contact us" + + + Check if "Contact us" menu item should be displayed in the top menu. + + + Display "My account" + + + Check if "My account" menu item should be displayed in the top menu. + + + Display "Home page" + + + Check if "Home page" menu item should be displayed in the top menu. + + + Display "New products" + + + Check if "New products" menu item should be displayed in the top menu. + + + Display "Search" + + + Check if "Search" menu item should be displayed in the top menu. + + + Top menu items + +
    +' + +CREATE TABLE #LocaleStringResourceTmp + ( + [ResourceName] [nvarchar](200) NOT NULL, + [ResourceValue] [nvarchar](max) NOT NULL + ) + +INSERT INTO #LocaleStringResourceTmp (ResourceName, ResourceValue) +SELECT nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') +FROM @resources.nodes('//Language/LocaleResource') AS R(nref) + +--do it for each existing language +DECLARE @ExistingLanguageId int +DECLARE cur_existinglanguage CURSOR FOR +SELECT [Id] +FROM [Language] +OPEN cur_existinglanguage +FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageId +WHILE @@FETCH_STATUS = 0 +BEGIN + DECLARE @ResourceName nvarchar(200) + DECLARE @ResourceValue nvarchar(MAX) + DECLARE cur_localeresource CURSOR FOR + SELECT ResourceName, ResourceValue + FROM #LocaleStringResourceTmp + OPEN cur_localeresource + FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue + WHILE @@FETCH_STATUS = 0 + BEGIN + IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName)) + BEGIN + UPDATE [LocaleStringResource] + SET [ResourceValue]=@ResourceValue + WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName + END + ELSE + BEGIN + INSERT INTO [LocaleStringResource] + ( + [LanguageId], + [ResourceName], + [ResourceValue] + ) + VALUES + ( + @ExistingLanguageId, + @ResourceName, + @ResourceValue + ) + END + + IF (@ResourceValue is null or @ResourceValue = '') + BEGIN + DELETE [LocaleStringResource] + WHERE LanguageId=@ExistingLanguageId AND ResourceName=@ResourceName + END + + FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue + END + CLOSE cur_localeresource + DEALLOCATE cur_localeresource + + --fetch next language identifier + FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageId +END +CLOSE cur_existinglanguage +DEALLOCATE cur_existinglanguage + +DROP TABLE #LocaleStringResourceTmp +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.invoiceident') + BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.invoiceident', 0, 0) + END +GO + +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.invoiceyear') + BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.invoiceyear', 2016, 0) + END +GO +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shippingsettings.hideshippingtotal') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'shippingsettings.hideshippingtotal', N'False', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'taxsettings.defaulttaxcategoryid') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'taxsettings.defaulttaxcategoryid', N'0', 0) +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAddressAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewAddressAttribute', N'Add a new address attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAffiliate') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewAffiliate', N'Add a new affiliate', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewBlogPost') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewBlogPost', N'Add a new blog post', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCampaign') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewCampaign', N'Add a new campaign', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCountry') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewCountry', N'Add a new country', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCurrency') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewCurrency', N'Add a new currency', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCustomerAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewCustomerAttribute', N'Add a new customer attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewCustomerAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewCustomerAttributeValue', N'Add a new customer attribute value', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewEmailAccount') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewEmailAccount', N'Add a new email account', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewLanguage') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewLanguage', N'Add a new language', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewMeasureDimension') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewMeasureDimension', N'Add a new measure dimension', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewMeasureWeight') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewMeasureWeight', N'Add a new measure weight', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewNews') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewNews', N'Add a new news', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'InstallNewPlugin') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'InstallNewPlugin', N'Install a new plugin', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewStateProvince') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewStateProvince', N'Add a new state or province', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewStore') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewStore', N'Add a new store', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewVendor') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewVendor', N'Add a new vendor', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewWarehouse') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewWarehouse', N'Add a new warehouse', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAddressAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteAddressAttribute', N'Delete an address attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAffiliate') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteAffiliate', N'Delete an affiliate', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteBlogPost') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteBlogPost', N'Delete a blog post', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCampaign') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteCampaign', N'Delete a campaign', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCountry') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteCountry', N'Delete a country', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCurrency') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteCurrency', N'Delete a currency', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCustomerAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteCustomerAttribute', N'Delete a customer attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteCustomerAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteCustomerAttributeValue', N'Delete a customer attribute value', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteEmailAccount') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteEmailAccount', N'Delete an email account', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteLanguage') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteLanguage', N'Delete a language', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMeasureDimension') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteMeasureDimension', N'Delete a measure dimension', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMeasureWeight') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteMeasureWeight', N'Delete a measure weight', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteMessageTemplate') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteMessageTemplate', N'Delete a message template', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteNews') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteNews', N'Delete a news', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'UninstallPlugin') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'UninstallPlugin', N'Uninstall a plugin', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteProductReview') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteProductReview', N'Delete a product review', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteStateProvince') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteStateProvince', N'Delete a state or province', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteStore') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteStore', N'Delete a store', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteVendor') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteVendor', N'Delete a vendor', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteWarehouse') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteWarehouse', N'Delete a warehouse', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAddressAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditAddressAttribute', N'Edit an address attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAffiliate') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditAffiliate', N'Edit an affiliate', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditBlogPost') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditBlogPost', N'Edit a blog post', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCampaign') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCampaign', N'Edit a campaign', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCountry') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCountry', N'Edit a country', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCurrency') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCurrency', N'Edit a currency', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCustomerAttribute') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCustomerAttribute', N'Edit a customer attribute', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCustomerAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCustomerAttributeValue', N'Edit a customer attribute value', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditEmailAccount') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditEmailAccount', N'Edit an email account', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditLanguage') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditLanguage', N'Edit a language', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMeasureDimension') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditMeasureDimension', N'Edit a measure dimension', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMeasureWeight') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditMeasureWeight', N'Edit a measure weight', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditMessageTemplate') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditMessageTemplate', N'Edit a message template', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditNews') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditNews', N'Edit a news', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditPlugin') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditPlugin', N'Edit a plugin', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditProductReview') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditProductReview', N'Edit a product review', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditStateProvince') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditStateProvince', N'Edit a state or province', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditStore') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditStore', N'Edit a store', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditTask') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditTask', N'Edit a task', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditVendor') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditVendor', N'Edit a vendor', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditWarehouse') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditWarehouse', N'Edit a warehouse', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteBlogPostComment') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteBlogPostComment', N'Delete a blog post comment', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteNewsComment') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteNewsComment', N'Delete a news comment', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddNewAddressAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddNewAddressAttributeValue', N'Add a new address attribute value', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditAddressAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditAddressAttributeValue', N'Edit an address attribute value', N'true') +END +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'DeleteAddressAttributeValue') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'DeleteAddressAttributeValue', N'Delete an address attribute value', N'true') +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.productreviewpossibleonlyafterpurchasing') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'catalogsettings.productreviewpossibleonlyafterpurchasing', N'False', 0) +END +GO + + --new setting + IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.exportimportusedropdownlistsforassociatedentities') + BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'catalogsettings.exportimportusedropdownlistsforassociatedentities', N'True', 0) + END + GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.showskuoncatalogpages') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'catalogsettings.showskuoncatalogpages', N'False', 0) +END +GO + +--rename settings +UPDATE [Setting] +SET [Name] = N'catalogsettings.showskuonproductdetailspage' +WHERE [Name] = N'catalogsettings.showproductsku' +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductAttributeValue]') and NAME='CustomerEntersQty') +BEGIN + ALTER TABLE [ProductAttributeValue] + ADD [CustomerEntersQty] bit NULL +END +GO + +UPDATE [ProductAttributeValue] +SET [CustomerEntersQty] = 0 +WHERE [CustomerEntersQty] IS NULL +GO + +ALTER TABLE [ProductAttributeValue] ALTER COLUMN [CustomerEntersQty] bit NOT NULL +GO + +--new or update setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shoppingcartsettings.renderassociatedattributevaluequantity') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'shoppingcartsettings.renderassociatedattributevaluequantity', N'True', 0); +END +ELSE +BEGIN + UPDATE [Setting] + SET [Value] = N'True' + WHERE [Name] = N'shoppingcartsettings.renderassociatedattributevaluequantity' +END +GO + +--update column +ALTER TABLE [RewardPointsHistory] ALTER COLUMN [PointsBalance] int NULL +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'rewardpointssettings.activationdelay') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'rewardpointssettings.activationdelay', N'0', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'rewardpointssettings.activationdelayperiodid') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'rewardpointssettings.activationdelayperiodid', N'0', 0) +END +GO + + +--new discount coupon code logic +DELETE FROM [GenericAttribute] +WHERE [KeyGroup] = 'Customer' and [Key] = 'DiscountCouponCode' +GO + +--new table +IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[ProductAvailabilityRange]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) +BEGIN + CREATE TABLE [dbo].[ProductAvailabilityRange]( + [Id] [int] IDENTITY(1,1) NOT NULL, + [Name] nvarchar(400) NOT NULL, + [DisplayOrder] int NOT NULL, + PRIMARY KEY CLUSTERED + ( + [Id] ASC + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ) +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='ProductAvailabilityRangeId') +BEGIN + ALTER TABLE [Product] + ADD [ProductAvailabilityRangeId] int NULL +END +GO + +UPDATE [Product] +SET [ProductAvailabilityRangeId] = 0 +WHERE [ProductAvailabilityRangeId] IS NULL +GO + +ALTER TABLE [Product] ALTER COLUMN [ProductAvailabilityRangeId] int NOT NULL +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.showpaymentmethoddescriptions') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'paymentsettings.showpaymentmethoddescriptions', N'True', 0) +END +GO + + +--ensure that dbo is added to existing stored procedures +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[FullText_IsSupported]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [FullText_IsSupported] +GO +CREATE PROCEDURE [dbo].[FullText_IsSupported] +AS +BEGIN + EXEC(' + SELECT CASE SERVERPROPERTY(''IsFullTextInstalled'') + WHEN 1 THEN + CASE DatabaseProperty (DB_NAME(DB_ID()), ''IsFulltextEnabled'') + WHEN 1 THEN 1 + ELSE 0 + END + ELSE 0 + END') +END +GO + + +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[FullText_Enable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [FullText_Enable] +GO +CREATE PROCEDURE [dbo].[FullText_Enable] +AS +BEGIN + --create catalog + EXEC(' + IF NOT EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'') + CREATE FULLTEXT CATALOG [nopCommerceFullTextCatalog] AS DEFAULT') + + --create indexes + DECLARE @create_index_text nvarchar(4000) + SET @create_index_text = ' + IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]'')) + CREATE FULLTEXT INDEX ON [Product]([Name], [ShortDescription], [FullDescription]) + KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('Product') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' + EXEC(@create_index_text) + + SET @create_index_text = ' + IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]'')) + CREATE FULLTEXT INDEX ON [LocalizedProperty]([LocaleValue]) + KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('LocalizedProperty') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' + EXEC(@create_index_text) + + SET @create_index_text = ' + IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]'')) + CREATE FULLTEXT INDEX ON [ProductTag]([Name]) + KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('ProductTag') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO' + EXEC(@create_index_text) +END +GO + + + +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[FullText_Disable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [FullText_Disable] +GO +CREATE PROCEDURE [dbo].[FullText_Disable] +AS +BEGIN + EXEC(' + --drop indexes + IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]'')) + DROP FULLTEXT INDEX ON [Product] + ') + + EXEC(' + IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]'')) + DROP FULLTEXT INDEX ON [LocalizedProperty] + ') + + EXEC(' + IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]'')) + DROP FULLTEXT INDEX ON [ProductTag] + ') + + --drop catalog + EXEC(' + IF EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'') + DROP FULLTEXT CATALOG [nopCommerceFullTextCatalog] + ') +END +GO + + + + +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[LanguagePackImport]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [LanguagePackImport] +GO +CREATE PROCEDURE [dbo].[LanguagePackImport] +( + @LanguageId int, + @XmlPackage xml +) +AS +BEGIN + IF EXISTS(SELECT * FROM [Language] WHERE [Id] = @LanguageId) + BEGIN + CREATE TABLE #LocaleStringResourceTmp + ( + [LanguageId] [int] NOT NULL, + [ResourceName] [nvarchar](200) NOT NULL, + [ResourceValue] [nvarchar](MAX) NOT NULL + ) + + INSERT INTO #LocaleStringResourceTmp (LanguageID, ResourceName, ResourceValue) + SELECT @LanguageId, nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') + FROM @XmlPackage.nodes('//Language/LocaleResource') AS R(nref) + + DECLARE @ResourceName nvarchar(200) + DECLARE @ResourceValue nvarchar(MAX) + DECLARE cur_localeresource CURSOR FOR + SELECT LanguageID, ResourceName, ResourceValue + FROM #LocaleStringResourceTmp + OPEN cur_localeresource + FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue + WHILE @@FETCH_STATUS = 0 + BEGIN + IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageID=@LanguageId AND ResourceName=@ResourceName)) + BEGIN + UPDATE [LocaleStringResource] + SET [ResourceValue]=@ResourceValue + WHERE LanguageID=@LanguageId AND ResourceName=@ResourceName + END + ELSE + BEGIN + INSERT INTO [LocaleStringResource] + ( + [LanguageId], + [ResourceName], + [ResourceValue] + ) + VALUES + ( + @LanguageId, + @ResourceName, + @ResourceValue + ) + END + + + FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue + END + CLOSE cur_localeresource + DEALLOCATE cur_localeresource + + DROP TABLE #LocaleStringResourceTmp + END +END + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'fixedorbyweightsettings.shippingbyweightenabled') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'fixedorbyweightsettings.shippingbyweightenabled', N'False', 0) +END +GO + +--rename settings +UPDATE [Setting] +SET [Name] = N'fixedorbyweightsettings.limitmethodstocreated' +WHERE [Name] = N'shippingbyweightsettings.limitmethodstocreated' +GO + +--rename settings +UPDATE [Setting] +SET [Name] = N'shippingratecomputationmethod.fixedorbyweight.rate.shippingmethodid' + SUBSTRING(name, 62, len(name)) +WHERE [Name] like N'shippingratecomputationmethod.fixedrate.rate.shippingmethodid%' +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'vendorsettings.allowvendorstoimportproducts') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'vendorsettings.allowvendorstoimportproducts', N'True', 0) +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='StartDateTimeUtc') +BEGIN + ALTER TABLE [TierPrice] + ADD [StartDateTimeUtc] datetime NULL +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='EndDateTimeUtc') +BEGIN + ALTER TABLE [TierPrice] + ADD [EndDateTimeUtc] datetime NULL +END +GO + +--add a tier prices instead of product special prices +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPrice') +BEGIN + EXEC(' + INSERT INTO [dbo].[TierPrice]([ProductId], [StoreId], [CustomerRoleId], [Quantity], [Price], [StartDateTimeUtc], [EndDateTimeUtc]) + SELECT [Id], 0, NULL, 1, [SpecialPrice], [SpecialPriceStartDateTimeUtc], [SpecialPriceEndDateTimeUtc] + FROM [dbo].[Product] + WHERE [SpecialPrice] <> 0') +END +GO + +UPDATE [Product] +SET [HasTierPrices] = 1 +WHERE [Id] IN (SELECT [ProductId] FROM [dbo].[TierPrice]) +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPrice') +BEGIN + ALTER TABLE [Product] DROP COLUMN [SpecialPrice] +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPriceStartDateTimeUtc') +BEGIN + ALTER TABLE [Product] DROP COLUMN [SpecialPriceStartDateTimeUtc] +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='SpecialPriceEndDateTimeUtc') +BEGIN + ALTER TABLE [Product] DROP COLUMN [SpecialPriceEndDateTimeUtc] +END +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'producteditordettings.specialprice' +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'producteditordettings.specialpricestartdate' +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'producteditordettings.specialpriceenddate' +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='StartDateTimeUtc') +BEGIN + ALTER TABLE [TierPrice] + ADD [StartDateTimeUtc] datetime NULL +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[TierPrice]') and NAME='EndDateTimeUtc') +BEGIN + ALTER TABLE [TierPrice] + ADD [EndDateTimeUtc] datetime NULL +END +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[OrderItem]') and NAME='VatRate') + EXEC sp_rename 'OrderItem.VatRate', 'TaxRate', 'COLUMN' +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[OrderItem]') and NAME='TaxRate') +BEGIN + ALTER TABLE [OrderItem] + ADD [TaxRate] decimal(18,4) NULL +END +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[OrderItem]') and NAME='TaxRate') +BEGIN + + UPDATE OrderItem + SET [TaxRate] = 0 + WHERE ([TaxRate] IS NULL) AND (PriceInclTax = PriceExclTax) + + UPDATE OrderItem + SET [TaxRate] = round((PriceInclTax / PriceExclTax - 1) * 100, 2) + WHERE ([TaxRate] IS NULL) AND PriceExclTax <> 0 + + ALTER TABLE [OrderItem] + ALTER COLUMN [TaxRate] DECIMAL(18,4) NOT NULL +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='InvoiceId') +BEGIN + ALTER TABLE [dbo].[Order] + ADD InvoiceId NVARCHAR(20) NULL; +END + +GO +DROP INDEX IF EXISTS [UI_Order_InvoiceId] ON [dbo].[Order] +GO + +IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Order]') AND name = N'UI_Order_InvoiceId') +BEGIN + CREATE UNIQUE NONCLUSTERED INDEX UI_Order_InvoiceId + ON dbo.[Order](InvoiceId, StoreId) + WHERE InvoiceId IS NOT NULL; +END +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='InvoiceDateUtc') +BEGIN + ALTER TABLE [dbo].[Order] + ADD InvoiceDateUtc DATETIME NULL; +END + +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderAmount') +BEGIN + ALTER TABLE [dbo].[Order] + ADD OrderAmount DECIMAL(18,4) NULL; +END + +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderAmount') +BEGIN + + UPDATE [dbo].[Order] + SET [OrderAmount] = OrderSubtotalExclTax - ISNULL(OrderSubTotalDiscountExclTax, 0) + ISNULL(OrderShippingExclTax, 0) + ISNULL(PaymentMethodAdditionalFeeExclTax, 0) - ISNULL(OrderDiscount, 0) + WHERE CustomerTaxDisplayTypeId = 10 AND OrderSubtotalExclTax IS NOT NULL + + UPDATE [dbo].[Order] + SET [OrderAmount] = OrderSubtotalInclTax - ISNULL(OrderSubTotalDiscountInclTax, 0) + ISNULL(OrderShippingInclTax, 0) + ISNULL(PaymentMethodAdditionalFeeInclTax, 0) - ISNULL(OrderDiscount, 0) - ISNULL(OrderTax, 0) + WHERE CustomerTaxDisplayTypeId = 0 AND OrderSubtotalInclTax IS NOT NULL +END + +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderAmountIncl') +BEGIN + ALTER TABLE [dbo].[Order] + ADD OrderAmountIncl DECIMAL(18,4) NULL; +END + +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderAmountIncl') +BEGIN + + UPDATE [dbo].[Order] + SET [OrderAmountIncl] = OrderSubtotalExclTax - ISNULL(OrderSubTotalDiscountExclTax, 0) + ISNULL(OrderShippingExclTax, 0) + ISNULL(PaymentMethodAdditionalFeeExclTax, 0) - ISNULL(OrderDiscount, 0) + ISNULL(OrderTax, 0) + WHERE CustomerTaxDisplayTypeId = 10 AND OrderSubtotalExclTax IS NOT NULL + + UPDATE [dbo].[Order] + SET [OrderAmountIncl] = OrderSubtotalInclTax - ISNULL(OrderSubTotalDiscountInclTax, 0) + ISNULL(OrderShippingInclTax, 0) + ISNULL(PaymentMethodAdditionalFeeInclTax, 0) - ISNULL(OrderDiscount, 0) + WHERE CustomerTaxDisplayTypeId = 0 AND OrderSubtotalExclTax IS NOT NULL +END + +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderDiscountIncl') +BEGIN + ALTER TABLE [dbo].[Order] + ADD OrderDiscountIncl DECIMAL(18,4) NULL; +END +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderDiscountIncl') + UPDATE [dbo].[Order] + SET [OrderDiscount] = OrderSubtotalExclTax - ISNULL(OrderSubTotalDiscountExclTax, 0) + ISNULL(OrderShippingExclTax, 0) + ISNULL(PaymentMethodAdditionalFeeExclTax, 0) + ISNULL(OrderTax, 0), + [OrderDiscountIncl] = [OrderDiscount] + WHERE CustomerTaxDisplayTypeId = 10 + + UPDATE [dbo].[Order] + SET + [OrderDiscountIncl] = OrderSubtotalInclTax - ISNULL(OrderSubTotalDiscountInclTax, 0) + ISNULL(OrderShippingInclTax, 0) + ISNULL(PaymentMethodAdditionalFeeInclTax, 0) + WHERE CustomerTaxDisplayTypeId = 0 +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderDiscountIncl') +ALTER TABLE [Order] ALTER COLUMN OrderDiscountIncl DECIMAL(18,4) NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderShippingNonTaxable') +BEGIN + ALTER TABLE [dbo].[Order] + ADD OrderShippingNonTaxable DECIMAL(18,4) NULL; +END +GO + +--init +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderShippingNonTaxable') + UPDATE [dbo].[Order] + SET OrderShippingNonTaxable = 0 + where OrderShippingNonTaxable is Null + /*update old orders? like. Will not work for taxempted customers + [OrderShippingNonTax] = OrderShippingExclTax, + OrderShippingExclTax = 0, + OrderShippingInclTax = 0 + WHERE OrderShippingExclTax = OrderShippingInclTax */ +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='OrderShippingNonTaxable') +ALTER TABLE [Order] ALTER COLUMN OrderShippingNonTaxable DECIMAL(18,4) NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='PaymentMethodAdditionalFeeNonTaxable') +BEGIN + ALTER TABLE [dbo].[Order] + ADD PaymentMethodAdditionalFeeNonTaxable DECIMAL(18,4) NULL; +END +GO + +--init +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='PaymentMethodAdditionalFeeNonTaxable') + UPDATE [dbo].[Order] + SET [PaymentMethodAdditionalFeeNonTaxable] = 0 + where [PaymentMethodAdditionalFeeNonTaxable] is Null + /*update old orders? like. Will not work for taxempted customers + [PaymentMethodAdditionalFeeNonTaxable] = PaymentMethodAdditionalFeeInclTax, + PaymentMethodAdditionalFeeExclTax = 0, + PaymentMethodAdditionalFeeInclTax = 0 + WHERE PaymentMethodAdditionalFeeInclTax = PaymentMethodAdditionalFeeExclTax */ +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='PaymentMethodAdditionalFeeNonTaxable') +ALTER TABLE [Order] ALTER COLUMN PaymentMethodAdditionalFeeNonTaxable DECIMAL(18,4) NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountIncl') +BEGIN + ALTER TABLE [dbo].[Order] + ADD EarnedRewardPointsBaseAmountIncl DECIMAL(18,4) NULL; +END +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountIncl') +UPDATE [dbo].[Order] + SET EarnedRewardPointsBaseAmountIncl = 0 + WHERE EarnedRewardPointsBaseAmountIncl IS NULL +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountIncl') +ALTER TABLE [Order] ALTER COLUMN EarnedRewardPointsBaseAmountIncl DECIMAL(18,4) NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountExcl') +BEGIN + ALTER TABLE [dbo].[Order] + ADD EarnedRewardPointsBaseAmountExcl DECIMAL(18,4) NULL; +END +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountExcl') +UPDATE [dbo].[Order] + SET EarnedRewardPointsBaseAmountExcl = 0 + WHERE EarnedRewardPointsBaseAmountExcl IS NULL +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='EarnedRewardPointsBaseAmountExcl') +ALTER TABLE [Order] ALTER COLUMN EarnedRewardPointsBaseAmountExcl DECIMAL(18,4) NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsTaxable') +BEGIN + ALTER TABLE [dbo].[Order] + ADD RewardPointsTaxable bit NULL; +END +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsTaxable') +UPDATE [dbo].[Order] + SET RewardPointsTaxable = 0 + WHERE RewardPointsTaxable IS NULL +GO +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsTaxable') +ALTER TABLE [Order] ALTER COLUMN RewardPointsTaxable bit NOT NULL +GO +--a stored procedure update +IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[ProductLoadAllPaged]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [ProductLoadAllPaged] +GO +CREATE PROCEDURE [dbo].[ProductLoadAllPaged] +( + @CategoryIds nvarchar(MAX) = null, --a list of category IDs (comma-separated list). e.g. 1,2,3 + @ManufacturerId int = 0, + @StoreId int = 0, + @VendorId int = 0, + @WarehouseId int = 0, + @ProductTypeId int = null, --product type identifier, null - load all products + @VisibleIndividuallyOnly bit = 0, --0 - load all products , 1 - "visible indivially" only + @MarkedAsNewOnly bit = 0, --0 - load all products , 1 - "marked as new" only + @ProductTagId int = 0, + @FeaturedProducts bit = null, --0 featured only , 1 not featured only, null - load all products + @PriceMin decimal(18, 4) = null, + @PriceMax decimal(18, 4) = null, + @Keywords nvarchar(4000) = null, + @SearchDescriptions bit = 0, --a value indicating whether to search by a specified "keyword" in product descriptions + @SearchManufacturerPartNumber bit = 0, -- a value indicating whether to search by a specified "keyword" in manufacturer part number + @SearchSku bit = 0, --a value indicating whether to search by a specified "keyword" in product SKU + @SearchProductTags bit = 0, --a value indicating whether to search by a specified "keyword" in product tags + @UseFullTextSearch bit = 0, + @FullTextMode int = 0, --0 - using CONTAINS with , 5 - using CONTAINS and OR with , 10 - using CONTAINS and AND with + @FilteredSpecs nvarchar(MAX) = null, --filter by specification attribute options (comma-separated list of IDs). e.g. 14,15,16 + @LanguageId int = 0, + @OrderBy int = 0, --0 - position, 5 - Name: A to Z, 6 - Name: Z to A, 10 - Price: Low to High, 11 - Price: High to Low, 15 - creation date + @AllowedCustomerRoleIds nvarchar(MAX) = null, --a list of customer role IDs (comma-separated list) for which a product should be shown (if a subjet to ACL) + @PageIndex int = 0, + @PageSize int = 2147483644, + @ShowHidden bit = 0, + @OverridePublished bit = null, --null - process "Published" property according to "showHidden" parameter, true - load only "Published" products, false - load only "Unpublished" products + @LoadFilterableSpecificationAttributeOptionIds bit = 0, --a value indicating whether we should load the specification attribute option identifiers applied to loaded products (all pages) + @FilterableSpecificationAttributeOptionIds nvarchar(MAX) = null OUTPUT, --the specification attribute option identifiers applied to loaded products (all pages). returned as a comma separated list of identifiers + @TotalRecords int = null OUTPUT +) +AS +BEGIN + + /* Products that filtered by keywords */ + CREATE TABLE #KeywordProducts + ( + [ProductId] int NOT NULL + ) + + DECLARE + @SearchKeywords bit, + @OriginalKeywords nvarchar(4000), + @sql nvarchar(max), + @sql_orderby nvarchar(max) + + SET NOCOUNT ON + + --filter by keywords + SET @Keywords = isnull(@Keywords, '') + SET @Keywords = rtrim(ltrim(@Keywords)) + SET @OriginalKeywords = @Keywords + IF ISNULL(@Keywords, '') != '' + BEGIN + SET @SearchKeywords = 1 + + IF @UseFullTextSearch = 1 + BEGIN + --remove wrong chars (' ") + SET @Keywords = REPLACE(@Keywords, '''', '') + SET @Keywords = REPLACE(@Keywords, '"', '') + + --full-text search + IF @FullTextMode = 0 + BEGIN + --0 - using CONTAINS with + SET @Keywords = ' "' + @Keywords + '*" ' + END + ELSE + BEGIN + --5 - using CONTAINS and OR with + --10 - using CONTAINS and AND with + + --clean multiple spaces + WHILE CHARINDEX(' ', @Keywords) > 0 + SET @Keywords = REPLACE(@Keywords, ' ', ' ') + + DECLARE @concat_term nvarchar(100) + IF @FullTextMode = 5 --5 - using CONTAINS and OR with + BEGIN + SET @concat_term = 'OR' + END + IF @FullTextMode = 10 --10 - using CONTAINS and AND with + BEGIN + SET @concat_term = 'AND' + END + + --now let's build search string + declare @fulltext_keywords nvarchar(4000) + set @fulltext_keywords = N'' + declare @index int + + set @index = CHARINDEX(' ', @Keywords, 0) + + -- if index = 0, then only one field was passed + IF(@index = 0) + set @fulltext_keywords = ' "' + @Keywords + '*" ' + ELSE + BEGIN + DECLARE @first BIT + SET @first = 1 + WHILE @index > 0 + BEGIN + IF (@first = 0) + SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' ' + ELSE + SET @first = 0 + + SET @fulltext_keywords = @fulltext_keywords + '"' + SUBSTRING(@Keywords, 1, @index - 1) + '*"' + SET @Keywords = SUBSTRING(@Keywords, @index + 1, LEN(@Keywords) - @index) + SET @index = CHARINDEX(' ', @Keywords, 0) + end + + -- add the last field + IF LEN(@fulltext_keywords) > 0 + SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' ' + '"' + SUBSTRING(@Keywords, 1, LEN(@Keywords)) + '*"' + END + SET @Keywords = @fulltext_keywords + END + END + ELSE + BEGIN + --usual search by PATINDEX + SET @Keywords = '%' + @Keywords + '%' + END + --PRINT @Keywords + + --product name + SET @sql = ' + INSERT INTO #KeywordProducts ([ProductId]) + SELECT p.Id + FROM Product p with (NOLOCK) + WHERE ' + IF @UseFullTextSearch = 1 + SET @sql = @sql + 'CONTAINS(p.[Name], @Keywords) ' + ELSE + SET @sql = @sql + 'PATINDEX(@Keywords, p.[Name]) > 0 ' + + + --localized product name + SET @sql = @sql + ' + UNION + SELECT lp.EntityId + FROM LocalizedProperty lp with (NOLOCK) + WHERE + lp.LocaleKeyGroup = N''Product'' + AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' + AND lp.LocaleKey = N''Name''' + IF @UseFullTextSearch = 1 + SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' + ELSE + SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' + + + IF @SearchDescriptions = 1 + BEGIN + --product short description + SET @sql = @sql + ' + UNION + SELECT p.Id + FROM Product p with (NOLOCK) + WHERE ' + IF @UseFullTextSearch = 1 + SET @sql = @sql + 'CONTAINS(p.[ShortDescription], @Keywords) ' + ELSE + SET @sql = @sql + 'PATINDEX(@Keywords, p.[ShortDescription]) > 0 ' + + + --product full description + SET @sql = @sql + ' + UNION + SELECT p.Id + FROM Product p with (NOLOCK) + WHERE ' + IF @UseFullTextSearch = 1 + SET @sql = @sql + 'CONTAINS(p.[FullDescription], @Keywords) ' + ELSE + SET @sql = @sql + 'PATINDEX(@Keywords, p.[FullDescription]) > 0 ' + + + + --localized product short description + SET @sql = @sql + ' + UNION + SELECT lp.EntityId + FROM LocalizedProperty lp with (NOLOCK) + WHERE + lp.LocaleKeyGroup = N''Product'' + AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' + AND lp.LocaleKey = N''ShortDescription''' + IF @UseFullTextSearch = 1 + SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' + ELSE + SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' + + + --localized product full description + SET @sql = @sql + ' + UNION + SELECT lp.EntityId + FROM LocalizedProperty lp with (NOLOCK) + WHERE + lp.LocaleKeyGroup = N''Product'' + AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' + AND lp.LocaleKey = N''FullDescription''' + IF @UseFullTextSearch = 1 + SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) ' + ELSE + SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 ' + END + + --manufacturer part number (exact match) + IF @SearchManufacturerPartNumber = 1 + BEGIN + SET @sql = @sql + ' + UNION + SELECT p.Id + FROM Product p with (NOLOCK) + WHERE p.[ManufacturerPartNumber] = @OriginalKeywords ' + END + + --SKU (exact match) + IF @SearchSku = 1 + BEGIN + SET @sql = @sql + ' + UNION + SELECT p.Id + FROM Product p with (NOLOCK) + WHERE p.[Sku] = @OriginalKeywords ' + END + + IF @SearchProductTags = 1 + BEGIN + --product tags (exact match) + SET @sql = @sql + ' + UNION + SELECT pptm.Product_Id + FROM Product_ProductTag_Mapping pptm with(NOLOCK) INNER JOIN ProductTag pt with(NOLOCK) ON pt.Id = pptm.ProductTag_Id + WHERE pt.[Name] = @OriginalKeywords ' + + --localized product tags + SET @sql = @sql + ' + UNION + SELECT pptm.Product_Id + FROM LocalizedProperty lp with (NOLOCK) INNER JOIN Product_ProductTag_Mapping pptm with(NOLOCK) ON lp.EntityId = pptm.ProductTag_Id + WHERE + lp.LocaleKeyGroup = N''ProductTag'' + AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + ' + AND lp.LocaleKey = N''Name'' + AND lp.[LocaleValue] = @OriginalKeywords ' + END + + --PRINT (@sql) + EXEC sp_executesql @sql, N'@Keywords nvarchar(4000), @OriginalKeywords nvarchar(4000)', @Keywords, @OriginalKeywords + + END + ELSE + BEGIN + SET @SearchKeywords = 0 + END + + --filter by category IDs + SET @CategoryIds = isnull(@CategoryIds, '') + CREATE TABLE #FilteredCategoryIds + ( + CategoryId int not null + ) + INSERT INTO #FilteredCategoryIds (CategoryId) + SELECT CAST(data as int) FROM [nop_splitstring_to_table](@CategoryIds, ',') + DECLARE @CategoryIdsCount int + SET @CategoryIdsCount = (SELECT COUNT(1) FROM #FilteredCategoryIds) + + --filter by customer role IDs (access control list) + SET @AllowedCustomerRoleIds = isnull(@AllowedCustomerRoleIds, '') + CREATE TABLE #FilteredCustomerRoleIds + ( + CustomerRoleId int not null + ) + INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId) + SELECT CAST(data as int) FROM [nop_splitstring_to_table](@AllowedCustomerRoleIds, ',') + DECLARE @FilteredCustomerRoleIdsCount int + SET @FilteredCustomerRoleIdsCount = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds) + + --paging + DECLARE @PageLowerBound int + DECLARE @PageUpperBound int + DECLARE @RowsToReturn int + SET @RowsToReturn = @PageSize * (@PageIndex + 1) + SET @PageLowerBound = @PageSize * @PageIndex + SET @PageUpperBound = @PageLowerBound + @PageSize + 1 + + CREATE TABLE #DisplayOrderTmp + ( + [Id] int IDENTITY (1, 1) NOT NULL, + [ProductId] int NOT NULL + ) + + SET @sql = ' + SELECT p.Id + FROM + Product p with (NOLOCK)' + + IF @CategoryIdsCount > 0 + BEGIN + SET @sql = @sql + ' + LEFT JOIN Product_Category_Mapping pcm with (NOLOCK) + ON p.Id = pcm.ProductId' + END + + IF @ManufacturerId > 0 + BEGIN + SET @sql = @sql + ' + LEFT JOIN Product_Manufacturer_Mapping pmm with (NOLOCK) + ON p.Id = pmm.ProductId' + END + + IF ISNULL(@ProductTagId, 0) != 0 + BEGIN + SET @sql = @sql + ' + LEFT JOIN Product_ProductTag_Mapping pptm with (NOLOCK) + ON p.Id = pptm.Product_Id' + END + + --searching by keywords + IF @SearchKeywords = 1 + BEGIN + SET @sql = @sql + ' + JOIN #KeywordProducts kp + ON p.Id = kp.ProductId' + END + + SET @sql = @sql + ' + WHERE + p.Deleted = 0' + + --filter by category + IF @CategoryIdsCount > 0 + BEGIN + SET @sql = @sql + ' + AND pcm.CategoryId IN (SELECT CategoryId FROM #FilteredCategoryIds)' + + IF @FeaturedProducts IS NOT NULL + BEGIN + SET @sql = @sql + ' + AND pcm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max)) + END + END + + --filter by manufacturer + IF @ManufacturerId > 0 + BEGIN + SET @sql = @sql + ' + AND pmm.ManufacturerId = ' + CAST(@ManufacturerId AS nvarchar(max)) + + IF @FeaturedProducts IS NOT NULL + BEGIN + SET @sql = @sql + ' + AND pmm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max)) + END + END + + --filter by vendor + IF @VendorId > 0 + BEGIN + SET @sql = @sql + ' + AND p.VendorId = ' + CAST(@VendorId AS nvarchar(max)) + END + + --filter by warehouse + IF @WarehouseId > 0 + BEGIN + --we should also ensure that 'ManageInventoryMethodId' is set to 'ManageStock' (1) + --but we skip it in order to prevent hard-coded values (e.g. 1) and for better performance + SET @sql = @sql + ' + AND + ( + (p.UseMultipleWarehouses = 0 AND + p.WarehouseId = ' + CAST(@WarehouseId AS nvarchar(max)) + ') + OR + (p.UseMultipleWarehouses > 0 AND + EXISTS (SELECT 1 FROM ProductWarehouseInventory [pwi] + WHERE [pwi].WarehouseId = ' + CAST(@WarehouseId AS nvarchar(max)) + ' AND [pwi].ProductId = p.Id)) + )' + END + + --filter by product type + IF @ProductTypeId is not null + BEGIN + SET @sql = @sql + ' + AND p.ProductTypeId = ' + CAST(@ProductTypeId AS nvarchar(max)) + END + + --filter by "visible individually" + IF @VisibleIndividuallyOnly = 1 + BEGIN + SET @sql = @sql + ' + AND p.VisibleIndividually = 1' + END + + --filter by "marked as new" + IF @MarkedAsNewOnly = 1 + BEGIN + SET @sql = @sql + ' + AND p.MarkAsNew = 1 + AND (getutcdate() BETWEEN ISNULL(p.MarkAsNewStartDateTimeUtc, ''1/1/1900'') and ISNULL(p.MarkAsNewEndDateTimeUtc, ''1/1/2999''))' + END + + --filter by product tag + IF ISNULL(@ProductTagId, 0) != 0 + BEGIN + SET @sql = @sql + ' + AND pptm.ProductTag_Id = ' + CAST(@ProductTagId AS nvarchar(max)) + END + + --"Published" property + IF (@OverridePublished is null) + BEGIN + --process according to "showHidden" + IF @ShowHidden = 0 + BEGIN + SET @sql = @sql + ' + AND p.Published = 1' + END + END + ELSE IF (@OverridePublished = 1) + BEGIN + --published only + SET @sql = @sql + ' + AND p.Published = 1' + END + ELSE IF (@OverridePublished = 0) + BEGIN + --unpublished only + SET @sql = @sql + ' + AND p.Published = 0' + END + + --show hidden + IF @ShowHidden = 0 + BEGIN + SET @sql = @sql + ' + AND p.Deleted = 0 + AND (getutcdate() BETWEEN ISNULL(p.AvailableStartDateTimeUtc, ''1/1/1900'') and ISNULL(p.AvailableEndDateTimeUtc, ''1/1/2999''))' + END + + --min price + IF @PriceMin is not null + BEGIN + SET @sql = @sql + ' + AND (p.Price >= ' + CAST(@PriceMin AS nvarchar(max)) + ')' + END + + --max price + IF @PriceMax is not null + BEGIN + SET @sql = @sql + ' + AND (p.Price <= ' + CAST(@PriceMax AS nvarchar(max)) + ')' + END + + --show hidden and ACL + IF @ShowHidden = 0 and @FilteredCustomerRoleIdsCount > 0 + BEGIN + SET @sql = @sql + ' + AND (p.SubjectToAcl = 0 OR EXISTS ( + SELECT 1 FROM #FilteredCustomerRoleIds [fcr] + WHERE + [fcr].CustomerRoleId IN ( + SELECT [acl].CustomerRoleId + FROM [AclRecord] acl with (NOLOCK) + WHERE [acl].EntityId = p.Id AND [acl].EntityName = ''Product'' + ) + ))' + END + + --filter by store + IF @StoreId > 0 + BEGIN + SET @sql = @sql + ' + AND (p.LimitedToStores = 0 OR EXISTS ( + SELECT 1 FROM [StoreMapping] sm with (NOLOCK) + WHERE [sm].EntityId = p.Id AND [sm].EntityName = ''Product'' and [sm].StoreId=' + CAST(@StoreId AS nvarchar(max)) + ' + ))' + END + + --prepare filterable specification attribute option identifier (if requested) + IF @LoadFilterableSpecificationAttributeOptionIds = 1 + BEGIN + CREATE TABLE #FilterableSpecs + ( + [SpecificationAttributeOptionId] int NOT NULL + ) + DECLARE @sql_filterableSpecs nvarchar(max) + SET @sql_filterableSpecs = ' + INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId]) + SELECT DISTINCT [psam].SpecificationAttributeOptionId + FROM [Product_SpecificationAttribute_Mapping] [psam] WITH (NOLOCK) + WHERE [psam].[AllowFiltering] = 1 + AND [psam].[ProductId] IN (' + @sql + ')' + + EXEC sp_executesql @sql_filterableSpecs + + --build comma separated list of filterable identifiers + SELECT @FilterableSpecificationAttributeOptionIds = COALESCE(@FilterableSpecificationAttributeOptionIds + ',' , '') + CAST(SpecificationAttributeOptionId as nvarchar(4000)) + FROM #FilterableSpecs + + DROP TABLE #FilterableSpecs + END + + --filter by specification attribution options + SET @FilteredSpecs = isnull(@FilteredSpecs, '') + CREATE TABLE #FilteredSpecs + ( + SpecificationAttributeOptionId int not null + ) + INSERT INTO #FilteredSpecs (SpecificationAttributeOptionId) + SELECT CAST(data as int) FROM [nop_splitstring_to_table](@FilteredSpecs, ',') + + CREATE TABLE #FilteredSpecsWithAttributes + ( + SpecificationAttributeId int not null, + SpecificationAttributeOptionId int not null + ) + INSERT INTO #FilteredSpecsWithAttributes (SpecificationAttributeId, SpecificationAttributeOptionId) + SELECT sao.SpecificationAttributeId, fs.SpecificationAttributeOptionId + FROM #FilteredSpecs fs INNER JOIN SpecificationAttributeOption sao ON sao.Id = fs.SpecificationAttributeOptionId + ORDER BY sao.SpecificationAttributeId + + DECLARE @SpecAttributesCount int + SET @SpecAttributesCount = (SELECT COUNT(1) FROM #FilteredSpecsWithAttributes) + IF @SpecAttributesCount > 0 + BEGIN + --do it for each specified specification option + DECLARE @SpecificationAttributeOptionId int + DECLARE @SpecificationAttributeId int + DECLARE @LastSpecificationAttributeId int + SET @LastSpecificationAttributeId = 0 + DECLARE cur_SpecificationAttributeOption CURSOR FOR + SELECT SpecificationAttributeId, SpecificationAttributeOptionId + FROM #FilteredSpecsWithAttributes + + OPEN cur_SpecificationAttributeOption + FOREACH: + FETCH NEXT FROM cur_SpecificationAttributeOption INTO @SpecificationAttributeId, @SpecificationAttributeOptionId + IF (@LastSpecificationAttributeId <> 0 AND @SpecificationAttributeId <> @LastSpecificationAttributeId OR @@FETCH_STATUS <> 0) + SET @sql = @sql + ' + AND p.Id in (select psam.ProductId from [Product_SpecificationAttribute_Mapping] psam with (NOLOCK) where psam.AllowFiltering = 1 and psam.SpecificationAttributeOptionId IN (SELECT SpecificationAttributeOptionId FROM #FilteredSpecsWithAttributes WHERE SpecificationAttributeId = ' + CAST(@LastSpecificationAttributeId AS nvarchar(max)) + '))' + SET @LastSpecificationAttributeId = @SpecificationAttributeId + IF @@FETCH_STATUS = 0 GOTO FOREACH + CLOSE cur_SpecificationAttributeOption + DEALLOCATE cur_SpecificationAttributeOption + END + + --sorting + SET @sql_orderby = '' + IF @OrderBy = 5 /* Name: A to Z */ + SET @sql_orderby = ' p.[Name] ASC' + ELSE IF @OrderBy = 6 /* Name: Z to A */ + SET @sql_orderby = ' p.[Name] DESC' + ELSE IF @OrderBy = 10 /* Price: Low to High */ + SET @sql_orderby = ' p.[Price] ASC' + ELSE IF @OrderBy = 11 /* Price: High to Low */ + SET @sql_orderby = ' p.[Price] DESC' + ELSE IF @OrderBy = 15 /* creation date */ + SET @sql_orderby = ' p.[CreatedOnUtc] DESC' + ELSE /* default sorting, 0 (position) */ + BEGIN + --category position (display order) + IF @CategoryIdsCount > 0 SET @sql_orderby = ' pcm.DisplayOrder ASC' + + --manufacturer position (display order) + IF @ManufacturerId > 0 + BEGIN + IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', ' + SET @sql_orderby = @sql_orderby + ' pmm.DisplayOrder ASC' + END + + --name + IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', ' + SET @sql_orderby = @sql_orderby + ' p.[Name] ASC' + END + + SET @sql = @sql + ' + ORDER BY' + @sql_orderby + + SET @sql = ' + INSERT INTO #DisplayOrderTmp ([ProductId])' + @sql + + --PRINT (@sql) + EXEC sp_executesql @sql + + DROP TABLE #FilteredCategoryIds + DROP TABLE #FilteredSpecs + DROP TABLE #FilteredSpecsWithAttributes + DROP TABLE #FilteredCustomerRoleIds + DROP TABLE #KeywordProducts + + CREATE TABLE #PageIndex + ( + [IndexId] int IDENTITY (1, 1) NOT NULL, + [ProductId] int NOT NULL + ) + INSERT INTO #PageIndex ([ProductId]) + SELECT ProductId + FROM #DisplayOrderTmp + GROUP BY ProductId + ORDER BY min([Id]) + + --total records + SET @TotalRecords = @@rowcount + + DROP TABLE #DisplayOrderTmp + + --return products + SELECT TOP (@RowsToReturn) + p.* + FROM + #PageIndex [pi] + INNER JOIN Product p with (NOLOCK) on p.Id = [pi].[ProductId] + WHERE + [pi].IndexId > @PageLowerBound AND + [pi].IndexId < @PageUpperBound + ORDER BY + [pi].IndexId + + DROP TABLE #PageIndex +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.deactivategiftcardsafterdeletingorder') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.deactivategiftcardsafterdeletingorder', N'False', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.completeorderwhendelivered') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.completeorderwhendelivered', N'True', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[NewsComment]') and NAME='IsApproved') +BEGIN + ALTER TABLE [NewsComment] + ADD [IsApproved] bit NULL +END +GO + +UPDATE [NewsComment] +SET [IsApproved] = 1 +WHERE [IsApproved] IS NULL +GO + +ALTER TABLE [NewsComment] ALTER COLUMN [IsApproved] bit NOT NULL +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditNewsComment') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditNewsComment', N'Edited a news comment', N'true') +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'newssettings.newscommentsmustbeapproved') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'newssettings.newscommentsmustbeapproved', N'False', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogComment]') and NAME='IsApproved') +BEGIN + ALTER TABLE [BlogComment] + ADD [IsApproved] bit NULL +END +GO + +UPDATE [BlogComment] +SET [IsApproved] = 1 +WHERE [IsApproved] IS NULL +GO + +ALTER TABLE [BlogComment] ALTER COLUMN [IsApproved] bit NOT NULL +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditBlogComment') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditBlogComment', N'Edited a blog comment', N'true') +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'blogsettings.blogcommentsmustbeapproved') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'blogsettings.blogcommentsmustbeapproved', N'False', 0) +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[News]') and NAME='CommentCount') +BEGIN + ALTER TABLE [News] DROP COLUMN [CommentCount] +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogPost]') and NAME='CommentCount') +BEGIN + ALTER TABLE [BlogPost] DROP COLUMN [CommentCount] +END +GO + +-- new message template + IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'NewReturnRequest.CustomerNotification') + BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'NewReturnRequest.CustomerNotification', NULL, N'%Store.Name%. New return request.', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%!' + @NewLine + '
    ' + @NewLine + 'You have just submitted a new return request. Details are below:' + @NewLine + '
    ' + @NewLine + 'Request ID: %ReturnRequest.CustomNumber%' + @NewLine + '
    ' + @NewLine + 'Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%' + @NewLine + '
    ' + @NewLine + 'Reason for return: %ReturnRequest.Reason%' + @NewLine + '
    ' + @NewLine + 'Requested action: %ReturnRequest.RequestedAction%' + @NewLine + '
    ' + @NewLine + 'Customer comments:' + @NewLine + '
    ' + @NewLine + '%ReturnRequest.CustomerComment%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) + END + GO + + --new table +IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StockQuantityHistory]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) +BEGIN + CREATE TABLE [dbo].[StockQuantityHistory] + ( + [Id] int IDENTITY(1,1) NOT NULL, + [ProductId] int NOT NULL, + [CombinationId] int NULL, + [WarehouseId] int NULL, + [QuantityAdjustment] int NOT NULL, + [StockQuantity] int NOT NULL, + [Message] NVARCHAR (MAX) NULL, + [CreatedOnUtc] datetime NOT NULL + PRIMARY KEY CLUSTERED + ( + [Id] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ) +END +GO + +IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'StockQuantityHistory_Product' AND parent_object_id = Object_id('StockQuantityHistory') AND Objectproperty(object_id, N'IsForeignKey') = 1) +BEGIN + ALTER TABLE [dbo].StockQuantityHistory + DROP CONSTRAINT StockQuantityHistory_Product +END +GO + +ALTER TABLE [dbo].[StockQuantityHistory] WITH CHECK ADD CONSTRAINT [StockQuantityHistory_Product] FOREIGN KEY([ProductId]) +REFERENCES [dbo].[Product] ([Id]) +ON DELETE CASCADE +GO + +--initial stock quantity history +DECLARE cur_initialhistory CURSOR FOR +SELECT [Product].Id, NULL, [Product].WarehouseId, [Product].StockQuantity, NULL +FROM [Product] +UNION ALL +SELECT [ProductAttributeCombination].ProductId, [ProductAttributeCombination].Id, NULL, [ProductAttributeCombination].StockQuantity, NULL +FROM [ProductAttributeCombination] +UNION ALL +SELECT [ProductWarehouseInventory].ProductId, NULL, [ProductWarehouseInventory].WarehouseId, [ProductWarehouseInventory].StockQuantity, [ProductWarehouseInventory].Id +FROM [ProductWarehouseInventory] + +DECLARE @productId int +DECLARE @combinationId int +DECLARE @warehouseId int +DECLARE @quantity int +DECLARE @warehouseInventoryId int + +OPEN cur_initialhistory +FETCH NEXT FROM cur_initialhistory INTO @productId, @combinationId, @warehouseId, @quantity, @warehouseInventoryId + +WHILE @@FETCH_STATUS = 0 +BEGIN + IF @warehouseId = 0 + BEGIN + SET @warehouseId = NULL; + END + + DECLARE @message nvarchar(200) + SET @message = 'Initialization of history table (original quantity set) during upgrade from a previous version' + IF @warehouseInventoryId IS NOT NULL + BEGIN + SET @message = 'Multiple warehouses. ' + @message; + END + + IF (@quantity IS NOT NULL AND @quantity <> 0 AND + NOT EXISTS (SELECT 1 FROM [StockQuantityHistory] WHERE ProductId = @productId AND + (CombinationId = @combinationId OR (CombinationId IS NULL AND @combinationId IS NULL)) AND (WarehouseId = @warehouseId OR (WarehouseId IS NULL AND @warehouseId IS NULL)))) + BEGIN + INSERT INTO [StockQuantityHistory] + ([ProductId], [CombinationId], [WarehouseId], [QuantityAdjustment], [StockQuantity], [Message], [CreatedOnUtc]) + VALUES + (@productId, @combinationId, @warehouseId, @quantity, @quantity, @message, GETUTCDATE()) + END + + FETCH NEXT FROM cur_initialhistory INTO @productId, @combinationId, @warehouseId, @quantity, @warehouseInventoryId +END + +CLOSE cur_initialhistory +DEALLOCATE cur_initialhistory +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'producteditorsettings.stockquantityhistory') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'producteditorsettings.stockquantityhistory', N'False', 0) +END +GO + + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='RequireReLogin') +BEGIN + ALTER TABLE [Customer] + ADD [RequireReLogin] bit NULL +END +GO + +UPDATE [Customer] +SET [RequireReLogin] = 0 +WHERE [RequireReLogin] IS NULL +GO + +ALTER TABLE [Customer] ALTER COLUMN [RequireReLogin] bit NOT NULL +GO + + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'rewardpointssettings.PointsForPurchases_Awarded' +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'rewardpointssettings.PointsForPurchases_Canceled' +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'ordersettings.GiftCards_Activated_OrderStatusId' +GO + +--delete setting +DELETE FROM [Setting] +WHERE [name] = N'ordersettings.GiftCards_Deactivated_OrderStatusId' +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.activategiftcardsaftercompletingorder') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.activategiftcardsaftercompletingorder', N'False', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.deactivategiftcardsaftercancellingorder') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.deactivategiftcardsaftercancellingorder', N'False', 0) +END +GO + + +--update a stored procedure +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[LanguagePackImport]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [LanguagePackImport] +GO +CREATE PROCEDURE [dbo].[LanguagePackImport] +( + @LanguageId int, + @XmlPackage xml, + @UpdateExistingResources bit +) +AS +BEGIN + IF EXISTS(SELECT * FROM [Language] WHERE [Id] = @LanguageId) + BEGIN + CREATE TABLE #LocaleStringResourceTmp + ( + [LanguageId] [int] NOT NULL, + [ResourceName] [nvarchar](200) NOT NULL, + [ResourceValue] [nvarchar](MAX) NOT NULL + ) + + INSERT INTO #LocaleStringResourceTmp (LanguageId, ResourceName, ResourceValue) + SELECT @LanguageId, nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') + FROM @XmlPackage.nodes('//Language/LocaleResource') AS R(nref) + + DECLARE @ResourceName nvarchar(200) + DECLARE @ResourceValue nvarchar(MAX) + DECLARE cur_localeresource CURSOR FOR + SELECT LanguageId, ResourceName, ResourceValue + FROM #LocaleStringResourceTmp + OPEN cur_localeresource + FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue + WHILE @@FETCH_STATUS = 0 + BEGIN + IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageId=@LanguageId AND ResourceName=@ResourceName)) + BEGIN + IF (@UpdateExistingResources = 1) + BEGIN + UPDATE [LocaleStringResource] + SET [ResourceValue]=@ResourceValue + WHERE LanguageId=@LanguageId AND ResourceName=@ResourceName + END + END + ELSE + BEGIN + INSERT INTO [LocaleStringResource] + ( + [LanguageId], + [ResourceName], + [ResourceValue] + ) + VALUES + ( + @LanguageId, + @ResourceName, + @ResourceValue + ) + END + + + FETCH NEXT FROM cur_localeresource INTO @LanguageId, @ResourceName, @ResourceValue + END + CLOSE cur_localeresource + DEALLOCATE cur_localeresource + + DROP TABLE #LocaleStringResourceTmp + END +END +GO + + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.skippaymentInfostepforredirectionpaymentmethods') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'paymentsettings.skippaymentInfostepforredirectionpaymentmethods', N'False', 0) +END +GO + + +--updated some indexes (required for case sensitive SQL Server collations) +IF EXISTS (SELECT 1 from sys.indexes WHERE [NAME]=N'IX_NewsletterSubscription_Email_StoreId' and object_id=object_id(N'[dbo].[NewsLetterSubscription]')) +BEGIN + DROP INDEX [IX_NewsletterSubscription_Email_StoreId] ON [NewsLetterSubscription] +END +GO +CREATE NONCLUSTERED INDEX [IX_NewsletterSubscription_Email_StoreId] ON [NewsLetterSubscription] ([Email] ASC, [StoreId] ASC) +GO + +IF EXISTS (SELECT 1 from sys.indexes WHERE [NAME]=N'IX_Product_ShowOnHomepage' and object_id=object_id(N'[dbo].[Product]')) +BEGIN + DROP INDEX [IX_Product_ShowOnHomepage] ON [Product] +END +GO +CREATE NONCLUSTERED INDEX [IX_Product_ShowOnHomepage] ON [Product] ([ShowOnHomePage] ASC) +GO + +--update a stored procedure +IF EXISTS ( + SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'[DeleteGuests]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1) +DROP PROCEDURE [DeleteGuests] +GO +CREATE PROCEDURE [dbo].[DeleteGuests] +( + @OnlyWithoutShoppingCart bit = 1, + @CreatedFromUtc datetime, + @CreatedToUtc datetime, + @TotalRecordsDeleted int = null OUTPUT +) +AS +BEGIN + CREATE TABLE #tmp_guests (CustomerId int) + + INSERT #tmp_guests (CustomerId) + SELECT [Id] FROM [Customer] c with (NOLOCK) + WHERE + --created from + ((@CreatedFromUtc is null) OR (c.[CreatedOnUtc] > @CreatedFromUtc)) + AND + --created to + ((@CreatedToUtc is null) OR (c.[CreatedOnUtc] < @CreatedToUtc)) + AND + --shopping cart items + ((@OnlyWithoutShoppingCart=0) OR (NOT EXISTS(SELECT 1 FROM [ShoppingCartItem] sci with (NOLOCK) inner join [Customer] with (NOLOCK) on sci.[CustomerId]=c.[Id]))) + AND + --guests only + (EXISTS(SELECT 1 FROM [Customer_CustomerRole_Mapping] ccrm with (NOLOCK) inner join [Customer] with (NOLOCK) on ccrm.[Customer_Id]=c.[Id] inner join [CustomerRole] cr with (NOLOCK) on cr.[Id]=ccrm.[CustomerRole_Id] WHERE cr.[SystemName] = N'Guests')) + AND + --no orders + (NOT EXISTS(SELECT 1 FROM [Order] o with (NOLOCK) inner join [Customer] with (NOLOCK) on o.[CustomerId]=c.[Id])) + AND + --no blog comments + (NOT EXISTS(SELECT 1 FROM [BlogComment] bc with (NOLOCK) inner join [Customer] with (NOLOCK) on bc.[CustomerId]=c.[Id])) + AND + --no news comments + (NOT EXISTS(SELECT 1 FROM [NewsComment] nc with (NOLOCK)inner join [Customer] with (NOLOCK) on nc.[CustomerId]=c.[Id])) + AND + --no product reviews + (NOT EXISTS(SELECT 1 FROM [ProductReview] pr with (NOLOCK) inner join [Customer] with (NOLOCK) on pr.[CustomerId]=c.[Id])) + AND + --no product reviews helpfulness + (NOT EXISTS(SELECT 1 FROM [ProductReviewHelpfulness] prh with (NOLOCK) inner join [Customer] with (NOLOCK) on prh.[CustomerId]=c.[Id])) + AND + --no poll voting + (NOT EXISTS(SELECT 1 FROM [PollVotingRecord] pvr with (NOLOCK) inner join [Customer] with (NOLOCK) on pvr.[CustomerId]=c.[Id])) + AND + --no forum topics + (NOT EXISTS(SELECT 1 FROM [Forums_Topic] ft with (NOLOCK) inner join [Customer] with (NOLOCK) on ft.[CustomerId]=c.[Id])) + AND + --no forum posts + (NOT EXISTS(SELECT 1 FROM [Forums_Post] fp with (NOLOCK) inner join [Customer] with (NOLOCK) on fp.[CustomerId]=c.[Id])) + AND + --no system accounts + (c.IsSystemAccount = 0) + + --delete guests + DELETE [Customer] + WHERE [Id] IN (SELECT [CustomerId] FROM #tmp_guests) + + --delete attributes + DELETE [GenericAttribute] + WHERE ([EntityId] IN (SELECT [CustomerId] FROM #tmp_guests)) + AND + ([KeyGroup] = N'Customer') + + --total records + SELECT @TotalRecordsDeleted = COUNT(1) FROM #tmp_guests + + DROP TABLE #tmp_guests +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.sitemapcustomurls') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'commonsettings.sitemapcustomurls', N'', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shoppingcartsettings.cartssharedbetweenstores') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'shoppingcartsettings.cartssharedbetweenstores', N'False', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='EmailToRevalidate') +BEGIN + ALTER TABLE [Customer] + ADD [EmailToRevalidate] nvarchar(1000) NULL +END +GO + +-- new message template + IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Customer.EmailRevalidationMessage') + BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'Customer.EmailRevalidationMessage', NULL, N'%Store.Name%. Email validation.', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%!' + @NewLine + '
    ' + @NewLine + 'To validate your new email address click here .' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + '%Store.Name%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) + END + GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsHistoryEntryId') +BEGIN + ALTER TABLE [Order] + ADD [RewardPointsHistoryEntryId] int NULL +END +GO + +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsWereAdded') +BEGIN + --column RewardPointsWereAdded was replaced with RewardPointsHistoryEntryId + --ensure that the new column value is not null to specify that reward points were added (earned) to an order + EXEC(' + UPDATE [Order] + SET [RewardPointsHistoryEntryId] = 0 + WHERE [RewardPointsWereAdded] = 1') +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='RewardPointsWereAdded') +BEGIN + ALTER TABLE [Order] DROP COLUMN [RewardPointsWereAdded] +END +GO + + +--update plugin locales (renamed) +UPDATE [LocaleStringResource] +SET [ResourceName] = REPLACE([ResourceName], 'Plugins.Feed.Froogle.','Plugins.Feed.GoogleShopping.') +WHERE [ResourceName] like 'Plugins.Feed.Froogle.%' +GO + +--update settings +UPDATE [Setting] +SET [Name] = REPLACE([Name], 'frooglesettings.','googlesShoppingsettings.') +WHERE [Name] like 'frooglesettings.%' +GO + + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductTemplate]') and NAME='IgnoredProductTypes') +BEGIN + ALTER TABLE [ProductTemplate] + ADD [IgnoredProductTypes] nvarchar(MAX) NULL +END +GO + +UPDATE [ProductTemplate] +SET [IgnoredProductTypes] = '10' +WHERE [ViewPath] = N'ProductTemplate.Simple' +GO + +UPDATE [ProductTemplate] +SET [IgnoredProductTypes] = '5' +WHERE [ViewPath] = N'ProductTemplate.Grouped' +GO + + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ReturnRequest]') and NAME='UploadedFileId') +BEGIN + ALTER TABLE [ReturnRequest] + ADD [UploadedFileId] int NULL +END +GO + +UPDATE [ReturnRequest] +SET [UploadedFileId] = 0 +WHERE [UploadedFileId] IS NULL +GO + +ALTER TABLE [ReturnRequest] ALTER COLUMN [UploadedFileId] int NOT NULL +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.returnrequestsallowfiles') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.returnrequestsallowfiles', N'False', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.returnrequestsfilemaximumsize') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.returnrequestsfilemaximumsize', N'2048', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[ProductReview]') and NAME='ReplyText') +BEGIN + ALTER TABLE [ProductReview] + ADD [ReplyText] nvarchar(MAX) NULL +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[BlogComment]') and NAME='StoreId') +BEGIN + ALTER TABLE [dbo].[BlogComment] + ADD [StoreId] int NULL +END +GO + +DECLARE @DefaultStoreId int +SET @DefaultStoreId = (SELECT TOP (1) Id FROM [dbo].[Store]); +--set default value to store column +UPDATE [dbo].[BlogComment] +SET StoreId = @DefaultStoreId +WHERE StoreId IS NULL +GO + +ALTER TABLE [dbo].[BlogComment] ALTER COLUMN [StoreId] int NOT NULL +GO + +IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'BlogComment_Store' AND parent_object_id = Object_id('BlogComment') AND Objectproperty(object_id, N'IsForeignKey') = 1) +ALTER TABLE [dbo].[BlogComment] +DROP CONSTRAINT BlogComment_Store +GO + +ALTER TABLE [dbo].[BlogComment] WITH CHECK ADD CONSTRAINT [BlogComment_Store] FOREIGN KEY([StoreId]) +REFERENCES [dbo].[Store] ([Id]) +ON DELETE CASCADE +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'blogsettings.showblogcommentsperstore') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'blogsettings.showblogcommentsperstore', N'False', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[NewsComment]') and NAME='StoreId') +BEGIN + ALTER TABLE [dbo].[NewsComment] + ADD [StoreId] int NULL +END +GO + +DECLARE @DefaultStoreId int +SET @DefaultStoreId = (SELECT TOP (1) Id FROM [dbo].[Store]); +--set default value to store column +UPDATE [dbo].[NewsComment] +SET StoreId = @DefaultStoreId +WHERE StoreId IS NULL +GO + +ALTER TABLE [dbo].[NewsComment] ALTER COLUMN [StoreId] int NOT NULL +GO + +IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'NewsComment_Store' AND parent_object_id = Object_id('NewsComment') AND Objectproperty(object_id, N'IsForeignKey') = 1) +ALTER TABLE [dbo].[NewsComment] +DROP CONSTRAINT NewsComment_Store +GO + +ALTER TABLE [dbo].[NewsComment] WITH CHECK ADD CONSTRAINT [NewsComment_Store] FOREIGN KEY([StoreId]) +REFERENCES [dbo].[Store] ([Id]) +ON DELETE CASCADE +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'newssettings.shownewscommentsperstore') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'newssettings.shownewscommentsperstore', N'False', 0) +END +GO + + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Vendor]') and NAME='AddressId') +BEGIN + ALTER TABLE [Vendor] + ADD [AddressId] int NULL +END +GO + +UPDATE [Vendor] +SET [AddressId] = 0 +WHERE [AddressId] IS NULL +GO + +ALTER TABLE [Vendor] ALTER COLUMN [AddressId] int NOT NULL +GO + + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.failedpasswordallowedattempts') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'customersettings.failedpasswordallowedattempts', N'0', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.failedpasswordlockoutminutes') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'customersettings.failedpasswordlockoutminutes', N'30', 0) +END +GO + + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='FailedLoginAttempts') +BEGIN + ALTER TABLE [Customer] + ADD [FailedLoginAttempts] int NULL +END +GO + +UPDATE [Customer] +SET [FailedLoginAttempts] = 0 +WHERE [FailedLoginAttempts] IS NULL +GO + +ALTER TABLE [Customer] ALTER COLUMN [FailedLoginAttempts] int NOT NULL +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='CannotLoginUntilDateUtc') +BEGIN + ALTER TABLE [Customer] + ADD [CannotLoginUntilDateUtc] datetime NULL +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'fixedorbycountrystateziptaxsettings.countrystatezipenabled') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'fixedorbycountrystateziptaxsettings.countrystatezipenabled', N'False', 0) +END +GO + +--rename settings +UPDATE [Setting] +SET [Name] = N'tax.taxprovider.fixedorbycountrystatezip.taxcategoryid' + SUBSTRING(name, 40, len(name)) +WHERE [Name] like N'tax.taxprovider.fixedrate.taxcategoryid%' +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='RegisteredInStoreId') +BEGIN + ALTER TABLE [dbo].[Customer] + ADD [RegisteredInStoreId] int NULL +END +GO + +declare @DefaultStoreId int; +if ((select count(id) from [dbo].[Store]) = 1) +set @DefaultStoreId = (select top(1) id from [dbo].[Store]) +else +set @DefaultStoreId = 0; +--set default value to store column +UPDATE [dbo].[Customer] set [RegisteredInStoreId] = @DefaultStoreId where [RegisteredInStoreId] is NULL + +ALTER TABLE [dbo].[Customer] ALTER COLUMN [RegisteredInStoreId] int NOT NULL +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shippingsettings.considerassociatedproductsdimensions') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'shippingsettings.considerassociatedproductsdimensions', N'True', 0) +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.bbcodeeditoropenlinksinnewwindow') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'commonsettings.bbcodeeditoropenlinksinnewwindow', N'false', 0) +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.cancelrecurringpaymentsafterfailedpayment') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'paymentsettings.cancelrecurringpaymentsafterfailedpayment', N'False', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[RecurringPayment]') and NAME='LastPaymentFailed') +BEGIN + ALTER TABLE [RecurringPayment] + ADD [LastPaymentFailed] bit NULL +END +GO + +UPDATE [RecurringPayment] +SET [LastPaymentFailed] = 0 +WHERE [LastPaymentFailed] IS NULL +GO + +ALTER TABLE [RecurringPayment] ALTER COLUMN [LastPaymentFailed] bit NOT NULL +GO + +-- new message template +IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'RecurringPaymentCancelled.CustomerNotification') +BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'RecurringPaymentCancelled.CustomerNotification', NULL, N'%Store.Name%. Recurring payment cancelled', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%,' + @NewLine + '
    ' + @NewLine + '%if (%RecurringPayment.CancelAfterFailedPayment%) It appears your credit card didn''t go through for this recurring payment (%Order.OrderURLForCustomer%)' + @NewLine + '
    ' + @NewLine + 'So your subscription has been canceled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) The recurring payment ID=%RecurringPayment.ID% was cancelled. endif%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) +END +GO + +-- new message template +IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'RecurringPaymentFailed.CustomerNotification') +BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'RecurringPaymentFailed.CustomerNotification', NULL, N'%Store.Name%. Last recurring payment failed', N'

    ' + @NewLine + '%Store.Name%' + @NewLine + '
    ' + @NewLine + '
    ' + @NewLine + 'Hello %Customer.FullName%,' + @NewLine + '
    ' + @NewLine + 'It appears your credit card didn''t go through for this recurring payment (%Order.OrderURLForCustomer%)' + @NewLine + '
    %if (%RecurringPayment.RecurringPaymentType% == "Manual") ' + @NewLine + 'You can recharge balance and manually retry payment or cancel it on the order history page. endif% %if (%RecurringPayment.RecurringPaymentType% == "Automatic") ' + @NewLine + 'You can recharge balance and wait, we will try to make the payment again, or you can cancel it on the order history page. endif%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'shoppingcartsettings.renderproductattributeprices') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'shoppingcartsettings.renderproductattributeprices', N'True', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'rewardpointssettings.earnedrewardpointsaretaxable') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'rewardpointssettings.earnedrewardpointsaretaxable', N'False', 0) +END +GO +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = lower(N'rewardpointssettings.AwardPointsIncludeShipping')) +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (lower(N'rewardpointssettings.AwardPointsIncludeShipping'), N'True', 0) +END +GO +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = lower(N'rewardpointssettings.AwardPointsIncludePaymentMethodAdditionalFee')) +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (lower(N'rewardpointssettings.AwardPointsIncludePaymentMethodAdditionalFee'), N'True', 0) +END +GO +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = lower(N'rewardpointssettings.AwardPointsExcludeGiftCard')) +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (lower(N'rewardpointssettings.AwardPointsExcludeGiftCard'), N'True', 0) +END +GO +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = lower(N'rewardpointssettings.AwardPointsExcludePurchasedRewardPoints')) +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (lower(N'rewardpointssettings.AwardPointsExcludePurchasedRewardPoints'), N'True', 0) +END +GO +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = lower(N'rewardpointssettings.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints')) +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (lower(N'rewardpointssettings.EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints'), N'False', 0) +END +GO +--add a new columns +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[RewardPointsHistory]') and NAME='PointsPurchased') +BEGIN + ALTER TABLE [RewardPointsHistory] + ADD PointsPurchased [int] NULL, PointsBalancePurchased [int] NULL, [PurchasedWithOrderItemId] [int] NULL, [UsedAmountPurchased] decimal(18,4) NULL +END +GO + +--create fk +IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[RewardPoints_PurchasedWithOrderItem]') AND parent_object_id = OBJECT_ID(N'[dbo].[RewardPointsHistory]')) +ALTER TABLE [dbo].[RewardPointsHistory] WITH CHECK ADD CONSTRAINT [RewardPoints_PurchasedWithOrderItem] FOREIGN KEY([PurchasedWithOrderItemId]) +REFERENCES [dbo].[OrderItem] ([Id]) +GO + +--enable it +IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[RewardPoints_PurchasedWithOrderItem]') AND parent_object_id = OBJECT_ID(N'[dbo].[RewardPointsHistory]')) +ALTER TABLE [dbo].[RewardPointsHistory] CHECK CONSTRAINT [RewardPoints_PurchasedWithOrderItem] +GO + +--init new col. +UPDATE [RewardPointsHistory] +SET [PointsPurchased] = 0, [UsedAmountPurchased] = 0, [PointsBalancePurchased] = 0 +WHERE [PointsPurchased] IS NULL +GO + +ALTER TABLE [RewardPointsHistory] ALTER COLUMN [PointsPurchased] [int] NOT NULL +GO +ALTER TABLE [RewardPointsHistory] ALTER COLUMN [UsedAmountPurchased] decimal(18,4) NOT NULL +GO + +IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RewardPointsHistory]') AND name = N'IX_RewardPointsHistory_Customer') +CREATE NONCLUSTERED INDEX [IX_RewardPointsHistory_Customer] ON [dbo].[RewardPointsHistory] +( + [CustomerId] ASC +) +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='IsRewardPoints') +BEGIN + ALTER TABLE [Product] + ADD [IsRewardPoints] [bit] NULL, + OverriddenRPExchangeRate decimal(18,4) NULL +END +GO + +--init new col. +UPDATE [Product] +SET [IsRewardPoints] = 0 +WHERE [IsRewardPoints] IS NULL +GO + +ALTER TABLE [Product] ALTER COLUMN [IsRewardPoints] [bit] NOT NULL +GO + +--add a new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Product]') and NAME='ExcludeFromRewardPoints') +BEGIN + ALTER TABLE [Product] + ADD ExcludeFromRewardPoints [bit] NULL +END +GO + +--init new col. +UPDATE [Product] +SET [ExcludeFromRewardPoints] = 0 +WHERE [ExcludeFromRewardPoints] IS NULL +GO + +ALTER TABLE [Product] ALTER COLUMN [ExcludeFromRewardPoints] [bit] NOT NULL +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Order]') and NAME='CustomOrderNumber') +BEGIN + ALTER TABLE [Order] + ADD [CustomOrderNumber] nvarchar(MAX) NULL +END +GO + +UPDATE [Order] +SET [CustomOrderNumber] = [id] +WHERE [CustomOrderNumber] IS NULL +GO + +ALTER TABLE [Order] ALTER COLUMN [CustomOrderNumber] nvarchar(MAX) NOT NULL +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.customordernumbermask') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.customordernumbermask', N'{ID}', 0) +END +GO + + --new table +IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CustomerPassword]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1) +BEGIN + CREATE TABLE [dbo].[CustomerPassword] + ( + [Id] int IDENTITY(1,1) NOT NULL, + [CustomerId] int NOT NULL, + [Password] NVARCHAR (MAX) NULL, + [PasswordFormatId] INT NOT NULL, + [PasswordSalt] NVARCHAR (MAX) NULL, + [CreatedOnUtc] datetime NOT NULL + PRIMARY KEY CLUSTERED + ( + [Id] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ) +END +GO + +IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'CustomerPassword_Customer' AND parent_object_id = Object_id('CustomerPassword') AND Objectproperty(object_id, N'IsForeignKey') = 1) +BEGIN + ALTER TABLE [dbo].CustomerPassword + DROP CONSTRAINT CustomerPassword_Customer +END +GO + +ALTER TABLE [dbo].[CustomerPassword] WITH CHECK ADD CONSTRAINT [CustomerPassword_Customer] FOREIGN KEY([CustomerId]) +REFERENCES [dbo].[Customer] ([Id]) +ON DELETE CASCADE +GO + +--move customer passwords into a new table +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and (NAME='Password' or NAME='PasswordFormatId' or NAME='PasswordSalt')) +BEGIN + EXEC(' + INSERT INTO [dbo].[CustomerPassword]([CustomerId], [Password], [PasswordFormatId], [PasswordSalt], [CreatedOnUtc]) + SELECT [Id], [Password], [PasswordFormatId], [PasswordSalt], [CreatedOnUtc] + FROM [dbo].[Customer]') +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='Password') +BEGIN + ALTER TABLE [Customer] DROP COLUMN [Password] +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='PasswordFormatId') +BEGIN + ALTER TABLE [Customer] DROP COLUMN [PasswordFormatId] +END +GO + +--drop column +IF EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='PasswordSalt') +BEGIN + ALTER TABLE [Customer] DROP COLUMN [PasswordSalt] +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.unduplicatedpasswordsnumber') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'customersettings.unduplicatedpasswordsnumber', N'4', 0) +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'customersettings.passwordlifetime') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'customersettings.passwordlifetime', N'90', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[CustomerRole]') and NAME='EnablePasswordLifetime') +BEGIN + ALTER TABLE [CustomerRole] + ADD [EnablePasswordLifetime] bit NULL +END +GO + +UPDATE [CustomerRole] +SET [EnablePasswordLifetime] = 0 +WHERE [EnablePasswordLifetime] IS NULL +GO + +ALTER TABLE [CustomerRole] ALTER COLUMN [EnablePasswordLifetime] bit NOT NULL +GO + +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'AddCustomerRewardPoints') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'AddCustomerRewardPoints', N'Add customer reward points', N'true') +END +GO +--new activity types +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'EditCustomerRewardPoints') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'EditCustomerRewardPoints', N'Edit customer reward points', N'true') +END +GO +GO + + +-- new message template + IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Service.ContactUs') + BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'Service.ContactUs', NULL, N'%Store.Name%. Contact us', N'

    ' + @NewLine + '%ContactUs.Body%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) + END + GO + +-- new message template + IF NOT EXISTS (SELECT 1 FROM [dbo].[MessageTemplate] WHERE [Name] = N'Service.ContactVendor') + BEGIN + DECLARE @NewLine AS CHAR(2) = CHAR(13) + CHAR(10) + INSERT [dbo].[MessageTemplate] ([Name], [BccEmailAddresses], [Subject], [Body], [IsActive], [AttachedDownloadId], [EmailAccountId], [LimitedToStores], [DelayPeriodId]) + VALUES (N'Service.ContactVendor', NULL, N'%Store.Name%. Contact us', N'

    ' + @NewLine + '%ContactUs.Body%' + @NewLine + '

    ' + @NewLine, 1, 0, 0, 0, 0) + END + GO + + --now vendors have "Manage product reviews" permission +IF EXISTS ( + SELECT 1 + FROM [dbo].[PermissionRecord] + WHERE [SystemName] = N'ManageProductReviews') +BEGIN + DECLARE @PermissionRecordId INT + SET @PermissionRecordId = (SELECT [Id] FROM [dbo].[PermissionRecord] WHERE [SystemName] = N'ManageProductReviews') + + --add it to vendor role by default + DECLARE @VendorCustomerRoleId int + SELECT @VendorCustomerRoleId = Id + FROM [CustomerRole] + WHERE IsSystemRole=1 and [SystemName] = N'Vendors' + + IF NOT EXISTS ( + SELECT 1 + FROM [dbo].[PermissionRecord_Role_Mapping] + WHERE [PermissionRecord_Id] = @PermissionRecordId AND [CustomerRole_Id] = @VendorCustomerRoleId) + BEGIN + INSERT [dbo].[PermissionRecord_Role_Mapping] ([PermissionRecord_Id], [CustomerRole_Id]) + VALUES (@PermissionRecordId, @VendorCustomerRoleId) + END +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'taxsettings.taxbasedonpickuppointaddress') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'taxsettings.taxbasedonpickuppointaddress', N'False', 0) +END +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.exportwithproducts') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.exportwithproducts', N'True', 0) +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='InteractionTypeId') +BEGIN + ALTER TABLE [DiscountRequirement] + ADD [InteractionTypeId] int NULL +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='ParentId') +BEGIN + ALTER TABLE [DiscountRequirement] + ADD [ParentId] int NULL +END +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[DiscountRequirement]') and NAME='IsGroup') +BEGIN + ALTER TABLE [DiscountRequirement] + ADD [IsGroup] bit NULL +END +GO + +UPDATE [DiscountRequirement] +SET [IsGroup] = 0 +WHERE [IsGroup] IS NULL +GO + +ALTER TABLE [DiscountRequirement] ALTER COLUMN [IsGroup] bit NOT NULL +GO + +--add default requirement group for existing requirements +DECLARE cursor_defaultGroup CURSOR FOR SELECT [DiscountId] FROM [DiscountRequirement] +DECLARE @discountId int + +OPEN cursor_defaultGroup +FETCH NEXT FROM cursor_defaultGroup INTO @discountId +WHILE @@FETCH_STATUS = 0 +BEGIN + IF NOT EXISTS (SELECT 1 FROM [DiscountRequirement] WHERE [DiscountId] = @discountId AND [ParentId] IS NULL AND [IsGroup] = 1) + BEGIN + INSERT INTO [DiscountRequirement] + ([DiscountId], [DiscountRequirementRuleSystemName], [InteractionTypeId], [ParentId], [IsGroup]) + VALUES + (@discountId, 'Default requirement group', 0, NULL, 1); + + DECLARE @requirementId int = (SELECT SCOPE_IDENTITY()); + + UPDATE [DiscountRequirement] + SET [ParentId] = @requirementId, [InteractionTypeId] = NULL + WHERE [DiscountId] = @discountId AND [Id] <> @requirementId + END + FETCH NEXT FROM cursor_defaultGroup INTO @discountId +END + +CLOSE cursor_defaultGroup +DEALLOCATE cursor_defaultGroup +GO + + +--new task +IF NOT EXISTS (SELECT 1 FROM [ScheduleTask] WHERE [Name] = N'Assign invoice ident') +INSERT INTO ScheduleTask + (Name, Seconds, Type, Enabled, StopOnError) +VALUES (N'Assign invoice ident', 60, N'Nop.Services.Orders.AssignInvoiceIdentTask, Nop.Services', 0, 0) +GO + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.assigninvoiceidentfromtask') + BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'ordersettings.assigninvoiceidentfromtask', 'False', 0) + END +GO +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'adminareasettings.useisodatetimeconverterinjson') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'adminareasettings.useisodatetimeconverterinjson', N'True', 0) +END +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportCategories') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'ImportCategories', N'Categories were imported', N'True') +END +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportManufacturers') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'ImportManufacturers', N'Manufacturers were imported', N'True') +END +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportProducts') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'ImportProducts', N'Products were imported', N'True') +END +GO + +--new activity type +IF NOT EXISTS (SELECT 1 FROM [ActivityLogType] WHERE [SystemKeyword] = N'ImportStates') +BEGIN + INSERT [ActivityLogType] ([SystemKeyword], [Name], [Enabled]) + VALUES (N'ImportStates', N'States and provinces were imported', N'True') +END +GO + +--update DownloadActivationType according to the new enum value +UPDATE [Product] +SET [DownloadActivationTypeId] = 0 +WHERE [DownloadActivationTypeId] = 1 +GO + +--new column +IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Currency]') and NAME='RoundingTypeId') +BEGIN + ALTER TABLE [Currency] + ADD [RoundingTypeId] INT NULL +END +GO + +UPDATE [Currency] +SET [RoundingTypeId] = 0 +WHERE [RoundingTypeId] IS NULL +GO + +-- Rounding with 1.00 intervals (The system used in Sweden since 30 September 2010. https://en.wikipedia.org/wiki/Cash_rounding#Rounding_with_1.00_intervals) +UPDATE [Currency] +SET [RoundingTypeId] = 60 +WHERE [CurrencyCode] = 'SEK' +GO + +ALTER TABLE [Currency] ALTER COLUMN [RoundingTypeId] INT NOT NULL +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'adminareasettings.usericheditorinmessagetemplates') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'adminareasettings.usericheditorinmessagetemplates', N'False', 0) +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'mediasettings.azurecachecontrolheader') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'mediasettings.azurecachecontrolheader', N'', 0) +END +GO + +--add stored procedure for getting category tree +IF EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[nop_padright]') AND xtype IN (N'FN', N'IF', N'TF')) +DROP FUNCTION [dbo].[nop_padright] +GO + +CREATE FUNCTION [dbo].[nop_padright] +( + @source INT, + @symbol NVARCHAR(MAX), + @length INT +) +RETURNS NVARCHAR(MAX) +AS +BEGIN + RETURN RIGHT(REPLICATE(@symbol, @length)+ RTRIM(CAST(@source AS NVARCHAR(MAX))), @length) +END +GO + +IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[CategoryLoadAllPaged]') AND OBJECTPROPERTY(object_id, N'IsProcedure') = 1) +DROP PROCEDURE [dbo].[CategoryLoadAllPaged] +GO + +CREATE PROCEDURE [dbo].[CategoryLoadAllPaged] +( + @ShowHidden BIT = 0, + @Name NVARCHAR(MAX) = NULL, + @StoreId INT = 0, + @CustomerRoleIds NVARCHAR(MAX) = NULL, + @PageIndex INT = 0, + @PageSize INT = 2147483644, + @TotalRecords INT = NULL OUTPUT +) +AS +BEGIN + SET NOCOUNT ON + + --filter by customer role IDs (access control list) + SET @CustomerRoleIds = ISNULL(@CustomerRoleIds, '') + CREATE TABLE #FilteredCustomerRoleIds + ( + CustomerRoleId INT NOT NULL + ) + INSERT INTO #FilteredCustomerRoleIds (CustomerRoleId) + SELECT CAST(data AS INT) FROM [nop_splitstring_to_table](@CustomerRoleIds, ',') + DECLARE @FilteredCustomerRoleIdsCount INT = (SELECT COUNT(1) FROM #FilteredCustomerRoleIds) + + --ordered categories + CREATE TABLE #OrderedCategoryIds + ( + [Id] int IDENTITY (1, 1) NOT NULL, + [CategoryId] int NOT NULL + ) + + --get max length of DisplayOrder and Id columns (used for padding Order column) + DECLARE @lengthId INT = (SELECT LEN(MAX(Id)) FROM [Category]) + DECLARE @lengthOrder INT = (SELECT LEN(MAX(DisplayOrder)) FROM [Category]) + + --get category tree + ;WITH [CategoryTree] + AS (SELECT [Category].[Id] AS [Id], dbo.[nop_padright] ([Category].[DisplayOrder], '0', @lengthOrder) + '-' + dbo.[nop_padright] ([Category].[Id], '0', @lengthId) AS [Order] + FROM [Category] WHERE [Category].[ParentCategoryId] = 0 + UNION ALL + SELECT [Category].[Id] AS [Id], [CategoryTree].[Order] + '|' + dbo.[nop_padright] ([Category].[DisplayOrder], '0', @lengthOrder) + '-' + dbo.[nop_padright] ([Category].[Id], '0', @lengthId) AS [Order] + FROM [Category] + INNER JOIN [CategoryTree] ON [CategoryTree].[Id] = [Category].[ParentCategoryId]) + INSERT INTO #OrderedCategoryIds ([CategoryId]) + SELECT [Category].[Id] + FROM [CategoryTree] + RIGHT JOIN [Category] ON [CategoryTree].[Id] = [Category].[Id] + + --filter results + WHERE [Category].[Deleted] = 0 + AND (@ShowHidden = 1 OR [Category].[Published] = 1) + AND (@Name IS NULL OR @Name = '' OR [Category].[Name] LIKE ('%' + @Name + '%')) + AND (@ShowHidden = 1 OR @FilteredCustomerRoleIdsCount = 0 OR [Category].[SubjectToAcl] = 0 + OR EXISTS (SELECT 1 FROM #FilteredCustomerRoleIds [roles] WHERE [roles].[CustomerRoleId] IN + (SELECT [acl].[CustomerRoleId] FROM [AclRecord] acl WITH (NOLOCK) WHERE [acl].[EntityId] = [Category].[Id] AND [acl].[EntityName] = 'Category') + ) + ) + AND (@StoreId = 0 OR [Category].[LimitedToStores] = 0 + OR EXISTS (SELECT 1 FROM [StoreMapping] sm WITH (NOLOCK) + WHERE [sm].[EntityId] = [Category].[Id] AND [sm].[EntityName] = 'Category' AND [sm].[StoreId] = @StoreId + ) + ) + ORDER BY ISNULL([CategoryTree].[Order], 1) + + --total records + SET @TotalRecords = @@ROWCOUNT + + --paging + SELECT [Category].* FROM #OrderedCategoryIds AS [Result] INNER JOIN [Category] ON [Result].[CategoryId] = [Category].[Id] + WHERE ([Result].[Id] > @PageSize * @PageIndex AND [Result].[Id] <= @PageSize * (@PageIndex + 1)) + ORDER BY [Result].[Id] + + DROP TABLE #FilteredCustomerRoleIds + DROP TABLE #OrderedCategoryIds +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.usestoredprocedureforloadingcategories') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'commonsettings.usestoredprocedureforloadingcategories', N'False', 0) +END +GO + + --new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'storeinformationsettings.displayminiprofilerforadminonly') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'storeinformationsettings.displayminiprofilerforadminonly', N'False', 0) +END +GO + +--indicating whether to display default menu items +DECLARE @displayMenuItems bit +IF NOT EXISTS (SELECT 1 FROM [Category] where ParentCategoryId=0 and Deleted=0 and Published=1) + set @displayMenuItems = N'True' +ELSE + set @displayMenuItems = N'False' + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayhomepagemenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displayhomepagemenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaynewproductsmenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displaynewproductsmenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayproductsearchmenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displayproductsearchmenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaycustomerinfomenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displaycustomerinfomenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayblogmenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displayblogmenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displayforumsmenuitem') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displayforumsmenuitem', @displayMenuItems, 0) +END + +--new setting +IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'displaydefaultmenuitemsettings.displaycontactusmenuitem ') +BEGIN + INSERT [Setting] ([Name], [Value], [StoreId]) + VALUES (N'displaydefaultmenuitemsettings.displaycontactusmenuitem ', @displayMenuItems, 0) +END GO \ No newline at end of file